![]() |
VBB3中如何给帖子的第一楼加广告(以Google广告为例)
很多人想知道如何给1楼的帖子加广告,其实很简单的,显示帖子的时候不是有 第1楼,第2楼吗?只要在适当的地方加个判断,如果是第1楼就显示广告就可以了。
首先修改 postbit 模板(如何你使用的是传统方式,就修改postbit_legacy模板),查找: Quote:
<if condition="$post['postcount'] == '1'"> </if> 后在<if>和</if>之间加上你从广告商处得来的广告代码, <script type="text/javascript"><!-- google_ad_client = "xxxxxx"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_channel =""; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> 当然,在<script>前和</script>后你可以加上例如<center>之类的修饰广告位置的语句。 |
| All times are GMT +8. The time now is 03:18 AM. |
Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.