Hi,
You could try this;
<%global_name($ID)%>
..where $ID == the category ID.
my $current_cat = $_[0];
my $seed = localtime;
my $table = $DB->table('CatLinks');
$table->select_options('ORDER BY RAND($seed)','LIMIT 1');
my $linkid = $table->select( ['LinkID'], { CategoryID => $current_cat } )->fetchrow;
my $link = $DB->table('Links')->get($linkid);
my $html = Links::SiteHTML::display('link', $link);
return $html;
}
Untested, but should work :)
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!
You could try this;
<%global_name($ID)%>
..where $ID == the category ID.
Code:
sub { my $current_cat = $_[0];
my $seed = localtime;
my $table = $DB->table('CatLinks');
$table->select_options('ORDER BY RAND($seed)','LIMIT 1');
my $linkid = $table->select( ['LinkID'], { CategoryID => $current_cat } )->fetchrow;
my $link = $DB->table('Links')->get($linkid);
my $html = Links::SiteHTML::display('link', $link);
return $html;
}
Untested, but should work :)
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!