/[irc-logger]/trunk/bin/irc-logger.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/irc-logger.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 25 by dpavlin, Sat May 20 10:12:19 2006 UTC revision 26 by dpavlin, Sat May 20 10:30:45 2006 UTC
# Line 116  sub get_from_log { Line 116  sub get_from_log {
116          $args->{limit} ||= 10;          $args->{limit} ||= 10;
117    
118          $args->{fmt} ||= {          $args->{fmt} ||= {
119                    date => '[%s] ',
120                  time => '{%s} ',                  time => '{%s} ',
121                  time_channel => '{%s %s} ',                  time_channel => '{%s %s} ',
122                  nick => '%s: ',                  nick => '%s: ',
# Line 202  sub get_from_log { Line 203  sub get_from_log {
203    
204                  $row->{time} =~ s#\.\d+##;                  $row->{time} =~ s#\.\d+##;
205    
                 my $t;  
                 $t = $row->{date} . ' ' if ($last_row->{date} ne $row->{date});  
                 $t .= $row->{time};  
   
206                  my $msg = '';                  my $msg = '';
207    
208                    $msg = sprintf($args->{fmt}->{date}, $row->{date}) . ' ' if ($last_row->{date} ne $row->{date});
209                    my $t = $row->{time};
210    
211                  if ($last_row->{channel} ne $row->{channel}) {                  if ($last_row->{channel} ne $row->{channel}) {
212                          $msg .= sprintf($args->{fmt}->{time_channel}, $t, $row->{channel});                          $msg .= sprintf($args->{fmt}->{time_channel}, $t, $row->{channel});
213                  } else {                  } else {
# Line 487  my $escape_re  = join '|' => keys %escap Line 487  my $escape_re  = join '|' => keys %escap
487  my $style = <<'_END_OF_STYLE_';  my $style = <<'_END_OF_STYLE_';
488  p { margin: 0; padding: 0.1em; }  p { margin: 0; padding: 0.1em; }
489  .time, .channel { color: #808080; font-size: 60%; }  .time, .channel { color: #808080; font-size: 60%; }
490    .date { float: right; background: #404040; color: #e0e0e0; font-size: 120%; padding: 0.5em; border-top: 1px dashed #e0e0e0; }
491  .nick { color: #000000; font-size: 80%; padding: 2px; font-family: courier, courier new, monospace ; }  .nick { color: #000000; font-size: 80%; padding: 2px; font-family: courier, courier new, monospace ; }
492  .message { color: #000000; font-size: 100%; }  .message { color: #000000; font-size: 100%; }
493  .search { float: right; }  .search { float: right; }
# Line 531  sub root_handler { Line 532  sub root_handler {
532                                  limit => $q->param('last') || 100,                                  limit => $q->param('last') || 100,
533                                  search => $q->param('search') || $q->param('grep') || undef,                                  search => $q->param('search') || $q->param('grep') || undef,
534                                  fmt => {                                  fmt => {
535                                            date => '<hr size="1"/><div class="date">%s</div> ',
536                                          time => '<span class="time">%s</span> ',                                          time => '<span class="time">%s</span> ',
537                                          time_channel => '<span class="channel">%s %s</span> ',                                          time_channel => '<span class="channel">%s %s</span> ',
538                                          nick => '%s:&nbsp;',                                          nick => '%s:&nbsp;',

Legend:
Removed from v.25  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26