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

Random Link on static page

Quote Reply
Random Link on static page
Hi

We are using a global to return a random paid link on the left menu..

On static pages it is not rotating (same link till its revuilt) is this normal or is there a way we can fix this.

the global is:

sub {
# Displays a random featured link
my $db = $DB->table('Links');
my $time = time;
my $cond = GT::SQL::Condition->new('ExpiryDate','>', $time, 'ExpiryDate', '<', 2147483647);
my $c = $db->count($cond);
my $r = int rand $c;
$db->select_options("Limit $r,1");
my $link = $db->select($cond)->fetchrow_hashref;
return Links::SiteHTML::display('link_featured', $link );
}
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Subject Author Views Date
Thread Random Link on static page katabd 3002 Nov 13, 2008, 6:02 AM
Post Re: [katabd] Random Link on static page
Andy 2845 Nov 13, 2008, 9:20 AM