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

Re: [Andy] Grab link by hits and votes...

Quote Reply
Re: [Andy] Grab link by hits and votes... In reply to
And still needs more explaining ... this is reminding me of my phd Crazy. If you want to use more than one variable to measure something it is not at all straightforward. What about if you take the link with the highest rating and if there is more than one, take the one with the most hits?

sub {
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ("ORDER BY Rating DESC Hits DESC, LIMIT 1");
$sth = $search_db->select ( {isValidated => 'Yes'});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}

Last edited by:

afinlr: Jul 29, 2003, 2:04 PM
Subject Author Views Date
Thread Grab link by hits and votes... Andy 2721 Jul 28, 2003, 1:22 AM
Thread Re: [Andy] Grab link by hits and votes...
afinlr 2645 Jul 29, 2003, 11:34 AM
Thread Re: [afinlr] Grab link by hits and votes...
Andy 2615 Jul 29, 2003, 12:56 PM
Thread Re: [Andy] Grab link by hits and votes...
afinlr 2651 Jul 29, 2003, 1:03 PM
Thread Re: [afinlr] Grab link by hits and votes...
Andy 2615 Jul 29, 2003, 1:13 PM
Post Re: [Andy] Grab link by hits and votes...
afinlr 2608 Jul 29, 2003, 1:35 PM
Thread Re: [Andy] Grab link by hits and votes...
SSmeredith 2594 Jul 30, 2003, 4:10 PM
Post Re: [SSmeredith] Grab link by hits and votes...
afinlr 2564 Jul 31, 2003, 5:48 PM