本帖最后由 findallove 于 2010-11-17 23:56 编辑
刷帖置顶好方法
方法:点击过的贴视为新帖,并置顶
如果论坛初哥要耍点人气就用它吧,科学快捷
dx1.5 的刷新方法,演示地址http://www.z8808.cn/bbs
在640行之后,即
$allowblockrecommend = $_G['group']['allowdiy'] || $_G['group']['allowauthorizedblock'];
$allowpostarticle = $_G['group']['allowmanagearticle'] || $_G['group']['allowauthorizedarticle'];
$allowpusharticle = empty($_G['forum_thread']['special']) && empty($_G['forum_thread']['sortid']) && !$_G['forum_thread']['pushedaid'];
if($_G['forum_thread']['displayorder'] != -4) {
$modmenu = array(
'thread' => $_G['forum']['ismoderator'] || $allowblockrecommend || $allowpusharticle && $allowpostarticle,
'post' => $_G['forum']['ismoderator'] && ($_G['group']['allowwarnpost'] || $_G['group']['allowbanpost'] || $_G['group']['allowdelpost'] || $_G['group']['allowstickreply']) || $_G['forum_thread']['pushedaid'] && $allowpostarticle
);
} else {
$modmenu = array();
}
之后加入下面代码即可
//点击更新
//cjupdateforum();
//function cjupdateforum()
{
DB::query("UPDATE ".DB::table('forum_thread')." SET lastpost='".time()."',dateline='".time()."' WHERE tid='$_G[tid]'");
$queryf = DB::query("SELECT fid FROM ".DB::table('forum_forum')." WHERE type<>'group' and fid='$_G[fid]'");
while($forum=DB::fetch($queryf)) {
$rs = DB::fetch_first("SELECT tid, subject, lastpost, lastposter FROM ".DB::table('forum_thread')." WHERE fid='$forum[fid]' AND displayorder>='0' ORDER BY lastpost DESC LIMIT 1");
$lastpost = addslashes("$rs[tid]\t$rs[subject]\t$rs[lastpost]\t$rs[lastposter]");
$sql="SELECT COUNT(*) AS threads, SUM(replies)+COUNT(*) AS posts FROM ".DB::table('forum_thread')." WHERE fid='$forum[fid]' AND displayorder>='0'";
$rs=DB::fetch_first($sql);
$threads=$rs['threads'];
$posts=$rs['posts'];
$d1=round((time()-86400)/86400)*86400;
$d1=$d1+43200;
$sql="SELECT COUNT(*) AS todayposts FROM ".DB::table('forum_thread')." WHERE fid='$forum[fid]' AND displayorder>='0' and dateline>$d1";
$rs=DB::fetch_first($sql);
$todayposts=$rs['todayposts'];
$query=DB::query("UPDATE ".DB::table('forum_forum')." SET threads='$threads', posts='$posts', lastpost='$lastpost',todayposts='$todayposts' WHERE fid='$forum[fid]'");
}
|