From: eldy <> Date: Sat, 3 Jun 2006 00:55:22 +0000 (+0000) Subject: Fix: Region for us an ca was not shown X-Git-Tag: AWSTATS_6_6_BETA~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5a0bd7ce2d5bd12ade7dd22cc75e4ae2f5fffb7;p=thirdparty%2FAWStats.git Fix: Region for us an ca was not shown --- diff --git a/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm b/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm index 815fd388..a5252d3a 100755 --- a/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm +++ b/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm @@ -4262,6 +4262,18 @@ my %regall=( # -----> +sub RegionName($$) +{ + my $countrycode = shift || ""; + my $regioncode = shift || ""; + + if ($countrycode eq "us") { return $regus{uc $regioncode} || ""; } + if ($countrycode eq "ca") { return $regca{uc $regioncode} || ""; } + + return $regall{uc($countrycode."_".$regioncode)} || ""; +} + + #----------------------------------------------------------------------------- # PLUGIN FUNCTION: Init_pluginname #----------------------------------------------------------------------------- @@ -4368,11 +4380,11 @@ sub AddHTMLGraph_geoip_city_maxmind { $city=~s/%20/ /g; # if ($countrycode ne $country) { next; } my $p_p; my $p_h; - if ($TotalPages) { $p_p=int($_city_p{$key}/$TotalPages*1000)/10; } + if ($TotalPages) { $p_p=int(($_city_p{$key}||0)/$TotalPages*1000)/10; } if ($TotalHits) { $p_h=int($_city_h{$key}/$TotalHits*1000)/10; } print "