Show Favorite Pet in Side Bar

Forum
Last Post
Threads / Messages

Abronsyth

A Headache Embodied
Member
Joined
Aug 25, 2011
Messages
1,012
Points
36
Location
NY
Mysidian Dollar
73,285
So I'd like to have the user's chosen "favorite pet" (the pet in the spot light, etc) in the side bar. That's all, just the pet's image, and if the user has not chosen a favorite pet yet, then it simply shows an empty box with the text "no active pet" in it.

How would I accomplish this?

Thanks,
Abron
 
umm all you need to do is to go to class_page.php, find the method that defines sidebar, and insert the image of user's favorite pet into sidebar. It should be quite simple, and on a quick note the favorite pet script can be found at class_userprofile.php.
 
Okay, I inserted this into the side bar:
Code:
<img src='http://www.".constant("DOMAIN").constant("SCRIPTPATH")."/siggy.php?id={$this->favpet}' border=0>

Now I'm not sure what else I need to add in, since the image is currently not showing up (the adoptable ID is not being inserted).
 
Lol I was just working on this too... I thought it was only me getting stuck. I tried various things from including other files to javascript document. scripts... its probably just something simple that I missed a comma on lol.
 
Urb. Well, let me know if you figure it out ;_;

EDIT:

Okay...I got it to show "none selected" but when I go to select a favorite pet it automatically sets it back to having no pet selected...it's like it's not saving it...erg.

So, what I did is I went through and added:
Code:
private $favpet;

Under all of the other private $things in class_page.php. Then I added in this:
Code:
$this->favpet = ($this->favpet == 0)?"None Selected":"<a href='http://www.".constant

("DOMAIN").constant("SCRIPTPATH")."/levelup.php?id={$this->favpet}' target='_blank'><img 

src='http://www.".constant("DOMAIN").constant("SCRIPTPATH")."/siggy.php?id={$this->favpet}' border=0></a>";

Under
Code:
if($mysidia->user->isloggedin == TRUE) {

Then, lastly, I add {$this->favpet} in the side bar.

So, what am I doing wrong?
 
Last edited:
Yeup, Ruinily and Isura were able to get it working, so now it's all good :)
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,120
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Top