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

 找回密码
 立即注册
搜索

[发布] 首页显示最后回复主题for5.0正式版

[复制链接]
tmjob 发表于 2006-10-11 15:16:12 | 显示全部楼层 |阅读模式
插件作用:在首页显示每个版块最新回复主题的标题,并截取适当的字符不使其撑开表格影响美观!
               首页显示这些标题无疑会增加浏览者的浏览欲望!
说      明:这个插件以前好像有过,这几天找不到,就自己做个一个,如果有雷同请勿追究!
适用版本:Discuz! 5。0正式版
插件作者:tmjob
修改文件:include/forum.func.php、templates/default/discuz.htm模板
安装难易:简
演  示:http://www.tmjob.cn
提醒:先进行备份,养成良好习惯否则出问题请不要找我

一、修改 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. //首页显示最后发表标题by tmjob.cn
  2.           $lastpost['subject1'] = cutstr($lastpost['subject'], 20, $dot = ' ...');
  3. //首页显示最后发表标题by tmjob.cn
复制代码


说明:其中的20是指截取的字符长度,可以自行修改!

二、修改 discuz.htm
查找:
  1. <td align="center" title="{lang forum_lastpost_in}: {$forum[lastpost][subject]}" nowrap>
  2.                                                 <span class="smalltxt"><a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][dateline]</a></span><br>{lang forum_lastpost_by}
复制代码


全部替换为

  1. <!--首页显示最后发表标题by tmjob.cn-->

  2. <td align="left"  nowrap><span class="smalltxt">
  3. <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost"  title="{lang forum_lastpost_in}: {$forum[lastpost][subject]}">{lang forum_lastpost_in}: $forum[lastpost][subject1]</a><br>
  4. $forum[lastpost][dateline]</span><br>
  5. {lang forum_lastpost_by}
  6. <!--首页显示最后发表标题by tmjob.cn-->
复制代码


**结束**

注 在主题前面不要显示 标题 个字
则第二步替换为:

  1. <!--首页显示最后发表标题by tmjob.cn-->

  2. <td align="left"  nowrap><span class="smalltxt">
  3. <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost"  title="{lang forum_lastpost_in}: {$forum[lastpost][subject]}">$forum[lastpost][subject1]</a><br>
  4. $forum[lastpost][dateline]</span><br>
  5. {lang forum_lastpost_by}
  6. <!--首页显示最后发表标题by tmjob.cn-->
复制代码



有什么问题和建议尽管提出!

有人安装说一声哦~~

[ 本帖最后由 tmjob 于 2006-10-15 15:38 编辑 ]
回复

使用道具 举报

╭ァ北﹏ 发表于 2006-10-11 15:17:29 | 显示全部楼层
:o
回复

使用道具 举报

zyfdyx 发表于 2006-10-11 15:35:46 | 显示全部楼层
支持一下!.........
回复

使用道具 举报

tst159 发表于 2006-10-11 16:25:39 | 显示全部楼层
支持一下!......... very good!
回复

使用道具 举报

建筑百科 发表于 2006-10-11 16:43:43 | 显示全部楼层
不错,安装后能正常工作.http://www.sinoarch.cn/forum
回复

使用道具 举报

花石子 发表于 2006-10-11 17:06:32 | 显示全部楼层
关注


.
回复

使用道具 举报

ywsndgv 发表于 2006-10-11 18:09:49 | 显示全部楼层
支持下,但还是用天使那个,比较美观
回复

使用道具 举报

亡灵之剑 发表于 2006-10-11 19:19:25 | 显示全部楼层
OK``
这个我喜欢
简单一点好```
回复

使用道具 举报

幻想曲♂Mobile 发表于 2006-10-11 21:28:29 | 显示全部楼层
回复

使用道具 举报

oogoogle 发表于 2006-10-12 10:19:27 | 显示全部楼层
请问楼主,如何去掉开始的“标题”两个字?
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-9-13 09:52 , Processed in 0.085449 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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