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

Products: Gossamer Links: Development, Plugins and Globals: Re: [rascal] Should it be in a Loop: Edit Log

Here is the list of edits for this post
Re: [rascal] Should it be in a Loop

sub {

my ($id,$search_db,$output,$sth,$link,@links);
$id = shift;
$search_db = $DB->table('Links','CatLinks');
$search_db->select_options ("ORDER BY rand()") || return $GT::SQL::error;
$sth = $search_db->select ({xxx => 'Yes', isValidated => 'Yes', CategoryID=>$id}) || return $GT::SQL::error;
while ($link = $sth->fetchrow_hashref) {
push @links, $link;
return { rand_links_loop => \@links };

..and then you should be able to call it with;


<%if rand_links_loop%>
<h1>Random Links</h1>
<%loop rand_links_loop%>
<include link.html%>

Andy (mod)
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!

Last edited by:

Andy: Mar 14, 2005, 11:21 PM

Edit Log: