频道循环,每个子栏目下,自动加广告位。
在系统设置-自定义全局变量处:增加变量:
photo_pids
值为广告位的pid,多个广告位按照 1,2,3等格式录入
之后在模板中按照下面方法添加广告位。
在循环前加:
{php $photo_pids = $siteconfigs['photo_pids'];$photo_pids=explode(',',$photo_pids);}
在循环里面加:
{php $poster_num = array_shift($photo_pids)}
广告代码如下:
<div style="height: 120px; background: #ddd"><script src="{WEBURL}promote/{$poster_num}.js"></script></div>