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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2020, 11:50 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,049
kristhasirah
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:
        if($mysidia->input->post("submit")){
            
$settings = array('system''method''maximum''clicks',  
                              
'number''reward''owner''user''linumber'); 
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($this->lang->method_explain)
                     ->
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($this->lang->clicks_explain)
                     ->
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($this->lang->number_explain)
                     ->
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($this->lang->owner_explain)    
                     ->
buildComment("Allow Users to click all the pets:    "FALSE)->buildRadioList("user"$levelUser$levelSettings->user)    
                     ->
buildComment($this->lang->user_explain)             
                     ->
buildButton("Change Level Settings""submit""submit");
        
$document->add($settingsForm); 
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
  #2  
Old 08-05-2020, 11:59 AM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 44,524
Missy Master is an unknown quantity at this point
Default

Thank you for this!! Can't wait to try it!
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 04:12 PM.

Currently Active Users: 457 (0 members and 457 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