Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[DST][Hack]在首页显示每个版块的今日最新帖

[复制链接]
伊泽浩 发表于 2007-9-23 11:30:09 | 显示全部楼层 |阅读模式
作者:[DST]hnxxwyq

效果图





修改三处地方

1.查找index.php中的
  1. if(forum($forum)) {
  2.                                         $catlist[$forum['fup']]['forums'][] = $forum['fid'];
  3.                                         $forum['orderid'] = $catlist[$forum['fup']]['forumscount']++;
  4.                                         $forum['subforums'] = '';
  5.                                         $forumlist[$forum['fid']] = $forum;
  6.                                 }
复制代码
修改成
  1. if(forum($forum)) {
  2.                                         $catlist[$forum['fup']]['forums'][] = $forum['fid'];
  3.                                         $forum['orderid'] = $catlist[$forum['fup']]['forumscount']++;
  4.                                         $forum['subforums'] = '';
  5.                                         // 最新主题修改开始                                        
  6.                                         $_query = $db->query("SELECT tid,subject,dateline,author FROM {$tablepre}threads " .
  7.                                                                                 "WHERE fid='{$forum['fid']}' AND dateline > " . strtotime(date('Y-m-d')) . ' ' .
  8.                                                                                 "ORDER BY dateline DESC " .
  9.                                                                                 "LIMIT 0,1");
  10.                                         if($new = $db->fetch_array($_query)) {
  11.                                                 $new['dateline'] = gmdate($dateformat, $new['dateline'] + $timeoffset * 3600);                                               
  12.                                                 $forum['newthread']  = $new;
  13.                                         }
  14.                                         // 最新主题修改结束
  15.                                         $forumlist[$forum['fid']] = $forum;
  16.                                 }
复制代码
2.寻找discuz.htm文件中的
  1. <thead class="category">
  2.                                         <tr>
  3.                                                 <th>{lang forum_name}</th>
  4.                                                 <td class="nums">{lang forum_threads}</td>
  5.                                                 <td class="nums">{lang forum_posts}</td>
  6.                                                 <td class="lastpost">{lang forum_lastpost}</td>
  7.                                         </tr>
  8.                                 </thead>
复制代码
修改为
  1. <thead class="category">
  2.                                         <tr>
  3.                                                 <th>{lang forum_name}</th>
  4.                                                 <!-- 最新主题修改开始 -->                                               
  5.                                                 <td>{最新主题}</td>
  6.                                                 <!-- 最新主题修改完毕 -->       
  7.                                                 <td class="nums">{lang forum_threads}</td>
  8.                                                 <td class="nums">{lang forum_posts}</td>
  9.                                                 <td class="lastpost">{lang forum_lastpost}</td>
  10.                                         </tr>
  11.                                 </thead>
复制代码
3寻找discuz.htm中
  1. <tbody id="forum$forum[fid]">
  2.                                                 <tr>
  3.                                                         <th$forum[folder]>
  4.                                                                 $forum[icon]
  5.                                                                 <h2><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a><!--{if $forum[todayposts] && !$forum['redirect']}--><em> ({lang index_today}: $forum[todayposts])</em><!--{/if}--></h2>
  6.                                                                 <!--{if $forum[description]}--><p>$forum[description]</p><!--{/if}-->
  7.                                                                 <!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}-->
  8.                                                                 <!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><p class="moderators">{lang forum_moderators}: $forum[moderators]</p><!--{else}--><span class="dropmenu" id="mod$forum[fid]" onmouseover="showMenu(this.id)">{lang forum_moderators}</span><ul class="moderators popupmenu_popup" id="mod$forum[fid]_menu" style="display: none">$forum[moderators]</ul><!--{/if}--><!--{/if}-->
  9.                                                         </th>
  10.                                                         <td class="nums">{if $forum['redirect']}--{else}$forum[threads]{/if}</td>
  11.                                                         <td class="nums">{if $forum['redirect']}--{else}$forum[posts]{/if}</td>
  12.                                                         <td class="lastpost">
  13.                                                         <!--{if $forum['permission'] == 1}-->
  14.                                                                 {lang private_forum}
  15.                                                         <!--{else}-->
  16.                                                                 <!--{if $forum['redirect']}-->
  17.                                                                         --
  18.                                                                 <!--{elseif is_array($forum['lastpost'])}-->
  19.                                                                         <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">{echo cutstr($forum[lastpost][subject], 40)}</a>
  20.                                                                         <cite>{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--> - $forum[lastpost][dateline]</cite>
  21.                                                                 <!--{else}-->
  22.                                                                         {lang never}
  23.                                                                 <!--{/if}-->
  24.                                                         <!--{/if}-->
  25.                                                         </td>
  26.                                                 </tr>
  27.                                         </tbody>
复制代码
修改为:
  1. <tbody id="forum$forum[fid]">
  2.                                                 <tr>
  3.                                                         <th$forum[folder]>
  4.                                                                 $forum[icon]
  5.                                                                 <h2><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a><!--{if $forum[todayposts] && !$forum['redirect']}--><em> ({lang index_today}: $forum[todayposts])</em><!--{/if}--></h2>
  6.                                                                 <!--{if $forum[description]}--><p>$forum[description]</p><!--{/if}-->
  7.                                                                 <!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}-->
  8.                                                                 <!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><p class="moderators">{lang forum_moderators}: $forum[moderators]</p><!--{else}--><span class="dropmenu" id="mod$forum[fid]" onmouseover="showMenu(this.id)">{lang forum_moderators}</span><ul class="moderators popupmenu_popup" id="mod$forum[fid]_menu" style="display: none">$forum[moderators]</ul><!--{/if}--><!--{/if}-->
  9.                                                         </th>
  10.                                                         <!-- 最新主题修改开始 -->       
  11.                                                         <td>
  12.                                                                 <!--{if $forum[newthread]}-->
  13.                                                                         <a href="redirect.php?tid=$forum[newthread][tid]&goto=lastpost#lastpost">{echo cutstr($forum[newthread][subject], 40)}</a>
  14.                                                                         <cite>{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['newthread']['author']<!--{else}-->{lang anonymous}<!--{/if}--> - $forum[newthread][dateline]</cite>                                                               
  15.                                                                 <!--{else}-->
  16.                                                                         没有今日最新主题
  17.                                                                 <!--{/if}-->
  18.                                                         </td>
  19.                                                         <!-- 最新主题修改完毕 -->       
  20.                                                         <td class="nums">{if $forum['redirect']}--{else}$forum[threads]{/if}</td>
  21.                                                         <td class="nums">{if $forum['redirect']}--{else}$forum[posts]{/if}</td>
  22.                                                         <td class="lastpost">
  23.                                                         <!--{if $forum['permission'] == 1}-->
  24.                                                                 {lang private_forum}
  25.                                                         <!--{else}-->
  26.                                                                 <!--{if $forum['redirect']}-->
  27.                                                                         --
  28.                                                                 <!--{elseif is_array($forum['lastpost'])}-->
  29.                                                                         <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">{echo cutstr($forum[lastpost][subject], 40)}</a>
  30.                                                                         <cite>{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--> - $forum[lastpost][dateline]</cite>
  31.                                                                 <!--{else}-->
  32.                                                                         {lang never}
  33.                                                                 <!--{/if}-->
  34.                                                         <!--{/if}-->
  35.                                                         </td>
  36.                                                 </tr>
  37.                                         </tbody>
复制代码
基本上就是把我注释里面的东西添加相应位置即可!这里测试是6.0的!其他版本可以对比替换,原理是一样的!

[ 本帖最后由 伊泽浩 于 2007-10-31 11:34 编辑 ]
javascrif 发表于 2007-9-23 11:50:40 | 显示全部楼层
图看不到,怎么回事
回复

使用道具 举报

刪蒢々記憶 发表于 2007-9-23 11:53:05 | 显示全部楼层
前排.......
回复

使用道具 举报

刪蒢々記憶 发表于 2007-9-23 11:57:42 | 显示全部楼层
前排.......
回复

使用道具 举报

森帝 发表于 2007-9-23 12:57:41 | 显示全部楼层
板~~~~~~~~~~`
回复

使用道具 举报

森帝 发表于 2007-9-23 12:57:58 | 显示全部楼层
板~~~~~~~~~~`
回复

使用道具 举报

simpsonhjp 发表于 2007-9-23 13:48:18 | 显示全部楼层
不明白!!!!!
回复

使用道具 举报

厦门7788 发表于 2007-9-23 14:31:44 | 显示全部楼层
根本看不懂哦
回复

使用道具 举报

hengheng84 发表于 2007-9-23 14:52:36 | 显示全部楼层
看不到图片啊!~
~
回复

使用道具 举报

花石子 发表于 2007-9-23 15:23:32 | 显示全部楼层
一个位置

支持下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-3-29 07:32 , Processed in 0.133333 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表