Discuz教程网

[代码修改] Discuz X2 目前最漂亮最时尚的首页横排美化

  [复制链接]
authicon dly 发表于 2011-7-16 10:58:16 | 显示全部楼层 |阅读模式
1314学习网图片103.jpg

本次修改于官方模板,横排美化增加版主显示/最新主题显示/版块介绍显示/版主申请,菜鸟作品,喜欢的就支持一个,话不多说,有图有真相
测试网站:www.bingsi.net

修改方法如下:


打开官方模板文件:
template/default/forum/discuz.htm
查找如下代码:
  1. <dt><a href="$forumurl"{if $forum[redirect]} target="_blank"{/if}{if $forum[extra][namecolor]} style="color: {$forum[extra][namecolor]};"{/if}>$forum[name]</a><!--{if $forum[todayposts] && !$forum['redirect']}--><em class="xw0 xi1" title="{lang forum_todayposts}"> ($forum[todayposts])</em><!--{/if}--></dt>
  2. <!--{if empty($forum[redirect])}--><dd><em>{lang forum_threads}: $forum[threads]</em>, <em>{lang forum_posts}: $forum[posts]</em></dd><!--{/if}-->
  3. <dd>
  4. <!--{if $forum['permission'] == 1}-->
  5. {lang private_forum}
  6. <!--{else}-->
  7. <!--{if $forum['redirect']}-->
  8. <a href="$forumurl" class="xi2">{lang url_link}</a>
  9. <!--{elseif is_array($forum['lastpost'])}-->
  10. <!--{if $cat['forumcolumns'] < 3}-->
  11. <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}-->{lang anonymous}<!--{/if}--></cite>
  12. <!--{else}-->
  13. <a href="forum.php?mod=redirect&tid=$forum[lastpost][tid]&goto=lastpost#lastpost">{lang forum_lastpost}: $forum[lastpost][dateline]</a>
  14. <!--{/if}-->
  15. <!--{else}-->
  16. {lang never}
  17. <!--{/if}-->
  18. <!--{/if}-->
  19. </dd>
复制代码

替换成如下代码:
  1. <dt>┌<img src="{STATICURL}image/common/arrow_right.gif"/><a href="$forumurl"{if $forum[redirect]} target="_blank"{/if}{if $forum[extra][namecolor]} style="color: {$forum[extra][namecolor]};"{/if}>$forum[name]</a><!--{if $forum[todayposts] && !$forum['redirect']}--><!--{/if}-->  <!--{if $forum['moderators']}--><font color="#3366CC">{lang forum_moderators}: $forum[moderators]</font><!--{else}--><a href="http://www.bingsi.net/plugin.php?id=ks_ac:ks_ac&apc=apply&mod=index"><font color="#CCCCFF">暂无版主.点击申请</font></a><!--{/if}--></h2></dt>
  2. <!--{if !$forum['redirect']}-->
  3. <p>├<img src="{STATICURL}image/common/arrow_right.gif"/><!--{if $forum[description]}-->{echo cutstr($forum[description], 32)}<!--{/if}--></p><dd class="i">├<img src="{STATICURL}image/common/arrow_right.gif"/><em>{lang forum_threads}: $forum[threads]</em> <em>{lang forum_posts}: $forum[posts]</em> <em><!--{if $forum[todayposts]}-->{lang forum_todayposts}: <font color="#FF3399">$forum[todayposts]</font><img src="static/image/common/new_bg.gif"align="absmiddle"><!--{else}-->{lang forum_todayposts}: <font color="#FF3399">0</font><!--{/if}--></em></dd><!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><p>{lang forum_moderators}: $forum[moderators]</p><!--{else}--></ul><!--{/if}--><!--{else}--><!--{/if}--></div>
  4. <!--{/if}-->
  5. <!--{if $forum[description] && !$cat['forumcolumns']}--><dd class="xg2">$forum[description]</dd><!--{/if}-->
  6. <!--{if $forum['subforums'] && $cat['forumcolumns'] <= 1}--><dd class="sfl">{lang forum_subforums}: $forum['subforums']</dd><!--{/if}-->
  7. <!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}-->
  8. <dd>

  9. <!--{if $forum['permission'] == 1}-->
  10. {lang private_forum}
  11. <!--{else}-->
  12. <!--{if $forum['redirect']}-->
  13. <a href="$forumurl" class="xi2">{lang url_link}</a>
  14. <!--{elseif is_array($forum['lastpost'])}-->
  15. <!--{if $cat['forumcolumns'] < 3}-->
  16. <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}-->{lang anonymous}<!--{/if}--></cite>
  17. <!--{else}-->
  18. └<img src="{STATICURL}image/common/arrow_right.gif"/>新主题:<a href="forum.php?mod=redirect&tid=$forum[lastpost][tid]&goto=lastpost#lastpost" class="xi2"><!--{echo cutstr($forum[lastpost][subject], 25)}--></a>
  19. <!--{/if}-->
  20. <!--{else}-->
  21. {lang never}
  22. <!--{/if}-->
  23. <!--{/if}-->
  24. </dd>
复制代码

如要在每个版块之间加一个美化边框的:

查找代码:
  1. <td class="fl_g" width="$cat[forumcolwidth]">
复制代码

替换成如下代码:
  1. <td class="fl_g" width="$cat[forumcolwidth]" style="padding:10px 5px; ">
  2. <div style="border:1px solid #ccc; ">
  3. <div style="padding:5px; ">
复制代码

注意:增加美化边框后,会使新主题错位,目前还没找到修改方法,大侠们可以自行修改,并希望给出修改代码.

最后请到后台更新缓存即可.这一步不可省哦.


所需图片请下载后上传到网站根目下的:

static/image/common


懒人包下载后请覆盖原文件即可.

附件下载: Discuz! X2 目前最漂亮最时尚的首页横排美化.zip (8.18 KB, 下载次数: 69)



上一篇:Discuz X2 最漂亮的首页焦点N格,让默认风格更清爽!
下一篇:DIY滚动的最新记录(站内微博)模块代码,带渐变!
authicon 摸西瓜啊 发表于 2011-7-20 08:46:14 | 显示全部楼层
看看。。。。。
authicon 都市dt1752 发表于 2011-7-26 20:15:35 | 显示全部楼层
蛮不错的说,正好需要,谢楼主分享
authicon 龙盘凤逸 发表于 2011-7-26 20:19:32 | 显示全部楼层
非常好方法,学习了,谢谢楼主的分享!
authicon 都市dt1752 发表于 2011-7-26 22:41:14 | 显示全部楼层
  1. http://www.bingsi.net/plugin.php?id=ks_ac:ks_ac&apc=apply&mod=index
复制代码

把代码中这个网址修改为你的版主申请网址
authicon 陆地飞鱼 发表于 2011-10-30 19:10:30 | 显示全部楼层
看下
authicon 胶州城网 发表于 2011-10-30 22:41:21 | 显示全部楼层
个人认为这个显得很乱
authicon 林潞视觉摄影 发表于 2011-11-1 01:27:41 | 显示全部楼层
看看  好像不错
authicon 天狼客服 发表于 2011-12-5 20:37:44 | 显示全部楼层
支持 这个是人品问题,下载别人东西 就应该恢复的
authicon 柏明权 发表于 2011-12-30 00:28:08 | 显示全部楼层
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 22:01

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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