Hello,
I used the following sub to show on Detail pages 10 links what have the same Category:
[/i]sub {
my $tags = shift;
my $id = $tags->{ID};
my $catid = $DB->table('CatLinks')->select({LinkID=>$id})->fetchrow_hashref->{CategoryID};
my $db = $DB->table('CatLinks','Links');
my $cond = GT::SQL::Condition->new( 'CatLinks.CategoryID','=',$catid, 'CatLinks.LinkID','<>',$id);
$db->select_options("ORDER BY Hits DESC", "LIMIT 10");
my $rs = $db->select($cond,['Links.*'])->fetchall_hashref or return;
my $output ="";
foreach(@$rs){
$output .= Links::SiteHTML::display('link_detail',$_);
}
return $output;
}[/i]
Now, I would like change this sub to show on a new Page 10 links of a certain category, as an example ID 60.
I will used this on a Page create with the PageBuilder Plugin.
I hope anyone understand my english
Greetings from Germany,
QIX
I used the following sub to show on Detail pages 10 links what have the same Category:
[/i]sub {
my $tags = shift;
my $id = $tags->{ID};
my $catid = $DB->table('CatLinks')->select({LinkID=>$id})->fetchrow_hashref->{CategoryID};
my $db = $DB->table('CatLinks','Links');
my $cond = GT::SQL::Condition->new( 'CatLinks.CategoryID','=',$catid, 'CatLinks.LinkID','<>',$id);
$db->select_options("ORDER BY Hits DESC", "LIMIT 10");
my $rs = $db->select($cond,['Links.*'])->fetchall_hashref or return;
my $output ="";
foreach(@$rs){
$output .= Links::SiteHTML::display('link_detail',$_);
}
return $output;
}[/i]
Now, I would like change this sub to show on a new Page 10 links of a certain category, as an example ID 60.
I will used this on a Page create with the PageBuilder Plugin.
I hope anyone understand my english

Greetings from Germany,
QIX