请选择 进入手机版 | 继续访问电脑版
设为首页收藏本站

Discuz! 官方站

 找回密码
 立即注册

QQ登录

只需一步,快速开始

Discuz! X 最新研发动态 通过这个窗口,关注跟踪我们的研发进展 Discuz! 开发技术文库 - 给官方提建议

Discuz! X2 正式版下载 帮助网站实现一站式服务  商业支持服务咨询 下载 - 安装 - 常见问题 - 转换 - 讨论 - 购买

2012站长年会开启报名 限量船票免费发放 Discuz!十大荣誉用户评选 - Discuz!NT3.6发布 漫游引入QQ空间游戏 -一骑新区横扫三国-5d6d免费论坛

查看: 88107|回复: 156

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

Forum Legend

Alliance Comes Success

Rank: 8Rank: 8

UID
381172
积分
3383
帖子
968
威望
213
在线时间
6 小时
注册时间
2006-6-7
发表于 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 编辑 ]

Rank: 3Rank: 3

UID
259437
积分
240
帖子
280
威望
1
在线时间
0 小时
注册时间
2005-10-12
发表于 2007-9-23 11:50:40 |显示全部楼层
图看不到,怎么回事

使用道具 举报

Newbie

自定义头衔

Rank: 1

UID
382133
积分
10
帖子
0
威望
1
在线时间
0 小时
注册时间
2006-6-9
发表于 2007-9-23 11:53:05 |显示全部楼层
前排.......

使用道具 举报

Newbie

自定义头衔

Rank: 1

UID
382133
积分
10
帖子
0
威望
1
在线时间
0 小时
注册时间
2006-6-9
发表于 2007-9-23 11:57:42 |显示全部楼层
前排.......

使用道具 举报

Lord

奥斯卡

Rank: 4

UID
617370
积分
732
帖子
856
威望
2
在线时间
2 小时
注册时间
2007-1-15
发表于 2007-9-23 12:57:41 |显示全部楼层
板~~~~~~~~~~`
一切皆有可能!

使用道具 举报

Lord

奥斯卡

Rank: 4

UID
617370
积分
732
帖子
856
威望
2
在线时间
2 小时
注册时间
2007-1-15
发表于 2007-9-23 12:57:58 |显示全部楼层
板~~~~~~~~~~`
一切皆有可能!

使用道具 举报

Rank: 2

UID
479314
积分
156
帖子
184
威望
0
在线时间
0 小时
注册时间
2006-11-3
发表于 2007-9-23 13:48:18 |显示全部楼层
不明白!!!!!
http://www.fshiphop.cn

使用道具 举报

Rank: 4

UID
490071
积分
855
帖子
666
威望
0
在线时间
135 小时
注册时间
2006-11-14
发表于 2007-9-23 14:31:44 |显示全部楼层
根本看不懂哦
厦门7788户外网站
http://www.xm7788.cn

使用道具 举报

Rank: 3Rank: 3

UID
198376
积分
221
帖子
131
威望
7
在线时间
4 小时
注册时间
2005-5-11
发表于 2007-9-23 14:52:36 |显示全部楼层
看不到图片啊!~
~
适合全家大小的马来西亚中文论坛~叱咤王国

凡走过必留痕迹。。。有我的地方就有足迹。。。

使用道具 举报

Rank: 8Rank: 8

UID
303244
积分
7169
帖子
8638
威望
5
在线时间
1 小时
注册时间
2006-1-5
发表于 2007-9-23 15:23:32 |显示全部楼层
一个位置

支持下

使用道具 举报

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

fastpost

手机版|Archiver|北京康盛新创科技有限责任公司 ( 京ICP证110024号|京网文[2011]0019-007号 )  

GMT+8, 2012-2-9 12:56 , Processed in 0.123999 second(s), 14 queries , Memcache On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部