View Full Version : Show Favorite Pet in Side Bar
Abronsyth
02-18-2013, 03:09 PM
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
Hall of Famer
02-18-2013, 07:21 PM
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.
Abronsyth
02-19-2013, 01:06 PM
Okay, I inserted this into the side bar:
<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).
Ruinily
02-19-2013, 01:52 PM
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.
Abronsyth
02-21-2013, 08:40 AM
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:
private $favpet;
Under all of the other private $things in class_page.php. Then I added in this:
$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 if($mysidia->user->isloggedin == TRUE) {
Then, lastly, I add {$this->favpet} in the side bar.
So, what am I doing wrong?
Ruinily
02-25-2013, 11:12 PM
I think this has been fixed by the way. ^_^
Abronsyth
02-26-2013, 09:08 AM
Yeup, Ruinily and Isura were able to get it working, so now it's all good :)
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.