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
  #1  
Old 08-25-2014, 10:09 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 111,693
Abronsyth is on a distinguished road
Default Alter Shop Table?

Just trying to make things less cluttered in general. I did something similar for my adoption page, but this is confusing me quite a bit.

I am trying to remove the columns "Category" "type" and "name" from the shop page. I am using Mys 1.3.3 and this is the shop file:
PHP Code:
<?php

class ShopController extends AppController{

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

    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");
        
$document $mysidia->frame->getDocument();
        
$document->setTitle($mysidia->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 = new Shoplist($mysidia->input->post("shoptype"));
        
$shoplist->display();
    }
    
    public function 
browse(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();                    
        
$document->setTitle($mysidia->lang->welcome);
        
        
$shoptype $mysidia->db->select("shops", array("shoptype"), "shopname = '{$mysidia->input->get("shop")}'")->fetchColumn();
        
$shoplist = new Shoplist($shoptype);
        
$shop $shoplist->createshop($mysidia->input->get("shop"));
        
$shop->display();
    }
    
    public function 
purchase(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        if(!
$mysidia->input->post("buy")) throw new InvalidIDException($mysidia->lang->global_id);
        
        if(
$mysidia->input->post("shoptype") == "itemshop"){
            
$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);
                
$document->setTitle($mysidia->lang->global_transaction_complete);
                
$document->addLangvar("{$mysidia->lang->purchase_item}{$item->getcost($shop->salestax)} {$mysidia->settings->cost}");
            }
        }
        elseif(
$mysidia->input->post("shoptype") == "adoptshop"){
            
$shop = new Adoptshop($mysidia->input->get("shop"));
            
$adopt $shop->getadopt($mysidia->input->post("adopttype"));
            
$adopt->assign($mysidia->user->username);
            
            
$shop->purchase($adopt);
               
$document->setTitle($mysidia->lang->global_transaction_complete);
            
$document->addLangvar("{$mysidia->lang->purchase_adopt}{$adopt->getcost($shop->salestax)} {$mysidia->settings->cost}");      
        }
        else throw new 
InvalidActionException($mysidia->lang->global_action);
    }
}
?>
I just can't seem to find the place I would edit to remove these three columns?

Thanks for any help,
Abron
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #2  
Old 08-25-2014, 05:13 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,259
IntoRain is on a distinguished road
Default

Seeing this:

$shoplist = new Shoplist($mysidia->input->post("shoptype"));
$shoplist->display();

I'd say it's on the file class_shoplist.php, function display() (I don't have the files on hand atm so can't confirm)
__________________


asp.net stole my soul.
Reply With Quote
  #3  
Old 08-27-2014, 07:12 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 111,693
Abronsyth is on a distinguished road
Default

Awesome! I found it on line 87 in class_shoplist.php, just had to edit buildHeaders and buildRow!

Thank you, IntoRain! I swear I'll get the hang of this eventually XD
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #4  
Old 08-27-2014, 10:26 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,259
IntoRain is on a distinguished road
Default

Glad you found it! ^^
__________________


asp.net stole my soul.
Reply With Quote
  #5  
Old 09-28-2014, 09:44 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 111,693
Abronsyth is on a distinguished road
Default

Oookay so I've since updated to 1.3.4, and the files are a bit different, so I am a little perplexed on how to do the same exact thing:
PHP Code:
<?php

/**
 * The ShopTableHelper Class, extends from the TableHelper class.
 * It is a specific helper for tables that involves operations on shops.
 * @category Resource
 * @package Helper
 * @author Hall of Famer 
 * @copyright Mysidia Adoptables Script
 * @link http://www.mysidiaadoptables.com
 * @since 1.3.3
 * @todo Not much at this point.
 *
 */

class ShopTableHelper extends TableHelper{

    
/**
     * Constructor of ShopTableHelper Class, it simply serves as a wrap-up.
     * @access public
     * @return Void
     */
    
public function __construct(){
        
parent::__construct();         
    }

    
/**
     * The getSalestax method, formats and retrieves the salestax of a shop.
     * @param Int  $salestax
     * @access public
     * @return String
     */
    
public function getSalestax($salestax){
        return 
"{$salestax}%";                
    }
    
    
/**
     * The getShopstatus method, returns the shop status with an enter link or a closed message.
     * @param Shop  $shop
     * @access public
     * @return Link|String
     */
    
public function getShopStatus($shop){    
        if(
$shop->status == "open") return new Link("shop/browse/{$shop->shopname}", new Image("templates/icons/next.gif"));
        else return 
"Closed";        
    }
    
    
/**
     * The getItemPurchaseForm method, constructs a buy form for an itemshop table.
     * @param Itemshop  $shop
     * @param Item  $item 
     * @access public
     * @return Form
     */
    
public function getItemPurchaseForm(Itemshop $shopItem $item){    
        
$mysidia Registry::get("mysidia");
        
$buyForm = new FormBuilder("buyform""../purchase/{$mysidia->input->get("shop")}""post");
        
$buyForm->setLineBreak(FALSE);
        
$buyForm->buildComment("<br>")
                ->
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");
        
$quantity->setSize(3);
        
$quantity->setMaxLength(3);
        
$quantity->setLineBreak(TRUE);

        
$buy = new Button("Buy""buy""buy");
        
$buy->setLineBreak(FALSE);

        
$buyForm->add($quantity);
        
$buyForm->add($buy);
        return 
$buyForm;                
    }
    
    
/**
     * The getAdoptPurchaseForm method, constructs a purchase form for an adoptshop table.
     * @param Adoptshop  $shop
     * @param Adoptable  $adopt 
     * @access public
     * @return Form
     */
    
public function getAdoptPurchaseForm(Adoptshop $shop$adopt){    
        
$mysidia Registry::get("mysidia");
        
$buyForm = new FormBuilder("buyform""../purchase/{$mysidia->input->get("shop")}""post");
        
$buyForm->setLineBreak(FALSE);
        
$buyForm->buildComment("<br>")
                ->
buildPasswordField("hidden""action""purchase")
                ->
buildPasswordField("hidden""adopttype"$adopt->type)
                ->
buildPasswordField("hidden""shopname"$shop->shopname)
                ->
buildPasswordField("hidden""shoptype""adoptshop")
                ->
buildPasswordField("hidden""salestax"$shop->salestax);
                
        
$buy = new Button("Buy""buy""buy");
        
$buy->setLineBreak(FALSE);
        
$buyForm->add($buy);
        return 
$buyForm;                
    }
    
    
/**
     * Magic method __toString for ShopTableHelper class, it reveals that the object is a shop table helper.
     * @access public
     * @return String
     */
    
public function __toString(){
        return new 
String("This is an instance of Mysidia ShopTableHelper class.");
    }    

?>
Any pointers?
__________________
My Mods Site (1.3.4, 2020 Mods)
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
Anyone Know How to Fix a Table Hwona Questions and Supports 0 07-28-2014 10:31 AM
Editing adopt table SilverDragonTears Questions and Supports 1 05-26-2013 08:19 PM
Admin Cp (Table) Alaric Questions and Supports 14 04-24-2012 06:23 AM
A 2-column table? Quillink Suggestions and Feature Requests 8 09-23-2010 02:26 PM
Table Prefix fadillzzz Questions and Supports 5 01-21-2010 11:17 AM


All times are GMT -5. The time now is 03:19 PM.

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