1. 修改 index.php
$currenttime = gmdate($timeformat, $timestamp + $timeoffset * 3600);
//首頁熱門貼 Start
$hack_subject_len=30; //每個標題最多顯示得字數
$hack_subject_num=10; //需要顯示記錄數
//會員排行
$members = '';
$memcredits = array();
$query = $db->query("SELECT username, uid, posts FROM {$tablepre}members ORDER BY posts DESC LIMIT 0, $hack_subject_num");
while($member = $db->fetch_array($query)) {
$memcredits[] = $member;
}
$hack_newthreads_threadlist = array();
$thread = array();
//最新貼
$query = $db->query("SELECT dateline,tid,subject,author,views,replies FROM {$tablepre}threads ORDER BY dateline DESC LIMIT 0, $hack_subject_num");
while($thread = $db->fetch_array($query)) {
$thread[subject0]=$thread[subject];
$thread['subject'] = cutstr($thread['subject'], $hack_subject_len);
$hack_newthreads_threadlist[] = $thread;
}
$threadview = $threadreply = array();
//瀏覽最多
$query = $db->query("SELECT author,subject,views,replies,tid,lastposter FROM {$tablepre}threads ORDER BY views DESC LIMIT 0,$hack_subject_num");
while($thread = $db->fetch_array($query)) {
$thread[subject0]=$thread[subject];
$thread[subject] = cutstr($thread[subject],$hack_subject_len);
$threadview[] = $thread;
}
//最新回覆
$query = $db->query("SELECT replies, tid, subject,author,views,lastposter FROM {$tablepre}threads where replies !=0 ORDER BY lastpost DESC LIMIT 0, $hack_subject_num");
while($thread = $db->fetch_array($query)) {
$thread[subject0]=$thread[subject];
$thread[subject] = cutstr($thread[subject], $hack_subject_len);
$threadreply[] = $thread;
}
//首頁熱門貼 End
2. 修改 templates/default/index.htm
<!--{if !empty($newpmexists)}-->
{template pmprompt}
<!--{/if}-->
3. 上傳附件 hot_topics.htm 至 templates/default/ 下