You run into a lot of annoying people on forums. I guess the types of idiots you come across depends on the type of forum. They might be ignorant, stupid, or just plain trolls. vB and other popular software offers and easy and effective way to deal with this but there’s only one problem. IT’s BORING!
Hence, the Troll Filter for vB. It’s my first greasemonkey script althought I’m sure it won’t be my last. I just started on it yesterday and have only spent about an hour on it so it could be pretty buggy, however it seems to work as expected on a few forums I’ve tested it on.
The script relies on element IDs and classes in the vB html, so if they change this script could break.
You’ll need the greasemonkey extension for Firefox installed, of course. Here’s a good tutorial if you’ve never used greasemonkey or installed greasemonkey scripts before. It’s easy, peasy, monkey-greasy.
Make sure you after you install the script that you go to tools->greasemonkey->manage user scripts and include the forums that you want to use it on. You can just put an asterisk in the include box if you want it to run on all vB forums.
To add users you’ll have to be somewhat comfortable with javascript(sorry). The user/replacement values are constructed inside an object literal. It’s not that hard if you just remember a few rules.
1) Where there is an ‘example_user_1′ before the colon, put your user there in all lower case.
2) Enclose the stuff on both sides of the colon with quotation marks if it is a string and not a variable using single or double quotes (’) or (”).
3) Add a comma after each entry unless it’s the last one.
-
-
-
// ==UserScript==
-
// @name Troll Filter for vB v1.0 beta
-
// @namespace http://footabulous.com/trollfilter
-
// @include http://forums.digitalpoint.com/*
-
// ==/UserScript==
-
-
//(function() {
-
-
var defaultReplacement = ‘King Troll Here!!!’;
-
-
// Usernames should be all lower case.
-
var badUsers = {
-
-
‘example_user_1′: defaultReplacement,
-
-
‘example_user_2′: ‘<span style="font-size: 150%; font-weight: bold; color: #ff0000;">I\’m a goob!!!</span>’,
-
-
‘example_user_3′: ‘<img src="http://i235.photobucket.com/albums/ee120/raacchheelll_photos/RickRoll.gif" alt="" />’
-
-
};
-
-
var tableList = document.getElementsByTagName(‘TABLE’);
-
-
var postElemsToReplace = new Array;
-
var aList, postID, i;
-
-
for (i in tableList)
-
{
-
if (/post\d+/.test(tableList[i].id))
-
{
-
aList = tableList[i].getElementsByTagName(‘A’);
-
-
for (var j in aList)
-
{
-
if (aList[j].className == ‘bigusername’)
-
{
-
if( aList[j].innerHTML.toLowerCase() in badUsers)
-
{
-
postID = ‘td_post_’+tableList[i].id.match(/\w+?(\d+)/)[1];
-
-
postElemsToReplace.push({element:postID, user:aList[j].innerHTML.toLowerCase()});
-
}
-
}
-
}
-
}
-
}
-
-
for (i in postElemsToReplace)
-
{
-
var postMessageEl = document.getElementById(postElemsToReplace[i][‘element’]);
-
-
postMessageEl.innerHTML = badUsers[postElemsToReplace[i][‘user’]];
-
}
-
-
//})();
-
-
Edit: the backslash character wasn’t showing up in front of the metacharacters such as \d and \w. I had to quadruple slash them.
Here’s a plain text version in case the above code gets screwed up.

January 17th, 2009 at 3:45 am
[...] // ==UserScript== // @name Troll Filter for vB v1.0 beta // @namespace http://footabulous.com/trollfilter // @include http://forums.digitalpoint.com/* // ==/UserScript== //(function() { var defaultReplacement = ‘General Tard lives here!!!’; // Usernames should be all lower case. var badUsers = { ‘example_user_1′: defaultReplacement, ‘example_user_2′: ‘<span style="font-size:150%; font-weight:bold; color:#ff0000;">I’m a goob!!!</span>’, }; var tableList = document.getElementsByTagName(’TABLE’); var postElemsToReplace = new Array; var aList, postID, i; for (i in tableList) { if (/postd+/.test(tableList[i].id)) { aList = tableList[i].getElementsByTagName(’A'); for (var j in aList) { if (aList[j].className == ‘bigusername’) { if( aList[j].innerHTML.toLowerCase() in badUsers) { postID = ‘td_post_’+tableList[i].id.match(/w+?(d+)/)[1]; postElemsToReplace.push({element:postID, user:aList[j].innerHTML.toLowerCase()}); } } } } } for (i in postElemsToReplace) { var postMessageEl = document.getElementById(postElemsToReplace[i]['element']); postMessageEl.innerHTML = badUsers[postElemsToReplace[i]['user']]; } //})(); There’s a little bit more of a description here. [...]