找回密码
 立即注册

QQ登录

只需一步,快速开始

万卷论坛-万卷网

[discuz教程] Discuz!手机版版块页面主题列表中隔几个主题插入一个广告

[复制链接]

发表于 2018-1-11 14:40:23 | 显示全部楼层 |阅读模式
Discuz!手机版版块页面主题列表中隔几个主题插入一个广告位的方法,打开模板(以触屏版为例)
\template\default\touch\forum\forumdisplay.htm

将代码
[html] view plain copy print?

  • <!--{loop $_G['forum_threadlist'] $key $thread}-->  
  •     <!--{if !$_G['setting']['mobile']['mobiledisplayorder3'] && $thread['displayorder'] > 0}-->  
  •         {eval continue;}  
  •     <!--{/if}-->  
  •     <!--{if $thread['displayorder'] > 0 && !$displayorder_thread}-->  
  •         {eval $displayorder_thread = 1;}  
  •     <!--{/if}-->  
  •     <!--{if $thread['moved']}-->  
  •         <!--{eval $thread[tid]=$thread[closed];}-->  
  •     <!--{/if}-->  
  •     <li>  
  •     <!--{hook/forumdisplay_thread_mobile $key}-->  
  •     <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" $thread[highlight] >  
  •     {$thread[subject]}  
  •     <span class="by">$thread[author]</span>  
  •     </a>  
  •     <span class="num">{$thread[replies]}</span>  
  •     <!--{if in_array($thread['displayorder'], array(1, 2, 3, 4))}-->  
  •         <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_top.png"></span>  
  •     <!--{elseif $thread['digest'] > 0}-->  
  •         <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_digest.png"></span>  
  •     <!--{elseif $thread['attachment'] == 2 && $_G['setting']['mobile']['mobilesimpletype'] == 0}-->  
  •         <span class="icon_tu"><img src="{STATICURL}image/mobile/images/icon_tu.png"></span>  
  •     <!--{/if}-->  
  •     </li>  
  • <!--{/if}-->  
  • {eval $index++;}      
  • <!--{/loop}-->  

<!--{loop $_G['forum_threadlist'] $key $thread}-->        <!--{if !$_G['setting']['mobile']['mobiledisplayorder3'] && $thread['displayorder'] > 0}-->                {eval continue;}        <!--{/if}-->        <!--{if $thread['displayorder'] > 0 && !$displayorder_thread}-->                {eval $displayorder_thread = 1;}        <!--{/if}-->        <!--{if $thread['moved']}-->                <!--{eval $thread[tid]=$thread[closed];}-->        <!--{/if}-->        <li>        <!--{hook/forumdisplay_thread_mobile $key}-->        <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" $thread[highlight] >        {$thread[subject]}        <span class="by">$thread[author]</span>        </a>        <span class="num">{$thread[replies]}</span>        <!--{if in_array($thread['displayorder'], array(1, 2, 3, 4))}-->                <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_top.png"></span>        <!--{elseif $thread['digest'] > 0}-->                <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_digest.png"></span>        <!--{elseif $thread['attachment'] == 2 && $_G['setting']['mobile']['mobilesimpletype'] == 0}-->                <span class="icon_tu"><img src="{STATICURL}image/mobile/images/icon_tu.png"></span>        <!--{/if}-->        </li><!--{/if}-->{eval $index++;}        <!--{/loop}-->
修改为
[html] view plain copy print?

  • {eval $index=0;}  
  • <!--{loop $_G['forum_threadlist'] $key $thread}-->  
  •     <!--{if !$_G['setting']['mobile']['mobiledisplayorder3'] && $thread['displayorder'] > 0}-->  
  •         {eval continue;}  
  •     <!--{/if}-->  
  •     <!--{if $thread['displayorder'] > 0 && !$displayorder_thread}-->  
  •         {eval $displayorder_thread = 1;}  
  •     <!--{/if}-->  
  •     <!--{if $thread['moved']}-->  
  •         <!--{eval $thread[tid]=$thread[closed];}-->  
  •     <!--{/if}-->  
  •     <li>  
  •     <!--{hook/forumdisplay_thread_mobile $key}-->  
  •     <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" $thread[highlight] >  
  •     {$thread[subject]}  
  •     <span class="by">$thread[author]</span>  
  •     </a>  
  •     <span class="num">{$thread[replies]}</span>  
  •     <!--{if in_array($thread['displayorder'], array(1, 2, 3, 4))}-->  
  •         <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_top.png"></span>  
  •     <!--{elseif $thread['digest'] > 0}-->  
  •         <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_digest.png"></span>  
  •     <!--{elseif $thread['attachment'] == 2 && $_G['setting']['mobile']['mobilesimpletype'] == 0}-->  
  •         <span class="icon_tu"><img src="{STATICURL}image/mobile/images/icon_tu.png"></span>  
  •     <!--{/if}-->  
  •     </li>  
  • <!--{if in_array($index,array(2,6,9))}-->  
  • <li>  
  •   
  • <!--上面一行添加广告代码-->  
  • </li>  
  • <!--{/if}-->  
  • {eval $index++;}      
  • <!--{/loop}-->  

{eval $index=0;}<!--{loop $_G['forum_threadlist'] $key $thread}-->        <!--{if !$_G['setting']['mobile']['mobiledisplayorder3'] && $thread['displayorder'] > 0}-->                {eval continue;}        <!--{/if}-->        <!--{if $thread['displayorder'] > 0 && !$displayorder_thread}-->                {eval $displayorder_thread = 1;}        <!--{/if}-->        <!--{if $thread['moved']}-->                <!--{eval $thread[tid]=$thread[closed];}-->        <!--{/if}-->        <li>        <!--{hook/forumdisplay_thread_mobile $key}-->        <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" $thread[highlight] >        {$thread[subject]}        <span class="by">$thread[author]</span>        </a>        <span class="num">{$thread[replies]}</span>        <!--{if in_array($thread['displayorder'], array(1, 2, 3, 4))}-->                <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_top.png"></span>        <!--{elseif $thread['digest'] > 0}-->                <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_digest.png"></span>        <!--{elseif $thread['attachment'] == 2 && $_G['setting']['mobile']['mobilesimpletype'] == 0}-->                <span class="icon_tu"><img src="{STATICURL}image/mobile/images/icon_tu.png"></span>        <!--{/if}-->        </li><!--{if in_array($index,array(2,6,9))}--><li><!--上面一行添加广告代码--></li><!--{/if}-->{eval $index++;}        <!--{/loop}-->修改说明
in_array($index,array(2,6,9)表示在第3、第7、第10个主题后面插入一个广告位,广告代码在上面所示位置。

温馨提示:
1、万卷书店现有正版新书,二手书,电子书。当您有需要购买时请联系QQ:2328858568 微信:a15319999845给您查询处理。注明:万卷论坛。有优惠
2、论坛已开通免费注册。当您在访问万卷论坛中遇到问题,投诉邮箱:673665010@qq.com 第一时间给您回复处理。




上一篇:DISCUZ!论坛管理员无法登录后台的各种解决方法总结
下一篇:Discuz!开发之插件页面title、keywords、description等SEO设置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

资讯网--资讯科技信息网站|网站地图

Processed in 0.074485 second(s), 30 queries.

站点统计| 举报| Archiver| 手机版| 小黑屋

Powered by Discuz! X3.4 © 2001-2018 Comsenz Inc.

使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

Honor accompaniments. theme macfee

快速回复 返回顶部 返回列表