Hi,
since the upgrade to Links3x the code below (and posted earlier in this thread) doesn't work any more.
I'll just get an error and detaild pages weren't build.
I can't work out what the problem since the LinksUpgrade is.
Does anyone here in the forum has a clue?
get_cat_id:
Code:
sub {
my $tags = shift;
my $id = $tags->{'ID'};
my $db = $DB->table ('Category','CatLinks');
$db->select_options('LIMIT 1');
my $catid = $db->select ( { LinkID => $id }, ['ID'] )->fetchrow_array;
return $catid;
}
related_links:
Code:
sub {
my $cat = shift;
my $LinkID= shift;
my $all_ids = $DB->table('Category')->children($cat);
push @$all_ids, $cat;
my $db_obj = $DB->table('Links','CatLinks','Category');
$db_obj->select_options ('ORDER BY Add_Date DESC Limit 4');
my $sth = $db_obj->select (['Links.*'], GT::SQL::Condition->new(
['CategoryID', 'IN', $all_ids],
['Links.ID', '!=', $LinkID, 'isValidated', '=', 'Yes', 'isNew', '=', 'Yes'])
);
my $output = qq~<br>~;
while (my $link = $sth->fetchrow_hashref) {
$link->{'category_url'} = $CFG->{build_root_url}."/".$link->{'Full_Name'}."/";
$link->{'detailed_url'} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$output .= qq~<CENTER><TABLE WIDTH="80%" BORDER="0" CELLSPACING="0" CELLPADDING="2">~;
$output .= Links::SiteHTML::display('link', $link);
$output .= qq~</TABLE></CENTER>~;
}
return $output;
}
And on the detailed.html:
Code:
<%related_links($get_cat_id, $ID)%>Regards,
Manu
Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.