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

打开插件目录下的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>';
        }
    };

 

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

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