From c372f623fc57a2962ca87a3727258055f7dd18da Mon Sep 17 00:00:00 2001 From: eldy <> Date: Tue, 7 Dec 2004 13:11:55 +0000 Subject: [PATCH] Fix: geoip_city was sometimes bind. --- wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm b/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm index cb8d7838..d8ce1eb7 100755 --- a/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm +++ b/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm @@ -367,6 +367,31 @@ sub SectionProcessIp_geoip_city_maxmind { } +#----------------------------------------------------------------------------- +# PLUGIN FUNCTION: SectionProcessHostname_pluginname +# UNIQUE: NO (Several plugins using this function can be loaded) +#----------------------------------------------------------------------------- +sub SectionProcessHostname_geoip_city_maxmind { + my $param="$_[0]"; # Param must be an IP + # <----- + my $record=(); + $record=$geoip_city_maxmind->record_by_name($param) if $geoip_city_maxmind; + if ($Debug) { debug(" Plugin geoip_city_maxmind: GetCityByName for $param: [$record]",5); } + my $city=$record->city; +# if ($PageBool) { $_city_p{$city}++; } + if ($city) { + my $countrycity=lc(($record->country_code)."_".$city); + $countrycity=~tr/ /_/; + $_city_h{$countrycity}++; + } else { + $_city_h{'unknown'}++; + } +# if ($timerecord > $_city_l{$city}) { $_city_l{$city}=$timerecord; } + # -----> + return; +} + + #----------------------------------------------------------------------------- # PLUGIN FUNCTION: SectionReadHistory_pluginname # UNIQUE: NO (Several plugins using this function can be loaded) -- 2.47.3