Download the plugin from http://www.jasonlitka.com/2007/04/16/wordpress-plugin-block-countries/ . Install in a regular way. Do not go to options now.
Download ip database from http://ip-to-country.webhosting.info/node/view/6
Convert to mysql dump using phpmyadmin interface.
For that, use any local database to create a table:
CREATE TABLE IF NOT EXISTSwp_iptocountry
(ip_from
int(4) unsigned NOT NULL DEFAULT '0',ip_to
int(4) unsigned NOT NULL DEFAULT '0',country_code2
char(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',country_code3
char(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',country_name
varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', PRIMARY KEY (ip_from
,ip_to
) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Uncompress ip-to-country.csv and import it into this table using standard phpMyAdmin interface and watching for the Windows-type line ending in the export file:
Create a local export file :
mysqldump -u root -p --opt YOUR_DB wp_iptocountry > ip2country.sql
Upload to server, insert into the WordPress db on server:
mysql -u USERNAME -p WORDPRESS_DB < ip2country.sql
Now, make the final modifications to the block countries plugin. Edit the file on server, PATH_TO_WEB_ROOT/wp-content/plugins/block-countries/block-countries.php, change
<td><select multiple size="10" name="bccodes[]">
to:
<td><select multiple="multiple" size="10" name="bccodes[]" style="height:350px">
You can use normal configuration page now enjoying the working interface.
Please make sure you do not block yourself . The warning in the plugin reads:
As a result of plugin work (I just blocked myself to test), you see a not very beautiful but quite an effective empty page with text: HTTP/1.1 403 Forbidden – Users from your country are not permitted to browse this site.
Enjoy!
i love to listen on audiobooks while travelling on a bus, i could learn a lot from it while travelling ‘::