File: /var/www/ilya/data/www/kamforum.ru/sources/tasks/warndeleter.php
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.1.x DB Optimizer Task
| =============================================
| by .silent
+---------------------------------------------------------------------------
|
| > TASK SCRIPT: Optimize forum database tables
| > Script written by .silent
| > Date started: 08st March 2006 (09:35)
|
+--------------------------------------------------------------------------
*/
//-----------------------------------------
// THIS TASKS OPERATIONS:
// Optimize database tables
//+----------------------------------------
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
$tableNames = $this->ipsclass->DB->get_table_names();
$this->ipsclass->DB->query( "DELETE FROM `ibf_warn_logs` WHERE `wlog_date`<".(time()-7776000).";");
if ( count( $tableNames ) )
{
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->append_task_log( $this->task, 'Deleting old warns was completed successefully' );
}
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlock_task( $this->task );
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->ipsclass =& $class->ipsclass;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>