Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 01-13-2015, 09:57 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 127,517
Kyttias is on a distinguished road
Default

As for your code above, because the Sidebar widget is partially controlled on the AdminCP you will also have to make changes there. AdminCP > Module > Create New Module:


You could also probably manually do this in the database (in the _modules table), but it's just not being done with code alone. (Note: the Module Order slot controls the order in which the modules in the sidebar will appear, lower numbers are higher.)

I also notice your code above is only a setter but there is no getter. The money bar has a getter, so just add one similar above your code:
PHP Code:
public function getFavPetSB(){
        return 
$this->FavPetSB;
    } 
I also propose the following changes in your code:

PHP Code:
protected function setFavPetSB(){
        
$mysidia Registry::get("mysidia");

        
$userfavpet $mysidia->db->select("users_profile", array("favpet"), "username = '{$mysidia->user->username}'")->fetchColumn(); 
        if (
$this->userfavpet == "0"){
            
$this->FavPetSB = new Paragraph
            
$this->FavPetSB->add(new Comment("<b>No Favorite Pet Set</b>"));
        }
        else{
            
$adopt = new OwnedAdoptable($userfavpet);
            
$this->FavPetSB = new Paragraph
            
$this->FavPetSB->add(new Comment("<b>Favorite Pet!</b> <br/>
                <a href='/myadopts/manage/
{$userfavpet}'><img src='{$adopt->getImage()}'></a>
                "
));
        }

        
$this->setDivision($this->FavPetSB);
    } 
Using "$adopt = new OwnedAdoptable($userfavpet);" you can also pull up data like {$adopt->getName()} and {$adopt->getCurrentLevel()}.

Lastly, the code you had looked familiar, but it's something that's slightly broken in the code itself, currently. Inside class_userprofile.php I'd replace the getFavpet function:

PHP Code:
 public function getFavpet(){ 
      if(
is_numeric($this->favpet)){ 
          
$adopt = new OwnedAdoptable($this->favpet); 
          
$favimg $adopt->getImage(); 
          
$this->favpet = ($this->favpet == 0)?new Comment("None Selected"):new Link("levelup/click/{$this->favpet}", new Image($favimg), TRUE);  
      }  
      return 
$this->favpet;       
  } 
Because unfortunately, levelup/siggy/{$numberhere} is not an image, not even if you add a file extension to it.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 01-13-2015 at 10:12 AM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeking Advanced PHP Coder (PAID) SoubisSacrifice Staff Central 14 01-29-2015 10:42 AM
Seeking a coder + artists~ Pear Staff Central 14 07-06-2014 03:42 PM
I need basic coding help Moontides Feedback and Suggestions 23 05-28-2014 01:54 PM
Seeking Mysidia coder Solistia Staff Central 4 05-03-2011 04:19 AM
My BASIC programs SleepWalker Other Chat 0 04-05-2010 08:37 AM


All times are GMT -5. The time now is 01:13 AM.

Currently Active Users: 2378 (0 members and 2378 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636