Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [neves] Modify a Category sub

Quote Reply
Re: [neves] Modify a Category sub In reply to
neves wrote:
Moin moin,

if you have a variable <%CertainCategoryID%> in your template your sub should look like

Code:
sub {
my $tags = shift;
my $catid = $tags->{CertainCategoryID};
my $id = $tags->{ID};
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;
}


Regards

Merten

Hi Merten,

thanks for your Help.
I dont have a variable <%CertainCategoryID%> because there is no linking to Category.
Is it possible to say:

sub {
my $tags = shift;
my $catid = $tags->{60};
....
....

To show only links from the Category with the ID 60 ??

Regards,
Frank
Subject Author Views Date
Thread Modify a Category sub qix 4395 Nov 3, 2007, 3:31 AM
Thread Re: [qix] Modify a Category sub
neves 4318 Nov 3, 2007, 4:49 AM
Thread Re: [neves] Modify a Category sub
qix 4285 Nov 3, 2007, 6:50 AM
Thread Re: [qix] Modify a Category sub
neves 4296 Nov 3, 2007, 12:07 PM
Thread Re: [neves] Modify a Category sub
qix 4299 Nov 3, 2007, 2:45 PM
Thread Re: [qix] Modify a Category sub
socrates 4266 Nov 5, 2007, 12:21 AM
Thread Re: [socrates] Modify a Category sub
socrates 4242 Nov 6, 2007, 8:16 PM
Thread Re: [socrates] Modify a Category sub
neves 4229 Nov 6, 2007, 11:11 PM
Post Re: [neves] Modify a Category sub
socrates 4220 Nov 7, 2007, 5:51 PM