首先要先写出调用广告的代码,首页,列表页,查看页都是不一样的 - 首页
- <!--{eval $ads = getad('system', 'indexad', '1'); }-->
- 分类页
- <!--{eval $ads = getad('system', $channel, '1'); }-->
- 列表页
- <!--{eval $ads2 = getad('system', $channel, '2'); }-->
- 查看页
- <!--{eval $ads3 = getad('system', $channel, '3'); }-->
复制代码
接下来就是显示广告到的各个位置的代码
- 页面顶部
- <!--{if !empty($ads2['pageheadad']) }-->
- <div class="ad_header">$ads2[pageheadad]</div>
- <!--{/if}-->
- 页面中央横幅
- <!--{if !empty($ads2['pagecenterad'])}-->
- <div class="ad_mainbody">$ads2[pagecenterad]</div>
- <!--{/if}-->
- 页面底部
- <!--{if !empty($ads2['pagefootad'])}-->
- <div class="ad_pagebody">$ads2[pagefootad]</div>
- <!--{/if}-->
- 页面侧边
- <!--{if !empty($ads2['siderad'])}-->
- <div class="global_module margin_bot10 bg_fff">
- <div class="global_module2_caption"><h3>网络资源</h3></div>
- <div class="ad_sidebar">
- $ads2[siderad]
- </div>
- </div>
- <!--{/if}-->
- 页面对联
- <!--{if !empty($ads2['pagemovead']) || !empty($ads2['pageoutad'])}-->
- <!--{if !empty($ads2['pagemovead'])}-->
- <div id="coupleBannerAdv" style="z-index: 10; position: absolute; width:100px;left:10px;top:10px;display:none">
- <div style="position: absolute; left: 6px; top: 6px;">
- $ads2[pagemovead]
- <br />
- <img src="{S_URL}/images/base/advclose.gif" onMouseOver="this.style.cursor='hand'" onClick="closeBanner
- ('coupleBannerAdv');">
- </div>
- <div style="position: absolute; right: 6px; top: 6px;">
- $ads2[pagemovead]
- <br />
- <img src="{S_URL}/images/base/advclose.gif" onMouseOver="this.style.cursor='hand'" onClick="closeBanner
- ('coupleBannerAdv');">
- </div>
- </div>
- <!--{/if}-->
- 页面漂浮
- <!--{if !empty($ads2['pageoutad'])}-->
- <div id="floatAdv" style="z-index: 10; position: absolute; width:100px;left:10px;top:10px;display:none">
- <div id="floatFloor" style="position: absolute; right: 6px; bottom:-700px">
- $ads2[pageoutad]
- </div>
- </div>
- <!--{/if}-->
- </div>
- <!--{/if}-->
复制代码重要的一点就是显示代码$ad* 是根据调用代码改变而改变的,而且首页是没有侧边广告的 不知道有哪里错的没,大家指点指点哈
|