portal门户模板写loop循环问题
<!--{loop $_G['forum_threadlist'] $key $thread}--><!--{if $_G['hiddenexists'] && $thread['hidden']}-->
<!--{eval continue;}-->
<!--{/if}-->
<!--{if !$thread['forumstick'] && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}-->
<!--{if $thread['related_group'] == 0 && $thread['closed'] > 1}-->
<!--{eval $thread=$thread;}-->
<!--{/if}-->
<!--{/if}-->
<!--{eval $waterfallwidth = $_G + 24; }-->
<div class="bus_loop bus_sd">
<!--{if !$_GET['archiveid'] && $_G['forum']['ismoderator']}-->
<div style="position:absolute;margin:1px;padding:2px;background:#FFF;z-index:9">
<!--{if $thread['fid'] == $_G}-->
<!--{if $thread['displayorder'] <= 3 || $_G['adminid'] == 1}-->
<input onclick="tmodclick(this)" type="checkbox" name="moderate[]" value="$thread" />
<!--{else}-->
<input type="checkbox" disabled="disabled" />
<!--{/if}-->
<!--{else}-->
<input type="checkbox" disabled="disabled" />
<!--{/if}-->
</div>
<!--{/if}-->
<div class="content bus_imghover">
<a href="forum.php?mod=viewthread&tid=$thread&{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">
<!--{if $thread['cover']}-->
<figure class="busmilo">
<img src="$thread" width="350" height="350" alt="$thread" />
<figcaption>
<p><!--{echo messagecutstr(DB::result_first('SELECT `message` FROM '.DB::table('forum_post').' WHERE `tid` ='.$thread.' AND `first` =1'),200);}--></p>
</figcaption>
</figure>
<!--{else}-->
<span class="nopic" style="width:185px; height:{$_G}px;"></span>
<!--{/if}-->
</a>
</div>
<div class="content_body">
<h2><a href="forum.php?mod=viewthread&tid=$thread&{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">$thread</a>
</h2>
<p><!--{echo messagecutstr(DB::result_first('SELECT `message` FROM '.DB::table('forum_post').' WHERE `tid` ='.$thread.' AND `first` =1'),200);}--></p>
</div>
<div class="clear"></div>
<div class="content_infor">
<span class="more"><a href="forum.php?mod=viewthread&tid=$thread&{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">阅读全文>></a></span>
<span class="auther"><a href="home.php?mod=space&uid=$thread"><!--{avatar($thread,small)}--><!--{$thread}--></a></span>
<span>发布时间:$thread</span>
<span>回复:$thread</span>
<span>浏览:$thread</span>
</div>
</div>
<!--{/loop}-->
<div class="bus_w100 bu_fr pg pb20">$multipage</div>
</div>
这是门户的loop循环,写了门户不显示循环内容
http://bbs.zb7.com/forum.php?mod=attachment&aid=MzU1ODZ8MTlhMTZjYmR8MTQyNDI1MDMxMnw4MjgwOXw1MDAzNTA%3D
这段<div class="bus_loop bus_sd">DIV循环内容完全不见了,怎么回事啊
loop 循环应该... 这样子写吧? 这个是在模板中的循环!
<!--{loop $_G['forum_threadlist'] $key $thread}-->
<!--{/loop}-->
而
...
这个是在DIY 中的模板循环代码!
两者是有区别的!
注意模板中的判断
<!--{if !$_GET['archiveid'] && $_G['forum']['ismoderator']}-->
条件不同显示的内容不同!
技术帮助 发表于 2015-2-20 12:05
这个是在模板中的循环!
解决办法呢 <!--{loop $_G['forum_threadlist'] $key $thread}-->
你们写的这句代码是不是就是指定了loop的数据源。
854850613 发表于 2015-3-12 11:45
你们写的这句代码是不是就是指定了loop的数据源。
是的 技术帮助 发表于 2015-3-12 14:51
是的
还是不明白怎么指定的。
能不能给给URI看看。
页:
[1]