[ Index ]

PHP Cross Reference of MyBB 1.8.29

title

Body

[close]

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

   1  <?php
   2  /**
   3   * MyBB 1.8
   4   * Copyright 2014 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://www.mybb.com
   7   * License: http://www.mybb.com/about/license
   8   *
   9   */
  10  
  11  function task_logcleanup($task)
  12  {
  13      global $mybb, $db, $lang, $plugins;
  14  
  15      // Clear out old admin logs
  16      if($mybb->config['log_pruning']['admin_logs'] > 0)
  17      {
  18          $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['admin_logs'];
  19          $db->delete_query("adminlog", "dateline<'{$cut}'");
  20      }
  21  
  22      // Clear out old moderator logs
  23      if($mybb->config['log_pruning']['mod_logs'] > 0)
  24      {
  25          $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['mod_logs'];
  26          $db->delete_query("moderatorlog", "dateline<'{$cut}'");
  27      }
  28  
  29      // Clear out old task logs
  30      if($mybb->config['log_pruning']['task_logs'] > 0)
  31      {
  32          $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['task_logs'];
  33          $db->delete_query("tasklog", "dateline<'{$cut}'");
  34      }
  35  
  36      // Clear out old mail error logs
  37      if($mybb->config['log_pruning']['mail_logs'] > 0)
  38      {
  39          $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['mail_logs'];
  40          $db->delete_query("mailerrors", "dateline<'{$cut}'");
  41      }
  42  
  43      // Clear out old user mail logs
  44      if($mybb->config['log_pruning']['user_mail_logs'] > 0)
  45      {
  46          $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['user_mail_logs'];
  47          $db->delete_query("maillogs", "dateline<'{$cut}'");
  48      }
  49  
  50      // Clear out old promotion logs
  51      if($mybb->config['log_pruning']['promotion_logs'] > 0)
  52      {
  53          $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['promotion_logs'];
  54          $db->delete_query("promotionlogs", "dateline<'{$cut}'");
  55      }
  56  
  57      if(is_object($plugins))
  58      {
  59          $plugins->run_hooks('task_logcleanup', $task);
  60      }
  61  
  62      add_task_log($task, $lang->task_logcleanup_ran);
  63  }


2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref