View Single Post
  #3  
Old 06-08-2020, 04:39 PM
Micolai's Avatar
Micolai Micolai is offline
Loving Mysidia!
 
Join Date: May 2020
Location: Tennessee
Posts: 130
Gender: Female
Credits: 27,066
Micolai is on a distinguished road
Default

Quote:
Originally Posted by kristhasirah View Post
there are 2 ways to do archive this first the "notsoeasyone"
you can try adding a if to the levelup.php and levelupview.php
it can be something like:
if(adopt->getOwner() == $mysidia->user->username){levelupcode goes here}
else{ $document->addLangvar("you can't feed others pets");} but if your levelup.php and levelupview.php is very modified then it will be kind of tricky to put everything in place without breaking something...

now the easy way:
look for this code in levelup.php
PHP Code:
        elseif($this->settings->owner == "disabled" and $this->adopt->getOwner() == $mysidia->user->username){
             throw new 
LevelupException("owner");               
        } 
and add this below:
PHP Code:
        elseif($this->adopt->getOwner() != $mysidia->user->username){
             throw new 
LevelupException("user");

(note this is just a copy/paste/edit of the original code posted above)

to add the message that will appear for the users you must open lang_levelup.php and add this:
PHP Code:
$lang['user'] = "Unfortunately, the admin has disabled the option for users to click others adoptables."
(you can edit the message... that's just a copy/paste/edit of the error for the owner... when they can't levelup their own adopts)

I test the code on my site and so far it works for me... i can only level up my own adopts, for the rest it gives me an error. i recommend doing a backup of your files before adding the code and do a heavy test of it, to see if it works for you too.
to disable the code just add // before elseif and throw or just delete it.

VERY IMPORTANT!: with this enabled once the user logs out he/she can't level up any of the adopts. this means not even guest can help the adopts to grow up. maybe someone can find a way to allow guest to level the adopts...

take in mind that the daycare will not work correctly with this, so you will probably need to disable the daycare or edit it to show only the owned adoptables... but for that you just need to go to the myadopt page to see them. so there's no point for the daycare.
Hmm, I tried the steps you put in quotes, but it didn't work >_< it was allowing the clicks anyway and I was a little confused on the first steps you mentioned that might not work if the files are modified. I'm not sure if my files are considered heavily modified or not, I didn't set any of them up. they were all installed when I got my hosting through Mysidia when I signed up. Thanks for helping me! I really appreciate it.
__________________
"You try you fail, you try you fail, but the only true failure is if you stop trying. So try again." - Haunted Mansion
Reply With Quote