Discuz!大师网

搜索
查看: 1130|回复: 0

Discuz!手机版版块页面主题列表中隔几个主题插入一个广告位的方法

[复制链接]
发表于 2017-4-10 01:33:00 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
打开模板(以触屏版为例)
\template\default\touch\forum\forumdisplay.htm
将代码
  1. <!--{loop $_G['forum_threadlist'] $key $thread}-->
  2.         <!--{if !$_G['setting']['mobile']['mobiledisplayorder3'] && $thread['displayorder'] > 0}-->
  3.                 {eval continue;}
  4.         <!--{/if}-->
  5.         <!--{if $thread['displayorder'] > 0 && !$displayorder_thread}-->
  6.                 {eval $displayorder_thread = 1;}
  7.         <!--{/if}-->
  8.         <!--{if $thread['moved']}-->
  9.                 <!--{eval $thread[tid]=$thread[closed];}-->
  10.         <!--{/if}-->
  11.         <li>
  12.         <!--{hook/forumdisplay_thread_mobile $key}-->
  13.         <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" $thread[highlight] >
  14.         {$thread[subject]}
  15.         <span class="by">$thread[author]</span>
  16.         </a>
  17.         <span class="num">{$thread[replies]}</span>
  18.         <!--{if in_array($thread['displayorder'], array(1, 2, 3, 4))}-->
  19.                 <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_top.png"></span>
  20.         <!--{elseif $thread['digest'] > 0}-->
  21.                 <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_digest.png"></span>
  22.         <!--{elseif $thread['attachment'] == 2 && $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
  23.                 <span class="icon_tu"><img src="{STATICURL}image/mobile/images/icon_tu.png"></span>
  24.         <!--{/if}-->
  25.         </li>
  26. <!--{/if}-->
  27. {eval $index++;}       
  28. <!--{/loop}-->
复制代码
修改为
  1. {eval $index=0;}
  2. <!--{loop $_G['forum_threadlist'] $key $thread}-->
  3.         <!--{if !$_G['setting']['mobile']['mobiledisplayorder3'] && $thread['displayorder'] > 0}-->
  4.                 {eval continue;}
  5.         <!--{/if}-->
  6.         <!--{if $thread['displayorder'] > 0 && !$displayorder_thread}-->
  7.                 {eval $displayorder_thread = 1;}
  8.         <!--{/if}-->
  9.         <!--{if $thread['moved']}-->
  10.                 <!--{eval $thread[tid]=$thread[closed];}-->
  11.         <!--{/if}-->
  12.         <li>
  13.         <!--{hook/forumdisplay_thread_mobile $key}-->
  14.         <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" $thread[highlight] >
  15.         {$thread[subject]}
  16.         <span class="by">$thread[author]</span>
  17.         </a>
  18.         <span class="num">{$thread[replies]}</span>
  19.         <!--{if in_array($thread['displayorder'], array(1, 2, 3, 4))}-->
  20.                 <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_top.png"></span>
  21.         <!--{elseif $thread['digest'] > 0}-->
  22.                 <span class="icon_top"><img src="{STATICURL}image/mobile/images/icon_digest.png"></span>
  23.         <!--{elseif $thread['attachment'] == 2 && $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
  24.                 <span class="icon_tu"><img src="{STATICURL}image/mobile/images/icon_tu.png"></span>
  25.         <!--{/if}-->
  26.         </li>
  27. <!--{if in_array($index,array(2,6,9))}-->
  28. <li>

  29. <!--上面一行添加广告代码-->
  30. </li>
  31. <!--{/if}-->
  32. {eval $index++;}       
  33. <!--{/loop}-->
复制代码


回复 马甲回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|网站地图|小黑屋|展会网|Discuz站长论坛 |天天打卡

GMT+8, 2024-4-24 13:46 , Processed in 0.027017 second(s), 7 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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