Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Callvote auto retardoing Anhaira topics

Callvote auto retardoing for Andhaira

  • vote yes

    Votes: 0 0.0%
  • vote no

    Votes: 1 100.0%

  • Total voters
    1

GeneralSamov

Prophet
Joined
Jul 8, 2007
Messages
3,647
Location
Karantania
It makes sense if he's referring to the Village idiot tbh (no offence :D ).

Calis posted that Andhaira's IP is located somewhere in Pakistan, when someone asked whether EtChaveuxEn is Andhaira's alt.
 

Wyrmlord

Arcane
Joined
Feb 3, 2008
Messages
28,886
Well, they were discussing what could be the basis of Andhaira's name. A word in Urdu and Hindi is Andhera, which means "darkness". Since Andhaira is from Pakistan, where they speak Urdu, it's quite possible that Andhaira's screenname refers to this word.
 

Ratty

Scholar
Joined
Mar 24, 2006
Messages
199
Location
Zagreb, Croatia
Andhera said:
How long did it take you to work on that code?
0.25 manhours.

Anyway, here's an improved (and even more bloated) version of the script that also filters forum view, topic review and search results:

Code:
// ==UserScript==
// @name           AndhairaFilter
// @namespace      http://www.rpgcodex.net/phpBB/AndhairaFilter
// @description    Filters posts and threads started by specific users on RPGCodex
// @include        http://www.rpgcodex.net/phpBB/*
// ==/UserScript==


// List of users whose posts are filtered.
var postfilter = new Array( 'Andhaira', 'UrielSeptimz', 'larpingdude14', 'Volourn' );

// true if specified element contains specified text, otherwise false.
function elementContainsText( el, str )
{
	if( el.innerHTML.search( str ) != -1 )
		return true;
		
	return false;
}

// Determine current page:
// 1 - viewtopic.php
// 2 - viewforum.php
// 3 - posting.php
// 4 - search.php
// 0 - other
function getCurrentPageType()
{
	var forumurl = 'www.rpgcodex.net/phpBB/';
	
	if( location.href.search( forumurl + 'viewtopic.php' ) != -1 )
	{
		return 1;
	}
	else if( location.href.search( forumurl + 'viewforum.php' ) != -1 )
	{
		return 2;
	}
	else if( location.href.search( forumurl + 'posting.php' ) != -1 )
	{
		return 3;
	}
	else if( location.href.search( forumurl + 'search.php' ) != -1 )
	{
		return 4;
	}
	
	return 0;
}

function filterFromTopicView( usernames )
{
	var spans = document.getElementsByTagName( 'span' );
	var post_found = false;
	
	for( var i = 0; i < spans.length; ++i )
	{
		// looking for offending posts
		if( !post_found && spans[i].getAttribute('class') == 'name' )
		{			
			for( var j = 0; j < postfilter.length; ++j )
			{
				if( elementContainsText( spans[i], postfilter[j] ) )
				{
					post_found = true;
					break;
				}
			}
		}
		
		// found an offending post, looking for its body
		if( post_found && spans[i].getAttribute('class') == 'postbody' )
		{
			//removing the post
			spans[i].parentNode.parentNode.removeChild( spans[i].parentNode );
			post_found = false;
		}
	}
}

function filterFromForumView( usernames )
{
	var spans = document.getElementsByTagName( 'span' );
	
	for( var i = 0; i < spans.length; ++i )
	{
		// looking for offending threads
		if( spans[i].getAttribute('class') == 'name' )
		{
			for( var j = 0; j < postfilter.length; ++j )
			{
				if( !elementContainsText( spans[i], postfilter[j] ) )
					continue;
					
				// found an offending thread, gotta remove it
				spans[i].parentNode.parentNode.parentNode.removeChild(
					spans[i].parentNode.parentNode );
				i = i == 0 ? 0 : i-1;
				break;
			}
		}
	}
}

function filterFromPostingView( usernames )
{
	//this function works for now, but will need to be expanded
	
	filterFromTopicView(usernames);
}

function filterFromSearchView( usernames )
{
	//this function works for now, but will need to be expanded
	
	var spans = document.getElementsByTagName('span');
	//if there is postbody class span, then search results are posts
	for( var i = 0; i < spans.length; ++i )
	{
		if( spans[i].getAttribute('class') == 'postbody' )
		{
			filterFromTopicView( usernames );
			return;
		}
	}
	filterFromForumView( usernames );
}

var page_type = getCurrentPageType();

switch( page_type )
{
case 1:
	filterFromTopicView( postfilter );
	break;
case 2:
	filterFromForumView( postfilter );
	break;
case 3:
	filterFromPostingView( postfilter );
	break;
case 4:
	filterFromSearchView( postfilter );
	break;
default:
	break;
}
To install, save the above code to a file named andhairafilter.user.js, get Greasemonkey add-on and simply try to open andhairafilter.user.js in Firefox. When Greasemonkey offers to install the script for you, click Install.

The script is capable of removing posts by any user, not just Andhaira. Filtered users are specified in the postfilter array (line 10 of the script), so feel free to add anyone you dislike. Don't be surprised if you end up filtering out 90% of the forum's content, though.
 

Texas Red

Whiner
Joined
Sep 9, 2006
Messages
7,044
Taluntain is Ao of the Codex? He could theoretically bring down the unjust rule of the admins and instate democracy, but he just doesn't meddle in such trivial affairs, right?
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom