正文中间来一个广告,效果我想不言而喻,呵呵。
无论是误点还是比较让人相信就是文章的一部分也好,反正,收益很明显。
首先 后台加入一个模板变量
$stylevar【insad】
内容为
XML/HTML代码
- <div style="clear:both;"><script type="text/javascript"><!--
- google_ad_client = "pub-4741390588082798";
- /* prcer.com-468x60-sablog */
- google_ad_slot = "6070365387";
- google_ad_width = 468;
- google_ad_height = 60;
- //-->
- </script>
- <script type="text/javascript"
- src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
- </script></div>
打开 index.php
查找
XML/HTML代码
- //TAGS
记得有2处,在上面加入代码
PHP代码
- //处理insad
- $article['content'] = preg_replace("/\s*\[insad\]\s*/ies", "sunrayinsad('\\1')", $article['content']);
打开 global.php
找到
PHP代码
- function footer()
在上面加入代码
PHP代码
- // insad 标签
- function sunrayinsad($id) {
- global $stylevar;
- $code = $stylevar【insad】;
- return $code;
- }
使用时候,只要在需要插入广告的地方插入标签【insad】。
转帖请注明来自 sunray's blog





#1