View Single Post
  #2  
Old 03-28-2016, 10:58 PM
tahbikat's Avatar
tahbikat tahbikat is offline
Member
 
Join Date: Feb 2014
Location: Louisiana
Posts: 408
Gender: Female
Credits: 51,328
tahbikat is on a distinguished road
Default

For the rarity part, try this,


I'm assuming you want this in your My Adopts page?

First go to myadoptsview.php in your view folder, and you need to add a rarity column to the table. So add the "Rarity" title next to gender. This is located in the public function index section right at the top of the file. I also changed my table width to 900 so don't copy that part unless you want to.

PHP Code:
$adoptTable = new TableBuilder("adopttable"900);
        
$adoptTable->setAlign(new Align("center""middle"));
        
$adoptTable->buildHeaders("Gender""Rarity""Name/Type""Image""Points""Level"); 
Then under the gender cell, add your rarity cell like so:
PHP Code:
$cells->add(new TCell($adopt->getGender("gui")));
            
$cells->add(new TCell("<img src='/picuploads/{$adopt->getRarity()}.png' />")); 
Here's the whole index part if you want to just copy and paste. This is the public function index section only, not the whole file, so only replace that part.

PHP Code:
    public function index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle($this->lang->title);
 
        
$pagination $this->getField("pagination");
        
$stmt $this->getField("stmt")->get();
        if(
$stmt->rowCount() == 0){
            
$document->addLangvar($this->lang->empty);
            return;
        }
        
        
$adoptTable = new TableBuilder("adopttable"900);
        
$adoptTable->setAlign(new Align("center""middle"));
        
$adoptTable->buildHeaders("Gender""Rarity""Name/Type""Image""Points""Level");
        
        while(
$aid $stmt->fetchColumn()){
            
$adopt = new OwnedAdoptable($aid);
            
$cells = new LinkedList;
            
$cells->add(new TCell($adopt->getGender("gui")));
            
$cells->add(new TCell("<img src='/picuploads/{$adopt->getRarity()}.png' />"));
            
$cells->add(new TCell("<b>{$adopt->getName()}</b><br />{$adopt->getType()}"));
            
$cells->add(new TCell(new Link("myadopts/manage/{$aid}"$adopt->getImage("gui"))));
            
$cells->add(new TCell($adopt->getTotalClicks()));
            
$cells->add(new TCell($adopt->getCurrentLevel()));
            
$adoptTable->buildRow($cells);
        }
        
$document->add($adoptTable);
        
$document->addLangvar($pagination->showPage());
    } 

As for your second question, I'm afraid pet groups are a bit more complicated/take longer to code and I'm not sure if anyone here has done that yet.

Last edited by tahbikat; 03-28-2016 at 11:02 PM.
Reply With Quote