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
  #1  
Old 01-14-2017, 11:45 AM
ffsharriet ffsharriet is offline
Member
 
Join Date: Jan 2017
Posts: 22
Gender: Female
Credits: 5,204
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 02:31 PM
Item Bug? tahbikat Questions and Supports 4 11-24-2015 05:28 PM
Changing Shop and Item Display? Abronsyth Questions and Supports 2 12-16-2014 03:25 PM
Buy X of Item A to receive X of Item B AndromedaKerova Suggestions and Feature Requests 0 11-09-2014 08:17 PM


All times are GMT -5. The time now is 12:55 PM.

Currently Active Users: 3509 (0 members and 3509 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636