View Single Post
Old 02-20-2003, 12:18 PM  
picindex
Confirmed User
 
Join Date: Oct 2002
Posts: 1,038
Quote:
Originally posted by FuqALot
I posted this before on this board but here it is.

Hi... here's a simple code im just writing now.. so if you need help hit me up.

create a file named rotate.cgi or something and put it in a directory where you also have all the possible rotated .html galleries. (so like yourdomain.com/galleries/rotate.cgi)

put the following code in it:

#!/usr/bin/perl
$usrid = $ENV{'QUERY_STRING'};
print "Content-type:text/html\n\n";
@galleries = <*.html>;
$galleryfile = $galleries[int(rand(@galleries))];
open(gallery,$galleryfile);
@galindex = <gallery>;
close(gallery);
foreach $line (@galindex) {
$line =~ s/%revid%/$usrid/g;
print $line;
}

In your galleries, replace the REVID, with %revid%, so the script knows where to insert the users id.

Then let people visit like this:
http://www.yourdomain.com/galleries/rotate.cgi?XXXXXX

Now a random gallery will be picked and
the %revid% will be replaced with XXXXXX and gallery will be printed.

Just wrote it, but it's that easy that it should work. Heh.
Just tested it and it worked... thanks
__________________
Good Content:

picindex is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote