慢慢赚钱博客

9月 30 2019

Discuz的logo右侧加图片广告方法

找到文件:
/template/default/common/header.htm

找到第125行:

<h2><!--{if !isset($_G['setting']['navlogos'][$mnid])}--><a title="$_G['setting']['bbname']" href="{if $_G['setting']['domain']['app']['default']} {$_G['scheme']}://{$_G['setting']['domain']['app']['default']}/{else}./{/if}">{$_G['style']['boardlogo']}</a><!--{else}- ->$_G['setting']['navlogos'][$mnid]<!--{/if}--></h2>

准备好你的广告代码,比如一个图片广告:(高度最好和你的logo一样,规定宽度和高度)
<a href="/forum-2-1.html" target="_blank" rel="noopener noreferrer"><img src="/images/70.gif" width="700" height="66" /></a>
或者按高度自适应:
<a href="/forum-2-1.html" target="_blank" rel="noopener noreferrer"><img src="/images/70.gif" height="66" /></a>

很简单,放到</h2>前面就可以了,最终效果:(红字是嵌进去的)
<h2><!--{if !isset($_G['setting']['navlogos'][$mnid])}--><a title="$_G['setting']['bbname']" href="{if $_G['setting']['domain']['app']['default']} {$_G['scheme']}://{$_G['setting']['domain']['app']['default']}/{else}./{/if}">{$_G['style']['boardlogo']}</a><!--{else}- ->$_G['setting']['navlogos'][$mnid]<!--{/if}--><a href="/forum-2-1.html" target="_blank" rel="noopener noreferrer"><img src="/images/70.gif" height="66" /></a></h2>

Written by moneyslow.com

moneyslow.com真棒!