return @stuff;
}
-sub _recent_uploads { Memories::Photo->search_recent() }
-sub _random { Memories::Photo->search_random() }
+for my $how (qw(random recent interesting popular)) {
+ no strict;
+ my $method = "search_$how";
+ *{"_$how"} = sub { Memories::Photo->$method };
+ *{$how} = sub { shift->do_cached(\&{"_$how"})};
+}
-sub recent_uploads { shift->do_cached(\&_recent_uploads) }
-sub random { shift->do_cached(\&_random) }
sub tagcloud { shift->do_cached(\&_tagcloud) }
sub _tagcloud {
[% INCLUDE header %]
-<h1> Welcome to Memories </h1>
-
+[% PROCESS macros %]
+<table class="frontpagetable" width="100%">
+[% FOR how = ["popular", "interesting", "random"] %]
+<tr><th colspan="4">[%how | ucfirst%] photos</th></tr>
+<tr>
+[% FOR pic = request.$how %]
+ <td align="center"> [% minithumb(pic) %] <br> [%pic.title%] </td>
+[% END %]
+</tr>
+[% END %]
+</table>
+
<p>
Memories is a site where you can upload and share your photos.
</p>
.photolicense { font-size: 80%; padding: 10px; }
.smaller { font-size: 80% }
+.frontpagetable { padding: 10px; }
+.frontpagetable th { border: 1px solid black; }
span.tagcloud0 { font-size: 9px;}
span.tagcloud1 { font-size: 10px;}
span.tagcloud2 { font-size: 10px;}