User Tools

Site Tools


CommentIPBlackList plugin

Add IP addresses to block in the $BLACKLIST_IP array. Save as plugin.commentipblacklist.php and put it under fp-plugins/commentipblacklist/, then enable via plugin panel

Plugin Name: CommentIPBlackList
Plugin URI:
Description: Simple IP based blacklist plugin for blocking comments from specific IP addresses. Can be used to block some annoying posters. 
Author: G Fulk
Version: 1.0
add_action('comment_validate', 'plugin_ipblacklist_validate');
function plugin_ipblacklist_validate($bool) {
	if (!$bool) return false;
	$BLACKLIST_IP = array(
		'', ''
	$ip = utils_ipget();
	if ($ip) {
		if (in_array($ip, $BLACKLIST_IP)) {
			global $_FP_SMARTY;
			$_FP_SMARTY->assign('error', array('ERROR: You have been blocked from posting comments.  Your IP address (' . $ip . ') has been logged on our servers.'));
			return false;
	return true;
res/plugins/fulk/commentipblacklist.txt · Last modified: 2019/01/12 17:53 by

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki