首页四格 for D4 [转] 简体版
https://discuz.dismall.com/viewthread.php?tid=205753&extra=page%3D1
作者 : deadxp
1‧在index.php找
- } else {
- $showoldetails = false;
- }
复制代码
下面加上
- //首頁熱門貼 Start
- $hack_subject_len=34; //每個標題最多顯示得字數
- $hack_subject_num=10; //需要顯示記錄數
- //最新貼
- $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 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
复制代码
再找
- $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
复制代码
下面加上
- $today = mktime (0,0,0,date("m") ,date("d"),date("Y"));
- $build_date = mktime (0,0,0,11,20,2005);//請修改後面的三個數字,分別代表你論壇運行第一天的月,日,年。
- $build_days = (int)(($today-$build_date)/(24*3600));
复制代码
2‧在index.htm 找
- <!--{if !empty($newpmexists)}-->
- {template pmprompt}
- <!--{/if}-->
复制代码
下面加上
再找
- <table cellspacing="{TABLESPACE}" cellpadding="0" border="0" width="{TABLEWIDTH}" align="center" class="outertxt">
- <tr><td class="smalltxt">
- {lang timenow} $currenttime, {lang your_lastvisit} $lastvisittime<br>
- {lang credits}: <span class="bold">$credits</span>
- <!--{loop $extcredits $id $credit}-->
- $credit[title]: <span class="bold">$GLOBALS[extcredits.$id]</span>$credit[unit]
- <!--{/loop}-->
- / {lang index_status}:
- <!--{if $validdays}--><a href="member.php?action=groupexpiry"><span class="bold">$grouptitle</span>($validdays)</a><!--{else}--><span class="bold">$grouptitle</span><!--{/if}-->
- <!--{if !empty($invisible)}--> / {lang login_invisible_mode}<!--{/if}-->
- </td><td align="right" nowrap class="smalltxt">
- <a href="search.php?srchfrom=$newthreads&searchsubmit=yes">{lang show_newthreads}</a> |
- <!--{if $discuz_uid}-->
- <a href="search.php?srchuid=$discuz_uid&mytopics=yes&searchsubmit=yes">{lang show_mytopics}</a> |
- <!--{if $allowuseblog}-->
- <a href="blog.php?uid=$discuz_uid" target="_blank">{lang blog}</a> |
- <!--{/if}-->
- <!--{/if}-->
- <a href="digest.php">{lang digest}</a> |
- <a href="member.php?action=markread">{lang mark_read}</a>
- | {lang welcome_newmember} <a href="viewpro.php?username=$memberenc"><span class="bold">$lastmember</span></a><br>
- {lang total} <span class="bold">$threads</span> {lang index_threads} / <span class="bold">$posts</span> {lang index_posts} / {lang index_today} <span class="bold">$todayposts</span> {lang index_posts} / <span class="bold">$totalmembers</span> {lang index_members}
- </td></tr></table>
复制代码
全部刪除
上傳hot_topics.htm到./templates/default 完成
[ 本帖最后由 MacauNet 于 2005-12-16 17:44 编辑 ] |