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)
-   -   Remove "already leveled creature today" text? (http://www.mysidiaadoptables.com/forum/showthread.php?t=4941)

Abronsyth 12-26-2015 09:41 AM

Is there a way to make it so that the pet's "profile" is shown when the pet is frozen? I've tried several things but to no avail as of yet.

Kyttias 12-26-2015 07:23 PM

I did some thinking on this today. You can find this line in levelup.php and comment it out (just make it so this whole elseif clause doesn't fire) -
PHP Code:

elseif($this->adopt->isFrozen() == "yes") { throw new LevelupException("frozen"); } 

to
PHP Code:

// elseif($this->adopt->isFrozen() == "yes") { throw new LevelupException("frozen"); } 

Or, hey, delete it if you're feeling safe with that, whatever.

Instead, we're going to pop on back up to where we checked if the pet had been visited today or not. This line opens up this clause:
PHP Code:

elseif($this->adopt->hasVoter($mysidia->user$date)){ 

We're going to modify it so it also fires when the pet is frozen. This is probably the most important part. Make it this:
PHP Code:

elseif($this->adopt->hasVoter($mysidia->user$date) || ($this->adopt->isFrozen() == "yes")){ 

Inside this, we can nest another if statement that can show a message that will say that the pet is frozen/locked:
PHP Code:

if (!$this->adopt->hasVoter($mysidia->user$date)){
    
$message .= "<b>This pet is frozen!</b>";


Setting a variable with 'dot equals' (.=) adds to the existing variable, appends to it - I think the technical term is that it concatenates to the existing variable.

Okay, so, ACTUALLY, if you used the code I gave originally without modifying it much, you'll see that I already did included something to happen if you're somehow on the page but hadn't visited the pet - the word 'Play' instead of the thankyou message. (To be honest I want to eventually create a feature so pet's aren't automatically counted as being clicked/visited as soon as the page loads, but wait until a button is pressed, so that's why it's there - well that doesn't work like that, and I haven't invented such a thing yet.) Regardless, here's that bit of code how I gave it in the original post:
PHP Code:

// If you haven't seen the pet today:
if (!$this->adopt->hasVoter($mysidia->user$date)){
        
$message .= "<div style='display: inline;'><span class='button'><i class='fa fa-paw'></i> Play</span></div>";


So go ahead and modify/use that. It'll show when you visit the page but the pet is frozen. Rest assured, pets will be treated as if they've already been seen for the day, and won't add on a new click.

Abronsyth 12-26-2015 08:11 PM

Aha! Excellent, thank you Kyttias! I wasn't too far off but I see now where I was going wrong.

Missy Master 07-28-2016 11:32 AM

Does anyone have the code to make this simple profile page ? I've tried fixing up the code here for levelup and not having too much success.

This is the last thing I need for my sites, a basic working public pet profile page :)

Can anyone help on what to change/take out to make it work ?

I just get white pages no matter what I do ...

parayna 12-19-2016 07:31 AM

I have the profiles for my pets set up:

But would it be possible to have the same show up on the view_levelup file? I've tried tinkering but it does not want to work, and I think I lack the understanding to know 100% where I've gone wrong... for now, I've added a link under all the text that refreshes the page to take you to their 'profile'.


Thank you ^_^


EDIT: I made some changes to my levelup view file! It now looks the same as my levelup so it's almost like the same page... I'm pretty happy I did it myself XD Took a while to realise I had to do {$adopt->whatever} and not {$this->adopt-whatever}... XD

  Spoiler: Images 
When you first click them to level them up. As a guest the reward bit won't show (tested and it works!)
http://i1346.photobucket.com/albums/...pstszhxgwq.png

After you've clicked that day. And also, when they're frozen it will show this but their name will have a snowflake next to it and the words will say you can't play with them.
http://i1346.photobucket.com/albums/...ps3f1g3ddh.png


What happens when they're frozen:
http://i1346.photobucket.com/albums/...psnkqzrjju.png

SilverDragonTears 01-15-2017 07:54 PM

I don't understand how to make the public profile. I have it working if you've already played with the pet but where is the code for the actual public profile?


All times are GMT -5. The time now is 12:33 AM.

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