Seems as though I am going through a new theme every couple of days. I really liked the last one, but it would have taken a tad too much work to get it to work well with putting code in posts. This one seems a little better suited for that.
One feature that is missing in WordPress is a decent way to filter out comments by IP Address. I decided to tackle that today. First I will do it via a quick hack and then expand it to more tightly integrate with the backend. If someone would like to figure out how to make it a plugin, that would be awesome.
1 2 3 4 5 6 7 | global $wpdb; $testIp = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] ); $ipResults = $wpdb->get_results("SELECT * FROM wp_banned WHERE IpAddress = '".$testIp."'"); if(count($ipResults) > 0) return -1; |
Now I just need to figure out how to add some nice buttons to the comment page to “Ban and Spam” comments…