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
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