// Modify Unread Link // // Purpose: // -------- // This script fires on a prospers.org/forum to update // unread and unreadreplies link to point to the new replies // // Version History: // ---------------- // Version Date Geek Comments // ------- ------- ------ ----------------------------------- // 1.0 04/15/2007 pwrfin Created. // // Installation: // ------------- // This is a Greasemonkey user script. // // To install, you need Greasemonkey: http://www.greasespot.net/ // Then restart Firefox and revisit this script. // // Under Tools, there will be a new menu item to "Install User Script". // Accept the default configuration and install. // // To uninstall, go to Tools/Manage User Scripts, // select "Modify Unread Link", and click Uninstall. // // -------------------------------------------------------------------- // ==UserScript== // @name Modify Unread Link // @namespace http://prospers.org/forum // @description Script to modify unread link in prospers.org forum // @include http://prospers.org/forum/index.php?action=unread // @include http://www.prospers.org/forum/index.php?action=unread // @include http://prospers.org/forum/index.php?action=unreadreplies // @include http://www.prospers.org/forum/index.php?action=unreadreplies // ==/UserScript== window.addEventListener("load", function(e) { var myBody = document.body; if (myBody) { myAtags = myBody.getElementsByTagName("a"); for (var i = 0; i < myAtags.length; i++) { var a = myAtags[i]; if(a.href.match("topic=")) { var linkname = (a.href.split ("=", 2)); var linkname1 = linkname[1]; if(linkname1.match("#")) continue; var linkparts = linkname1.split(";",2); if(linkparts[0]) { var pval = linkparts[0].split('.',2); if(pval[1] == '0') { var newlink = linkname[0]; newlink += "="; newlink += pval[0]; newlink += ".new;"; newlink += linkparts[1]; newlink += "#new"; a.href = newlink; } } } } } }, false);