本帖最后由 毅馨 于 2011-11-21 10:21 编辑
效果预览:- http://dytt.th.ht/forum.php
复制代码 或者见下图:
版本说明:
1.没有版块简介的时候显示“点击申请版主”
2.有版块简介的时候显示版块简介
3.没有版主显示版主空缺
4.有版主下拉菜单显示版主
5.有主题显示:最后发布的主题及作者
6.没有主题显示:暂无主题,抢先发布
7.有新主题,右上角显示主题数
具体效果见下图(点击看大图):
修改自该版块的一横排美化的帖子,现在已经找不到了,无法贴上原文链接,修改后去除了多余的css等,在IE下不会出现网页有错误等!
若想实现效果,请认真看完全贴!
步骤:
首先管理中心-论坛-分区编辑-论坛首页下级子版块横排:填大于或者等于2的数字
懒人覆盖版只适合默认风格或者你目前使用的风格目录下没有forum目录:
懒人覆盖版请修改下载的压缩包里的template/default/forum/discuz.htm文件,先查找:点击申请版主,修改前面的链接为您的论坛版主申请的链接!然后再把upload文件夹下的全部文件上传覆盖!
手动修改版
首先:
修改static/js/目录下的:common.js
用记事本打开,在底部查找- if(BROWSER.ie) {
- document.documentElement.addBehavior("#default#userdata");
- }
复制代码 替换为:- if(BROWSER.ie) {
- document.documentElement.addBehavior("#default#userdata");
- }
- function forumbackshow(id){
- document.getElementById(id).style.background="#f8f8f8";
- }
- function forumbackout(id){
- document.getElementById(id).style.background="";
- }
- function showgoto() {
- var i, args=showgoto.arguments; document.showgtvlaue = false;
- for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
- }
复制代码 修template\default\common目录下的:common.css
用记事本打开,在底部查找- .slidebox {display: none; }
复制代码 替换为:- .slidebox {display: none; }
- /* 横排美化 */
- .ficodiv {float:left;}
- .ficodiv,.ficodiv img{width:56px; height:56px; overflow:hidden; margin-top:2px; margin-right:5px;}
- .f_ttdiv {height:56px; line-height:20px;overflow:hidden;}
- .f_name {height:20px; overflow:hidden;}
- .f_name small{float:right;color:#aaa;}
- .f_name small span{color:#f30;}
- .f_name a span{font-size:14px;}
- .f_lyhp {float:left;}
- .f_lyhp {color:#999;}
- .f_bkjs {height:20px; line-height:18px; overflow:hidden;color:#888;}
- .f_tzmh {padding:5px; height:18px; line-height:20px; overflow:hidden;}
复制代码 其次:
修改\template\default\forum或者您目前使用风格forum目录下的discuz.htm的文件
查找:- <td class="fl_g" width="$cat[forumcolwidth]">
- <div class="fl_icn_g"{if !empty($forum[extra][iconwidth]) && !empty($forum[icon])} style="width: {$forum[extra][iconwidth]}px;"{/if}>
- <!--{if $forum[icon]}-->
- $forum[icon]
- <!--{else}-->
- <a href="$forumurl"{if $forum[redirect]} target="_blank"{/if}><img src="{IMGDIR}/forum{if $forum[folder]}_new{/if}.gif" alt="$forum[name]" /></a>
- <!--{/if}-->
- </div>
- <dl{if !empty($forum[extra][iconwidth]) && !empty($forum[icon])} style="margin-left: {$forum[extra][iconwidth]}px;"{/if}>
- <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>
- <!--{if empty($forum[redirect])}--><dd><em>{lang forum_threads}: $forum[threads]</em>, <em>{lang forum_posts}: $forum[posts]</em></dd><!--{/if}-->
- <dd>
- <!--{if $forum['permission'] == 1}-->
- {lang private_forum}
- <!--{else}-->
- <!--{if $forum['redirect']}-->
- <a href="$forumurl" class="xi2">{lang url_link}</a>
- <!--{elseif is_array($forum['lastpost'])}-->
- <!--{if $cat['forumcolumns'] < 3}-->
- <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>
- <!--{else}-->
- <a href="forum.php?mod=redirect&tid=$forum[lastpost][tid]&goto=lastpost#lastpost">{lang forum_lastpost}: $forum[lastpost][dateline]</a>
- <!--{/if}-->
- <!--{else}-->
- {lang never}
- <!--{/if}-->
- <!--{/if}-->
- </dd>
- </dl>
- </td>
复制代码 替换为:- <td class="fl_g" width="$cat[forumcolwidth]" style="padding:10px 5px; ">
- <div id="showback_$forum[fid]" style="border:1px solid #ccc; cursor:default;" onmouseover="forumbackshow('showback_$forum[fid]')" onmouseout="forumbackout('showback_$forum[fid]')">
- <div style="padding:5px; ">
- <div class="ficodiv">
- <!--{if $forum[icon]}-->
- $forum[icon]
- <!--{else}-->
- <a href="$forumurl"{if $forum[redirect]} target="_blank"{/if}>
- <img src="{IMGDIR}/forum{if $forum[folder]}_new{/if}.gif" alt="$forum[name]" />
- </a>
- <!--{/if}-->
- </div>
- <div class="f_ttdiv" {if !empty($forum[extra][iconwidth]) && !empty($forum[icon])} style="margin-left: {$forum[extra][iconwidth]}px;"{/if}>
- <div class="f_name" title="$forum[name]">
- <small>
- <!--{if $forum[todayposts] && !$forum['redirect']}-->
- (<span title="{lang forum_todayposts}">$forum[todayposts]</span>)
- <!--{/if}-->
- </small>
- <a href="$forumurl" {if $forum[redirect]}target="_blank"{/if}{if $forum[extra][namecolor]} style="color:{$forum[extra][namecolor]};"{/if}>
- <span>$forum[name]</span>
- </a>
- </div>
- <div class="f_name">
- <!--{if empty($forum[redirect])}-->
- <div class="f_lyhp">
- <span>主题:</span><em style="color:#f60;">$forum[threads]</em>
- </div><div style="float:left;">
- <span>帖子:</span><em style="color:#090;">$forum[posts]</em>
- <!--{if $forum[moderators]}-->
- <span id="default{$forum['fid']}" class="showmenu" onmouseover="showMenu(this.id);">版主列表</span>
- <ul id="default{$forum['fid']}_menu" class="p_pop" style="display:none;"><!--{echo str_replace(array(',',' c="1"'),'',$forum[moderators]);}--></ul><!--{else}-->
- 版主空缺
- <!--{/if}-->
- </div>
- <!--{/if}-->
- </div>
- <div class="f_bkjs">
- <!--{if $forum[description]}-->
- <span tabindex="$forum[description]">$forum[description]</span>
- <!--{else}-->
- <a href="您的版主申请的链接地址"><b style="color:#f30;">点击申请版主</b></a>
- <!--{/if}-->
- </div>
- </div>
- </div>
- <div class="f_tzmh">
- <!--{if $forum['redirect']}-->
- <a href="$forumurl" class="xi2">{lang url_link}</a>
- <!--{elseif is_array($forum['lastpost'])}-->
- <FONT color=#003D79>最后发表:</font>
- <a href="forum.php?mod=viewthread&tid=$forum[lastpost][tid]" class="xi2">
- <!--{echo cutstr($forum[lastpost][subject], 25)}--></a>
- <!--{if $forum['lastpost']['author']}-->(by:$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->)
- </a>
- <!--{else}-->
- <FONT color=#003D79>最后发表:</font>暂无主题, <a href="forum.php?mod=post&action=newthread&fid=$forum[fid]">抢先发表</a>!
- <!--{/if}-->
- </div>
- </div>
- </td>
复制代码 <a href="您的版主申请的链接地址"><b style="color:#f30;">点击申请版主</b></a>
自行修改为您的版主申请的链接地址!
查找:- <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>
复制代码 替换为:- <a href="forum.php?mod=viewthread&tid=$forum[lastpost][tid]" 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>
复制代码 查找:
- <p class="chart z">{lang index_today}: <em>$todayposts</em><span class="pipe">|</span>{lang index_yesterday}: <em>$postdata[0]</em><span class="pipe">|</span>{lang index_posts}: <em>$posts</em><span class="pipe">|</span>{lang index_members}: <em>$_G['cache']['userstats']['totalmembers']</em><!--{if $_G['setting']['lastmember']}--><span class="pipe">|</span>{lang welcome_new_members}: <em><a href="home.php?mod=space&username={echo rawurlencode($_G['setting']['lastmember'])}" target="_blank" class="xi2">$_G['setting']['lastmember']</a></em><!--{/if}--></p>
复制代码 替换为:- <p class="chart z">{lang index_today}: <em>$todayposts</em><span class="pipe"> | </span><img src="{IMGDIR}/yestoday.gif" alt="昨日贴数" style="position:relative; top:4px;"> {lang index_yesterday}: $postdata[0]<span class="pipe"> | </span><img src="{IMGDIR}/replay.gif" alt="总贴数" style="position:relative; top:4px;"> {lang index_posts}: <em>$posts</em><span class="pipe"> | </span><img src="{IMGDIR}/members.gif" alt="会员数" style="position:relative; top:4px;"> {lang index_members}: <em>$_G['cache']['userstats']['totalmembers']</em><!--{if $_G['setting']['lastmember']}--><span class="pipe"> | </span><img src="{IMGDIR}/welcome.gif" alt="欢迎新会员" style="position:relative; top:4px;"> {lang welcome_new_members}: <em><a href="home.php?mod=space&username={echo rawurlencode($_G['setting']['lastmember'])}" target="_blank" class="xi2">$_G['setting']['lastmember']</a></em><!--{/if}--></p>
复制代码 使用手动修改版的请把以下文件里面的图片上传到:\static\image\common目录下
会实现昨日,帖子,会员,欢迎新会员前面家图标的效果:
ok后台更新一下缓存,看看效果吧!
|