Gossamer Forum
Quote Reply
Payment links globals
Hello

Does anyone know of a global that will allow us to display a list of all Links with a Paid status, and a global that will rotate a 2 random links from these links?

We have tried the following for the first one:

sub {
# Displays the partners links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY Title ASC Limit 250')|| return $GT::SQL::error;
$sth = $search_db->select ( {ExpiryDate '!=" '2147483647'})|| return $GT::SQL::error;
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link_short', $link);
}
return $output;
}

and tried

sub {
# Displays the featured links on the home page.
my $db = $DB->table('Links');
my $cond = GT::SQL::Condition->new('ExpiryDate', '!=', '2147483647');
my $total = $db->count ( $cond );
my $rand = int rand $total;
$db->select_options ("LIMIT $rand, 1");
my $link = $db->select($cond)->fetchrow_hashref;
return Links::SiteHTML::display('link_short', $link);
}

for the second one..

Any ideas?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Subject Author Views Date
Thread Payment links globals katabd 2190 Mar 28, 2006, 3:58 PM
Thread Re: [katabd] Payment links globals
brewt 2108 Mar 28, 2006, 4:15 PM
Post Re: [brewt] Payment links globals
katabd 2104 Mar 28, 2006, 5:19 PM