Gossamer Forum
Quote Reply
category Links
Hi,

I am using the below global to get the latest 8 links i the current category - how can I pass a specific category to is as <%category_link('x')%> where x is the ID of the category I want the latest links from?

Code:
sub {
my $tags = shift;
my $cat = $tags->{'Full_Name'};
my $output;
my $sth;
my $link;

use GT::SQL::Condition;


my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Time DESC Limit 8');
$sth = $search_db->select (['Links.ID', 'Links.Description', 'Links.Title', 'Links.Add_Date', 'Links.isNew', 'Links.Image', 'Links.Story', 'Links.Add_Time', 'Links.Country', 'Category.Full_Name', 'Category.Name'], GT::SQL::Condition->new(['Full_Name', 'LIKE', $cat .'%'], ['isValidated', '=', 'Yes']));

my $output = qq~<br><hr>~;

while ($link = $sth->fetchrow_hashref)
{
# Set the category url
my $category_url = $CFG->{build_root_url}."/".$link->{'Full_Name'}."/";

# Set the detailed_url
my $detailed_url = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";

$output .= Links::SiteHTML::display('link', $link);
}

return $output;
}

http://www.ameinfo.com
Subject Author Views Date
Thread category Links klauslovgreen 4548 Apr 26, 2003, 10:05 AM
Thread Re: [klauslovgreen] category Links
afinlr 4418 Apr 27, 2003, 10:12 AM
Thread Re: [afinlr] category Links
klauslovgreen 4397 Apr 27, 2003, 10:36 PM
Thread Re: [klauslovgreen] category Links
afinlr 4398 Apr 28, 2003, 6:04 AM
Thread Re: [afinlr] category Links
klauslovgreen 4387 Apr 28, 2003, 8:34 AM
Thread Re: [klauslovgreen] category Links
afinlr 4367 Apr 28, 2003, 10:21 AM
Post Re: [afinlr] category Links
klauslovgreen 4381 Apr 28, 2003, 10:25 AM
Thread Re: [afinlr] category Links
klauslovgreen 4374 Apr 28, 2003, 10:29 AM
Thread Re: [klauslovgreen] category Links
afinlr 4374 Apr 28, 2003, 10:53 AM
Thread Re: [afinlr] category Links
klauslovgreen 4371 Apr 28, 2003, 10:55 AM
Thread Re: [klauslovgreen] category Links
afinlr 4370 Apr 28, 2003, 10:59 AM
Post Re: [afinlr] category Links
klauslovgreen 4351 Apr 28, 2003, 11:04 AM