From: eldy <> Date: Sat, 23 Mar 2002 22:23:35 +0000 (+0000) Subject: New parameter: StyleSheet X-Git-Tag: AWSTATS_4_0_BETA~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8b3e27f8d070c2e57a635fa2949ee07e784d722;p=thirdparty%2FAWStats.git New parameter: StyleSheet New parameter: WrapperScript --- diff --git a/docs/awstats_config.html b/docs/awstats_config.html index 1aa223f6..af1e100d 100644 --- a/docs/awstats_config.html +++ b/docs/awstats_config.html @@ -76,6 +76,7 @@ it with its value when reading it), follow the example:
  • NbOfLinesForCorruptedLog
  • SplitSearchString
  • Expires +
  • WrapperScript
    OPTIONAL ACCURACY SETUP SECTION (Not required but increase AWStats features)
    @@ -602,6 +603,18 @@ it with its value when reading it), follow the example:



    +WrapperScript
    +Version : 4.0 +
    +
    # For some particular integration needs, you may want to have CGI links to +
    # point to another script than awstats.pl. +
    # Use the name of this script in WrapperScript parameter. +
    # Example: "awstatslauncher.pl" +
    # Default: "" +
    # +
    WrapperScript="" + +


    + LevelFor
    Version : 4.0 +

    # You can change value for following option to increase AWStats capabilities diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index 8b968edb..3dfd0b51 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -340,6 +340,14 @@ SplitSearchString=0 # Expires=0 +# For some particular integration needs, you may want to have CGI links to +# point to another script than awstats.pl. +# Use the name of this script in WrapperScript parameter. +# Example: "awstatslauncher.pl" +# Default: "" +# +WrapperScript="" + #----------------------------------------------------------------------------- # OPTIONAL ACCURACY SETUP SECTION (Not required but increase AWStats features) @@ -490,7 +498,7 @@ BarWidth = 260 BarHeight = 180 # You can ask AWStats to use a particular CSS (Cascading Style Sheet) to -# change its look (Feature not yet available). +# change its look. # Example: "/css/awstats.css" # Default: "" # diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index e5afcb5f..f4c3da27 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -21,11 +21,12 @@ use vars qw(%DomainsHashIDLib @RobotsSearchIDOrder_list1 @RobotsSearchIDOrder_li #------------------------------------------------------- # Defines #------------------------------------------------------- -my $VERSION="4.0 (build 53)"; +my $VERSION="4.0 (build 55)"; # ---------- Init variables ------- my $Debug=0; my $ShowSteps=0; +my $AWScript; my $DIR; my $PROG; my $Extension; @@ -89,6 +90,7 @@ $HTMLHeadSection, $HTMLEndSection, $HTMLOutput, $Host, $LastUpdate, $LogFile, $LogFormat, $LogFormatString, $Logo, $LogoLink, $MonthRequired, $PageCode, $PerlParsingFormat, $QueryString, $SiteConfig, $SiteDomain, $SiteToAnalyze, $SiteToAnalyzeWithoutwww, +$StyleSheet, $WrapperScript, $TotalEntries, $TotalBytesPages, $TotalKeyphrases, $TotalDifferentPages, $TotalDifferentKeyphrases, $URLFilter, $UserAgent, $YearRequired)= (); @@ -246,6 +248,10 @@ DIV { font: 12px arial,verdana,helvetica; text-align:justify; } //--> EOF + if ($StyleSheet) { + print "\n"; + } + print "\n\n"; print "\n"; # Write logo, flags and product name @@ -548,6 +554,7 @@ sub Read_Config_File { if ($param =~ /^NbOfLinesForCorruptedLog/) { $NbOfLinesForCorruptedLog=$value; next; } if ($param =~ /^SplitSearchString/) { $SplitSearchString=$value; next; } if ($param =~ /^Expires/) { $Expires=$value; next; } + if ($param =~ /^WrapperScript/) { $WrapperScript=$value; next; } # Read optional accuracy setup section if ($param =~ /^LevelForRobotsDetection/) { $LevelForRobotsDetection=$value; next; } # Not used yet if ($param =~ /^LevelForBrowsersDetection/) { $LevelForBrowsersDetection=$value; next; } # Not used yet @@ -602,6 +609,7 @@ sub Read_Config_File { if ($param =~ /^BarHeight/) { $BarHeight=$value; next; } if ($param =~ /^Logo$/) { $Logo=$value; next; } if ($param =~ /^LogoLink/) { $LogoLink=$value; next; } + if ($param =~ /^StyleSheet/) { $StyleSheet=$value; next; } if ($param =~ /^color_Background/) { $color_Background=$value; next; } if ($param =~ /^color_TableTitle/) { $color_TableTitle=$value; next; } if ($param =~ /^color_TableBGTitle/) { $color_TableBGTitle=$value; next; } @@ -1953,7 +1961,7 @@ sub Show_Flag_Links { if ($flag eq "it") { $lng="Italian"; } if ($flag eq "nl") { $lng="Dutch"; } if ($flag eq "es") { $lng="Spanish"; } - print "\"$lng\" \n"; + print "\"$lng\" \n"; } } } @@ -2366,6 +2374,9 @@ $SiteToAnalyzeWithoutwww = $SiteToAnalyze; $SiteToAnalyzeWithoutwww =~ s/www\.// if ($FirstDayOfWeek == 1) { @DOWIndex = (1,2,3,4,5,6,0); } else { @DOWIndex = (0,1,2,3,4,5,6); } +# Should we link to ourselves or to a wrapper script +$AWScript=($WrapperScript?"$WrapperScript":"$DirCgi$PROG.$Extension"); + # Check year and month parameters if ($QueryString =~ /year=/i) { $YearRequired=$QueryString; $YearRequired =~ s/.*year=//; $YearRequired =~ s/&.*//; $YearRequired =~ s/ .*//; } if ((! $YearRequired) || ($YearRequired !~ /^\d\d\d\d$/)) { $YearRequired=$nowyear; } @@ -3514,7 +3525,7 @@ EOF $NewLinkParams =~ s/staticlinks[=]*[^ &]*//; $NewLinkParams =~ tr/&/&/s; $NewLinkParams =~ s/^&//; $NewLinkParams =~ s/&$//; if ($NewLinkParams) { $NewLinkParams="${NewLinkParams}&"; } - print "$Message[74]"; + print "$Message[74]"; } print "\n"; if ($QueryString !~ /output=/i) { # If main page asked @@ -3530,22 +3541,22 @@ EOF print ""; if ($ShowDomainsStats) { print "$Message[17]   "; } if ($ShowHostsStats) { print "".ucfirst($Message[81])."   "; } - if ($ShowHostsStats) { print "$Message[9]  \n"; } - if ($ShowHostsStats) { print "$Message[45]  \n"; } + if ($ShowHostsStats) { print "$Message[9]  \n"; } + if ($ShowHostsStats) { print "$Message[45]  \n"; } if ($ShowAuthenticatedUsers) { print "$Message[94]   "; } if ($ShowRobotsStats) { print "$Message[53]   "; } print "
    "; # Navigation print "$Message[72] : "; print ""; - if ($ShowPagesStats) { print "$Message[29]   "; } + if ($ShowPagesStats) { print "$Message[29]   "; } if ($ShowPagesStats) { print "$Message[104]   "; } if ($ShowFileTypesStats) { print "$Message[73]   "; } if ($ShowFileSizesStats) { } if ($ShowOSStats) { print "$Message[59]   "; } if ($ShowBrowsersStats) { print "$Message[21]   "; } - if ($ShowBrowsersStats) { print "$Message[33]   "; } - if ($ShowBrowsersStats) { print "$Message[34]
    \n"; } + if ($ShowBrowsersStats) { print "$Message[33]   "; } + if ($ShowBrowsersStats) { print "$Message[34]
    \n"; } # Referers print "$Message[23] : "; print ""; @@ -3556,11 +3567,11 @@ EOF print ""; if ($ShowCompressionStats) { print "$Message[98]   "; } if ($ShowHTTPErrorsStats) { print "$Message[22]   "; } - if ($ShowHTTPErrorsStats) { print "$Message[31]
    \n"; } + if ($ShowHTTPErrorsStats) { print "$Message[31]
    \n"; } } else { ${NewLinkParams} =~ s/&+$//; - if ($ShowBackLink) { print "$Message[76]\n"; } + if ($ShowBackLink) { print "$Message[76]\n"; } } print "\n"; print "
    \n"; @@ -3846,7 +3857,7 @@ EOF if ($NewLinkParams) { $NewLinkParams="${NewLinkParams}&"; } foreach my $key (sort keys %listofyears) { if ($ENV{"GATEWAY_INTERFACE"} || !$StaticLinks) { - print "$Message[6] $key   "; + print "$Message[6] $key   "; } } print ""; @@ -3912,7 +3923,7 @@ EOF for (my $ix=1; $ix<=12; $ix++) { my $monthix=$ix; if ($monthix < 10) { $monthix="0$monthix"; } print ""; - if ($ENV{"GATEWAY_INTERFACE"} || !$StaticLinks) { print ""; } + if ($ENV{"GATEWAY_INTERFACE"} || !$StaticLinks) { print ""; } print "$monthlib{$monthix}"; if ($ENV{"GATEWAY_INTERFACE"} || !$StaticLinks) { print ""; } print "\n"; @@ -4179,7 +4190,7 @@ EOF if ($Debug) { debug("ShowHostsStats",2); } print "$CENTER 
    "; $MaxNbOfHostsShown = (scalar keys %_hostmachine_h) if $MaxNbOfHostsShown > (scalar keys %_hostmachine_h); - &tab_head("$Message[81] ($Message[77] $MaxNbOfHostsShown)   -   $Message[80]   -   $Message[9]   -   $Message[45]",19); + &tab_head("$Message[81] ($Message[77] $MaxNbOfHostsShown)   -   $Message[80]   -   $Message[9]   -   $Message[45]",19); if ($MonthRequired ne "year") { print "$Message[81] : $TotalHostsKnown $Message[82], $TotalHostsUnknown $Message[1] - $TotalUnique $Message[11]$Message[56]$Message[57]$Message[75]$Message[9]\n"; } else { print "$Message[81] : ".(scalar keys %_hostmachine_h)."$Message[56]$Message[57]$Message[75]$Message[9]\n"; } $total_p=$total_h=$total_k=0; @@ -4266,7 +4277,7 @@ EOF if ($Debug) { debug("ShowPagesStats (MaxNbOfPageShown=$MaxNbOfPageShown TotalDifferentPages=$TotalDifferentPages)",2); } print "$CENTER  
    "; $MaxNbOfPageShown = $TotalDifferentPages if $MaxNbOfPageShown > $TotalDifferentPages; - &tab_head("$Message[19] ($Message[77] $MaxNbOfPageShown)   -   $Message[80]",19); + &tab_head("$Message[19] ($Message[77] $MaxNbOfPageShown)   -   $Message[80]",19); print "$TotalDifferentPages $Message[28]"; print "$Message[29]"; print "$Message[104]"; @@ -4381,8 +4392,8 @@ EOF if ($ShowBrowsersStats) { if ($Debug) { debug("ShowBrowsersStats",2); } print "$CENTER 
    "; - $BrowsersHashIDLib{"netscape"}="Netscape ($Message[58])"; - $BrowsersHashIDLib{"msie"}="MS Internet Explorer ($Message[58])"; + $BrowsersHashIDLib{"netscape"}="Netscape ($Message[58])"; + $BrowsersHashIDLib{"msie"}="MS Internet Explorer ($Message[58])"; my $Total=0; foreach my $key (keys %_browser_h) { $Total+=$_browser_h{$key}; } &tab_head($Message[21],19); print "Browser$Message[111]$Message[57]$Message[15]\n"; @@ -4390,7 +4401,7 @@ EOF foreach my $key (sort { $_browser_h{$b} <=> $_browser_h{$a} } keys (%_browser_h)) { my $p=int($_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=$BrowsersHashIcon{$key}||"notavailable"; $nameicon =~ s/\s.*//; $nameicon =~ tr/A-Z/a-z/; @@ -4414,7 +4425,7 @@ EOF foreach my $key (sort { $_os_h{$b} <=> $_os_h{$a} } keys (%_os_h)) { my $p=int($_os_h{$key}/$Total*1000)/10; if ($key eq "Unknown") { - print "$Message[0]$_os_h{$key}"; + print "$Message[0]$_os_h{$key}"; print "$p %\n"; } else { @@ -4504,7 +4515,7 @@ EOF if ($Debug) { debug("ShowKeyphrasesStats",2); } print "$CENTER 
    "; $MaxNbOfKeywordsShown = $TotalDifferentKeyphrases if $MaxNbOfKeywordsShown > $TotalDifferentKeyphrases; - &tab_head("$Message[43] ($Message[77] $MaxNbOfKeywordsShown)   -   $Message[80]",19); + &tab_head("$Message[43] ($Message[77] $MaxNbOfKeywordsShown)   -   $Message[80]",19); print "$TotalDifferentKeyphrases $Message[103]$Message[14]$Message[15]\n"; $total_s=0; my $count=0; @@ -4539,7 +4550,7 @@ EOF my $p=int($_errors_h{$key}/$TotalErrors*1000)/10; if ($httpcode{$key}) { print ""; } else { print ""; } - if ($key == 404) { print "$key"; } + if ($key == 404) { print "$key"; } else { print "$key"; } if ($httpcode{$key}) { print "$httpcode{$key}$_errors_h{$key}$p %\n"; } else { print "Unknown error$_errors_h{$key}$p %\n"; }