前段时间发布了一篇关于在帖子中adsense插入广告文章http://nt.discuz.net/showtopic-22082.html
但是会在所有的帖子中都插入广告,这样就违反了google中所说最多显示三个广告的规则,我于是少加修改,只在第一层显示广告代码。修改文件/aspx/1/showtopic.aspx (1为当前模板目录)
templateBuilder.Append(" <!--用户信息结束-->\r\n");
templateBuilder.Append(" <div class=\"Dright2\">\r\n");
templateBuilder.Append(" <div style=\"padding:0px;height:auto!important;height:280px;min-height:280px;\">\r\n");
//显示帖子内容
string adIframe="";//iframe广告
//只在第一楼显示广告,否则会违反google规则
if(post["id"].ToString().Trim()=="1")
);
这样既不会违反规则,又达到了广告的效果,怎样?不错吧!
演示效果:http://bbs.51aspx.com/showtopic-434.html
是不是只在第一层显示阿?
相关文章:
-
2022-12-23
-
2021-06-09
-
2021-06-12
-
2021-08-09
-
2021-12-23
-
2021-05-18
-
2021-11-11
-
2021-11-24