First commit

This commit is contained in:
2025-06-18 10:24:27 +08:00
commit ebc39cd5dd
3873 changed files with 412712 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_announcement_daily.php 25786 2011-11-22 06:17:25Z zhengqingpeng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$delnum = C::t('forum_announcement')->delete_all_by_endtime($_G['timestamp']);
if($delnum) {
require_once libfile('function/cache');
updatecache(array('announcements', 'announcements_forum'));
}
?>

View File

@@ -0,0 +1,21 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_cleanfeed.php 29135 2012-03-27 08:25:02Z zhengqingpeng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if($_G['setting']['feedday'] < 3) $_G['setting']['feedday'] = 3;
$deltime = $_G['timestamp'] - $_G['setting']['feedday']*3600*24;
$f_deltime = $_G['timestamp'] - $_G['setting']['feedday']*3600*24;
C::t('home_feed')->delete_by_dateline($deltime);
C::t('home_feed')->optimize_table();
?>

View File

@@ -0,0 +1,22 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_cleannotification.php 24556 2011-09-26 06:16:03Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
C::t('home_notification')->delete_clear(0, 2);
C::t('home_notification')->delete_clear(1, 30);
$deltime = $_G['timestamp'] - 7*3600*24;
C::t('home_pokearchive')->delete_by_dateline($deltime);
C::t('home_notification')->optimize();
?>

View File

@@ -0,0 +1,21 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_cleantrace.php 24958 2011-10-19 02:54:32Z zhengqingpeng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$maxday = 90;
$deltime = $_G['timestamp'] - $maxday*3600*24;
C::t('home_clickuser')->delete_by_dateline($deltime);
C::t('home_visitor')->delete_by_dateline($deltime);
?>

View File

@@ -0,0 +1,146 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_cleanup_daily.php 33675 2013-08-01 02:09:09Z nemohou $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
require_once libfile('function/cache');
updatecache('forumrecommend');
if(C::t('common_advertisement')->close_endtime()) {
updatecache(array('setting', 'advs'));
}
C::t('forum_threaddisablepos')->truncate();
C::t('common_searchindex')->truncate();
C::t('forum_threadmod')->delete_by_dateline($_G['timestamp']-31536000);
C::t('forum_forumrecommend')->delete_old();
C::t('home_visitor')->delete_by_dateline($_G['timestamp']-7776000);
C::t('forum_postcache')->delete_by_dateline(TIMESTAMP-86400);
C::t('forum_newthread')->delete_by_dateline(TIMESTAMP-1296000);
C::t('common_seccheck')->truncate();
if($_G['setting']['heatthread']['type'] == 2 && $_G['setting']['heatthread']['period']) {
$partakeperoid = 86400 * $_G['setting']['heatthread']['period'];
C::t('forum_threadpartake')->delete_threadpartake($_G['timestamp'] - $partakeperoid);
}
C::t('common_member_count')->clear_today_data();
C::t('forum_trade')->update_closed($_G['timestamp']);
C::t('forum_tradelog')->clear_failure(7);
C::t('forum_tradelog')->expiration_payed(7);
C::t('forum_tradelog')->expiration_finished(7);
if($_G['setting']['cachethreadon']) {
removedir($_G['setting']['cachethreaddir'], TRUE);
touch($_G['setting']['cachethreaddir'].'/index.htm');
}
removedir($_G['setting']['attachdir'].'image', TRUE);
@touch($_G['setting']['attachdir'].'image/index.htm');
C::t('forum_attachment_unused')->clear();
C::t('forum_polloption_image')->clear();
$uids = $members = array();
$members = C::t('common_member')->fetch_all_ban_by_groupexpiry(TIMESTAMP);
if(($uids = array_keys($members))) {
$setarr = array();
foreach(C::t('common_member_field_forum')->fetch_all($uids) as $uid => $member) {
$member['groupterms'] = dunserialize($member['groupterms']);
$member['groupid'] = $members[$uid]['groupid'];
$member['credits'] = $members[$uid]['credits'];
if(!empty($member['groupterms']['main']['groupid'])) {
$groupidnew = $member['groupterms']['main']['groupid'];
$adminidnew = $member['groupterms']['main']['adminid'];
unset($member['groupterms']['main']);
unset($member['groupterms']['ext'][$member['groupid']]);
$setarr['groupexpiry'] = groupexpiry($member['groupterms']);
} else {
$query = C::t('common_usergroup')->fetch_by_credits($member['credits'], 'member');
$groupidnew = $query['groupid'];
$adminidnew = 0;
}
$setarr['adminid'] = $adminidnew;
$setarr['groupid'] = $groupidnew;
C::t('common_member')->update($uid, $setarr);
C::t('common_member_field_forum')->update($uid, array('groupterms' => ($member['groupterms'] ? serialize($member['groupterms']) : '')));
}
}
if(!empty($_G['setting']['advexpiration']['allow'])) {
$endtimenotice = mktime(0, 0, 0, date('m', TIMESTAMP), date('d', TIMESTAMP), date('Y', TIMESTAMP)) + $_G['setting']['advexpiration']['day'] * 86400;
$advs = array();
foreach(C::t('common_advertisement')->fetch_all_endtime($endtimenotice) as $adv) {
$advs[] = '<a href="admin.php?action=adv&operation=edit&advid='.$adv['advid'].'" target="_blank">'.$adv['title'].'</a>';
}
if($advs) {
$users = explode("\n", $_G['setting']['advexpiration']['users']);
$users = array_map('trim', $users);
if($users) {
foreach(C::t('common_member')->fetch_all_by_username($users) as $member) {
$noticelang = array('day' => $_G['setting']['advexpiration']['day'], 'advs' => implode("<br />", $advs), 'from_id' => 0, 'from_idtype' => 'advexpire');
if(in_array('notice', $_G['setting']['advexpiration']['method'])) {
notification_add($member['uid'], 'system', 'system_adv_expiration', $noticelang, 1);
}
if(in_array('mail', $_G['setting']['advexpiration']['method'])) {
$advexpvar = array(
'tpl' => 'adv_expiration',
'var' => $noticelang,
'svar' => $noticelang,
);
if(!sendmail("{$member['username']} <{$member['email']}>", $advexpvar)) {
runlog('sendmail', "{$member['email']} sendmail failed.");
}
}
}
}
}
}
$count = C::t('common_card')->count_by_where("status = '1' AND cleardateline <= '{$_G['timestamp']}'");
if($count) {
C::t('common_card')->update_to_overdue($_G['timestamp']);
$card_info = serialize(array('num' => $count));
$cardlog = array(
'info' => $card_info,
'dateline' => $_G['timestamp'],
'operation' => 9
);
C::t('common_card_log')->insert($cardlog);
}
C::t('common_member_action_log')->delete_by_dateline($_G['timestamp'] - 86400);
C::t('forum_collectioninvite')->delete_by_dateline($_G['timestamp'] - 86400*7);
loadcache('seccodedata', true);
$_G['cache']['seccodedata']['register']['show'] = 0;
savecache('seccodedata', $_G['cache']['seccodedata']);
function removedir($dirname, $keepdir = FALSE) {
$dirname = str_replace(array( "\n", "\r", '..'), array('', '', ''), $dirname);
if(!is_dir($dirname)) {
return FALSE;
}
$handle = opendir($dirname);
while(($file = readdir($handle)) !== FALSE) {
if($file != '.' && $file != '..') {
$dir = $dirname . DIRECTORY_SEPARATOR . $file;
is_dir($dir) ? removedir($dir) : unlink($dir);
}
}
closedir($handle);
return !$keepdir ? (@rmdir($dirname) ? TRUE : FALSE) : TRUE;
}
?>

View File

@@ -0,0 +1,17 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_cleanup_monthly.php 26922 2011-12-27 10:00:36Z svn_project_zhangjie $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
C::t('common_mytask')->delete_exceed(2592000);
?>

View File

@@ -0,0 +1,20 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_follow_daily.php 25889 2011-11-24 09:52:20Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$removetime = TIMESTAMP - $_G['setting']['followretainday'] * 86400;
foreach(C::t('home_follow_feed')->fetch_all_by_dateline($removetime, '<=') as $feed) {
C::t('home_follow_feed')->insert_archiver($feed);
C::t('home_follow_feed')->delete($feed['feedid']);
}
?>

View File

@@ -0,0 +1,41 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_magic_daily.php 24589 2011-09-27 07:45:55Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if(!empty($_G['setting']['magicstatus'])) {
$magicarray = array();
foreach(C::t('common_magic')->fetch_all_data(1) as $magic) {
if($magic['supplytype'] && $magic['supplynum']) {
$magicarray[$magic['magicid']]['supplytype'] = $magic['supplytype'];
$magicarray[$magic['magicid']]['supplynum'] = $magic['supplynum'];
}
}
list($daynow, $weekdaynow) = explode('-', dgmdate(TIMESTAMP, 'd-w', $_G['setting']['timeoffset']));
foreach($magicarray as $id => $magic) {
$autosupply = 0;
if($magic['supplytype'] == 1) {
$autosupply = 1;
} elseif($magic['supplytype'] == 2 && $weekdaynow == 1) {
$autosupply = 1;
} elseif($magic['supplytype'] == 3 && $daynow == 1) {
$autosupply = 1;
}
if(!empty($autosupply)) {
C::t('common_magic')->update($id, array('num' => $magic['supplynum']));
}
}
}
?>

View File

@@ -0,0 +1,42 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_medal_daily.php 24698 2011-10-08 08:36:47Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$medalnewarray = $medalsnew = $uids = array();
foreach(C::t('forum_medallog')->fetch_all_by_expiration(TIMESTAMP) as $medalnew) {
$uids[] = $medalnew['uid'];
$medalnews[] = $medalnew;
}
$membermedals = array();
foreach(C::t('common_member_field_forum')->fetch_all($uids) as $member) {
$membermedals[$member['uid']] = $member['medals'];
}
foreach($medalnews as $medalnew) {
$medalnew['medals'] = empty($medalnewarray[$medalnew['uid']]) ? explode("\t", $membermedals[$medalnew['uid']]) : explode("\t", $medalnewarray[$medalnew['uid']]);
foreach($medalnew['medals'] as $key => $medalnewid) {
list($medalid, $medalexpiration) = explode("|", $medalnewid);
if($medalnew['medalid'] == $medalid) {
unset($medalnew['medals'][$key]);
}
}
$medalnewarray[$medalnew['uid']] = implode("\t", $medalnew['medals']);
C::t('forum_medallog')->update($medalnew['id'], array('status' => 0));
C::t('common_member_field_forum')->update($medalnew['uid'], array('medals' => $medalnewarray[$medalnew['uid']]), 'UNBUFFERED');
C::t('common_member_medal')->delete_by_uid_medalid($medalnew['uid'], $medalnew['medalid']);
}
?>

View File

@@ -0,0 +1,18 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_member_optimize_daily.php 28623 2012-03-06 09:01:58Z zhangguosheng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if(getglobal('setting/membersplit')) {
C::t('common_member')->split(100);
}
?>

View File

@@ -0,0 +1,16 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_onlinetime_monthly.php 24402 2011-09-16 12:18:32Z zhengqingpeng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
C::t('common_onlinetime')->update_thismonth();
?>

View File

@@ -0,0 +1,17 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_promotion_hourly.php 24377 2011-09-15 11:02:12Z zhengqingpeng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
C::t('forum_promotion')->delete_all();
?>

View File

@@ -0,0 +1,52 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_publish_halfhourly.php 31463 2012-08-30 08:59:17Z zhangguosheng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
require_once libfile('function/forum');
require_once libfile('function/post');
loadcache('cronpublish');
$dataChanged = false;
$cron_publish_ids = array();
$cron_publish_ids = getglobal('cache/cronpublish');
if (is_array($cron_publish_ids) && count($cron_publish_ids) > 0) {
$threadall = C::t('forum_thread')->fetch_all_by_tid($cron_publish_ids);
foreach ($cron_publish_ids as $tid) {
if(!$threadall[$tid]) {
unset($cron_publish_ids[$tid]);
$dataChanged = true;
}
}
foreach ($threadall as $stid=>$sdata) {
if ($sdata['dateline'] <= getglobal('timestamp')) {
threadpubsave($stid, true);
unset($cron_publish_ids[$stid]);
$dataChanged = true;
}
}
if ($dataChanged === true) {
savecache('cronpublish', $cron_publish_ids);
}
}
if (!is_array($cron_publish_ids)) {
$cron_publish_try = dunserialize($cron_publish_ids);
if (!is_array($cron_publish_try)) {
$cron_publish_try = array();
}
savecache('cronpublish', $cron_publish_try);
}
?>

View File

@@ -0,0 +1,19 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_secqaa_daily.php 6752 2010-03-25 08:47:54Z cnteacher $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if($_G['setting']['secqaa']['status'] > 0) {
require_once libfile('function/cache');
updatecache('secqaa');
}
?>

View File

@@ -0,0 +1,22 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_security_daily.php 29568 2012-04-19 03:39:25Z songlixin $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$queryf = C::t('forum_forum')->fetch_all_fids();
foreach($queryf as $forum) {
$thread = C::t('forum_thread')->fetch_by_fid_displayorder($forum['fid']);
$thread['shortsubject'] = cutstr($thread['subject'], 80);
$lastpost = "{$thread['tid']}\t{$thread['shortsubject']}\t{$thread['lastpost']}\t{$thread['lastposter']}";
C::t('forum_forum')->update($forum['fid'], array('lastpost' => $lastpost));
}
?>

View File

@@ -0,0 +1,18 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id$
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$removetime = TIMESTAMP - $_G['setting']['smstimelimit'] + 86400;
foreach(C::t('common_smslog')->fetch_all_by_dateline($removetime, '<=') as $smslog) {
C::t('common_smslog')->insert_archiver($smslog);
C::t('common_smslog')->delete($smslog['smslogid']);
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_tag_daily.php 27449 2012-02-01 05:32:35Z zhangguosheng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
?>

View File

@@ -0,0 +1,86 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_threadexpiry_hourly.php 33625 2013-07-19 06:03:49Z nemohou $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
C::t('common_seccheck')->delete_expiration();
$actionarray = array();
foreach(C::t('forum_threadmod')->fetch_all_by_expiration_status($_G['timestamp']) as $expiry) {
switch($expiry['action']) {
case 'EST': $actionarray['UES'][] = $expiry['tid']; break;
case 'EHL': $actionarray['UEH'][] = $expiry['tid']; break;
case 'ECL': $actionarray['UEC'][] = $expiry['tid']; break;
case 'EOP': $actionarray['UEO'][] = $expiry['tid']; break;
case 'EDI': $actionarray['UED'][] = $expiry['tid']; break;
case 'TOK': $actionarray['UES'][] = $expiry['tid']; break;
case 'CCK': $actionarray['UEH'][] = $expiry['tid']; break;
case 'CLK': $actionarray['UEC'][] = $expiry['tid']; break;
case 'SPA': $actionarray['SPD'][] = $expiry['tid']; break;
}
}
if($actionarray) {
foreach($actionarray as $action => $tids) {
switch($action) {
case 'UES':
C::t('forum_thread')->update($actionarray[$action], array('displayorder'=>0), true);
C::t('forum_threadmod')->update_by_tid_action($tids, array('EST', 'TOK'), array('status'=>0));
require_once libfile('function/cache');
updatecache('globalstick');
break;
case 'UEH':
C::t('forum_thread')->update($actionarray[$action], array('highlight'=>0), true);
C::t('forum_threadmod')->update_by_tid_action($tids, array('EHL', 'CCK'), array('status'=>0));
break;
case 'UEC':
case 'UEO':
$closed = $action == 'UEO' ? 1 : 0;
C::t('forum_thread')->update($actionarray[$action], array('closed'=>$closed), true);
C::t('forum_threadmod')->update_by_tid_action($tids, array('EOP', 'ECL', 'CLK'), array('status'=>0));
break;
case 'UED':
C::t('forum_threadmod')->update_by_tid_action($tids, array('EDI'), array('status'=>0));
$digestarray = $authoridarry = array();
foreach(C::t('forum_thread')->fetch_all_by_tid($actionarray[$action]) as $digest) {
$authoridarry[] = $digest['authorid'];
$digestarray[$digest['digest']][] = $digest['authorid'];
}
foreach($digestarray as $digest => $authorids) {
batchupdatecredit('digest', $authorids, array("digestposts=digestposts+'-1'"), -$digest, $fid = 0);
}
C::t('forum_thread')->update($actionarray[$action], array('digest'=>0), true);
break;
case 'SPD':
C::t('forum_thread')->update($actionarray[$action], array('stamp'=>-1), true);
C::t('forum_threadmod')->update_by_tid_action($tids, array('SPA'), array('status'=>0));
break;
}
}
require_once libfile('function/post');
foreach($actionarray as $action => $tids) {
updatemodlog(implode(',', $tids), $action, 0, 1);
}
}
?>

View File

@@ -0,0 +1,50 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_todayheats_daily.php 31913 2012-10-24 06:52:26Z zhengqingpeng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$yesterday = strtotime(dgmdate(TIMESTAMP, 'Y-m-d'))-86400;
$data = $tids = $fids = $hotnum = array();
$daystr = dgmdate($yesterday, 'Ymd');
foreach(C::t('forum_thread')->fetch_all_for_guide('hot', 0, array(), $_G['setting']['heatthread']['guidelimit'], $yesterday, 0, 0) as $thread) {
$data[$thread['tid']] = array(
'cid' => 0,
'fid' => $thread['fid'],
'tid' => $thread['tid']
);
$fids[$thread['fid']] = array('fid' => $thread['fid'], 'dateline' => $daystr, 'hotnum' => 0);
$tids[$thread['fid']][$thread['tid']] = $thread['tid'];
}
if($data) {
$cids = C::t('forum_threadcalendar')->fetch_all_by_fid_dateline(array_keys($fids), $daystr);
foreach($cids as $fid => $cinfo) {
$hotnum[$cinfo['cid']] = count($tids[$fid]);
foreach($tids[$fid] as $tid) {
$data[$tid]['cid'] = $cinfo['cid'];
}
unset($fids[$fid]);
}
if($fids) {
C::t('forum_threadcalendar')->insert_multiterm($fids);
foreach(C::t('forum_threadcalendar')->fetch_all_by_fid_dateline(array_keys($fids), $daystr) as $fid => $cinfo) {
$hotnum[$cinfo['cid']] = count($tids[$fid]);
foreach($tids[$fid] as $tid) {
$data[$tid]['cid'] = $cinfo['cid'];
}
}
}
C::t('forum_threadhot')->insert_multiterm($data);
foreach($hotnum as $cid => $num) {
C::t('forum_threadcalendar')->update($cid, array('hotnum' => $num));
}
}
?>

View File

@@ -0,0 +1,34 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_todaypost_daily.php 31920 2012-10-24 09:18:33Z zhengqingpeng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$yesterdayposts = intval(C::t('forum_forum')->fetch_sum_todaypost());
C::t('forum_forum')->update_oldrank_and_yesterdayposts();
$historypost = C::t('common_setting')->fetch_setting('historyposts');
$hpostarray = explode("\t", $historypost);
$_G['setting']['historyposts'] = $hpostarray[1] < $yesterdayposts ? "$yesterdayposts\t$yesterdayposts" : "$yesterdayposts\t$hpostarray[1]";
C::t('common_setting')->update_setting('historyposts', $_G['setting']['historyposts']);
$date = date('Y-m-d', TIMESTAMP - 86400);
C::t('forum_statlog')->insert_stat_log($date);
C::t('forum_forum')->clear_todayposts();
$rank = 1;
foreach(C::t('forum_statlog')->fetch_all_rank_by_logdate($date) as $value) {
C::t('forum_forum')->update($value['fid'], array('rank' => $rank));
$rank++;
}
savecache('historyposts', $_G['setting']['historyposts']);
?>

View File

@@ -0,0 +1,25 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cron_todayviews_daily.php 26812 2011-12-23 08:21:29Z zhangguosheng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$updateviews = array();
$deltids = array();
foreach(C::t('forum_threadaddviews')->fetch_all_order_by_tid(500) as $tid => $addview) {
$deltids[$tid] = $updateviews[$addview['addviews']][] = $tid;
}
if($deltids) {
C::t('forum_threadaddviews')->delete($deltids);
}
foreach($updateviews as $views => $tids) {
C::t('forum_thread')->increase($tids, array('views' => $views), true);
}
?>

View File

@@ -0,0 +1 @@