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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[修改] 首页 美化 显示最后主题/回复 For 5.0RC+4.1

[复制链接]
折翼の天使♂ 发表于 2006-8-8 07:55:13 | 显示全部楼层 |阅读模式
========================================================
||HACK:首页显示最后主题+美化 For 5.0+4.1 [5.0已成功测试]
||作者: 折翼の天使♂
||性质: 人性化
||安装: 易
||修改文件(建议先备份):templates/default/index.htm  include/forum.func.php templates/default/forumdisplay_subforum.h
||演示:  http://www.rplive.cn/index.php
||演示:  http://www.rplive.cn/forum-41-1.html
||更多HACK请见:http://www.rplive.cn
========================================================



=========================================
注:首页改过的..已有相关说明....


①index.htm[5.0 找 discuz.htm]模板,查找:


  1.                         <!--{if is_array($forum['lastpost'])}-->
  2.                                 <td class="altbg2"><table cellpadding="0" cellspacing="0" border="0" width="100%">
  3.                                 <tr><td align="right" class="smalltxt" title="{lang forum_lastpost_in}: $forum[lastpost][subject]" nowrap>
  4.                                 $forum[lastpost][dateline]<br>{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang guest}<!--{/if}--></td>
  5.                                 <td nowrap> <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost"><img src="{IMGDIR}/lastpost.gif" border="0"></a></td>
  6.                                 </tr></table></td>
  7.                         <!--{else}-->
复制代码

替换成:


  1. <!--{if is_array($forum['lastpost'])}--><td class="altbg2" height="52"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td align="left" class="smalltxt" title="发布时间: $forum[lastpost][dateline]{LF}完整标题: $forum[lastpost][subject]" nowrap><span style="altbg2"><fieldset style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all" align="center"><legend><span class="smalltxt"><strong></strong></span></legend></span><br>┌标题: <a title="发布时间: $forum[lastpost][dateline]{LF}完整标题: $forum[lastpost][subject]" href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][subjectsc]</a><br>├时间: <a title="发布时间: $forum[lastpost][dateline]{LF}完整标题: $forum[lastpost][subject]" href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][dateline]</a><br>└作者: <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang guest}<!--{/if}--></fieldset></td></tr></table></td><!--{else}-->
复制代码


注:首页改过的..跳过...②...
②查找:


  1.                 <td width="5%"> </td>
  2.                 <td width="51%">{lang forum_name}</td>
  3.                 <td width="5%">{lang forum_threads}</td>
  4.                 <td width="5%">{lang forum_posts}</td>
  5.                 <td width="5%">{lang forum_todayposts}</td>
  6.                 <td width="13%">{lang forum_lastpost}</td>
  7.                 <td width="16%">{lang forum_moderators}</td>
复制代码

替换成:


  1.                 <td width="5%"> </td>
  2.                 <td width="48%">{lang forum_name}</td>
  3.                 <td width="5%">{lang forum_threads}</td>
  4.                 <td width="5%">{lang forum_posts}</td>
  5.                 <td width="5%">{lang forum_todayposts}</td>
  6.                 <td width="16%">{lang forum_lastpost}</td>
  7.                 <td width="16%">{lang forum_moderators}</td>
复制代码

这个可以根据你自己的情况修改。

③include/forum.func.php,查找:


  1.                 $lastpost['dateline'] = gmdate("$dateformat $timeformat", $lastpost['dateline'] + $timeoffset * 3600);
复制代码

下面添加:


  1.                 $lastpost['subjectsc'] = cutstr($lastpost['subject'], 23);
复制代码

以上23数值是标题的长度。

============================

以下是子版的修改

============================

编辑模板 - forumdisplay_subforum.htm
查找


  1. <!--{if is_array($sub['lastpost'])}-->
  2.                                 <td class="altbg2"><table cellpadding="0" cellspacing="0" border="0" width="100%">
  3.                                 <tr><td align="right" class="smalltxt" title="{lang forum_lastpost_in}: $sub[lastpost][subject]" nowrap>
  4.                                 $sub[lastpost][dateline]<br>{lang forum_lastpost_by} <!--{if $sub['lastpost']['author']}-->$sub['lastpost']['author']<!--{else}-->{lang guest}<!--{/if}--></td>
  5.                                 <td nowrap> <a href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost"><img src="{IMGDIR}/lastpost.gif" border="0"></a></td>
  6.                                 </tr></table></td>
  7.                         <!--{else}-->
复制代码

替换成


  1. <!--{if is_array($sub['lastpost'])}--><td class="altbg2" height="52"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td align="left" class="smalltxt" title="发布时间: $sub[lastpost][dateline]{LF}完整标题: $sub[lastpost][subject]" nowrap><span style="altbg2"><fieldset style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all" align="center"><legend><span class="smalltxt"><strong></strong></span></legend></span><br>┌标题: <a title="发布时间: $sub[lastpost][dateline]{LF}完整标题: $sub[lastpost][subject]" href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost">$sub[lastpost][subjectsc]</a><br>├时间: <a title="发布时间: $sub[lastpost][dateline]{LF}完整标题: $sub[lastpost][subject]" href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost">$sub[lastpost][dateline]</a><br>└作者: <!--{if $sub['lastpost']['author']}-->$sub['lastpost']['author']<!--{else}-->{lang guest}<!--{/if}--></fieldset></td></tr></table></td><!--{else}-->
复制代码

找到


  1. <td width="5%"> </td>
  2.                 <td width="51%">{lang forum_name}</td>
  3.                 <td width="5%">{lang forum_threads}</td>
  4.                 <td width="5%">{lang forum_posts}</td>
  5.                 <td width="5%">{lang forum_todayposts}</td>
  6.                 <td width="13%">{lang forum_lastpost}</td>
  7.                 <td width="16%">{lang forum_moderators}</td>
复制代码

替换成


  1. <td width="5%"> </td>
  2.                 <td width="48%">{lang forum_name}</td>
  3.                 <td width="5%">{lang forum_threads}</td>
  4.                 <td width="5%">{lang forum_posts}</td>
  5.                 <td width="5%">{lang forum_todayposts}</td>
  6.                 <td width="16%">{lang forum_lastpost}</td>
  7.                 <td width="16%">{lang forum_moderators}</td>
复制代码


===============================================================

  1. <!--{if is_array($sub['lastpost'])}-->
  2.                                 <td class="altbg2"><table cellpadding="0" cellspacing="0" border="0" width="100%">
  3.                                 <tr><td align="right" class="smalltxt" title="{lang forum_lastpost_in}: $sub[lastpost][subject]" nowrap>
  4.                                 $sub[lastpost][dateline]<br>{lang forum_lastpost_by} <!--{if $sub['lastpost']['author']}-->$sub['lastpost']['author']<!--{else}-->{lang guest}<!--{/if}--></td>
  5.                                 <td nowrap> <a href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost"><img src="{IMGDIR}/lastpost.gif" border="0"></a></td>
  6.                                 </tr></table></td>
  7.                         <!--{else}-->
复制代码

替换成


  1. <!--{if is_array($sub['lastpost'])}--><td class="altbg2" height="52"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td align="left" class="smalltxt" title="发布时间: $sub[lastpost][dateline]{LF}完整标题: $sub[lastpost][subject]" nowrap><span style="altbg2"><fieldset style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all" align="center"><legend><span class="smalltxt"><strong></strong></span></legend></span><br>┌标题: <a title="发布时间: $sub[lastpost][dateline]{LF}完整标题: $sub[lastpost][subject]" href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost">$sub[lastpost][subjectsc]</a><br>├时间: <a title="发布时间: $sub[lastpost][dateline]{LF}完整标题: $sub[lastpost][subject]" href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost">$sub[lastpost][dateline]</a><br>└作者: <!--{if $sub['lastpost']['author']}-->$sub['lastpost']['author']<!--{else}-->{lang guest}<!--{/if}--></fieldset></td></tr></table></td><!--{else}-->
复制代码



=========================================


注:要去掉...边框的..打开 index.htm

  1. <span style="altbg2"><fieldset style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all" align="center"><legend><span class="smalltxt"><strong></strong></span></legend></span><br>
复制代码




  1. <!--{/if}--></fieldset></td></tr>
复制代码


替换成


  1. <!--{/if}--></td></tr>
复制代码

演示图...稍候送上....

[ 本帖最后由 折翼の天使♂ 于 2007-3-12 07:35 编辑 ]
 楼主| 折翼の天使♂ 发表于 2006-8-8 07:55:30 | 显示全部楼层
演示图:

[ 本帖最后由 折翼の天使♂ 于 2006-8-8 08:07 编辑 ]
回复

使用道具 举报

 楼主| 折翼の天使♂ 发表于 2006-8-8 07:55:50 | 显示全部楼层
留用./..
回复

使用道具 举报

ruokuang 发表于 2006-8-8 08:23:47 | 显示全部楼层
不错,挺好看的
回复

使用道具 举报

yl0124 发表于 2006-8-8 08:28:58 | 显示全部楼层
用的。。顶下!!
回复

使用道具 举报

vr3000 发表于 2006-8-8 08:47:26 | 显示全部楼层
感谢大大分享...送你IP一个..
回复

使用道具 举报

squaly 发表于 2006-8-8 09:10:33 | 显示全部楼层
楼主5.0的ndex.htm是空白的啊,怎么改?
回复

使用道具 举报

 楼主| 折翼の天使♂ 发表于 2006-8-8 09:35:12 | 显示全部楼层
原帖由 squaly 于 2006-8-8 09:10 发表
楼主5.0的ndex.htm是空白的啊,怎么改?


找..discuz.htm
回复

使用道具 举报

WeDone 发表于 2006-8-8 15:58:34 | 显示全部楼层
谢谢了
回复

使用道具 举报

天使の翼 发表于 2006-8-8 16:46:08 | 显示全部楼层
改一下4.1的吧,5.0还没准备装
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-19 02:24 , Processed in 0.119351 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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