Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Newest Threads Forum Seclection

Quote Reply
Newest Threads Forum Seclection
Can someone please help how I can use this script below, to show latest threads from a particular forum.
What I mean is, lets say your forums are named:
1.Automotive 2.Computers 3.General, and you only want to show threads of forum 2(Computers and all it's sub's).

# get the details of the recents posts from the database
my $db = new GT::SQL $path . '/defs';
my $post_db = $db->table ('Post');
$post_db->select_options('ORDER BY post_time DESC', "LIMIT $num");
my $sth = $post_db->select;
my @output;
my $date = date_get();
while (my $post = $sth->fetchrow_hashref) {
$$post{'time_ago'} = time_ago($$post{'post_time'});
$$post{'post_time'} = date_get($$post{'post_time'});
push @output, $post;
}
Subject Author Views Date
Thread Newest Threads Forum Seclection goman 1980 Oct 25, 2003, 9:34 PM
Post Re: [goman] Newest Threads Forum Seclection
goman 1886 Oct 27, 2003, 10:40 AM