Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #41  
Old 03-18-2016, 01:39 PM
Ittermat's Avatar
Ittermat Ittermat is offline
The awesomesauce
 
Join Date: Feb 2016
Location: in front of my laptop
Posts: 272
Gender: Female
Credits: 38,648
Ittermat is on a distinguished road
Default

hey maybe you can help me..Im trying to use this mod- but everytime I try I keep getting errors... Im putting everything in as you say to...but it still wont work...Im not sure whats wrong.. maybe you can help?

this is my Itemshop.php code.

Quote:
<?php

use Resource\Collection\LinkedList;

class Itemshop extends Model{

public $sid;
public $category;
public $shopname;
public $shoptype;
public $description;
public $imageurl;
public $status;
public $restriction;
public $salestax;
public $items;
protected $total = 0;

public function __construct($shopname){
// Fetch the database info into object property
$mysidia = Registry::get("mysidia");
$row = $mysidia->db->select("shops", array(), "shopname ='{$shopname}'")->fetchObject();
if(!is_object($row)) throw new Exception("Invalid Shopname specified");

// loop through the anonymous object created to assign properties
foreach($row as $key => $val){
$this->$key = $val;
}
$this->items = $this->getitemnames();
$this->total = (is_array($this->items))?count($this->items):0;
}

public function getcategory(){
$mysidia = Registry::get("mysidia");
$stmt = $mysidia->db->select("shops", array(), "category ='{$this->category}'");
$cate_exist = ($row = $stmt->fetchObject())?TRUE:FALSE;
return $cate_exist;
}

public function getshop(){
$mysidia = Registry::get("mysidia");
if(empty($this->shopname)) $shop_exist = FALSE;
else{
$stmt = $mysidia->db->select("shops", array(), "shopname ='{$this->shopname}'");
$shop_exist = ($row = $stmt->fetchObject())?TRUE:FALSE;
}
return $shop_exist;
}

public function getitemnames(){
if(!$this->items){
$mysidia = Registry::get("mysidia");
$stmt = $mysidia->db->select("items", array("itemname"), "shop ='{$this->shopname}'");
$items = array();

while($item = $stmt->fetchColumn()){
$items[] = $item;
}
return $items;
}
else return $this->items;
}

public function gettotal(){
return $this->total;
}
public function display(){
$mysidia = Registry::get("mysidia");
$document = $mysidia->frame->getDocument();
$document->addLangvar($mysidia->lang->select_item);

if($this->gettotal() == 0){
$document->addLangvar($mysidia->lang->empty);
return FALSE;
}

# Choose the NPC image based on the name of the shop
switch ($this->shopname) {
case "Bookstore":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/646f59544e20a3ba433292c85fa7cd68.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Arent books wonderful??"; break;
case 2: $npc_text = "Nothing like traveling to a whole new world with a book!"; break;
case 3: $npc_text = "Welcome to {$this->shopname}!"; break;
case 4: $npc_text = "Off to see the wizard?"; break;
case 5: $npc_text = "Once I was covered in books, and I thought I was in heaven!"; break;
case 6: $npc_text = "Promise you'll tell me how it ends!!"; }
break;
case "Caratrises candy":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/2d0485231a263b02740ce1ea57b926d1.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "All candy is made by me!"; break;
case 2: $npc_text = "Cavities Guaranteed!"; break;
case 3: $npc_text = "Welcome to {$this->shopname}!"; break;
case 4: $npc_text = "Okay...but im not going to pay for your dental bills."; break;
case 5: $npc_text = "If you come back on a holiday I'll have special candy for you!"; break;
case 6: $npc_text = "I wont tell if you dont tell."; }
break;
case "Catari Necessities":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/fc29ee5d45ec433a1faf8fc9ff75c408.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "My favorite toy is the Teaser!"; break;
case 2: $npc_text = "Dont forget to get your Catari some treats!"; break;
case 3: $npc_text = "Welcome to {$this->shopname}!"; break;
case 4: $npc_text = "You're right! I should stock some live mice."; break;
case 5: $npc_text = "Catari are pretty easy to please"; break;
case 6: $npc_text = "Have you been to the Shrine yet? If so Tell Eyre I said hi!"; }
break;

case "Catfucious stall":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/36a5e23916c437d13755cef4e28a95ee.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Please browse as long as you need my child."; break;
case 2: $npc_text = "The first step to tranquility is not paying attention to anyone but yourself."; break;
case 3: $npc_text = "I am not here to make money my child..I am here to spread love."; break;
case 4: $npc_text = "I hope that I can help you improve your life"; break;
case 5: $npc_text = "Dont ask for too much...only want what is needed"; break;
case 6: $npc_text = "There is more to life than money...Happiness is golden"; }
break;

case "Delilahs drinks":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/24e509b16d94ee2becfa134eb335cbac.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Hi there Sweetie! I make everything myself!"; break;
case 2: $npc_text = "I'll sell holiday exclusive items, so please check back during a holiday!"; break;
case 3: $npc_text = "All you need is love!"; break;
case 4: $npc_text = "You're so adorable! Thank you for coming in!"; break;
case 5: $npc_text = "Even if I dont have something you want now- I might later!"; break;
case 6: $npc_text = "Yes, Habibi is my Brother...why do you ask?"; }
break;


case "Eyres treasury":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/a01f278da98365994ea4c1dd4e0d8212.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Im not giving my things up that easily..."; break;
case 2: $npc_text = "You know if you arent going to buy anything? you can go away..."; break;
case 3: $npc_text = "I am NOT Cute"; break;
case 4: $npc_text = "............."; break;
case 5: $npc_text = "I dont do trades...I want cold hard cash!"; break;
case 6: $npc_text = "Havent you left yet?"; }
break;

case "Feesh Fundamentals":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/9a50351b442506040eac15e7bf0589aa.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Blub blub...blub,,"; break;
case 2: $npc_text = "Blub..."; break;
case 3: $npc_text = "Blubb blub,,,"; break;
case 4: $npc_text = "............."; break;
case 5: $npc_text = "Blub..."; break;
case 6: $npc_text = "*sound of bubbles* "; }
break;

case "Glidera Goodies":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/1f3616733a28da078a709e93f3a2914a.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Glidera are wonderfully loyal pets!"; break;
case 2: $npc_text = "Cinnamon here has been with me for a really long time!"; break;
case 3: $npc_text = "Welcome to {$this->shopname}!; break;
case 4: $npc_text = "Have you tried giving your Glidera a mealworm yet?"; break;
case 5: $npc_text = "I hope you find everything you're looking for"; break;
case 6: $npc_text = "If you need help just let me know! "; }
break;

case "Habibis Holiday":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/5f47dde45fffa266ba4b26594034bc4a.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "I love holidays.."; break;
case 2: $npc_text = "I hope you're having a good time.."; break;
case 3: $npc_text = "Welcome to {$this->shopname}!; break;
case 4: $npc_text = "Its a lovely day isnt it?"; break;
case 5: $npc_text = "I hope you find everything you're looking for"; break;
case 6: $npc_text = "If you need help just let me know! "; }
break;

case "Hounda essentials":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/7e50a54e67ea07f33274ddbd55f4c681.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "I love Toys!"; break;
case 2: $npc_text = "I hope you're having a good time.."; break;
case 3: $npc_text = "Welcome to {$this->shopname}!; break;
case 4: $npc_text = "Please dont throw the ball...I need to stay behind the counter!"; break;
case 5: $npc_text = "I hope you find everything you're looking for"; break;
case 6: $npc_text = "If you need help just let me know! "; }
break;

case "Supermarket":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/5306b4da3d1c288c80f4ff1709e3580a.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Yea...what you're looking for is around here somewhere..."; break;
case 2: $npc_text = "Thats nice....."; break;
case 3: $npc_text = "Welcome to the {$this->shopname}...; break;
case 4: $npc_text = "With this price gun, I am invincible..."; break;
case 5: $npc_text = "I hope you find everything you're looking for...I guess.."; break;
case 6: $npc_text = "If you need help just let me know..or dont, because I dont care..."; }
break;

case "Camerons toys":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/29ebda897900480c07a5e1a9bc1c1994.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Hewwo!.."; break;
case 2: $npc_text = "Mummy says Im the bestest at selling toys!....."; break;
case 3: $npc_text = "Welcome to {$this->shopname}!; break;
case 4: $npc_text = "Can we be Fwiends?..."; break;
case 5: $npc_text = "If you need help, tell me!!.."; break;
case 6: $npc_text = "Pwease come back again!..."; }
break;

case "Caseys Crafts":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/bef6477cc0e7308db3ea9a88f841c956.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Hello! What are you going to make today?"; break;
case 2: $npc_text = "My son Cameron is next door!"; break;
case 3: $npc_text = "Welcome to {$this->shopname}!; break;
case 4: $npc_text = "I cant wait to see what you make!"; break;
case 5: $npc_text = "If you need help, Just let me know!!"; break;
case 6: $npc_text = "Please come back again!"; }
break;


case "Pet paints":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/e053750b18df3ab752793c365bfd61ec.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Hello! We have a bunch of cool colors!"; break;
case 2: $npc_text = "When im not here, I'm usually painting!"; break;
case 3: $npc_text = "Welcome to {$this->shopname}!; break;
case 4: $npc_text = "I cant wait to see your new pet!"; break;
case 5: $npc_text = "If you need help, Just let me know!!"; break;
case 6: $npc_text = "Please come back again!"; }
break;

case "Premium pet paints":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/e053750b18df3ab752793c365bfd61ec.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Hello! We have a bunch of cool colors!"; break;
case 2: $npc_text = "These Paints are only for the specialist of members!!"; break;
case 3: $npc_text = "Welcome to {$this->shopname}!; break;
case 4: $npc_text = "I cant wait to see your new pet!"; break;
case 5: $npc_text = "If you need help, Just let me know!!"; break;
case 6: $npc_text = "Please come back again!"; }
break;

case "Potters Potions":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/6bdb9f184918c39f01114ca8736331eb.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "Oh wait....those two things arent supposed to be mixed..."; break;
case 2: $npc_text = "I make everything here myself."; break;
case 3: $npc_text = "Welcome to {$this->shopname}!; break;
case 4: $npc_text = "Dont be alarmed...its only smoke."; break;
case 5: $npc_text = "If you need help, Just let me know.."; break;
case 6: $npc_text = "Please come back again!"; }
break;

case "Account upgrades":
$npc_img = "http://atrocity.mysidiahost.com/picuploads/png/1dd6406902d48dafb229ca6d74ed3365.png";
#Based on the random number, sets a quote for $npc_text
$num = Rand (1,6);
switch ($num) {
case 1: $npc_text = "If you want to change something on your account this is the place to go!."; break;
case 2: $npc_text = "Only premium members can be here!."; break;
case 3: $npc_text = "Welcome to {$this->shopname}!; break;
case 4: $npc_text = "I know we dont have much...."; break;
case 5: $npc_text = "If you need help, Just let me know.."; break;
case 6: $npc_text = "Please come back again!"; }
break;
default;
$npc_img = "http://placekitten.com/g/200/500";
$npc_text = "Welcome to {$this->shopname}!";
break;
}

# let's begin rendering the page
$document->add(new Comment("
<style>
.s_top {
overflow:hidden;
display: block;
}
.sc_npc_text{
width: 300px;
float: left;
position: relative;
height: 70px;
padding: 15px;
margin: 10px;
margin-top: 180px;
font-family: 'Trebuchet MS', Helvetica, sans-serif;
overflow: auto;
}
.sc_npc_img{
width: 40%;
float: left;
}

.sc_item {
display: inline-table;
padding: 5px;
text-align: center;
font-family: 'Trebuchet MS', Helvetica, sans-serif;
font-size: 14px;
margin-bottom: 3px;
}
.s_panel {
border-radius: 2px;
border: 1px solid #CCC;
background-color: #FBFDF2;
}
</style>
<!-- START Container for Text and NPC -->
<div class='s_top s_container'>
<div class='s_panel sc_npc_text'>{$npc_text}</div>
<div class='sc_npc_img'><img src='{$npc_img}' height='300'></div>
</div>
<!-- END Container for Text and NPC -->
<!-- START Container for Items -->
<div class='s_container'>
", FALSE));

# Now render each item the store has
foreach($this->items as $stockitem){
$item = $this->getitem($stockitem);

#descriptions of the item functions
switch ($item->function) {
case "Click1": $usage = "<br/><b>use:</b> Feed a pet to give them {$item->value} EXP."; break;
case "Click2": $usage = "<br/><b>use:</b> Feed a pet to set their EXP to {$item->value}."; break;
case "Click3": $usage = "<br/><b>use:</b> Resets EXP earned today to 0."; break;
case "Level1": $usage = "<br/><b>use:</b> Raises the Level of your pet by {$item->value}."; break;
case "Level2": $usage = "<br/><b>use:</b> Sets the Level of your pet to {$item->value}."; break;
case "Level3": $usage = "<br/><b>use:</b> Makes your pet Level 0 again!"; break;
case "Gender": $usage = "<br/><b>use:</b> Swaps the gender of your pet to its opposite!"; break;
default;
$usage = "";
break;
}

# Now let's render each item icon, name, price and tooltip
$document->add(new Comment("
<div class=\"s_panel sc_item\">
<img rel=\"tooltip\" title=\"{$item->description} <em>{$usage}</em>\" src=\"{$item->imageurl}\"/><br/>
<b>{$item->itemname}</b>
<br/>
{$item->price} {$mysidia->settings->cost}<br/>
", FALSE));


# Building the Buy form
$buyForm = new FormBuilder("buyform", "../purchase/{$mysidia->input->get("shop")}", "post");
$buyForm->setLineBreak(FALSE);
$buyForm->buildPasswordField("hidden", "action", "purchase")
->buildPasswordField("hidden", "itemname", $item->itemname)
->buildPasswordField("hidden", "shopname", $shop->shopname)
->buildPasswordField("hidden", "shoptype", "itemshop")
->buildPasswordField("hidden", "salestax", $shop->salestax);
$quantity = new TextField("quantity", "1");
$quantity->setSize(3);
$quantity->setMaxLength(3);
$quantity->setLineBreak(FALSE);
$buy = new Button("Buy", "buy", "buy");
$buy->setLineBreak(FALSE);
$buyForm->add($quantity);
$buyForm->add($buy);

# Actually adding in the Quantity field Buy button now
$document->add($buyForm);

# Now we finish off the item by closing its div
$document->add(new Comment("</div>", FALSE));
}

# And that's a wrap
$document->add(new Comment("</div><!-- END Container for Items -->", FALSE));

} #END display function


public function getitem($itemname){
return new StockItem($itemname);
}

public function purchase(Item $item){
$mysidia = Registry::get("mysidia");
if($item->owner != $mysidia->user->username) Throw new NoPermissionException('Something is very very wrong, please contact an admin asap.');
else{
$item->quantity = $mysidia->input->post("quantity");
$cost = $item->getcost($this->salestax, $item->quantity);
$moneyleft = $mysidia->user->money - $cost;
if($moneyleft >= 0 and $item->quantity > 0){
$purchase = $item->append($item->quantity, $item->owner);
$mysidia->db->update("users", array("money" => $moneyleft), "username = '{$item->owner}'");
$status = TRUE;
}
else throw new InvalidActionException($mysidia->lang->money);
}
return $status;
}

public function rent($item, $period){

}

public function execute($action){

}

protected function save($field, $value){
$mysidia = Registry::get("mysidia");
$mysidia->db->update("shops", array($field => $value), "sid='{$this->sid}' and shoptype = 'adoptshop'");
}
}
?>
Please and thank you
Reply With Quote
  #42  
Old 03-18-2016, 02:41 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,664
Kyttias is on a distinguished road
Default

Looks like you've copy pasted your error into nearly every single shop. Make sure there is a closing " in case 3 of every shop. Specifically lines 176, 189, 202, 215, 228, 241, 255, 268, 281, and 294.

Please check out the free text editor Notepad++! It comes with syntax highlighting meant for coding so it's EASY to spot syntax errors because the colors coded system of how it displays lines will jam up. Lines are also numbered.

All I literally had to do was copy paste your code into my text editor and the errors were all just sitting there, very easy to spot. Definitely look into getting a program to program in if you're going to be modding your site so heavily.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #43  
Old 03-18-2016, 02:58 PM
Ittermat's Avatar
Ittermat Ittermat is offline
The awesomesauce
 
Join Date: Feb 2016
Location: in front of my laptop
Posts: 272
Gender: Female
Credits: 38,648
Ittermat is on a distinguished road
Default

thanks kyttias... stupid mistakes I know...but i dont see the mistakes since I dont get the coding...and i do have notepad ++ it just doesnt actually help me much XD (Again probably because of my lack of knowledge on the subject) Thanks though...now i know what the issue was.. XD
Reply With Quote
  #44  
Old 04-03-2016, 12:16 PM
LUC1G07CH1's Avatar
LUC1G07CH1 LUC1G07CH1 is offline
Member
 
Join Date: Mar 2016
Location: Too distant for telling, but it's HUEBR
Posts: 158
Gender: Unknown/Other
Credits: 31,841
LUC1G07CH1 is on a distinguished road
Send a message via AIM to LUC1G07CH1 Send a message via Yahoo to LUC1G07CH1
Default

Edit: Nevermind! I have writen the shop name wrong!

Last edited by LUC1G07CH1; 04-03-2016 at 12:28 PM.
Reply With Quote
  #45  
Old 06-06-2016, 04:09 PM
Ittermat's Avatar
Ittermat Ittermat is offline
The awesomesauce
 
Join Date: Feb 2016
Location: in front of my laptop
Posts: 272
Gender: Female
Credits: 38,648
Ittermat is on a distinguished road
Default

How would I make it so the tooltips appear on a specific spot on the map where the hotspot is located? At the moment Im using them as Titles for buildings on an image map, but the tool tip appears at the top of the image- even though I have the Rel=tooltip and Title=building in the code for each one.
Reply With Quote
  #46  
Old 06-13-2016, 05:28 PM
Suzanne Suzanne is offline
Member
 
Join Date: Jun 2016
Posts: 11
Gender: Female
Credits: 1,539
Suzanne is on a distinguished road
Default

Thank you for sharing this. Installed and works great.

If anyone knows how to use this on the adoption page and the my adopts page please share :-)

Thanks,
Suzanne
Reply With Quote
  #47  
Old 09-03-2016, 07:03 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 22,779
parayna is on a distinguished road
Default

Glad I found this again for installing.. XD Do you have plans to make a similar adopt shop? That would be awesome 0w0
Reply With Quote
  #48  
Old 09-05-2016, 02:32 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,664
Kyttias is on a distinguished road
Default

My retail job is eating a lot of my time. I'm not actually sure when I'll be around to work on stuff like this.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #49  
Old 09-05-2016, 03:00 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 22,779
parayna is on a distinguished road
Default

Oh, that's totally fine ^_^ I think a job is definitely more important! XD

(Oh, and I dunno if anyone is interested but I started a new course at college and I'm doing IT and one of the parts we're doing is coding and we're doing PHP, server side scripting, CSS, HTML and Javascript! I'm so excited! I can actually learn stuff in an actual teaching environment! Why didn't I think of this before?! XD I didn't actually know that we were doing coding when I chose IT, I just like computers... XD Yeah, sorry XD)
Reply With Quote
  #50  
Old 01-14-2017, 12:45 PM
ffsharriet ffsharriet is offline
Member
 
Join Date: Jan 2017
Posts: 22
Gender: Female
Credits: 4,808
ffsharriet is on a distinguished road
Default Help

I've seemed to have messed up the code.

It's saying:

Parse error: syntax error, unexpected '$document' (T_VARIABLE), expecting function (T_FUNCTION) in /home/equiland/public_html/view/inventoryview.php on line 34


Here is the code:

public function index(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$document->setTitle($mysidia->lang->inventory);

$inventory = $this->getField("inventory");
$inventoryTable = new TableBuilder("inventory");
$inventoryTable->setAlign(new Align("center", "middle"));
$inventoryTable->buildHeaders("Image", "Category", "Name", "Description", "Quantity", "Use", "Sell", "Toss");
$inventoryTable->setHelper(new ItemTableHelper);

$iids = $inventory->getiids();
for($i = 0; $i < $iids->length(); $i++){
$item = $inventory->getitem($iids[$i]);
$cells = new LinkedList;
$cells->add(new TCell($inventory->getitemimage($item->imageurl)));
$cells->add(new TCell($item->category));
$cells->add(new TCell($item->itemname));
$cells->add(new TCell($item->description));
$cells->add(new TCell($item->quantity));
$cells->add(new TCell($inventoryTable->getHelper()->getUseForm($item)));
$cells->add(new TCell($inventoryTable->getHelper()->getSellForm($item)));
$cells->add(new TCell($inventoryTable->getHelper()->getTossForm($item)));
$inventoryTable->buildRow($cells);
}
$document->add($inventoryTable);
}
$document->add($inventoryTable);
}
public function uses(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
if($mysidia->input->post("aid")){
$message = (string)$this->getField("message");
$document->setTitle($mysidia->lang->global_action_complete);
$document->addLangvar($message);
return;
}

$petMap = $this->getField("petMap");
$document->setTitle($mysidia->lang->select_title);
$document->addLangvar($mysidia->lang->select);
$chooseFrom = new Form("chooseform", "uses", "post");

$adoptable = new DropdownList("aid");
$adoptable->add(new Option("None Selected", "none"));
if($petMap->size() > 0){
$iterator = $petMap->iterator();
while($iterator->hasNext()){
$adopt = $iterator->nextEntry();
$adoptable->add(new Option($adopt->getValue(), $adopt->getKey()));
}
}
$chooseFrom->add($adoptable);

$chooseFrom->add(new PasswordField("hidden", "itemname", $mysidia->input->post("itemname")));
$chooseFrom->add(new PasswordField("hidden", "validation", "valid"));
$chooseFrom->add(new Button("Choose this Adopt", "submit", "submit"));
$document->add($chooseFrom);
}

public function sell(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$document->setTitle($this->lang->global_transaction_complete);
$document->addLangvar("{$this->lang->sell}{$mysidia->input->post("quantity")} {$mysidia->input->post("itemname")} {$this->lang->sell2}");
}

public function toss(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
if($mysidia->input->get("confirm")){
$document->setTitle($this->lang->global_action_complete);
$document->addLangvar("{$this->lang->toss}{$mysidia->input->post("itemname")}{$this->lang->toss2}");
return;
}

$document->setTitle($this->lang->toss_confirm);
$document->addLangvar($this->lang->toss_warning);

$confirmForm = new FormBuilder("confirmform", "toss/confirm", "post");
$confirmForm->buildPasswordField("hidden", "action", "toss")
->buildPasswordField("hidden", "itemname", $mysidia->input->post("itemname"))
->buildButton("Please Toss", "confirm", "confirm");
$document->add($confirmForm);
}
}
?>
Reply With Quote
Reply

Tags
item display, item shop, npc, shop, shopkeeper


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mys v1.3.4 Shop Listing Display Kyttias Mys v1.3.x Mods 13 06-13-2016 03:31 PM
Item Bug? tahbikat Questions and Supports 4 11-24-2015 06:28 PM
Changing Shop and Item Display? Abronsyth Questions and Supports 2 12-16-2014 04:25 PM
Buy X of Item A to receive X of Item B AndromedaKerova Suggestions and Feature Requests 0 11-09-2014 09:17 PM


All times are GMT -5. The time now is 04:39 AM.

Currently Active Users: 1331 (0 members and 1331 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636