Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Restyling the adopt manage page (http://www.mysidiaadoptables.com/forum/showthread.php?t=4972)

Abronsyth 01-08-2016 01:28 PM

Restyling the adopt manage page
 
Resolved

I am trying to restyle the .../myadopts/manage/ID# page to actually display adopt data, but it's proving to be difficult. For some reason the methods that work to display data everywhere else in the .../myadopts file does not work right on the manage page. Elsewhere data can be displayed like;
PHP Code:

{$adopt->getTotalClicks()} 

And that'll display the total clicks an adopt has accumulated, but that same code does not work within the manage function.

If I could figure out how to at least define things within the manage function then I could get it all working, but I've tried;
PHP Code:

        $gender $this->getField("gender")->getValue(); 

And it doesn't work...so I'm lost.

Here is my public function manage:
PHP Code:

    public function manage(){
        
$mysidia Registry::get("mysidia");
        
$aid $this->getField("aid")->getValue();
        
$name $this->getField("name")->getValue();
        
$image $this->getField("image");
        
        
$document $this->document;        
        
$document->setTitle("Managing {$name}");
        
$document->add($image);
        
$document->add(new Comment("<br><br>This page allows you to manage {$name}.  Click on an option below to change settings.<br>
                        <a href='http://catisserie.mysidiahost.com/levelup/click/
{$aid}'>Play</a> | <a href='http://catisserie.mysidiahost.com/myadopts/stats/{$aid}'>Stats</a> | <a href='http://catisserie.mysidiahost.com/myadopts/bbcode/{$aid}'>Codes</a> | <a href='http://catisserie.mysidiahost.com/myadopts/freeze/{$aid}'>(Un)Freeze</a><br>
                        <ul>
                                        <li>Name: 
{$name} | <a href='http://catisserie.mysidiahost.com/myadopts/rename/{$aid}'>change</a></li>
                                        <li>Birthday: date adopted will display here </li>
                                        <li>Type: adopt breed will display here</li>
                                        <li>Sex: m or f will display here</li>
                                        <li>Trade Status: trade status will display here | <a href='http://catisserie.mysidiahost.com/myadopts/trade/
{$aid}'>change</a></li>
                                        <li>LVL: level will display here</li>
                                        <li>Total EXP: number of clicks will go here</li> 
                                    </ul>"
));
        
        
$document->add(new Image("templates/icons/delete.gif"));
        
$document->add(new Link("pound/pound/{$aid}"" Pound {$name}"TRUE)); 
    } 

Sorry again for all of the questions ;~;

Kyttias 01-08-2016 03:24 PM

Try setting $adopt = new Adoptable($aid); and then using it as you were trying before?

Abronsyth 01-08-2016 08:29 PM

Set it to $adopt = new OwnedAdoptable($aid); and it works brilliantly now! I am much obliged, Kyttias! I cannot thank you enough!

Kyttias 01-08-2016 08:44 PM

I was close. ^^;; Glad it's working!

tahbikat 01-08-2016 10:43 PM

Oooh, so this displays stats on the actual manage page? I have some stats on the Stats page under manage, but this would be much better!

Abronsyth 01-08-2016 11:05 PM

Yep! It was killing me to have to go to the adoptable and then click on the stats link to see any information about the pet XD If you need help getting any specific stats to display just ask! Here's my resulting page;
http://i.imgur.com/P9R9F27.png

PHP Code:

    public function manage(){
        
$mysidia Registry::get("mysidia");
        
$aid $this->getField("aid")->getValue();
        
$name $this->getField("name")->getValue();
        
$image $this->getField("image");
        
$adopt = new OwnedAdoptable($aid);
        
        
$document $this->document;        
        
$document->setTitle("Managing {$name}");
        
$document->add($image);
        
$document->add(new Comment("<br><br>This page allows you to manage {$name}.  Click on an option below to change settings.<br>
                        <a href='http://YOUR URL/levelup/click/
{$aid}'>Play</a> | <a href='http://YOUR URL/myadopts/stats/{$aid}'>Stats</a> | <a href='http://YOUR URL/myadopts/bbcode/{$aid}'>Codes</a> | <a href='http://YOUR URL/myadopts/freeze/{$aid}'>(Un)Freeze</a><br>
                        <ul>
                                        <li><strong>Name:</strong> 
{$name} | <a href='http://YOUR URL/myadopts/rename/{$aid}'>change</a></li>
                                        <li><strong>Birthday:</strong> 
{$adopt->getBirthday()} </li>
                                        <li><strong>Type:</strong> 
{$adopt->getType()}</li>
                                        <li><strong>Sex:</strong> 
{$adopt->getGender()}</li>
                                        <li><strong>Trade Status:</strong> 
{$adopt->getTradeStatus()} | <a href='http://YOUR URL/myadopts/trade/{$aid}'>change</a></li>
                                        <li><strong>LVL:</strong> 
{$adopt->getCurrentLevel()}</li>
                                        <li><strong>Total EXP:</strong> 
{$adopt->getTotalClicks()}  </li> 
                                    </ul>"
));
        
        
$document->add(new Image("templates/icons/delete.gif"));
        
$document->add(new Link("pound/pound/{$aid}"" Pound {$name}"TRUE)); 
    } 


tahbikat 01-09-2016 04:31 AM

Thank you kindly Abron. <3 Gonna add this to my ever growing list of things to add. :P

SilverDragonTears 01-16-2017 02:17 AM

the birthday part is throwing an error but I have that in my database.

Abronsyth 01-17-2017 08:28 AM

Are you using Kyttias's birthday mod?

kingsofjuly 06-25-2018 03:09 AM

Where do I insert this, please? I attempted to place it under line 38:

Quote:

public function manage(){
$this->setField("aid", new Integer($this->adopt->getAdoptID()));
$this->setField("name", new String($this->adopt->getName()));
$this->setField("image", $this->image);
}
but it keeps throwing me to a blank page, on both My Adopts and Manage the Pet page. I have altered the URLs to my own domain. Would love to implement this, as I've just added the stat adding script :) Thanks


All times are GMT -5. The time now is 11:23 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.