cleanup_monthly.inc.php

来自「php最好的论坛程序! php最好的论坛程序! php最好的论坛程序!」· PHP 代码 · 共 28 行

PHP
28
字号
<?php

/*
	[Discuz!] (C)2001-2006 Comsenz Inc.
	This is NOT a freeware, use is subject to license terms

	$RCSfile: cleanup_monthly.inc.php,v $
	$Revision: 1.5.2.2 $
	$Date: 2006/07/17 07:50:18 $
*/

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$myrecordtimes = $_DCACHE['settings']['myrecorddays'] * 86400;
$db->query("DELETE FROM {$tablepre}mythreads WHERE dateline<'$timestamp'-'$myrecordtimes'", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}myposts WHERE dateline<'$timestamp'-'$myrecordtimes'", 'UNBUFFERED');

$db->query("DELETE {$tablepre}favorites FROM {$tablepre}favorites LEFT JOIN {$tablepre}forums USING(fid) WHERE {$tablepre}favorites.fid>0 AND {$tablepre}forums.fid IS NULL");
$db->query("DELETE {$tablepre}favorites FROM {$tablepre}favorites LEFT JOIN {$tablepre}threads USING(tid) WHERE {$tablepre}favorites.tid>0 AND {$tablepre}threads.tid IS NULL");

$db->query("DELETE {$tablepre}rewardlog FROM {$tablepre}rewardlog LEFT JOIN {$tablepre}threads USING(tid) WHERE {$tablepre}threads.tid IS NULL", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}tradelog WHERE orderid<='".date('Ymd', $timestamp-5*86400)."'", 'UNBUFFERED');

$db->query("TRUNCATE {$tablepre}relatedthreads");

?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?