Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

HeavyBomber

Quote Reply
HeavyBomber
HeavyBomber,
How do you get the last five posts on your front page?? cool...

</not a clue>
Quote Reply
Re: [Kilroy] HeavyBomber In reply to
Code:
#!/usr/bin/perl
#==============================

use strict;
use lib '/path/to/admin';
use GForum qw/$DB $IN/;
GForum::init('/path/to/admin');

last();

#==============================

sub last {
#------------------------------------------------
# Last five posts.

my ($tab, $output, $sth) = ($DB->table('Post'), undef, undef);

$tab->select_options('ORDER BY post_time DESC', 'LIMIT 5');
$sth = $tab->select( 'post_subject', 'post_id' );
while (my $post = $sth->fetchrow_hashref) {
$output .= qq|<a href="/cgi-bin/gforum.cgi?do=post_view&post=$post->{post_id}">$post->{Title}</a><br>|;
}

print $IN->header();
print $output;

}


Well something like that :)

Last edited by:

Paul: Apr 30, 2002, 4:19 AM
Quote Reply
Re: [Kilroy] HeavyBomber In reply to
Paul has one way, but we did it a little different.

ASP page with some VBSCRIPT calling a stored procedure.

It's done with a MS SQL stored procedure that takes the forum_id as a parameter, it is called from various points in the web site with the forum_id specified. The stored procedure also utilizes a user defined function to change the unix date to a normal date.

Last edited by:

HeavyBombers: Apr 30, 2002, 10:21 AM