Topic awaiting preservation: Timed randomness? |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: |
posted 11-25-2003 04:11
Hello. code: $minutes=((($mytime%604800)%86400)%3600)/60;
|
Nervous Wreck (II) Inmate From: |
posted 11-25-2003 04:15
BTW, the echo statements are My debuging statements. I haven't wrote a call to an image yet. |
Maniac (V) Mad Scientist From: :morF |
posted 11-25-2003 04:50
simply have one function ot randomly choose an image from an array/flat-file database/MySQL database/whatever. Then, after you've exited your script at the bottom, add the usual HTML tags (HTML, HEAD, TITLE, BODY, etc). Inside the head tag put a piece of javascript code (which someone else will have to supply) that refreshes the page every 5 seconds or whatever you want. Insie the body tag put a standard image tag that calls the image name out of your PHP script, like: <img src="http://www.mysite.com/images/<?PHP echo $image_name; ?>">. Then, when you're page refeshes, PHP randomly picks another image, and replaces the 'echo $image_name;' with a different name. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 11-25-2003 05:03
Hmm..... |
Paranoid (IV) Inmate From: Milwaukee |
posted 11-25-2003 05:45
Hey, good implementation, bitdamaged. I didn't know about the "touch" function -- that's useful stuff. I never really thought about it before, but empty files are a perfect way to set site-wide persistent "variables" in any number of circumstances. |
Nervous Wreck (II) Inmate From: |
posted 11-25-2003 22:32
Okay, I think I was unsuccessful in getting My idea across. Maybe if I start out with the end product first. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 11-25-2003 23:30
That's what this would do. code: <img src="http://yoursite.com/sigthing.php">
code: $img = "path/to/img.gif";
|
Nervous Wreck (II) Inmate From: |
posted 11-26-2003 01:11
Your correct. I did not know that you could call a script with an image tag. |
Nervous Wreck (II) Inmate From: |
posted 11-26-2003 05:52
Hey bitdamaged... |
Maniac (V) Mad Scientist From: :morF |
posted 11-26-2003 05:57
since you call the image from the script, you get the script ot return the image. It should replace with it...or you can used .htaccess to mask it. |
Nervous Wreck (II) Inmate From: |
posted 11-26-2003 22:47
I'm sorry. You completely lost Me with that one. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 11-27-2003 03:16
I'm not great with mod_rewrite but I think what you can do is drop an .htaccess file into your signature directory. With the following. code: RewriteEngine on
|