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

Re: [Paul] Global to return Random Category Name

Quote Reply
Re: [Paul] Global to return Random Category Name In reply to
Paul:



Sure does. Thanks!



I added a bit more... since the returned code has spaces aznd periods, and the actual pages do not (they have underscores), I changed it to:



Quote:
my $count = int(rand($DB->table('Category')->count)) || 1;
my $link = $DB->table('Category')->select( { ID => $count }, ['Full_Name'] )->fetchrow;
$link =~ s/\s/_/g;
$link =~ s/\./_/g;
return $link;


(Did not realize this would be a problem in creating a link to the random category until I tried it!)



dave
dave

Big Cartoon DataBase
Big Comic Book DataBase
Subject Author Views Date
Thread Global to return Random Category Name carfac 3267 Mar 21, 2002, 10:34 AM
Post Re: [carfac] Global to return Random Category Name
Stealth 3158 Mar 21, 2002, 10:54 AM
Thread Re: [carfac] Global to return Random Category Name
Paul 3164 Mar 21, 2002, 11:11 AM
Thread Re: [Paul] Global to return Random Category Name
carfac 3162 Mar 21, 2002, 11:20 AM
Thread Re: [carfac] Global to return Random Category Name
carfac 3192 Mar 21, 2002, 11:25 AM
Thread Re: [carfac] Global to return Random Category Name
Paul 3171 Mar 21, 2002, 11:27 AM
Thread Re: [Paul] Global to return Random Category Name
carfac 3161 Mar 21, 2002, 11:33 AM
Thread Re: [carfac] Global to return Random Category Name
Paul 3188 Mar 21, 2002, 12:01 PM
Post Re: [Paul] Global to return Random Category Name
carfac 3168 Mar 21, 2002, 12:17 PM