抽空研究了一下DX1.5帖内广告右侧环绕的修改方法,康盛在正式版里面设置了令人无语的阅读区域,而经查阅相关帖子,发现这个阅读区域设置素一个bug,且在未作任何修改的情况下,DX1.5的帖内广告是无法设置宽度的(只能是120),在参考了各类相关帖子后,我写了这个方法,共各位朋友们参考。
1.关于调整右侧广告的宽度
参考了stephen990的帖子(http://www.discuz.net/forum.php?mod=viewthread&tid=1972530) ,这个方法很好,共分两步:
a.修改source\class\adv\adv_thread.php
// $extra =\'style="width:\'.$_G[\'thread\'][\'contentmr\'].\'px"\';
$extra 整句删除
b.然后修改common.css
编辑 .a_pr 的样式 的宽度
.a_pr { float: right; width: 250px; overflow: hidden; }
2.关于右侧广告的绕排
参考了的sonnyjou帖子(http://www.discuz.net/forum.php?mod=viewthread&tid=1911348),方法是可以的,但是css没有控制正确,以至于有人回帖时说右侧会空出一块来,因此基于他的帖子做修改,完整的方法如下:
(1)需要修改两个文件,修改前请备份
\template\default\forum\viewthread_node_body.htm
\template\default\forum\viewthread_node.htm
(2)首先查找viewthread_node.htm内的代码
- <!--{ad/thread/a_pt/2/$postcount}-->
- <!--{if !$_G['inajax']}-->
- <!--{if $ad_a_pr}-->
- <!--{if !empty($_G['thread']['contentmr']) && empty($ad_a_pr_css)}-->
- <style type="text/css">.pcb{margin-right:<!--{echo $_G['thread']['contentmr']+10}-->px}</style>
- <!--{eval $ad_a_pr_css=1;}-->
- <!--{/if}-->
- $ad_a_pr
- <!--{elseif empty($ad_a_pr_css)}-->
- <style type="text/css">.pcb{margin-right:0}</style>
- <!--{eval $ad_a_pr_css=1;}-->
- <!--{/if}-->
- <!--{/if}-->
- <!--{if $post['first']}-->
- <!--{if $post[tags] || $relatedkeywords}-->
- <div class="ptg">
- <!--{if $post[tags]}-->$post[tags]<!--{/if}-->
- <!--{if $relatedkeywords}--><span>$relatedkeywords</span><!--{/if}-->
- </div>
- <!--{/if}-->
- <!--{/if}-->
复制代码 将其删除,然后保存。
(3)其次打开viewthread_node_body.htm,找到$post[message],在这之前加入如下代码(不要加到table前面,就在$post[message]这几个字符前面,你可以先来个回车,然后加入上述代码):
- <!--{ad/thread/a_pt/2/$postcount}-->
- <!--{if !$_G['inajax']}-->
- <!--{if $ad_a_pr}-->
- <!--{if !empty($_G['thread']['contentmr']) && empty($ad_a_pr_css)}-->
- <style type="text/css">.pcb{margin-right:0}</style>
- <!--{eval $ad_a_pr_css=1;}-->
- <!--{/if}-->
- $ad_a_pr
- <!--{elseif empty($ad_a_pr_css)}-->
- <style type="text/css">.pcb{margin-right:0}</style>
- <!--{eval $ad_a_pr_css=1;}-->
- <!--{/if}-->
- <!--{/if}-->
- <!--{if $post['first']}-->
- <!--{if $post[tags] || $relatedkeywords}-->
- <div class="ptg">
- <!--{if $post[tags]}-->$post[tags]<!--{/if}-->
- <!--{if $relatedkeywords}--><span>$relatedkeywords</span><!--{/if}-->
- </div>
- <!--{/if}-->
- <!--{/if}-->
复制代码 一共有两处,都要加上上述代码
然后保存,后台刷新缓存。
这样就可以完成帖内广告右侧环绕了,我测试了ie6.0-9.0,firefox,chrome都可以正常显示,safari请自行测试。
添加个演示:http://bbs.minoland.com/thread-11382-1-1.html
注:貌似我去看没看到演示
|