]> git.sesse.net Git - webpdf/commitdiff
Move the ���show_last��� parameter part of config.pm.
authorSteinar H. Gunderson <sesse@samfundet.no>
Tue, 9 Aug 2005 17:01:46 +0000 (17:01 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Tue, 9 Aug 2005 17:01:46 +0000 (17:01 +0000)
config.pm
last.pl

index 68030ea7b555ac58e2f6a7b9824a1718c9d7366b..e8bde1a55afb5d3e3319d5dd9faaa11b2d0e78b3 100644 (file)
--- a/config.pm
+++ b/config.pm
@@ -10,4 +10,7 @@ our $xserver = ":25";
 # Directory for PDF output.
 our $outputdir = "/home/cassarossa/itk/sesse/public_html/pdf/output";
 
 # Directory for PDF output.
 our $outputdir = "/home/cassarossa/itk/sesse/public_html/pdf/output";
 
+# How many thumbnails to show in the “last uploaded” page.
+our $show_last = 20;
+
 1;
 1;
diff --git a/last.pl b/last.pl
index 58e8a2146a0a487e18bb25192497e73e672435b2..99ee2f5ac082cec37afc8165e99f241e93063d59 100755 (executable)
--- a/last.pl
+++ b/last.pl
@@ -6,14 +6,12 @@ use strict;
 use warnings;
 require './config.pm';
 
 use warnings;
 require './config.pm';
 
-my $num_last = 20;
-
 # Find the latest N PNG thumbnails. Somewhat ineffective, but I assume 
 # we'll get to that later :-)
 my @thumbnails = (sort { -M $a <=> -M $b } <$pdfweb::config::outputdir/*.png>);
 # Find the latest N PNG thumbnails. Somewhat ineffective, but I assume 
 # we'll get to that later :-)
 my @thumbnails = (sort { -M $a <=> -M $b } <$pdfweb::config::outputdir/*.png>);
-my $real_num_last = scalar @thumbnails;
-if ($real_num_last > $num_last) {
-       $real_num_last = $num_last;
+my $real_show_last = scalar @thumbnails;
+if ($real_show_last > $pdfweb::config::show_last) {
+       $real_show_last = $pdfweb::config::show_last;
 }
 
 # Sorry, no HTML templating. I didn't want to pull in yet another
 }
 
 # Sorry, no HTML templating. I didn't want to pull in yet another
@@ -35,12 +33,12 @@ Content-type: text/html; charset=utf-8
     <meta name="MSSmartTagsPreventParsing" content="TRUE" />
   </head>
   <body>
     <meta name="MSSmartTagsPreventParsing" content="TRUE" />
   </head>
   <body>
-    <h1>Last $real_num_last uploads</h1>
+    <h1>Last $real_show_last uploads</h1>
     
     <p><a href="http://pdf.sesse.net/">Back to the converter</a></p>
 EOF
 
     
     <p><a href="http://pdf.sesse.net/">Back to the converter</a></p>
 EOF
 
-for my $t (@thumbnails[0..$num_last-1]) {
+for my $t (@thumbnails[0..$pdfweb::config::show_last-1]) {
        (my $descname = $t) =~ s/\.png$/.desc/;
        open DESC, "<$descname"
                or next;
        (my $descname = $t) =~ s/\.png$/.desc/;
        open DESC, "<$descname"
                or next;