From 07ea12f5301c50d4c6595be5cba8544658ddc7f6 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 9 Aug 2005 17:01:46 +0000 Subject: [PATCH] =?utf8?q?Move=20the=20=EF=BF=BD=EF=BF=BD=EF=BF=BDshow=5Fl?= =?utf8?q?ast=EF=BF=BD=EF=BF=BD=EF=BF=BD=20parameter=20part=20of=20config.?= =?utf8?q?pm.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- config.pm | 3 +++ last.pl | 12 +++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/config.pm b/config.pm index 68030ea..e8bde1a 100644 --- 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"; +# How many thumbnails to show in the “last uploaded” page. +our $show_last = 20; + 1; diff --git a/last.pl b/last.pl index 58e8a21..99ee2f5 100755 --- a/last.pl +++ b/last.pl @@ -6,14 +6,12 @@ use strict; 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>); -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 @@ -35,12 +33,12 @@ Content-type: text/html; charset=utf-8 -

Last $real_num_last uploads

+

Last $real_show_last uploads

Back to the converter

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; -- 2.39.2