|
|
|
08-12-2002, 01:53 PM
|
Postid: 72240
|
|
Registered User
Join Date: Apr 2000
Location: San Francisco, CA
Posts: 1,935
|
random images script?
I have a series of images that I would like to randomize on our home page. I'd like it to be that whenever you load the page, another image gets loaded in the same place.
Ideally, I want something that will put the minimal load on the server, that I don't have to re-configure when I add new images to the directory, and that will be rock solid.
I have seen a buch of stuff on hotscripts and I have no idea what to pick. In the past I have used a script I think from Matts Script Archive or something, that is very finiky.
I understand I can use cgi, javascript and php (and probably others, too). What are the advantages of using one over the other? Ideally, I'd like a script that just randomizes from a certain directory, and I can add images to that directory any time and they will start shoing up in the page.
Does anyone have any bright ideas for me?
oh, and thanks. 
|
|
|
08-12-2002, 02:30 PM
|
Postid: 72244
|
|
Site Owner
Join Date: Nov 1999
Location: League City, Texas
Posts: 1,464
|
Evoir,
I use Justin's script to do exactly what you are wanting to do. The only difference between what you posted and what it does, is that you have to manually enter the image URL's to be posted. It doesn't just pull from a directory.
Mont
|
|
|
08-12-2002, 03:11 PM
|
Postid: 72245
|
|
Registered User
Join Date: Apr 2000
Location: San Francisco, CA
Posts: 1,935
|
Thanks!
Wondering, can you set it up so that it does not link to anything? What happens if you put no url in?
Also
Does anyone know of a solution that will just grab images from a directory that I don't have to configure each one?
|
|
|
08-12-2002, 03:53 PM
|
Postid: 72250
|
|
Blond and Caffeinated
Join Date: Jan 1999
Location: Southern California, USA
Posts: 3,247
|
It's a small script hack - just remove the hyperlink from the formatting. I use the script at a couple sites for a banner rotation, but can see it'd be very nice for image rotation too.
If you can't remove it, maybe just a main page link or something?
Post if you find a script that does what you are seeking, I'd like to see that too.
|
|
|
08-12-2002, 03:56 PM
|
Postid: 72251
|
|
Site Owner
Join Date: Nov 1999
Location: League City, Texas
Posts: 1,464
|
Evoir,
You can either set the link right back to your home page (with a zero border, it doesn't even show up as a link), or in some cases, I set it to the image itself. Being a fishing site, many of my users snag the images to run as wallpaper and such on thier own computers. One of my regulars invited me for some lunch in his home, and I was amazed to see his collection of pics. He had a nifty little program that rotated them just like I was doing on the home page.
Also, "method 3" is the one to use with Justin's program.
Mont
|
|
|
08-12-2002, 03:59 PM
|
Postid: 72252
|
|
Registered User
Join Date: Apr 2000
Location: San Francisco, CA
Posts: 1,935
|
Madi wrote:
It's a small script hack - just remove the hyperlink from the formatting.
Which file do I edit?
The images are sitting smack dab in the middle of our home page. I really don't want it to link to anything, if possible. 
|
|
|
08-12-2002, 05:18 PM
|
Postid: 72257
|
|
Site Owner
Join Date: Jul 2001
Location: where the boat is: Chesapeake Bay
Posts: 702
|
There is a script at nms that only does image rotation. It does want a list configured of the images that you want to show, but I really like your idea of just dropping files into a directory and having them show up. The extension should be pretty trivial. At the place up front that says
Code:
my @files = qw(
foo.jpg
bah.png
);
define a new variable
Code:
my $file_dir = /path/to/images
and then a little routine to open that directory, read the names of the files, and stuff them into @files.
I think the enhancement is sufficiently interesting (and useful to me) that I'll be happy to do it for you (on the house!) I don't think it will take me more than about 20 minutes. When do you expect to launch your update? I am on vacation next week, and on top of getting ready to be gone I am home sick today. If I don't feel good enough to go to work tomorrow I'll be able to whip it out in the morning, otherwise it could be a day or two after I get back.
__________________
dave
S/V Auspicious
lying Annapolis MD
On the eighth day there were regular expressions.
--me
pay it forward
|
|
|
08-12-2002, 06:46 PM
|
Postid: 72258
|
|
Registered User
Join Date: Apr 2000
Location: San Francisco, CA
Posts: 1,935
|
I am hoping to launch on weds, but I could use something else until you were able to put this together. I like the idea of being able to add to the directory at any time and not having to configure anything else.
It will be for random quotes that we have set up as image files, all matching the same size. So, if we stick to the same size file, and it is always named .gif and .jpg, I hope we'd be all set.
My main thing is that it is server friendly, as we once had a big surge and our random cgi script busted on us. I don't know the technical term, but it couldn't handle the load. It was a long time ago, and it was when we got some national press, but I am hoping to install something rock solid and server friendly.
I'll prolly start it out with the banner script, but would like to move toward this modified script you are speaking about.
Thanks!
Evie
Last edited by Evoir : 08-12-2002 at 10:22 PM.
|
|
|
08-12-2002, 08:03 PM
|
Postid: 72263
|
|
Blond and Caffeinated
Join Date: Jan 1999
Location: Southern California, USA
Posts: 3,247
|
Evie - it's showbanner.pl - edit:
Code:
print qq(<a href="$main::CONFIG{'URL'}?ID=$B[0]");if($Target){print qq( target="$Target");}print qq(>
...and then the </a> at the end of the image string. Me, I'd just tweak the above until it worked w/o the link (or it broke, and then I'd back up. Undo ctrl+z is my very best friend, LOLOL . . .) Maybe someone else can tell you EXACTLY what to remove, LOL  !!
|
|
|
08-13-2002, 10:07 AM
|
Postid: 72299
|
|
Site Owner
Join Date: Jul 2001
Location: where the boat is: Chesapeake Bay
Posts: 702
|
Evie --
Home sick again today, so I made myself useful and edited the nms rand_image script to run on all the images in a directory. See a demonstration on my site. It will display a new image every time you reload the page. I sent you a PM with a link to the modified tar file and instructions. The modified script includes the configuration for my FQ site so it should be easy for you to see what to change to point to your directory.
I hope you can work from the tar file. If not, let me know and we'll work out an alternative.
I'd appreciate feedback on how well it works, and if the instructions are clear enough.
By the way it took 5 minutes to make the code modifications, and 10 minutes to update the instructions and other documentation. Isn't that always the way?
__________________
dave
S/V Auspicious
lying Annapolis MD
On the eighth day there were regular expressions.
--me
pay it forward
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 12:37 PM.
|
| |
|
|
|