AGAMES 討論區

 找回密碼
 快速註冊
搜索
查看: 1598|回復: 1
打印 上一主題 下一主題

首頁最簡單兩格發布 [複製鏈接]

七級帝王會員

☆Prince★}+}|電腦王子

Rank: 7Rank: 7Rank: 7

帖子
3799
EXP
6040 點
金幣
4990 個
好友
0
註冊時間
2008-3-27

友誼之星勳章

跳轉到指定樓層
樓主
發表於 2008-11-14 18:43:51 |只看該作者 |倒序瀏覽
演示:



所需修改文件:
index.php
templates/discuz.htm


================================


修改index.php
找:
  1. $threads = $posts = $todayposts = $fids = $announcepm = 0;
複製代碼
下面加入
  1. /////////////////////////////////////////////////////////////首頁兩格
  2. //今日發貼排行
  3. $tomonth=date(n);
  4. $todate=date(j);
  5. $toyear=date(Y);
  6. $time=mktime(0,0,0,$tomonth,$todate,$toyear);
  7. $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");
  8. while($result=$db->fetch_array($query)){
  9. $poststar.="<a href=viewpro.php?uid=".$result[authorid].">".$result[author]."</a> (<font color=red>".$result[num]."</font>)<br>";
  10. }
  11. //今日發貼排行
  12. $hack_subject_len=80; //每個標題最多顯示得字數
  13. $hack_subject_num=15; //需要顯示記錄數
  14. $hack_newthreads_threadlist = array();
  15. $thread = array();
  16. //最新貼
  17. $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");
  18. while($thread = $db->fetch_array($query)) {
  19.               $thread['forumname'] = $thread['name'];
  20.               $thread['date']= gmdate("$dateformat $timeformat", $thread['dateline'] + $timeoffset * 3600);
  21.               $thread['lastreplytime']= gmdate("$dateformat $timeformat", $thread[lastpost] + ($timeoffset * 3600));
  22.               $thread[subject0]=$thread[subject];
  23.               $thread['subject'] = cutstr($thread['subject'], $hack_subject_len);
  24.               $hack_newthreads_threadlist[] = $thread;
  25. }
  26. //最新貼
  27. $threadview = $threadreply = array();
  28. //最新回復
  29. $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");
  30.               while($thread = $db->fetch_array($query)) {
  31.                               $thread[subject0]=$thread[subject];
  32.                               $thread['forumname'] = $thread['name'];
  33.                               $thread['date']= gmdate("$dateformat $timeformat", $thread['dateline'] + $timeoffset * 3600);
  34.                               $thread['lastreplytime']= gmdate("$dateformat $timeformat", $thread[lastpost] + ($timeoffset * 3600));
  35.                               $thread[subject] = cutstr($thread[subject], $hack_subject_len);
  36.                               $threadreply[] = $thread;
  37.               }
  38. //最新回復
  39. ///////////////////////////////////////////////////////////////////首頁兩格
複製代碼


修改templates/discuz.htm

  1. <div id="ad_text"></div><!--{/if}-->
複製代碼

[ 本帖最後由 dlalden 於 2008-11-14 18:47 編輯 ]
Alta Multimedia - Youtube:http://www.youtube.com/user/altahk

七級帝王會員

☆Prince★}+}|電腦王子

Rank: 7Rank: 7Rank: 7

帖子
3799
EXP
6040 點
金幣
4990 個
好友
0
註冊時間
2008-3-27

友誼之星勳章

2
發表於 2008-11-14 18:46:51 |只看該作者
下面加


[ 本帖最後由 dlalden 於 2008-11-14 18:51 編輯 ]
附件: 你需要登錄才可以下載或查看附件。沒有帳號?快速註冊
您需要登錄後才可以回帖 登錄 | 快速註冊

Archiver|手機版|AGAMES 討論區

GMT+8, 2024-9-20 12:09 , Processed in 0.047528 second(s), 12 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回頂部