不知如何描述 viewthread.htm、viewthread_node.htm、viewthread_node_body.htm这三个模板,也没有琢磨明白之间的关系,公开资料描述:
| -- template -- default -- forum -- viewthread.htm 看帖页面模板文件
| -- template -- default -- forum -- viewthread_node.htm 新回复节点模板文件
| -- template -- default -- forum -- viewthread_node_body.htm 主题回复节点模板文件
其中,是以viewthread.htm为主体,其中引入viewthread_node.htm和viewthread_node_body.htm,三个模板中功能代码不能随意移动使用。
通常,viewthread.htm想要使用其他两个模板里的代码,需要这样:
- <!--{loop $postlist $post}-->
- ……
- <!--{/loop}-->
复制代码 最近在做个模板下载站,在viewthread.htm测试了两段代码,一个是横排展示的小图,一个是供下载的附件,需要脱离帖子内容区域单独使用,代码如下:
横排小图:(代码来自viewthread_node_body.htm)
- <!--{loop $postlist $post}-->
- <!--{if $post['attachment'] && $_GET['from'] != 'preview'}-->
- <div class="attach_nopermission attach_tips">
- <div>
- <h3><strong>{lang attach_nopermission_notice}</strong></h3>
- <p><!--{if $_G['uid']}-->{lang attach_nopermission}<!--{elseif $_G['connectguest']}-->{lang attach_nopermission_connect_fill_profile}<!--{else}-->{lang attach_nopermission_login} <!--{hook/global_login_text}--><!--{/if}--></p>
- </div>
- <span class="atips_close" onclick="this.parentNode.style.display='none'">x</span>
- </div>
- <!--{elseif $post['imagelist'] || $post['attachlist']}-->
- <div class="pattl">
- <!--{if $post['imagelist'] && $_G['setting']['imagelistthumb'] && $post['imagelistcount'] >= $_G['setting']['imagelistthumb']}-->
- <!--{if !isset($imagelistkey)}-->
- <!--{eval $imagelistkey = rawurlencode(dsign($_G[tid].'|100|100'))}-->
- <script type="text/javascript" reload="1">var imagelistkey = '$imagelistkey';</script>
- <!--{/if}-->
- <!--{eval $post['imagelistthumb'] = true;}-->
- <div class="bbda cl mtw mbm pbm">
- <strong>{lang more_images}</strong>
- <a href="javascript:;" onclick="attachimglst('$post[pid]', 0)" class="xi2 attl_g">{lang image_small}</a>
- <a href="javascript:;" onclick="attachimglst('$post[pid]', 1, {echo intval($_G['setting']['lazyload'])})" class="xi2 attl_m">{lang image_big}</a>
- </div>
- <div id="imagelist_$post[pid]" class="cl" style="display:none"><!--{echo showattach($post, 1)}--></div>
- <div id="imagelistthumb_$post[pid]" class="pattl_c cl"><img src="{IMGDIR}/loading.gif" width="16" height="16" class="vm" /> {lang image_list_openning}</div>
- <!--{else}-->
- <!--{echo showattach($post, 1)}-->
- <!--{/if}-->
- </div>
- <!--{/if}-->
- <!--{/loop}-->
复制代码 下载附件:(代码来自viewthread_node_body.htm)
- <!--{loop $postlist $post}-->
- <!--{if $post['attachlist']}-->
- <!--{eval echo showattach($post)}-->
- <!--{/if}-->
- <!--{/loop}-->
复制代码 暂时可以用,是否有问题还未知。
|