The plugin does not work when the PHP GeoIP extension is installed. There is an error in geoip.inc. The solution is simple: only load the .inc file when the extension is not used. The extension is being used if the constant GEOIP_COUNTRY_EDITION is defined. Here’s an example:
if (!defined('GEOIP_COUNTRY_EDITION'))
{
include_once('geoip.inc');
$geoIp = geoip_open(realpath(dirname(__FILE__))
.'/GeoIP.dat',GEOIP_STANDARD);
}
And also handle the call to get the country:
<td><strong>
<?php echo defined('GEOIP_COUNTRY_EDITION')
? geoip_country_name_by_name($stat->ip)
: geoip_country_name_by_addr($geoIp, $stat->ip);
?>
</strong></td>
Then the plugin works either way.
]]>Great job just one basic question, how do I exclude IP addresses like my own? Thanks!
]]>I really like this plugin – it’s small and simple and doesn’t slow down my website. If you are planning any future versions, it would be nice to be able to exclude IP addresses (like my own) from the list of visitors.
]]>