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
  #31  
Old 02-15-2016, 11:46 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 109,998
Kyttias is on a distinguished road
Default

Themes don't even modify core files, so I don't see how the two are related.

Please paste your entire inventoryview.php file. And, if you can, please link me to the site so I can see the problem first hand and confirm you have jQuery installed once and only once and in the correct location. I hope we get this figured out. ^^;
__________________
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
  #32  
Old 02-15-2016, 12:01 PM
Corsair's Avatar
Corsair Corsair is offline
Member
 
Join Date: Jan 2012
Posts: 128
Gender: Female
Credits: 13,269
Corsair is on a distinguished road
Exclamation

Thanks for being so penitent. I am still trying to get a handle on this php thing.

http://monstari.mysidiahost.com/index
PHP Code:
<?php

use Resource\Collection\LinkedList;

class 
InventoryView extends View{
    
     public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle($mysidia->lang->inventory);
        
$document->addLangvar("You may manage these items as you like, or go to the alchemy page to make your own items: <br>");    
        
$document->add(new Link("inventory/alchemy""Go to Alchemy Laboratory!"));    
        
$document->add(new Comment("<br><br>")); 
        
        
$inventory $this->getField("inventory");
        
        
        
$iids $inventory->getiids();
        for(
$i 0$i $iids->length(); $i++){
            
$item $inventory->getitem($iids[$i]);
                 
            
# 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;
            }  
# End item function descriptions        

            
            # Rendering items now
            
$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> Own &times;{$item->quantity}<br/>"FALSE));

            
# If item is consumable, add use button
            
if($item->consumable == "yes") {
                
$useForm = new FormBuilder("useform""inventory/uses""post");
                
$useForm->setLineBreak(FALSE);
                
$useForm->buildPasswordField("hidden""action""uses")
                        ->
buildPasswordField("hidden""itemname"$item->itemname)
                        ->
buildButton("Use""use""use");
                
$document->add($useForm);
            }

           
# Add sellback button so long as the item is not a key item
            
$sellback $item->price 2;
            
$document->add(new Comment("<hr>{$sellback} {$mysidia->settings->cost} Each "FALSE));
            if(
$item->function != "Key") {
                
$sellForm = new FormBuilder("sellform""inventory/sell""post");
                
$sellForm->setLineBreak(FALSE);
                
$sellForm->buildPasswordField("hidden""action""sell")
                         ->
buildPasswordField("hidden""itemname"$item->itemname);
                
                
$quantity = new TextField("quantity");
                
$quantity->setSize(3);
                
$quantity->setMaxLength(3);
                
$quantity->setLineBreak(FALSE);

                
$sell = new Button("Sell""sell""sell");
                
$sell->setLineBreak(FALSE);

                
$sellForm->add($quantity);
                
$sellForm->add($sell);
            }    
            
$document->add($sellForm);
            
$document->add(new Comment("</div>"FALSE));   

        } 
# END item for loop

    
# END index function  
            
    
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);            
    }
public function 
alchemy(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
        if(
$mysidia->input->post("iid") and $mysidia->input->post("iid2")){
            
$alchemy $this->getField("alchemy");
            
$newitem $alchemy->getNewItem()->itemname;
            
$document->setTitle($this->lang->alchemy_success);
            
$document->addLangvar($this->lang->alchemy_newitem.$newitem.$this->lang->alchemy_newitem2);    
            return;        
        }

        
$document->setTitle($this->lang->alchemy_title);
        
$document->addLangvar($this->lang->alchemy);
        
$itemMap $this->getField("itemMap");
        
$settings $this->getField("settings");
        
$alchemyFrom = new Form("alchemyform""alchemy""post");
        
$alchemyFrom->add(new Comment("<b>Cost of performing Alchemy: {$settings->cost} {$mysidia->settings->cost}</b><br>"));
        
        
$alchemyFrom->add(new Comment($mysidia->lang->alchemy_choose));        
        
$items = new DropdownList("iid");
        
$items->add(new Option("None Selected""none"));
        if(
$itemMap->size() > 0){
            
$iterator $itemMap->iterator();
            while(
$iterator->hasNext()){
                
$item $iterator->nextEntry();
                
$items->add(new Option($item->getValue(), $item->getKey()));
            }
        }        
        
$alchemyFrom->add($items);

        
$alchemyFrom->add(new Comment($mysidia->lang->alchemy_choose2));        
        
$items2 = new DropdownList("iid2");
        
$items2->add(new Option("None Selected""none"));
        if(
$itemMap->size() > 0){
            
$iterator $itemMap->iterator();
            while(
$iterator->hasNext()){
                
$item2 $iterator->nextEntry();
                
$items2->add(new Option($item2->getValue(), $item2->getKey()));
            }
        }        
        
$alchemyFrom->add($items2);        
        
$alchemyFrom->add(new Button("Let's mix the items now!""submit""submit"));
        
$document->add($alchemyFrom);        
    }
}
?>
Reply With Quote
  #33  
Old 02-15-2016, 12:17 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 109,998
Kyttias is on a distinguished road
Default

Mkay, I copy-pasted in your exact file and I have no errors at all? There is no reason you should be having an error on line 72 and not much sooner. Do you have the error without the Alchemy mod installed (I've never used it)? I doubt it would interfere, but it's worth checking...

Can you try moving
HTML Code:
<!-- Scripts -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 
<script src="/js/tooltip.js"></script>
<script src="/js/tabs.js"></script>
<script>
$(function() { $("#profile").organicTabs(); });
</script>
<!-- Script end -->
into your header instead of your footer for me? Have you tried this yet? Does it make a difference for the tooltips?
__________________
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
  #34  
Old 02-15-2016, 01:10 PM
Corsair's Avatar
Corsair Corsair is offline
Member
 
Join Date: Jan 2012
Posts: 128
Gender: Female
Credits: 13,269
Corsair is on a distinguished road
Default

Ok so weird thing. I removed everything and can still sell key items so even if I removed your mod I still can sell key items. whelp

Edit:

Ok so I did a fresh install and followed the installation. Installed this mod and got the same error.

Last edited by Corsair; 02-15-2016 at 03:10 PM.
Reply With Quote
  #35  
Old 02-15-2016, 07:18 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 109,998
Kyttias is on a distinguished road
Default

It's quite bizarre that two other people have this mod installed on their site, other than myself, just fine and never experienced fatal errors. Yet, no matter how much I search, I can't find any helpful reference to a similar error that they would have fixed elsewhere. My classes/class_guicontainer.php and classes/class_guicomponent.php files identical to the default install!

EDIT: I can actually recreate your error... if you followed the instructions wrong, you replaced your entire view/inventoryview.php file instead of replacing only the index() function as instructed. Try replacing your entire file with this (or go back and follow the instructions more carefully):
  Spoiler: replace inventoryview.php 
PHP Code:
<?php

use Resource\Collection\LinkedList;

class 
InventoryView extends View{
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle($mysidia->lang->inventory);
        
        
$inventory $this->getField("inventory");
        
        
$document->add(new Comment(" <style>
                .sc_item {
                  display: inline-table;
                  padding: 5px;
                  text-align: center;
                  font-family: 'Trebuchet MS', Helvetica, sans-serif;
                  font-size: 14px;
                  margin-bottom: 3px;
                  width: 120px;
                }
                .s_panel {
                  border-radius: 2px;
                  border: 1px solid #CCC;
                  background-color: #FBFDF2;  
                }
            </style> "
FALSE));
        
$iids $inventory->getiids();
        for(
$i 0$i $iids->length(); $i++){
            
$item $inventory->getitem($iids[$i]);
                 
            
# 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;
            }  
# End item function descriptions        

            
            # Rendering items now
            
$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> Own &times;{$item->quantity}<br/>"FALSE));

            
# If item is consumable, add use button
            
if($item->consumable == "yes") {
                
$useForm = new FormBuilder("useform""inventory/uses""post");
                
$useForm->setLineBreak(FALSE);
                
$useForm->buildPasswordField("hidden""action""uses")
                        ->
buildPasswordField("hidden""itemname"$item->itemname)
                        ->
buildButton("Use""use""use");
                
$document->add($useForm);
            }

            
# Add sellback button so long as the item is not a key item
            
$sellback $item->price 2;
            
$document->add(new Comment("<hr>{$sellback} {$mysidia->settings->cost} Each "FALSE));
            if(
$item->category != "Key Items") {
                
$sellForm = new FormBuilder("sellform""inventory/sell""post");
                
$sellForm->setLineBreak(FALSE);
                
$sellForm->buildPasswordField("hidden""action""sell")
                         ->
buildPasswordField("hidden""itemname"$item->itemname);
                
                
$quantity = new TextField("quantity");
                
$quantity->setSize(3);
                
$quantity->setMaxLength(3);
                
$quantity->setLineBreak(FALSE);

                
$sell = new Button("Sell""sell""sell");
                
$sell->setLineBreak(FALSE);

                
$sellForm->add($quantity);
                
$sellForm->add($sell);
                            
$document->add($sellForm);
            }    

            
$document->add(new Comment("</div>"FALSE));   

        } 
# END item for loop

    
# END index function  
    
    
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);            
    }
}
?>


Anyway, yeah, the Key item thing seems to be a bug or afterthought with the baseline Mysidia framework... by the sounds of it. In classes/class_itemtablehelper.php, the category "Key Items" is referenced twice, rather than the function "Key". I literally just imitated the existing file to render the form, so I copied over the same error.

However, if I do create an item with the category "Key Items" on a default install, it renders as expected on a default install of Mysidia (you can never sell key items). I cannot actually recreate your problem on a default install whatsoever.

  Spoiler: screenshot of default install with key items working as intended 


So, this DOES come down to being a bug with my mod, AND I managed to fix it. The fix is in the file above. (I moved $document->add($sellForm); inside the if statement, because that makes more sense, anyway. The variable should have still never been built to display, anyway... but apparently it was?)
__________________
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.

Last edited by Kyttias; 02-15-2016 at 08:15 PM.
Reply With Quote
  #36  
Old 02-15-2016, 07:38 PM
Corsair's Avatar
Corsair Corsair is offline
Member
 
Join Date: Jan 2012
Posts: 128
Gender: Female
Credits: 13,269
Corsair is on a distinguished road
Default

I'm not sure either. I installed a fresh new install and before adding anything I tested it and it came up a error. I installed it as the guide said. Other then that everything else with the mode is working. Until I can figure this out I'll have to warn people not to sell their key items.

As for tooltips they are working now. I'm not sure what happened but that much is cleared up. I must have installed something that broke it.
Reply With Quote
  #37  
Old 02-15-2016, 07:46 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 109,998
Kyttias is on a distinguished road
Default

I made some edits to my last post that should clear everything up. I'm glad the tooltips are working!

edit: And made one last edit to my previous post @ 8:53 EST. Thanks for catching the Key Item thing, it apparently was my fault! I hadn't created a Key Item yet to test, and all I had to do was move one line only slightly. ^^;;;
__________________
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.

Last edited by Kyttias; 02-15-2016 at 07:54 PM.
Reply With Quote
  #38  
Old 02-15-2016, 08:09 PM
Corsair's Avatar
Corsair Corsair is offline
Member
 
Join Date: Jan 2012
Posts: 128
Gender: Female
Credits: 13,269
Corsair is on a distinguished road
Default

I can't thank you enough. I need to make sure to install mods more carefully. Everything seems to be working now.
Reply With Quote
  #39  
Old 02-15-2016, 09:12 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 109,998
Kyttias is on a distinguished road
Default

I'm glad everything got sorted out. Maybe it'll help someone in the future!
__________________
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
  #40  
Old 03-10-2016, 02:03 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 96,136
SilverDragonTears is on a distinguished road
Default

i cant see the NPC part on my site.
__________________

Check out SilvaTales
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 02:39 PM.

Currently Active Users: 825 (0 members and 825 guests)
Threads: 4,081, Posts: 32,029, 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