Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-08-2020, 01:43 AM
Micolai's Avatar
Micolai Micolai is offline
Loving Mysidia!
 
Join Date: May 2020
Location: Tennessee
Posts: 130
Gender: Female
Credits: 26,500
Micolai is on a distinguished road
Smile Disabling clicks by other users

RESOLVED

I feel like I've been posting a lot lately lol sorry guys... I'm wondering if there is a way for me to disable clicks by other users. Meaning, say I'm a member, I can click my horse, but other people can't. How could I set this up?

The reason I'm wanting to do this is I plan to turn the 'Level up' system into a raising system, where I change the level up title to 'Feed' that way the member basically feeds their horse themselves everyday and that raises the adoptable to get them to age.
__________________
"You try you fail, you try you fail, but the only true failure is if you stop trying. So try again." - Haunted Mansion

Last edited by Micolai; 06-09-2020 at 03:15 PM. Reason: Issue resolved
Reply With Quote
  #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,043
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
  #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: 26,500
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
  #4  
Old 06-09-2020, 09:28 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,043
kristhasirah
Default

weird the code is not working for you, i tested it many times and worked, I even manage to make it part of the options in the admin panel, like the disable user to click their own adopts.
i can't truly help you with the other option, my levelup is very edited, i did try to add the first option to the levelupview.php, and got the message i can't feed others adopts, but the click still counted and got the same result in the levelup.php the click still counted.

the code in the quotes should work, because based on something that's already in the site... the other option i can think is to edit directly the
PHP Code:
        elseif($this->settings->owner == "disabled" and $this->adopt->getOwner() == $mysidia->user->username){
             throw new 
LevelupException("owner");               
        } 
to something like this:
PHP Code:
        elseif($this->adopt->getOwner() != $mysidia->user->username){
             throw new 
LevelupException("owner");               
        } 
or like this:
PHP Code:
        elseif($this->settings->owner == "enabled" and $this->adopt->getOwner() != $mysidia->user->username){
             throw new 
LevelupException("owner");               
        } 
if one of that options works then just edit the lang_levelup $owner to the message you want to display.
The only thing about editing this code is that the option to enable/disable the user to click their own adopts will become unusable, but if the second option works, then it will become the option to enable/disable the users from clicking others adopts.

just remember to backup your file before adding/editing something.
sorry I can't be of more help in this area. and sorry if i don't make sense some times... English is not my native language, so most of the time is kind of complicated for me to explain something >_>
__________________
Reply With Quote
  #5  
Old 06-09-2020, 03:14 PM
Micolai's Avatar
Micolai Micolai is offline
Loving Mysidia!
 
Join Date: May 2020
Location: Tennessee
Posts: 130
Gender: Female
Credits: 26,500
Micolai is on a distinguished road
Default

Okay, so, your very first post the "Easy way" quoted example was right. I wasn't adding the code in the right spot and it now works. Thank you so very much for your help!
__________________
"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
  #6  
Old 06-09-2020, 03:46 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,043
kristhasirah
Default

glad it worked for you ^^
__________________
Reply With Quote
  #7  
Old 06-09-2020, 04:03 PM
Micolai's Avatar
Micolai Micolai is offline
Loving Mysidia!
 
Join Date: May 2020
Location: Tennessee
Posts: 130
Gender: Female
Credits: 26,500
Micolai is on a distinguished road
Default

Quote:
Originally Posted by kristhasirah View Post
glad it worked for you ^^
I really do appreciate the help :D it's been a dream of mine for a really long time to get this up and running and I feel like for the most part what stuff I want is easy stuff, just time consuming and I don't always know what I need to do to get what I am wanting done, etc so I end up having to ask questions a lot lol. But I feel like I usually follow tutorials pretty well. One of my friends is helping me learn where certain files are in the system because a big problem was me not knowing where I needed to go in my stuff to do certain things, etc.

Is there by chance a way I can easier contact you to ask you questions? If not that's okay, I just know these forums are a little slow at getting answers lol. I don't have many things right now I'm needing help with, just a couple.
__________________
"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
  #8  
Old 06-10-2020, 08:16 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,043
kristhasirah
Default

is more easy for me here in the forum, usually i check it every 2 hours XD
but if for some reason cant find me, the you can contact me on discord, or by email.
(will send the info by a pm ^^)
__________________
Reply With Quote
  #9  
Old 06-10-2020, 05:48 PM
Micolai's Avatar
Micolai Micolai is offline
Loving Mysidia!
 
Join Date: May 2020
Location: Tennessee
Posts: 130
Gender: Female
Credits: 26,500
Micolai is on a distinguished road
Default

Thank you!
__________________
"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
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:57 AM.

Currently Active Users: 416 (0 members and 416 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636