解决abs_shortcode点击隐藏内容回复会打开高级回复窗口问题
vasd 16小时前

打开插件目录下的hook目录找到shortcode_case_end.php并打开。

找到

// [reply]...[/reply] => 回复用户可见
$this->bbcode_table["/\[reply\](.*?)\[\/reply\]/is"] = function ($match) {
    global $uid, $tid, $thread;
    $is_reply = db_find_one('post', array('uid' => $uid, 'tid' => $tid));
    if (isset($thread['firstpid'])) {
        if ($is_reply || $thread['uid'] === $uid) {
            return '<div class="alert alert-success">' . $match[1] . '</div>';
        } else {
            // 就是这一行要改!
            return '<div class="alert alert-warning">' . '本帖有隐藏内容,请您<a href="' . url('post-create-' . $tid) . '" style="font-weight:bold;">回复</a>后查看。' . '</div>';
        }
    } else {
        return '<div class="alert alert-secondary">' . $match[1] . '</div>';
    }
};

改成

// [reply]...[/reply] => 回复用户可见
    $this->bbcode_table["/\[reply\](.*?)\[\/reply\]/is"] = function ($match) {
        global $uid, $tid, $thread;
        $is_reply = db_find_one('post', array('uid' => $uid, 'tid' => $tid));
        if (isset($thread['firstpid'])) {
            if ($is_reply || $thread['uid'] === $uid) {
                return '<div class="alert alert-success">' . $match[1] . '</div>';
            } else {
                // 修改处
                if ($uid) {
                    return '<div class="alert alert-warning">本帖有隐藏内容,请您<a href="javascript:void(0);" onclick="$(\'html, body\').animate({scrollTop: $(\'#quick_reply_form\').offset().top}, 500);" style="font-weight:bold; color:#0084ff;" class="reply-link">回复</a>后查看。</div>';
                } else {
                    // 未登录:跳转到登录页
                    return '<div class="alert alert-warning">本帖有隐藏内容,请您<a href="' . url('user-login') . '" style="font-weight:bold; color:#0084ff;">登录</a>后回复查看。</div>';
                }    
            }
        } else {
            return '<div class="alert alert-secondary">' . $match[1] . '</div>';
        }
    };

 

温馨提示:楼主使用知乎蓝主题,其他主题未测试可行性

最后于 14小时前 被vasd编辑 ,原因:
最新回复 (2)
全部楼主
  • Tillreetree 版主
    12小时前 2
    0
    感谢反馈
  • outsider
    9小时前 3
    0
    楼主,你写得实在是太好了。我惟一能做的,就只有把这个帖子顶上去这件事了。 
返回
vasd
一级用户组
8
主题数
3
帖子数
扫码访问