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

global: Adding A Random Link

Quote Reply
global: Adding A Random Link
Hi,

I tested the global one:

sub {
my $tags = shift;
my $link_db = $DB->table('Links','CatLinks');
my $cat_id = $tags->{Random_CatID};
my $limit = $tags->{Random_Limit} || 3;
my (@output, $sth);
$link_db->select_options ('ORDER BY RAND()', "LIMIT $limit");
if ($cat_id) {
$sth = $link_db->select ( { CategoryID => $cat_id });
}
else {
$sth = $link_db->select;
}while (my $hash = $sth->fetchrow_hashref) {
push @output, $hash;
}return { Random_Loop => \@output; }
}


being the page:

http://www.gossamer-threads.com/...s/Detailed/1834.html

I have the version of Mysql: 3.23.46

But this one does not work, i have the folowing error:

A fatal error has occured:

GT::Config (10988): Unable to compile 'random_link' in file '/home/domain/cgi-bin/admin/templates/default/globals.txt': syntax error at (eval 14) line 15, at EOF
syntax error at (eval 14) line 16, near "}
}"
at /home/domain/cgi-bin/admin/GT/Template.pm line 461.

Please enable debugging in setup for more details.

Thank's
Subject Author Views Date
Thread global: Adding A Random Link michelb 2851 Apr 3, 2002, 11:31 PM
Thread Re: [michelb] global: Adding A Random Link
Paul 2780 Apr 4, 2002, 1:21 AM
Thread Re: [Paul] global: Adding A Random Link
michelb 2772 Apr 4, 2002, 2:20 AM
Thread Re: [michelb] global: Adding A Random Link
pugdog 2751 Apr 4, 2002, 4:04 PM
Post Re: [pugdog] global: Adding A Random Link
michelb 2725 Apr 4, 2002, 8:47 PM