Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
Placing descriptions on the My Adopts page
I would like for the user to see not just the image of the adoptable, but also the description included during it's creation in the ACP (when viewing the adoptable in My Adopts)
Any suggestions on how to go about doing this? |
#2
|
||||
|
||||
Directly on the stats page? Or when you click on it?
If you look at the database you will see that the description is associated with an Adoptable and not an OwnedAdoptable. So we have to get the species to get the description. Basically, through the OwnedAdoptable's type, we get the Adoptable and then we return the description. In code-words, in the file class_ownedadoptable.php we add a protected $type; to the list at the top then we add this function: public function getDescription(){ $adopt = new Adoptable($this->type); return $adopt->getDescription(); } So if you want it in the stats page, you just needed to add a comment on the getStats() function in the class_ownedadoptable.php file like: $stats->add(new Comment("<br>Description: ",FALSE)); $stats->add(new Comment($this->getDescription())); So you class_ownedadoptable.php should look like this: PHP Code:
__________________
asp.net stole my soul. Last edited by IntoRain; 02-19-2014 at 12:44 PM. |
#3
|
||||
|
||||
Quote:
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#4
|
|||
|
|||
Into Rain: That was exactly what I was looking for.
This brings me to another question though. There is a limit on the characters that can be entered into the description of an adoptable. This is fine with me as it pertains to its use in the Adoptshop, but when it is sent over to the stats page, I want there to be a much larger limit on the character value. So, this would involve cutting short the description in the Adoptshop, but still maintaining the extra characters in the database for when the description shows up on the stats page. Again, my sincere thanks for your assistance. |
#5
|
||||
|
||||
If there isn't a simple code for this, a work around I've found is to create a page with all the adoptables and their descriptions. You could also create separate pages for each, and a promocode is given to unlock each page.
__________________
Avatar courtesy of Doll Divine. |
#6
|
|||
|
|||
All that being said, are there any suggestions for this in terms of code changes?:
"There is a limit on the characters that can be entered into the description of an adoptable. This is fine with me as it pertains to its use in the Adoptshop, but when it is sent over to the stats page, I want there to be a much larger limit on the character value. So, this would involve cutting short the description in the Adoptshop, but still maintaining the extra characters in the database for when the description shows up on the stats page." |
#7
|
||||
|
||||
Oops, didn't notice the inheritance! My bad! Thank you, HoF!
Quote:
__________________
asp.net stole my soul. |
#8
|
|||
|
|||
How would I go about adding a function to get the new table?
EDIT: Actually scratch that... I just added the following... Code:
public function getDescription2(){ return $this->description2; } and... $stats->add(new Comment("<br>Backstory: ",FALSE)); $stats->add(new Comment($this->getDescription2())); Thanks again! Last edited by Vaporman87; 02-21-2014 at 03:12 PM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
My Adopts Page | parayna | Questions and Supports | 14 | 03-09-2016 10:53 PM |
Pagination/ My Adopts Page | Missy Master | Suggestions and Feature Requests | 13 | 01-23-2011 09:37 PM |
Neater Adopts Page | LilPixie | Questions and Supports | 0 | 09-06-2009 11:14 PM |
My Adopts Page | Seapyramid | Addons/Mods Graveyard | 8 | 05-02-2009 04:04 PM |
What's New? |
What's Hot? |
What's Popular? |