GameFAQs Private Board Boot Button

Adds a boot button to the private board member list

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        GameFAQs Private Board Boot Button
// @namespace   http://userscripts.org/scripts/show/177183
// @description Adds a boot button to the private board member list
// @include     http://www.gamefaqs.com/boards/*
// @include     https://www.gamefaqs.com/boards/*
// @version     1.11
// ==/UserScript==

var list = document.getElementsByClassName("board")[0];
if (list) {
    var tbodys = list.getElementsByTagName("tbody");
    for (var i = 1; i < tbodys.length; i++) {
        tbodys[i].getElementsByTagName("tr")[0].innerHTML = '<th>Member</th><th>Last Visit</th><th>Boot</th>';
        var tre = tbodys[i].getElementsByTagName("tr");
        for (var j = 1; j < tre.length; j++) {
            first_td = tre[j].getElementsByTagName("td")[0].innerHTML;
            second_td = tre[j].getElementsByTagName("td")[1].innerHTML;
            user = tre[j].getElementsByTagName("td")[0].getElementsByTagName("a")[0].innerHTML;
            tre[j].innerHTML = '<td>' + first_td + '</td><td>' + second_td + '</td>';
            if (first_td.indexOf("<b>") == -1) {
                tre[j].innerHTML += '<td><b><input type="button" onclick="document.forms[2].target_text.value=\'' + user + '\';document.forms[2].action.value=\'removemember\';document.forms[2].submit();" value="Boot" /></b></td>';
            } else if (first_td.indexOf("(owner)") == -1 && document.forms[4]) {
                tre[j].innerHTML += '<td><b><input type="button" onclick="document.forms[4].target_text.value=\'' + user + '\';document.forms[4].action.value=\'demotemember\';document.forms[4].submit();" value="Demote" /></b></td>';
            }
        }
    }
}