View Single Post
  #2  
Old 06-08-2020, 09:04 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,393
kristhasirah
Default

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.
__________________

Last edited by kristhasirah; 06-08-2020 at 09:40 AM.
Reply With Quote