如何正确在日志内容中加任意GOOGLE ADSENSE广告代码

2008/05/26  |  4:00 上午分类:免费资源  |  360 views

解决方案

在你的模板文件global.css里面加一个
.ad {
float: left;
}
定义
然后打开include目录下面的read.inc.php文件

找到
<div class="Content-body" id="logcontent_<?php echo $fa['id']?>" style="word-break:break-all; table-layout: fixed;">

在以上代码后面加上以下代码
<div class=ad  style="float:left">你的gg代码</div>

要定义广告放置的位置需要改变style="float:left"的值
对应的为:left;right;inherit;none等

PS:这里的GG代码建议为250×250!
以上是别人修改方案,而现在我要告诉大家的不同

其实<div class=ad  style="float:left">你的gg代码</div>这段代码的定义style="float:left"完全可以去除,那样的话你就可以加2个或者更多的广告代码了,日志顶部2个广告根据你风格大小而定广告的格式!
修改后代码:
<div class=ad><script type="text/javascript"><!–
google_ad_client = "pub-5977695576655798";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
//2007-09-09: 两性, 娱乐, 婴儿, 孕妇, 美女
google_ad_channel = "2468448810+2439191414+6299995353+1203589425+8124405883";
google_color_border = "081218";
google_color_bg = "081218";
google_color_link = "00CCFF";
google_color_text = "7B96A5";
google_color_url = "008000";
//–>
</script>
<script type="text/javascript"
  src="
http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><script type="text/javascript"><!–
google_ad_client = "pub-5977695576655798";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
//2007-09-09: 两性, 娱乐, 婴儿, 孕妇, 美女
google_ad_channel = "2468448810+2439191414+6299995353+1203589425+8124405883";
google_color_border = "081218";
google_color_bg = "081218";
google_color_link = "00CCFF";
google_color_text = "7B96A5";
google_color_url = "008000";
//–>
</script>
<script type="text/javascript"
  src="
http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></
div><br/>
其中部分为我的广告代码你可以换作你自己的!


发表您的评论