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 210
schedule_development - TextStorm Wiki

The Wiki is still in development, please bare with us while we add and update content.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
schedule_development [2016/12/08 22:07]
textstorm
schedule_development [2016/12/08 22:10] (current)
textstorm
Line 9: Line 9:
 You **will not** be able to instantiate the //User class// or //use any functions// with schedules. You **will not** be able to instantiate the //User class// or //use any functions// with schedules.
 ===== Schedule Structure ===== ===== Schedule Structure =====
-Start with the below code structure:+Start with the below code structure ​and add your own code underneath the "Put your schedule code here" comment:
 <file php ScheduleStructure.php>​ <file php ScheduleStructure.php>​
 <?php <?php
Line 21: Line 21:
         //set $count to the number of rows you have updated ($queryresult->​rowCount();​) it will store how many rows were affected the last time the schedule ran         //set $count to the number of rows you have updated ($queryresult->​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'"​);​  $db->​query("​UPDATE scheduler SET rowsaff = '​$count',​ running = '​0'​ WHERE schedref = '​$schedref'"​);​
 +}
 +?>
 +</​file>​
 +
 +The below code is an example of a simple schedule to clear down old Administration Panel logs:
 +<file php ClearAdminLogsSchedule.php>​
 +<?php
 +if($caller) {
 + $schedref = "​LOG1";​
 + $date = date("​Y-m-d"​);​
 + $dategen = new DateTime($date);​
 + $dategen->​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'"​);​
 } }
 ?> ?>

QR Code
QR Code schedule_development (generated for current page)