mhonarc-commits
[Top] [All Lists]

CVS: mhonarc/MHonArc/lib mhamain.pl,2.75,2.76 mhdb.pl,2.36,2.37 mhindex.pl,...

2004-12-15 13:33:48
Update of /home/users/mhonarc.org/ehood/cvs/mhonarc/mhonarc/MHonArc/lib
In directory denethor.mallorn.com:/tmp/cvs-serv24301

Modified Files:
	mhamain.pl mhdb.pl mhindex.pl mhinit.pl mhopt.pl mhrcfile.pl 
	mhrcvars.pl mhthread.pl mhusage.pl 
Log Message:
Addition of MAXPGS resource: Sets the maximum number of index pages
generated when MULTIPG is active.  Resource is probably only useful
for unusual usage cases of mhonarc.  Resource added to satisfy a
particular need for a user.


Index: mhamain.pl
===================================================================
RCS file: /home/users/mhonarc.org/ehood/cvs/mhonarc/mhonarc/MHonArc/lib/mhamain.pl,v
retrieving revision 2.75
retrieving revision 2.76
diff -C2 -r2.75 -r2.76
*** mhamain.pl	22 May 2004 18:01:24 -0000	2.75
--- mhamain.pl	15 Dec 2004 20:33:39 -0000	2.76
***************
*** 266,269 ****
--- 266,270 ----
  	    $IdxPageNum = 1;
  	    $NumOfPages = 1;
+ 	    $NumOfPrintedPages = 1;
  	}
  	if ($THREAD) {
***************
*** 679,685 ****
--- 680,694 ----
  	++$NumOfPages      if ($NumOfMsgs/$IDXSIZE) > $NumOfPages;
  	$NumOfPages   = 1  if $NumOfPages == 0;
+ 
+ 	$NumOfPrintedPages = $NumOfPages;
+ 	if (($MAXPGS > 0) && ($MAXPGS < $NumOfPages)) {
+ 	    $NumOfPrintedPages = $MAXPGS;
+ 	}
+ 
      } else {
  	$NumOfPages = 1;
+ 	$NumOfPrintedPages = 1;
      }
+ 
  }
  

Index: mhdb.pl
===================================================================
RCS file: /home/users/mhonarc.org/ehood/cvs/mhonarc/mhonarc/MHonArc/lib/mhdb.pl,v
retrieving revision 2.36
retrieving revision 2.37
diff -C2 -r2.36 -r2.37
*** mhdb.pl	7 Oct 2003 02:29:17 -0000	2.36
--- mhdb.pl	15 Dec 2004 20:33:39 -0000	2.37
***************
*** 70,76 ****
--- 70,78 ----
  print_var($db,'ExtraHFields',\%ExtraHFields);
  print_var($db,'TListOrder',  \(_at_)TListOrder);
+ print_var($db,'MAXPGS',      \$MAXPGS);
  print_var($db,'MULTIIDX',    \$MULTIIDX);
  print_var($db,'NumOfMsgs',   \$NumOfMsgs);
  print_var($db,'NumOfPages',  \$NumOfPages);
+ print_var($db,'NumOfPrintedPages',\$NumOfPrintedPages);
  print_var($db,'SaveRsrcs',   \$SaveRsrcs);
  

Index: mhindex.pl
===================================================================
RCS file: /home/users/mhonarc.org/ehood/cvs/mhonarc/mhonarc/MHonArc/lib/mhindex.pl,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** mhindex.pl	20 Nov 2002 23:53:12 -0000	1.11
--- mhindex.pl	15 Dec 2004 20:33:39 -0000	1.12
***************
*** 41,45 ****
      &compute_page_total();
      $PageNum    = $onlypg || 1;
!     $totalpgs   = $onlypg || $NumOfPages;
      if (!scalar(@MListOrder)) {
  	@MListOrder = &sort_messages();
--- 41,45 ----
      &compute_page_total();
      $PageNum    = $onlypg || 1;
!     $totalpgs   = $onlypg || $NumOfPrintedPages;
      if (!scalar(@MListOrder)) {
  	@MListOrder = &sort_messages();

Index: mhinit.pl
===================================================================
RCS file: /home/users/mhonarc.org/ehood/cvs/mhonarc/mhonarc/MHonArc/lib/mhinit.pl,v
retrieving revision 2.51
retrieving revision 2.52
diff -C2 -r2.51 -r2.52
*** mhinit.pl	17 Oct 2003 22:01:38 -0000	2.51
--- mhinit.pl	15 Dec 2004 20:33:39 -0000	2.52
***************
*** 271,274 ****
--- 271,275 ----
  $SLOW		= 0;	# Save memory flag
  $NumOfPages	= 0;	# Number of index pages
+ $NumOfPrintedPages = 0;	# Number of printed index pages
  $IdxMinPg	= -1;	# Starting page of index for updating
  $TIdxMinPg	= -1;	# Starting page of thread index for updating
***************
*** 347,350 ****
--- 348,352 ----
  $CONLEN      = defined($ENV{'M2H_CONLEN'})    ?  $ENV{'M2H_CONLEN'}	: 0;
  $MAIN        = defined($ENV{'M2H_MAIN'})      ?  $ENV{'M2H_MAIN'}	: 1;
+ $MAXPGS      = defined($ENV{'M2H_MAXPGS'})    ?  $ENV{'M2H_MAXPGS'}	: 0;
  $MULTIIDX    = defined($ENV{'M2H_MULTIPG'})   ?  $ENV{'M2H_MULTIPG'}	: 0;
  $MODTIME     = defined($ENV{'M2H_MODTIME'})   ?  $ENV{'M2H_MODTIME'}	: 0;

Index: mhopt.pl
===================================================================
RCS file: /home/users/mhonarc.org/ehood/cvs/mhonarc/mhonarc/MHonArc/lib/mhopt.pl,v
retrieving revision 2.56
retrieving revision 2.57
diff -C2 -r2.56 -r2.57
*** mhopt.pl	2 Oct 2003 03:30:58 -0000	2.56
--- mhopt.pl	15 Dec 2004 20:33:39 -0000	2.57
***************
*** 97,100 ****
--- 97,101 ----
  	'mailtourl=s',	# URL to use for e-mail address hyperlinks
  	'main',		# Create a main index
+ 	'maxpgs=i',	# Maximum number of index pages
  	'maxsize=i',	# Maximum number of messages allowed in archive
  	'mbox',		# Use mailbox format		(ignored now)
***************
*** 510,513 ****
--- 511,516 ----
      $MAILTOURL	= $opt{'mailtourl'}  if $opt{'mailtourl'};
      $NewsUrl	= $opt{'newsurl'}    if $opt{'newsurl'};
+     $MAXPGS	= $opt{'maxpgs'}     if defined($opt{'maxpgs'});
+ 	$MAXPGS = 0  if $MAXPGS < 0;
      $MAXSIZE	= $opt{'maxsize'}    if defined($opt{'maxsize'});
  	$MAXSIZE = 0  if $MAXSIZE < 0;

Index: mhrcfile.pl
===================================================================
RCS file: /home/users/mhonarc.org/ehood/cvs/mhonarc/mhonarc/MHonArc/lib/mhrcfile.pl,v
retrieving revision 2.41
retrieving revision 2.42
diff -C2 -r2.41 -r2.42
*** mhrcfile.pl	15 Mar 2004 20:28:23 -0000	2.41
--- mhrcfile.pl	15 Dec 2004 20:33:40 -0000	2.42
***************
*** 505,508 ****
--- 505,514 ----
  	    $MAIN = 1; last FMTSW;
  	}
+ 	if ($elem eq 'maxpgs') {		# Max number of index pages
+ 	    if (($tmp = &get_elem_int($handle, $elem, 1)) ne '') {
+ 		$MAXPGS = $tmp;
+ 	    }
+ 	    last FMTSW;
+ 	}
  	if ($elem eq 'maxsize') {		# Size of archive
  	    if (($tmp = &get_elem_int($handle, $elem, 1)) ne '') {

Index: mhrcvars.pl
===================================================================
RCS file: /home/users/mhonarc.org/ehood/cvs/mhonarc/mhonarc/MHonArc/lib/mhrcvars.pl,v
retrieving revision 2.26
retrieving revision 2.27
diff -C2 -r2.26 -r2.27
*** mhrcvars.pl	1 Oct 2003 04:30:42 -0000	2.26
--- mhrcvars.pl	15 Dec 2004 20:33:40 -0000	2.27
***************
*** 432,436 ****
  	}
      	if ($var eq 'IDXFNAME') {	## Filename of index page
! 	    if ($MULTIIDX && ($n = int($Index2MLoc{$index}/$IDXSIZE)+1) > 1) {
  		$tmp = sprintf("%s%d.$HtmlExt",
  			       $IDXPREFIX, $index ne '' ? $n : 1);
--- 432,439 ----
  	}
      	if ($var eq 'IDXFNAME') {	## Filename of index page
! 	    if ($MULTIIDX &&
! 		(($n = int($Index2MLoc{$index}/$IDXSIZE)+1) > 1) &&
! 		(($MAXPGS <= 0) || ($n <= $MAXPGS)))
! 	    {
  		$tmp = sprintf("%s%d.$HtmlExt",
  			       $IDXPREFIX, $index ne '' ? $n : 1);
***************
*** 473,477 ****
  	}
      	if ($var eq 'TIDXFNAME') {
! 	    if ($MULTIIDX && ($n = int($Index2TLoc{$index}/$IDXSIZE)+1) > 1) {
  		$tmp = sprintf("%s%d.$HtmlExt",
  			       $TIDXPREFIX, $index ne '' ? $n : 1);
--- 476,483 ----
  	}
      	if ($var eq 'TIDXFNAME') {
! 	    if ($MULTIIDX &&
! 		(($n = int($Index2TLoc{$index}/$IDXSIZE)+1) > 1) &&
! 		(($MAXPGS <= 0) || ($n <= $MAXPGS)))
! 	    {
  		$tmp = sprintf("%s%d.$HtmlExt",
  			       $TIDXPREFIX, $index ne '' ? $n : 1);
***************
*** 505,509 ****
  	    SW: {
  		if ($arg eq 'NEXT') {
! 		    $tmp = $PageNum < $NumOfPages ?
  		    			$NEXTPGLINK : $NEXTPGLINKIA;
  		    last SW; }
--- 511,515 ----
  	    SW: {
  		if ($arg eq 'NEXT') {
! 		    $tmp = $PageNum < $NumOfPrintedPages ?
  		    			$NEXTPGLINK : $NEXTPGLINKIA;
  		    last SW; }
***************
*** 512,516 ****
  		    last SW; }
  		if ($arg eq 'TNEXT') {
! 		    $tmp = $PageNum < $NumOfPages ?
  		    			$TNEXTPGLINK : $TNEXTPGLINKIA;
  		    last SW; }
--- 518,522 ----
  		    last SW; }
  		if ($arg eq 'TNEXT') {
! 		    $tmp = $PageNum < $NumOfPrintedPages ?
  		    			$TNEXTPGLINK : $TNEXTPGLINKIA;
  		    last SW; }
***************
*** 548,554 ****
  	    if ($after ne "") {
  		$after  = $num + abs($after);
! 		$after  = $NumOfPages  unless $after < $NumOfPages;
  	    } else {
! 		$after  = $NumOfPages;
  	    }
  	    $tmp = "";
--- 554,561 ----
  	    if ($after ne "") {
  		$after  = $num + abs($after);
! 		$after  = $NumOfPrintedPages
! 			  unless $after < $NumOfPrintedPages;
  	    } else {
! 		$after  = $NumOfPrintedPages;
  	    }
  	    $tmp = "";
***************
*** 576,580 ****
  	}
  	if ($var eq 'NUMOFPAGES') {
! 	    $tmp = $NumOfPages;
  	    last REPLACESW;
  	}
--- 583,588 ----
  	}
  	if ($var eq 'NUMOFPAGES') {
! 	    #$tmp = $NumOfPages;
! 	    $tmp = $NumOfPrintedPages;
  	    last REPLACESW;
  	}
***************
*** 588,592 ****
  		if ($arg eq 'PREV')    { $num = $PageNum-1; last SW; }
  		if ($arg eq 'FIRST')   { $num = 0; last SW; }
! 		if ($arg eq 'LAST')    { $num = $NumOfPages; last SW; }
  		if ($arg =~ /^-?\d+$/) { $num = $PageNum+$arg; last SW; }
  	    }
--- 596,600 ----
  		if ($arg eq 'PREV')    { $num = $PageNum-1; last SW; }
  		if ($arg eq 'FIRST')   { $num = 0; last SW; }
! 		if ($arg eq 'LAST')    { $num = $NumOfPrintedPages; last SW; }
  		if ($arg =~ /^-?\d+$/) { $num = $PageNum+$arg; last SW; }
  	    }
***************
*** 594,598 ****
  		$tmp = $t ? $TIDXNAME : $IDXNAME;
  	    } else {
! 		$num = $NumOfPages  if $num > $NumOfPages;
  		$tmp = sprintf("%s%d.$HtmlExt", $prefix, $num);
  	    }
--- 602,606 ----
  		$tmp = $t ? $TIDXNAME : $IDXNAME;
  	    } else {
! 		$num = $NumOfPrintedPages  if $num > $NumOfPrintedPages;
  		$tmp = sprintf("%s%d.$HtmlExt", $prefix, $num);
  	    }

Index: mhthread.pl
===================================================================
RCS file: /home/users/mhonarc.org/ehood/cvs/mhonarc/mhonarc/MHonArc/lib/mhthread.pl,v
retrieving revision 2.11
retrieving revision 2.12
diff -C2 -r2.11 -r2.12
*** mhthread.pl	20 Nov 2002 23:53:12 -0000	2.11
--- mhthread.pl	15 Dec 2004 20:33:40 -0000	2.12
***************
*** 56,60 ****
      @ThreadList = @TListOrder;
      $PageNum  = $onlypg || 1;
!     $totalpgs = $onlypg || $NumOfPages;
   
      for ( ; $PageNum <= $totalpgs; ++$PageNum) {
--- 56,60 ----
      @ThreadList = @TListOrder;
      $PageNum  = $onlypg || 1;
!     $totalpgs = $onlypg || $NumOfPrintedPages;
   
      for ( ; $PageNum <= $totalpgs; ++$PageNum) {

Index: mhusage.pl
===================================================================
RCS file: /home/users/mhonarc.org/ehood/cvs/mhonarc/mhonarc/MHonArc/lib/mhusage.pl,v
retrieving revision 2.25
retrieving revision 2.26
diff -C2 -r2.25 -r2.26
*** mhusage.pl	2 Oct 2003 03:30:58 -0000	2.25
--- mhusage.pl	15 Dec 2004 20:33:40 -0000	2.26
***************
*** 119,122 ****
--- 119,123 ----
                               (def: "mailto:\$TO\$";)
    -main                    : Create a main index
+   -maxpgs <#>              : Maximum number of index pages
    -maxsize <#>             : Maximum number of messages allowed in archive
    -mhpattern <exp>         : Perl expression for message files in a directory

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