Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Re: [rmurdo] Display last X updates on a different page.

Quote Reply
Re: [rmurdo] Display last X updates on a different page. In reply to
Hi,

Untested, but give this a go:

get_latest_forum
Code:
sub {

my $path = '/path/to/gforum/admin/defs';

my $NEWDB = new GT::SQL (
def_path => $path,
cache => 0,
debug => 0,
subclass => 1
);

my $tbl = $NEWDB->table('Post');
$tbl->select_options("ORDER BY post_time DESC LIMIT 10");

my @loop;
my $sth = $tbl->select() || die $GT::SQL::error;
while (my $hit = $sth->fetchrow_hashref) {
push @loop, $hit;
}

return { latest_forum_posts => \@loop }

}


Code:
<%get_latest_forum%>
<ul>
<%loop latest_forum_posts%>
<li><a href="/cgi-bin/gforum/gforum.cgi?post=<%post_id%>"><%post_subject%></a></li>
<%endloop%>
</ul>

Thats all the time I can spare with that. Hopefully it works ;)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Display last X updates on a different page. rmurdo 7188 Nov 27, 2008, 11:09 AM
Thread Re: [rmurdo] Display last X updates on a different page.
Andy 7048 Nov 27, 2008, 11:36 PM
Thread Re: [Andy] Display last X updates on a different page.
rmurdo 7038 Nov 28, 2008, 11:09 AM
Thread Re: [rmurdo] Display last X updates on a different page.
Andy 7061 Nov 28, 2008, 11:11 AM
Thread Re: [Andy] Display last X updates on a different page.
rmurdo 7030 Nov 28, 2008, 11:22 AM
Thread Re: [rmurdo] Display last X updates on a different page.
Andy 7039 Nov 29, 2008, 12:22 AM
Thread Re: [Andy] Display last X updates on a different page.
rmurdo 7026 Nov 29, 2008, 12:08 PM
Thread Re: [rmurdo] Display last X updates on a different page.
Andy 6994 Nov 29, 2008, 12:30 PM
Thread Re: [Andy] Display last X updates on a different page.
rmurdo 7009 Nov 29, 2008, 12:32 PM
Thread Re: [rmurdo] Display last X updates on a different page.
rmurdo 6978 Nov 29, 2008, 2:32 PM
Post Re: [rmurdo] Display last X updates on a different page.
rmurdo 6942 Nov 29, 2008, 7:50 PM
Thread Re: [rmurdo] Display last X updates on a different page.
Andy 6935 Nov 30, 2008, 12:45 AM
Thread Re: [Andy] Display last X updates on a different page.
rmurdo 6948 Nov 30, 2008, 2:56 PM
Post Re: [rmurdo] Display last X updates on a different page.
Andy 6891 Nov 30, 2008, 11:18 PM