another clamstats.pl question



In this script the author has it collecting stats by date, hour, month and
year. The only one of these thats not working correctly is by year:

By Year ( . = 4 viruses )
--------------------------
     2:     90 ......................

The same is with the html output. On the authors page his has the complete
year shown:

2006 7,779

The virus count is right, its just the year thats being shown wrong. This
is the portion of the script that I 'think' controls this:

### BY YEAR

$TXT .= "\n\nBy Year ( . = $yearscale viruses )\n" if $text;
$TXT .= "--------------------------\n" if $text;

if ($html) {
print "<table border=0><tr><Th bgcolor=\#666699
COLSPAN=3><font color=\#FFFFFF size=4>Viruses by Year</font></th><TH
align=center>";
}

foreach my $yr ( sort keys %{$stats{year}} ) {
my $yearraw = $stats{year}->{$yr};
1 while $stats{year}->{$yr} =~ s/(.*\d)(\d\d\d)/$1,$2/;
$TXT .= sprintf("%6s: %6s %s\n", $yr, $stats{year}->{$yr}, "." x
int($yearraw/$yearscale)) if $text;

if ($html) {
print "<tr><td align=left bgcolor=\#9999FF>";
print "$yr" . "</td>";
print "<td align=center bgcolor=\#DCDCEE>";
print $stats{year}->{$yr} . "</td>";
print "<td align=left bgcolor=\#DCDCEE><img
src=\"/meter.jpg\" height=5 WIDTH=" . int($yearraw/$yearscale) . ">";
print "</td></tr>\n";
}

}
print "</TD>" if $html;


}


There are a few lines that are line wrapped here in this message. Any help
would be appreciated.

Chris

--
Chris
Registered Linux User 283774 http://counter.li.org
18:44:14 up 27 days, 6:44, 1 user, load average: 0.24, 0.28, 0.18
Mandriva Linux 10.1 Official, kernel 2.6.8.1-12mdk

Attachment: pgprNguzRF7a2.pgp
Description: PGP signature



Relevant Pages

  • Re: ASP include files
    ... thats for that one;o) ... it's considered a "no no" to post in HTML;o) ... I want script #1! ... All incoming mail on monsterzam@hotmail.com will be permanently ...
    (microsoft.public.inetserver.asp.general)
  • Re: FORM QUESTION
    ... headerredirect and I get an error. ... add the html forms into processor.php then everything is done ... within the one script, thats how i do things. ...
    (alt.php)
  • Re: General question about javascript V HTML form
    ... Onselect is not a vaild attribute for a select element, it is for input and textarea elements when some text in them is selected: ... Coding it up looks a shade simpler in HTML rather than script, but thats all I can see... ... Using HTML ensures it will work in a greater range of browsers and those with script support missing or turned off, though you may wish to augment it with script to provide a better UI for those that have it available and turned on. ...
    (comp.lang.javascript)
  • RE: Help with line length in script
    ... I use a script that generates stats for clamav. ... The problem is that the line length in the txt and html ... While in the html file its shows this: ... Registered Linux User 283774 http://counter.li.org ...
    (perl.beginners)
  • Help with line length in script
    ... The problem is that the line length in the txt and html ... While in the html file its shows this: ... If the whole script is needed let me know and I'll upload it somewhere. ... Registered Linux User 283774 http://counter.li.org ...
    (perl.beginners)