View Last Post on 'Your Posts'

Add a View Last Post link to the 'Your Posts' page.

当前为 2016-01-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name View Last Post on 'Your Posts'
  3. // @description Add a View Last Post link to the 'Your Posts' page.
  4. // @author Jawe - http://www.hackforums.net/member.php?action=profile&uid=2219785
  5. // @include *hackforums.net/search.php*
  6. // @version 1.0
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
  8. // @namespace https://greasyfork.org/users/24272
  9. // ==/UserScript==
  10. var pageText = $('body').html().toString();
  11.  
  12. var foundText = pageText.indexOf("Last Post");
  13.  
  14. if (foundText == -1) {
  15. $(".trow1 a[href*='showthread.php?tid=']").each(function(e) {
  16. uid = $(this).attr("href");
  17.  
  18.  
  19.  
  20.  
  21. if (uid.indexOf('pid') > -1) {} else {
  22.  
  23. $(this).after("<a href=" + uid + "&action=lastpost><b><u>View Last Post</u></b></a>");
  24. $(this).after(" || ");
  25. }
  26.  
  27. })
  28.  
  29. $(".trow2 a[href*='showthread.php?tid=']").each(function(e) {
  30. uid = $(this).attr("href");
  31.  
  32. if (uid.indexOf('pid') > -1) {} else {
  33.  
  34. $(this).after("<a href=" + uid + "&action=lastpost><b><u>View Last Post</u></b></a>");
  35. $(this).after(" || ");
  36. }
  37.  
  38. })
  39. }