mhonarc-commits
[Top] [All Lists]

CVS: mharc/bin web-archive,1.36,1.37

2002-09-18 11:50:37
Update of /cvsroot/mhonarc/mharc/bin
In directory subversions:/tmp/cvs-serv16283/bin

Modified Files:
	web-archive 
Log Message:
Added support for localizing all-lists page archive listing.


Index: web-archive
===================================================================
RCS file: /cvsroot/mhonarc/mharc/bin/web-archive,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** web-archive	18 Sep 2002 17:23:28 -0000	1.36
--- web-archive	18 Sep 2002 18:50:24 -0000	1.37
***************
*** 42,45 ****
--- 42,46 ----
  
  use Getopt::Long;
+ use POSIX;
  use MHArc::ListDef;
  use MHArc::Util qw( usage );
***************
*** 622,628 ****
  sub format_date {
    my $time = shift;
!   my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($time);
!   $year += 1900;  ++$mon;
!   sprintf("%d-%02d-%02d %02d:%02d:%02d", $year,$mon,$mday,$hour,$min,$sec);
  }
  
--- 623,631 ----
  sub format_date {
    my $time = shift;
!   my $fmt  = shift || '%Y-%m-%d %H:%M:%S';
!   #my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($time);
!   #$year += 1900;  ++$mon;
!   #sprintf("%d-%02d-%02d %02d:%02d:%02d", $year,$mon,$mday,$hour,$min,$sec);
!   POSIX::strftime($fmt, localtime($time));
  }
  
***************
*** 700,703 ****
--- 703,730 ----
  			      join('/', $html_dir, '.PNM.all-foot');
  
+   my $label_name  = $opts{'-label-name'} ||
+ 			      $config->{'ALL_LISTS_LABEL_NAME'} ||
+ 			      'Name';
+   my $label_indexes
+ 		  = $opts{'-label-indexes'} ||
+ 			      $config->{'ALL_LISTS_LABEL_INDEXES'} ||
+ 			      'Current Index';
+   my $label_last  = $opts{'-label-last-updated'} ||
+ 			      $config->{'ALL_LISTS_LABEL_LAST_UPDATED'} ||
+ 			      'Last Updated';
+   my $label_info  = $opts{'-label-info'} ||
+ 			      $config->{'ALL_LISTS_LABEL_INFO'} ||
+ 			      '[info]';
+   my $label_date  = $opts{'-label-date'} ||
+ 			      $config->{'ALL_LISTS_LABEL_DATE'} ||
+ 			      '[Date]';
+   my $label_threads
+ 		  = $opts{'-label-threads'} ||
+ 			      $config->{'ALL_LISTS_LABEL_THREADS'} ||
+ 			      '[Threads]';
+   my $time_fmt    = $opts{'-time-fmt'} ||
+ 			      $config->{'ALL_LISTS_DATE_FORMAT'} ||
+ 			      '%Y-%m-%d %H:%M:%S';
+ 
    local(*IDX);
    my $tmp_index   = $index_html . ".tmp";
***************
*** 733,739 ****
    print IDX qq|<table class="archiveLists" cellpadding="3" cellspacing="1">\n|,
  	    qq|<tr class="listsHeaderRow" valign="baseline" align="left">\n|,
! 	    qq|<th>Name</th>|,
! 	    qq|<th>Current&nbsp;Index</th>|,
! 	    qq|<th>Last&nbsp;Updated</th>|,
  	    qq|\n</tr>\n|;
  
--- 760,766 ----
    print IDX qq|<table class="archiveLists" cellpadding="3" cellspacing="1">\n|,
  	    qq|<tr class="listsHeaderRow" valign="baseline" align="left">\n|,
! 	    qq|<th>$label_name</th>|,
! 	    qq|<th>$label_indexes</th>|,
! 	    qq|<th>$label_last</th>|,
  	    qq|\n</tr>\n|;
  
***************
*** 744,748 ****
  
      print "Printing listing for $list\n"  if $debug;
!     $last_updated = format_date($time);
      $last_updated =~ s/ /\&nbsp;/g;
      my $short_title = entify($listname);
--- 771,775 ----
  
      print "Printing listing for $list\n"  if $debug;
!     $last_updated = format_date($time, $time_fmt);
      $last_updated =~ s/ /\&nbsp;/g;
      my $short_title = entify($listname);
***************
*** 763,767 ****
      print IDX qq|<td>&nbsp;<span class="listName">|,
  	      qq|<a href="$html_url/$list/">$short_title</a></span>&nbsp;|;
!     print IDX qq|<a class="infoLink" href="$info">[info]</a>&nbsp;|
  		  if defined($info);
      print IDX qq|</td>\n|;
--- 790,794 ----
      print IDX qq|<td>&nbsp;<span class="listName">|,
  	      qq|<a href="$html_url/$list/">$short_title</a></span>&nbsp;|;
!     print IDX qq|<a class="infoLink" href="$info">$label_info</a>&nbsp;|
  		  if defined($info);
      print IDX qq|</td>\n|;
***************
*** 769,775 ****
  
      print IDX qq|<td>|;
!     print IDX qq|&nbsp;<a href="$html_url/$list/$latest/index.html">[Date]</a>&nbsp;|
  	if (-e join('/', $dir, $latest, 'index.html'));
!     print IDX qq|&nbsp;<a href="$html_url/$list/$latest/threads.html">[Thread]</a>&nbsp;|
  	if (-e join('/', $dir, $latest, 'threads.html'));
      print IDX qq|</td>\n|;
--- 796,802 ----
  
      print IDX qq|<td>|;
!     print IDX qq|&nbsp;<a href="$html_url/$list/$latest/index.html">$label_date</a>&nbsp;|
  	if (-e join('/', $dir, $latest, 'index.html'));
!     print IDX qq|&nbsp;<a href="$html_url/$list/$latest/threads.html">$label_threads</a>&nbsp;|
  	if (-e join('/', $dir, $latest, 'threads.html'));
      print IDX qq|</td>\n|;

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV