Gossamer Forum
Quote Reply
Modify a Category sub
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 Unsure

Greetings from Germany,
QIX
Subject Author Views Date
Thread Modify a Category sub qix 5504 Nov 3, 2007, 3:31 AM
Thread Re: [qix] Modify a Category sub
neves 5414 Nov 3, 2007, 4:49 AM
Thread Re: [neves] Modify a Category sub
qix 5387 Nov 3, 2007, 6:50 AM
Thread Re: [qix] Modify a Category sub
neves 5389 Nov 3, 2007, 12:07 PM
Thread Re: [neves] Modify a Category sub
qix 5386 Nov 3, 2007, 2:45 PM
Thread Re: [qix] Modify a Category sub
socrates 5360 Nov 5, 2007, 12:21 AM
Thread Re: [socrates] Modify a Category sub
socrates 5334 Nov 6, 2007, 8:16 PM
Thread Re: [socrates] Modify a Category sub
neves 5328 Nov 6, 2007, 11:11 PM
Post Re: [neves] Modify a Category sub
socrates 5319 Nov 7, 2007, 5:51 PM