Discuz给淘帖,最新帖子,最新回复页面加导航和顶部广告方法
默认情况下这两类页面是无法直接通过应用广告的。
那么这个就需要修改默认的模板了,
方法很简单,自定义一个广告
这个我就不多说了,来说下怎么加上去,我们在目录
template\default\common
找到Header.htm文件,打开直接拉到最下方面
添加两处代码即可
[C#] 纯文本查看 复制代码 </div>
<!--{/if}-->
<!--{if $_G['uid']}-->
<ul id="myitem_menu" class="p_pop" style="display: none;">
<li><a href="forum.php?mod=guide&view=my">{lang mypost}</a></li>
<li><a href="home.php?mod=space&do=favorite&view=me">{lang favorite}</a></li>
<li><a href="home.php?mod=space&do=friend">{lang friends}</a></li>
<!--{hook/global_myitem_extra}-->
</ul>
<!--{/if}-->
<!--{subtemplate common/header_qmenu}-->
<!--{/if}-->
<!--{ad/headerbanner/wp a_h}-->
<div class="wp a_h"><!--{ad/custom_15}--></div> 看这里添加的是顶部广告
<div id="hd">
<div class="wp">
<div class="hdc cl">
<!--{eval $mnid = getcurrentnav();}-->
<h2><!--{if !isset($_G['setting']['navlogos'][$mnid])}--><a href="{if $_G['setting']['domain']['app']['default']}http://{$_G['setting']['domain']['app']['default']}/{else}./{/if}" title="$_G['setting']['bbname']">{$_G['style']['boardlogo']}</a><!--{else}-->$_G['setting']['navlogos'][$mnid]<!--{/if}--></h2>
<!--{template common/header_userstatus}-->
</div>
<div id="nv">
<a href="javascript:;" id="qmenu">{lang my_nav}</a>
<ul>
<!--{loop $_G['setting']['navs'] $nav}-->
<!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}--><li {if $mnid == $nav[navid]}class="a" {/if}$nav[nav]></li><!--{/if}-->
<!--{/loop}-->
</ul>
<!--{hook/global_nav_extra}-->
</div>
<!--{if !empty($_G['setting']['plugins']['jsmenu'])}-->
<ul class="p_pop h_pop" id="plugin_menu" style="display: none">
<!--{loop $_G['setting']['plugins']['jsmenu'] $module}-->
<!--{if !$module['adminid'] || ($module['adminid'] && $_G['adminid'] > 0 && $module['adminid'] >= $_G['adminid'])}-->
<li>$module[url]</li>
<!--{/if}-->
<!--{/loop}-->
</ul>
<!--{/if}-->
$_G[setting][menunavs]
<div id="mu" class="cl">
<!--{if $_G['setting']['subnavs']}-->
<!--{loop $_G[setting][subnavs] $navid $subnav}-->
<!--{if $_G['setting']['navsubhover'] || $mnid == $navid}-->
<ul class="cl {if $mnid == $navid}current{/if}" id="snav_$navid" style="display:{if $mnid != $navid}none{/if}">
$subnav
</ul>
<!--{/if}-->
<!--{/loop}-->
<!--{/if}-->
</div>
<!--{ad/subnavbanner/a_mu}-->
<!--{ad/custom_16}-->看这里添加的是二级导航广告
<!--{subtemplate common/pubsearchform}-->
</div>
</div>
<!--{hook/global_header}-->
<!--{/if}-->
<div id="wp" class="wp">
效果如本站样式
|