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 5205 Aug 2, 2008, 6:31 AM
Thread Re: [Eraser] FatherID with Global
Andy 5081 Aug 2, 2008, 7:06 AM
Thread Re: [Andy] FatherID with Global
Eraser 5090 Aug 2, 2008, 8:14 AM
Thread Re: [Eraser] FatherID with Global
Andy 5069 Aug 2, 2008, 8:40 AM
Thread Re: [Andy] FatherID with Global
Eraser 5075 Aug 2, 2008, 11:54 AM
Thread Re: [Eraser] FatherID with Global
Andy 5076 Aug 2, 2008, 12:11 PM
Post Re: [Andy] FatherID with Global
Eraser 5064 Aug 2, 2008, 12:14 PM