aboc 发表于 2015-11-10 21:24:54

帖子点赞相关钩子不存在的解决方法

PC
viewthread_postbottom
template/default/forum/viewthread_node_body.htm
大概是287行,也就是
<!--{else}-->
                <div id="post_rate_div_$post"></div>
        <!--{/if}-->
        <!--{/if}-->
        <!--{hook/viewthread_postbottom $postcount}--><==这就是钩子
</div>

viewthread_title_extra
template/default/forum/viewthread.htm
大概是224行
<!--{/if}-->
                                        <a href="forum.php?mod=viewthread&tid=$_G$fromuid" {if $fromuid}title="{lang share_url_copy_comment}"{/if}>[{lang share_url_copy}]</a>
                                </span>
                                <!--{hook/viewthread_title_extra}--><==这就是钩子
                        </td>
                </tr>
        </table>

forumdisplay_thread_subject
template/default/forum/forumdisplay_list.htm
大概211行
                                                                                        - <span class="xi1">[{lang replycredit} <strong> $thread['replycredit']</strong> ]</span>
                                                                                <!--{/if}-->
                                                                                <!--{hook/forumdisplay_thread_subject $key}--><==这就是钩子
                                                                                <!--{if $thread}-->
                                                                                        <span class="tps">$thread</span>

forumdisplay_thread
template/default/forum/forumdisplay_list.htm
两处,分别是157和290行
                                                                                        <!--{/if}-->
                                                                                <!--{/if}-->
                                                                                <!--{hook/forumdisplay_thread $key}--><==这就是钩子
                                                                                $thread $thread
                                                                                <!--{if $thread['moved']}-->


<h3 class="xw0">
                                                                        <!--{hook/forumdisplay_thread $key}--><==这就是钩子
                                                                        <a href="forum.php?mod=viewthread&tid=$thread&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra"$thread{if $thread['isgroup'] == 1 || $thread['forumstick']} target="_blank"{else}{/if} title="$thread">$thread</a>



手机/触屏版
viewthread_postbottom_mobile
template/default/touch/forum/viewthread.htm
大概是193行
                        <!--{/if}-->
       </div>
   </div>
   <!--{hook/viewthread_postbottom_mobile $postcount}--><==这就是钩子
   <!--{eval $postcount++;}-->
   <!--{/loop}-->

        <!--{subtemplate forum/forumdisplay_fastpost}-->


viewthread_bottom_mobile
template/default/touch/forum/viewthread.htm
大概是204行
</div>
<!-- main postlist end -->

$multipage

<!--{hook/viewthread_bottom_mobile}-->   <==这就是钩子

<script type="text/javascript">

aboc 发表于 2015-12-21 23:45:52

今天新发现一个用户论坛出现手机版无点赞图标,逐一分析代码后,发现为
template/*****_mobile_simple/touch/forum/viewthread.php   
第 71行附近的代码如下,缺少红色那一行,造成在解析插件的时候,因为$postcount 默认为 null,所以无法匹配索引为0的插件内容,所以不能显示
<!-- more pagelist start -->
   <!--{eval $postcount = 0;}-->
<!--{loop $postlist $post}-->
页: [1]
查看完整版本: 帖子点赞相关钩子不存在的解决方法