找回密码
 立即注册
搜索

途迹耕耘

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

GMT+8, 2025-12-22 05:42 , Processed in 0.098775 second(s), 14 queries .

[DZ教程] discuz 只调用回复回复楼

[复制链接]
bdk 发表于 2020-5-2 06:47:45 | 显示全部楼层 |阅读模式
在帖子内容页,1楼(主题帖)与回复帖代码:
  1. <!--{eval $postcount = 0;}-->
  2.         <!--{loop $postlist $post}-->
  3.                 <!--{if $rushreply && $_GET['checkrush'] && $post['rewardfloor'] != 1}-->
  4.                         <!--{eval continue;}-->
  5.                 <!--{/if}-->
  6.                 <div id="post_$post[pid]" {if $_G['blockedpids'] && $post['inblacklist']}style="display:none;"{/if}>
  7.                         <!--{subtemplate forum/viewthread_node}-->
  8.                 </div>
  9.                 <!--{eval $postcount++;}-->
  10.         <!--{/loop}-->
复制代码
其中的
  1. <div id="post_$post[pid]" {if $_G['blockedpids'] && $post['inblacklist']}style="display:none;"{/if}>
  2. <!--{subtemplate forum/viewthread_node}-->
  3. </div>
复制代码
为主题帖与回复楼公同使用,如果只调用回复楼,不调用1楼主题帖,则:
  1. <!--{eval $postcount = 0;}-->
  2. <!--{loop $postlist $post}-->
  3. <!--{if $rushreply && $_GET['checkrush'] && $post['rewardfloor'] != 1}-->
  4. <!--{eval continue;}-->
  5. <!--{/if}-->
  6. <!--{if !$post['first'] && $_G['forum_thread']['replies']}-->
  7. <div id="post_$post[pid]" class="box"><!--{subtemplate forum/viewthread_node}--></div>
  8. <!--{/if}-->
  9. <!--{eval $postcount++;}-->
  10. <!--{/loop}-->
复制代码
第6行做了判断:不是1楼,并有回复。
---------------------------------------------------------
如果只调用1楼,不调用回复:

  1. <!--{eval $postcount = 0;}-->
  2. <!--{loop $postlist $post}-->
  3. <!--{if $rushreply && $_GET['checkrush'] && $post['rewardfloor'] != 1}-->
  4. <!--{eval continue;}-->
  5. <!--{/if}-->
  6. <!--{if $post['first']}-->
  7. <div id="post_$post[pid]" class="box"><!--{subtemplate forum/viewthread_node}--></div>
  8. <!--{/if}-->
  9. <!--{eval $postcount++;}-->
  10. <!--{/loop}-->
复制代码
第6行做了判断:1楼。
OK.