todayposts_daily.inc.php

来自「论坛代码网增加免费空间业务」· PHP 代码 · 共 28 行

PHP
28
字号
<?php

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

	$Id: todayposts_daily.inc.php 10920 2007-10-19 00:53:10Z monkey $
*/

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

$yesterdayposts = intval($db->result_first("SELECT sum(todayposts) FROM {$tablepre}forums"));

$historypost = $db->result_first("SELECT value FROM {$tablepre}settings WHERE variable='historyposts'");

$hpostarray = explode("\t", $historypost);
$historyposts = $hpostarray[1] < $yesterdayposts ? "$yesterdayposts\t$yesterdayposts" : "$yesterdayposts\t$hpostarray[1]";

$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('historyposts', '$historyposts')");
$db->query("UPDATE {$tablepre}forums SET todayposts='0'");

require_once DISCUZ_ROOT.'./include/cache.func.php';
$_DCACHE['settings']['historyposts'] = $historyposts;
updatesettings();

?>

⌨️ 快捷键说明

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