Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Community Board > Feedback and Suggestions

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-30-2014, 01:06 PM
kitty08's Avatar
kitty08 kitty08 is offline
Member
 
Join Date: Sep 2011
Posts: 42
Gender: Female
Credits: 5,565
kitty08 is on a distinguished road
Default Help !! Shops not appearing é.è

Invalid ID Specified

Currently there is no active shop available, please come back later.
Hello,
This is showing...
Altough I did 3 shops... It was the same from the beggining even when I did not touch the code so I don't understand... Is this because of shops categories? I typed pets in it. Thank you a lot :D
__________________



NABARUDIS.COM
Reply With Quote
  #2  
Old 12-30-2014, 01:26 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,255
IntoRain is on a distinguished road
Default

Can you post your shop.php and shopview.php files? (just the index() function for both)
__________________


asp.net stole my soul.
Reply With Quote
  #3  
Old 12-31-2014, 09:49 AM
kitty08's Avatar
kitty08 kitty08 is offline
Member
 
Join Date: Sep 2011
Posts: 42
Gender: Female
Credits: 5,565
kitty08 is on a distinguished road
Default

SHOPVIEW
PHP Code:
<?php

use Resource\Collection\LinkedList;

class 
ShopView extends View{
    
    public function 
index(){
        
$document $this->document;
        
$document->setTitle($this->lang->access);
        
        
$typeForm = new Form("shoptypes""shop""post");
        
$typeSelection = new DropdownList("shoptype");
        
$typeSelection->add(new Option("Itemshop""itemshop"));
        
$typeSelection->add(new Option("Adoptshop""adoptshop"));
        
$typeForm->add($typeSelection);
        
$typeForm->add(new Button("Go""submit""submit"));
        
$document->add($typeForm);
        
        
$shopList $this->getField("shopList"); 
        
$document->addLangvar($this->lang->select);
        
$shopTable = new TableBuilder("shoplist");
        
$shopTable->setAlign(new Align("center""middle"));
        
$shopTable->buildHeaders("Image""Category""Type""Name""Description""Sales Tax""Enter");    
        
$shopTable->setHelper(new ShopTableHelper);         
        
        
$iterator $shopList->iterator();
        while(
$iterator->hasNext()){
$shopList $this->getField("shopList"); 
        
$document->addLangvar($this->lang->select);
        
$shopTable = new TableBuilder("shoplist");
        
$shopTable->setAlign(new Align("center""middle"));
        
$shopTable->buildHeaders("Enter""Sells""Description""Location");    
        
$shopTable->setHelper(new ShopTableHelper);         
        
        
$iterator $shopList->iterator();
        while(
$iterator->hasNext()){
            
$entry $iterator->next();
            
$shop $shopList->createshop($entry->getKey());
            
$cells = new LinkedList;
            
$cells->add(new TCell($shopTable->getHelper()->getShopStatus($shop)));
            
            if(
$shop->status == "open") { 
                if (
$shop->shoptype == "itemshop"){ $cells->add(new TCell("Items")); }
                if (
$shop->shoptype == "adoptshop"){ $cells->add(new TCell("Pets")); }
                
$cells->add(new TCell($shop->description));
                
$cells->add(new TCell($shop->category));
                
# $cells->add(new TCell($shopTable->getHelper()->getSalestax($shop->salestax)));    
            
}    
            if(
$shop->status == "closed") { 
                
$cells->add(new TCell(""));
                
$cells->add(new TCell("Not Open."));
                
$cells->add(new TCell("")); 
            }    
            
$shopTable->buildRow($cells);
        }  
            
$entry $iterator->next();
            
$shop $shopList->createshop($entry->getKey());
            
$cells = new LinkedList;
            
            
$cells->add(new TCell($shopList->getshopimage($shop->imageurl)));
            
$cells->add(new TCell($shop->category));
            
$cells->add(new TCell($shop->shoptype));
            
$cells->add(new TCell($shop->shopname));
            
$cells->add(new TCell($shop->description));
            
$cells->add(new TCell($shopTable->getHelper()->getSalestax($shop->salestax)));
            
$cells->add(new TCell($shopTable->getHelper()->getShopStatus($shop)));
            
$shopTable->buildRow($cells);
        }
        
$document->add($shopTable);  
    }
    
    public function 
browse(){
        
$document $this->document;                    
        
$document->setTitle($this->lang->welcome);
        
$shop $this->getField("shop");
        
$shop->display();
    }
    
    public function 
purchase(){
        
$mysidia Registry::get("mysidia");
        
$cost $this->getField("cost");
        
$document $this->document;        
        
        if(
$mysidia->input->post("shoptype") == "itemshop"){
            
$document->setTitle($this->lang->global_transaction_complete);
            
$document->addLangvar("{$this->lang->purchase_item}{$cost->getValue()} {$mysidia->settings->cost}");
        }
        elseif(
$mysidia->input->post("shoptype") == "adoptshop"){
               
$document->setTitle($this->lang->global_transaction_complete);
            
$document->addLangvar("{$this->lang->purchase_adopt}{$cost->getValue()} {$mysidia->settings->cost}");      
        }
        else return;
    }
}
?>
SHOP

PHP Code:
<?php

use Resource\Native\Integer;

class 
ShopController extends AppController{

    const 
PARAM "shop";

    public function 
__construct(){
        
parent::__construct("member");    
        
$mysidia Registry::get("mysidia");        
        
$mysidia->user->getstatus();
        if(
$mysidia->user->status->canshop == "no"){
            throw new 
NoPermissionException($mysidia->lang->denied);
        }
        if(
$mysidia->input->action() != "index" and !$mysidia->input->get("shop")){
            throw new 
InvalidIDException($mysidia->lang->global_id);
        }
    }
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$shopList = new Shoplist($mysidia->input->post("shoptype"));
        if(
$shopList->gettotal() == 0) throw new InvalidIDException("none");
        
$this->setField("shopList"$shopList);
    }
    
    public function 
browse(){
        
$mysidia Registry::get("mysidia");        
        
$shoptype $mysidia->db->select("shops", array("shoptype"), "shopname = '{$mysidia->input->get("shop")}'")->fetchColumn();
        
$shoplist = new Shoplist($shoptype);
        
$shop $shoplist->createshop($mysidia->input->get("shop"));
        
$this->setField("shop"$shop);
    }
    
    public function 
purchase(){
        
$mysidia Registry::get("mysidia");
        if(!
$mysidia->input->post("buy")) throw new InvalidIDException($mysidia->lang->global_id);
        
        if(
$mysidia->input->post("shoptype") == "itemshop"$this->purchaseItem();
        elseif(
$mysidia->input->post("shoptype") == "adoptshop"$this->purchaseAdopt();
        else throw new 
InvalidActionException($mysidia->lang->global_action);
    }
    
    private function 
purchaseItem(){
        
$mysidia Registry::get("mysidia");        
        
$shop = new Itemshop($mysidia->input->get("shop"));
        
$item $shop->getitem($mysidia->input->post("itemname"));
        
$item->assign($mysidia->user->username);
        
$oldquantity $item->getoldquantity();
        
$newquantity $oldquantity $mysidia->input->post("quantity");
            
        if(!
is_numeric($mysidia->input->post("quantity"))){
            throw new 
InvalidActionException($mysidia->lang->invalid_quantity);
        }
        elseif(
$newquantity $item->cap){
            throw new 
InvalidActionException($mysidia->lang->full_quantity); 
        }
        else{
            
$shop->purchase($item);
            
$this->setField("cost", new Integer($item->getcost($shop->salestax)));
        }        
    }
    
    private function 
purchaseAdopt(){
        
$mysidia Registry::get("mysidia");
        
$shop = new Adoptshop($mysidia->input->get("shop"));
        
$adopt $shop->getadopt($mysidia->input->post("adopttype"));
        
$adopt->assign($mysidia->user->username);            
        
$shop->purchase($adopt);
        
$this->setField("cost", new Integer($adopt->getcost($shop->salestax)));        
    }
}
?>
__________________



NABARUDIS.COM
Reply With Quote
  #4  
Old 12-31-2014, 11:15 AM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,255
IntoRain is on a distinguished road
Default

Your index() function in shopview is broken, repeated code and two while's with no matching ending curly brackets, maybe it doesn't work because of that?
The original seems to work well:

shopview

PHP Code:
        public function index(){ 
        
$document $this->document
        
$document->setTitle($this->lang->access); 
         
        
$typeForm = new Form("shoptypes""shop""post"); 
        
$typeSelection = new DropdownList("shoptype"); 
        
$typeSelection->add(new Option("Itemshop""itemshop")); 
        
$typeSelection->add(new Option("Adoptshop""adoptshop")); 
        
$typeForm->add($typeSelection); 
        
$typeForm->add(new Button("Go""submit""submit")); 
        
$document->add($typeForm); 
         
        
$shopList $this->getField("shopList");  
        
$document->addLangvar($this->lang->select); 
        
$shopTable = new TableBuilder("shoplist"); 
        
$shopTable->setAlign(new Align("center""middle")); 
        
$shopTable->buildHeaders("Image""Category""Type""Name""Description""Sales Tax""Enter");     
        
$shopTable->setHelper(new ShopTableHelper);                 
         
        
$iterator $shopList->iterator(); 
        while(
$iterator->hasNext()){ 
            
$entry $iterator->next(); 
            
$shop $shopList->createshop($entry->getKey()); 
            
$cells = new LinkedList
             
            
$cells->add(new TCell($shopList->getshopimage($shop->imageurl))); 
            
$cells->add(new TCell($shop->category)); 
            
$cells->add(new TCell($shop->shoptype)); 
            
$cells->add(new TCell($shop->shopname)); 
            
$cells->add(new TCell($shop->description)); 
            
$cells->add(new TCell($shopTable->getHelper()->getSalestax($shop->salestax))); 
            
$cells->add(new TCell($shopTable->getHelper()->getShopStatus($shop))); 
            
$shopTable->buildRow($cells); 
        } 
        
$document->add($shopTable);   
    } 
If the original still throws errors:

shop

PHP Code:
public function index(){ 
        
$mysidia Registry::get("mysidia");
        
$hasShop = ($mysidia->input->post("shoptype") != "")? 0;
        
        
$this->setField("hasShop", new Integer($hasShop));
        
        if(
$mysidia->input->post("shoptype") != ""){
            
$shopList = new Shoplist($mysidia->input->post("shoptype"));
            if(
$shopList->gettotal() == 0) throw new InvalidIDException("none");
            
$this->setField("shopList"$shopList);
       } 
shopview

PHP Code:
public function index(){
        
$document $this->document;
        
$document->setTitle($this->lang->access);
        
        
$typeForm = new Form("shoptypes""shop""post");
        
$typeSelection = new DropdownList("shoptype");
        
$typeSelection->add(new Option("Itemshop""itemshop"));
        
$typeSelection->add(new Option("Adoptshop""adoptshop"));
        
$typeForm->add($typeSelection);
        
$typeForm->add(new Button("Go""submit""submit"));
        
$document->add($typeForm);
        
$hasShop $this->getField("hasShop")->getValue(); 
        
        if(
$hasShop){
        
$shopList $this->getField("shopList"); 
        
$document->addLangvar($this->lang->select);
        
$shopTable = new TableBuilder("shoplist");
        
$shopTable->setAlign(new Align("center""middle"));
        
$shopTable->buildHeaders("Image""Category""Type""Name""Description""Sales Tax""Enter");    
        
$shopTable->setHelper(new ShopTableHelper);         
        
        
$iterator $shopList->iterator();
        while(
$iterator->hasNext()){
            
$entry $iterator->next();
            
$shop $shopList->createshop($entry->getKey());
            
$cells = new LinkedList;
            
            
$cells->add(new TCell($shopList->getshopimage($shop->imageurl)));
            
$cells->add(new TCell($shop->category));
            
$cells->add(new TCell($shop->shoptype));
            
$cells->add(new TCell($shop->shopname));
            
$cells->add(new TCell($shop->description));
            
$cells->add(new TCell($shopTable->getHelper()->getSalestax($shop->salestax)));
            
$cells->add(new TCell($shopTable->getHelper()->getShopStatus($shop)));
            
$shopTable->buildRow($cells);
        }
        
$document->add($shopTable);  
        }

__________________


asp.net stole my soul.
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
Site appearing blank? Pear Questions and Supports 18 11-09-2014 04:50 PM
Signature Images not appearing? Pear Questions and Supports 2 02-08-2014 07:42 PM
Shop Appearing As Fatal Error Hwona Questions and Supports 6 09-09-2013 06:03 PM
Bbcode image not appearing superdude44 Questions and Supports 3 05-09-2012 07:15 PM
Again Shops RoconzaArt Questions and Supports 10 01-17-2011 04:32 PM


All times are GMT -5. The time now is 03:59 AM.

Currently Active Users: 475 (0 members and 475 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