SCboy论坛用户屏蔽脚本

用于屏蔽特定用户在Scboy论坛中显示的信息

目前為 2020-07-05 提交的版本,檢視 最新版本

// ==UserScript==

// @name         SCboy论坛用户屏蔽脚本

// @namespace    http://tampermonkey.net/

// @version      0.1

// @description  用于屏蔽特定用户在Scboy论坛中显示的信息

// @author       西桑Shisan

// @match        https://www.scboy.com/*

// @grant        none

// ==/UserScript==
var block_list = ["123456789", "12345678910"]

// 在以上block_list中替换和添加你希望屏蔽用户的UID(数量不限,注意保留双引号,ID之间要加逗号)。
// UID可以从用户主页中获得,例如论坛管理员Tager的主页:
// https://www.scboy.com/?user-7.htm
// 其中user-7提示了其UID,也即Tager的UID为7

for(var i = 0, len = block_list.length; i < len; i++){
    block_list[i] = "a[href='?user-" + block_list[i] + ".htm']"
}

// 有需要保留的部分,将其注释掉即可(比如,你仍然希望看到一些宗师玩家的教学贴,尽管已经拉黑了他)
$(block_list.join(', ')).each(function(){
    // 发帖
    if ($(this).parent().parent().hasClass('thread')){
        $(this).parent().parent().hide();
    }
    // 消息(消息会被屏蔽,但依然会有红点提示)
    if ($(this).parent().parent().hasClass('notice')){
        $(this).parent().parent().hide();
    }
    // 回帖
    if ($(this).parent().parent().hasClass('post')){
        $(this).parent().parent().hide();
    }
    // 楼中楼(在楼中楼回复为2页及以上时,点到第二页会使屏蔽功能失效,因此请谨慎点击)
    if ($(this).parent().hasClass('text-left')){
        $(this).hide();
        $(this).next().hide();
    }
})