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 4681 Apr 26, 2003, 10:05 AM
Thread Re: [klauslovgreen] category Links
afinlr 4550 Apr 27, 2003, 10:12 AM
Thread Re: [afinlr] category Links
klauslovgreen 4530 Apr 27, 2003, 10:36 PM
Thread Re: [klauslovgreen] category Links
afinlr 4530 Apr 28, 2003, 6:04 AM
Thread Re: [afinlr] category Links
klauslovgreen 4520 Apr 28, 2003, 8:34 AM
Thread Re: [klauslovgreen] category Links
afinlr 4500 Apr 28, 2003, 10:21 AM
Post Re: [afinlr] category Links
klauslovgreen 4515 Apr 28, 2003, 10:25 AM
Thread Re: [afinlr] category Links
klauslovgreen 4507 Apr 28, 2003, 10:29 AM
Thread Re: [klauslovgreen] category Links
afinlr 4506 Apr 28, 2003, 10:53 AM
Thread Re: [afinlr] category Links
klauslovgreen 4504 Apr 28, 2003, 10:55 AM
Thread Re: [klauslovgreen] category Links
afinlr 4503 Apr 28, 2003, 10:59 AM
Post Re: [afinlr] category Links
klauslovgreen 4484 Apr 28, 2003, 11:04 AM