Here goes. First, you'll need to scrub some of the styles, tables, etc. in the attached templates, sorry (but hopefully they'll get you started)! Once you do that, create a new template directory and load the attached templates into them.
Create this global (which I got from somewhere here a long time ago):
Code:
sub { my $tags = shift;
my $post_db = $DB->table ('Post');
$post_db->select_options ('WHERE post_root_id=0', 'ORDER BY post_time DESC', 'LIMIT 10');
my $sth = $post_db->select;
my @output;
while (my $post = $sth->fetchrow_hashref) { push @output, $post;
} return { post_loop => \@output };
}
I called it hot_threads; if you change the name, change it in the attached category_list.html. What it does in category_list.html is bring up a list of the linked subject lines of your ten most recent threads (change LIMIT to your tastes). You could also use it to add "descriptions" of the threads, i.e., the first X characters of the first post by creating a separate global called html_strip (a sample is attached) and then wrap the post_message variable in category_list.html with it like this:
Code:
<%html_strip($post_message)%>
It's longer than it should be for an SSI, but I'm also using it to strip out certain characters for generating an RSS feed (the attached version calls up to the first 200 characters). To limit the size of the subject lines, I created a global like this:
Code:
sub {
my $post_subject = shift;
return substr($post_subject,0,60);
}
where "60" is the number of characters you want - and wrap post_subject with it like this:
Code:
<%antisaklad($post_subject)%>
(in honor of a user who was forever writing subject lines as long as your average romance novel).
To actually call all this stuff via SSIs:
Create an SSI pointing at /cgi-bin/forum/gforum.cgi?t=ssi (where "ssi" is the name of your SSI-template directory) to bring up the ten most recent threads (the attached template also has a similar block to call up the ten most posted-to threads; feel free to delete).
If you want to call up the most recently commented-on threads in a particular forum, create an SSI for /cgi-bin/forum/gforum.cgi?forum=24;t=ssi - swapping in the ID number of the actual forum you pointed to.
We're a newspaper, so I also created similar SSIs to link articles to individual comments on them; if you want those, let me know.