[ Index ] |
PHP Cross Reference of MyBB |
[Summary view] [Print] [Text view]
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: logcleanup.php 5297 2010-12-28 22:01:14Z Tomm $ 10 */ 11 12 function task_logcleanup($task) 13 { 14 global $mybb, $db, $lang; 15 16 // Clear out old admin logs 17 if($mybb->config['log_pruning']['admin_logs'] > 0) 18 { 19 $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['admin_logs']; 20 $db->delete_query("adminlog", "dateline<'{$cut}'"); 21 } 22 23 // Clear out old moderator logs 24 if($mybb->config['log_pruning']['mod_logs'] > 0) 25 { 26 $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['mod_logs']; 27 $db->delete_query("moderatorlog", "dateline<'{$cut}'"); 28 } 29 30 // Clear out old task logs 31 if($mybb->config['log_pruning']['task_logs'] > 0) 32 { 33 $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['task_logs']; 34 $db->delete_query("tasklog", "dateline<'{$cut}'"); 35 } 36 37 // Clear out old mail error logs 38 if($mybb->config['log_pruning']['mail_logs'] > 0) 39 { 40 $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['mail_logs']; 41 $db->delete_query("mailerrors", "dateline<'{$cut}'"); 42 } 43 44 // Clear out old user mail logs 45 if($mybb->config['log_pruning']['user_mail_logs'] > 0) 46 { 47 $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['user_mail_logs']; 48 $db->delete_query("maillogs", "dateline<'{$cut}'"); 49 } 50 51 // Clear out old promotion logs 52 if($mybb->config['log_pruning']['promotion_logs'] > 0) 53 { 54 $cut = TIME_NOW-60*60*24*$mybb->config['log_pruning']['promotion_logs']; 55 $db->delete_query("promotionlogs", "dateline<'{$cut}'"); 56 } 57 58 add_task_log($task, $lang->task_logcleanup_ran); 59 } 60 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Oct 8 19:19:50 2013 | Cross-referenced by PHPXref 0.7.1 |