Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Funner Post Blocker 3
- // @version 1.0
- // @require http://code.jquery.com/jquery-2.0.3.min.js
- // @description Block that user...with style.
- // @author: Steve5451
- // ==/UserScript==
- // Let's set some variables. \\
- var blockeduser = 'BETELGEUSE SUCKS COCKS'; // The exact name of the user you wish to block.
- var usernamereplace = 'Blocked'; // What their name with be replaced with in quotes. Leave empty to disable.
- var blockedtext = '~Blocked~'; // What their post will be replaced with. Leave empty to disable.
- var avatarurl = 'http://i.imgur.com/aYYikg0.png'; // What their avatar will be replaced with. Leave empty to disable.
- if(document.URL.indexOf("?topic=") !=-1) {
- $('.windowbg').each(function(i) {
- checkuser($(this));
- });
- $('.windowbg2').each(function(i) {
- checkuser($(this));
- });
- }
- function checkuser(window) {
- window.find('a').each(function(i) {
- if($(this).parent().attr('class') == "quoteheader") {
- var quote_txt = $(this).html();
- var name_end = quote_txt.indexOf(' on ', 0);
- var name = quote_txt.substring(12,name_end)
- if(name == blockeduser) {
- if(blockedtext != '') {
- $(this).parent().next().html(blockedtext);
- }
- if(usernamereplace != '') {
- $(this).parent().html(usernamereplace);
- }
- }
- }
- if($(this).html() == blockeduser) {
- if(avatarurl != '') {
- $(this).parent().parent().find('.avatar').attr('src', avatarurl);
- }
- if(blockedtext != '') {
- $(this).parent().parent().parent().find('.post').html(blockedtext);
- }
- if(usernamereplace != '') {
- $(this).replaceWith(usernamereplace);
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment