Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/sfoyston/public_html/TextStorm/Wiki/inc/init.php on line 560
Warning: Cannot modify header information - headers already sent by (output started at /home/sfoyston/public_html/TextStorm/Wiki/inc/init.php:560) in /home/sfoyston/public_html/TextStorm/Wiki/inc/auth.php on line 495
Warning: Cannot modify header information - headers already sent by (output started at /home/sfoyston/public_html/TextStorm/Wiki/inc/init.php:560) in /home/sfoyston/public_html/TextStorm/Wiki/inc/actions.php on line 687
Warning: Cannot modify header information - headers already sent by (output started at /home/sfoyston/public_html/TextStorm/Wiki/inc/init.php:560) in /home/sfoyston/public_html/TextStorm/Wiki/inc/actions.php on line 687
Warning: Cannot modify header information - headers already sent by (output started at /home/sfoyston/public_html/TextStorm/Wiki/inc/init.php:560) in /home/sfoyston/public_html/TextStorm/Wiki/inc/actions.php on line 687
====== Schedule Development ======
This page will cover the requirements for developing SchedMan schedules and activating them.
===== Important Notes =====
Please make sure you have set up your Cron Job as specified when you first installed the game engine, if you have not set up a Cron Job, SchedMan and some other features such as Auctions may not work correctly.
The //$db// database object **is** available to use in all schedules.
You **will not** be able to instantiate the //User class// or //use any functions// with schedules.
===== Schedule Structure =====
Start with the below code structure and add your own code underneath the "Put your schedule code here" comment:
rowCount();) it will store how many rows were affected the last time the schedule ran
$db->query("UPDATE scheduler SET rowsaff = '$count', running = '0' WHERE schedref = '$schedref'");
}
?>
The below code is an example of a simple schedule to clear down old Administration Panel logs:
modify('-30 day');
$deldate = $dategen->format('Y-m-d');
$del = $db->query("DELETE FROM panel_logs WHERE logdate < '$deldate'");
$count = $del->rowCount();
$db->query("UPDATE scheduler SET rowsaff = '$count' WHERE schedref = '$schedref'");
}
?>
===== Adding a Schedule to SchedMan =====
Navigate to SchedMan and go to the "Create" page. You should see something similar to below.
{{:schedman.png?200|}}
To add the schedule fill the boxes in with the following values:
**SchedRef:** The schedule reference you assigned to $schedref in the code
**Description:** A description of what the schedule does
**File:** Put the PHP file for the schedule you've developed in the following location - http://www.yourgame.com/AdMiN/includes/schedules/ - put the name of the file in the box (**example.php**)
**Time To Add:** Enter how often you would like the schedule to run in **Minutes**