5
5
# necessary from your scheduler to update your statistics and from command
6
6
# line or a browser to read report results.
7
7
# See AWStats documentation (in docs/ directory) for all setup instructions.
9
# This program is free software; you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 2 of the License, or
12
# (at your option) any later version.
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
8
20
#------------------------------------------------------------------------------
9
# $Revision: 1.971 $ - $Author: eldy $ - $Date: 2010/10/16 17:24:03 $
21
# $Revision: 1.982 $ - $Author: eldy $ - $Date: 2012/10/24 22:33:50 $
24
36
#------------------------------------------------------------------------------
25
37
use vars qw/ $REVISION $VERSION /;
26
$REVISION = '$Revision: 1.971 $';
38
$REVISION = '$Revision: 1.982 $';
27
39
$REVISION =~ /\s(.*)\s/;
29
$VERSION = "7.0 (build $REVISION)";
41
$VERSION = "7.1 (build $REVISION)";
31
43
# ----- Constants -----
313
326
$WrapperScript, $SiteDomain,
314
327
$UseHTTPSLinkForUrl, $URLQuerySeparators,
315
328
$URLWithAnchor, $ErrorMessages,
329
$ShowFlagLinks, $AddLinkToExternalCGIWrapper
319
332
'', '', '', '', '', '', '', '', '', '', '', '', '', '',
320
'', '', '', '', '', '', '', '', '', '', '', '', ''
333
'', '', '', '', '', '', '', '', '', '', '', '', '', '', ''
323
336
$color_Background $color_TableBG $color_TableBGRowTitle
511
524
%MonthUnique %MonthVisits
512
525
%MonthPages %MonthHits %MonthBytes
513
526
%MonthNotViewedPages %MonthNotViewedHits %MonthNotViewedBytes
514
%_session %_browser_h
527
%_session %_browser_h %_browser_p
515
528
%_domener_p %_domener_h %_domener_k %_errors_h %_errors_k
516
529
%_filetypes_h %_filetypes_k %_filetypes_gz_in %_filetypes_gz_out
517
530
%_host_p %_host_h %_host_k %_host_l %_host_s %_host_u
518
531
%_waithost_e %_waithost_l %_waithost_s %_waithost_u
519
%_keyphrases %_keywords %_os_h %_pagesrefs_p %_pagesrefs_h %_robot_h %_robot_k %_robot_l %_robot_r
532
%_keyphrases %_keywords %_os_h %_os_p %_pagesrefs_p %_pagesrefs_h %_robot_h %_robot_k %_robot_l %_robot_r
520
533
%_worm_h %_worm_k %_worm_l %_login_h %_login_p %_login_k %_login_l %_screensize_h
521
534
%_misc_p %_misc_h %_misc_k
522
535
%_cluster_p %_cluster_h %_cluster_k
987
1001
"<span dir=\"ltr\" style=\"font: 11px verdana, arial, helvetica; color: #$color_text;\">";
989
"<b>Advanced Web Statistics $VERSION</b> - <a href=\"http://awstats.sourceforge.net\" target=\"awstatshome\">";
1003
"<b>Advanced Web Statistics $VERSION</b> - <a href=\"http://www.awstats.org\" target=\"awstatshome\">";
990
1004
print $Message[169] . " $PROG";
991
1005
if ($listplugins) {
992
1006
my $atleastoneplugin = 0;
1905
1917
$SiteDomain = $value;
1920
if ( $param =~ /^AddLinkToExternalCGIWrapper/ ) {
1922
# No regex test as AddLinkToExternalCGIWrapper is always exact value
1923
$AddLinkToExternalCGIWrapper = $value;
1908
1926
if ( $param =~ /^HostAliases/ ) {
1909
1927
@HostAliases = ();
1910
1928
foreach my $elem ( split( /\s+/, $value ) ) {
2768
2786
if ( $ShowLinksToWhoIs !~ /[01]/ ) { $ShowLinksToWhoIs = 0; }
2769
2787
$Logo ||= 'awstats_logo6.png';
2770
$LogoLink ||= 'http://awstats.sourceforge.net';
2788
$LogoLink ||= 'http://www.awstats.org';
2771
2789
if ( $BarWidth !~ /^\d+/ || $BarWidth < 1 ) { $BarWidth = 260; }
2772
2790
if ( $BarHeight !~ /^\d+/ || $BarHeight < 1 ) { $BarHeight = 90; }
2773
2791
$color_Background =~ s/#//g;
3636
3654
binmode HISTORYTMP;
3638
3656
print HISTORYTMP
3639
'<xml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://awstats.sourceforge.net/files/awstats.xsd">'
3657
'<xml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.awstats.org/files/awstats.xsd">'
3642
3660
Save_History( "header", $year, $month, $date );
4643
4662
if ( $SectionsToSave{'os'} ) {
4644
4663
Save_History( 'os', $year, $month, $date );
4645
4664
delete $SectionsToSave{'os'};
4646
if ($withpurge) { %_os_h = (); }
4665
if ($withpurge) { %_os_h = (); %_os_p = (); }
4648
4667
if ( !scalar %SectionsToLoad ) {
4649
4668
debug(" Stop reading history file. Got all we need.");
4695
4715
if ( $SectionsToSave{'browser'} ) {
4696
4716
Save_History( 'browser', $year, $month, $date );
4697
4717
delete $SectionsToSave{'browser'};
4698
if ($withpurge) { %_browser_h = (); }
4718
if ($withpurge) { %_browser_h = (); %_browser_p = (); }
4700
4720
if ( !scalar %SectionsToLoad ) {
4701
4721
debug(" Stop reading history file. Got all we need.");
6897
6917
print HISTORYTMP "# OS ID - Hits\n";
6898
6918
$ValueInFile{$sectiontosave} = tell HISTORYTMP;
6899
print HISTORYTMP "${xmlbb}BEGIN_OS${xmlbs}"
6919
print HISTORYTMP "${xmlbb}BEGIN_OS ID - Hits - Pages${xmlbs}"
6900
6920
. ( scalar keys %_os_h )
6901
6921
. "${xmlbe}\n";
6902
6922
foreach ( keys %_os_h ) {
6903
print HISTORYTMP "${xmlrb}$_${xmlrs}$_os_h{$_}${xmlre}\n";
6923
my $hits = $_os_h{$_} || 0;
6924
my $pages = $_os_p{$_} || 0;
6925
print HISTORYTMP "${xmlrb}$_${xmlrs}$hits${xmlrs}$pages${xmlre}\n";
6905
6927
print HISTORYTMP "${xmleb}END_OS${xmlee}\n";
6910
6932
print HISTORYTMP "<section id='$sectiontosave'><comment>\n";
6912
print HISTORYTMP "# Browser ID - Hits\n";
6934
print HISTORYTMP "# Browser ID - Hits - Pages\n";
6913
6935
$ValueInFile{$sectiontosave} = tell HISTORYTMP;
6914
6936
print HISTORYTMP "${xmlbb}BEGIN_BROWSER${xmlbs}"
6915
6937
. ( scalar keys %_browser_h )
6916
6938
. "${xmlbe}\n";
6917
6939
foreach ( keys %_browser_h ) {
6918
print HISTORYTMP "${xmlrb}$_${xmlrs}$_browser_h{$_}${xmlre}\n";
6940
my $hits = $_browser_h{$_} || 0;
6941
my $pages = $_browser_p{$_} || 0;
6942
print HISTORYTMP "${xmlrb}$_${xmlrs}$hits${xmlrs}$pages${xmlre}\n";
6920
6944
print HISTORYTMP "${xmleb}END_BROWSER${xmlee}\n";
7657
7681
# Reset all hash arrays with name beginning by _
7658
%_session = %_browser_h = ();
7682
%_session = %_browser_h = %_browser_p = ();
7659
7683
%_domener_p = %_domener_h = %_domener_k = %_errors_h = %_errors_k = ();
7660
7684
%_filetypes_h = %_filetypes_k = %_filetypes_gz_in = %_filetypes_gz_out = ();
7661
7685
%_host_p = %_host_h = %_host_k = %_host_l = %_host_s = %_host_u = ();
7662
7686
%_waithost_e = %_waithost_l = %_waithost_s = %_waithost_u = ();
7663
%_keyphrases = %_keywords = %_os_h = %_pagesrefs_p = %_pagesrefs_h =
7687
%_keyphrases = %_keywords = %_os_h = %_os_p = %_pagesrefs_p = %_pagesrefs_h =
7664
7688
%_robot_h = %_robot_k = %_robot_l = %_robot_r = ();
7665
7689
%_worm_h = %_worm_k = %_worm_l = %_login_p = %_login_h = %_login_k =
7666
7690
%_login_l = %_screensize_h = ();
7788
7812
#------------------------------------------------------------------------------
7789
# Function: Decode an precompiled regex value to a common regex value
7813
# Function: Decode a precompiled regex value to a common regex value
7790
7814
# Parameters: compiledregextodecode
7793
7817
# Return: standardregex
7794
7818
#------------------------------------------------------------------------------
7795
7819
sub UnCompileRegex {
7796
shift =~ /\(\?[-^\w]*:(.*)\)/;
7820
shift =~ /\(\?[-\w]*:(.*)\)/;
8439
8463
'browsers', 'domains', 'operating_systems', 'robots',
8440
8464
'search_engines', 'worms'
8442
print "----- $PROG $VERSION (c) 2000-2010 Laurent Destailleur -----\n";
8466
print "----- $PROG $VERSION (c) 2000-2012 Laurent Destailleur -----\n";
8444
8468
"AWStats is a free web server logfile analyzer to show you advanced web\n";
8445
8469
print "statistics.\n";
8589
8613
print " Dynamic or static HTML or XHTML reports, static PDF reports\n";
8590
8614
print " Indexed text or XML monthly database\n";
8591
8615
print " And a lot of other advanced features and options...\n";
8592
print "New versions and FAQ at http://awstats.sourceforge.net\n";
8616
print "New versions and FAQ at http://www.awstats.org\n";
8595
8619
#------------------------------------------------------------------------------
9766
9790
# Logo and flags
9767
9791
if ( $FrameName ne 'mainleft' ) {
9768
if ( $LogoLink =~ "http://awstats.sourceforge.net" ) {
9792
if ( $LogoLink =~ "http://www.awstats.org" ) {
9769
9793
print "<td align=\"right\" rowspan=\"3\"><a href=\""
9770
9794
. XMLEncode($LogoLink)
9771
9795
. "\" target=\"awstatshome\"><img src=\"$DirIcons/other/$Logo\" border=\"0\""
9830
9854
# Logo and flags
9831
9855
if ( $FrameName eq 'mainright' ) {
9832
if ( $LogoLink =~ "http://awstats.sourceforge.net" ) {
9856
if ( $LogoLink =~ "http://www.awstats.org" ) {
9833
9857
print "<td align=\"right\" rowspan=\"2\"><a href=\""
9834
9858
. XMLEncode($LogoLink)
9835
9859
. "\" target=\"awstatshome\"><img src=\"$DirIcons/other/$Logo\" border=\"0\""
10407
10431
#------------------------------------------------------------------------------
10408
10432
# Function: Prints the File Type table
10409
10433
# Parameters: _
10434
# Input: $NewLinkParams, $NewLinkTargets
10411
10435
# Output: HTML
10413
10437
#------------------------------------------------------------------------------
10414
10438
sub HTMLMainFileType{
10439
my $NewLinkParams = shift;
10440
my $NewLinkTarget = shift;
10415
10441
if (!$LevelForFileTypesDetection > 0){return;}
10416
10442
if ($Debug) { debug( "ShowFileTypesStatsCompressionStats", 2 ); }
10417
10443
print "$Center<a name=\"filetypes\"> </a><br />\n";
10420
10446
my $Totalk = 0;
10421
10447
foreach ( keys %_filetypes_k ) { $Totalk += $_filetypes_k{$_}; }
10422
10448
my $title = "$Message[73]";
10449
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
10450
# extend the title to include the added link
10451
$title = "$title - <a href=\"" . (XMLEncode(
10452
"$AddLinkToExternalCGIWrapper" . "?section=FILETYPES&baseName=$DirData/$PROG"
10453
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
10454
. "&siteConfig=$SiteConfig" )
10455
. "\"$NewLinkTarget>$Message[179]</a>");
10423
10458
if ( $ShowFileTypesStats =~ /C/i ) { $title .= " - $Message[98]"; }
10425
10460
# build keylist at top
10586
10621
"<tr bgcolor=\"#$color_TableBGRowTitle\"><th colspan=\"2\">$Message[58]</th>";
10588
"<th width=\"80\">$Message[111]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[57]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[15]</th>";
10623
"<th width=\"80\">$Message[111]</th><th bgcolor=\"#$color_p\" width=\"80\">$Message[56]</th><th bgcolor=\"#$color_p\" width=\"80\">$Message[15]</th>";
10625
"<th bgcolor=\"#$color_h\" width=\"80\">$Message[57]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[15]</th>";
10589
10626
print "<th> </th>";
10590
10627
print "</tr>\n";
10591
10628
my $total_h = 0;
10592
10630
my $count = 0;
10593
10631
&BuildKeyList( MinimumButNoZero( scalar keys %_browser_h, 500 ),
10594
1, \%_browser_h, \%_browser_h );
10632
1, \%_browser_h, \%_browser_p );
10595
10633
my %keysinkeylist = ();
10596
10634
my $max_h = 1;
10598
10637
# Count total by family
10599
10638
my %totalfamily_h = ();
10600
my $TotalFamily = 0;
10639
my %totalfamily_p = ();
10640
my $TotalFamily_h = 0;
10641
my $TotalFamily_p = 0;
10601
10642
BROWSERLOOP: foreach my $key (@keylist) {
10602
10643
$total_h += $_browser_h{$key};
10603
10644
if ( $_browser_h{$key} > $max_h ) {
10604
10645
$max_h = $_browser_h{$key};
10647
$total_p += $_browser_p{$key};
10648
if ( $_browser_p{$key} > $max_p ) {
10649
$max_p = $_browser_p{$key};
10606
10651
foreach my $family ( keys %BrowsersFamily ) {
10607
10652
if ( $key =~ /^$family/i ) {
10608
10653
$totalfamily_h{$family} += $_browser_h{$key};
10609
$TotalFamily += $_browser_h{$key};
10654
$totalfamily_p{$family} += $_browser_p{$key};
10655
$TotalFamily_h += $_browser_h{$key};
10656
$TotalFamily_p += $_browser_p{$key};
10610
10657
next BROWSERLOOP;
10634
10686
. uc($family)
10635
10687
. "</b></td>";
10636
10688
print "<td> </td><td><b>"
10689
. Format_Number(int( $totalfamily_p{$family} ))
10690
. "</b></td><td><b>$p_p</b></td>";
10637
10692
. Format_Number(int( $totalfamily_h{$family} ))
10638
. "</b></td><td><b>$p</b></td><td> </td>";
10693
. "</b></td><td><b>$p_h</b></td><td> </td>";
10639
10694
print "</tr>\n";
10640
10695
$familyheadershown = 1;
10642
10697
$keysinkeylist{$key} = 1;
10643
10698
my $ver = $1;
10699
my $p_h = ' ';
10700
my $p_p = ' ';
10645
10701
if ($total_h) {
10647
10703
int( $_browser_h{$key} / $total_h * 1000 ) / 10;
10708
int( $_browser_p{$key} / $total_p * 1000 ) / 10;
10650
10711
print "<tr>";
10672
10734
if ( ( $bredde_h == 1 ) && $_browser_h{$key} ) {
10673
10735
$bredde_h = 2;
10675
print "<td>".Format_Number($_browser_h{$key})."</td><td>$p</td>";
10737
if ( $max_p > 0 ) {
10739
int( $BarWidth * ( $_browser_p{$key} || 0 ) /
10742
if ( ( $bredde_p == 1 ) && $_browser_p{$key} ) {
10745
print "<td>".Format_Number($_browser_p{$key})."</td><td>$p_p</td>";
10746
print "<td>".Format_Number($_browser_h{$key})."</td><td>$p_h</td>";
10676
10747
print "<td class=\"aws\">";
10678
10749
# alt and title are not provided to reduce page size
10679
10750
if ($ShowBrowsersStats) {
10752
"<img src=\"$DirIcons\/other\/$BarPng{'hp'}\" width=\"$bredde_p\" height=\"5\" /><br />";
10681
10754
"<img src=\"$DirIcons\/other\/$BarPng{'hh'}\" width=\"$bredde_h\" height=\"5\" /><br />";
10683
10756
print "</td>";
10692
10765
foreach my $key (@keylist) {
10693
10766
if ( $keysinkeylist{$key} ) { next; }
10694
10767
if ( !$familyheadershown ) {
10768
my $p_h = ' ';
10769
my $p_p = ' ';
10772
int( ( $total_p - $TotalFamily_p ) / $total_p * 1000 ) /
10696
10776
if ($total_h) {
10698
int( ( $total_h - $TotalFamily ) / $total_h * 1000 ) /
10778
int( ( $total_h - $TotalFamily_h ) / $total_h * 1000 ) /
10703
10783
"<tr bgcolor=\"#F6F6F6\"><td class=\"aws\" colspan=\"2\"><b>$Message[2]</b></td>";
10704
10784
print "<td> </td><td><b>"
10705
. Format_Number(( $total_h - $TotalFamily ))
10706
. "</b></td><td><b>$p</b></td><td> </td>";
10785
. Format_Number(( $total_p - $TotalFamily_p ))
10786
. "</b></td><td><b>$p_p</b></td>";
10788
. Format_Number(( $total_h - $TotalFamily_h ))
10789
. "</b></td><td><b>$p_h</b></td><td> </td>";
10707
10790
print "</tr>\n";
10708
10791
$familyheadershown = 1;
10793
my $p_h = ' ';
10794
my $p_p = ' ';
10711
10795
if ($total_h) {
10712
$p = int( $_browser_h{$key} / $total_h * 1000 ) / 10;
10796
$p_h = int( $_browser_h{$key} / $total_h * 1000 ) / 10;
10800
$p_p = int( $_browser_p{$key} / $total_p * 1000 ) / 10;
10715
10803
print "<tr>";
10716
10804
if ( $key eq 'Unknown' ) {
10742
10830
my $bredde_h = 0;
10743
10832
if ( $max_h > 0 ) {
10745
10834
int( $BarWidth * ( $_browser_h{$key} || 0 ) / $max_h ) +
10837
if ( $max_p > 0 ) {
10839
int( $BarWidth * ( $_browser_p{$key} || 0 ) / $max_p ) +
10748
10842
if ( ( $bredde_h == 1 ) && $_browser_h{$key} ) {
10749
10843
$bredde_h = 2;
10751
print "<td>".Format_Number($_browser_h{$key})."</td><td>$p</td>";
10845
if ( ( $bredde_p == 1 ) && $_browser_p{$key} ) {
10848
print "<td>".Format_Number($_browser_p{$key})."</td><td>$p_p</td>";
10849
print "<td>".Format_Number($_browser_h{$key})."</td><td>$p_h</td>";
10752
10850
print "<td class=\"aws\">";
10754
10852
# alt and title are not provided to reduce page size
10755
10853
if ($ShowBrowsersStats) {
10855
"<img src=\"$DirIcons\/other\/$BarPng{'hp'}\" width=\"$bredde_p\" height=\"5\" /><br />";
10757
10857
"<img src=\"$DirIcons\/other\/$BarPng{'hh'}\" width=\"$bredde_h\" height=\"5\" /><br />";
10759
10859
print "</td>";
10766
10866
#------------------------------------------------------------------------------
10767
10867
# Function: Prints the Unknown Browser Detail frame or static page
10868
# Parameters: $NewLinkTarget
10770
10870
# Output: HTML
10772
10872
#------------------------------------------------------------------------------
10773
10873
sub HTMLShowBrowserUnknown{
10874
my $NewLinkTarget = shift;
10774
10875
print "$Center<a name=\"unknownbrowser\"> </a><br />\n";
10775
10876
my $title = "$Message[50]";
10877
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
10878
# extend the title to include the added link
10879
$title = "$title - <a href=\"" . (XMLEncode(
10880
"$AddLinkToExternalCGIWrapper" . "?section=UNKNOWNREFERERBROWSER&baseName=$DirData/$PROG"
10881
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
10882
. "&siteConfig=$SiteConfig" )
10883
. "\"$NewLinkTarget>$Message[179]</a>");
10776
10885
&tab_head( "$title", 19, 0, 'unknownbrowser' );
10777
10886
print "<tr bgcolor=\"#$color_TableBGRowTitle\"><th>User agent ("
10778
10887
. ( scalar keys %_unknownrefererbrowser_l )
10817
10926
"<tr bgcolor=\"#$color_TableBGRowTitle\"><th colspan=\"2\">$Message[58]</th>";
10928
"<th bgcolor=\"#$color_p\" width=\"80\">$Message[56]</th><th bgcolor=\"#$color_p\" width=\"80\">$Message[15]</th>";
10819
10930
"<th bgcolor=\"#$color_h\" width=\"80\">$Message[57]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[15]</th>";
10820
print "<th> </th>";
10821
10931
print "</tr>\n";
10822
10932
my $total_h = 0;
10823
10934
my $count = 0;
10824
10935
&BuildKeyList( MinimumButNoZero( scalar keys %_os_h, 500 ),
10825
1, \%_os_h, \%_os_h );
10936
1, \%_os_h, \%_os_p );
10826
10937
my %keysinkeylist = ();
10827
10938
my $max_h = 1;
10829
10941
# Count total by family
10830
10942
my %totalfamily_h = ();
10831
my $TotalFamily = 0;
10943
my %totalfamily_p = ();
10944
my $TotalFamily_h = 0;
10945
my $TotalFamily_p = 0;
10832
10946
OSLOOP: foreach my $key (@keylist) {
10833
10947
$total_h += $_os_h{$key};
10948
$total_p += $_os_p{$key};
10834
10949
if ( $_os_h{$key} > $max_h ) { $max_h = $_os_h{$key}; }
10950
if ( $_os_p{$key} > $max_p ) { $max_p = $_os_p{$key}; }
10835
10951
foreach my $family ( keys %OSFamily ) {
10836
10952
if ( $key =~ /^$family/i ) {
10837
10953
$totalfamily_h{$family} += $_os_h{$key};
10838
$TotalFamily += $_os_h{$key};
10954
$totalfamily_p{$family} += $_os_p{$key};
10955
$TotalFamily_h += $_os_h{$key};
10956
$TotalFamily_p += $_os_p{$key};
10844
10962
# Write records grouped in a browser family
10845
10963
foreach my $family ( keys %OSFamily ) {
10964
my $p_h = ' ';
10965
my $p_p = ' ';
10847
10966
if ($total_h) {
10848
$p = int( $totalfamily_h{$family} / $total_h * 1000 ) / 10;
10967
$p_h = int( $totalfamily_h{$family} / $total_h * 1000 ) / 10;
10971
$p_p = int( $totalfamily_p{$family} / $total_p * 1000 ) / 10;
10851
10974
my $familyheadershown = 0;
10852
10975
foreach my $key ( reverse sort keys %_os_h ) {
10860
10983
"<tr bgcolor=\"#F6F6F6\"><td class=\"aws\" colspan=\"2\"><b>$family_name</b></td>";
10861
10984
print "<td><b>"
10985
. Format_Number(int( $totalfamily_p{$family} ))
10986
. "</b></td><td><b>$p_p</b></td>";
10862
10988
. Format_Number(int( $totalfamily_h{$family} ))
10863
. "</b></td><td><b>$p</b></td><td> </td>";
10989
. "</b></td><td><b>$p_h</b></td><td> </td>";
10864
10990
print "</tr>\n";
10865
10991
$familyheadershown = 1;
10867
10993
$keysinkeylist{$key} = 1;
10868
10994
my $ver = $1;
10995
my $p_h = ' ';
10996
my $p_p = ' ';
10870
10997
if ($total_h) {
10871
$p = int( $_os_h{$key} / $total_h * 1000 ) / 10;
10998
$p_h = int( $_os_h{$key} / $total_h * 1000 ) / 10;
11002
$p_p = int( $_os_p{$key} / $total_p * 1000 ) / 10;
10874
11005
print "<tr>";
10888
11020
if ( ( $bredde_h == 1 ) && $_os_h{$key} ) {
10889
11021
$bredde_h = 2;
10891
print "<td>".Format_Number($_os_h{$key})."</td><td>$p</td>";
11023
if ( $max_p > 0 ) {
11025
int( $BarWidth * ( $_os_p{$key} || 0 ) / $max_p )
11028
if ( ( $bredde_p == 1 ) && $_os_p{$key} ) {
11031
print "<td>".Format_Number($_os_p{$key})."</td><td>$p_p</td>";
11032
print "<td>".Format_Number($_os_h{$key})."</td><td>$p_h</td>";
10892
11033
print "<td class=\"aws\">";
10894
11035
# alt and title are not provided to reduce page size
10895
11036
if ($ShowOSStats) {
11038
"<img src=\"$DirIcons\/other\/$BarPng{'hp'}\" width=\"$bredde_p\" height=\"5\" /><br />";
10897
11040
"<img src=\"$DirIcons\/other\/$BarPng{'hh'}\" width=\"$bredde_h\" height=\"5\" /><br />";
10899
11042
print "</td>";
10908
11051
foreach my $key (@keylist) {
10909
11052
if ( $keysinkeylist{$key} ) { next; }
10910
11053
if ( !$familyheadershown ) {
11054
my $p_h = ' ';
11055
my $p_p = ' ';
10912
11056
if ($total_h) {
10914
int( ( $total_h - $TotalFamily ) / $total_h * 1000 ) /
11058
int( ( $total_h - $TotalFamily_h ) / $total_h * 1000 ) /
11064
int( ( $total_p - $TotalFamily_p ) / $total_p * 1000 ) /
10919
11069
"<tr bgcolor=\"#F6F6F6\"><td class=\"aws\" colspan=\"2\"><b>$Message[2]</b></td>";
10920
11070
print "<td><b>"
10921
. Format_Number(( $total_h - $TotalFamily ))
10922
. "</b></td><td><b>$p</b></td><td> </td>";
11071
. Format_Number(( $total_p - $TotalFamily_p ))
11072
. "</b></td><td><b>$p_p</b></td>";
11074
. Format_Number(( $total_h - $TotalFamily_h ))
11075
. "</b></td><td><b>$p_h</b></td><td> </td>";
10923
11076
print "</tr>\n";
10924
11077
$familyheadershown = 1;
11079
my $p_h = ' ';
11080
my $p_p = ' ';
10927
11081
if ($total_h) {
10928
$p = int( $_os_h{$key} / $total_h * 1000 ) / 10;
11082
$p_h = int( $_os_h{$key} / $total_h * 1000 ) / 10;
11086
$p_p = int( $_os_p{$key} / $total_p * 1000 ) / 10;
10931
11089
print "<tr>";
10932
11090
if ( $key eq 'Unknown' ) {
10950
11108
. " /></td><td class=\"aws\">$libos</td>";
10952
11110
my $bredde_h = 0;
10953
11112
if ( $max_h > 0 ) {
10955
11114
int( $BarWidth * ( $_os_h{$key} || 0 ) / $max_h ) + 1;
10957
11116
if ( ( $bredde_h == 1 ) && $_os_h{$key} ) { $bredde_h = 2; }
10958
print "<td>".Format_Number($_os_h{$key})."</td><td>$p</td>";
11117
if ( $max_p > 0 ) {
11119
int( $BarWidth * ( $_os_p{$key} || 0 ) / $max_p ) + 1;
11121
if ( ( $bredde_p == 1 ) && $_os_p{$key} ) { $bredde_p = 2; }
11122
print "<td>".Format_Number($_os_p{$key})."</td><td>$p_p</td>";
11123
print "<td>".Format_Number($_os_h{$key})."</td><td>$p_h</td>";
10959
11124
print "<td class=\"aws\">";
10961
11126
# alt and title are not provided to reduce page size
10962
11127
if ($ShowOSStats) {
11129
"<img src=\"$DirIcons\/other\/$BarPng{'hp'}\" width=\"$bredde_p\" height=\"5\" /><br />";
10964
11131
"<img src=\"$DirIcons\/other\/$BarPng{'hh'}\" width=\"$bredde_h\" height=\"5\" /><br />";
10966
11133
print "</td>";
10973
11140
#------------------------------------------------------------------------------
10974
11141
# Function: Prints the Unkown OS Detail frame or static page
11142
# Parameters: $NewLinkTarget
10977
11144
# Output: HTML
10979
11146
#------------------------------------------------------------------------------
10980
11147
sub HTMLShowOSUnknown{
11148
my $NewLinkTarget = shift;
10981
11149
print "$Center<a name=\"unknownos\"> </a><br />\n";
10982
11150
my $title = "$Message[46]";
10983
&tab_head( "$title", 19, 0, 'unknownos' );
11151
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
11152
# extend the title to include the added link
11153
$title = "$title - <a href=\"" . (XMLEncode(
11154
"$AddLinkToExternalCGIWrapper" . "?section=UNKNOWNREFERER&baseName=$DirData/$PROG"
11155
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
11156
. "&siteConfig=$SiteConfig" )
11157
. "\"$NewLinkTarget>$Message[179]</a>");
11159
&tab_head( "$title", 19, 0, 'unknownos' );
10984
11160
print "<tr bgcolor=\"#$color_TableBGRowTitle\"><th>User agent ("
10985
11161
. ( scalar keys %_unknownreferer_l )
10986
11162
. ")</th><th>$Message[9]</th></tr>\n";
11011
11187
#------------------------------------------------------------------------------
11012
11188
# Function: Prints the Referers frame or static page
11189
# Parameters: $NewLinkTarget
11015
11191
# Output: HTML
11017
11193
#------------------------------------------------------------------------------
11018
11194
sub HTMLShowReferers{
11195
my $NewLinkTarget = shift;
11019
11196
print "$Center<a name=\"refererse\"> </a><br />\n";
11020
11197
my $title = "$Message[40]";
11021
&tab_head( "$title", 19, 0, 'refererse' );
11198
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
11199
# extend the title to include the added link
11200
$title = "$title - <a href=\"" . (XMLEncode(
11201
"$AddLinkToExternalCGIWrapper" . "?section=SEREFERRALS&baseName=$DirData/$PROG"
11202
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
11203
. "&siteConfig=$SiteConfig" )
11204
. "\"$NewLinkTarget>$Message[179]</a>");
11206
&tab_head( $title, 19, 0, 'refererse' );
11023
11208
"<tr bgcolor=\"#$color_TableBGRowTitle\"><th>".Format_Number($TotalDifferentSearchEngines)." $Message[122]</th>";
11104
11289
#------------------------------------------------------------------------------
11105
11290
# Function: Prints the Referer Pages frame or static page
11291
# Parameters: $NewLinkTarget
11108
11293
# Output: HTML
11110
11295
#------------------------------------------------------------------------------
11111
11296
sub HTMLShowRefererPages{
11297
my $NewLinkTarget = shift;
11112
11298
print "$Center<a name=\"refererpages\"> </a><br />\n";
11113
11299
my $total_p = 0;
11114
11300
my $total_h = 0;
11122
11308
$FilterEx{'refererpages'}
11124
11310
my $title = "$Message[41]";
11311
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
11312
# extend the title to include the added link
11313
$title = "$title - <a href=\"" . (XMLEncode(
11314
"$AddLinkToExternalCGIWrapper" . "?section=PAGEREFS&baseName=$DirData/$PROG"
11315
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
11316
. "&siteConfig=$SiteConfig" )
11317
. "\"$NewLinkTarget>$Message[179]</a>");
11126
11320
$cpt = ( scalar keys %_pagesrefs_h );
11127
11321
&tab_head( "$title", 19, 0, 'refererpages' );
11128
11322
print "<tr bgcolor=\"#$color_TableBGRowTitle\"><th>";
11233
11427
#------------------------------------------------------------------------------
11234
11428
# Function: Prints the Key Phrases frame or static page
11429
# Parameters: $NewLinkTarget
11237
11431
# Output: HTML
11239
11433
#------------------------------------------------------------------------------
11240
11434
sub HTMLShowKeyPhrases{
11435
my $NewLinkTarget = shift;
11241
11436
print "$Center<a name=\"keyphrases\"> </a><br />\n";
11242
&tab_head( $Message[43], 19, 0, 'keyphrases' );
11437
my $title = "$Message[43]";
11438
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
11439
# extend the title to include the added link
11440
$title = "$title - <a href=\"" . (XMLEncode(
11441
"$AddLinkToExternalCGIWrapper" . "?section=SEARCHWORDS&baseName=$DirData/$PROG"
11442
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
11443
. "&siteConfig=$SiteConfig" )
11444
. "\"$NewLinkTarget>$Message[179]</a>");
11446
&tab_head( $title, 19, 0, 'keyphrases' );
11243
11447
print "<tr bgcolor=\"#$color_TableBGRowTitle\""
11244
11448
. Tooltip(15)
11245
11449
. "><th>".Format_Number($TotalDifferentKeyphrases)." $Message[103]</th><th bgcolor=\"#$color_s\" width=\"80\">$Message[14]</th><th bgcolor=\"#$color_s\" width=\"80\">$Message[15]</th></tr>\n";
11291
11495
#------------------------------------------------------------------------------
11292
11496
# Function: Prints the Keywords frame or static page
11497
# Parameters: $NewLinkTarget
11295
11499
# Output: HTML
11297
11501
#------------------------------------------------------------------------------
11298
11502
sub HTMLShowKeywords{
11503
my $NewLinkTarget = shift;
11299
11504
print "$Center<a name=\"keywords\"> </a><br />\n";
11300
&tab_head( $Message[44], 19, 0, 'keywords' );
11505
my $title = "$Message[44]";
11506
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
11507
# extend the title to include the added link
11508
$title = "$title - <a href=\"" . (XMLEncode(
11509
"$AddLinkToExternalCGIWrapper" . "?section=KEYWORDS&baseName=$DirData/$PROG"
11510
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
11511
. "&siteConfig=$SiteConfig" )
11512
. "\"$NewLinkTarget>$Message[179]</a>");
11514
&tab_head( $title, 19, 0, 'keywords' );
11301
11515
print "<tr bgcolor=\"#$color_TableBGRowTitle\""
11302
11516
. Tooltip(15)
11303
11517
. "><th>".Format_Number($TotalDifferentKeywords)." $Message[13]</th><th bgcolor=\"#$color_s\" width=\"80\">$Message[14]</th><th bgcolor=\"#$color_s\" width=\"80\">$Message[15]</th></tr>\n";
13149
13363
if ($Debug) { debug( "ShowDaysOfMonthStats", 2 ); }
13150
13364
print "$Center<a name=\"daysofmonth\"> </a><br />\n";
13366
my $NewLinkParams = ${QueryString};
13367
$NewLinkParams =~ s/(^|&|&)update(=\w*|$)//i;
13368
$NewLinkParams =~ s/(^|&|&)staticlinks(=\w*|$)//i;
13369
$NewLinkParams =~ s/(^|&|&)year=[^&]*//i;
13370
$NewLinkParams =~ s/(^|&|&)month=[^&]*//i;
13371
$NewLinkParams =~ s/(^|&|&)framename=[^&]*//i;
13372
$NewLinkParams =~ s/(&|&)+/&/i;
13373
$NewLinkParams =~ s/^&//;
13374
$NewLinkParams =~ s/&$//;
13375
if ($NewLinkParams) { $NewLinkParams = "${NewLinkParams}&"; }
13376
my $NewLinkTarget = '';
13378
if ( $FrameName eq 'mainright' ) {
13379
$NewLinkTarget = " target=\"_parent\"";
13151
13382
my $title = "$Message[138]";
13384
if ($AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
13385
# extend the title to include the added link
13386
$title = "$title - <a href=\"".(XMLEncode(
13387
"$AddLinkToExternalCGIWrapper". "?section=DAY&baseName=$DirData/$PROG"
13388
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
13389
. "&siteConfig=$SiteConfig" )
13390
. "\"$NewLinkTarget>$Message[179]</a>");
13152
13393
&tab_head( "$title", 0, 0, 'daysofmonth' );
13153
13394
print "<tr>";
13154
13395
print "<td align=\"center\">\n";
13155
13396
print "<center>\n";
13157
my $NewLinkParams = ${QueryString};
13158
$NewLinkParams =~ s/(^|&|&)update(=\w*|$)//i;
13159
$NewLinkParams =~ s/(^|&|&)staticlinks(=\w*|$)//i;
13160
$NewLinkParams =~ s/(^|&|&)year=[^&]*//i;
13161
$NewLinkParams =~ s/(^|&|&)month=[^&]*//i;
13162
$NewLinkParams =~ s/(^|&|&)framename=[^&]*//i;
13163
$NewLinkParams =~ s/(&|&)+/&/i;
13164
$NewLinkParams =~ s/^&//;
13165
$NewLinkParams =~ s/&$//;
13166
if ($NewLinkParams) { $NewLinkParams = "${NewLinkParams}&"; }
13167
my $NewLinkTarget = '';
13169
if ( $FrameName eq 'mainright' ) {
13170
$NewLinkTarget = " target=\"_parent\"";
13173
13398
my $average_v = my $average_p = 0;
13174
13399
my $average_h = my $average_k = 0;
13175
13400
my $total_u = my $total_v = my $total_p = my $total_h = my $total_k = 0;
13571
13796
sub HTMLMainDaysofWeek{
13572
13797
my $firstdaytocountaverage = shift;
13573
13798
my $lastdaytocountaverage = shift;
13799
my $NewLinkParams = shift;
13800
my $NewLinkTarget = shift;
13574
13802
if ($Debug) { debug( "ShowDaysOfWeekStats", 2 ); }
13575
13803
print "$Center<a name=\"daysofweek\"> </a><br />\n";
13576
13804
my $title = "$Message[91]";
13885
14113
: "$StaticLinks.downloads.$StaticExt"
13887
14115
. "\"$NewLinkTarget>$Message[80]</a>";
14117
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
14118
# extend the title to include the added link
14119
$title = "$title - <a href=\"" . (XMLEncode(
14120
"$AddLinkToExternalCGIWrapper" . "?section=DOWNLOADS&baseName=$DirData/$PROG"
14121
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
14122
. "&siteConfig=$SiteConfig" )
14123
. "\"$NewLinkTarget>$Message[179]</a>");
13888
14126
&tab_head( "$title", 0, 0, 'downloads' );
13890
14128
for my $u (sort {$_downloads{$b}->{'AWSTATS_HITS'} <=> $_downloads{$a}->{'AWSTATS_HITS'}}(keys %_downloads) ){
13973
14211
#------------------------------------------------------------------------------
13974
14212
# Function: Prints the hours chart and table
14213
# Parameters: $NewLinkParams, $NewLinkTarget
13977
14215
# Output: HTML
13979
14217
#------------------------------------------------------------------------------
13980
14218
sub HTMLMainHours{
13981
if ($Debug) { debug( "ShowHoursStats", 2 ); }
14219
my $NewLinkParams = shift;
14220
my $NewLinkTarget = shift;
14222
if ($Debug) { debug( "ShowHoursStats", 2 ); }
13982
14223
print "$Center<a name=\"hours\"> </a><br />\n";
13983
14224
my $title = "$Message[20]";
14226
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
14227
# extend the title to include the added link
14228
$title = "$title - <a href=\"" . (XMLEncode(
14229
"$AddLinkToExternalCGIWrapper" . "?section=TIME&baseName=$DirData/$PROG"
14230
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
14231
. "&siteConfig=$SiteConfig" )
14232
. "\"$NewLinkTarget>$Message[179]</a>");
13984
14235
if ( $PluginsLoaded{'GetTimeZoneTitle'}{'timezone'} ) {
13985
14236
$title .= " (GMT "
13986
14237
. ( GetTimeZoneTitle_timezone() >= 0 ? "+" : "" )
14213
14464
: "$StaticLinks.alldomains.$StaticExt"
14215
14466
. "\"$NewLinkTarget>$Message[80]</a>";
14469
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
14470
# extend the title to include the added link
14471
$title = "$title - <a href=\"" . (XMLEncode(
14472
"$AddLinkToExternalCGIWrapper" . "?section=DOMAIN&baseName=$DirData/$PROG"
14473
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
14474
. "&siteConfig=$SiteConfig" )
14475
. "\"$NewLinkTarget>$Message[179]</a>");
14216
14478
&tab_head( "$title", 19, 0, 'countries' );
14218
14480
my $total_u = my $total_v = my $total_p = my $total_h = my $total_k = 0;
14457
14719
: "$StaticLinks.unknownip.$StaticExt"
14459
14721
. "\"$NewLinkTarget>$Message[45]</a>";
14723
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
14724
# extend the title to include the added link
14725
$title = "$title - <a href=\"" . (XMLEncode(
14726
"$AddLinkToExternalCGIWrapper" . "?section=VISITOR&baseName=$DirData/$PROG"
14727
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
14728
. "&siteConfig=$SiteConfig" )
14729
. "\"$NewLinkTarget>$Message[179]</a>");
14460
14732
&tab_head( "$title", 19, 0, 'visitors' );
14462
14734
&BuildKeyList( $MaxNbOf{'HostsShown'}, $MinHit{'Host'}, \%_host_h,
14720
14992
if ($Debug) { debug( "ShowRobotStats", 2 ); }
14721
14993
print "$Center<a name=\"robots\"> </a><br />\n";
14723
"$Message[53] ($Message[77] $MaxNbOf{'RobotShown'}) - <a href=\""
14995
my $title = "$Message[53] ($Message[77] $MaxNbOf{'RobotShown'}) - <a href=\""
14725
14997
$ENV{'GATEWAY_INTERFACE'}
14726
14998
|| !$StaticLinks
14734
15006
? XMLEncode("$AWScript${NewLinkParams}output=lastrobots")
14735
15007
: "$StaticLinks.lastrobots.$StaticExt"
14737
. "\"$NewLinkTarget>$Message[9]</a>",
14740
print "<tr bgcolor=\"#$color_TableBGRowTitle\""
15009
. "\"$NewLinkTarget>$Message[9]</a>";
15011
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
15012
# extend the title to include the added link
15013
$title = "$title - <a href=\"" . (XMLEncode(
15014
"$AddLinkToExternalCGIWrapper" . "?section=ROBOT&baseName=$DirData/$PROG"
15015
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
15016
. "&siteConfig=$SiteConfig" )
15017
. "\"$NewLinkTarget>$Message[179]</a>");
15020
&tab_head( "$title", 19, 0, 'robots');
15022
print "<tr bgcolor=\"#$color_TableBGRowTitle\""
14741
15023
. Tooltip(16) . "><th>"
14742
15024
. Format_Number(( scalar keys %_robot_h ))
14743
15025
. " $Message[51]*</th>";
15019
15301
. "\"$NewLinkTarget>$Message[116]</a>";
15304
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
15305
# extend the title to include the added link
15306
$title .= " - <a href=\"" . (XMLEncode(
15307
"$AddLinkToExternalCGIWrapper" . "?section=SIDER&baseName=$DirData/$PROG"
15308
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
15309
. "&siteConfig=$SiteConfig" )
15310
. "\"$NewLinkTarget>$Message[179]</a>");
15021
15313
&tab_head( "$title", 19, 0, 'urls' );
15023
15315
"<tr bgcolor=\"#$color_TableBGRowTitle\"><th>".Format_Number($TotalDifferentPages)." $Message[28]</th>";
15227
15519
if ($Debug) { debug( "ShowOSStats", 2 ); }
15228
15520
print "$Center<a name=\"os\"> </a><br />\n";
15229
15521
my $Totalh = 0;
15230
15523
my %new_os_h = ();
15231
15525
OSLOOP: foreach my $key ( keys %_os_h ) {
15232
15526
$Totalh += $_os_h{$key};
15527
$Totalp += $_os_p{$key};
15233
15528
foreach my $family ( keys %OSFamily ) {
15234
15529
if ( $key =~ /^$family/i ) {
15235
15530
$new_os_h{"${family}cumul"} += $_os_h{$key};
15531
$new_os_p{"${family}cumul"} += $_os_p{$key};
15239
15535
$new_os_h{$key} += $_os_h{$key};
15536
$new_os_p{$key} += $_os_p{$key};
15242
15539
"$Message[59] ($Message[77] $MaxNbOf{'OsShown'}) - <a href=\""
15254
15551
: "$StaticLinks.unknownos.$StaticExt"
15256
15553
. "\"$NewLinkTarget>$Message[0]</a>";
15555
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
15556
# extend the title to include the added link
15557
$title .= " - <a href=\"" . (XMLEncode(
15558
"$AddLinkToExternalCGIWrapper" . "?section=OS&baseName=$DirData/$PROG"
15559
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
15560
. "&siteConfig=$SiteConfig" )
15561
. "\"$NewLinkTarget>$Message[179]</a>");
15257
15564
&tab_head( "$title", 19, 0, 'os' );
15259
15566
&BuildKeyList( $MaxNbOf{'OsShown'}, $MinHit{'Os'}, \%new_os_h,
15262
15569
# Graph the top five in a pie chart
15263
15570
if (scalar @keylist > 1){
15302
"<tr bgcolor=\"#$color_TableBGRowTitle\"><th width=\"$WIDTHCOLICON\"> </th><th>$Message[59]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[57]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[15]</th></tr>\n";
15609
"<tr bgcolor=\"#$color_TableBGRowTitle\"><th width=\"$WIDTHCOLICON\"> </th><th>$Message[59]</th>";
15611
"<th bgcolor=\"#$color_p\" width=\"80\">$Message[56]</th><th bgcolor=\"#$color_p\" width=\"80\">$Message[15]</th>";
15613
"<th bgcolor=\"#$color_h\" width=\"80\">$Message[57]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[15]</th></tr>\n";
15303
15614
my $total_h = 0;
15304
15616
my $count = 0;
15306
15618
foreach my $key (@keylist) {
15619
my $p_h = ' ';
15620
my $p_p = ' ';
15308
15621
if ($Totalh) {
15309
$p = int( $new_os_h{$key} / $Totalh * 1000 ) / 10;
15622
$p_h = int( $new_os_h{$key} / $Totalh * 1000 ) / 10;
15626
$p_p = int( $new_os_p{$key} / $Totalp * 1000 ) / 10;
15312
15629
if ( $key eq 'Unknown' ) {
15313
15630
print "<tr><td"
15314
15631
. ( $count ? "" : " width=\"$WIDTHCOLICON\"" )
15315
15632
. "><img src=\"$DirIcons\/os\/unknown.png\""
15316
15633
. AltTitle("")
15317
. " /></td><td class=\"aws\"><span style=\"color: #$color_other\">$Message[0]</span></td><td>".Format_Number($_os_h{$key})."</td><td>$p</td></tr>\n";
15634
. " /></td><td class=\"aws\"><span style=\"color: #$color_other\">$Message[0]</span></td>"
15635
. "<td>".Format_Number($_os_p{$key})."</td><td>$p_p</td><td>".Format_Number($_os_h{$key})."</td><td>$p_h</td></tr>\n";
15320
15638
my $keywithoutcumul = $key;
15330
15648
. ( $count ? "" : " width=\"$WIDTHCOLICON\"" )
15331
15649
. "><img src=\"$DirIcons\/os\/$nameicon.png\""
15332
15650
. AltTitle("")
15333
. " /></td><td class=\"aws\">$libos</td><td>".Format_Number($new_os_h{$key})."</td><td>$p</td></tr>\n";
15651
. " /></td><td class=\"aws\">$libos</td><td>".Format_Number($new_os_p{$key})."</td><td>$p_p</td><td>".Format_Number($new_os_h{$key})."</td><td>$p_h</td></tr>\n";
15335
15653
$total_h += $new_os_h{$key};
15654
$total_p += $new_os_p{$key};
15338
15657
if ($Debug) {
15339
15658
debug( "Total real / shown : $Totalh / $total_h", 2 );
15341
15660
my $rest_h = $Totalh - $total_h;
15661
my $rest_p = $Totalp - $total_p;
15342
15662
if ( $rest_h > 0 ) {
15344
if ($Totalh) { $p = int( $rest_h / $Totalh * 1000 ) / 10; }
15665
if ($Totalh) { $p_h = int( $rest_h / $Totalh * 1000 ) / 10; }
15666
if ($Totalp) { $p_p = int( $rest_p / $Totalp * 1000 ) / 10; }
15345
15667
print "<tr>";
15346
15668
print "<td> </td>";
15348
"<td class=\"aws\"><span style=\"color: #$color_other\">$Message[2]</span></td><td>".Format_Number($rest_h)."</td>";
15349
print "<td>$p %</td></tr>\n";
15670
"<td class=\"aws\"><span style=\"color: #$color_other\">$Message[2]</span></td><td>".Format_Number($rest_p)."</td>";
15671
print "<td>$p_p %</td><td>".Format_Number($rest_h)."</td><td>$p_h %</td></tr>\n";
15365
15687
if ($Debug) { debug( "ShowBrowsersStats", 2 ); }
15366
15688
print "$Center<a name=\"browsers\"> </a><br />\n";
15367
15689
my $Totalh = 0;
15368
15691
my %new_browser_h = ();
15692
my %new_browser_p = ();
15369
15693
BROWSERLOOP: foreach my $key ( keys %_browser_h ) {
15370
15694
$Totalh += $_browser_h{$key};
15695
$Totalp += $_browser_p{$key};
15371
15696
foreach my $family ( keys %BrowsersFamily ) {
15372
15697
if ( $key =~ /^$family/i ) {
15373
15698
$new_browser_h{"${family}cumul"} += $_browser_h{$key};
15699
$new_browser_p{"${family}cumul"} += $_browser_p{$key};
15374
15700
next BROWSERLOOP;
15377
15703
$new_browser_h{$key} += $_browser_h{$key};
15704
$new_browser_p{$key} += $_browser_p{$key};
15380
15707
"$Message[21] ($Message[77] $MaxNbOf{'BrowsersShown'}) - <a href=\""
15392
15719
: "$StaticLinks.unknownbrowser.$StaticExt"
15394
15721
. "\"$NewLinkTarget>$Message[0]</a>";
15724
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
15725
# extend the title to include the added link
15726
$title .= " - <a href=\"" . (XMLEncode(
15727
"$AddLinkToExternalCGIWrapper" . "?section=BROWSER&baseName=$DirData/$PROG"
15728
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
15729
. "&siteConfig=$SiteConfig" )
15730
. "\"$NewLinkTarget>$Message[179]</a>");
15395
15733
&tab_head( "$title", 19, 0, 'browsers' );
15397
15735
&BuildKeyList(
15398
15736
$MaxNbOf{'BrowsersShown'}, $MinHit{'Browser'},
15399
\%new_browser_h, \%new_browser_h
15737
\%new_browser_h, \%new_browser_p
15402
15740
# Graph the top five in a pie chart
15441
"<tr bgcolor=\"#$color_TableBGRowTitle\"><th width=\"$WIDTHCOLICON\"> </th><th>$Message[21]</th><th width=\"80\">$Message[111]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[57]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[15]</th></tr>\n";
15779
"<tr bgcolor=\"#$color_TableBGRowTitle\"><th width=\"$WIDTHCOLICON\"> </th><th>$Message[21]</th><th width=\"80\">$Message[111]</th><th bgcolor=\"#$color_p\" width=\"80\">$Message[56]</th><th bgcolor=\"#$color_p\" width=\"80\">$Message[15]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[57]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[15]</th></tr>\n";
15442
15780
my $total_h = 0;
15443
15782
my $count = 0;
15444
15783
foreach my $key (@keylist) {
15784
my $p_h = ' ';
15785
my $p_p = ' ';
15446
15786
if ($Totalh) {
15447
$p = int( $new_browser_h{$key} / $Totalh * 1000 ) / 10;
15787
$p_h = int( $new_browser_h{$key} / $Totalh * 1000 ) / 10;
15791
$p_p = int( $new_browser_p{$key} / $Totalp * 1000 ) / 10;
15450
15794
if ( $key eq 'Unknown' ) {
15451
15795
print "<tr><td"
15452
15796
. ( $count ? "" : " width=\"$WIDTHCOLICON\"" )
15453
15797
. "><img src=\"$DirIcons\/browser\/unknown.png\""
15454
15798
. AltTitle("")
15455
. " /></td><td class=\"aws\"><span style=\"color: #$color_other\">$Message[0]</span></td><td width=\"80\">?</td><td>".Format_Number($_browser_h{$key})."</td><td>$p</td></tr>\n";
15799
. " /></td><td class=\"aws\"><span style=\"color: #$color_other\">$Message[0]</span></td><td width=\"80\">?</td>"
15800
. "<td>".Format_Number($_browser_p{$key})."</td><td>$p_p</td>"
15801
. "<td>".Format_Number($_browser_h{$key})."</td><td>$p_h</td></tr>\n";
15458
15804
my $keywithoutcumul = $key;
15478
15824
? "<b>$Message[112]</b>"
15479
15825
: "$Message[113]"
15481
. "</td><td>".Format_Number($new_browser_h{$key})."</td><td>$p</td></tr>\n";
15827
. "</td><td>".Format_Number($new_browser_p{$key})."</td><td>$p_p</td><td>".Format_Number($new_browser_h{$key})."</td><td>$p_h</td></tr>\n";
15483
15829
$total_h += $new_browser_h{$key};
15830
$total_p += $new_browser_p{$key};
15486
15833
if ($Debug) {
15487
15834
debug( "Total real / shown : $Totalh / $total_h", 2 );
15489
15836
my $rest_h = $Totalh - $total_h;
15837
my $rest_p = $Totalp - $total_p;
15490
15838
if ( $rest_h > 0 ) {
15492
if ($Totalh) { $p = int( $rest_h / $Totalh * 1000 ) / 10; }
15841
if ($Totalh) { $p_h = int( $rest_h / $Totalh * 1000 ) / 10; }
15842
if ($Totalp) { $p_p = int( $rest_p / $Totalp * 1000 ) / 10; }
15493
15843
print "<tr>";
15494
15844
print "<td> </td>";
15496
"<td class=\"aws\"><span style=\"color: #$color_other\">$Message[2]</span></td><td> </td><td>$rest_h</td>";
15497
print "<td>$p %</td></tr>\n";
15846
"<td class=\"aws\"><span style=\"color: #$color_other\">$Message[2]</span></td><td> </td><td>$rest_p</td>";
15847
print "<td>$p_p %</td><td>$rest_h</td><td>$p_h %</td></tr>\n";
15502
15852
#------------------------------------------------------------------------------
15581
15931
? $_from_h[$_]
15584
&tab_head( $Message[36], 19, 0, 'referer' );
15935
my $title = "$Message[36]";
15937
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
15938
# extend the title to include the added link
15939
$title .= " - <a href=\"" . (XMLEncode(
15940
"$AddLinkToExternalCGIWrapper" . "?section=ORIGIN&baseName=$DirData/$PROG"
15941
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
15942
. "&siteConfig=$SiteConfig" )
15943
. "\"$NewLinkTarget>$Message[179]</a>");
15946
&tab_head( $title, 19, 0, 'referer' );
15585
15947
my @p_p = ( 0, 0, 0, 0, 0, 0 );
15586
15948
if ( $Totalp > 0 ) {
15587
15949
$p_p[0] = int( $_from_p[0] / $Totalp * 1000 ) / 10;
16065
16427
if ($Debug) { debug( "ShowHTTPErrorsStats", 2 ); }
16066
16428
print "$Center<a name=\"errors\"> </a><br />\n";
16067
16429
my $title = "$Message[32]";
16431
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
16432
# extend the title to include the added link
16433
$title .= " - <a href=\"" . (XMLEncode(
16434
"$AddLinkToExternalCGIWrapper" . "?section=ERRORS&baseName=$DirData/$PROG"
16435
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
16436
. "&siteConfig=$SiteConfig" )
16437
. "\"$NewLinkTarget>$Message[179]</a>");
16068
16440
&tab_head( "$title", 19, 0, 'errors' );
16070
16442
&BuildKeyList( $MaxRowsInHTMLOutput, 1, \%_errors_h, \%_errors_h );
16177
16549
if ($Debug) { debug( "ShowClusterStats", 2 ); }
16178
16550
print "$Center<a name=\"clusters\"> </a><br />\n";
16179
16551
my $title = "$Message[155]";
16553
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
16554
# extend the title to include the added link
16555
$title .= " - <a href=\"" . (XMLEncode(
16556
"$AddLinkToExternalCGIWrapper" . "?section=CLUSTER&baseName=$DirData/$PROG"
16557
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
16558
. "&siteConfig=$SiteConfig" )
16559
. "\"$NewLinkTarget>$Message[179]</a>");
16180
16562
&tab_head( "$title", 19, 0, 'clusters' );
16182
16564
&BuildKeyList( $MaxRowsInHTMLOutput, 1, \%_cluster_p, \%_cluster_p );
16286
16668
: "$StaticLinks.allextra$extranum.$StaticExt"
16288
16670
. "\"$NewLinkTarget>$Message[80]</a>";
16672
if ( $AddLinkToExternalCGIWrapper && ($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks) ) {
16673
print " - <a href=\""
16675
"$AddLinkToExternalCGIWrapper" . "?section=EXTRA_$extranum&baseName=$DirData/$PROG"
16676
. "&month=$MonthRequired&year=$YearRequired&day=$DayRequired"
16677
. "§ionTitle=$ExtraName[$extranum]&siteConfig=$SiteConfig" )
16678
. "\"$NewLinkTarget>$Message[179]</a>");
16289
16681
print "</th>";
16291
16683
if ( $ExtraStatTypes[$extranum] =~ m/P/i ) {
18321
18713
if ( $ValidHTTPCodes{ $field[$pos_code] } ) { # Code is valid
18322
18714
if ( int($field[$pos_code]) == 304 && $pos_size>0) { $field[$pos_size] = 0; }
18323
18715
# track downloads
18324
if (int($field[$pos_code]) == 200 && $MimeHashLib{$extension}[1] eq 'd'){
18716
if (int($field[$pos_code]) == 200 && $MimeHashLib{$extension}[1] eq 'd' && $urlwithnoquery !~ /robots.txt$/ ) # We track download if $MimeHashLib{$extension}[1] = 'd'
18325
18718
$_downloads{$urlwithnoquery}->{'AWSTATS_HITS'}++;
18326
18719
$_downloads{$urlwithnoquery}->{'AWSTATS_SIZE'} += ($pos_size>0 ? int($field[$pos_size]) : 0);
18327
18720
if ($Debug) { debug( " New download detected: '$urlwithnoquery'", 2 ); }
18995
19388
&& $UserAgent !~ /$regnotfirefox/o )
18997
19390
$_browser_h{"firefox$1"}++;
19391
if ($PageBool) { $_browser_p{"firefox$1"}++; }
18998
19392
$TmpBrowser{$UserAgent} = "firefox$1";
19002
19396
elsif ( $UserAgent =~ /$regveropera/o ) {
19003
19397
$_browser_h{"opera$1"}++;
19398
if ($PageBool) { $_browser_p{"opera$1"}++; }
19004
19399
$TmpBrowser{$UserAgent} = "opera$1";
19008
19403
elsif ( $UserAgent =~ /$regverchrome/o ) {
19009
19404
$_browser_h{"chrome$1"}++;
19405
if ($PageBool) { $_browser_p{"chrome$1"}++; }
19010
19406
$TmpBrowser{$UserAgent} = "chrome$1";
19019
19415
$safariver = $1;
19021
19417
$_browser_h{"safari$safariver"}++;
19418
if ($PageBool) { $_browser_p{"safari$safariver"}++; }
19022
19419
$TmpBrowser{$UserAgent} = "safari$safariver";
19025
19422
# Konqueror ?
19026
19423
elsif ( $UserAgent =~ /$regverkonqueror/o ) {
19027
19424
$_browser_h{"konqueror$1"}++;
19425
if ($PageBool) { $_browser_p{"konqueror$1"}++; }
19028
19426
$TmpBrowser{$UserAgent} = "konqueror$1";
19031
19429
# Subversion ?
19032
19430
elsif ( $UserAgent =~ /$regversvn/o ) {
19033
19431
$_browser_h{"svn$1"}++;
19432
if ($PageBool) { $_browser_p{"svn$1"}++; }
19034
19433
$TmpBrowser{$UserAgent} = "svn$1";
19039
19438
&& $UserAgent !~ /$regnotie/o )
19041
19440
$_browser_h{"msie$2"}++;
19441
if ($PageBool) { $_browser_p{"msie$2"}++; }
19042
19442
$TmpBrowser{$UserAgent} = "msie$2";
19045
19445
# Netscape 6.x, 7.x ... ? (must be at end of test)
19046
19446
elsif ( $UserAgent =~ /$regvernetscape/o ) {
19047
19447
$_browser_h{"netscape$1"}++;
19448
if ($PageBool) { $_browser_p{"netscape$1"}++; }
19048
19449
$TmpBrowser{$UserAgent} = "netscape$1";
20385
20799
&HTMLShowURLDetail();
20387
20801
if ( $HTMLOutput{'unknownos'} ) {
20388
&HTMLShowOSUnknown();
20802
&HTMLShowOSUnknown($NewLinkTarget);
20390
20804
if ( $HTMLOutput{'unknownbrowser'} ) {
20391
&HTMLShowBrowserUnknown();
20805
&HTMLShowBrowserUnknown($NewLinkTarget);
20393
20807
if ( $HTMLOutput{'osdetail'} ) {
20394
20808
&HTMLShowOSDetail();
20397
20811
&HTMLShowBrowserDetail();
20399
20813
if ( $HTMLOutput{'refererse'} ) {
20400
&HTMLShowReferers();
20814
&HTMLShowReferers($NewLinkTarget);
20402
20816
if ( $HTMLOutput{'refererpages'} ) {
20403
&HTMLShowRefererPages();
20817
&HTMLShowRefererPages($NewLinkTarget);
20405
20819
if ( $HTMLOutput{'keyphrases'} ) {
20406
&HTMLShowKeyPhrases();
20820
&HTMLShowKeyPhrases($NewLinkTarget);
20408
20822
if ( $HTMLOutput{'keywords'} ) {
20409
&HTMLShowKeywords();
20823
&HTMLShowKeywords($NewLinkTarget);
20411
20825
if ( $HTMLOutput{'downloads'} ) {
20412
20826
&HTMLShowDownloads();
20506
20920
# BY DAY OF WEEK
20507
20921
#-------------------------
20508
20922
if ($ShowDaysOfWeekStats) {
20509
&HTMLMainDaysofWeek($firstdaytocountaverage, $lastdaytocountaverage);
20923
&HTMLMainDaysofWeek($firstdaytocountaverage, $lastdaytocountaverage, $NewLinkParams, $NewLinkTarget);
20513
20927
#----------------------------
20514
20928
if ($ShowHoursStats) {
20929
&HTMLMainHours($NewLinkParams, $NewLinkTarget);
20518
20932
print "\n<a name=\"who\"> </a>\n\n";