pastebin - collaborative debugging tool
polynomial.kpaste.net RSS


XR QuickMod
Posted by Anonymous on Fri 22nd Jul 2011 15:17
raw | new post

  1. // ==UserScript==
  2. // @name           IPB Quick Moderate / XtremeRoot
  3. // @namespace      http://www.xtremeroot.net/
  4. // @include        http*://www.xtremeroot.net/Offensive/index.php?*showtopic=*
  5. // ==/UserScript==
  6.  
  7. document.body.innerHTML += '<a id="quick_moderate_button" href="#" style="position: fixed; z-index: 99999; top: 0; left: 0; font-weight: bold; text-decoration: none; background-color: #050; color: #fff; text-align: center; display: block; width: 34px; height: 22px;">QM</a>';
  8.  
  9. var button = document.getElementById('quick_moderate_button');
  10.  
  11. var qm_on = false;
  12.  
  13. button.addEventListener('click', function() {
  14.  
  15.         var html = document.body.innerHTML;
  16.  
  17.         var posts = Array();
  18.        
  19.         if(qm_on == true) { qm_on = false; } else { qm_on = true; }
  20.  
  21.         var offset = 0;
  22.         while(true)
  23.         {
  24.                 var msg_pos = html.indexOf('Begin Msg Number ', offset);
  25.                 if(msg_pos == -1) break;
  26.                 msg_pos += 17;
  27.                 var msg_end = html.indexOf('-->', msg_pos);
  28.                 var msg_id = parseInt( html.substr(msg_pos, msg_end - msg_pos) );
  29.                 posts.push(msg_id);
  30.                 offset = msg_end + 1;
  31.         }
  32.        
  33.         for($i = 0; $i < posts.length; $i++)
  34.         {
  35.                 var el = document.getElementById('post_id_' + posts[$i].toString());
  36.                 var divs = el.getElementsByTagName('div');
  37.                 if(qm_on == true)
  38.                 {
  39.                         document.getElementById('branding').style.display = 'none';
  40.                         divs[1].style.display = 'none';
  41.                         divs[6].style.display = 'none';
  42.                 } else {
  43.                         document.getElementById('branding').style.display = 'block';
  44.                         divs[1].style.display = 'block';
  45.                         divs[6].style.display = 'block';
  46.                 }
  47.         }
  48. }, false );

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}





All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at