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

Random links by Link_Owner

Quote Reply
Random links by Link_Owner
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:

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
Subject Author Views Date
Thread Random links by Link_Owner anthonyweston 5578 Oct 21, 2012, 6:52 AM
Thread Re: [anthonyweston] Random links by Link_Owner
Andy 5447 Oct 21, 2012, 6:56 AM
Thread Re: [Andy] Random links by Link_Owner
anthonyweston 5425 Oct 21, 2012, 12:34 PM
Thread Re: [anthonyweston] Random links by Link_Owner
Andy 5433 Oct 21, 2012, 11:32 PM
Thread Re: [Andy] Random links by Link_Owner
anthonyweston 5422 Oct 22, 2012, 3:19 AM
Thread Re: [anthonyweston] Random links by Link_Owner
Andy 5427 Oct 22, 2012, 3:21 AM
Thread Re: [Andy] Random links by Link_Owner
anthonyweston 5416 Oct 22, 2012, 3:42 AM
Thread Re: [anthonyweston] Random links by Link_Owner
Andy 5409 Oct 22, 2012, 4:08 AM
Post Re: [Andy] Random links by Link_Owner
anthonyweston 5407 Oct 22, 2012, 4:39 AM