--- trunk/httpd.pl 2004/05/07 11:25:01 17 +++ trunk/httpd.pl 2004/05/07 20:52:34 19 @@ -107,11 +107,24 @@ # # ?show_id=XXXXxxxx___message_id___xxxxXXXX } elsif ($param->{'show_id'}) { - + + $mws->reset_counters; my $row = $mws->fetch_result_by_id($param->{'show_id'}); $tpl_var->{message} = $row; } +print Dumper($mws->{counter}); + + # push counters to template + foreach my $f (qw(from to cc bcc)) { + my $h = $mws->counter($f) || next; + my @a; + foreach my $k (sort { $h->{$b}->{usage} <=> $h->{$a}->{usage} } keys %$h) { + push @a, $h->{$k}; + } + $tpl_var->{counters}->{$f} = [ @a ] if (@a); + } + $tt->process($tpl_file, $tpl_var, \$html) || die $tt->error(); # @@ -154,7 +167,9 @@ while ( $s =~ s/^\s*\[(?:re|fwd|fw):\s+(.+)\]\s*$/$1/ig || $s =~ s/^\s*(?:re|fwd|fw):\s+(.+?)\s*$/$1/ig || $s =~ s/^\[\S+\]\s*//ig || - $s =~ s/^\[[^@]+@\w+\.\w+\s*:\s+(.+)\s*\]\s*$/$1/g + $s =~ s/^\[[^@]+@\w+\.\w+\s*:\s+(.+)\s*\]\s*$/$1/g || + $s =~ s/\(fwd\)\s*$//ig || + $s =~ s/\"//g ) { }; return $s; }