Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Thread Tools Display Modes
Old 08-05-2020, 11:50 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 191
Gender: Female
Credits: 15,644
Default Enable/Disable Daily clicks for the users

i think the daily click is a useful function, but when you have a small site or have limited the daycare to show only some levels or give really small amounts of money for each click... it seems not so needed...
the temporal solution was to increase the number to the amount of current owned adoptables. But someone asked in the chat if there was a way to disable the option... the easy way was to remove the code that gives the error once you reached the limit... but if one day you want to enable the daily click you have to add that code again. So after looking at the code i came with the idea of adding an enable and disable option.

first you need to insert a new row in the levels_settings table in the database
name: linumber
value: disabled
should look similar to this:

now open your level.php in the admincp folder and search for: public function settings(){

you will add: , 'linumber' after 'user'
it should look like this:
PHP Code:
$settings = array('system''method''maximum''clicks',  
save the file and now open levelview.php in the view folder of admincp
look for:
PHP Code:
           $levelUser = clone $levelSystem
you will add below this:
PHP Code:
        $levelLinumber = clone $levelSystem
then look for
PHP Code:
                     ->buildComment("Maximum Number of adoptables allowed for daily clicks:   "FALSE)->buildTextField("number"$levelSettings->number
on top of it you will add this:
PHP Code:
                     ->buildComment("Enable or disable the daily clicks:    "FALSE)->buildRadioList("linumber"$levelLinumber$levelSettings->linumber
in the end it should look like this:
PHP Code:
        $levelOwner = clone $levelSystem;
$levelUser = clone $levelSystem;
$levelLinumber = clone $levelSystem;
$settingsForm->buildComment("Level-Clicks System Enabled:   "FALSE)->buildRadioList("system"$levelSystem$levelSettings->system)
buildComment("Level-Clicks Mechanism:   "FALSE)->buildRadioList("method"$levelMethod$levelSettings->method)
buildComment("Max-Level allowed for all Species:     "FALSE)->buildTextField("maximum"$levelSettings->maximum)                 
buildComment("Required Clicks Patterns:   "FALSE)->buildTextField("clicks", ($levelSettings->clicks)?implode(","$levelSettings->clicks):"")
buildComment("Enable or disable the daily clicks:    "FALSE)->buildRadioList("linumber"$levelLinumber$levelSettings->linumber)
buildComment("Maximum Number of adoptables allowed for daily clicks:   "FALSE)->buildTextField("number"$levelSettings->number)
buildComment("Min and Max Money Reward for clicking adoptables(separate by comma):    "FALSE)->buildTextField("reward"implode(","$levelSettings->reward))
buildComment("Allow Users to click their own pets:    "FALSE)->buildRadioList("owner"$levelOwner$levelSettings->owner)    
buildComment("Allow Users to click all the pets:    "FALSE)->buildRadioList("user"$levelUser$levelSettings->user)    
buildButton("Change Level Settings""submit""submit");
save and now open levelup.php in the public folder
look for
PHP Code:
  elseif($mysidia->user->getVotes() > $this->settings->number) throw new LevelupException("number"); 
and replace with:
PHP Code:
 elseif($mysidia->user->getVotes() > $this->settings->number and $this->settings->linumber == "enabled") throw new LevelupException("number"); 
and you are done, you can now enable or disable the daily clicks from the admincp
Reply With Quote
Old 08-05-2020, 11:59 AM
Missy Master's Avatar
Missy Master Missy Master is offline
Join Date: Jan 2010
Posts: 464
Gender: Unknown/Other
Credits: 18,334
Missy Master is an unknown quantity at this point

Thank you for this!! Can't wait to try it!
Reply With Quote

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 08:39 AM.

Currently Active Users: 353 (1 members and 352 guests)
Threads: 4,025, Posts: 31,703, Members: 15,672
Welcome to our newest members, Meimbel.

What's New?

What's Hot?

What's Popular?

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