找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 8704|回复: 6

portal门户模板写loop循环问题

  [复制链接]
发表于 2015-2-18 17:06:55 | 显示全部楼层 |阅读模式
  1. <!--{loop $_G['forum_threadlist'] $key $thread}-->
  2.                                                                         <!--{if $_G['hiddenexists'] && $thread['hidden']}-->
  3.                                                                                 <!--{eval continue;}-->
  4.                                                                         <!--{/if}-->
  5.                                                                         <!--{if !$thread['forumstick'] && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}-->
  6.                                                                                 <!--{if $thread['related_group'] == 0 && $thread['closed'] > 1}-->
  7.                                                                                         <!--{eval $thread[tid]=$thread[closed];}-->
  8.                                                                                 <!--{/if}-->
  9.                                                                         <!--{/if}-->
  10.                                                                         <!--{eval $waterfallwidth = $_G[setting][forumpicstyle][thumbwidth] + 24; }-->

  11.                                                                         <div class="bus_loop bus_sd">
  12.                                                                                 <!--{if !$_GET['archiveid'] && $_G['forum']['ismoderator']}-->
  13.                                                                                         <div style="position:absolute;margin:1px;padding:2px;background:#FFF;z-index:9">
  14.                                                                                         <!--{if $thread['fid'] == $_G[fid]}-->
  15.                                                                                                 <!--{if $thread['displayorder'] <= 3 || $_G['adminid'] == 1}-->
  16.                                                                                                         <input onclick="tmodclick(this)" type="checkbox" name="moderate[]" value="$thread[tid]" />
  17.                                                                                                 <!--{else}-->
  18.                                                                                                         <input type="checkbox" disabled="disabled" />
  19.                                                                                                 <!--{/if}-->
  20.                                                                                         <!--{else}-->
  21.                                                                                                 <input type="checkbox" disabled="disabled" />
  22.                                                                                         <!--{/if}-->
  23.                                                                                         </div>
  24.                                                                                 <!--{/if}-->
  25.     <div class="content bus_imghover">
  26.         <a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra" {if $thread['isgroup'] == 1 || $thread['forumstick'] || CURMODULE == 'guide'} target="_blank"{else} onclick="atarget(this)"{/if} title="$thread[subject]">
  27.                                                                                         <!--{if $thread['cover']}-->
  28.             <figure class="busmilo">
  29.                 <img src="$thread[coverpath]" width="350" height="350" alt="$thread[subject]" />
  30.                 <figcaption>
  31.                     <p><!--{echo messagecutstr(DB::result_first('SELECT `message` FROM '.DB::table('forum_post').' WHERE `tid` ='.$thread[tid].' AND `first` =1'),200);}--></p>
  32.                 </figcaption>
  33.             </figure>
  34.                         <!--{else}-->
  35.                                                                                         <span class="nopic" style="width:185px; height:{$_G[setting][forumpicstyle][thumbwidth]}px;"></span>
  36.                                                                                         <!--{/if}-->
  37.         </a>
  38.     </div>
  39.     <div class="content_body">        
  40.                                                                                         <h2><a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra" {if $thread['isgroup'] == 1 || $thread['forumstick'] || CURMODULE == 'guide'} target="_blank"{else} onclick="atarget(this)"{/if} title="$thread[subject]">$thread[subject]</a>
  41.                                                                                         </h2>                        
  42.                                                                                         <p><!--{echo messagecutstr(DB::result_first('SELECT `message` FROM '.DB::table('forum_post').' WHERE `tid` ='.$thread[tid].' AND `first` =1'),200);}--></p>               
  43.                                                                                 </div>
  44.                                                                                 <div class="clear"></div>
  45.                                                                                 <div class="content_infor">
  46.                                                                                         <span class="more"><a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra" {if $thread['isgroup'] == 1 || $thread['forumstick'] || CURMODULE == 'guide'} target="_blank"{else} onclick="atarget(this)"{/if} title="$thread[subject]">阅读全文>></a></span>        
  47.                                                                                         <span class="auther"><a href="home.php?mod=space&uid=$thread[authorid]"><!--{avatar($thread[authorid],small)}--><!--{$thread[author]}--></a></span>
  48.                                                                                         <span>发布时间:$thread[dateline]</span>
  49.                                                                                         <span>回复:$thread[replies]</span>               
  50.                                                                                         <span>浏览:$thread[views]</span>
  51.                                                                                 </div>
  52.                                                                         </div>
  53. <!--{/loop}-->
  54. <div class="bus_w100 bu_fr pg pb20">$multipage</div>
  55. </div>
复制代码


这是门户的loop循环,写了门户不显示循环内容




这段<div class="bus_loop bus_sd">DIV循环内容完全不见了,怎么回事啊

回复

使用道具 举报

发表于 2015-2-19 19:44:08 | 显示全部楼层
loop 循环应该[loop]  ...  [/loop]   这样子写吧?
回复

使用道具 举报

发表于 2015-2-20 12:05:51 | 显示全部楼层
这个是在模板中的循环!
  1. <!--{loop $_G['forum_threadlist'] $key $thread}-->

  2. <!--{/loop}-->

复制代码



  1. [loop]  ...  [/loop]
复制代码

这个是在  DIY 中的模板循环代码!
两者是有区别的!


注意模板中的判断

  1. <!--{if !$_GET['archiveid'] && $_G['forum']['ismoderator']}-->
复制代码


条件不同显示的内容不同!



回复

使用道具 举报

 楼主| 发表于 2015-2-24 09:08:21 | 显示全部楼层
技术帮助 发表于 2015-2-20 12:05
这个是在模板中的循环!

解决办法呢
回复

使用道具 举报

发表于 2015-3-12 11:45:40 | 显示全部楼层
<!--{loop $_G['forum_threadlist'] $key $thread}-->
你们写的这句代码是不是就是指定了loop的数据源。
回复

使用道具 举报

发表于 2015-3-12 14:51:54 | 显示全部楼层
854850613 发表于 2015-3-12 11:45
你们写的这句代码是不是就是指定了loop的数据源。

是的
回复

使用道具 举报

发表于 2015-3-12 15:37:34 | 显示全部楼层

还是不明白怎么指定的。
能不能给给URI看看。
回复

使用道具 举报

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

本版积分规则

QQ|Archiver|手机版|小黑屋|Discuz代码分析|Discuz目录结构|DZ起点网 ( 蜀ICP备13000518号-15 )

GMT+8, 2024-5-17 19:11 , Processed in 0.053866 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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