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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

PW,首页显示最后回复主题,子版,横版显示 主题美化 (适用 5.0,5.5 GBK) 4.10 修正更新

[复制链接]
奇跡の海 发表于 2007-3-16 20:54:12 | 显示全部楼层 |阅读模式
首页显示最后回复主题,子版,横版显示回复主题 (适用版本5.0,5.5 GBK 其他版本未测试,不过改动不是十分大,应该可以自己改成需要的样子) 在IE6.0下显示正常 IE7.0也没发现问题!

插件作用:在首页显示每个版块最新回复主题的标题,并截取适当的字符不使其撑开表格影响美观!
               首页显示这些标题无疑会增加浏览者的浏览欲望!

修改文件:include/forum.func.php、templates/default/discuz.htm、forumdisplay_subforum.htm 模板

安装难易:简

演  示:http://www.seaomc.com.cn

提醒:先进行备份,养成良好习惯!


附件中缺少的图片上次没发现
感谢10楼帮忙修正
首页版块URL转向动态地址的修正见贴低

PS:加了N个相关的改动了,有些代码要根据自己的模板进行改写,记得备份!

  1. 斑竹位置和新贴统计回复统计等被放到了版块底部,这样不回被撑开表格.
复制代码


横排的说明:只适合一行2个版块的论坛,其他的请自行修改,或跟帖回复!

演示图


一、修改 forum.func.php
查找:

  1. list($lastpost['tid'], $lastpost['subject'], $lastpost['dateline'], $lastpost

  2. ['author']) = is_array($forum['lastpost']) ? $forum['lastpost'] : explode("\t", $forum

  3. ['lastpost']);
复制代码


在后面添加:

  1. //首页显示最后发表标题
  2.           $lastpost['subject1'] = cutstr($lastpost['subject'], 20, $dot = ' ...');
  3. //首页显示最后发表标题
复制代码


其中的20是表示显示的字节!

打开首页模板discuz.htm

查找:

  1. <!--{if !$cat['forumcolumns']}-->
复制代码


再找:
  1. <!--{else}-->
  2.                         <tbody id="category_$cat[fid]" style="$collapse['category_'.$cat[fid]]"><tr class="altbg2">
复制代码


之间的内容(不包含这两行的部分)全部替换为:

  1. <TBODY id=category_$cat[fid]>
  2. <TR class=category align=middle>
  3. <TD width="5%"> </TD>
  4. <TD align=left width="56%">{lang forum_name}</TD>
  5. <TD width="35%" colSpan=3>{lang forum_lastpost}</TD></TR><!--{loop $cat[forums] $forumid}-->
  6.                 <!--{eval $forum=$forumlist[$forumid];}-->
  7.                 <tr class="row" onMouseOver="this.className='row1'" onMouseOut="this.className='row'">
  8. <TD align=middle>$forum[folder]</TD>
  9. <TD class=subject align=left>$forum[icon]<a href="forumdisplay.php?fid=$forum[fid]"><span class="bold">$forum[name]</span></a> <BR><IMG height=5 src="{IMGDIR}/forumlin.gif"><BR><SPAN class=smalltxt>$forum[description] <!--{if $forum['subforums']}--><BR><SPAN class=bold>{lang forum_subforums}:</SPAN> $forum['subforums'] <!--{/if}--></SPAN></TD><!--{if $forum['permission'] == 1}-->
  10. <TD align=right width=12><IMG alt="{lang private_forum}" src="{IMGDIR}/topicnew.gif" border=0><BR><IMG alt="{lang private_forum}" src="{IMGDIR}/vote.gif" border=0><BR><IMG alt="{lang private_forum}" src="{IMGDIR}/tsale.gif" border=0> </TD>
  11. <TD width=4><IMG src="{IMGDIR}/last.gif"></TD>
  12. <TD noWrap align=left><IMG src="{IMGDIR}/ttopic.jpg"> = <SPAN class=smalltxt>{lang private_forum}</SPAN> <BR><IMG height=5 src="{IMGDIR}/forumlin2.gif"><BR><IMG src="{IMGDIR}/wirter.jpg"> = <SPAN class=smalltxt>{lang private_forum}</SPAN> <BR><IMG height=5 src="{IMGDIR}/forumlin2.gif"><BR></TD><!--{else}--><!--{if is_array($forum['lastpost'])}-->
  13. <TD align=right width=12><A href="post.php?action=newthread&fid=$forum[fid]&extra=page%3D1"><IMG alt=在本版发表新帖 src="{IMGDIR}/topicnew.gif" border=0></A><BR><A href="post.php?action=newthread&fid=$forum[fid]&extra=page%3D1&poll=yes"><IMG alt=在本版发起投票 src="{IMGDIR}/vote.gif" border=0></A><BR><A href="forumdisplay.php?fid=$forum[fid]&filter=digest"><IMG alt=查看本版的精华帖 src="{IMGDIR}/tsale.gif" border=0></A> </TD>
  14. <TD width=4><IMG src="{IMGDIR}/last.gif"></TD>
  15. <TD title="发布时间: $forum[lastpost][dateline]{LF}完整标题: $forum[lastpost][subject]" noWrap align=left><IMG src="{IMGDIR}/ttopic.jpg"> = <SPAN class=smalltxt><A title="发布时间: $forum[lastpost][dateline]{LF}完整标题: $forum[lastpost][subject]" href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][subject1]</A></SPAN> <BR><IMG height=5 src="{IMGDIR}/forumlin2.gif"><BR><IMG src="{IMGDIR}/wirter.jpg"> =<!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->  <A href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost"><FONT color=#88b500>($forum[lastpost][dateline])</FONT></A> <BR><IMG height=5 src="{IMGDIR}/forumlin2.gif"><BR></TD><!--{else}-->
  16. <TD align=middle><SPAN class=smalltxt>{lang never}</SPAN></TD><!--{/if}--><!--{/if}--></TR>
  17. <TR class=row>
  18. <TD bgColor=#f3f3f3 height=10></TD>
  19. <TD bgColor=#f3f3f3 height=10><IMG src="{IMGDIR}/moderator.gif"> $forum[moderators]</TD>
  20. <TD bgColor=#f3f3f3 colSpan=3 height=10><IMG alt=主题总数 src="{IMGDIR}/i_topic.gif"> <FONT color=#9933cc>$forum[threads]</FONT> <IMG alt=帖子总数 src="{IMGDIR}/i_post.gif"> <FONT color=#0099ff>$forum[posts]</FONT> <IMG alt=今日帖数 src="{IMGDIR}/i_today.gif"> <FONT color=#ff3399>$forum[todayposts]</FONT></TD></TR><!--{/loop}-->
复制代码


上传附件到模板对应的图片目录中!

修改完毕,更新缓存!

子版添加方法

templates\default\forumdisplay_subforum.htm

查找:
  1. <td width="100%" colspan="$forum['forumcolumns']">{lang forum_subforums}</td>
复制代码


以上内容全部替换(不包括本行)为:

  1. <div class="spaceborder spacebottom" style="width: {TABLEWIDTH}">
  2.   <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
  3.     <!--{if !$forum['forumcolumns']}-->
  4.     <tr class="header" align="center">
  5.       <td width="5%"> </td>
  6.       <td width="60%">{lang forum_name}</td>
  7.       <td width="3%"> </td>
  8.            <td width="1%"> </td>
  9.       <td width="35%">{lang forum_lastpost}</td>
  10.     </tr>
  11.     <!--{loop $sublist $sub}-->
  12.     <!--{if $sub['permission']}-->
  13.     <tr class="row" onmouseover="this.style.backgroundColor='{ALTBG1}'" onmouseout="this.style.backgroundColor='{ALTBG2}'">
  14.       <td align="center">$sub[folder]</td>
  15.       <td class="subject"> $sub[icon]<a href="forumdisplay.php?fid=$sub[fid]"><span class="bold">$sub[name]</span></a>
  16.           <!--{if $sub[todayposts]}-->
  17.         <span class="todayposts">($sub[todayposts])</span>
  18.         <!--{/if}-->
  19. <BR><IMG height=5 src="{IMGDIR}/forumlin.gif"><BR>
  20.         <span class="smalltxt">$sub[description]</span></td>
  21.                
  22.                
  23.       <td align=right width=12><div align="right"><a href="post.php?action=newthread&fid=$sub[fid]&extra=page%3D1"><img alt=在本版发表新帖 src="{IMGDIR}/topicnew.gif" border=0 /></a><br />
  24.               <a href="post.php?action=newthread&fid=$sub[fid]&extra=page%3D1&poll=yes"><img alt=在本版发起投票 src="{IMGDIR}/vote.gif" border=0 /></a><br />
  25.           <a href="forumdisplay.php?fid=$sub[fid]&filter=digest"><img alt=查看本版的精华帖 src="{IMGDIR}/tsale.gif" border=0 /></a> </div></td>
  26.                   <TD width=4><div style="float:left;text-align:left;"><a href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost"><img src="{IMGDIR}/last.gif" border="0"></a></div></TD>
  27.       <!--{if $sub['permission'] == 1}-->
  28.       <td align="center"><span class="smalltxt">{lang private_forum}</span></td>
  29.       <!--{else}-->
  30.       <!--{if is_array($sub['lastpost'])}-->
  31.       <td title="发布时间: $sub[lastpost][dateline]{LF}完整标题: $sub[lastpost][subject]" nowrap align=left><img src="{IMGDIR}/ttopic.jpg" /> = <span class=smalltxt><a title="发布时间: $sub[lastpost][dateline]{LF}完整标题: $sub[lastpost][subject]" href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost">$sub[lastpost][subject1]</a></span> <br />
  32.           <img height=5 src="{IMGDIR}/forumlin2.gif" /><br />
  33.         <img src="{IMGDIR}/wirter.jpg" /> =
  34.         <!--{if $sub['lastpost']['author']}-->
  35.         $sub['lastpost']['author']
  36.         <!--{else}-->
  37.         {lang anonymous}
  38.         <!--{/if}-->
  39.           <a href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost"><font color=#88b500>($sub[lastpost][dateline])</font></a> <br />
  40.         <img height=5 src="{IMGDIR}/forumlin2.gif" /><br /></td>
  41.       <!--{else}-->
  42.       <td align="center"><span class="smalltxt">{lang never}</span></td>
  43.       <!--{/if}-->
  44.       <!--{/if}-->
  45.     </tr>
  46.     <tr class=row>
  47.       <td bgcolor=#f3f3f3 height=10></td>
  48.       <td bgcolor=#f3f3f3 height=10><img src="{IMGDIR}/moderator.gif" /> $sub[moderators]</td>
  49.       <td bgcolor=#f3f3f3 colspan=3 height=10><img alt=主题总数 src="{IMGDIR}/i_topic.gif" /> <font color=#9933cc>$sub[threads]</font> <img alt=帖子总数 src="{IMGDIR}/i_post.gif" /> <font color=#0099ff>$sub[posts]</font> <img alt=今日帖数 src="{IMGDIR}/i_today.gif" /> <font color=#ff3399>$sub[todayposts]</font></td>
  50.     </tr>
  51.     <!--{/if}-->
  52.     <!--{/loop}-->
  53.     <!--{else}-->
  54.     <tr class="header">
复制代码


子版改写完成!

首页横版美化显示回复主题



打开首页模板discuz.htm

找(如果有2个,在第2处)
  1. <!--{if is_array($forum['lastpost'])}-->
复制代码


  1. <!--{else}-->
  2.                                         {lang never}
  3.                                 <!--{/if}-->
  4.                                 </td></tr><tr class="smalltxt"><td>{lang forum_threads}: $forum[threads]</td><td>{lang forum_posts}: $forum[posts]</td><td>{lang forum_todayposts}: $forum[todayposts]</td></tr></table>
复制代码


之间的部分(不包括这两行)全部替换为:

  1. <!--首页横版显示最后发表标题--BY seaomc.com.cn>
  2. <TD align=left width=1>$forum[icon]
  3. <A href="post.php?action=newthread&fid=$forum[fid]&extra=page%3D1"><IMG alt=在本版发表新帖 src="{IMGDIR}/topicnew.gif" border=0></A><BR><A href="post.php?

  4. action=newthread&fid=$forum[fid]&extra=page%3D1&poll=yes"><IMG alt=在本版发起投票 src="{IMGDIR}/vote.gif" border=0></A><BR><A href="forumdisplay.php?

  5. fid=$forum[fid]&filter=digest"><IMG alt=查看本版的精华帖 src="{IMGDIR}/tsale.gif" border=0></A>  </td>
  6. <TD title="发布时间: $forum[lastpost][dateline]{LF}完整标题: $forum[lastpost][subject]" noWrap align=left><IMG src="{IMGDIR}/ttopic.jpg"> = <SPAN

  7. class=smalltxt><A title="发布时间: $forum[lastpost][dateline]{LF}完整标题: $forum[lastpost][subject]" href="redirect.php?tid=$forum[lastpost][tid]

  8. &goto=lastpost#lastpost">$forum[lastpost][subject1]</A></SPAN> <BR><IMG height=5 src="{IMGDIR}/forumlin2.gif"><BR><IMG src="{IMGDIR}/wirter.jpg"> =<!--{if

  9. $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->  <A href="redirect.php?tid=$forum[lastpost][tid]

  10. &goto=lastpost#lastpost"><FONT color=#88b500>($forum[lastpost][dateline])</FONT></A> <BR></TD>
  11. <!--首页横版显示最后发表标题--BY seaomc.com.cn>
复制代码


查找
  1. <tr class="smalltxt"><td colspan="3">{lang forum_lastpost}:
复制代码
删除(如果有两个删除第2个)


横版如果想有斑竹项目,请将
  1. {lang forum_moderators}: $forum[moderators]
复制代码

放到你需要的位置!

首页横版美化显示最后回复完毕

子版横排显示回复



  1. <!--{if is_array($sub['lastpost'])}-->
复制代码


  1. <!--{else}-->
  2.                         {lang never}
  3.                 <!--{/if}-->
  4.                 </td></tr><tr class="smalltxt"><td>{lang forum_threads}: $sub[threads]</td><td>{lang forum_posts}: $sub[posts]</td><td>{lang forum_todayposts}: $sub[todayposts]</td></tr></table>
复制代码


之间,不包括这两行改为:

  1. <!--子版横版显示最后发表标题--BY seaomc.com.cn>
  2. <TD align=left width=1>$sub[icon]
  3. <A href="post.php?action=newthread&fid=$sub[fid]&extra=page%3D1"><IMG alt=在本版发表新帖 src="{IMGDIR}/topicnew.gif" border=0></A><BR><A href="post.php?

  4. action=newthread&fid=$sub[fid]&extra=page%3D1&poll=yes"><IMG alt=在本版发起投票 src="{IMGDIR}/vote.gif" border=0></A><BR><A href="forumdisplay.php?

  5. fid=$sub[fid]&filter=digest"><IMG alt=查看本版的精华帖 src="{IMGDIR}/tsale.gif" border=0></A>  </td>
  6. <TD title="发布时间: $sub[lastpost][dateline]{LF}完整标题: $sub[lastpost][subject]" noWrap align=left><IMG src="{IMGDIR}/ttopic.jpg"> = <SPAN

  7. class=smalltxt><A title="发布时间: $sub[lastpost][dateline]{LF}完整标题: $sub[lastpost][subject]" href="redirect.php?tid=$sub[lastpost][tid]

  8. &goto=lastpost#lastpost">$sub[lastpost][subject1]</A></SPAN> <BR><IMG height=5 src="{IMGDIR}/forumlin2.gif"><BR><IMG src="{IMGDIR}/wirter.jpg"> =<!--{if

  9. $sub['lastpost']['author']}-->$sub['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->  <A href="redirect.php?tid=$sub[lastpost][tid]

  10. &goto=lastpost#lastpost"><FONT color=#88b500>($sub[lastpost][dateline])</FONT></A> <BR></TD>
  11. <!--子版横版显示最后发表标题--BY seaomc.com.cn>
复制代码


删除
  1. <tr class="smalltxt"><td colspan="3">{lang forum_lastpost}:
复制代码
(如果有两个删除第2个)

子版横排显示回复完成

横版如果想有斑竹项目,请将
加到你想要的位置!
  1. {lang forum_moderators}: $sub[moderators]
复制代码


上传附件到相应目录,更新缓存!

问题修正:

关于版块地址点击变成动态地址问题的修改方法:


已经修改的,请查找:

  1. <A href="forumdisplay.php?fid=$forum[fid]"><SPAN class=bold>$forum[name]</SPAN></A>
复制代码


替换为:

  1. <a href="forumdisplay.php?fid=$forum[fid]"><span class="bold">$forum[name]</span></a>
复制代码

[ 本帖最后由 奇跡の海 于 2007-4-20 00:55 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x

评分

1

查看全部评分

zhl820808 发表于 2007-3-16 21:20:24 | 显示全部楼层
沙发支持下!!
安装成功

演示地址:http://10650.cn


[ 本帖最后由 zhl820808 于 2007-3-16 21:45 编辑 ]
回复

使用道具 举报

飞天雪狐 发表于 2007-3-16 21:54:20 | 显示全部楼层





:lol
回复

使用道具 举报

我爱涛涛 发表于 2007-3-16 21:56:33 | 显示全部楼层
早就安装了
:)
回复

使用道具 举报

ba0411 发表于 2007-3-16 22:00:35 | 显示全部楼层
請問 如何修改能在最後回覆的主題顯示主題分類呢?
回复

使用道具 举报

lioulangzhe 发表于 2007-3-16 22:09:02 | 显示全部楼层
谢谢分享,顶
回复

使用道具 举报

5ezsd 发表于 2007-3-16 22:29:03 | 显示全部楼层
forum.func.php  这个文件在哪里 怎么没有找到 
回复

使用道具 举报

 楼主| 奇跡の海 发表于 2007-3-16 22:45:47 | 显示全部楼层
原帖由 5ezsd 于 2007-3-16 22:29 发表
forum.func.php  这个文件在哪里 怎么没有找到 



include/forum.func.php
回复

使用道具 举报

dk97531 发表于 2007-3-17 01:28:33 | 显示全部楼层
哦,不错不错先在我才看见
回复

使用道具 举报

Lz-黑鬼 发表于 2007-3-17 02:13:17 | 显示全部楼层
wirter是錯的, writer才對,我改修正了, 見附件

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-25 09:31 , Processed in 0.121853 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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