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
Quote Reply
Re: [katabd] Random Link on static page In reply to
Hi,

Yup, thats normal (as its a "static" page, i.e is only built when you do a build =))

The only way to really sort it, is :

1) An IFRAME, which links to a dynamic page, where the global is called#
2) A similar thing to the IFRAME - but Javascript, which grabs the page when its viewed by a user

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates