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)
-   -   Display AdoptSpotlight anywhere? c: (http://www.mysidiaadoptables.com/forum/showthread.php?t=4156)

pachoofoosh 06-06-2013 04:19 PM

Display AdoptSpotlight anywhere? c:
 
Hello! c:
I was wondering if there was a way to display a user's favorite pet anywhere on-site, and as a module in the sidebar? I was wondering because I'm planning on using the user's favorite pet as their 'active pet', which they'll be able to explore with, although I'm not quite sure how to have it display the pet.
Thanks for the help! <3

Infernette 06-06-2013 07:19 PM

I need this as well, but I'll try to fiddle around to see if it can work the same was as the avatar for you ^^

Hall of Famer 06-10-2013 06:55 PM

Sure you can do that by creating a module for sidebar, although to display it on another widget/location can be difficult at this moment. You need to write a very simple php code in the adoptsoptlight module, I will post a tutorial a few days later.

pachoofoosh 06-19-2013 04:35 PM

Alright, awesome! Thanks, I'll play around with the code and see if I can get it to display the pet anywhere. ^^ (Sorry for the late reply! ^^;)

Hall of Famer 06-20-2013 04:34 AM

Alright, I will post the tutorial this weekend or early next week. It really should not be difficult, although you better test it thoroughly on your site to make sure its not malfunctioning.

pachoofoosh 07-03-2013 12:00 PM

I figured out how to add it to the sidebar!
I used your tutorial on how to add avatars onto the sidebar, but played around with the script for a bit to see if it'd display the favorite pet. uwu

To display the AdoptSpotlight in the sidebar, make a new module, and in the text box for the Module's PHP, add this:

Code:

$profile = $mysidia->user->getprofile();
$favpet = new Image("levelup/siggy/" . $profile->getFavpetID());
$favpet->resize(100); // Resize the image to a certain size. This makes it 100x100 pixels.
$moduleContainer->add($favpet);


Hall of Famer 07-03-2013 02:23 PM

Thats indeed a smart strategy, the module system sure makes your life easy if you know what you are doing. Most users unfamiliar with PHP are expected to be using HTML code instead of PHP code though, but there are circumstances that you have to use PHP code.

pachoofoosh 07-04-2013 12:39 PM

Quote:

Originally Posted by Hall of Famer (Post 27406)
Thats indeed a smart strategy, the module system sure makes your life easy if you know what you are doing. Most users unfamiliar with PHP are expected to be using HTML code instead of PHP code though, but there are circumstances that you have to use PHP code.

Haha yeah. cx Thankfully php is one of the more flexible languages though, so it can be easier to find different solutions to problems and such. The Module system makes it much easier to control a site's features quickly and efficiently. Although I'm starting to understand how the script works more, and I love how easy it is to edit once you've got the basic idea. It has really helped me understand the point of using OOP; Most tutorials I've seen around the internet were hard to understand because of the way they were written. Then again the best way to learn is by doing I suppose.
//Long reply whoops |D

Tequila 07-04-2013 03:34 PM

Quote:

Originally Posted by pachoofoosh (Post 27403)
I figured out how to add it to the sidebar!
I used your tutorial on how to add avatars onto the sidebar, but played around with the script for a bit to see if it'd display the favorite pet. uwu

To display the AdoptSpotlight in the sidebar, make a new module, and in the text box for the Module's PHP, add this:

Code:

$profile = $mysidia->user->getprofile();
$favpet = new Image("levelup/siggy/" . $profile->getFavpetID());
$favpet->resize(100); // Resize the image to a certain size. This makes it 100x100 pixels.
$moduleContainer->add($favpet);


Awesome! ;3 now to get it centered. Thanks! ;3

Hall of Famer 07-06-2013 11:49 PM

To get it centered, simply add this to the code block:

PHP Code:

$favpet->setAlign(new Align("center")); 

This should do the trick, lemme know if anything goes wrong.


All times are GMT -5. The time now is 05:27 AM.

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