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
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