Wednesday, 11 June 2008

Bad Words Filter Plugin for FlatPress

To change the badwords in the comments entry to something like @#$?%! heh.. :)
here is the code

function plugin_bwfilter_comment($text) {
	$bws = array(‘fuck’,’shit’, ‘bitch’); // the words considered as bad!
        $rep = ‘@#$?%!’; // the replacement of all the badwords
	foreach ($bws as $bw) {
		if ($bw != ‘’) {
			$text = preg_replace(‘/’.$bw.‘/si’, ‘@#$?%!’, $text);
		}
	}
	return $text;
}
 
// we add the filter
add_filter(‘comment_text’, ‘plugin_bwfilter_comment’, 1);

if you don’t like the trouble of just copy and paste the code well here’s my plugin download link. I’ve added a simple admin feature to add and delete the words you would like to filter ;)

Wednesday, 21 May 2008

randomquote Plugin for FlatPress

Jika anda perhatikan di panel kanan paling atas itu adalah widget yang saya buat sendiri. Bila anda menyukainya silakan didownload.
Installasinya juga tidak sulit anda tinggal unzip file randomquote.zip dan upload ke /fp-plugins/ kemudian aktifkan plugin melalui admin > plugins lalu tampilkan widget randomquote di panel anda melalui admin > widgets