Hi,
I show the populair links on my home page with a global.
How do I show the most populair links from every last week. (7days).
Can anybody help?
Thanks, Ron
This is the global:
----------------------------------
sub {
# Displays the pop links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY Hits DESC Limit 5');
$sth = $search_db->select ( { isNew => 'No', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
my $desc = $link->{'Description'};
unless (length $desc <= 30) {my $short = substr ($desc, 0, 30); $short =~ s/\s\S+?$//; $short .= " ...";
$link->{'Description'} = $short;}
$link->{'detailed_url'} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display ('pop1', $link);
}
return $output;
}
I show the populair links on my home page with a global.
How do I show the most populair links from every last week. (7days).
Can anybody help?
Thanks, Ron
This is the global:
----------------------------------
sub {
# Displays the pop links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY Hits DESC Limit 5');
$sth = $search_db->select ( { isNew => 'No', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
my $desc = $link->{'Description'};
unless (length $desc <= 30) {my $short = substr ($desc, 0, 30); $short =~ s/\s\S+?$//; $short .= " ...";
$link->{'Description'} = $short;}
$link->{'detailed_url'} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display ('pop1', $link);
}
return $output;
}