5 # Create per-month index assuming that directory structure is ./YYYY/MM/...
6 # non-four-numeric subtis are put on a separate list.
7 # Output to stdout (redirect >index.html if you wish)
9 # Copyright (c) 2006 Eugene G. Crosser
11 # This software is provided 'as-is', without any express or implied
12 # warranty. In no event will the authors be held liable for any damages
13 # arising from the use of this software.
15 # Permission is granted to anyone to use this software for any purpose,
16 # including commercial applications, and to alter it and redistribute it
17 # freely, subject to the following restrictions:
19 # 1. The origin of this software must not be misrepresented; you must not
20 # claim that you wrote the original software. If you use this software
21 # in a product, an acknowledgment in the product documentation would be
22 # appreciated but is not required.
23 # 2. Altered source versions must be plainly marked as such, and must not be
24 # misrepresented as being the original software.
25 # 3. This notice may not be removed or altered from any source distribution.
29 use CGI qw/:html *table *Tr *center/;
34 opendir(D,'.') || die "cannot open current directory: $!";
35 while (my $de=readdir(D)) {
36 next if ($de =~/^\./);
38 if ($de =~ /^\d\d\d\d$/) {
62 print start_html(-title=>'Gallery'),"\n";
63 print start_center,"\n";
64 print h1("Gallery Index"),"\n";
65 print start_table({-cellspacing=>3}),"\n";
66 foreach my $yr(sort @years) {
68 print td({-bgcolor=>"#ffc0ff"},$yr);
69 for (my $mo=1;$mo<=12;$mo++) {
70 my $dir=sprintf "%04d/%02d",$yr,$mo;
72 print td({-bgcolor=>"#ffffc0"},a({-href=>$dir.'/'},$mn[$mo]));
74 print td({-bgcolor=>"#c0c0c0"},$mn[$mo]);
79 print end_table,p,"\n";
81 print start_table({-cellspacing=>3}),"\n";
82 foreach my $sub(sort @subdirs) {
83 print Tr(td({-bgcolor=>"#ffffc0"},a({-href=>$sub.'/'},$sub)));
87 print end_center,"\n";