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

last post global : well coded ?

Quote Reply
last post global : well coded ?
I, could you tell me if the following global is well coded... I use it to display some posts on my homepage but I have often an error message :

GT::SQL::Table (32144): Wrong argument passed to this subroutine. Usage: Could not create a condition object out of arguments.
at /home/web/cgi-bin/gforum/admin/GT/SQL/Table.pm line 643


Here is the global

sub {
my $tags = shift;
my $post_db = $DB->table ('Post');
$post_db->select_options ('WHERE post_root_id=0', ' AND forum_id_fk NOT IN (7,8)',
'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 };
}



Txs
Regards
FMP
Subject Author Views Date
Thread last post global : well coded ? fmp 2634 Mar 2, 2006, 1:17 AM
Thread Re: [fmp] last post global : well coded ?
Jagerman 2558 Mar 3, 2006, 3:41 PM
Post Re: [Jagerman] last post global : well coded ?
fmp 2544 Mar 5, 2006, 10:44 AM
Post Re: [Jagerman] last post global : well coded ?
fmp 2481 Apr 13, 2006, 2:29 PM
Post Re: [Jagerman] last post global : well coded ?
fmp 2453 Apr 23, 2006, 3:21 AM