9 # Find the latest N PNG thumbnails. Somewhat ineffective, but I assume
10 # we'll get to that later :-)
11 my @thumbnails = (sort { -M $a <=> -M $b } <$pdfweb::config::outputdir/*.png>);
12 my $real_show_last = scalar @thumbnails;
13 if ($real_show_last > $pdfweb::config::show_last) {
14 $real_show_last = $pdfweb::config::show_last;
17 # Sorry, no HTML templating. I didn't want to pull in yet another
21 Content-type: text/html; charset=utf-8
23 <?xml version="1.0" encoding="UTF-8" ?>
25 html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
26 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
27 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
29 <title>PDF converter : sesse.net</title>
30 <link rel="stylesheet" href="http://www.sesse.net/sesse.css" type="text/css" />
31 <link rel="stylesheet" href="pdfweb.css" type="text/css" />
32 <link rev="made" href="mailto:sgunderson\@bigfoot.com" />
33 <meta name="MSSmartTagsPreventParsing" content="TRUE" />
36 <h1>Last $real_show_last uploads</h1>
38 <p><a href="http://pdf.sesse.net/">Back to the converter</a></p>
41 for my $t (@thumbnails[0..$pdfweb::config::show_last-1]) {
42 (my $descname = $t) =~ s/\.png$/.desc/;
43 open DESC, "<$descname"
45 chomp (my $desc = <DESC>);
48 if (length($desc) > 30) {
49 $desc = substr($desc, 0, 30) . " ...";
51 $desc = HTML::Entities::encode_entities($desc);
53 my $time = (stat($t))[9];
54 my $date = POSIX::strftime("%Y-%m-%d %H:%M", localtime($time));
56 (my $pdfname = $t) =~ s/\.png$//;
59 <div class="pdfthumbnail">
60 <p class="thumb"><a href="output/$pdfname"><img src="output/$t" alt="PDF thumbnail" /></a></p>
61 <p class="desc">$desc</p>
62 <p class="date">$date</p>
69 <p class="copyright">Web PDF converter, © 2005 <a href="http://www.sesse.net/">Steinar H. Gunderson</a>.</p>