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 05-27-2017, 02:45 AM
KatFennec's Avatar
KatFennec KatFennec is offline
Member
 
Join Date: Apr 2017
Posts: 57
Gender: Female
Credits: 9,556
KatFennec is on a distinguished road
Default Cron Job help

I'm trying to set up cron jobs to decrease a stat several times a day on each adoptable, but I'm running into some trouble and I'm not sure if it's the cron job itself or the PHP. Note that I'm specifically interested in Cron Jobs, not scheduled tasks.



cron.php
PHP Code:
<?php
class CronController extends AppController{

    public function 
__construct(){

    }
    
    public function 
index(){

    }
    
    public function 
lowerFullness() {
        
$mysidia Registry::get("mysidia");
        
$mysidia->db->update("owned_adoptables", array("fullness" => -10));
    }
    
}  
?>
__________________
Reply With Quote
  #2  
Old 05-28-2017, 08:31 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 79,264
Dinocanid is on a distinguished road
Default

I wanted to rip my hair out so bad trying to figure this out a long time ago, but I found the answer a few minutes ago!

There is actually nothing wrong with your cron.php. When you create the cronjob in cPanel, the command has to be:
So replace 'function' with whatever function you are trying to run in cron.php and it should work.

EDIT: Also apparently using math right there with UPDATE will not work. See here for a fix
__________________

Last edited by Dinocanid; 05-28-2017 at 09:21 PM.
Reply With Quote
  #3  
Old 05-29-2017, 12:13 AM
KatFennec's Avatar
KatFennec KatFennec is offline
Member
 
Join Date: Apr 2017
Posts: 57
Gender: Female
Credits: 9,556
KatFennec is on a distinguished road
Default

That did it, thanks for the help!
__________________
Reply With Quote
Reply


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 02:53 PM.

Currently Active Users: 884 (0 members and 884 guests)
Threads: 4,081, Posts: 32,032, 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