I give you the Cthulheriser!
This is a very simple WordPress plug-in that automatically replaces some Christianity-related words in comments with some more Lovecraftian ones.
As written, there’s no way to exempt certain individual comments or authors (though I could make it so it exempts certain IPs, I guess), and there’s no control panel for it or anything.
You can change the words it changes yourself, if you like. The code should be pretty transparent. It’s a good idea to keep as many entries in the $pattern array as in the $replace array, because of the way preg_replace() works, but how many entries they have exactly doesn’t matter. Add or delete at will~
To use it, just paste the code below into a regular textfile, rename the file to “cthulheriser.php” (or anything, really, as long as it’s a .php file) and upload it to /wp-content/plugins/. You can then turn it on in your WordPress admin panel thing, in the Plugins section.
Because of the way WordPress’s comment parsing works, it doesn’t actually change the comments in the database, so if you disable the plugin, everything will just go back to normal, no harm done.
As far as licensing goes, it’s in the public domain, as far as I’m concerned. Code is too simple not to be. I’d still appreciate it if the header thing with the credit were preserved, though.
This is version 0.1, and it won’t be 1.0 until I add a proper user interface.
Which is to say, never.
<?php
/*
Plugin Name: Cthulheriser
Plugin URI: http://cairnarvon.rotahall.org/?p=494
Description: Makes comments more Lovecraftian, for great justice.
Version: 0.1
Author: Koen Crolla
Author URI: http://cairnarvon.rotahall.org/
*/
function cthulherise($content) {
$pattern = array('/God/',
'/Jesus/',
'/Holy Ghost/',
'/Moses/',
'/Virgin Mary/',
'/Amen[!.]?)/',
'/Apostle/',
'/apostle/',
'/Bible/',
'/Heaven/',
'/Hell/',
'/[Gg]ospels?/');
$replace = array('Azathoth',
'Nyarlathotep',
'Crawling Horror',
'Cthulhu',
'Black Goat of the Woods',
'Ia! Ia! Cthulhu fhtagn!',
'High Priest',
'cultist',
'Necronomicon',
'the Great Beyond',
'the Chaos',
'Cryptical Books of Hsan');
$content = preg_replace($pattern, $replace, $content);
return $content;
}
add_filter('comment_text', 'cthulherise');
?>