I need a global to display 4 random links by the same Link_Owner on the detailed page similar to the one I have for just random links:
my (@links,$sth,$link);
my $tags = shift;
my ($cat_id, $cat_name) = each %{$DB->table('Links')->get_categories($tags->{ID})};
my $link_db = $DB->table('Links','CatLinks');
$link_db->select_options ("ORDER BY RAND()","LIMIT 4");
my $sth = $link_db->select ( { CategoryID => $cat_id }, {isValidated => 'Yes'});
while (my $link = $sth->fetchrow_hashref) {
$link = Links::SiteHTML::tags('link', $link);
push@links, $link;
}
return {relate=>\@links};
}
I'm just not sure how to make the above show only links by the same Link Owner?
Thanks!
Anthony
Code:
sub { my (@links,$sth,$link);
my $tags = shift;
my ($cat_id, $cat_name) = each %{$DB->table('Links')->get_categories($tags->{ID})};
my $link_db = $DB->table('Links','CatLinks');
$link_db->select_options ("ORDER BY RAND()","LIMIT 4");
my $sth = $link_db->select ( { CategoryID => $cat_id }, {isValidated => 'Yes'});
while (my $link = $sth->fetchrow_hashref) {
$link = Links::SiteHTML::tags('link', $link);
push@links, $link;
}
return {relate=>\@links};
}
I'm just not sure how to make the above show only links by the same Link Owner?
Thanks!
Anthony