From: eldy <> Date: Mon, 16 Sep 2002 14:24:28 +0000 (+0000) Subject: Track detailed minor and major version for browsers. X-Git-Tag: AWSTATS_5_0_BETA~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e32d49da0855dfc0d6db6ef359018d881ee9f8;p=thirdparty%2FAWStats.git Track detailed minor and major version for browsers. --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 1d86b2b2..ee87b755 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -104,7 +104,7 @@ $NewLinePhase $NbOfLinesForCorruptedLog $PurgeLogFile $ShowAuthenticatedUsers $ShowCompressionStats $ShowFileSizesStats $ShowDropped $ShowCorrupted $ShowUnknownOrigin $ShowLinksToWhoIs $ShowEMailSenders $ShowEMailReceivers -$Expires $UpdateStats $MigrateStats $URLWithQuery $UseFramesWhenCGI +$Expires $UpdateStats $MigrateStats $URLWithQuery $UseFramesWhenCGI $Spec /; ($DNSLookup, $AllowAccessFromWebToAuthenticatedUsersOnly, $BarHeight, $BarWidth, $CreateDirDataIfNotExists, $KeepBackupOfHistoricFiles, $MaxLengthOfURL, @@ -117,8 +117,8 @@ $NewLinePhase, $NbOfLinesForCorruptedLog, $PurgeLogFile, $ShowAuthenticatedUsers, $ShowCompressionStats, $ShowFileSizesStats, $ShowDropped, $ShowCorrupted, $ShowUnknownOrigin, $ShowLinksToWhoIs, $ShowEMailSenders, $ShowEMailReceivers, -$Expires, $UpdateStats, $MigrateStats, $URLWithQuery, $UseFramesWhenCGI)= -(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +$Expires, $UpdateStats, $MigrateStats, $URLWithQuery, $UseFramesWhenCGI, $Spec)= +(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); use vars qw/ $PosTotalVisits $PosTotalUnique $PosMonthHostsKnown $PosMonthHostsUnknown /; @@ -212,7 +212,7 @@ use vars qw/ @SessionsRange @Message @HostAliases @AllowAccessFromWebToFollowingAuthenticatedUsers @DefaultFile @OnlyFiles @SkipDNSLookupFor @SkipFiles @SkipHosts @PluginsToLoad @DOWIndex @RobotsSearchIDOrder -@_msiever_h @_nsver_h @_from_p @_from_h @_time_p @_time_h @_time_k +@_from_p @_from_h @_time_p @_time_h @_time_k @keylist /; @SessionsRange=("0s-30s","30s-2mn","2mn-5mn","5mn-15mn","15mn-30mn","30mn-1h","1h+"); @@ -221,7 +221,6 @@ use vars qw/ @AllowAccessFromWebToFollowingAuthenticatedUsers=(); @DefaultFile = @OnlyFiles = @SkipDNSLookupFor = @SkipFiles = @SkipHosts = @PluginsToLoad = (); @DOWIndex = @RobotsSearchIDOrder = (); -@_msiever_h = @_nsver_h = (); @_from_p = @_from_h = (); @_time_p = @_time_h = @_time_k = (); @keylist=(); @@ -1489,7 +1488,7 @@ sub Read_History_With_Update { my $withpurge=shift||0; my $part=shift||""; my %allsections=("general"=>1,"time"=>2,"visitor"=>3,"day"=>4,"login"=>5,"domain"=>6,"session"=>7,"browser"=>8, - "msiever"=>9,"nsver"=>10,"os"=>11,"unknownreferer"=>12,"unknownrefererbrowser"=>13,"robot"=>14,"sider"=>15, + "os"=>11,"unknownreferer"=>12,"unknownrefererbrowser"=>13,"robot"=>14,"sider"=>15, "filetypes"=>16,"origin"=>17,"sereferrals"=>18,"pagerefs"=>19,"searchwords"=>20,"keywords"=>21, "errors"=>22,"sider_404"=>23); @@ -1516,8 +1515,6 @@ sub Read_History_With_Update { if ($UpdateStats || $MigrateStats || $HTMLOutput eq "main" || $HTMLOutput eq "domains") { $SectionsToLoad{"domain"}=6; } if ($UpdateStats || $MigrateStats || $HTMLOutput eq "main" || $HTMLOutput eq "sessions") { $SectionsToLoad{"session"}=7; } if ($UpdateStats || $MigrateStats || $HTMLOutput eq "main" || $HTMLOutput eq "browserdetail") { $SectionsToLoad{"browser"}=8; } - if ($UpdateStats || $MigrateStats || $HTMLOutput eq "main" || $HTMLOutput eq "browserdetail") { $SectionsToLoad{"msiever"}=9; } - if ($UpdateStats || $MigrateStats || $HTMLOutput eq "main" || $HTMLOutput eq "browserdetail") { $SectionsToLoad{"nsver"}=10; } if ($UpdateStats || $MigrateStats || $HTMLOutput eq "main" || $HTMLOutput eq "os") { $SectionsToLoad{"os"}=11; } if ($UpdateStats || $MigrateStats || $HTMLOutput eq "main" || $HTMLOutput eq "unknownos") { $SectionsToLoad{"unknownreferer"}=12; } if ($UpdateStats || $MigrateStats || $HTMLOutput eq "main" || $HTMLOutput eq "unknownbrowser") { $SectionsToLoad{"unknownrefererbrowser"}=13; } @@ -1962,66 +1959,6 @@ sub Read_History_With_Update { if (! scalar %SectionsToLoad) { debug(" Stop reading history file. Got all we need."); last; } next; } - # BEGIN_MSIEVER - if ($field[0] eq "BEGIN_MSIEVER") { - if ($Debug) { debug(" Begin of MSIEVER section"); } - $_=; - chomp $_; s/\r//; - if (! $_) { error("Error: History file \"$historyfilename\" is corrupted (in section MSIEVER). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost).","","",1); } - my @field=split(/\s+/,$_); $countlines++; - my $count=0;my $countloaded=0; - while ($field[0] ne "END_MSIEVER") { - if ($field[0]) { - $count++; - if ($SectionsToLoad{"msiever"}) { - $countloaded++; - if ($field[1]) { $_msiever_h[$field[0]]+=$field[1]; } - } - } - $_=; - chomp $_; s/\r//; - if (! $_) { error("Error: History file \"$historyfilename\" is corrupted (in section MSIEVER). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost).","","",1); } - @field=split(/\s+/,$_); $countlines++; - } - if ($Debug) { debug(" End of MSIEVER section ($count entries, $countloaded loaded)"); } - delete $SectionsToLoad{"msiever"}; - if ($SectionsToSave{"msiever"}) { - Save_History("msiever",$year,$month); delete $SectionsToSave{"msiever"}; - if ($withpurge) { @_msiever_h=(); } - } - if (! scalar %SectionsToLoad) { debug(" Stop reading history file. Got all we need."); last; } - next; - } - # BEGIN_NSVER - if ($field[0] eq "BEGIN_NSVER") { - if ($Debug) { debug(" Begin of NSVER section"); } - $_=; - chomp $_; s/\r//; - if (! $_) { error("Error: History file \"$historyfilename\" is corrupted (in section NSVER). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost).","","",1); } - my @field=split(/\s+/,$_); $countlines++; - my $count=0;my $countloaded=0; - while ($field[0] ne "END_NSVER") { - if ($field[0]) { - $count++; - if ($SectionsToLoad{"nsver"}) { - $countloaded++; - if ($field[1]) { $_nsver_h[$field[0]]+=$field[1]; } - } - } - $_=; - chomp $_; s/\r//; - if (! $_) { error("Error: History file \"$historyfilename\" is corrupted (in section NSVER). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost).","","",1); } - @field=split(/\s+/,$_); $countlines++; - } - if ($Debug) { debug(" End of NSVER section ($count entries, $countloaded loaded)"); } - delete $SectionsToLoad{"nsver"}; - if ($SectionsToSave{"nsver"}) { - Save_History("nsver",$year,$month); delete $SectionsToSave{"nsver"}; - if ($withpurge) { @_nsver_h=(); } - } - if (! scalar %SectionsToLoad) { debug(" Stop reading history file. Got all we need."); last; } - next; - } # BEGIN_OS if ($field[0] eq "BEGIN_OS") { if ($Debug) { debug(" Begin of OS section"); } @@ -2552,7 +2489,7 @@ sub Save_History { print HISTORYTMP "# If you remove this file, all statistics for date $year-$month will be lost/reset.\n"; print HISTORYTMP "\n"; print HISTORYTMP "# This section is not used yet\n"; - print HISTORYTMP "BEGIN_MAP 24\n"; + print HISTORYTMP "BEGIN_MAP 23\n"; print HISTORYTMP "POS_GENERAL \n"; print HISTORYTMP "POS_TIME \n"; print HISTORYTMP "POS_VISITOR \n"; @@ -2560,8 +2497,7 @@ sub Save_History { print HISTORYTMP "POS_LOGIN \n"; print HISTORYTMP "POS_DOMAIN \n"; print HISTORYTMP "POS_SESSION \n"; - print HISTORYTMP "POS_MSIEVER \n"; - print HISTORYTMP "POS_NSVER \n"; + print HISTORYTMP "POS_BROWSER \n"; print HISTORYTMP "POS_OS \n"; print HISTORYTMP "POS_UNKNOWNREFERER \n"; print HISTORYTMP "POS_UNKNOWNREFERERBROWSER \n"; @@ -2777,26 +2713,6 @@ sub Save_History { foreach my $key (keys %_browser_h) { print HISTORYTMP "$key $_browser_h{$key}\n"; } print HISTORYTMP "END_BROWSER\n"; } - if ($sectiontosave eq "nsver") { - print HISTORYTMP "\n"; - print HISTORYTMP "# IE Version - Hits\n"; - print HISTORYTMP "BEGIN_NSVER ".(@_nsver_h)."\n"; - for (my $i=1; $i <= @_nsver_h; $i++) { - my $nb_h=$_nsver_h[$i]||""; - print HISTORYTMP "$i $nb_h\n"; - } - print HISTORYTMP "END_NSVER\n"; - } - if ($sectiontosave eq "msiever") { - print HISTORYTMP "\n"; - print HISTORYTMP "# Netscape Version - Hits\n"; - print HISTORYTMP "BEGIN_MSIEVER ".(@_msiever_h)."\n"; - for (my $i=1; $i <= @_msiever_h; $i++) { - my $nb_h=$_msiever_h[$i]||""; - print HISTORYTMP "$i $nb_h\n"; - } - print HISTORYTMP "END_MSIEVER\n"; - } if ($sectiontosave eq "os") { print HISTORYTMP "\n"; print HISTORYTMP "# OS ID - Hits\n"; @@ -3050,7 +2966,6 @@ sub Init_HashArray { my $month=sprintf("%02i",shift||0); if ($Debug) { debug("Call to Init_HashArray [$year,$month]"); } # Reset all arrays with name beginning by _ - @_msiever_h = @_nsver_h = (); for (my $ix=0; $ix<6; $ix++) { $_from_p[$ix]=0; $_from_h[$ix]=0; } for (my $ix=0; $ix<24; $ix++) { $_time_h[$ix]=0; $_time_k[$ix]=0; $_time_p[$ix]=0; } # Reset all hash arrays with name beginning by _ @@ -4250,21 +4165,19 @@ if ($UpdateStats && $FrameName ne "index" && $FrameName ne "mainleft") { # Updat # Analyze: Robot #--------------- if ($pos_agent >= 0) { - $field[$pos_agent] =~ tr/\+ /__/; # Same Agent with different writing syntax have now same name - $field[$pos_agent] =~ s/%20/_/g; # This is to support servers (like Roxen) that writes user agent with %20 in it - $UserAgent=lc($field[$pos_agent]); + if ($Spec == 1) { $field[$pos_agent] =~ s/%20/_/g; } # This is to support servers (like Roxen) that writes user agent with %20 in it + $UserAgent=$field[$pos_agent]; if ($LevelForRobotsDetection) { my $uarobot=$TmpRobot{$UserAgent}; if (! $uarobot) { - # If made on each record -> -1300 rows/seconds my $foundrobot=0; #study $UserAgent; Does not increase speed foreach my $bot (@RobotsSearchIDOrder) { if ($UserAgent =~ /$bot/i) { $foundrobot=1; - $TmpRobot{$UserAgent}=$uarobot="$bot"; # Last time, we won't search if robot or not. We know it's is. + $TmpRobot{$UserAgent}=$uarobot="$bot"; # Last time, we won't search if robot or not. We know it is. last; } } @@ -4274,7 +4187,7 @@ if ($UpdateStats && $FrameName ne "index" && $FrameName ne "mainleft") { # Updat } # If robot, we stop here if ($uarobot ne "-") { - if ($Debug) { debug("UserAgent $UserAgent contains robot ID '$uarobot'",2); } + if ($Debug) { debug("UserAgent '$UserAgent' contains robot ID '$uarobot'",2); } $_robot_h{$uarobot}++; $_robot_l{$uarobot}=$timerecord; next; } @@ -4504,7 +4417,9 @@ if ($UpdateStats && $FrameName ne "index" && $FrameName ne "mainleft") { # Updat $_host_k{$_}+=$field[$pos_size]; - if ($pos_agent >= 0 && $UserAgent) { # Made on each record -> -100 rows/seconds + # Analyze: Browser and OS + #------------------------ + if ($pos_agent >= 0 && $UserAgent) { if ($LevelForBrowsersDetection) { @@ -4512,55 +4427,46 @@ if ($UpdateStats && $FrameName ne "index" && $FrameName ne "mainleft") { # Updat #----------------- my $uabrowser=$TmpBrowser{$UserAgent}; if (! $uabrowser) { - my $found=0; - # IE ? (For higher speed, we start with IE, the most often used. This avoid other tests if found) - if (($UserAgent =~ /msie/) && ($UserAgent !~ /webtv/) && ($UserAgent !~ /omniweb/) && ($UserAgent !~ /opera/)) { - $_browser_h{"msie"}++; - if ($UserAgent =~ /msie_(\d)\./) { # $1 now contains IE major version no - $_msiever_h[$1]++; - $TmpBrowser{$UserAgent}="msie_$1"; - $found=1; - } + my $found=1; + # IE ? + if (($UserAgent =~ /msie([+_ ]|)([\d\.]*)/i) && ($UserAgent !~ /webtv/i) && ($UserAgent !~ /omniweb/i) && ($UserAgent !~ /opera/i)) { + $_browser_h{"msie$2"}++; + $TmpBrowser{$UserAgent}="msie$2"; } - # Netscape ? - if (!$found) { - if (($UserAgent =~ /mozilla/) && ($UserAgent !~ /compatible/) && ($UserAgent !~ /opera/) && ($UserAgent !~ /galeon/)) { - $_browser_h{"netscape"}++; - if ($UserAgent =~ /\/(\d)\./) { # $1 now contains Netscape major version no - $_nsver_h[$1]++; - $TmpBrowser{$UserAgent}="netscape_$1"; - $found=1; - } - } + elsif ($UserAgent =~ /netscape.?\/([\d\.]*)/i) { + $_browser_h{"netscape$1"}++; + $TmpBrowser{$UserAgent}="netscape$1"; + } + elsif (($UserAgent =~ /mozilla(\/|)([\d\.]*)/i) && ($UserAgent !~ /compatible/i) && ($UserAgent !~ /opera/i) && ($UserAgent !~ /galeon/i)) { + $_browser_h{"netscape$2"}++; + $TmpBrowser{$UserAgent}="netscape$2"; } - # Other ? - if (!$found) { + else { + $found=0; foreach my $key (@BrowsersSearchIDOrder) { # Search ID in order of BrowsersSearchIDOrder if ($UserAgent =~ /$key/i) { - $_browser_h{$key}++; - $TmpBrowser{$UserAgent}=$key; + $_browser_h{"$key"}++; + $TmpBrowser{$UserAgent}="$key"; $found=1; last; } } } - # Unknown browser ? if (!$found) { $_browser_h{"Unknown"}++; - $_unknownrefererbrowser_l{$field[$pos_agent]}=$timerecord; $TmpBrowser{$UserAgent}="Unknown"; + my $newua=$UserAgent; $newua =~ tr/\+ /__/; + $_unknownrefererbrowser_l{$newua}=$timerecord; } } else { - # TODO Do not parse version (do it in output only). This will increase features and reduce speed. - if ($uabrowser =~ /^msie_(\d)/) { $_browser_h{"msie"}++; $_msiever_h[$1]++; } - elsif ($uabrowser =~ /^netscape_(\d)/) { $_browser_h{"netscape"}++; $_nsver_h[$1]++; } - else { - $_browser_h{$uabrowser}++; - if ($uabrowser eq "Unknown") { $_unknownrefererbrowser_l{$field[$pos_agent]}=$timerecord; } + $_browser_h{$uabrowser}++; + if ($uabrowser eq "Unknown") { + my $newua=$UserAgent; $newua =~ tr/\+ /__/; + $_unknownrefererbrowser_l{$newua}=$timerecord; } } @@ -4577,22 +4483,26 @@ if ($UpdateStats && $FrameName ne "index" && $FrameName ne "mainleft") { # Updat foreach my $key (@OSSearchIDOrder) { # Search ID in order of OSSearchIDOrder if ($UserAgent =~ /$key/i) { my $osid=$OSHashID{$key}; - $_os_h{$osid}++; - $TmpOS{$UserAgent}=$osid; + $_os_h{"$osid"}++; + $TmpOS{$UserAgent}="$osid"; $found=1; last; } } # Unknown OS ? if (!$found) { - $_unknownreferer_l{$field[$pos_agent]}=$timerecord; $_os_h{"Unknown"}++; $TmpOS{$UserAgent}="Unknown"; + my $newua=$UserAgent; $newua =~ tr/\+ /__/; + $_unknownreferer_l{$newua}=$timerecord; } } else { $_os_h{$uaos}++; - if ($uaos eq "Unknown") { $_unknownreferer_l{$field[$pos_agent]}=$timerecord; } + if ($uaos eq "Unknown") { + my $newua=$UserAgent; $newua =~ tr/\+ /__/; + $_unknownreferer_l{$newua}=$timerecord; + } } } @@ -4646,7 +4556,6 @@ if ($UpdateStats && $FrameName ne "index" && $FrameName ne "mainleft") { # Updat if ($LevelForSearchEnginesDetection) { - # If made on each record -> -1700 rows/seconds (should be made on 10% of records only) foreach my $key (@SearchEnginesSearchIDOrder) { # Search ID in order of SearchEnginesSearchIDOrder if ($refererserver =~ /$key/i) { # This hit came from the search engine $key @@ -5811,26 +5720,33 @@ EOF exit(0); } if ($HTMLOutput eq "browserdetail") { - print "$Center 
\n"; - &tab_head("$Message[33]
",19); + # Count total of msie and netscape + my %total=(); + foreach my $key (keys %_browser_h) { + if ($key =~ /^msie/i) { $total{"msie"}+=$_browser_h{$key}; next; } + if ($key =~ /^netscape/i) { $total{"netscape"}+=$_browser_h{$key}; next; } + } + # Show msie and netscape arrays + print "$Center 
"; + &tab_head("$Message[34]
",19); print "$Message[58]$Message[57]$Message[15]\n"; - for (my $i=1; $i <= @_nsver_h; $i++) { - my $h=" "; my $p=" "; - if ($_nsver_h[$i] > 0 && $_browser_h{"netscape"} > 0) { - $h=$_nsver_h[$i]; $p=int($_nsver_h[$i]/$_browser_h{"netscape"}*1000)/10; $p="$p %"; + foreach my $key (reverse sort keys %_browser_h) { + if ($key =~ /^msie(.*)/i) { + my $ver=$1; + my $p=int($_browser_h{$key}/$total{"msie"}*1000)/10; $p="$p"; + print "MSIE ".($ver?"$ver":"?")."$_browser_h{$key}$p%\n"; } - print "Mozilla/$i.xx$h$p\n"; } &tab_end; - print " 
"; - &tab_head("$Message[34]
",19); + print " 
\n"; + &tab_head("$Message[33]
",19); print "$Message[58]$Message[57]$Message[15]\n"; - for (my $i=1; $i <= @_msiever_h; $i++) { - my $h=" "; my $p=" "; - if ($_msiever_h[$i] > 0 && $_browser_h{"msie"} > 0) { - $h=$_msiever_h[$i]; $p=int($_msiever_h[$i]/$_browser_h{"msie"}*1000)/10; $p="$p %"; + foreach my $key (reverse sort keys %_browser_h) { + if ($key =~ /^netscape(.*)/i) { + my $ver=$1; + my $p=int($_browser_h{$key}/$total{"netscape"}*1000)/10; $p="$p"; + print "Netscape ".($ver?"$ver":"?")."$_browser_h{$key}$p%\n"; } - print "MSIE/$i.xx$h$p\n"; } &tab_end; &html_end; @@ -6619,10 +6535,11 @@ EOF if ($Debug) { debug("ShowOSStats",2); } print "$Center 
\n"; my $Total=0; foreach my $key (keys %_os_h) { $Total+=$_os_h{$key}; } - &tab_head($Message[59],19); + &tab_head("$Message[59]",19); print "OS$Message[57]$Message[15]\n"; my $count=0; - foreach my $key (sort { $_os_h{$b} <=> $_os_h{$a} } keys (%_os_h)) { + &BuildKeyList($MaxRowsInHTMLOutput,1,\%_os_h,\%_os_h); + foreach my $key (@keylist) { my $p=int($_os_h{$key}/$Total*1000)/10; if ($key eq "Unknown") { print "$Message[0]$_os_h{$key}"; @@ -6644,21 +6561,29 @@ EOF if ($ShowBrowsersStats) { if ($Debug) { debug("ShowBrowsersStats",2); } print "$Center 
\n"; - my $Total=0; foreach my $key (keys %_browser_h) { $Total+=$_browser_h{$key}; } - &tab_head($Message[21],19); + my $Total=0; my %new_browser_h=(); + foreach my $key (keys %_browser_h) { + $Total+=$_browser_h{$key}; + if ($key =~ /^msie/i) { $new_browser_h{"msiecumul"}+=$_browser_h{$key}; next; } + if ($key =~ /^netscape/i) { $new_browser_h{"netscapecumul"}+=$_browser_h{$key}; next; } + $new_browser_h{$key}+=$_browser_h{$key}; + } + &tab_head("$Message[21]",19); print "Browser$Message[111]$Message[57]$Message[15]\n"; my $count=0; - foreach my $key (sort { $_browser_h{$b} <=> $_browser_h{$a} } keys (%_browser_h)) { - my $p=int($_browser_h{$key}/$Total*1000)/10; + &BuildKeyList($MaxRowsInHTMLOutput,1,\%new_browser_h,\%new_browser_h); + foreach my $key (@keylist) { + my $p=int($new_browser_h{$key}/$Total*1000)/10; if ($key eq "Unknown") { - print "$Message[0]?$_browser_h{$key}$p %\n"; + print "$Message[0]?$_browser_h{$key}$p%\n"; } else { - my $nameicon=lc($BrowsersHashIcon{$key}||"notavailable"); $nameicon =~ s/\s.*//; - my $newbrowser=$BrowsersHashIDLib{$key}||$key; - if ($newbrowser eq "netscape") { $newbrowser="Netscape ($Message[58])"; } - if ($newbrowser eq "msie") { $newbrowser="MS Internet Explorer ($Message[58])"; } - print "$newbrowser".($BrowsersHereAreGrabbers{$key}?"$Message[112]":"$Message[113]")."$_browser_h{$key}$p %\n"; + my $keywithoutcumul=$key; $keywithoutcumul =~ s/cumul$//i; + my $libbrowser=$BrowsersHashIDLib{$keywithoutcumul}||$keywithoutcumul; + my $nameicon=$BrowsersHashIcon{$keywithoutcumul}||"notavailable"; + if ($libbrowser eq "netscape") { $libbrowser="Netscape ($Message[58])"; } + if ($libbrowser eq "msie") { $libbrowser="MS Internet Explorer ($Message[58])"; } + print "$libbrowser".($BrowsersHereAreGrabbers{$key}?"$Message[112]":"$Message[113]")."$new_browser_h{$key}$p%\n"; } $count++; } diff --git a/wwwroot/cgi-bin/lib/browsers.pm b/wwwroot/cgi-bin/lib/browsers.pm index af5f2806..fcb846e0 100644 --- a/wwwroot/cgi-bin/lib/browsers.pm +++ b/wwwroot/cgi-bin/lib/browsers.pm @@ -184,7 +184,7 @@ "wdg_validator","WDG HTML Validator", "webzip","WebZIP", "staroffice","StarOffice", -"libwww","LibWWW" +"libwww","LibWWW", ); @@ -291,3 +291,11 @@ 1; + + +# Browsers example +# Netscape 4.05 Mozilla/4.05 [fr]C-SYMPA (Win95; I) +# Netscape 4.7 Mozilla/4.7 [fr] (Win95; I) +# Netscape 6.0 Mozilla/5.0 (Macintosh; N; PPC; fr-FR; m18) Gecko/20001108 Netscape6/6.0 +# MSIE 4.0 Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; KITV4 Wanadoo; KITV5 Wanadoo) +# Autre Mozilla/3.01 (compatible;) \ No newline at end of file diff --git a/wwwroot/cgi-bin/lib/operating_systems.pm b/wwwroot/cgi-bin/lib/operating_systems.pm index 5be76e4e..7d003eba 100644 --- a/wwwroot/cgi-bin/lib/operating_systems.pm +++ b/wwwroot/cgi-bin/lib/operating_systems.pm @@ -17,18 +17,17 @@ #------------------------------------------------------------------------- @OSSearchIDOrder = ( # Windows OS family -"windows_xp","windows_nt_5\.1", # Must be before windows_nt_5 -"windows_me","win_9x_4\.9", # Must be before windows_98 -"windows2000","windows_2000","windows_nt_5", -"winnt","windows_nt","windows-nt","win32", -"win98","windows_98","windows98", -"win95","windows_95", -"win16","windows_3","windows;i;16", # This works for windows_31 and windows_3.1 -"wince","windows_ce", +"windows[_+ ]xp","windows[_+ ]nt[_+ ]5\.1", # Must be before windows_nt_5 +"windows[_+ ]me","win[_+ ]9x", # Must be before windows_98 +"windows[_+ ]?2000","windows[_+ ]nt[_+ ]5", +"winnt","windows[_+ \-]nt","win32", +"win(.*)98", +"win(.*)95", +"win(.*)16","windows[_+ ]3", # This works for windows_31 and windows_3.1 +"win(.*)ce", # Macintosh OS family -"mac_p", # This works for mac_ppc and mac_powerpc -"mac_68", # This works for mac_6800 and mac_68k -"macppc", +"mac[_+ ]?p", # This works for macppc and mac_ppc and mac_powerpc +"mac[_+ ]68", # This works for mac_6800 and mac_68k "macweb", "macintosh", # Unix like OS @@ -52,7 +51,7 @@ "cp/m", "crayos", "dreamcast", -"riscos","risc_os", +"risc[_+ ]?os", "webtv" ); @@ -63,16 +62,16 @@ #-------------------------------------------------------------------------- %OSHashID = ( # Windows OS family -"windows_xp","winxp","windows_nt_5\.1","winxp", -"windows_me","winme","win_9x_4\.9","winme", -"windows2000","win2000","windows_2000","win2000","windows_nt_5","win2000", -"winnt","winnt","windows_nt","winnt","windows-nt","winnt","win32","winnt", -"win98","win98","windows_98","win98","windows98","win98", -"win95","win95","windows_95","win95", -"win16","win16","windows_3","win16","windows;i;16","win16", -"wince","wince","windows_ce","wince", +"windows[_+ ]xp","winxp","windows[_+ ]nt[_+ ]5\.1","winxp", +"windows[_+ ]me","winme","win[_+ ]9x","winme", +"windows[_+ ]?2000","win2000","windows[_+ ]nt[_+ ]5","win2000", +"winnt","winnt","windows[_+ \-]nt","winnt","win32","winnt", +"win(.*)98","win98", +"win(.*)95","win95", +"win(.*)16","win16","windows[_+ ]3","win16", +"win(.*)ce","wince", # Macintosh OS family -"mac_p","macintosh","mac_68","macintosh","macppc","macintosh","macweb","macintosh","macintosh","macintosh", +"mac[_+ ]?p","macintosh","mac[_+ ]68","macintosh","macweb","macintosh","macintosh","macintosh", # Unix like OS "linux","linux", "aix","aix", @@ -94,7 +93,7 @@ "cp/m","cp/m", "crayos","crayos", "dreamcast","dreamcast", -"riscos","riscos","risc_os","riscos", +"risc[_+ ]?os","riscos", "webtv","webtv" );