include/cache.func.php- //TOPLIST_CACHE版
- case 'newthread':
- $table = 'threads t';
- $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
- $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.displayorder!='-1' ORDER BY t.dateline DESC LIMIT 0, 6";
- break;
- case 'newreply':
- $table = 'threads t';
- $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
- $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.replies>0 and t.displayorder!='-1' ORDER BY t.lastpost DESC LIMIT 0, 6";
- break;
-
- case 'topdigest':
- $table = 'threads t';
- $cols = 't.tid, t.fid, t.author, t.subject, t.digest, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
- $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE digest>0 ORDER BY rand() LIMIT 0, 6";
- break;
- case 'topviews':
- $table = 'threads t';
- $timestamp=time();//添加
- $ctime=$timestamp-3600*24*7;//添加 最后7是天数,自己修改
- $view = rand(1,3)==1 ? 'views' : 'replies';
- $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
- $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.displayorder!='-1' and dateline>$ctime ORDER BY t.$view DESC LIMIT 0, 6";
- break;
- //TOPLIST_CACHE版
复制代码 其中所有前面加上注意加入的代码前后都需要留一个空格 |