From: eldy <> Date: Sat, 10 Mar 2001 00:01:02 +0000 (+0000) Subject: Add an optionnal limit for number of shown domains X-Git-Tag: AWSTATS_1_0~330 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4986908d179369994dbbc19bbb196afd46b7bf8;p=thirdparty%2FAWStats.git Add an optionnal limit for number of shown domains --- diff --git a/awstats.model.conf b/awstats.model.conf index 4e238ca3..709081b8 100644 --- a/awstats.model.conf +++ b/awstats.model.conf @@ -167,6 +167,8 @@ BarHeight = 220 # This value can be used to choose maximum number of lines shown for each # particular reporting. # +# Stats by domains +MaxNbOfDomain = 25 # Stats by hosts MaxNbOfHostsShown = 25 MinHitHost = 1 diff --git a/awstats.pl b/awstats.pl index c2bd3fb2..53567634 100644 --- a/awstats.pl +++ b/awstats.pl @@ -14,7 +14,7 @@ #------------------------------------------------------- # Defines #------------------------------------------------------- -$VERSION="2.24 (build 14)"; +$VERSION="2.24 (build 16)"; $Lang=0; # Default value @@ -208,7 +208,7 @@ $message[72][0]="English us.png"; # French $message[0][1]="Inconnus"; $message[1][1]="Inconnu (IP non résolue)"; -$message[2][1]="Autres visiteurs"; +$message[2][1]="Autres"; $message[3][1]="Voir détails"; $message[4][1]="Jour"; $message[5][1]="Mois"; @@ -283,7 +283,7 @@ $message[72][1]="French fr.png"; # Dutch $message[0][2]="Onbekend"; $message[1][2]="Onbekend (Onbekend ip)"; -$message[2][2]="Andere bezoekers"; +$message[2][2]="Andere"; $message[3][2]="Bekijk details"; $message[4][2]="Dag"; $message[5][2]="Maand"; @@ -358,7 +358,7 @@ $message[72][2]="Dutch nl.png"; # Spanish $message[0][3]="Desconocido"; $message[1][3]="Dirección IP desconocida"; -$message[2][3]="Otros visitantes"; +$message[2][3]="Otros"; $message[3][3]="Vea detalles"; $message[4][3]="Día"; $message[5][3]="Mes"; @@ -433,7 +433,7 @@ $message[72][3]="Spanish es.png"; # Italian $message[0][4]="Sconosciuto"; $message[1][4]="Sconosciuto (ip non risolto)"; -$message[2][4]="Altri visitatori"; +$message[2][4]="Altri"; $message[3][4]="Vedi dettagli"; $message[4][4]="Giorno"; $message[5][4]="Mese"; @@ -508,7 +508,7 @@ $message[72][4]="Italian it.png"; # German $message[0][5]="Unbekannt"; $message[1][5]="IP konnte nicht aufgeloest werden"; -$message[2][5]="Sonstige Besucher"; +$message[2][5]="Sonstige"; $message[3][5]="Details"; $message[4][5]="Tag"; $message[5][5]="Monat"; @@ -584,7 +584,7 @@ $message[72][5]="German de.png"; $PageCode[6]=""; $message[0][6]="Nieznany"; $message[1][6]="Nieznany (brak odwzorowania IP w DNS)"; -$message[2][6]="Inni go¶cie"; +$message[2][6]="Inni"; $message[3][6]="Szczegó³y..."; $message[4][6]="Dzieñ"; $message[5][6]="Miesi±c"; @@ -660,7 +660,7 @@ $message[72][6]="Polish pl.png"; $PageCode[7]=""; $message[0][7]="¶ãíùóôï"; $message[1][7]="¶ãíùóôï (ìç áíáãíùñéóìÝíç ip)"; -$message[2][7]="¶ëëïé åðéóêÝðôåò"; +$message[2][7]="¶ëëïé"; $message[3][7]="ÅìöÜíéóç ëåðôïìåñéþí"; $message[4][7]="ÇìÝñá"; $message[5][7]="ÌÞíáò"; @@ -1241,6 +1241,7 @@ sub UnescapeURLParam { $_[0] =~ s/%2e/\./gi; #. $_[0] =~ s/%2f/ /gi; #/ $_[0] =~ s/%3a/:/gi; #: + $_[0] =~ s/%3b/;/gi; #; $_[0] =~ s/%3c/ /gi; #< $_[0] =~ s/%3d/ /gi; #= $_[0] =~ s/%3e/ /gi; #> @@ -1332,6 +1333,7 @@ sub Read_Config_File { if ($param =~ /^HTMLEndSection/) { $HTMLEndSection=$value; next; } if ($param =~ /^BarWidth/) { $BarWidth=$value; next; } if ($param =~ /^BarHeight/) { $BarHeight=$value; next; } + if ($param =~ /^MaxNbOfDomain/) { $MaxNbOfDomain=$value; next; } if ($param =~ /^MaxNbOfHostsShown/) { $MaxNbOfHostsShown=$value; next; } if ($param =~ /^MinHitHost/) { $MinHitHost=$value; next; } if ($param =~ /^MaxNbOfRobotShown/) { $MaxNbOfRobotShown=$value; next; } @@ -1379,6 +1381,7 @@ sub Check_Config { if (! ($ShowFlagLinks =~ /[0-1]/)) { $ShowFlagLinks=1; } if (! ($BarWidth =~ /[\d]/)) { $BarWidth=260; } if (! ($BarHeight =~ /[\d]/)) { $BarHeight=220; } + if (! ($MaxNbOfDomain =~ /[\d]/)) { $MaxNbOfDomain=25; } if (! ($MaxNbOfHostsShown =~ /[\d]/)) { $MaxNbOfHostsShown=25; } if (! ($MinHitHost =~ /[\d]/)) { $MinHitHost=1; } if (! ($MaxNbOfRobotShown =~ /[\d]/)) { $MaxNbOfRobotShown=25; } @@ -1688,7 +1691,7 @@ $LogFileWithoutLog=$LogFile;$LogFileWithoutLog =~ s/\.log$//; # monthnum must be in english because it's used to translate log date in log files which are always in english %monthnum = ( "Jan","01","Feb","02","Mar","03","Apr","04","May","05","Jun","06","Jul","07","Aug","08","Sep","09","Oct","10","Nov","11","Dec","12" ); -($nowsec,$nowmin,$nowmin,$nowday,$nowmonth,$nowyear,$nowwday,$nowyday,$nowisdst) = localtime(time); +($nowsec,$nowmin,$nowhour,$nowday,$nowmonth,$nowyear,$nowwday,$nowyday,$nowisdst) = localtime(time); if ($nowyear < 100) { $nowyear+=2000; } else { $nowyear+=1900; } $nowsmallyear=$nowyear;$nowsmallyear =~ s/^..//; if (++$nowmonth < 10) { $nowmonth = "0$nowmonth"; } @@ -2901,6 +2904,7 @@ if ($SortDir<0) { $max_h=$_domener_h{$sortdomains_h[0]}; } else { $max_h=$_domener_h{$sortdomains_h[$#sortdomains_h]}; } if ($SortDir<0) { $max_k=$_domener_k{$sortdomains_k[0]}; } else { $max_k=$_domener_k{$sortdomains_k[$#sortdomains_k]}; } +$count=0;$total_p=0;$total_h=0;$total_k=0; foreach $key (@sortdomains_p) { if ($max_h > 0) { $bredde_p=$BarWidth*$_domener_p{$key}/$max_h+1; } # use max_h to enable to compare pages with hits if ($max_h > 0) { $bredde_h=$BarWidth*$_domener_h{$key}/$max_h+1; } @@ -2918,7 +2922,23 @@ foreach $key (@sortdomains_p) { print "\"$message[57][$Lang]:
\n"; print "\"$message[44][$Lang]:"; print "\n"; + $total_p += $_domener_p{$key}; + $total_h += $_domener_h{$key}; + $total_k += $_domener_k{$key}; + $count++; + if ($count >= $MaxNbOfDomain) { last; } } +$rest_p=$TotalPages-$total_p; +$rest_h=$TotalHits-$total_h; +$rest_k=int((($TotalBytes-$total_k)/1024)*100)/100; +if ($rest_p > 0) { # All other domains (known or not) + print "$message[2][$Lang]$rest_p$rest_h$rest_k\n"; + print ""; + print "\"$message[56][$Lang]:
\n"; + print "\"$message[57][$Lang]:
\n"; + print "\"$message[44][$Lang]:"; + print "\n"; + } &tab_end; @@ -2931,33 +2951,32 @@ print "$message[18][$Lang]=$MinHitHost) { - $kilo=int(($_hostmachine_k{$key}/1024)*100)/100; - if ($key eq "Unknown") { - print "$message[1][$Lang]$_hostmachine_p{$key}$_hostmachine_h{$key}$kilo$message[3][$Lang]\n"; - } - else { - $yearcon=substr($_hostmachine_l{$key},0,4); - $monthcon=substr($_hostmachine_l{$key},4,2); - $daycon=substr($_hostmachine_l{$key},6,2); - $hourcon=substr($_hostmachine_l{$key},8,2); - $mincon=substr($_hostmachine_l{$key},10,2); - print "$key$_hostmachine_p{$key}$_hostmachine_h{$key}$kilo"; - if ($daycon ne "") { - if ($Lang != 0) { print "$daycon/$monthcon/$yearcon - $hourcon:$mincon"; } - else { print "$daycon $monthlib{$monthcon} $yearcon - $hourcon:$mincon"; } - } + if ($_hostmachine_h{$key}>=$MinHitHost) { + $kilo=int(($_hostmachine_k{$key}/1024)*100)/100; + if ($key eq "Unknown") { + print "$message[1][$Lang]$_hostmachine_p{$key}$_hostmachine_h{$key}$kilo$message[3][$Lang]\n"; + } else { - print "-"; + $yearcon=substr($_hostmachine_l{$key},0,4); + $monthcon=substr($_hostmachine_l{$key},4,2); + $daycon=substr($_hostmachine_l{$key},6,2); + $hourcon=substr($_hostmachine_l{$key},8,2); + $mincon=substr($_hostmachine_l{$key},10,2); + print "$key$_hostmachine_p{$key}$_hostmachine_h{$key}$kilo"; + if ($daycon ne "") { + if ($Lang != 0) { print "$daycon/$monthcon/$yearcon - $hourcon:$mincon"; } + else { print "$daycon $monthlib{$monthcon} $yearcon - $hourcon:$mincon"; } + } + else { + print "-"; + } } + $total_p += $_hostmachine_p{$key}; + $total_h += $_hostmachine_h{$key}; + $total_k += $_hostmachine_k{$key}; } - - $total_p += $_hostmachine_p{$key}; - $total_h += $_hostmachine_h{$key}; - $total_k += $_hostmachine_k{$key}; - } - $count++; - if (!(($SortDir<0 && $count<$MaxNbOfHostsShown) || ($SortDir>0 && $#sorthosts_p-$MaxNbOfHostsShown < $count))) { last; } + $count++; + if (!(($SortDir<0 && $count<$MaxNbOfHostsShown) || ($SortDir>0 && $#sorthosts_p-$MaxNbOfHostsShown < $count))) { last; } } $rest_p=$TotalPages-$total_p; $rest_h=$TotalHits-$total_h; @@ -3188,4 +3207,3 @@ foreach $key (@sorterrors) { &html_end; 0; # Do not remove this line -