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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

RC2 首页显示最后回复/作者/日期 - 完美版

[复制链接]
鬼哥哥 发表于 2006-8-28 21:44:35 | 显示全部楼层 |阅读模式
之前在这里找RC2在首页显示最后回复、作者、以及日期的美化。。
可是一直都没有像之前4。1那样完美。。

所以自己照4。1那里慢慢的转过来。。


演示:http://www.90sec.com


查找templates/default/discuz.html
  1. <!--{if is_array($forum['lastpost'])}-->
  2.       <td align="center" title="{lang forum_lastpost_in}: {$forum[lastpost][subject]}" nowrap>
  3.       <span class="smalltxt"><a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][dateline]</a></span><br>{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
  4.       </td>
  5.      <!--{else}-->
复制代码


替换
  1. <!--{if is_array($forum['lastpost'])}-->
  2.       <td align="left" title="{lang forum_lastpost_in}: {$forum[lastpost][subject]}" nowrap>
  3.       <span class="smalltxt">标题: <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum['lastpost'][subject]</a></span><br> <!--{if $forum['lastpost']['author']}-->作者: $forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--><br>日期: $forum[lastpost][dateline]
  4.       </td>
  5.      <!--{else}-->
复制代码




查找
  1. <td width="5%"> </td>
  2. <td width="56%" align="left">{lang forum_name}</td>
  3. <td width="5%">{lang forum_threads}</td>
  4. <td width="5%">{lang forum_posts}</td>
  5. <td width="13%">{lang forum_lastpost}</td>
  6. <td width="16%">{lang forum_moderators}</td>
复制代码


替换
  1. <td width="5%"> </td>
  2. <td width="50%" align="left">{lang forum_name}</td>
  3. <td width="7%">{lang forum_threads}</td>
  4. <td width="7%">{lang forum_posts}</td>
  5. <td width="15%">{lang forum_lastpost}</td>
  6. <td width="16%">{lang forum_moderators}</td>
复制代码




查找:include/forum.func.php
  1. $forum['lastpost'] = $lastpost;
复制代码


后面加
  1. $forum['lastpost'][subject]=cutstr($forum['lastpost'][subject], 20);
复制代码





再来打开templates/default/forumdisplay_subforum.html

  1. <!--{if is_array($sub['lastpost'])}-->
  2.      <td align="center" title="{lang forum_lastpost_in}: $sub[lastpost][subject]" nowrap>
  3.      <span class="smalltxt"><a href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost">$sub[lastpost][dateline]</a></span><br>{lang forum_lastpost_by} <!--{if $sub['lastpost']['author']}-->$sub[lastpost][author]<!--{else}-->{lang anonymous}<!--{/if}-->
  4.      </td>
  5.     <!--{else}-->
复制代码


替换

  1. <!--{if is_array($sub['lastpost'])}-->
  2.      <td align="left" title="{lang forum_lastpost_in}: $sub[lastpost][subject]" nowrap>
  3.      <span class="smalltxt">标题: <a href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost">$sub['lastpost'][subject]</a></span><br> <!--{if $sub['lastpost']['author']}-->作者: $sub[lastpost][author]<!--{else}-->{lang anonymous}<!--{/if}--><br>日期: $sub[lastpost][dateline]
  4.      </td>
  5.     <!--{else}-->
复制代码





查找

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


替换

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

[ 本帖最后由 鬼哥哥 于 2006-8-28 21:50 编辑 ]

本帖子中包含更多资源

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

x
尐sHōw;`z.du’ 发表于 2006-8-28 23:24:20 | 显示全部楼层
沙发!~顶!`
回复

使用道具 举报

云心飞扬 发表于 2006-8-28 23:26:51 | 显示全部楼层
这个不错,收藏先。
回复

使用道具 举报

3481 发表于 2006-8-28 23:31:49 | 显示全部楼层
感谢这位先进的提供,确实完整无误

因版主这栏我己去掉,以致安装后,总是无法齐头,如下列,所附代码,再4.1及RC1 是无错的
但用于RC2就有错误,标题无法显示,但下列代码却能齐头、能否麻烦修改,谢谢

无法齐头
         标题:
         作者:
         日期: 2006-7-20 13:21


标题:
作者:
日期: 2006-7-24 21:20  

下列代码能齐头
  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>┌ </font>标题: <a title="发表时间: $forum[lastpost][dateline]{LF}完整标题: $forum[lastpost][subject]" href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][subjectsc]</a><br>├ </font>时间: <a title="发表时间: $forum[lastpost][dateline]{LF}完整标题: $forum[lastpost][subject]" href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][dateline]</a><br>└ </font>作者: <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang guest}<!--{/if}--></td></tr></table></td><!--{else}-->
  2. <td class="altbg2" align="center"><span class="smalltxt">{lang never}</span></td><!--{/if}-->
复制代码
回复

使用道具 举报

fan156 发表于 2006-8-29 12:25:40 | 显示全部楼层
Parse error: syntax error, unexpected T_ELSE in d:\wwwroot\forumdata\templates\1_discuz.tpl.php on line 137

改了,提示这个错误,主页打不开了

[ 本帖最后由 fan156 于 2006-8-29 12:29 编辑 ]
回复

使用道具 举报

fan156 发表于 2006-8-29 12:27:16 | 显示全部楼层
我是用RC2就有错误,现在怎么弄?
回复

使用道具 举报

fan156 发表于 2006-8-29 12:28:39 | 显示全部楼层
我修改回来了,也不行了
回复

使用道具 举报

zengtian 发表于 2006-8-29 17:49:30 | 显示全部楼层
坑人,用了成这样了
Parse error: parse error, unexpected T_ELSE in /home/xzqd/www/forumdata/templates/1_discuz.tpl.php on line 93
回复

使用道具 举报

云心飞扬 发表于 2006-8-29 18:16:27 | 显示全部楼层
已经成功安装了。谢谢楼主。
回复

使用道具 举报

折翼の天使♂ 发表于 2006-8-29 18:35:05 | 显示全部楼层
...水..
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-28 07:31 , Processed in 0.120769 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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