Tetra-WebBBS Debugger 6.10

Contents of /home/zoetecnocampoco/public_html/cgi-bin/bbs/lib/webbbs_stats.pl

    1- #<<<
    2- #########################################
    3- #    ---  Tetra-WebBBS  --- 
    4- # By:             tetrabb.com
    5- # Version:        6.10
    6- # Last modified:  2009-11-01
    7- # Copyright (c)   2006-2009
    8- # Website:        http://tetrabb.com
    9- # For more details see license.txt
   10- #
   11- # Core script:    webbbs_stats.pl
   12- # Authors:        Tarty
   13- #                 Rainer Libowski
   14- #
   15- ##########################################
   16- #>>>
   17- 
   18- require 'webbbs_share.pl';
   19- 
   20- sub TopStats {
   21- &Parse_Form;
   22- &Initialize_Data;
   23- @sortedmessages = ( sort { $a <=> $b } keys %MessageList );
   24- $TotalMessages  = @sortedmessages;
   25- $lastmessage    = $sortedmessages[ @sortedmessages - 1 ];
   26- $firstmessage   = $sortedmessages[0];
   27- @months         = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
   28- $MaxHeight      = 90;
   29- ( $navbar_top, $navbar_bottom ) = $main::tbb->{'tbb_html'}->get_navbar_HTML( 'sub_navbar' => 'stats' );
   30- 
   31- my $title = $text{'3010'};
   32- if ( $AdminRun && ( $tbb->{'get'}->{'md'} eq 'topstats' ) ) {
   33- $title = $text{'01120'};
   34- }
   35- if ( $AdminRun && ( $tbb->{'get'}->{'md'} eq 'msgstats' ) ) {
   36- $title = $text{'01122'};
   37- }
   38- if ( $AdminRun && ( $tbb->{'get'}->{'md'} eq 'topicstats' ) ) {
   39- $title = $text{'01123'};
   40- }
   41- &Header( $title, $MessageHeaderFile );
   42- 
   43- my %subnav_args = ();
   44- &Header2( undef, 'statistics', \%subnav_args );
   45- 
   46- if ($printboardname) { print "<h2>$boardname</h2>\n"; }
   47- print "<h3>$title</h3>\n", $cust{'glob_header_e'}, "</div>\n";
   48- print "<div id='misc_topstat'>\n", $cust{'misc_topstat_s'};
   49- &TopStats1 if ( $TotalMessages > 0 );
   50- print $cust{'misc_topstat_e'}, "\n", "</div>\n";
   51- &Footer( $MessageFooterFile, 'credits', );
   52- } ## end sub TopStats
   53- 
   54- sub TopStats1 {
   55- require 'webbbs_index.pl';
   56- $DateConfig =~ s/at\s//go;
   57- $DateConfig =~ s/%DY%//go;
   58- $DateConfig =~ s/%HR%:%mn%([|:%sc%]*)([\s]*)//go;
   59- $DateConfig =~ s/%hr%:%mn%(.*)\s%am%([\s]*)//go;
   60- $DateConfig =~ s/,\s//go;
   61- &CountDBMRead if ( ( $DisplayViews == 1 ) || $AdminRun );
   62- %Name        = ();
   63- %PosterCount = ();
   64- %LastPost    = ();
   65- %LastDate    = ();
   66- my $ttlviews = 0;
   67- my @Topics;
   68- my ( %StarterCount, %SIZE );
   69- foreach (@sortedmessages) {
   70- my ( $date, $poster, $prev ) = ( split( /\|/, $MessageList{$_} ) )[ 0, 2, 3 ];
   71- $poster =~ s/&pipe;/\|/g;
   72- my $posterlc = $poster;
   73- $posterlc =~ tr/A-Z/a-z/;
   74- unless ( $PosterCount{$posterlc} ) { $Name{$posterlc} = $poster; }
   75- $PosterCount{$posterlc}++;
   76- if ( $date > $LastDate{$posterlc} ) {
   77- $LastPost{$posterlc} = $_;
   78- $LastDate{$posterlc} = $date;
   79- }
   80- $ttlviews += $CountList{$_};
   81- unless ($prev) {
   82- push( @Topics, $_ );
   83- $StarterCount{$posterlc}++;
   84- }
   85- my $subdir = '/bbs' . int( $_ / 1000 );
   86- $SIZE{$_} = -s ( $dir . $subdir . '/' . $_ );
   87- }
   88- my $PosterCount = scalar( keys %PosterCount ) || 0;
   89- if ($AdminRun) {
   90- $TopNPosters = $PosterCount;
   91- }
   92- my @messages;
   93- %already = ();
   94- foreach (@Topics) {
   95- unless ( $already{$_} ) {
   96- ( $respcount, $respdate, $showthread, $newcount ) = ( 0, 0, 0, 0 );
   97- ( $threadviews, $resppost, $respposter ) = ( 0, 0, '' );
   98- $firstnew = 1000000000;
   99- &CompressList($_);
  100- if ( $showthread > 0 ) {
  101- push( @messages, [ $_, $respcount, $newcount, $firstnew, $threadviews, $resppost, $respdate, $respposter ] );
  102- }
  103- }
  104- }
  105- $messagecount = scalar(@messages) || 0;
  106- print "<div>\n", "<div style='width:50%; float:right;'>\n", "<table>\n", "    <tr>\n", "<td style='width:50%;' class='strong'>$text{'6008'}</td>\n", '<td>', &PrintDate( int( $MessageList{$lastmessage} ) ), ' (';
  107- my $newfromnow = int( ( $time - $MessageList{$lastmessage} ) / 86400 );
  108- if ( $newfromnow > 1 ) { print &commas($newfromnow), " $text{'3053'}"; }
  109- elsif ( $newfromnow == 1 ) { print $text{'3052'}; }
  110- else                       { print $text{'3051'}; }
  111- print ")</td>\n", "    </tr><tr>\n", "<td class='strong'>$text{'6007'}</td>\n", "<td>", &PrintDate( int( $MessageList{ $sortedmessages[0] } ) ), "</td>\n";
  112- my $oldfromnow = int( ( $time - $MessageList{ $sortedmessages[0] } ) / 86400 );
  113- if ( ( $oldfromnow - $newfromnow ) > 0 ) {
  114- print "    </tr><tr>\n", "<td class='strong'>$text{'3016'}</td>\n", "<td>", &commas( int( $TotalMessages / ( $oldfromnow - $newfromnow ) + .5 ) ), "</td>\n";
  115- }
  116- print "    </tr><tr>\n", "<td class='strong'>$text{'3004'}</td>\n", "<td>", &commas( int( ( $TotalMessages / $PosterCount ) + .5 ) ), "</td>\n";
  117- if ( ( $DisplayViews == 1 ) && $oldfromnow ) {
  118- print "    </tr><tr>\n", "<td class='strong'>$text{'3017'}</td>\n", "<td>", &commas( int( ( $ttlviews / $oldfromnow ) + .5 ) ), "</td>\n";
  119- }
  120- if ( ( $TopNPosters > 10 ) || $AdminRun ) {
  121- $compactDisplay = 1;
  122- }
  123- $profQS     = 'md' . $QS2 . 'profile' . $QS1 . 'id';
  124- $profTarget = '';
  125- if ($AdminRun) {
  126- $compactDisplay = 1;
  127- my %size;
  128- my $dir_size = 0;
  129- use File::Find;
  130- find(
  131- sub {
  132- $size{$File::Find::name} = -s if -f;
  133- },
  134- $dir
  135- );
  136- foreach ( keys %size ) { $dir_size += $size{$_}; }
  137- print "    </tr><tr>\n", "<td class='strong'>$text{'3020'}</td>\n", "<td>";
  138- if ( $dir_size >= 1048576 ) {
  139- print &commas( int( $dir_size / 1048576 * 100 ) / 100 ), ' MB';
  140- }
  141- elsif ( $dir_size >= 1024 ) {
  142- print int( $dir_size / 1024 ), ' KB';
  143- }
  144- else { print sprintf( '%.1f', $dir_size ) . ' KB'; }
  145- print "</td>\n";
  146- }
  147- print "    </tr>\n", "</table>\n", "</div>\n", "<div style='width:49%; float:left;'>\n";
  148- print "<table>\n", "    <tr>\n", "<td style='width:50%;' class='strong'>$text{'3011'}</td>\n", "<td>", &commas($messagecount), "</td>\n", "    </tr><tr>\n", "<td class='strong'>$text{'3002'}</td>\n", "<td>", &commas($TotalMessages), "</td>\n", "    </tr><tr>\n", "<td class='strong'>$text{'3003'}</td>\n", "<td>", &commas($PosterCount), "</td>\n";
  149- if ( $DisplayViews == 1 ) {
  150- print "    </tr><tr>\n", "<td class='strong'>$text{'3012'}</td>\n", "<td>", &commas($ttlviews), "</td>\n";
  151- }
  152- if ($AllowProfiles) {
  153- %ProfileList = ();
  154- opendir( PROFILES, $UserProfileDir );
  155- my @profiles = readdir(PROFILES);
  156- closedir(PROFILES);
  157- foreach (@profiles) {
  158- next unless (/^(.*)\.txt$/);
  159- $ProfileList{$1} = ( stat("$UserProfileDir/$_") )[9];
  160- }
  161- undef @profiles;
  162- print "    </tr><tr>\n", "<td class='strong'>$text{'3013'}</td>\n", "<td>", &commas( scalar( keys %ProfileList ) ), "</td>\n";
  163- }
  164- print "    </tr>\n", "</table>\n";
  165- print "</div>\n",    "</div><br style='clear:both;'><br/>\n";
  166- if (    ( ( !$AdminRun ) && ( $TopNPosters > 0 ) )
  167-      || ( $AdminRun && ( $tbb->{'get'}->{'md'} eq 'topstats' ) ) )
  168- {
  169- &MostProlificPosters(%PosterCount);
  170- print "<div >\n";
  171- &TopStarters(%StarterCount);
  172- print "</div>\n";
  173- }
  174- if ( ( ( !$AdminRun ) && ( $TopNPosters > 0 ) )
  175-      || ( $AdminRun
  176-           && (    ( $tbb->{'get'}->{'md'} eq 'msgstats' )
  177-                || ( $tbb->{'get'}->{'md'} eq 'topicstats' ) )
  178-      )
  179-     )
  180- {
  181- if ($AdminRun) {
  182- $TopNPosters = 200;
  183- }
  184- else {
  185- print "<br/>\n";
  186- }
  187- if ($compactDisplay) {
  188- 
  189- if ( $AdminRun && ( $tbb->{'get'}->{'md'} eq 'msgstats' ) ) {
  190- print "<div>\n", "<div style='width:50%; float:right;'>\n";
  191- &MostLengthy(%SIZE);
  192- print "</div>\n", "<div style='width:49%; float:left;'>\n";
  193- &MostViewedPosts;
  194- print "</div>\n", "</div><br style='clear:both;'><br/>\n";
  195- }
  196- elsif ( $AdminRun && ( $tbb->{'get'}->{'md'} eq 'topicstats' ) ) {
  197- print "<div>\n", "<div style='width:50%; float:right;'>\n";
  198- &MostActive(@messages);
  199- print "</div>\n", "<div style='width:49%; float:left;'>\n";
  200- &MostViewedTopics(@messages);
  201- print "</div>\n", "</div><br style='clear:both;'><br/>\n";
  202- }
  203- else {
  204- if ( $DisplayViews == 1 ) {
  205- print "<div>\n", "<div style='width:50%; float:right;'>\n";
  206- &MostViewedPosts;
  207- print "</div>\n", "<div style='width:49%; float:left;'>\n";
  208- &MostViewedTopics(@messages);
  209- print "</div>\n", "</div><br style='clear:both;'><br/>\n";
  210- }
  211- print "<div>\n", "<div style='width:50%; float:right;'>\n";
  212- &MostLengthy(%SIZE);
  213- print "</div>\n", "<div style='width:49%; float:left;'>\n";
  214- &MostActive(@messages);
  215- print "</div>\n", "</div><br style='clear:both;'><br/>\n";
  216- }
  217- }
  218- else {
  219- @OurColors = qw( row1 row2 );
  220- $NextColor = 0;
  221- &MostActive(@messages);
  222- if ( $DisplayViews == 1 ) {
  223- &MostViewedTopics(@messages);
  224- &MostViewedPosts;
  225- }
  226- &MostLengthy(%SIZE);
  227- }
  228- }
  229- } ## end sub TopStats1
  230- 
  231- sub MostProlificPosters {
  232- my %PosterCount = @_;
  233- my @sorted =
  234-     sort { $PosterCount{$b} <=> $PosterCount{$a} } keys %PosterCount;
  235- unless ($AdminRun) {
  236- splice @sorted, $TopNPosters if ( @sorted > $TopNPosters );
  237- }
  238- print "<h4>$text{'3001'}";
  239- print " - $text{'3000'} $TopNPosters" unless ($AdminRun);
  240- print "</h4>\n", "<table>\n", "    <tr>\n", "<th style='width:200px;'>$text{'3005'}</th>\n", "<th style='width:75px;'>$text{'3006'}</th>\n", "<th style='width:", ( $MaxHeight + 12 ), "px;'></th>\n", "<th style='width:100px;'>$text{'3007'}</th>\n", "<th>$text{'3008'}</th>\n", "    </tr>";
  241- my $posttotal = 0;
  242- my %Listed;
  243- my $multiplier1 = ( $MaxHeight / $TotalMessages ) if ($TotalMessages);
  244- my $multiplier2 = ( 100 / $TotalMessages )        if ($TotalMessages);
  245- foreach (@sorted) {
  246- $posttotal += $PosterCount{$_};
  247- my $percent = sprintf( '%.f', ( $PosterCount{$_} * $multiplier2 ) );
  248- if ( $percent == 0 ) {
  249- $percent = '<1' unless ( $PosterCount{$_} == 0 );
  250- }
  251- print "<tr>\n", "<td class='nowrap'>";
  252- $ProfileCheck{ $Name{$_} } = $Name{$_};
  253- $ProfileCheck{ $Name{$_} } =~ s/[^\w\.\-\']/\+/g;
  254- $ProfileCheck{ $Name{$_} } =~ tr/A-Z/a-z/;
  255- $Listed{ $ProfileCheck{ $Name{$_} } }++;
  256- if ( $ProfileList{ $ProfileCheck{ $Name{$_} } } ) {
  257- $ProfileCheck{ $Name{$_} } = "<a href='" . $DestinationURL . $BBSquery . $profQS . $QS2 . $ProfileCheck{ $Name{$_} } . "'$profTarget>$Name{$_}</a>";
  258- }
  259- else {
  260- $ProfileCheck{ $Name{$_} } = $Name{$_};
  261- }
  262- print $ProfileCheck{ $Name{$_} }, "</td>\n", "<td>", &commas( $PosterCount{$_} ), "</td>\n", "<td><div class='stats_line' style='width:", sprintf( '%.f', ( $PosterCount{$_} * $multiplier1 + .05 ) ), "px;'></div></td>\n", "<td>$percent%</td>\n", "<td><a href='", $DestinationURL, $BBSquery, 'md' . $QS2 . 'read' . $QS1 . 'id' . $QS2 . $LastPost{$_}, "'$BBStarget>", &PrintDate( $LastDate{$_} ), "</a> (";
  263- my $daysaway = int( ( $time - $LastDate{$_} ) / 86400 );
  264- if ( $daysaway > 1 ) { print &commas($daysaway), " $text{'3053'}"; }
  265- elsif ( $daysaway == 1 ) { print $text{'3052'}; }
  266- else                     { print $text{'3051'}; }
  267- print ")</td>\n", "    </tr>";
  268- }
  269- my $pcttotal = sprintf( '%.f', ( $posttotal * $multiplier2 ) );
  270- if ( $pcttotal == 100 ) {
  271- $pcttotal = "~100" unless ( $posttotal eq $TotalMessages );
  272- }
  273- print "<tr class='strong'>\n", "<td>$text{'3049'}</td>\n", "<td>", &commas($posttotal), "</td>\n", "<td><div class='stats_linebox' style='width:", ( $MaxHeight + 4 ), "px;'><div class='stats_line' style='width:", sprintf( '%.f', ( $posttotal * $multiplier1 + .05 ) ), "px;'></div></div></td>\n", "<td>$pcttotal%</td>\n", "<td></td>\n", "    </tr>\n";
  274- print "</table><br/>\n";
  275- } ## end sub MostProlificPosters
  276- 
  277- sub TopStarters {
  278- my (%StarterCount) = @_;
  279- my $MaxHeight = 200;
  280- my @sorted =
  281-     sort { $StarterCount{$b} <=> $StarterCount{$a} } keys %StarterCount;
  282- splice @sorted, $TopNPosters if ( @sorted > $TopNPosters );
  283- my $topnum = $AdminRun ? '' : " - $text{'3000'} $TopNPosters";
  284- print "<h4>$text{'3031'}$topnum</h4>\n", "<table>\n", "    <tr>\n", "<th>$text{'3005'}</th>\n", "<th style='width:100px;'>$text{'3041'}</th>\n", "<th style='width:", ( $MaxHeight + 30 ), "px;'></th>\n", "<th style='width:200px;'>$text{'3007'}</th>\n", "    </tr>";
  285- my $posttotal   = 0;
  286- my $multiplier1 = ( $MaxHeight / $messagecount ) if ($messagecount);
  287- my $multiplier2 = ( 100 / $messagecount ) if ($messagecount);
  288- foreach (@sorted) {
  289- $posttotal += $StarterCount{$_};
  290- my $percent = sprintf( '%.f', ( $StarterCount{$_} * $multiplier2 ) );
  291- if ( $percent == 0 ) {
  292- $percent = '<1' unless ( $StarterCount{$_} == 0 );
  293- }
  294- print "<tr>\n", "<td class='nowrap'>", &poster_format( $Name{$_} ), "</td>\n", "<td>", &commas( $StarterCount{$_} ), "</td>\n", "<td><div class='stats_line' style='width:", sprintf( '%.f', ( $StarterCount{$_} * $multiplier1 + .05 ) ), "px;'></div></td>\n", "<td>$percent%</td>\n", "    </tr>";
  295- }
  296- my $pcttotal = sprintf( '%.f', ( $posttotal * $multiplier2 ) );
  297- if ( $pcttotal == 100 ) {
  298- $pcttotal = "~100" unless ( $posttotal eq $messagecount );
  299- }
  300- print "<tr class='strong'>\n", "<td>$text{'3049'}</td>\n", "<td>", &commas($posttotal), "</td>\n", "<td><div class='stats_linebox' style='width:", ( $MaxHeight + 4 ), "px;'><div class='stats_line' style='width:", sprintf( '%.f', ( $posttotal * $multiplier1 + .05 ) ), "px;'></div></div></td>\n", "<td>$pcttotal%</td>\n", "    </tr>\n", "</table>\n";
  301- } ## end sub TopStarters
  302- 
  303- sub LatestProfiles {
  304- my %ProfileList = @_;
  305- my %ProfilePoster;
  306- unless ($ListAllProfiles) {
  307- foreach ( keys %PosterCount ) {
  308- s/[^\w\.\-\']/\+/g;
  309- $ProfilePoster{$_}++ if ( $ProfileList{$_} );
  310- }
  311- }
  312- my @sorted =
  313-     sort { $ProfileList{$b} <=> $ProfileList{$a} } keys %ProfileList;
  314- print "<h4>$text{'3014'} $text{'3013'}</h4>\n", "<table>\n", "    <tr>\n", "<th>$text{'304'} Name</th>\n", "<th style='width:150px;'>$text{'3046'}</th>\n", "    </tr>";
  315- my $cnt = 0;
  316- foreach $key (@sorted) {
  317- unless ($ListAllProfiles) {
  318- next unless ( $ProfilePoster{$key} );
  319- }
  320- my $IncludeProfile = 1;
  321- unless ($ListEmptyProfiles) {
  322- if ( int( ( stat("$UserProfileDir/$key.txt") )[7] ) < 200 ) {
  323- $IncludeProfile = 0;
  324- }
  325- }
  326- my $profilename = '';
  327- open( FILE, "$UserProfileDir/$key.txt" );
  328- binmode(FILE);
  329- while (<FILE>) {
  330- if (/^NAME>(.*)/io) { $profilename = $1; }
  331- elsif (    (/^IMAGE>(.+)/io)
  332-         || (/^LINKNAME>(.+)/io)
  333-         || (/^LINKURL>(.+)/io)
  334-         || (/^<P>(.+)/io) )
  335- {
  336- $IncludeProfile = 1;
  337- last;
  338- }
  339- }
  340- close(FILE);
  341- next unless ($IncludeProfile);
  342- print "<tr>\n", "<td class='nowrap'><a href='", $DestinationURL, $BBSquery, $profQS, $QS2, $key, "'$profTarget>$profilename</a></td>\n", "<td>", &PrintDate( $ProfileList{$key} ), "</td>\n", "    </tr>";
  343- $cnt++;
  344- last if ( $cnt == $TopNPosters );
  345- }
  346- print "</table>\n";
  347- } ## end sub LatestProfiles
  348- 
  349- sub get_message_desc {
  350- my ( $date, $sub, $poster, $admin ) = ( split( /\|/, $MessageList{ $_[0] } ) )[ 0 .. 2, 6 ];
  351- $sub    =~ s/&pipe;/\|/g;
  352- $poster =~ s/&pipe;/\|/g;
  353- my ( $messagedesc, $admin_e, $new_e ) = ( '', '', '' );
  354- if ( $admin eq 'AdminPost' ) {
  355- $messagedesc .= $AdminOpenCode . ' ';
  356- $admin_e = ' ' . $AdminCloseCode;
  357- }
  358- if (    ( $Cookies{'lastmessage'} && ( $Cookies{'lastmessage'} < $_[0] ) )
  359-      || ( $newcount{ $_[0] } > 0 ) )
  360- {
  361- $messagedesc .= $NewOpenCode . ' ';
  362- $new_e = ' ' . $NewCloseCode;
  363- }
  364- unless ( $sub eq $text{'0250'} ) {
  365- $messagedesc .= "<a href='" . $DestinationURL . $BBSquery . 'md' . $QS2 . 'read' . $QS1 . 'id' . $QS2 . $_[0] . "'$BBStarget title='$text{'3047'} " . $poster . "

$text{'3048'} " . &PrintDate($date) . "'>$sub</a>";
  366- }
  367- else { $messagedesc .= $sub; }
  368- $messagedesc .= $new_e . $admin_e;
  369- return ($messagedesc);
  370- } ## end sub get_message_desc
  371- 
  372- sub print_line {
  373- my ( $N, $V, $M, $K ) = @_;
  374- my $line = "<tr>\n" . "<td><div style='overflow:hidden;'>$N</div></td>\n" . "<td><div class='stats_line' style='width:" . int( $V * $M ) . "px;'></div></td>\n" . "<td>";
  375- if ($K) {
  376- $V =
  377-     ( $V >= $K )
  378-     ? &commas( int( $V / $K ) )
  379-     : sprintf( '%.1f', ( $V / $K ) );
  380- $line .= $V . ' K';
  381- }
  382- else { $line .= &commas($V); }
  383- $line .= "</td>\n" . "    </tr>";
  384- return ($line);
  385- } ## end sub print_line
  386- 
  387- sub MostActive {
  388- my @messages = @_;
  389- my @sorted = sort { $b->[1] <=> $a->[1] } @messages;
  390- splice @sorted, $TopNPosters if ( @sorted > $TopNPosters );
  391- print "<h4>$text{'3032'} - $text{'3000'} $TopNPosters</h4>\n", "<table>\n", "    <tr>\n";
  392- if ($compactDisplay) {
  393- my $multiplier = ( $MaxHeight / $sorted[0]->[1] )
  394-     if ( $sorted[0]->[1] > 1 );
  395- print "<th>$text{'3042'}</th>\n", "<th style='width:", ( $MaxHeight + 12 ), "px;'></th>\n", "<th style='width:50px;'>$text{'3006'}</th>\n", "    </tr>";
  396- for ( $i = 0; $i < @sorted; $i++ ) {
  397- print &print_line( &get_message_desc( $sorted[$i]->[0] ), $sorted[$i]->[1], $multiplier );
  398- }
  399- }
  400- else {
  401- print "<th style='width:50%;'>$text{'3042'}</th>\n", "<th style='width:75px;'>[$text{'3006'}]</th>\n";
  402- print "<th style='width:75px;'>$text{'3044'}</th>\n"
  403-     if ( $DisplayViews == 1 );
  404- print "<th>$text{'0553'}</th>\n", "    </tr>";
  405- for ( $i = 0; $i < @sorted; $i++ ) {
  406- print &StatsPrintMessageDescCompress( $sorted[$i] );
  407- }
  408- }
  409- print "</table>\n";
  410- } ## end sub MostActive
  411- 
  412- sub CompressListxx {
  413- my ( $date, $sub, $poster, $next ) = ( split( /\|/, $MessageList{ $_[0] } ) )[ 0 .. 2, 4 ];
  414- $respcount++;
  415- $threadviews += $CountList{ $_[0] };
  416- if ( $date > $respdate ) {
  417- ( $resppost, $respdate, $respposter ) = ( $_[0], $date, $poster );
  418- }
  419- unless ( $DontUse{ $_[0] } ) { $showthread = 1; }
  420- if ( $Cookies{'lastmessage'}
  421-      && ( $Cookies{'lastmessage'} < $_[0] ) )
  422- {
  423- $newcount++;
  424- if ( $firstnew > $_[0] ) { $firstnew = $_[0]; }
  425- }
  426- if ($next) {
  427- $next =~ s/^\s//gi;
  428- my @threadresponses = split( / /, $next );
  429- foreach (@threadresponses) {
  430- next unless ( $_ > $_[0] );
  431- if ( $MessageList{$_} > 0 ) { &CompressListxx($_); }
  432- }
  433- }
  434- $already{ $_[0] } = 1;
  435- } ## end sub CompressListxx
  436- 
  437- sub MostViewedTopics {
  438- my @messages = @_;
  439- my @sorted = sort { $b->[4] <=> $a->[4] } @messages;
  440- splice @sorted, $TopNPosters if ( @sorted > $TopNPosters );
  441- print "<h4>$text{'3033'} - $text{'3000'} $TopNPosters</h4>\n", "<table>\n", "    <tr>\n";
  442- if ($compactDisplay) {
  443- my $multiplier = ( $MaxHeight / $sorted[0]->[4] )
  444-     if ( $sorted[0]->[4] > 1 );
  445- print "<th>$text{'3042'}</th>\n", "<th style='width:", ( $MaxHeight + 12 ), "px;'></th>\n", "<th style='width:50px;'>$text{'3044'}</th>\n", "    </tr>";
  446- for ( $i = 0; $i < @sorted; $i++ ) {
  447- last if ( $sorted[$i]->[4] < 1 );
  448- 
  449- print &print_line( &get_message_desc( $sorted[$i]->[0] ), $sorted[$i]->[4], $multiplier );
  450- }
  451- }
  452- else {
  453- print "<th style='width:50%;'>$text{'3042'}</th>\n", "<th style='width:75px;'>$text{'3006'}</th>\n", "<th style='width:75px;'>[$text{'3044'}]</th>\n", "<th>$text{'0553'}</th>\n", "    </tr>";
  454- for ( $i = 0; $i < @sorted; $i++ ) {
  455- print &StatsPrintMessageDescCompress( $sorted[$i] );
  456- }
  457- }
  458- print "</table>\n";
  459- } ## end sub MostViewedTopics
  460- 
  461- sub MostViewedPosts {
  462- 
  463- my @sorted = sort { $CountList{$b} <=> $CountList{$a} } keys %CountList;
  464- 
  465- splice @sorted, $TopNPosters if ( @sorted > $TopNPosters );
  466- print "<h4>$text{'3034'} - $text{'3000'} $TopNPosters</h4>\n", "<table>\n", "    <tr>\n", "<th>$text{'3043'}</th>\n";
  467- if ($compactDisplay) {
  468- my $multiplier = ( $MaxHeight / $CountList{ $sorted[0] } )
  469-     if ( $CountList{ $sorted[0] } > 1 );
  470- print "<th style='width:", ( $MaxHeight + 12 ), "px;'></th>\n", "<th style='width:50px;'>$text{'3044'}</th>\n", "    </tr>";
  471- foreach (@sorted) {
  472- last if ( $CountList{$_} < 1 );
  473- print &print_line( &get_message_desc($_), $CountList{$_}, $multiplier );
  474- }
  475- }
  476- else {
  477- print "<th style='width:75px;'>[$text{'3044'}]</th>\n", "<th style='width:150px;'>$text{'3005'}</th>\n", "<th style='width:150px;'>$text{'3046'}</th>\n", "    </tr>";
  478- foreach (@sorted) { print &StatsPrintMessageDesc($_); }
  479- }
  480- print "</table>\n";
  481- } ## end sub MostViewedPosts
  482- 
  483- sub MostLengthy {
  484- my %SIZE = @_;
  485- my @sorted = sort { $SIZE{$b} <=> $SIZE{$a} } keys %SIZE;
  486- splice @sorted, $TopNPosters if ( @sorted > $TopNPosters );
  487- print "<h4>$text{'3035'} - $text{'3000'} $TopNPosters</h4>\n", "<table>\n", "    <tr>\n", "<th>$text{'3043'}</th>\n";
  488- if ($compactDisplay) {
  489- my $multiplier = ( $MaxHeight / $SIZE{ $sorted[0] } )
  490-     if ( $SIZE{ $sorted[0] } > 1 );
  491- print "<th style='width:", ( $MaxHeight + 12 ), "px;'></th>\n", "<th style='width:50px;'>$text{'3045'}</th>\n", "    </tr>";
  492- foreach (@sorted) {
  493- print &print_line( &get_message_desc($_), $SIZE{$_}, $multiplier, 1024 );
  494- }
  495- }
  496- else {
  497- print "<th style='width:75px;'>[$text{'3045'}]</th>\n";
  498- print "<th style='width:75px;'>$text{'3044'}</th>\n"
  499-     if ( $DisplayViews == 1 );
  500- print "<th style='width:150px;'>$text{'3005'}</th>\n", "<th style='width:150px;'>$text{'3046'}</th>\n", "    </tr>";
  501- foreach (@sorted) {
  502- my $filesize =
  503-     ( $SIZE{$_} >= 1024 )
  504-     ? &commas( int( $SIZE{$_} / 1024 ) ) . ' KB'
  505-     : sprintf( '%.1f', ( $SIZE{$_} / 1024 ) ) . ' KB';
  506- print &StatsPrintMessageDesc( $_, $filesize );
  507- }
  508- }
  509- print "</table>\n";
  510- } ## end sub MostLengthy
  511- 
  512- sub StatsPrintMessageDesc {
  513- my ( undef, $filesize ) = @_;
  514- my ( $date, $sub, $poster, $admin ) = ( split( /\|/, $MessageList{ $_[0] } ) )[ 0 .. 2, 6 ];
  515- $sub    =~ s/&pipe;/\|/g;
  516- $poster =~ s/&pipe;/\|/g;
  517- my ( $admin_e, $new_e ) = ( '', '' );
  518- my $messagedesc = "<tr class='" . $OurColors[ ( $NextColor++ % @OurColors ) ] . "'>\n" . "<td>";
  519- if ( $admin eq 'AdminPost' ) {
  520- $messagedesc .= $AdminOpenCode . ' ';
  521- $admin_e = ' ' . $AdminCloseCode;
  522- }
  523- if (    ( $Cookies{'lastmessage'} && ( $Cookies{'lastmessage'} < $_[0] ) )
  524-      || ( $newcount{ $_[0] } > 0 ) )
  525- {
  526- $messagedesc .= $NewOpenCode . ' ';
  527- $new_e = ' ' . $NewCloseCode;
  528- }
  529- unless ( ( $messagenumber == $_[0] ) || ( $sub eq $text{'0250'} ) ) {
  530- $messagedesc .= "<a href='" . $DestinationURL . $BBSquery . 'md' . $QS2 . 'read' . $QS1 . 'id' . $QS2 . $_[0] . "'$BBStarget>$sub</a>";
  531- }
  532- else { $messagedesc .= $sub; }
  533- $messagedesc .= $new_e . $admin_e . "</td>\n";
  534- $messagedesc .= "<td>$filesize</td>\n" if ($filesize);
  535- if ( $DisplayViews == 1 ) {
  536- $messagedesc .= "<td>";
  537- if ( $CountList{ $_[0] } > 0 ) {
  538- $messagedesc .=
  539-     ( $sub ne $text{'0250'} )
  540-     ? &commas( $CountList{ $_[0] } )
  541-     : 'N/A';
  542- }
  543- else { $messagedesc .= '0'; }
  544- $messagedesc .= "</td>\n";
  545- }
  546- $messagedesc .= "<td>" . &poster_format($poster) . "</td>\n" . "<td>" . &PrintDate($date) . "</td>\n" . "    </tr>";
  547- return ($messagedesc);
  548- } ## end sub StatsPrintMessageDesc
  549- 
  550- sub StatsPrintMessageDescCompress {
  551- my @messages = @_;
  552- my ( $date, $sub, $poster, $admin ) = ( split( /\|/, $MessageList{ $messages[0]->[0] } ) )[ 0 .. 2, 6 ];
  553- $sub    =~ s/&pipe;/\|/g;
  554- $poster =~ s/&pipe;/\|/g;
  555- my ( $admin_e, $new_e ) = ( '', '' );
  556- my $messagedesc = "<tr class='" . $OurColors[ ( $NextColor++ % @OurColors ) ] . "'>\n" . "<td>";
  557- if ( $admin eq 'AdminPost' ) {
  558- $messagedesc .= $AdminOpenCode . ' ';
  559- $admin_e = ' ' . $AdminCloseCode;
  560- }
  561- if ( $Cookies{'lastmessage'}
  562-      && ( $Cookies{'lastmessage'} < $messages[0]->[0] ) )
  563- {
  564- $messagedesc .= $NewOpenCode . ' ';
  565- $new_e = ' ' . $NewCloseCode;
  566- }
  567- unless ( $sub eq $text{'0250'} ) {
  568- $messagedesc .= "<a href='" . $DestinationURL . $BBSquery . 'md' . $QS2 . 'read' . $QS1 . 'id' . $QS2 . $messages[0]->[0] . "'$BBStarget>$sub</a>";
  569- }
  570- else { $messagedesc .= $sub; }
  571- $messagedesc .= $new_e . $admin_e . "<br>\n" . "$text{'3047'} " . &poster_format($poster) . " $text{'3048'} " . &PrintDate($date) . "</td>\n" . "<td>" . &commas( $messages[0]->[1] );
  572- if ( $messages[0]->[2] > 0 ) {
  573- $messagedesc .= " <span class='small'>(";
  574- if ( ( $messages[0]->[3] > 0 ) && ( $messages[0]->[3] < 1000000000 ) ) {
  575- $messagedesc .= "<a href='" . $DestinationURL . $BBSquery . 'md' . $QS2 . 'read' . $QS1 . 'id' . $QS2 . $_[0] . $messages[0]->[3] . "'$BBStarget" . " title='jump to 1st new'>" . $messages[0]->[2] . " $text{'0552'}</a>";
  576- }
  577- else {
  578- $messagedesc .= $messages[0]->[2] . " $text{'0552'}";
  579- }
  580- $messagedesc .= ")</span>";
  581- }
  582- $messagedesc .= "</td>\n";
  583- if ( $DisplayViews == 1 ) {
  584- $messagedesc .= "<td>";
  585- if ( $messages[0]->[4] > 0 ) {
  586- $messagedesc .=
  587-     ( $sub ne $text{'0250'} )
  588-     ? &commas( $messages[0]->[4] )
  589-     : 'N/A';
  590- }
  591- else { $messagedesc .= '0'; }
  592- $messagedesc .= "</td>\n";
  593- }
  594- $messages[0]->[7] =~ s/&pipe;/\|/go;
  595- $messagedesc .= "<td>$text{'3047'} " . &poster_format( $messages[0]->[7] ) . "<br/>\n" . "$text{'3048'} <a href='" . $DestinationURL . $BBSquery . 'md' . $QS2 . 'read' . $QS1 . 'id' . $QS2 . $_[0] . $messages[0]->[5] . "'$BBStarget>" . &PrintDate( $messages[0]->[6] ) . "</a></td>\n" . "    </tr>";
  596- return ($messagedesc);
  597- } ## end sub StatsPrintMessageDescCompress
  598- 
  599- sub poster_format {
  600- local $_ = $_[0];
  601- if ( $ProfileCheck{$_} ) { return $ProfileCheck{$_}; }
  602- $ProfileCheck{$_} = $_;
  603- $ProfileCheck{$_} =~ s/[^\w\.\-\']/\+/g;
  604- $ProfileCheck{$_} =~ tr/A-Z/a-z/;
  605- if ( $ProfileList{ $ProfileCheck{$_} } ) {
  606- $ProfileCheck{$_} = "<a href='" . $DestinationURL . $BBSquery . $profQS . $QS2 . $ProfileCheck{$_} . "'$profTarget>$_</a>";
  607- }
  608- else { $ProfileCheck{$_} = $_; }
  609- return $ProfileCheck{$_};
  610- } ## end sub poster_format
  611- 
  612- sub TrafficStats1 {
  613- @rowColors    = qw( row1 row2 );
  614- %MessageCount = ();
  615- my ( %Year, %YrMon, %Hour );
  616- my $firsttime = $time;
  617- foreach ( keys %MessageList ) {
  618- my $messagetime = int( $MessageList{$_} );
  619- my ( $hour, $wday ) = ( localtime($messagetime) )[ 2, 6 ];
  620- $Hour{$hour}++;
  621- if ( $hour > 18 ) { $messagetime -= 21600; }
  622- elsif ( $hour < 6 ) { $messagetime += 21600; }
  623- unless ( $wday == 0 ) { $messagetime -= ( $wday * 86400 ); }
  624- my ( $mday, $mon, $year ) = ( localtime($messagetime) )[ 3 .. 5 ];
  625- if ( $mon < 10 )  { $mon  = '0' . $mon; }
  626- if ( $mday < 10 ) { $mday = '0' . $mday; }
  627- $year += 1900;
  628- $Year{$year}++;
  629- my $date = $year . $mon;
  630- $YrMon{$date}++;
  631- $date .= $mday;
  632- $MessageCount{$date}++;
  633- if ( $firsttime > $messagetime ) { $firsttime = $messagetime; }
  634- }
  635- &TrafficDateCheck($firsttime);
  636- my @sorted =
  637-     sort { $MessageCount{$b} <=> $MessageCount{$a} } keys %MessageCount;
  638- my $multiplier = ( $MaxHeight / $MessageCount{ $sorted[0] } )
  639-     if ( $MessageCount{ $sorted[0] } );
  640- print "<p>\n", "<span class='strong'>$text{'2101'}</span> ", &commas($TotalMessages), "<br/>\n", "<span class='strong'>$text{'2102'}</span> ", &commas( scalar( keys %MessageCount ) ), "\n", "</p>\n", "<table>\n";
  641- &TrafficPrintList( $firsttime, $multiplier );
  642- print "</table><br/>\n";
  643- 
  644- print "<div>\n", "<div style='width:50%; float:right;'>\n";
  645- &make_stats_hour(%Hour);
  646- my $yrCount = scalar( keys %Year );
  647- if ( $yrCount > 1 ) {
  648- @sorted = sort { $Year{$b} <=> $Year{$a} } keys %Year;
  649- $multiplier = ( $MaxHeight / $Year{ $sorted[0] } )
  650-     if ( $Year{ $sorted[0] } );
  651- print "<p><span class='strong'>$text{'2116'}</span> $yrCount</p>\n", "<table>\n", "    <tr>\n", "<th colspan='", $yrCount, "'>$text{'2117'}</th>\n", "    </tr><tr style='height:", ( $MaxHeight + 40 ), "px;'>\n";
  652- foreach ( sort keys %Year ) {
  653- &print_line_v( $_, $Year{$_}, $multiplier );
  654- }
  655- print "    </tr>\n", "</table>\n";
  656- }
  657- print "</div>\n", "<div style='width:49%; float:left;'>\n";
  658- @sorted = sort { $YrMon{$b} <=> $YrMon{$a} } keys %YrMon;
  659- $multiplier = ( $MaxHeight / $YrMon{ $sorted[0] } )
  660-     if ( $YrMon{ $sorted[0] } );
  661- print "<p><span class='strong'>$text{'2111'}</span> ", &commas( scalar( keys %YrMon ) ), "</p>\n", "<table>\n";
  662- my ( $cnt, $mth, $i ) = ( 0, 0, 0 );
  663- foreach ( sort keys %YrMon ) {
  664- if ( $cnt == 0 ) {
  665- print "<tr>\n", "<th colspan='12'>$text{'2112'} ", substr( $_, 0, 4 ), "</th>\n", "    </tr><tr style='height:", ( $MaxHeight + 40 ), "px;'>\n";
  666- }
  667- $mth = substr( $_, 4, 2 );
  668- for ( $i = $cnt; $i < $mth; $i++ ) {
  669- &print_line_v( $months[$i] );
  670- $cnt++;
  671- }
  672- &print_line_v( $months[$mth], $YrMon{$_}, $multiplier );
  673- $cnt++;
  674- if ( $cnt == 12 ) {
  675- print "    </tr>";
  676- $cnt = 0;
  677- }
  678- }
  679- if ( $cnt > 0 ) {
  680- for ( $i = $cnt; $i < 12; $i++ ) { print "<td></td>\n"; }
  681- print "    </tr>\n";
  682- }
  683- print "</table>\n";
  684- print "</div>\n", "</div><br style='clear:both;'/>\n";
  685- } ## end sub TrafficStats1
  686- 
  687- sub TrafficDateCheck_stopped {
  688- my $datecheck = $_[0];
  689- my ( $mday, $mon, $year ) = ( localtime($datecheck) )[ 3 .. 5 ];
  690- if ( $mon < 10 )  { $mon  = '0' . $mon; }
  691- if ( $mday < 10 ) { $mday = '0' . $mday; }
  692- my $date = ( $year + 1900 ) . $mon . $mday;
  693- $MessageCount{$date} = '0' unless ( $MessageCount{$date} );
  694- $datecheck += 604800;
  695- &TrafficDateCheck($datecheck) unless ( $datecheck > $time );
  696- } ## end sub TrafficDateCheck_stopped
  697- 
  698- sub TrafficPrintList_stopped {
  699- my ( $firsttime, $multiplier, $cnt, $leaddone ) = @_;
  700- my ( $mday, $mon, $year, $yday ) = ( localtime($firsttime) )[ 3 .. 5, 7 ];
  701- $year += 1900;
  702- $cnt++;
  703- if ( $cnt == 1 ) {
  704- print "<tr>\n", "<th colspan='52'>$text{'2110'} $year</th>\n", "    </tr><tr style='height:", ( $MaxHeight + 40 ), "px;'>\n";
  705- }
  706- unless ($leaddone) {
  707- my $weeks = int( $yday / 7 ) - 1;
  708- my $i;
  709- for ( $i = 0; $i < $weeks; $i++ ) {
  710- &print_line_v($cnt);
  711- $cnt++;
  712- }
  713- $leaddone++;
  714- }
  715- if ( $mon < 10 )  { $mon  = '0' . $mon; }
  716- if ( $mday < 10 ) { $mday = '0' . $mday; }
  717- &print_line_v( $cnt, $MessageCount{ $year . $mon . $mday }, $multiplier, "$text{'2103'} $mday $months[$mon] $year" );
  718- if ( $cnt == 52 ) { print "    </tr>"; $cnt = 0; }
  719- $firsttime += 604800;
  720- unless ( $firsttime > $time ) {
  721- &TrafficPrintList( $firsttime, $multiplier, $cnt, $leaddone );
  722- }
  723- elsif ( $cnt < 52 ) {
  724- my $i;
  725- for ( $i = $cnt + 1; $i < 53; $i++ ) { print "<td></td>\n"; }
  726- print "    </tr>\n";
  727- }
  728- } ## end sub TrafficPrintList_stopped
  729- 
  730- sub make_stats_hour {
  731- my %Hour       = @_;
  732- my @sorted     = sort { $Hour{$b} <=> $Hour{$a} } keys %Hour;
  733- my $multiplier = ( $MaxHeight / $Hour{ $sorted[0] } )
  734-     if ( $Hour{ $sorted[0] } );
  735- print "<p><span class='strong'>$text{'2113'}</span></p>\n", "<table>\n", "    <tr>\n", "<th colspan='24'>$text{'2114'}</th>\n", "    </tr><tr style='height:", ( $MaxHeight + 40 ), "px;'>\n";
  736- for ( 0 .. 23 ) {
  737- my $label = $_;
  738- if ( $_ == 12 ) { $label = $text{'2115'}; }
  739- elsif ( $_ > 12 ) { $label -= 12; }
  740- &print_line_v( $label, $Hour{$_}, $multiplier );
  741- }
  742- print "    </tr>\n", "</table>\n";
  743- } ## end sub make_stats_hour
  744- 
  745- sub print_line_v {
  746- my ( $N, $V, $M, $T ) = @_;
  747- print "<td class='", $rowColors[ ( $NextColor++ % @rowColors ) ], "'>$V\n";
  748- print " <div class='stats_line' style='height:", int( $V * $M ), "px;'></div>"
  749-     if ($V);
  750- print "<div class='box'";
  751- print " title='$T'" if ($T);
  752- print ">$N</div></td>\n";
  753- } ## end sub print_line_v
  754- 
  755- sub SetCookieData {
  756- &GetCookie($boardname);
  757- unless ( $FORM{'ListType'} ) {
  758- $FORM{'ListType'} = $Cookies{'listtype'};
  759- }
  760- unless ( $FORM{'ListTime'} ) {
  761- $FORM{'ListTime'} = $Cookies{'listtime'};
  762- }
  763- unless ( $FORM{'password'} ) {
  764- $FORM{'password'} = $Cookies{'password'};
  765- }
  766- if ( !$name )  { $name  = $Cookies{'name'}; }
  767- if ( !$email ) { $email = $Cookies{'email'}; }
  768- } ## end sub SetCookieData
  769- 
  770- sub TrafficStats {
  771- my $firsttime = $time;
  772- @sortedmessages = ( sort { $a <=> $b } keys %MessageList );
  773- $TotalMessages = @sortedmessages;
  774- foreach (@sortedmessages) {
  775- my $messagetime = int( $MessageList{$_} );
  776- my ( $hour, $wday ) = ( localtime($messagetime) )[ 2, 6 ];
  777- if ( $hour > 18 ) { $messagetime -= 21600; }
  778- elsif ( $hour < 6 ) { $messagetime += 21600; }
  779- unless ( $wday == 0 ) { $messagetime -= ( $wday * 86400 ); }
  780- my ( $mday, $mon, $year ) = ( localtime($messagetime) )[ 3 .. 5 ];
  781- $year += 1900;
  782- if ( $mon < 10 )  { $mon  = '0' . $mon; }
  783- if ( $mday < 10 ) { $mday = '0' . $mday; }
  784- my $date = $year . $mon . $mday;
  785- $MessageCount{$date}++;
  786- if ( $firsttime > $messagetime ) { $firsttime = $messagetime; }
  787- }
  788- &TrafficDateCheck($firsttime);
  789- my $WeekCount = scalar( keys %MessageCount );
  790- &Header( $text{'2100'}, $MessageHeaderFile );
  791- my %subnav_args = ();
  792- &Header2( undef, 'statistics', \%subnav_args );
  793- print "<h3>$text{'2100'}</h3>\n", $cust{'glob_header_e'}, "\n</div>\n", "<div id='adm_wrap'>\n", "<p><span class='strong'>$text{'2101'}</span> ", &commas($TotalMessages), "<br>\n", "<span class='strong'>$text{'2102'}</span> ", &commas($WeekCount), "</p>\n", "<table>\n", "    <tr>\n", "<th style='text-align:right;'>$text{'2103'}</th>\n", "<th colspan='2'>$text{'2104'}</th>\n", "    </tr>";
  794- my $MaxHeight = 500;
  795- my @sortedmessages = ( sort { $MessageCount{$b} <=> $MessageCount{$a} }
  796-                            keys %MessageCount );
  797- $multiplier = ( $MaxHeight / $MessageCount{ $sortedmessages[0] } )
  798-     if ($TotalMessages);
  799- &TrafficPrintList($firsttime);
  800- print "</table>\n", "</div>\n";
  801- &Footer( $MessageFooterFile, "credits" );
  802- } ## end sub TrafficStats
  803- 
  804- sub TrafficDateCheck {
  805- my $datecheck = $_[0];
  806- my ( $mday, $mon, $year ) = ( localtime($datecheck) )[ 3 .. 5 ];
  807- $year += 1900;
  808- if ( $mon < 10 )  { $mon  = '0' . $mon; }
  809- if ( $mday < 10 ) { $mday = '0' . $mday; }
  810- my $date = $year . $mon . $mday;
  811- unless ( $MessageCount{$date} ) {
  812- $MessageCount{$date} = '0';
  813- }
  814- $datecheck += 604800;
  815- unless ( $datecheck > $time ) { &TrafficDateCheck($datecheck); }
  816- } ## end sub TrafficDateCheck
  817- 
  818- sub TrafficPrintList {
  819- my $firsttime = $_[0];
  820- my ( $mday, $mon, $year ) = ( localtime($firsttime) )[ 3 .. 5 ];
  821- $year += 1900;
  822- print "<tr class='rollover' style='margin-left: 8px;'>\n", "<td style='text-align:right;'>$mday $months[$mon] $year</td>\n";
  823- if ( $mon < 10 )  { $mon  = '0' . $mon; }
  824- if ( $mday < 10 ) { $mday = '0' . $mday; }
  825- my $date = $year . $mon . $mday;
  826- print "<td style='text-align:right;'>", &commas( $MessageCount{$date} ), "</td>\n", "<td>";
  827- if ( $MessageCount{$date} > 0 ) {
  828- print "<div class='stats_line' style='width:", int( $MessageCount{$date} * $multiplier ), "px;'></div>";
  829- }
  830- print "</td>\n", "    </tr>";
  831- $firsttime += 604800;
  832- unless ( $firsttime > $time ) { &TrafficPrintList($firsttime); }
  833- } ## end sub TrafficPrintList
  834- 
  835- 1;