hwm_forum_t_filter

Фильтр по совпадению текста на форуме

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name            hwm_forum_t_filter
// @author          Kleshnerukij
// @description     Фильтр по совпадению текста на форуме
// @version         0.4.0
// @include         https://www.heroeswm.ru/forum_messages.php?tid=*
// @include         https://qrator.heroeswm.ru/forum_messages.php?tid=*
// @include         https://178.248.235.15/forum_messages.php?tid=*
// @include         https://www.lordswm.com/forum_messages.php?tid=*
// @encoding 	    utf-8
// @namespace       https://greasyfork.org/users/12821
// ==/UserScript==

// (c) Клещнерукий - http://www.heroeswm.ru/pl_info.php?id=7076906

(function() {
    'use strict';

    // При необходимости, можно задать ещё условия для фильтра
    var x46_filter_phrase = [
        '(.*?|)саш.*?зеб.*?',
        'https://webhamster.ru/mytetrashare/index/mtb0/1033'
    ];

	var x46_page_content = document.getElementsByTagName('body')[0].innerHTML;
	var x46_search_zeb_msg = /name="(\d+)" class="pi">\d+<\/a>&nbsp;<\/span>&nbsp;\d+\-\d+\-\d+ \d+:\d+:\d+<\/td><td style="border: 0px; background-image: none" align="right"><\/td><\/tr><\/tbody><\/table><\/td><\/tr><tr><td style="color: #000000; padding: 5px;font-size: 0.8125em;">(.*?)<\/td>/isg;
	var x46_search_zeb_err = /(.*?|)саш.*?зеб.*?/isg;
	var x46_chek_section = /forum_thread\.php\?id=\d+\"><font class=\"forumt\">(Форум для внеигровых тем|Творчество)<\/font>/i;
	var x46_msg_id;

    while ((x46_msg_id = x46_search_zeb_msg.exec(x46_page_content)) !== null) {
        x46_filter_phrase.forEach(function(x46_reg, i) {
            var x46_temp_reg = new RegExp(x46_reg, "igs");
            if (x46_msg_id[2].search(x46_temp_reg) != -1) {
                document.getElementsByName(x46_msg_id[1])[0].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling.getElementsByTagName('td')[0].innerHTML = '<font color="red">Сообщение удалено спам-фильтром</font>';
            }
        });
    }
})();