Advertisement
Foxscotch

Untitled

Oct 12th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name Steve's User Blocker Reborn
  3. // @version 1.0
  4. // @require http://code.jquery.com/jquery-2.0.3.min.js
  5. // @include *forum.blockland.us*
  6. // @include *blockland.us/smf*
  7. // @description Works best with Emo Freak                                :^)
  8. // @author: Steve5451
  9. // ==/UserScript==
  10. //Known bugs: If a blocked user quotes another blocked user, then you'll have two unblock buttons.
  11.  
  12. var defUsers = "BETELGEUSE SUCKS COCKS"; //Default user(s) to block, seperated with a comma Eg. "Emo Freak,Nal,Steve-senpai". You can leave this alone and you will be prompted whether you want to change it when you first run the script.
  13.  
  14.  
  15. //-------- you should probably leave this stuff below alone --------\\
  16.  
  17. if(localStorage.blockedUsers == null) {
  18. var goToProfile = confirm('User Blocker: User table created with default of "' + defUsers + '". Press Ok to change blocked users.');
  19. localStorage.blockedUsers = defUsers;
  20. if(goToProfile == true) {
  21. window.location = 'http://forum.blockland.us/index.php?action=profile;sa=theme';
  22. } else {
  23. alert("User Blocker: You can change the blocked users at any time by going to your Look and Layout Preferences in your profile.");
  24. }
  25. }
  26.  
  27. if(document.URL.indexOf('sa=theme') != -1) {
  28. $('input').each(function() {
  29. if($(this).val() == 'Change profile') {
  30. $(this).before('<div align="left"><h4>Steve\'s User Image Blocker</h4>Users to block: <input class="blockedUsers" value="' + localStorage.blockedUsers + '" /> <input type="button" class="saveUsers" value="Save" /><br/><div style="font-size: 8pt;">Add multiple users with a comma. Eg. \"Emo Freak,Nal,Steve-senpai\" without quotes.<br/>Leave blank to disable (although you could just disable the script)</div><br/><td colspan="2"><hr width="100%" size="1" class="hrcolor"></td><br/></div>');
  31. }
  32. });
  33.  
  34. $('.saveUsers').click(function() {
  35. localStorage.blockedUsers = $('.blockedUsers').val();
  36. alert("Saved");
  37. });
  38. } else if(document.URL.indexOf('topic=') && localStorage.blockedUsers != '') {
  39. var blockedusers = localStorage.blockedUsers;
  40.  
  41. var curName = blockedusers.split(',');
  42. curName.forEach(function(thisName) {
  43. $('.windowbg, .windowbg2').each(function() {
  44. var name = $(this).children().children().first().children().first().children().first().children().first().children().first().html();
  45. if(name == thisName) {
  46. blockstuffs($(this).find('.post').find('img'));
  47. }
  48. });
  49.  
  50. $('.quoteheader').each(function() {
  51. var name = $(this).children().first().html().split('Quote from: ')[1].split(' on <b>')[0];
  52. if(name == thisName) {
  53. blockstuffs($(this).next().find('img'));
  54. }
  55. });
  56. });
  57.  
  58. $('.imgShow').click(function() {
  59. if($(this).attr('revealed') == 'false') {
  60. $(this)
  61. .attr('revealed', 'true')
  62. .val('Hide garbage')
  63. .next().css('height', 'auto')
  64. .css('width', 'auto');
  65. } else {
  66. $(this)
  67. .attr('revealed', 'false')
  68. .val('Show garbage')
  69. .next().css('height', '0px')
  70. .css('width', '0px');
  71. }
  72. });
  73.  
  74. function blockstuffs(img) {
  75. img.before('<input type="button" class="imgShow" revealed="false" value="Show garbage" />');
  76. img.wrap('<div style="height: 0px; width: 0px; overflow: hidden;"></div>');
  77. }
  78. $('a[href="https://forum.blockland.us/index.php?action=profile;u=77986"]').text(atob('UHVzc3kgQm95IFRvbnk='));
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement