xerotic

HackForums.net - Search Your Threads v1.0.0

Feb 17th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name            HackForums Search Your Threads
  3. // @namespace       Xerotic
  4. // @description     Adds the Search Your Threads (SYT) button to forum display pages.
  5. // @include         https://hackforums.net/forumdisplay.php*
  6. // @version         1.0.0
  7. // @grant           none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11.     var fid = parseInt($('div.breadcrumb').find('a').last().attr('href').split("fid=")[1]);
  12.     var username = $('span.welcome').find('a').text();
  13.  
  14.     var newHTML = `&nbsp;&nbsp;|&nbsp;&nbsp;<form method="post" action="search.php" style="display:inline">
  15.         <input type="hidden" name="action" value="do_search">
  16.         <input type="hidden" name="matchusername" value="1">
  17.         <input type="hidden" name="forums" value="${fid}">
  18.         <input type="hidden" name="threadprefix" value="any">
  19.         <input type="hidden" name="showresults" value="threads">
  20.         <input type="hidden" name="author" value="${username}">
  21.         <button type="submit" class="button" name="submit" title="Search Your Threads"><strong>SYT</strong></button>
  22.     </form>`;
  23.  
  24.     $('td.thead').find('div.float_right').find('strong').append(newHTML);
  25. })();
Add Comment
Please, Sign In to add comment