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

Products: Gossamer Links: Development, Plugins and Globals: Re: [Paul] show category name by random link globle: Edit Log

Here is the list of edits for this post
Re: [Paul] show category name by random link globle
i am back. here is code borrow from random link globe.


Random_category => sub {
my $tags = shift;
my $category_db = $DB->table('category');
my $cat_id = $tags->{Random_CatID};
my $limit = $tags->{Random_Limit} || 1;
my (@output, $sth);
$category_db->select_options ('ORDER BY RAND()', "LIMIT $limit");
if ($cat_id) {
$sth = $category_db->select ( { ID => $cat_id });
}
else {
$sth = $category_db->select;
}while (my $hash = $sth->fetchrow_hashref) {
push @output, $hash;
}return { Random_Loop => \@output }
}


it comes to a bit trouble part. how to show the a links belongs to that category?





Thanks

Last edited by:

courierb: Aug 30, 2002, 6:09 AM

Edit Log: