From: eldy <>
Date: Sat, 18 Nov 2000 14:47:56 +0000 (+0000)
Subject: Now domain and page reports are sorted on pages (no more on hit)
X-Git-Tag: AWSTATS_1_0~379
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4e930be5ec7b665203e0bc623ed7f2da6f54406;p=thirdparty%2FAWStats.git
Now domain and page reports are sorted on pages (no more on hit)
---
diff --git a/awstats.pl b/awstats.pl
index cfd420bb..372dd849 100644
--- a/awstats.pl
+++ b/awstats.pl
@@ -2034,6 +2034,13 @@ if ($QueryString =~ /browserdetail/) {
}
&tab_end;
+ &html_end;
+ exit(0);
+ }
+if ($QueryString =~ /info/) {
+ # Not yet available
+ print "
";
+
&html_end;
exit(0);
}
@@ -2041,9 +2048,10 @@ if ($QueryString =~ /browserdetail/) {
if ($BenchMark == 1) { print "Start of sorting: ";print localtime();print "
"; }
@RobotArray=keys %RobotHash;
@SearchEnginesArray=keys %SearchEnginesHash;
+@sortdomains_p=sort { $SortDir*$_domener_p{$a} <=> $SortDir*$_domener_p{$b} } keys (%_domener_p);
@sortdomains_h=sort { $SortDir*$_domener_h{$a} <=> $SortDir*$_domener_h{$b} } keys (%_domener_h);
@sortdomains_k=sort { $SortDir*$_domener_k{$a} <=> $SortDir*$_domener_k{$b} } keys (%_domener_k);
-@sorthosts_h=sort { $SortDir*$_hostmachine_h{$a} <=> $SortDir*$_hostmachine_h{$b} } keys (%_hostmachine_h);
+@sorthosts_p=sort { $SortDir*$_hostmachine_p{$a} <=> $SortDir*$_hostmachine_p{$b} } keys (%_hostmachine_p);
@sortsiders=sort { $SortDir*$_sider_p{$a} <=> $SortDir*$_sider_p{$b} } keys (%_sider_p);
@sortbrowsers=sort { $SortDir*$_browser_h{$a} <=> $SortDir*$_browser_h{$b} } keys (%_browser_h);
@sortos=sort { $SortDir*$_os_h{$a} <=> $SortDir*$_os_h{$b} } keys (%_os_h);
@@ -2561,11 +2569,10 @@ 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]}; }
-foreach $key (@sortdomains_h) {
+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; }
if ($max_k > 0) { $bredde_k=$BarWidth*$_domener_k{$key}/$max_k+1; }
- $page=$_domener_p{$key};if ($page eq "") { $page=0; }
$kilo=int(($_domener_k{$key}/1024)*100)/100;
if ($key eq "ip") {
print " | $message[0][$Lang] | $key | ";
@@ -2573,7 +2580,7 @@ foreach $key (@sortdomains_h) {
else {
print "
 | $DomainsHash{$key} | $key | ";
}
- print "$page | $_domener_h{$key} | $kilo | ";
+ print "$_domener_p{$key} | $_domener_h{$key} | $kilo | ";
print "";
print "![\"$message[56][$Lang]:](\"$DirIcons\/other\/$BarImageHorizontal_p\") \n";
print "![\"$message[57][$Lang]:](\"$DirIcons\/other\/$BarImageHorizontal_h\") \n";
@@ -2590,13 +2597,12 @@ $tab_titre="TOP $MaxNbOfHostsShown $message[55][$Lang] $TotalHosts $message[26][
&tab_head;
print " |
| $message[18][$Lang] | $message[56][$Lang] | $message[57][$Lang] | $message[44][$Lang] | $message[9][$Lang] |
\n";
$count=0;$total_p=0;$total_h=0;$total_k=0;
-foreach $key (@sorthosts_h)
+foreach $key (@sorthosts_p)
{
if ($_hostmachine_h{$key}>=$MinHitHost) {
- $page=$_hostmachine_p{$key};if ($page eq "") { $page=0; }
$kilo=int(($_hostmachine_k{$key}/1024)*100)/100;
if ($key eq "Unknown") {
- print "| $message[1][$Lang] | $page | $_hostmachine_h{$key} | $kilo | $message[3][$Lang] |
\n";
+ print "| $message[1][$Lang] | $_hostmachine_p{$key} | $_hostmachine_h{$key} | $kilo | $message[3][$Lang] |
\n";
}
else {
$yearcon=substr($_hostmachine_l{$key},0,4);
@@ -2604,7 +2610,7 @@ foreach $key (@sorthosts_h)
$daycon=substr($_hostmachine_l{$key},6,2);
$hourcon=substr($_hostmachine_l{$key},8,2);
$mincon=substr($_hostmachine_l{$key},10,2);
- print "| $key | $page | $_hostmachine_h{$key} | $kilo | ";
+ 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 | "; }
@@ -2619,7 +2625,7 @@ foreach $key (@sorthosts_h)
$total_k += $_hostmachine_k{$key};
}
$count++;
- if (!(($SortDir<0 && $count<$MaxNbOfHostsShown) || ($SortDir>0 && $#sorthosts_h-$MaxNbOfHostsShown < $count))) { last; }
+ if (!(($SortDir<0 && $count<$MaxNbOfHostsShown) || ($SortDir>0 && $#sorthosts_p-$MaxNbOfHostsShown < $count))) { last; }
}
$rest_p=$TotalPages-$total_p;
$rest_h=$TotalHits-$total_h;