Gossamer Forum
Quote Reply
FatherID with Global
 
How do I get the FatherID instead of ID with this global?


Code:
sub {
# return random related links
my (@links,$sth,$link);
my $tags = shift;
my ($cat_id) = each %{$DB->table('Links')->get_categories($tags->{ID})};
my $link_db = $DB->table('Links','CatLinks','Category');
$link_db->select_options ("ORDER BY RAND()","LIMIT 6");
my $sth = $link_db->select ( { CategoryID => $cat_id }, {isValidated => 'Yes'});
while (my $link = $sth->fetchrow_hashref) {
$link = Links::SiteHTML::tags('link', $link);
unless ($link->{ID} == $tags->{ID}){
push@links, $link;
}
}
return {relatedlnks=>\@links};
}


Code:
sub {
# return random related links
my (@links,$sth,$link);
my $tags = shift;
my ($cat_id) = each %{$DB->table('Links')->get_categories($tags->{ID})};
my $link_db = $DB->table('Links','CatLinks','Category');
$link_db->select_options ("ORDER BY RAND()","LIMIT 6");
my $sth = $link_db->select ( { FatherID => $cat_id }, {isValidated => 'Yes'});
while (my $link = $sth->fetchrow_hashref) {
$link = Links::SiteHTML::tags('link', $link);
unless ($link->{ID} == $tags->{ID}){
push@links, $link;
}
}
return {relatedlnks=>\@links};
}

~ ERASER


Free JavaScripts @ Insight Eye

Last edited by:

Eraser: Aug 2, 2008, 6:32 AM
Subject Author Views Date
Thread FatherID with Global Eraser 4219 Aug 2, 2008, 6:31 AM
Thread Re: [Eraser] FatherID with Global
Andy 4119 Aug 2, 2008, 7:06 AM
Thread Re: [Andy] FatherID with Global
Eraser 4129 Aug 2, 2008, 8:14 AM
Thread Re: [Eraser] FatherID with Global
Andy 4107 Aug 2, 2008, 8:40 AM
Thread Re: [Andy] FatherID with Global
Eraser 4114 Aug 2, 2008, 11:54 AM
Thread Re: [Eraser] FatherID with Global
Andy 4114 Aug 2, 2008, 12:11 PM
Post Re: [Andy] FatherID with Global
Eraser 4108 Aug 2, 2008, 12:14 PM