Perl or JS Code for Random Filename?

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Perl or JS Code for Random Filename?

Postby Darren » Tue Jun 24, 2008 12:03 am

Hi all,

I am trying to generate a random filename in a Coranto news style. I need a script (Perl or JavaScript, or anything else that would work in a Coranto news style) that will return a random filename for a single, predetermined directory.

The closest I can find online is all the random image rotators out there, all of which seem to use an array of preset values. I don't want an array -- when a new file is created in the directory, I want it to be automatically available for random inclusion.

Posts: 44
Joined: Sat Oct 30, 2004 9:20 pm

Postby Pirate Elf » Tue Jun 24, 2008 8:58 pm

The closest I can think of is using a random generator and then making a style and profile that works with it. That's what i did to produce all sorts of random content on my page. Since the cgi uses a .txt file as it's database it's easy to whip out a style that would work. The only problem is is you have to manually add the new file names if there are ever any new ones. So that might not help you. I just make it to where my posters can post something and the style and profile build it into the page..

For what I mean just check out the image on the bottom left is random, the site banner is random, and the quotes for buddy christ are random. All done through coranto.

Program used Randex
Nichts ist für dich
Nichts war für dich
Nichts bleibt für dich
Für immer
Pirate Elf
Posts: 732
Joined: Wed Jan 31, 2007 9:45 pm

Return to Customization

Who is online

Users browsing this forum: No registered users and 1 guest