I found a Greasemonkey script 'on this page'
(http://forums.hardwarezone.com.sg/eat-drink-man-woman-16/hide-those-annoying-threads-3056566.html),
and made a single modification (the @include parameter) to make it work
on forums.slimdevices.com. 

With this script, every forum thread comes with a "Ignore" link, so if
it annoys you, you can simply hide it, and it won't come back. (As a
bonus, you can now also hide all those sticky threads that fill up the
top of each subforum, and that you never read anyway.) 

Unfortunately, the thread will still show on the index.php page, but
when you enter the subforum itself, the script kicks in.

The script runs in Greasemonkey which in turn runs in Firefox. If you
have several computers (or Firefox user profiles), you'll need to
install the script on each one.

<code>
// ==UserScript==
// @name Hide Forum Threads
// @namespace ThreadFilter
// @description Hides threads in Vbulletin boards.
// @include http://forums.slimdevices.com/*
// ==/UserScript==

//*************global variables
var splitCh = String.fromCharCode(255);
var filterseperator= ",";

unsafeWindow._blockThread =
function(threadid)
{
window.setTimeout(SetKillFile, 0, threadid);
}

function updateKillFile(list)
{
data = list.join(splitCh);
window.setTimeout(GM_setValue, 0, "ThreadBlockerFilterFile",
escape(data));
GM_setValue("ThreadBlockerFilterFile", escape(data));
}

//adds a Thread to the Killfile
function SetKillFile(killspec)
{
//get thread element for immediate removal
var row = document.getElementById("td_threadtitle_"+killspec)
row.parentNode.parentNode.removeChild(row.parentNode);
var splitCh = String.fromCharCode(255);
var data = "";
var list = new Array();
data = unescape(GM_getValue("ThreadBlockerFilterFile", "-----"));
list = data.split(splitCh);
list.push(killspec);
updateKillFile(list);
}

function addThreadIgnoreLink (thisElement)
{
// Adding the Ignore-Link
threadid = threadid.substring(15);
var link = document.createElement('a');
link.setAttribute('href', 'javascript:_blockThread("'+threadid+'")');
link.setAttribute('style', 'float:right;font-size:xx-small;');
link.innerHTML = "Ignore";
thisElement.childNodes[1].appendChild(link);
}

function filterThreads()
{
allElements = document.evaluate(
'//*[@title]',
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);

for (var i = 0; i < allElements.snapshotLength; i++) {
thisElement = allElements.snapshotItem(i);
if (thisElement.nodeName.toUpperCase() == 'TD')
{
for( var x = 0; x < thisElement.attributes.length; x++ )
{
if( thisElement.attributes[x].nodeName.toLowerCase() == 'title' )
{
threadid = thisElement.getAttribute('id');
if(threadid != null)
{
addThreadIgnoreLink(thisElement);

//Filtering Threads
var data = unescape(GM_getValue("ThreadBlockerFilterFile", "-----"));
var list = data.split(splitCh);
for (var j=0; j<list.length; j++) {
//var tid = threadid.substring(13);
if (list[j] == threadid && list[j] != "" && threadid != "")
{
node = thisElement.parentNode;
if (node.parentNode != null)
{
node.parentNode.removeChild(node);
//alert('Thread deleted' + node.innerHTML);

}
}
}
}
}
}
}
}
}


filterThreads(); 
</code>


-- 
Soulkeeper

Noise < Music < Silence
------------------------------------------------------------------------
Soulkeeper's Profile: http://forums.slimdevices.com/member.php?userid=35297
View this thread: http://forums.slimdevices.com/showthread.php?t=94286

_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/discuss

Reply via email to