hey guys, more userscriptiness
// ==UserScript==
// @name ThreadShield
// @namespace
// @version 0.5
// @description you'll never have to see that handicap again...even if it's me.
// @include http://forum.blockland.us/*
// @copyright 2012+, Kingdaro
// ==/UserScript==
/*
Changelist:
0.4
-Allows for multiple names - surprised someone hasn't done this for me, it was piss easy, haha.
-SHOULD replace /just/ the name on the topic index under latest poster, it is returning a true search value so there shouldn't be any problems.
If there are please report them.
0.41
-Fixes the destroying the entire userlist if a blocked user is online
-Snips blocked names/profiles in the forum index
0.5
-Renamed to ThreadShield for blocking in only certain threads, credit to Nickelbob Ultra for the idea.
*/
var n = [
//enter the profiles of your people you want to block here, just after the "index.php?" part
//surround it in single or double quotes
//or you could enter the name instead to block anything that involves that user.
'Lørd Tøny',
'action=profile;u=4325',
];
var replaceText = '-snip-' //whatever you want it to say in place of removed posts.
var thread = 'topic=159737' //the "topic=" portion of the topic ID you would like to block, in this case it's the pony topic.
/* EDIT ANYTHING BELOW AND I WILL loving MURDER YOU
nah it's open source, just give credit where it's due :) */
var posts = document.getElementsByTagName('td');
var i;
var ii;
var nil;
for (i=0;i<=posts.length;i++){
for (ii=0;ii<n.length;i++){
var v = posts[i];
var vv = n[ii]
var str = v.innerHTML;
if (str.search(vv)>-1){
if (v.className=='windowbg' || v.className=='windowbg2'){
if (location.search.search(thread)>=0){
if (posts[i].width!='22%'){
if (str.search('Users active in past 15 minutes:')<0){
posts[i].innerHTML = '<div style=" \
text-align:center; \
">'+replaceText+'</div>';
}
}else{
var links = posts[i].getElementsByTagName('a');
links[1].innerHTML = replaceText;
links[1].href = nil
}
}
}
}
}
}
thread-based blocking.
i actually had some fixes in place but i removed them because i was going to make this for just personal use and i didn't mind some of the problems, if they're too big of an issue i can make a quick 0.51 fix
i would make a thread but this is my special little treat for you guys.