Hack Forums Ban reason on profile - HTTPS Fix

Adds ban reason to a banned profile - HTTPS Fix

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name            Hack Forums Ban reason on profile - HTTPS Fix
// @namespace       Snorlax - Fixed by Leroy Jethro Gibbs
// @description		Adds ban reason to a banned profile - HTTPS Fix
// @require			https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @include			*hackforums.net/member.php?action=profile&uid=*
// @version         1.0	
// @grant       none
// ==/UserScript==

userBanned = $(".group7").length;
UID = document.location.href.replace(/[^0-9]/g, '');
username = $(".group7").text();

if(userBanned == 1) {
    $("a[href*='misc.php?action=username_history&uhuid=']").after("<br /><strong>Ban reason: </strong><span id='banReason'>Loading...</span>");
    $("#banReason").after("<br /><a href='javascript:void(0)' id='showMore' style='font-size:x-small'>Show more...</a>");
    $("#showMore").after("<div style='display: none;' id='extraInfo' ><strong>Banned by: </strong><span id='bannedBy'>Loading...</span></div>");
    $("#bannedBy").after("<br /><strong>Ban date info: </strong><span id='banDate'>Loading...</span>");
    $("#banDate").after('<br /><a id="citeBan" href="javascript:void();">[cite ban]</a></div>');
    getPage();
}

function getPage() {
    $.ajax({
        type: "GET",
        url: "/bans.php",
        async: true,
        data: "",
        success: function(data){
            banPage(data);
        }
    });
}

function banPage(data) {
    banReason = $(data).find("a[href*='" + UID + "']:contains('" + username + "')").parent().next().html();
    console.log(banReason);
    bannedBy = $(data).find("a[href*='" + UID + "']:contains('" + username + "')").parent().next().next().html();
    console.log(bannedBy);
    bannedWhen = $(data).find("a[href*='" + UID + "']:contains('" + username + "')").parent().next().next().next().html();
    console.log(bannedWhen);
    banExpiry = $(data).find("a[href*='" + UID + "']:contains('" + username + "')").parent().next().next().next().next().html();
    console.log(banExpiry);
    $("#banReason").html(banReason); 
    $("#bannedBy").html(bannedBy);
    $("#banDate").html("Banned: " + bannedWhen + ". Will expire: " + banExpiry + ".");

}

$("#showMore").on("click", function() {
    $(this).hide();
    $("#extraInfo").show();
});
$("#citeBan").on("click", function() {
    prompt("Cited Ban:","[b][url=" + document.location.href + "][color=black]" + username + "[/color][/url][/b] was banned for: " + banReason);
});