|
Post by Wormopolis on May 16, 2009 20:17:27 GMT -8
Browser Tested: IE and FF placement: board or Global footer
will block out links to external pages if they are in the restricted list.
<script type="text/javascript"> <!-- // LinkBlocker v1.1 // Block out specific URLs // By Wormopolis - [url]wormocodes.proboards.com[/url] // Keep Header Intact
var restrictedLinks = [ "yahoo.com", "www.google.com", "www.nekkidpictures.com", "http://www.makemyday.net" // no comma last entry ]; //Array of restricted URLs
var removeMsg='«LINK REMOVED - URL IS RESTRICTED»'; var keepText=false; //set to true to put back the text without a hyperlink var workInPms=false; //set true if you want this to affect PMs
// NO NEED TO EDIT BELOW
if (location.href.match(/action=display/) || (location.href.match(/pmview/) && workImPms)) { tds=document.getElementsByTagName('td'); for (h=0; h<tds.length; h++) { if (tds[h].width=='20%' && tds[h].vAlign=='top' && tds[h].className.match(/windowbg/i) && tds[h].align=='left' ) { postCell=tds[h].nextSibling.getElementsByTagName('tr')[1].firstChild; for (lnks=postCell.getElementsByTagName('a'), l=0; l<lnks.length; l++) { dest=lnks[l].href; putback=(keepText ? lnks[l].innerHTML : removeMsg); for (i=0; i<restrictedLinks.length; i++) { if (dest.match(restrictedLinks[i])) { lnks[l].parentNode.replaceChild(document.createTextNode(putback),lnks[l]); l--; break; } } } } } } // --> </script>
preview: coming soon
|
|
|
Post by Wormopolis on May 16, 2009 23:31:27 GMT -8
bug fix: it was skipping some links.
|
|