The reason for the error message :
[23-Apr-2013 13:42:26 Europe/London] PHP Fatal error: Cannot redeclare geoip_load_shared_mem() (previously declared in mydomain.com/includes/geoip.inc:241) in mydomain.com/includes/geoip.inc on line 257
is because I have included the following code on my tpl_main_page.php ...
Code:
<!--BOF cookie control script-->
<?php
include(DIR_WS_INCLUDES . "geoip.inc");
$gi = geoip_open(DIR_WS_INCLUDES . "GeoIP.dat", GEOIP_STANDARD);
$visitor_ip_address = $_SERVER["REMOTE_ADDR"];
$visitor_country_code = geoip_country_code_by_addr ($gi,$visitor_ip_address);
if ($visitor_country_code =='BE'|| $visitor_country_code =='BG'|| $visitor_country_code =='CZ'|| $visitor_country_code =='DK'|| $visitor_country_code =='DE'|| $visitor_country_code =='EE'|| $visitor_country_code =='IE'|| $visitor_country_code =='GR'|| $visitor_country_code =='ES'|| $visitor_country_code =='FR'|| $visitor_country_code =='IT'|| $visitor_country_code =='CY'|| $visitor_country_code =='LV'|| $visitor_country_code =='LT'|| $visitor_country_code =='LU'|| $visitor_country_code =='HU'|| $visitor_country_code =='MT'|| $visitor_country_code =='NL'|| $visitor_country_code =='AT'|| $visitor_country_code =='PL'|| $visitor_country_code =='PT'|| $visitor_country_code =='RO'|| $visitor_country_code =='SI'|| $visitor_country_code =='SK'|| $visitor_country_code =='FI'|| $visitor_country_code =='SE'|| $visitor_country_code =='GB')
require($template->get_template_dir('tpl_cookie_control.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_cookie_control.php');
?>
<!--EOF cookie control script
... to effect the display of a cookie alert banner only for EU visitors. This is causing conflict with Supertracker mod which uses geoip.inc to get the country code, at the same time.
Any suggestions on how to improve my code to stop these error messages (which occur every time a non-robot visitor visits my site - I exclude bots from s/tracker) would I'm sure, be extremely helpful.
Bookmarks