Adopt Spotlight Broken?

Forum
Last Post
Threads / Messages

KittHaven

Member
Member
Joined
May 21, 2013
Messages
478
Points
28
Age
25
Location
Devon, UK
Mysidian Dollar
8,292
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~
 
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.
 
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:
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:
  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;	  
  }
 
@HoF and @pachoofoosh : Pachoofoosh's way worked! Thank you! ^_^

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

~Parayna
 
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 ^_^
 
Ah i've got that too. :'o

Hmm maybe this will work?:

PHP:
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;       
  }
 
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:
 
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?)
 
Last edited:
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:
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!! ^_^
 
Last edited:

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,132
Members
1,603
Latest member
Monako
BETA

Latest Threads

Top