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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] 首页美化,在最新帖子前面添加“新”字样!

[复制链接]
chen345210 发表于 2011-10-12 13:49:30 | 显示全部楼层 |阅读模式
效果图:

修改方法:
首先我们将附件图片上传至当前模板的图片文件夹下!默认模板路径为static/image/common
上传覆盖即可,然后我们接下来修改模板文件。
打开现在使用的模板文件,例如:现在我们使用的是官方默认的模板(default)
打开template/default/forum/discuz.htm
查找
  1. <a href="forum.php?mod=redirect&tid=$forum[lastpost][tid]&goto=lastpost#lastpost" class="xi2 "><!--{echo cutstr($forum[lastpost][subject], 30)}--></a> <cite>$forum[lastpost][dateline] <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->$_G[setting][anonymoustext]<!--{/if}--></cite>
复制代码

替换为:

  1. <a href="forum.php?mod=redirect&tid=$forum[lastpost][tid]&goto=lastpost#lastpost" class="xi2 drtban_new"><!--{echo cutstr($forum[lastpost][subject], 30)}--></a> <cite>$forum[lastpost][dateline] <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->$_G[setting][anonymoustext]<!--{/if}--></cite>
复制代码

然后我们在查找
  1. <a href="forum.php?mod=redirect&tid=$forum[lastpost][tid]&goto=lastpost#lastpost" class="xi2 "><!--{echo cutstr($forum[lastpost][subject], 30)}--></a> <cite>$forum[lastpost][dateline] <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->$_G[setting][anonymoustext]<!--{/if}--></cite>
复制代码

替换为
  1. <a href="forum.php?mod=redirect&tid=$forum[lastpost][tid]&goto=lastpost#lastpost" class="xi2 drtban_new"><!--{echo cutstr($forum[lastpost][subject], 30)}--></a> <cite>$forum[lastpost][dateline] <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->$_G[setting][anonymoustext]<!--{/if}--></cite>
复制代码
然后我们在打开css文件
路径:template /default /common /module.css
然后在尾部添加
  1. .drtban_new{padding-left:18px;background-attachment: scroll;background-image: url({IMGDIR}/ban_new.gif);background-repeat: no-repeat;background-position: 0px 2px;
  2. background-size:auto;background-origin:padding-box;background-clip:border-box;background-color:transparent;}
复制代码
然后我们进入后台缓存,打开首页查看一下吧!

”新“字图下载:


本帖子中包含更多资源

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

x
 楼主| chen345210 发表于 2011-10-12 13:49:53 | 显示全部楼层
演示地址:http://bbs.7drt.com
回复

使用道具 举报

urs2 发表于 2011-10-12 14:14:28 | 显示全部楼层
要改动的东西挺多的啊。
回复

使用道具 举报

 楼主| chen345210 发表于 2011-10-12 15:03:09 | 显示全部楼层
urs2 发表于 2011-10-12 14:14
要改动的东西挺多的啊。

也不算多,呵呵呵!
回复

使用道具 举报

404786069 发表于 2011-10-12 15:26:53 | 显示全部楼层
顶一下.
回复

使用道具 举报

我是一块砖 发表于 2011-10-12 16:06:35 | 显示全部楼层
改的太复杂了
回复

使用道具 举报

 楼主| chen345210 发表于 2011-10-12 17:31:38 | 显示全部楼层
某有那么复杂吧、、
回复

使用道具 举报

szcavan 发表于 2011-10-12 18:06:11 | 显示全部楼层
要改动的东西挺多的啊。
回复

使用道具 举报

 楼主| chen345210 发表于 2011-10-12 20:19:17 | 显示全部楼层
不会吧,这都闲多!呵呵!
回复

使用道具 举报

SSAY 发表于 2011-10-12 20:43:11 | 显示全部楼层
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-22 12:54 , Processed in 0.110607 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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