NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name fokse's d2jsp post blocker // @author Fokse // @description Hides posts from a defined list of users // @namespace jsppostblocker // @include http://forums.d2jsp.org/topic.php?t=*&f=* // @include http://forums.d2jsp.org/topic.php?t=* // @include http://forums.d2jsp.org/post.php // @require http://code.jquery.com/jquery-latest.js // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // ==/UserScript== console.log("Fokse's Post Blocker Loaded~"); function parsePage(){ var uniqueid = [], userlink, userid, quoteCount = 0; jQuery('BODY DIV.tbb FORM[name="REPLIER"] DL DT A[href^="user.php"]').each(function(){ userlink = jQuery(this).attr('href'); userid = userlink.split('='); uniqueid.push(userid[1]); }); jQuery('BODY DIV.tbb form dl dd div.desc.p3 div.fR.links').each(function(){ var userlink = jQuery(this).attr('href'); if (GM_getValue("User_"+uniqueid[quoteCount])){ jQuery(this).prepend("<b><a class =\"unBlockPost\" data-target=\""+uniqueid[quoteCount]+"\" href=\"#\"> UnBlock Posts</u></b>"); } else{ jQuery(this).prepend("<b><a class =\"blockPost\" data-target=\""+uniqueid[quoteCount]+"\" href=\"#\"> Block Posts</u></b>"); } quoteCount++; }); quoteCount = 0; jQuery('BODY DIV.tbb form dl dd div.bts.ppc').each(function(){ if (GM_getValue("User_"+uniqueid[quoteCount])){ $( this ).html('<div class="foot ce ta"><b>Posts from that user are blocked</b></div>'); } quoteCount++; }); $( ".blockPost" ).click(function() { GM_setValue("User_"+jQuery(this).data("target"), true); location.reload(); return false; }); $( ".unBlockPost" ).click(function() { GM_deleteValue("User_"+jQuery(this).data("target")); location.reload(); return false; }); } parsePage();