Source for "Tibia Forum Post Number"

By Pnoexz
Has 1 other script.


// ==UserScript==
// @name           Tibia Forum Post Number
// @include        http://forum.tibia.com/*
// @author         Pnoexz (pnoexz@hotmail.com)
// @description    Shows the direct link and the replace code of a post on the forums of the MMORPG Tibia.
// ==/UserScript==

// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need FireFox http://www.mozilla.org/products/firefox and 
// the Firefox extension called Greasemonkey: http://greasemonkey.mozdev.org/
// Install the Greasemonkey extension 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 "Tibia Forum Post Number", and click Uninstall.
//
// --------------------------------------------------------------------

(function() {
   var pagecheck = window.location.href.split("="); if (pagecheck[1] == 'thread&threadid' || pagecheck[1] == 'thread&postid') {
      var getalin = document.evaluate('//a[@href]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
      for (var i = 0; i < getalin.snapshotLength; i++) {
         var getlin = getalin.snapshotItem(i);
         var gotlin = getlin.href
         var linspl = gotlin.split("=")
         if (linspl[1] == 'quote&postid') {
            var dirlin = window.location.href
            var dirclin = dirlin.split("#")
            getlin.parentNode.innerHTML = '<a href=' + gotlin + '>Quote</a><br><a href=' + dirclin[0] + '#post' + linspl[2] + '>Direct Link</a>  ||  <span style="font-size=small"> Replace code: [post=' + linspl[2] + '][/post]</span></br>';
         }
      }
   }
})()