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

Displaying Newest Links on Homepage

Quote Reply
Displaying Newest Links on Homepage
I have the following global which works great to show the top 5 latest links on my homepage, and restricted to a certain length. I was wondering how I can amend this to only include links from a certain category, for example, only links from category with ID 500.

Thanks!

Code:

sub {
# Displays the newest links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY ID DESC Limit 5');
$sth = $search_db->select ( { isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
if (length $link->{Title} > 31) {
$link->{Title} = substr($link->{Title}, 0, 28) . '...';
}
$output .= Links::SiteHTML::display ('link4', $link);
}
return $output;
}
Subject Author Views Date
Thread Displaying Newest Links on Homepage Jobu 14212 Sep 17, 2006, 8:58 AM
Post Re: [Jobu] Displaying Newest Links on Homepage
Jobu 13985 Sep 17, 2006, 9:58 AM
Thread Re: [Jobu] Displaying Newest Links on Homepage
Jobu 14020 Sep 17, 2006, 3:27 PM
Thread Re: [Jobu] Displaying Newest Links on Homepage
fuzzy logic 13980 Sep 17, 2006, 3:47 PM
Thread Re: [fuzzy logic] Displaying Newest Links on Homepage
Jobu 14086 Sep 17, 2006, 4:21 PM
Thread Re: [Jobu] Displaying Newest Links on Homepage
jdgamble 13923 Sep 20, 2006, 9:34 AM
Thread Re: [jdgamble] Displaying Newest Links on Homepage
Jobu 13897 Sep 22, 2006, 10:39 PM
Thread Re: [Jobu] Displaying Newest Links on Homepage
jdgamble 13870 Sep 23, 2006, 9:43 AM
Thread Re: [jdgamble] Displaying Newest Links on Homepage
Jobu 13843 Sep 23, 2006, 9:50 AM
Post Re: [Jobu] Displaying Newest Links on Homepage
fuzzy logic 13807 Sep 23, 2006, 10:05 AM
Thread Re: [jdgamble] Displaying Newest Links on Homepage
Jobu 13887 Sep 24, 2006, 2:36 PM
Thread Re: [Jobu] Displaying Newest Links on Homepage
jdgamble 13901 Sep 24, 2006, 2:56 PM
Post Re: [jdgamble] Displaying Newest Links on Homepage
Jobu 13804 Sep 24, 2006, 3:01 PM
Thread Re: [jdgamble] Displaying Newest Links on Homepage
Jobu 13843 Sep 24, 2006, 3:05 PM
Thread Re: [Jobu] Displaying Newest Links on Homepage
jdgamble 13841 Sep 24, 2006, 3:12 PM
Thread Re: [jdgamble] Displaying Newest Links on Homepage
Jobu 13824 Sep 24, 2006, 4:25 PM
Thread Re: [Jobu] Displaying Newest Links on Homepage
jdgamble 13806 Sep 24, 2006, 4:46 PM
Thread Re: [jdgamble] Displaying Newest Links on Homepage
Jobu 13880 Sep 24, 2006, 5:12 PM
Thread Re: [Jobu] Displaying Newest Links on Homepage
fuzzy logic 13818 Sep 24, 2006, 7:11 PM
Thread Re: [fuzzy logic] Displaying Newest Links on Homepage
Jobu 13843 Sep 24, 2006, 7:17 PM
Thread Re: [Jobu] Displaying Newest Links on Homepage
fuzzy logic 13833 Sep 24, 2006, 8:05 PM
Thread Re: [fuzzy logic] Displaying Newest Links on Homepage
Jobu 13836 Sep 24, 2006, 9:27 PM
Thread Re: [Jobu] Displaying Newest Links on Homepage
fuzzy logic 13805 Sep 24, 2006, 9:53 PM
Post Re: [fuzzy logic] Displaying Newest Links on Homepage
Jobu 13756 Sep 24, 2006, 10:02 PM