Advertisement
taerkitty

phpBB Ignore Topic

Apr 23rd, 2012
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           Ignore Topic
  3. // @namespace      http://userscripts.org/scripts/show/31174
  4. // @description    Ignore Topic
  5. // @include        http://www.nerfrevolution.com/forums/*
  6. // ==/UserScript==
  7.  
  8. // IPB Completely hide user
  9. //
  10. // Remove table elements (posts) by given user
  11. // from UserScripts.org
  12. // http://userscripts.org/scripts/show/31174
  13. //
  14. // This is a Greasemonkey user script
  15. // Requires Greasemonkey Version 0.8
  16. //
  17. // To install, you need Greasemonkey, get it from: http://www.greasespot.net
  18. // Then restart Firefox and revisit this script.
  19. // Under Tools, there will be a new menu item to "Install User Script".
  20. // Accept the default configuration and install.
  21. //
  22. // To uninstall, go to Tools/Manage User Scripts,
  23. // select "IPB Completely hide user", and click Uninstall.
  24. //
  25. //
  26. // --------------------------------------------------------------------------
  27. // ==UserScript==
  28. // @name           IPB Completely hide user
  29. // @namespace      http://userscripts.org/scripts/show/31174
  30. // @description    Remove table elements with certain user names
  31. // ==/UserScript==
  32. //
  33. // --------------------------------------------------------------------------
  34. // VERSION HISTORY:
  35. //
  36. // 1.3.1
  37. // Reworked to target threads in NRev
  38. //
  39. // 1.3
  40. // Changed string match method to exact match for posts and better match
  41. // for quotes
  42. //
  43. // 1.2
  44. // Added hide quotes from users
  45. //
  46. // 1.1
  47. // Switched from remove to hide - faster and more reliable.
  48. //
  49. // 1.0
  50. // Basic remove post from posters given in the list
  51. //
  52. // --------------------------------------------------------------------------
  53.  
  54. var blacklist =
  55. [
  56.     "Nerfers Nerfing For Jesus",
  57.     "Another Topic You Don't Want to Ever See Again"
  58. ];
  59.  
  60.  
  61. function removeThreads(node)
  62. {
  63.     var topic = node.firstChild.nodeValue;
  64.     GM_log("topic: '" + topic + "'");
  65.    
  66.     for (j = 0; j < blacklist.length; j++)
  67.     {
  68.         // GM_log("blacklist[" + j + "]: '" + blacklist[j] + "'");
  69.         if (topic == blacklist[j])
  70.         {
  71.             GM_log("found");
  72.             node.parentNode.parentNode.style.display = 'none';
  73.         }
  74.     }
  75.    
  76. }
  77.  
  78. var foo = document.getElementsByTagName("a");
  79. for (var i=0; i<foo.length; i++)
  80. {
  81.     if ((foo[i].className == "topictitle") || (foo[i].className == "topictitle link-new"))
  82.     {
  83.         removeThreads(foo[i]);
  84.     }
  85. }
  86.  
  87. return;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement