There's no extremely simple way to do this, but it isn't impossible.
You are probably going to need to enable SSI on your main page. Then, what you do is add something like:
<!--#include virtual="/cgi-bin/new_posts.cgi"-->
The contents of the "new_posts.cgi" file that you'll create should be something like this:
Code:
#!/usr/bin/perl
use lib '/path/to/gforum/admin';
use GForum qw/$DB/;
GForum::init('/path/to/gforum/admin');
my $p = $DB->table("Post");
$p->select_options("ORDER BY post_latest_reply", "LIMIT
10");
my $sth = $DB->table("Post")->select('post_id', 'post_subject', 'post_time' => {
forum_id_fk =>
123,
post_root_id => 0
});
print "Content-type: text/html\n\n";
while (my ($id, $subject, $time) = $sth->fetchrow) {
$subject = GT::CGI::html_escape($subject);
print qq|<li><a href="/url/to/gforum.cgi?post=$id">$subject</a></li>\n|;
}
Now, if you access that new_posts.cgi (you'll probably need to 'chmod 755' it first) you should see a list of topics, each linked to the appropriate thread. You'll need to change the bit in
red to the proper forum ID, and the part in
orange to the number of posts you want to display. Of course, you can also change the <li> and <a> tags as required to fit the appearance you desire.
Now, if the SSI is working, you should see the HTML produced by that CGI on your main page, where the SSI include was. We use something similar to this for the "news" section of our site, based on the threads of the Announcement forum.
Jason Rhinelander
Gossamer Threads jason@gossamer-threads.com