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)
-   -   Adopt Spotlight Broken? (http://www.mysidiaadoptables.com/forum/showthread.php?t=4699)

parayna 10-22-2014 12:12 PM

Adopt Spotlight Broken?
 
Hey, the adopt spotlight on my site seems to be broken? The names appear in the list when you are choosing from your profile but for some reason the image appears broken (with that broken image icon). Does anyone know why? ^_^

Thanks~

Hall of Famer 10-25-2014 10:39 PM

Umm does this happen to every user on your site, or only a few of them? I can tell that adopt spotlight may be broken if you hard delete an adoptable that is assigned on adopt spotlight, since in this case the adoptable ID will no longer exist.

pachoofoosh 11-02-2014 05:58 PM

I broke the adoptspotlight on my site by deleting adoptables directly from the database (was resetting everything); after I reset the auto_increment values it got mean and decided not to work. QvQ

This fixed the problem for me and got the adoptSpotlight working, it might work on your site? ^^

in class_userprofile.php, find the following function (should be around line 55):
PHP Code:

public function getFavpet(){
      if(
is_numeric($this->favpet)){
          
$this->favpet = ($this->favpet == 0)?new Comment("None Selected"):new Link("levelup/click/{$this->favpet}", new Image("levelup/siggy/{$this->favpet}"), TRUE); 
      } 
      return 
$this->favpet;      
  } 

Replace it with this:
PHP Code:

  public function getFavpet(){
      if(
is_numeric($this->favpet)){
          
$adopty = new OwnedAdoptable($this->favpet);
          
$favimg $adopty->getImage();
          
$this->favpet = ($this->favpet == 0)?new Comment("None Selected"):new Link("levelup/click/{$this->favpet}", new Image($favimg), TRUE); 
      } 
      return 
$this->favpet;      
  } 


parayna 11-09-2014 08:04 AM

@HoF and @pachoofoosh : Pachoofoosh's way worked! Thank you! ^_^

(Sorry for the late reply, I have had exams recently >.<)

~Parayna

parayna 11-18-2014 03:37 PM

Hi, I am not sure if it is to do with this piece of code but for some reason when I go onto someone's profile and they DON'T have a favourite pet selected it says, 'Adoptable ID 0 does not exist or does not belong to the owner specified... '

For once I actually know what it means (I think... XD) as when I go to the admin CP on my host site, under the fav pet in the users_profile thing it has a 0 for the default. And for some reason it thinks it is a valid ID. Does anyone know how to fix this? Thanks ^_^

parayna 12-05-2014 04:01 PM

Bumping :)

pachoofoosh 12-06-2014 08:31 AM

Ah i've got that too. :'o

Hmm maybe this will work?:

PHP Code:

public function getFavpet(){ 
      if(
is_numeric($this->favpet) && $this->favpet != 0){ 
          
$adopty = new OwnedAdoptable($this->favpet); 
          
$favimg $adopty->getImage(); 
          
$this->favpet = new Link("levelup/click/{$this->favpet}", new Image($favimg), TRUE);  
      }  
        elseif(
$this->favpet 0) {
           
$this->favpet = new Comment("None Selected");
        }
      return 
$this->favpet;       
  } 


parayna 12-07-2014 09:22 AM

Hmm, I tried that but now all that's coming up is a white page.. but only for people who have no favourite pet selected.. D:

Kyttias 12-07-2014 02:40 PM

When checking for a value to be equal, isn't it two == and not just one =? That might be a start. So the last bit elseif($this->favpet = 0), try it with two ==. (Does it need to be an else if? Why not just else?)

parayna 12-07-2014 02:46 PM

I'll try that! Thanks! ^_^

EDIT: I got rid of the 'if' and it made all users have a white page.. maybe that's why it is needed? I dunno XD

EDIT2: Yay! I fixed it! It was fixed when I did this:

PHP Code:

public function getFavpet(){ 
      if(
is_numeric($this->favpet) && $this->favpet != 0){ 
          
$adopty = new OwnedAdoptable($this->favpet); 
          
$favimg $adopty->getImage(); 
          
$this->favpet = new Link("levelup/click/{$this->favpet}", new Image($favimg), TRUE);  
      }  
        elseif(
$this->favpet == 0) {
           
$this->favpet = new Comment("None Selected");
        }
      return 
$this->favpet;       
  } 

I put another equals in front of the 0 after the 'elseif'.

Thank you!! ^_^


All times are GMT -5. The time now is 04:05 PM.

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