Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Random Numbers in .cgi pages- I Know How!

Quote Reply
Random Numbers in .cgi pages- I Know How!
Hi:

Finally, I have something to contribute!

You know how radom numbers only works on category pages, and not the cgi generated pages? Well, here is how to add to the other pages!

BTW, I got the idea from Digital Concepts mod for environmental variables- thanks, hope you don't mind me corrupting your code! It is a little ugly, but this works (so far, at least!)

Step one, open HTML-Templetes.pm, and go to the bottom for the specific page you want to add to. You have to do this for EACH page.... search, add, etc. Told you it was ugly!)

add:
my $random2;

then add:
$random2 = int(rand (10000));

Finally, in the output:

my $output = &load_template search.html', {
random2 => $random2, %$tags, %GLOBALS

Works!

Dave


Quote Reply
Re: Random Numbers in .cgi pages- I Know How! In reply to
hehe.. 8)

you can do this too.. it just gets rid of using the variable..

Code:
my $output = &load_template search.html', {
random2 => (int rand 10000),
%$tags,
%GLOBALS