Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #21  
Old 08-14-2014, 07:15 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,165
Hwona is on a distinguished road
Default

This is really wierd. I'm using v.1.3.3 but I don't have this... wait, what host are you huys using?
__________________
Reply With Quote
  #22  
Old 08-14-2014, 07:17 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 44,521
Missy Master is an unknown quantity at this point
Default

I'm on Skyehosting.
Reply With Quote
  #23  
Old 08-14-2014, 07:43 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,165
Hwona is on a distinguished road
Default

Do you both have the same host? I don't know...
@Abronsyth
You can borrow my site's inventory file! It works... for now. :L
__________________
Reply With Quote
  #24  
Old 08-14-2014, 08:07 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 111,689
Abronsyth is on a distinguished road
Default

I use iPage, so it's not to do with the host.

Wallie, thanks! If you can either post it or PM the code to me I can at least compare them and see if there's something different in there.
Reply With Quote
  #25  
Old 08-14-2014, 08:08 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 44,521
Missy Master is an unknown quantity at this point
Default

I wonder if that would help me with mine? If I dont get this fixed, I'm going to have to shut down Simmland :(

No one can use items now.
Reply With Quote
  #26  
Old 08-14-2014, 08:12 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,165
Hwona is on a distinguished road
Default

Here you go(not I may have customized a thing or two in there):
PHP Code:
<?php

class InventoryController extends AppController{

    const 
PARAM "confirm";
    private 
$view;
    private 
$subController;

    public function 
__construct(){
        
parent::__construct("member");
    }
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        
$document->setTitle($mysidia->lang->inventory);
        
        
$inventory = new Inventory($mysidia->user);
        if(
$inventory->gettotal() == 0) throw new InvalidIDException($mysidia->lang->inventory_empty);
        
$inventory->display();
    }
            
    public function 
uses(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        
$item = new PrivateItem($mysidia->input->post("itemname"), $mysidia->user->username);   
        if(
$item->iid == 0) throw new InvalidIDException("It appears that you do not have this item in your inventory.");
        
        if(
$mysidia->input->post("aid")){
            if(!
$item->checktarget($mysidia->input->post("aid")) or $mysidia->input->post("validation") != "valid"){
                
$document->setTitle($mysidia->lang->use_title);
                
$document->addLangvar($mysidia->lang->use_fail);
            }
            elseif(!
$item->randomchance()){
                
$item->remove();
                
$document->setTitle($mysidia->lang->badluck);
                
$document->addLangvar($mysidia->lang->effect);
            }
            else 
$item->apply($mysidia->input->post("aid")); 
            return;            
        }
        
        
$document->setTitle($mysidia->lang->select_title);
        
$document->addLangvar($mysidia->lang->select);
        
        
$chooseFrom = new Form("chooseform""uses""post");
        
$adoptable = new DropdownList("aid");
        
        
$ids $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}'")->fetchAll(PDO::FETCH_COLUMN);    
        
$names $mysidia->db->select("owned_adoptables", array("name"), "owner = '{$mysidia->user->username}'")->fetchAll(PDO::FETCH_COLUMN);
        
$adoptable->add(new Option("None Selected""none"));
        
$adoptable->fill($names$ids);
        
        
$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 $mysidia->frame->getDocument();
        
$item = new PrivateItem($mysidia->input->post("itemname"), $mysidia->user->username);   
        if(
$item->iid == 0) throw new InvalidIDException("It appears that you do not have this item in your inventory.");
        
        if(!
$mysidia->input->post("quantity")){
            
$document->setTitle($mysidia->lang->global_action_title);
            
$document->addLangvar($mysidia->lang->sell_empty);
        }
        elseif(
$item->quantity $mysidia->input->post("quantity")){
            
$document->setTitle($mysidia->lang->global_action_title);
            
$document->addLangvar($mysidia->lang->sell_quantity);
        }
        else{
            
$item->sell($mysidia->input->post("quantity"));
            
$document->setTitle("Transaction Completed");
            
$document->addLangvar("{$mysidia->lang->sell}{$mysidia->input->post("quantity")} {$mysidia->input->post("itemname")} {$mysidia->lang->sell2}");
        }    
    }
    
    public function 
toss(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        
$item = new PrivateItem($mysidia->input->post("itemname"), $mysidia->user->username);  
        if(
$item->iid == 0) throw new InvalidIDException("It appears that you do not have this item in your inventory.");
        
        if(
$mysidia->input->get("confirm")){
            
$item->toss();
            
$document->setTitle($mysidia->lang->global_action_complete);
            
$document->addLangvar($mysidia->lang->toss.$mysidia->input->post("itemname").$mysidia->lang->toss2);
            return;
        }
        
        
$warning "Are you sure you wish to toss {$mysidia->input->post("itemname")}?<br> 
                    It will be permanently removed from your inventory, and this action cannot be undone!<br>"
;
        
$document->setTitle("Confirm your Action");
        
$document->add(new Comment($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);            
    }
}
?>
@Annatar
That would be horrible! You have a lot of custom stuff there no?
__________________

Last edited by Hwona; 08-14-2014 at 08:16 PM.
Reply With Quote
  #27  
Old 08-14-2014, 08:14 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 44,521
Missy Master is an unknown quantity at this point
Default

I have a lot I've worked on for it, yes, and I have three more sites I really want to open, and use our great code here!

But no use of items means I cant do anything at all right now.

Ah, thanks for posting that!



The strangest thing is, sell works, and toss .. it's just use.

Last edited by Missy Master; 08-14-2014 at 08:16 PM.
Reply With Quote
  #28  
Old 08-14-2014, 08:22 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,165
Hwona is on a distinguished road
Default

Wait....
I'm going to make a quick list of differences that I can find...
1. only the use function "returns" anything
2. only the use function works with adoptables
__________________
Reply With Quote
  #29  
Old 08-14-2014, 08:25 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 44,521
Missy Master is an unknown quantity at this point
Default

Aww it wont work for me, hehehe.
Reply With Quote
  #30  
Old 08-14-2014, 08:37 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,165
Hwona is on a distinguished road
Default

Quote:
Originally Posted by Annatar View Post
Aww it wont work for me, hehehe.
I believe it's because you're using v.1.3.4. :L
__________________
Reply With Quote
Reply

Thread Tools
Display Modes

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 Item Shop Mod(s): NPC + Item Display + Tooltips Kyttias Mys v1.3.x Mods 55 06-19-2020 11:21 AM
Buy X of Item A to receive X of Item B AndromedaKerova Suggestions and Feature Requests 0 11-09-2014 08:17 PM
Using Item Error Abronsyth Questions and Supports 3 03-29-2013 06:43 PM
Parse error: syntax error, unexpected T_ELSE in /home/.nyles/ Saphira Questions and Supports 11 05-26-2009 11:45 AM


All times are GMT -5. The time now is 02:33 PM.

Currently Active Users: 455 (0 members and 455 guests)
Threads: 4,080, Posts: 32,024, 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