[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/inc/tasks/ -> hourlycleanup.php (source)

   1  <?php
   2  /**
   3   * MyBB 1.6
   4   * Copyright 2010 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://mybb.com
   7   * License: http://mybb.com/about/license
   8   *
   9   * $Id$
  10   */
  11  
  12  function task_hourlycleanup($task)
  13  {
  14      global $db, $lang;
  15      
  16      $threads = array();
  17      $posts = array();
  18  
  19      // Delete moved threads with time limits
  20      $db->delete_query("threads", "deletetime != '0' AND deletetime < '".TIME_NOW."'");
  21      
  22      // Delete old searches
  23      $cut = TIME_NOW-(60*60*24);
  24      $db->delete_query("searchlog", "dateline < '{$cut}'");
  25  
  26      // Delete old captcha images
  27      $cut = TIME_NOW-(60*60*24);
  28      $db->delete_query("captcha", "dateline < '{$cut}'");
  29      
  30      add_task_log($task, $lang->task_hourlycleanup_ran);
  31  }
  32  ?>


Generated: Tue Oct 8 19:19:50 2013 Cross-referenced by PHPXref 0.7.1