From: eldy <> Date: Sat, 13 Mar 2004 12:34:10 +0000 (+0000) Subject: Added field to choose size of list limit. X-Git-Tag: AWSTATS_6_1_BETA~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93dfccb59d074e5208ffc22ad0dfbe5149b4ef28;p=thirdparty%2FAWStats.git Added field to choose size of list limit. Fixed some bugs when BuildReportOutput is set to xhtml. Number of shown lines were one more than required. --- diff --git a/wwwroot/cgi-bin/plugins/rawlog.pm b/wwwroot/cgi-bin/plugins/rawlog.pm index 2ccc94b8..66b3729b 100644 --- a/wwwroot/cgi-bin/plugins/rawlog.pm +++ b/wwwroot/cgi-bin/plugins/rawlog.pm @@ -45,7 +45,10 @@ sub Init_rawlog { # <----- # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS debug(" InitParams=$InitParams",1); - $MAXLINE=5000; + + if ($QueryString =~ /rawlog_maxlines=(\d+)/i) { $MAXLINE=&DecodeEncodedString("$1"); } + else { $MAXLINE=5000; } + # -----> return ($checkversion?$checkversion:"$PluginHooksFunctions"); @@ -87,16 +90,19 @@ sub BuildFullHTMLOutput_rawlog { print "
\n"; # Show raws + my $xml=($BuildReportFormat eq 'xhtml'); open(LOG,"$LogFile") || error("Couldn't open server log file \"$LogFile\" : $!"); binmode LOG; # Avoid premature EOF due to log files corrupted with \cZ or bin chars my $i=0; + print "
";
 	while () {
 		chomp $_; $_ =~ s/\r//;
 		if ($Filter && $_ !~ /$Filter/o) { next; }
-		print "$_
\n"; - if (++$i > $MAXLINE) { last; } + print ($xml?XMLEncode("$_"):"$_"); + print "\n"; + if (++$i >= $MAXLINE) { last; } } - print "
\n$i lines.
"; + print "

\n$i lines.
"; return 1; # -----> } @@ -109,7 +115,7 @@ sub _ShowForm { print ""; print "\n"; print "\n"; - print "\n"; print "
Show content of file '$LogFile' ($MAXLINE first lines):
$Message[79]: \n"; + print "
$Message[79]:       Max Number of Lines:       \n"; print ""; print "
\n";