- 最後登錄
- 2012-8-5
- 在線時間
- 978 小時
- UID
- 275
- 閱讀權限
- 140
- 精華
- 71
- 帖子
- 3799
- 日誌
- 0
- EXP
- 6040 點
- 金幣
- 4990 個
- 註冊時間
- 2008-3-27
- 帖子
- 3799
- EXP
- 6040 點
- 金幣
- 4990 個
- 好友
- 0
- 註冊時間
- 2008-3-27
|
演示:
所需修改文件:
index.php
templates/discuz.htm
================================
修改index.php
找:- $threads = $posts = $todayposts = $fids = $announcepm = 0;
複製代碼 下面加入- /////////////////////////////////////////////////////////////首頁兩格
- //今日發貼排行
- $tomonth=date(n);
- $todate=date(j);
- $toyear=date(Y);
- $time=mktime(0,0,0,$tomonth,$todate,$toyear);
- $query=$db->query("select count(pid) as num,authorid,author from $tablepre"."posts where dateline>=$time group by authorid order by num desc limit 0,11");
- while($result=$db->fetch_array($query)){
- $poststar.="<a href=viewpro.php?uid=".$result[authorid].">".$result[author]."</a> (<font color=red>".$result[num]."</font>)<br>";
- }
- //今日發貼排行
- $hack_subject_len=80; //每個標題最多顯示得字數
- $hack_subject_num=15; //需要顯示記錄數
- $hack_newthreads_threadlist = array();
- $thread = array();
- //最新貼
- $query = $db->query("SELECT dateline,tid,subject,author,views,replies,lastpost,lastposter FROM {$tablepre}threads WHERE fid ORDER BY dateline DESC LIMIT 0, $hack_subject_num");
- while($thread = $db->fetch_array($query)) {
- $thread['forumname'] = $thread['name'];
- $thread['date']= gmdate("$dateformat $timeformat", $thread['dateline'] + $timeoffset * 3600);
- $thread['lastreplytime']= gmdate("$dateformat $timeformat", $thread[lastpost] + ($timeoffset * 3600));
- $thread[subject0]=$thread[subject];
- $thread['subject'] = cutstr($thread['subject'], $hack_subject_len);
- $hack_newthreads_threadlist[] = $thread;
- }
- //最新貼
- $threadview = $threadreply = array();
- //最新回復
- $query = $db->query("SELECT dateline,tid,subject,author,views,replies,lastpost,lastposter FROM {$tablepre}threads WHERE fid AND replies ORDER BY lastpost DESC LIMIT 0, $hack_subject_num");
- while($thread = $db->fetch_array($query)) {
- $thread[subject0]=$thread[subject];
- $thread['forumname'] = $thread['name'];
- $thread['date']= gmdate("$dateformat $timeformat", $thread['dateline'] + $timeoffset * 3600);
- $thread['lastreplytime']= gmdate("$dateformat $timeformat", $thread[lastpost] + ($timeoffset * 3600));
- $thread[subject] = cutstr($thread[subject], $hack_subject_len);
- $threadreply[] = $thread;
- }
- //最新回復
- ///////////////////////////////////////////////////////////////////首頁兩格
複製代碼
修改templates/discuz.htm
找
- <div id="ad_text"></div><!--{/if}-->
複製代碼
[ 本帖最後由 dlalden 於 2008-11-14 18:47 編輯 ] |
|