今天看到某网站有一篇文章是介绍的数码产品,他这篇文章浏览量很高,顺带我去百度查了下排名非常好啊。但我发现他不仅抓住了流量,并进行了利益转化,就在他文章页头部居然插入了电商产品联盟广告。插入实现方法如下。
1、主题文件“include.php”挂载接口:
function ActivePlugin_主题ID(){
Add_Filter_Plugin('Filter_Plugin_Edit_Response5','主题ID_article_shuo');
}
2、接口代码放置“include.php”代码最后
function 主题ID_article_shuo() {
global $zbp,$article;
echo '<style>.admin_product{ margin:4px 0;}</style>';
echo '<div class="admin_product"><label for="meta_shuo" class="editinputname">广告:</label><input placeholder="留空则不显示,支持联盟代码,支持html" type="text" name="meta_shuo" style=" width:80%; height:30px" value="'.htmlspecialchars($article->Metas->shuo).'"/></div>';
}
3、文章模板页加入显示判断:
{if $article.Metas.shuo}
<div class="say">
<p>{$article.Metas.shuo}</p>
</div>
{/if}
PS:判断是否存在,存在则显示,不存在不显示。
广告插入