From: eldy <> Date: Wed, 23 Nov 2005 20:02:10 +0000 (+0000) Subject: Detect linux and bsd distributions and groups them by families X-Git-Tag: AWSTATS_6_5_BETA_2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=221a84afa82d5bddf9f331f18a66288d304077b4;p=thirdparty%2FAWStats.git Detect linux and bsd distributions and groups them by families --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index d52786dc..23bcd2f1 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -226,7 +226,7 @@ use vars qw/ @DOWIndex = @fieldlib = @keylist = (); use vars qw/ @MiscListOrder %MiscListCalc -@OSFamily %BrowsersFamily @SessionsRange %SessionsAverage +%OSFamily %BrowsersFamily @SessionsRange %SessionsAverage %LangBrowserToLangAwstats %LangAWStatsToFlagAwstats @HostAliases @AllowAccessFromWebToFollowingAuthenticatedUsers @DefaultFile @SkipDNSLookupFor @@ -242,7 +242,7 @@ use vars qw/ /; @MiscListOrder=('AddToFavourites','JavascriptDisabled','JavaEnabled','DirectorSupport','FlashSupport','RealPlayerSupport','QuickTimeSupport','WindowsMediaPlayerSupport','PDFSupport'); %MiscListCalc=('TotalMisc'=>'','AddToFavourites'=>'u','JavascriptDisabled'=>'hm','JavaEnabled'=>'hm','DirectorSupport'=>'hm','FlashSupport'=>'hm','RealPlayerSupport'=>'hm','QuickTimeSupport'=>'hm','WindowsMediaPlayerSupport'=>'hm','PDFSupport'=>'hm'); -@OSFamily=('win','mac'); +%OSFamily=('win'=>'Windows','mac'=>'Macintosh','linux'=>'Linux','bsd'=>'BSD'); %BrowsersFamily=('msie'=>1,'firefox'=>2,'netscape'=>3); @SessionsRange=('0s-30s','30s-2mn','2mn-5mn','5mn-15mn','15mn-30mn','30mn-1h','1h+'); %SessionsAverage=('0s-30s',15,'30s-2mn',75,'2mn-5mn',210,'5mn-15mn',600,'15mn-30mn',1350,'30mn-1h',2700,'1h+',3600); @@ -8410,17 +8410,20 @@ if (scalar keys %HTMLOutput) { OSLOOP: foreach my $key (@keylist) { $total_h+=$_os_h{$key}; if ($_os_h{$key} > $max_h) { $max_h = $_os_h{$key}; } - foreach my $family (@OSFamily) { if ($key =~ /^$family/i) { $totalfamily_h{$family}+=$_os_h{$key}; $TotalFamily+=$_os_h{$key}; next OSLOOP; } } + foreach my $family (keys %OSFamily) { if ($key =~ /^$family/i) { $totalfamily_h{$family}+=$_os_h{$key}; $TotalFamily+=$_os_h{$key}; next OSLOOP; } } } # Write records grouped in a browser family - foreach my $family (@OSFamily) { + foreach my $family (keys %OSFamily) { my $p=' '; if ($total_h) { $p=int($totalfamily_h{$family}/$total_h*1000)/10; $p="$p %"; } my $familyheadershown=0; foreach my $key (reverse sort keys %_os_h) { if ($key =~ /^$family(.*)/i) { - if (! $familyheadershown) { - print "