From: eldy <>
Date: Thu, 16 Jan 2003 14:09:31 +0000 (+0000)
Subject: Added icons for file types.
X-Git-Tag: AWSTATS_5_4_BETA~52
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b570ddca4c261b35f76d275d0024e977f66d2041;p=thirdparty%2FAWStats.git
Added icons for file types.
Added parameter AddDataArrayMonthDayStats, AddDataArrayShowDaysOfWeekStats and AddDataArrayShowHoursStats.
---
diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt
index 169e4d3d..bf24aa7b 100644
--- a/docs/awstats_changelog.txt
+++ b/docs/awstats_changelog.txt
@@ -23,6 +23,9 @@ New features/improvments:
- Added average session length in Visit Duration report.
- Added percentage in Visit Duration report.
- logresolvemerge.pl can read .gz or .bz2 files.
+- Added icons and Mime label for file types.
+- Added parameter AddDataArrayMonthDayStats, AddDataArrayShowDaysOfWeekStats,
+ and AddDataArrayShowHoursStats.
Other/Documentation:
- Replaced -month=year option by -month=all.
diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf
index b08dc316..d7f15c7a 100644
--- a/wwwroot/cgi-bin/awstats.model.conf
+++ b/wwwroot/cgi-bin/awstats.model.conf
@@ -800,11 +800,26 @@ ShowKeywordsStats=1
ShowHTTPErrorsStats=1
-# This value can be used to choose maximum number of lines shown for each
-# particular reporting.
+# Some graphical reports are followed by the data array of values.
+# If you don't want this array (to reduce report size for example), you can
+# set thoose options to 0.
+# Possible values: 0 or 1
+# Default: 1
+#
+# Data array values for the ShowMonthDaysStats report
+AddDataArrayMonthDayStats=1
+# Data array values for the ShowDaysOfWeekStats report
+AddDataArrayShowDaysOfWeekStats=1
+# Data array values for the ShowHoursStats report
+AddDataArrayShowHoursStats=1
+
+
+# Following parameter can be used to choose maximum number of lines shown for
+# each particular reporting.
#
# Stats by domains
MaxNbOfDomain = 10
+MinHitDomain = 1
# Stats by hosts
MaxNbOfHostsShown = 10
MinHitHost = 1
@@ -825,10 +840,10 @@ MaxNbOfKeyphrasesShown = 10
MinHitKeyphrase = 1
# Stats for keywords
MaxNbOfKeywordsShown = 10
-MinHitKeyword = 1
+MinHitKeyword = 1
# Stats for emails
MaxNbOfEMailsShown = 20
-MinHitEMail = 1
+MinHitEMail = 1
# Choose if you want the week report to start on sunday or monday
@@ -1078,12 +1093,12 @@ color_x="C1B2E2" # Background color for number of exit pages (Default = "C1B2
#-----------------------------------------------------------------------------
# You can include other config files using the directive with the name of the
-# config file (like Apache, so you must keep the '#' before 'include').
+# config file.
# This is particularly usefull for users who have a lot of virtual servers, so
# a lot of config files and want to maintain common values in only one file.
# Note that when a variable is defined both in a config file and in an
# included file, AWStats will use the last value read.
#
-#include ""
+#Include ""
diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl
index 18d52f2c..4fd736e5 100644
--- a/wwwroot/cgi-bin/awstats.pl
+++ b/wwwroot/cgi-bin/awstats.pl
@@ -88,26 +88,24 @@ $DNSStaticCacheFile='dnscache.txt';
$DNSLastUpdateCacheFile='dnscachelastupdate.txt';
$Lang='en';
$MaxRowsInHTMLOutput = 1000;
-$BarImageVertical_v = 'barrevv.png';
-#$BarImageHorizontal_v = 'barrehv.png';
-$BarImageVertical_u = 'barrevu.png';
-#$BarImageHorizontal_u = 'barrehu.png';
-$BarImageVertical_p = 'barrevp.png';
-$BarImageHorizontal_p = 'barrehp.png';
-#$BarImageVertical_e = 'barreve.png';
-$BarImageHorizontal_e = 'barrehe.png';
-$BarImageHorizontal_x = 'barrehx.png';
-$BarImageVertical_h = 'barrevh.png';
-$BarImageHorizontal_h = 'barrehh.png';
-$BarImageVertical_k = 'barrevk.png';
-$BarImageHorizontal_k = 'barrehk.png';
+$BarImageVertical_v = 'vv.png';
+#$BarImageHorizontal_v = 'hv.png';
+$BarImageVertical_u = 'vu.png';
+#$BarImageHorizontal_u = 'hu.png';
+$BarImageVertical_p = 'vp.png';
+$BarImageHorizontal_p = 'hp.png';
+#$BarImageVertical_e = 've.png';
+$BarImageHorizontal_e = 'he.png';
+$BarImageHorizontal_x = 'hx.png';
+$BarImageVertical_h = 'vh.png';
+$BarImageHorizontal_h = 'hh.png';
+$BarImageVertical_k = 'vk.png';
+$BarImageHorizontal_k = 'hk.png';
use vars qw/
$EnableLockForUpdate $DNSLookup $AllowAccessFromWebToAuthenticatedUsersOnly
$BarHeight $BarWidth $CreateDirDataIfNotExists $KeepBackupOfHistoricFiles $MaxLengthOfURL
$MaxNbOfDomain $MaxNbOfHostsShown $MaxNbOfKeyphrasesShown $MaxNbOfKeywordsShown
$MaxNbOfLoginShown $MaxNbOfPageShown $MaxNbOfRefererShown $MaxNbOfRobotShown $MaxNbOfEMailsShown
-$MinHitFile $MinHitHost $MinHitKeyphrase $MinHitKeyword
-$MinHitLogin $MinHitRefer $MinHitRobot $MinHitEMail
$NbOfLinesRead $NbOfLinesDropped $NbOfLinesCorrupted $NbOfOldLines $NbOfNewLines
$NbOfLinesShowsteps $NewLinePhase $NbOfLinesForCorruptedLog $PurgeLogFile
$ShowAuthenticatedUsers $ShowFileSizesStats
@@ -121,8 +119,6 @@ $UseFramesWhenCGI $DecodeUA
$BarHeight, $BarWidth, $CreateDirDataIfNotExists, $KeepBackupOfHistoricFiles, $MaxLengthOfURL,
$MaxNbOfDomain, $MaxNbOfHostsShown, $MaxNbOfKeyphrasesShown, $MaxNbOfKeywordsShown,
$MaxNbOfLoginShown, $MaxNbOfPageShown, $MaxNbOfRefererShown, $MaxNbOfRobotShown, $MaxNbOfEMailsShown,
-$MinHitFile, $MinHitHost, $MinHitKeyphrase, $MinHitKeyword,
-$MinHitLogin, $MinHitRefer, $MinHitRobot, $MinHitEMail,
$NbOfLinesRead, $NbOfLinesDropped, $NbOfLinesCorrupted, $NbOfOldLines, $NbOfNewLines,
$NbOfLinesShowsteps, $NewLinePhase, $NbOfLinesForCorruptedLog, $PurgeLogFile,
$ShowAuthenticatedUsers, $ShowFileSizesStats,
@@ -131,10 +127,11 @@ $ShowEMailSenders, $ShowEMailReceivers,
$AuthenticatedUsersNotCaseSensitive,
$Expires, $UpdateStats, $MigrateStats, $URLNotCaseSensitive, $URLWithQuery, $URLReferrerWithQuery,
$UseFramesWhenCGI, $DecodeUA)=
-(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,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,0,0,0,0,0,0);
use vars qw/
$AllowToUpdateStatsFromBrowser $ArchiveLogRecords $DetailedReportsOnNewWindows
$FirstDayOfWeek $KeyWordsNotSensitive $SaveDatabaseFilesWithPermissionsForEveryone
+$WarningMessages $DebugMessages
$ShowMenu $ShowMonthDayStats $ShowDaysOfWeekStats
$ShowHoursStats $ShowDomainsStats $ShowHostsStats
$ShowRobotsStats $ShowSessionsStats $ShowPagesStats $ShowFileTypesStats
@@ -142,18 +139,23 @@ $ShowBrowsersStats $ShowOSStats $ShowOriginStats
$ShowKeyphrasesStats $ShowKeywordsStats
$ShowHTTPErrorsStats
$ShowFlagLinks $ShowLinksOnUrl
-$WarningMessages $DebugMessages
+$AddDataArrayMonthDayStats $AddDataArrayShowDaysOfWeekStats $AddDataArrayShowHoursStats
+$MinHitFile $MinHitDomain $MinHitHost $MinHitKeyphrase $MinHitKeyword
+$MinHitLogin $MinHitRefer $MinHitRobot $MinHitEMail
/;
($AllowToUpdateStatsFromBrowser, $ArchiveLogRecords, $DetailedReportsOnNewWindows,
$FirstDayOfWeek, $KeyWordsNotSensitive, $SaveDatabaseFilesWithPermissionsForEveryone,
+$WarningMessages, $DebugMessages,
$ShowMenu, $ShowMonthDayStats, $ShowDaysOfWeekStats,
$ShowHoursStats, $ShowDomainsStats, $ShowHostsStats,
$ShowRobotsStats, $ShowSessionsStats, $ShowPagesStats, $ShowFileTypesStats,
$ShowBrowsersStats, $ShowOSStats, $ShowOriginStats, $ShowKeyphrasesStats,
$ShowKeywordsStats, $ShowHTTPErrorsStats,
$ShowFlagLinks, $ShowLinksOnUrl,
-$WarningMessages, $DebugMessages)=
-(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
+$AddDataArrayMonthDayStats, $AddDataArrayShowDaysOfWeekStats, $AddDataArrayShowHoursStats,
+$MinHitFile, $MinHitDomain, $MinHitHost, $MinHitKeyphrase, $MinHitKeyword,
+$MinHitLogin, $MinHitRefer, $MinHitRobot, $MinHitEMail)=
+(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
use vars qw/
$LevelForRobotsDetection $LevelForBrowsersDetection $LevelForOSDetection $LevelForRefererAnalyze
$LevelForSearchEnginesDetection $LevelForKeywordsDetection
@@ -220,6 +222,7 @@ $TotalSearchEngines = $TotalRefererPages = $TotalDifferentSearchEngines = $Total
use vars qw/
@RobotsSearchIDOrder_list1 @RobotsSearchIDOrder_list2 @RobotsSearchIDOrder_list3
@BrowsersSearchIDOrder @OSSearchIDOrder @SearchEnginesSearchIDOrder @WordsToExtractSearchUrl @WordsToCleanSearchUrl
+@WormsSearchIDOrder
@DOWIndex @RobotsSearchIDOrder
@_from_p @_from_h
@_time_p @_time_h @_time_k
@@ -254,11 +257,13 @@ use vars qw/
@PluginsToLoad = ();
# ---------- Init hash arrays --------
use vars qw/
+%BrowsersHashIDLib %BrowsersHashIcon %BrowsersHereAreGrabbers
%DomainsHashIDLib
-%BrowsersHereAreGrabbers %BrowsersHashIcon %BrowsersHashIDLib
+%MimeHashLib %MimeHashIcon %MimeHashFamily
%OSHashID %OSHashLib
%RobotsHashIDLib
%SearchEnginesHashIDLib %SearchEnginesKnownUrl
+%WormsHashID %WormsHashLib
/;
use vars qw/
%HTMLOutput
@@ -1027,7 +1032,7 @@ sub Parse_Config {
if ($_ =~ /^$/) { next; }
# Check includes
- if ($_ =~ /^#include "([^\"]+)"/) {
+ if ($_ =~ /^Include "([^\"]+)"/ || $_ =~ /^#include "([^\"]+)"/) { # #include kept fr backward compatibility
my $includeFile = $1;
if ($Debug) { debug("Found an include : $includeFile",2); }
if ( $includeFile !~ /^[\\\/]/ ) {
@@ -1176,6 +1181,7 @@ sub Parse_Config {
if ($param =~ /^MaxNbOfExtra(\d+)/) { $MaxNbOfExtra[$1]=$value; next; }
if ($param =~ /^MinHitExtra(\d+)/) { $MinHitExtra[$1]=$value; next; }
# Read optional appearance setup section
+ if ($param =~ /^MaxRowsInHTMLOutput/) { $MaxRowsInHTMLOutput=$value; next; }
if ($param =~ /^Lang/) { $Lang=$value; next; }
if ($param =~ /^DirLang/) { $DirLang=$value; next; }
if ($param =~ /^ShowMenu/) { $ShowMenu=$value; next; }
@@ -1198,8 +1204,11 @@ sub Parse_Config {
if ($param =~ /^ShowHTTPErrorsStats/) { $ShowHTTPErrorsStats=$value; next; }
if ($param =~ /^ShowEMailSenders/) { $ShowEMailSenders=$value; next; }
if ($param =~ /^ShowEMailReceivers/) { $ShowEMailReceivers=$value; next; }
- if ($param =~ /^MaxRowsInHTMLOutput/) { $MaxRowsInHTMLOutput=$value; next; } # Not used yet
+ if ($param =~ /^AddDataArrayMonthDayStats/) { $AddDataArrayMonthDayStats=$value; next; }
+ if ($param =~ /^AddDataArrayShowDaysOfWeekStats/) { $AddDataArrayShowDaysOfWeekStats=$value; next; }
+ if ($param =~ /^AddDataArrayShowHoursStats/) { $AddDataArrayShowHoursStats=$value; next; }
if ($param =~ /^MaxNbOfDomain/) { $MaxNbOfDomain=$value; next; }
+ if ($param =~ /^MinHitDomain/) { $MinHitDomain=$value; next; }
if ($param =~ /^MaxNbOfHostsShown/) { $MaxNbOfHostsShown=$value; next; }
if ($param =~ /^MinHitHost/) { $MinHitHost=$value; next; }
if ($param =~ /^MaxNbOfRobotShown/) { $MaxNbOfRobotShown=$value; next; }
@@ -1268,7 +1277,7 @@ sub Parse_Config {
#------------------------------------------------------------------------------
# Function: Load the reference databases
-# Parameters: -
+# Parameters: List of files to load
# Input: $DIR
# Output: Arrays and Hash tables are defined
# Return: -
@@ -1279,15 +1288,9 @@ sub Read_Ref_Data {
# Debian package : "/usr/share/awstats/lib"
# Other possible directories : "./lib"
my @PossibleLibDir=("${DIR}lib","/usr/share/awstats/lib","./lib");
-
my %FilePath=();
my @FileListToLoad=();
- push @FileListToLoad, "browsers.pm";
- push @FileListToLoad, "domains.pm";
- push @FileListToLoad, "operating_systems.pm";
- push @FileListToLoad, "robots.pm";
- push @FileListToLoad, "search_engines.pm";
- push @FileListToLoad, "worms.pm";
+ while (my $file=shift) { push @FileListToLoad, "$file.pm"; }
foreach my $file (@FileListToLoad) {
foreach my $dir (@PossibleLibDir) {
my $searchdir=$dir;
@@ -1521,7 +1524,11 @@ sub Check_Config {
if ($ShowKeyphrasesStats !~ /[0-1]/) { $ShowKeyphrasesStats=1; }
if ($ShowKeywordsStats !~ /[0-1]/) { $ShowKeywordsStats=1; }
if ($ShowHTTPErrorsStats !~ /[0-1]/) { $ShowHTTPErrorsStats=1; }
+ if ($AddDataArrayMonthDayStats !~ /[0-1]/) { $AddDataArrayMonthDayStats=1; }
+ if ($AddDataArrayShowDaysOfWeekStats !~ /[0-1]/) { $AddDataArrayShowDaysOfWeekStats=1; }
+ if ($AddDataArrayShowHoursStats !~ /[0-1]/) { $AddDataArrayShowHoursStats=1; }
if ($MaxNbOfDomain !~ /^\d+$/ || $MaxNbOfDomain<1) { $MaxNbOfDomain=20; }
+ if ($MinHitDomain !~ /^\d+$/ || $MinHitDomain<1) { $MinHitDomain=1; }
if ($MaxNbOfHostsShown !~ /^\d+$/ || $MaxNbOfHostsShown<1) { $MaxNbOfHostsShown=20; }
if ($MinHitHost !~ /^\d+$/ || $MinHitHost<1) { $MinHitHost=1; }
if ($MaxNbOfLoginShown !~ /^\d+$/ || $MaxNbOfLoginShown<1) { $MaxNbOfLoginShown=10; }
@@ -3078,7 +3085,7 @@ sub Save_History {
$ValueInFile{$sectiontosave}=tell HISTORYTMP;
print HISTORYTMP "BEGIN_DOMAIN ".(scalar keys %_domener_h)."\n";
# We save page list in score sorted order to get a -output faster and with less use of memory.
- &BuildKeyList($MaxNbOfDomain,1,\%_domener_h,\%_domener_p);
+ &BuildKeyList($MaxNbOfDomain,$MinHitDomain,\%_domener_h,\%_domener_p);
my %keysinkeylist=();
foreach my $key (@keylist) {
$keysinkeylist{$key}=1;
@@ -4564,7 +4571,7 @@ if ($ENV{'AWSTATS_CONFIG'}) {
}
if ((! $ENV{'GATEWAY_INTERFACE'}) && (! $SiteConfig)) {
- &Read_Ref_Data();
+ &Read_Ref_Data('browsers','domains','operating_systems','robots','search_engines','worms');
print "----- $PROG $VERSION (c) Laurent Destailleur -----\n";
print "$PROG is a free web server logfile analyzer to show you advanced web\n";
print "statistics.\n";
@@ -4676,7 +4683,8 @@ if (! $FrameName) {
if ($FrameName ne 'index') {
&Read_Language_Data($Lang);
if ($FrameName ne 'mainleft') {
- &Read_Ref_Data();
+ if (! scalar keys %HTMLOutput) { &Read_Ref_Data('browsers','domains','operating_systems','robots','search_engines','worms'); }
+ else { &Read_Ref_Data('browsers','domains','operating_systems','robots','search_engines','worms','mime'); }
&Read_Plugins();
}
}
@@ -7094,6 +7102,7 @@ EOF
&html_end;
}
if ($HTMLOutput{'main'}) {
+
# MONTHDAY
#---------------------------------------------------------------------
if ($ShowMonthDayStats) {
@@ -7154,7 +7163,7 @@ EOF
$total_u=$total_v=$total_p=$total_h=$total_k=0;
print "
";
print "";
- print "| | ";
+ print "
| | \n";
$max_v=$max_p=$max_h=$max_k=1;
# Define total and max
for (my $ix=1; $ix<=12; $ix++) {
@@ -7201,37 +7210,39 @@ EOF
print "
\n
\n";
# Show data array for month
- print "\n";
- print "| $Message[5] | ";
- if ($ShowMonthDayStats =~ /U/i) { print "$Message[11] | "; }
- if ($ShowMonthDayStats =~ /V/i) { print "$Message[10] | "; }
- if ($ShowMonthDayStats =~ /P/i) { print "$Message[56] | "; }
- if ($ShowMonthDayStats =~ /H/i) { print "$Message[57] | "; }
- if ($ShowMonthDayStats =~ /B/i) { print "$Message[75] |
"; }
- for (my $ix=1; $ix<=12; $ix++) {
- my $monthix=sprintf("%02s",$ix);
- print "";
- print "| ",$MonthLib{$monthix}," | ";
- if ($ShowMonthDayStats =~ /U/i) { print "",$MonthUnique{$YearRequired.$monthix}?$MonthUnique{$YearRequired.$monthix}:"0"," | "; }
- if ($ShowMonthDayStats =~ /V/i) { print "",$MonthVisits{$YearRequired.$monthix}?$MonthVisits{$YearRequired.$monthix}:"0"," | "; }
- if ($ShowMonthDayStats =~ /P/i) { print "",$MonthPages{$YearRequired.$monthix}?$MonthPages{$YearRequired.$monthix}:"0"," | "; }
- if ($ShowMonthDayStats =~ /H/i) { print "",$MonthHits{$YearRequired.$monthix}?$MonthHits{$YearRequired.$monthix}:"0"," | "; }
- if ($ShowMonthDayStats =~ /B/i) { print "",Format_Bytes(int($MonthBytes{$YearRequired.$monthix}))," | "; }
+ if ($AddDataArrayMonthDayStats) {
+ print "\n";
+ print "| $Message[5] | ";
+ if ($ShowMonthDayStats =~ /U/i) { print "$Message[11] | "; }
+ if ($ShowMonthDayStats =~ /V/i) { print "$Message[10] | "; }
+ if ($ShowMonthDayStats =~ /P/i) { print "$Message[56] | "; }
+ if ($ShowMonthDayStats =~ /H/i) { print "$Message[57] | "; }
+ if ($ShowMonthDayStats =~ /B/i) { print "$Message[75] | "; }
print "
\n";
+ for (my $ix=1; $ix<=12; $ix++) {
+ my $monthix=sprintf("%02s",$ix);
+ print "";
+ print "| ",$MonthLib{$monthix}," | ";
+ if ($ShowMonthDayStats =~ /U/i) { print "",$MonthUnique{$YearRequired.$monthix}?$MonthUnique{$YearRequired.$monthix}:"0"," | "; }
+ if ($ShowMonthDayStats =~ /V/i) { print "",$MonthVisits{$YearRequired.$monthix}?$MonthVisits{$YearRequired.$monthix}:"0"," | "; }
+ if ($ShowMonthDayStats =~ /P/i) { print "",$MonthPages{$YearRequired.$monthix}?$MonthPages{$YearRequired.$monthix}:"0"," | "; }
+ if ($ShowMonthDayStats =~ /H/i) { print "",$MonthHits{$YearRequired.$monthix}?$MonthHits{$YearRequired.$monthix}:"0"," | "; }
+ if ($ShowMonthDayStats =~ /B/i) { print "",Format_Bytes(int($MonthBytes{$YearRequired.$monthix}))," | "; }
+ print "
\n";
+ }
+ # Average row
+ # TODO
+ # Total row
+ print "| $Message[102] | ";
+ if ($ShowMonthDayStats =~ /U/i) { print "$total_u | "; }
+ if ($ShowMonthDayStats =~ /V/i) { print "$total_v | "; }
+ if ($ShowMonthDayStats =~ /P/i) { print "$total_p | "; }
+ if ($ShowMonthDayStats =~ /H/i) { print "$total_h | "; }
+ if ($ShowMonthDayStats =~ /B/i) { print "".Format_Bytes($total_k)." | "; }
+ print "
\n";
+ print "
\n
\n";
}
- # Average row
- # TODO
- # Total row
- print "
| $Message[102] | ";
- if ($ShowMonthDayStats =~ /U/i) { print "$total_u | "; }
- if ($ShowMonthDayStats =~ /V/i) { print "$total_v | "; }
- if ($ShowMonthDayStats =~ /P/i) { print "$total_p | "; }
- if ($ShowMonthDayStats =~ /H/i) { print "$total_h | "; }
- if ($ShowMonthDayStats =~ /B/i) { print "".Format_Bytes($total_k)." | "; }
- print "
\n";
-
- print "
\n
";
-
+
# Show daily stats
$average_nb=$average_u=$average_v=$average_p=$average_h=$average_k=0;
$total_u=$total_v=$total_p=$total_h=$total_k=0;
@@ -7321,7 +7332,7 @@ EOF
my $year=$1; my $month=$2; my $day=$3;
if (! DateIsValid($day,$month,$year)) { next; } # If not an existing day, go to next
my $dayofweekcursor=DayOfWeek($day,$month,$year);
- print "";
+ print " | ";
print ($day==$nowday && $month==$nowmonth && $year==$nowyear?'':'');
print "$day ".$MonthLib{$month}."";
print ($day==$nowday && $month==$nowmonth && $year==$nowyear?'':'');
@@ -7334,42 +7345,43 @@ EOF
print "\n \n";
# Show data array for days
- print "\n";
- print "| $Message[4] | ";
- if ($ShowMonthDayStats =~ /V/i) { print "$Message[10] | "; }
- if ($ShowMonthDayStats =~ /P/i) { print "$Message[56] | "; }
- if ($ShowMonthDayStats =~ /H/i) { print "$Message[57] | "; }
- if ($ShowMonthDayStats =~ /B/i) { print "$Message[75] | "; }
- foreach my $daycursor ($firstdaytoshowtime..$lastdaytoshowtime) {
- $daycursor =~ /^(\d\d\d\d)(\d\d)(\d\d)/;
- my $year=$1; my $month=$2; my $day=$3;
- if (! DateIsValid($day,$month,$year)) { next; } # If not an existing day, go to next
- my $dayofweekcursor=DayOfWeek($day,$month,$year);
- print "";
- print "| ",Format_Date("$year$month$day"."000000",2)," | ";
- if ($ShowMonthDayStats =~ /V/i) { print "",$DayVisits{$year.$month.$day}?$DayVisits{$year.$month.$day}:"0"," | "; }
- if ($ShowMonthDayStats =~ /P/i) { print "",$DayPages{$year.$month.$day}?$DayPages{$year.$month.$day}:"0"," | "; }
- if ($ShowMonthDayStats =~ /H/i) { print "",$DayHits{$year.$month.$day}?$DayHits{$year.$month.$day}:"0"," | "; }
- if ($ShowMonthDayStats =~ /B/i) { print "",Format_Bytes(int($DayBytes{$year.$month.$day}))," | "; }
- print " \n";
+ if ($AddDataArrayMonthDayStats) {
+ print "\n";
+ print "| $Message[4] | ";
+ if ($ShowMonthDayStats =~ /V/i) { print "$Message[10] | "; }
+ if ($ShowMonthDayStats =~ /P/i) { print "$Message[56] | "; }
+ if ($ShowMonthDayStats =~ /H/i) { print "$Message[57] | "; }
+ if ($ShowMonthDayStats =~ /B/i) { print "$Message[75] | "; }
+ foreach my $daycursor ($firstdaytoshowtime..$lastdaytoshowtime) {
+ $daycursor =~ /^(\d\d\d\d)(\d\d)(\d\d)/;
+ my $year=$1; my $month=$2; my $day=$3;
+ if (! DateIsValid($day,$month,$year)) { next; } # If not an existing day, go to next
+ my $dayofweekcursor=DayOfWeek($day,$month,$year);
+ print "";
+ print "| ",Format_Date("$year$month$day"."000000",2)," | ";
+ if ($ShowMonthDayStats =~ /V/i) { print "",$DayVisits{$year.$month.$day}?$DayVisits{$year.$month.$day}:"0"," | "; }
+ if ($ShowMonthDayStats =~ /P/i) { print "",$DayPages{$year.$month.$day}?$DayPages{$year.$month.$day}:"0"," | "; }
+ if ($ShowMonthDayStats =~ /H/i) { print "",$DayHits{$year.$month.$day}?$DayHits{$year.$month.$day}:"0"," | "; }
+ if ($ShowMonthDayStats =~ /B/i) { print "",Format_Bytes(int($DayBytes{$year.$month.$day}))," | "; }
+ print " \n";
+ }
+ # Average row
+ print "| $Message[96] | ";
+ if ($ShowMonthDayStats =~ /V/i) { print "$average_v | "; }
+ if ($ShowMonthDayStats =~ /P/i) { print "$average_p | "; }
+ if ($ShowMonthDayStats =~ /H/i) { print "$average_h | "; }
+ if ($ShowMonthDayStats =~ /B/i) { print "$average_k | "; }
+ print " \n";
+ # Total row
+ print "| $Message[102] | ";
+ if ($ShowMonthDayStats =~ /V/i) { print "$total_v | "; }
+ if ($ShowMonthDayStats =~ /P/i) { print "$total_p | "; }
+ if ($ShowMonthDayStats =~ /H/i) { print "$total_h | "; }
+ if ($ShowMonthDayStats =~ /B/i) { print "".Format_Bytes($total_k)." | "; }
+ print " \n";
+ print " \n ";
}
- # Average row
- print "| $Message[96] | ";
- if ($ShowMonthDayStats =~ /V/i) { print "$average_v | "; }
- if ($ShowMonthDayStats =~ /P/i) { print "$average_p | "; }
- if ($ShowMonthDayStats =~ /H/i) { print "$average_h | "; }
- if ($ShowMonthDayStats =~ /B/i) { print "$average_k | "; }
- print " \n";
- # Total row
- print "| $Message[102] | ";
- if ($ShowMonthDayStats =~ /V/i) { print "$total_v | "; }
- if ($ShowMonthDayStats =~ /P/i) { print "$total_p | "; }
- if ($ShowMonthDayStats =~ /H/i) { print "$total_h | "; }
- if ($ShowMonthDayStats =~ /B/i) { print "".Format_Bytes($total_k)." | "; }
- print " \n";
-
- print " \n ";
-
+
print "\n";
print " | \n";
&tab_end;
@@ -7440,21 +7452,23 @@ EOF
print "
\n";
# Show data array for days of week
- print "\n";
- print "| $Message[4] | ";
- if ($ShowDaysOfWeekStats =~ /P/i) { print "$Message[56] | "; }
- if ($ShowDaysOfWeekStats =~ /H/i) { print "$Message[57] | "; }
- if ($ShowDaysOfWeekStats =~ /B/i) { print "$Message[75] |
"; }
- for (@DOWIndex) {
- print "";
- print "| ".$Message[$_+84]." | ";
- if ($ShowDaysOfWeekStats =~ /P/i) { print "",$avg_dayofweek_p[$_]," | "; }
- if ($ShowDaysOfWeekStats =~ /H/i) { print "",$avg_dayofweek_h[$_]," | "; }
- if ($ShowDaysOfWeekStats =~ /B/i) { print "",Format_Bytes($avg_dayofweek_k[$_])," | "; }
- print "
\n";
+ if ($AddDataArrayShowDaysOfWeekStats) {
+ print "\n";
+ print "| $Message[4] | ";
+ if ($ShowDaysOfWeekStats =~ /P/i) { print "$Message[56] | "; }
+ if ($ShowDaysOfWeekStats =~ /H/i) { print "$Message[57] | "; }
+ if ($ShowDaysOfWeekStats =~ /B/i) { print "$Message[75] |
"; }
+ for (@DOWIndex) {
+ print "";
+ print "| ".$Message[$_+84]." | ";
+ if ($ShowDaysOfWeekStats =~ /P/i) { print "",$avg_dayofweek_p[$_]," | "; }
+ if ($ShowDaysOfWeekStats =~ /H/i) { print "",$avg_dayofweek_h[$_]," | "; }
+ if ($ShowDaysOfWeekStats =~ /B/i) { print "",Format_Bytes($avg_dayofweek_k[$_])," | "; }
+ print "
\n";
+ }
+ print "
\n
\n";
}
- print "
\n
\n";
-
+
print "";
print "\n";
&tab_end;
@@ -7506,42 +7520,45 @@ EOF
print "
\n";
# Show data array for hours
- print "\n";
- print "\n";
- print "| $Message[20] | ";
- if ($ShowHoursStats =~ /P/i) { print "$Message[56] | "; }
- if ($ShowHoursStats =~ /H/i) { print "$Message[57] | "; }
- if ($ShowHoursStats =~ /B/i) { print "$Message[75] | "; }
- print " ";
- for (my $ix=0; $ix<=11; $ix++) {
- my $monthix=($ix<10?"0$ix":"$ix");
- print "";
- print "| $monthix | ";
- if ($ShowHoursStats =~ /P/i) { print "",$_time_p[$monthix]?$_time_p[$monthix]:"0"," | "; }
- if ($ShowHoursStats =~ /H/i) { print "",$_time_h[$monthix]?$_time_h[$monthix]:"0"," | "; }
- if ($ShowHoursStats =~ /B/i) { print "",Format_Bytes(int($_time_k[$monthix]))," | "; }
- print " \n";
- }
- print " \n";
- print " | \n";
- print "\n";
- print "| $Message[20] | ";
- if ($ShowHoursStats =~ /P/i) { print "$Message[56] | "; }
- if ($ShowHoursStats =~ /H/i) { print "$Message[57] | "; }
- if ($ShowHoursStats =~ /B/i) { print "$Message[75] | "; }
- print " \n";
- for (my $ix=12; $ix<=23; $ix++) {
- my $monthix=($ix<10?"0$ix":"$ix");
- print "";
- print "| $monthix | ";
- if ($ShowHoursStats =~ /P/i) { print "",$_time_p[$monthix]?$_time_p[$monthix]:"0"," | "; }
- if ($ShowHoursStats =~ /H/i) { print "",$_time_h[$monthix]?$_time_h[$monthix]:"0"," | "; }
- if ($ShowHoursStats =~ /B/i) { print "",Format_Bytes(int($_time_k[$monthix]))," | "; }
+ if ($AddDataArrayShowHoursStats) {
+ print "\n";
+ print "\n";
+ print "| $Message[20] | ";
+ if ($ShowHoursStats =~ /P/i) { print "$Message[56] | "; }
+ if ($ShowHoursStats =~ /H/i) { print "$Message[57] | "; }
+ if ($ShowHoursStats =~ /B/i) { print "$Message[75] | "; }
+ print " ";
+ for (my $ix=0; $ix<=11; $ix++) {
+ my $monthix=($ix<10?"0$ix":"$ix");
+ print "";
+ print "| $monthix | ";
+ if ($ShowHoursStats =~ /P/i) { print "",$_time_p[$monthix]?$_time_p[$monthix]:"0"," | "; }
+ if ($ShowHoursStats =~ /H/i) { print "",$_time_h[$monthix]?$_time_h[$monthix]:"0"," | "; }
+ if ($ShowHoursStats =~ /B/i) { print "",Format_Bytes(int($_time_k[$monthix]))," | "; }
+ print " \n";
+ }
+ print " \n";
+ print " | \n";
+ print "\n";
+ print "| $Message[20] | ";
+ if ($ShowHoursStats =~ /P/i) { print "$Message[56] | "; }
+ if ($ShowHoursStats =~ /H/i) { print "$Message[57] | "; }
+ if ($ShowHoursStats =~ /B/i) { print "$Message[75] | "; }
print " \n";
+ for (my $ix=12; $ix<=23; $ix++) {
+ my $monthix=($ix<10?"0$ix":"$ix");
+ print "";
+ print "| $monthix | ";
+ if ($ShowHoursStats =~ /P/i) { print "",$_time_p[$monthix]?$_time_p[$monthix]:"0"," | "; }
+ if ($ShowHoursStats =~ /H/i) { print "",$_time_h[$monthix]?$_time_h[$monthix]:"0"," | "; }
+ if ($ShowHoursStats =~ /B/i) { print "",Format_Bytes(int($_time_k[$monthix]))," | "; }
+ print " \n";
+ }
+ print " \n";
+ print " | \n";
+ print " \n \n";
}
- print " \n";
- print " |
\n
\n";
-
+
print "\n";
&tab_end;
}
@@ -7565,7 +7582,7 @@ EOF
$max_h=1; foreach my $key (values %_domener_h) { if ($key > $max_h) { $max_h = $key; } }
$max_k=1; foreach my $key (values %_domener_k) { if ($key > $max_k) { $max_k = $key; } }
my $count=0;
- &BuildKeyList($MaxNbOfDomain,1,\%_domener_p,\%_domener_p);
+ &BuildKeyList($MaxNbOfDomain,$MinHitDomain,\%_domener_p,\%_domener_p);
foreach my $key (@keylist) {
my $bredde_p=0;my $bredde_h=0;my $bredde_k=0;
if ($max_h > 0) { $bredde_p=int($BarWidth*$_domener_p{$key}/$max_h)+1; } # use max_h to enable to compare pages with hits
@@ -7890,7 +7907,59 @@ EOF
&tab_end;
}
- # BY URL
+ # BY FILE TYPE
+ #-------------------------
+ if ($ShowFileTypesStats) {
+ if ($Debug) { debug("ShowFileTypesStatsCompressionStats",2); }
+ print "$Center
\n";
+ my $Totalh=0; foreach my $key (keys %_filetypes_h) { $Totalh+=$_filetypes_h{$key}; }
+ my $Totalk=0; foreach my $key (keys %_filetypes_k) { $Totalk+=$_filetypes_k{$key}; }
+ my $title="$Message[73]";
+ if ($ShowFileTypesStats =~ /C/i) { $title.=" - $Message[98]"; }
+ &tab_head("$title",19);
+ print "| $Message[73] | ";
+ if ($ShowFileTypesStats =~ /H/i) { print " $Message[57] | $Message[15] | "; }
+ if ($ShowFileTypesStats =~ /B/i) { print "$Message[75] | "; }
+ if ($ShowFileTypesStats =~ /C/i) { print "$Message[100] | $Message[101] | $Message[99] | "; }
+ print "
\n";
+ my $count=0;
+ &BuildKeyList($MaxRowsInHTMLOutput,1,\%_filetypes_h,\%_filetypes_h);
+ foreach my $key (@keylist) {
+ my $p=int($_filetypes_h{$key}/$Totalh*1000)/10;
+ if ($key eq 'Unknown') {
+ print " | $Message[0] | ";
+ print " | ";
+ }
+ else {
+ my $nameicon=$MimeHashIcon{$key}||"notavailable";
+ my $nametype=$MimeHashLib{$MimeHashFamily{$key}||""}||" ";
+ print "
 | $key | ";
+ print "$nametype | ";
+ }
+ if ($ShowFileTypesStats =~ /H/i) { print "$_filetypes_h{$key} | $p % | "; }
+ if ($ShowFileTypesStats =~ /B/i) { print "".Format_Bytes($_filetypes_k{$key})." | "; }
+ if ($ShowFileTypesStats =~ /C/i) {
+ if ($_filetypes_gz_in{$key}) {
+ my $percent=int(100*(1-$_filetypes_gz_out{$key}/$_filetypes_gz_in{$key}));
+ printf("%s | %s | %s (%s%) | ",Format_Bytes($_filetypes_gz_in{$key}),Format_Bytes($_filetypes_gz_out{$key}),Format_Bytes($_filetypes_gz_in{$key}-$_filetypes_gz_out{$key}),$percent);
+ }
+ else {
+ print " | | | ";
+ }
+ }
+ print "
\n";
+ $count++;
+ }
+ &tab_end;
+ }
+
+ # BY FILE SIZE
+ #-------------------------
+ if ($ShowFileSizesStats) {
+
+ }
+
+ # BY FILE/URL
#-------------------------
if ($ShowPagesStats) {
if ($Debug) { debug("ShowPagesStats (MaxNbOfPageShown=$MaxNbOfPageShown TotalDifferentPages=$TotalDifferentPages)",2); }
@@ -7972,54 +8041,6 @@ EOF
&tab_end;
}
- # BY FILE TYPE
- #-------------------------
- if ($ShowFileTypesStats) {
- if ($Debug) { debug("ShowFileTypesStatsCompressionStats",2); }
- print "$Center
\n";
- my $Totalh=0; foreach my $key (keys %_filetypes_h) { $Totalh+=$_filetypes_h{$key}; }
- my $Totalk=0; foreach my $key (keys %_filetypes_k) { $Totalk+=$_filetypes_k{$key}; }
- my $title="$Message[73]";
- if ($ShowFileTypesStats =~ /C/i) { $title.=" - $Message[98]"; }
- &tab_head("$title",19);
- print "| $Message[73] | ";
- if ($ShowFileTypesStats =~ /H/i) { print " $Message[57] | $Message[15] | "; }
- if ($ShowFileTypesStats =~ /B/i) { print "$Message[75] | "; }
- if ($ShowFileTypesStats =~ /C/i) { print "$Message[100] | $Message[101] | $Message[99] | "; }
- print "
\n";
- my $count=0;
- &BuildKeyList($MaxRowsInHTMLOutput,1,\%_filetypes_h,\%_filetypes_h);
- foreach my $key (@keylist) {
- my $p=int($_filetypes_h{$key}/$Totalh*1000)/10;
- if ($key eq 'Unknown') {
- print "| $Message[0] | ";
- }
- else {
- print "
| $key | ";
- }
- if ($ShowFileTypesStats =~ /H/i) { print "$_filetypes_h{$key} | $p % | "; }
- if ($ShowFileTypesStats =~ /B/i) { print "".Format_Bytes($_filetypes_k{$key})." | "; }
- if ($ShowFileTypesStats =~ /C/i) {
- if ($_filetypes_gz_in{$key}) {
- my $percent=int(100*(1-$_filetypes_gz_out{$key}/$_filetypes_gz_in{$key}));
- printf("%s | %s | %s (%s%) | ",Format_Bytes($_filetypes_gz_in{$key}),Format_Bytes($_filetypes_gz_out{$key}),Format_Bytes($_filetypes_gz_in{$key}-$_filetypes_gz_out{$key}),$percent);
- }
- else {
- print " | | | ";
- }
- }
- print "
\n";
- $count++;
- }
- &tab_end;
- }
-
- # BY FILE SIZE
- #-------------------------
- if ($ShowFileSizesStats) {
-
- }
-
# BY OS
#----------------------------
if ($ShowOSStats) {
@@ -8033,13 +8054,13 @@ EOF
foreach my $key (@keylist) {
my $p=int($_os_h{$key}/$Total*1000)/10;
if ($key eq 'Unknown') {
- print "![\"$Message[0]\"](\"$DirIcons\/os\/unknown.png\") | $Message[0] | $_os_h{$key} | ";
+ print "
![\"$Message[0]\"](\"$DirIcons\/os\/unknown.png\") | $Message[0] | $_os_h{$key} | ";
print "$p % |
\n";
}
else {
my $newos=$OSHashLib{$key}||$key;
my $nameicon=lc($key); $nameicon =~ s/[^\w]+//g;
- print " | $newos | $_os_h{$key} | ";
+ print "
 | $newos | $_os_h{$key} | ";
print "$p % |
\n";
}
$count++;
@@ -8066,7 +8087,7 @@ EOF
foreach my $key (@keylist) {
my $p=int($new_browser_h{$key}/$Total*1000)/10;
if ($key eq 'Unknown') {
- print "![\"$Message[0]\"](\"$DirIcons\/browser\/unknown.png\") | $Message[0] | ? | $_browser_h{$key} | $p% |
\n";
+ print "![\"$Message[0]\"](\"$DirIcons\/browser\/unknown.png\") | $Message[0] | ? | $_browser_h{$key} | $p% |
\n";
}
else {
my $keywithoutcumul=$key; $keywithoutcumul =~ s/cumul$//i;
@@ -8074,7 +8095,7 @@ EOF
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";
+ print " | $libbrowser | ".($BrowsersHereAreGrabbers{$key}?"$Message[112]":"$Message[113]")." | $new_browser_h{$key} | $p % |
\n";
}
$count++;
}