Dear forum,

I apologize for the poor title of this post. Let me try to explain what I want to do. At the moment on my site I have a masthead image that is a white neon light through a green background. Say I made copies of that masthead image and turned each copy into a different color so there was a green one, a red one, a blue one etc. Then would It be possible to have the images change every 5 to 10 seconds or so? What would it take to do that?

Any suggestions would be most appreciated.

Thanks alot

FrancisQ

The Green Room

Comments

paul-at-murphymaphia.com’s picture

check out the masthead on http://murphymaphia.com
notice that the image source is actually a php script.
so, create a php script that looks in a directory and selects a random image, opens it and streams the file to the browser.
Once you do that, use the path to that php script as the logo image setting in the theme admin.

That's the most simple version.
You could do one like mine that actually selects 7 random folders then selects 1 random image from each and builds a single image from the 7 sources.

AndrewE’s picture

Paul thanks for the reply,

I kind of understand what you mean but I have not got a clue how to put that in code. Any noob (read idiot) pointers would be great.

Thanks

FrancisQ

The Green Room

sepeck’s picture

Start here with this article.
http://www.alistapart.com/articles/randomizer/

I found it by googling for "php random image display" and it was second or third on the list.

-sp
---------
Test site...always start with a test site.
Drupal Best Practices Guide

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

AndrewE’s picture

Sepeck I got it working thanks to that link!

Now my masthead changes colors woo-hoo!

:)

Thanks guys,

FrancisQ

The Green Room

sepeck’s picture

Glad to to be of help.

I don't really know php, but I once needed a Christmas countdown counter. So I figured some bright soul must have done it and posted the code somewhere. It was the 3rd Google link that led me to it. My sister-in-law was thrilled to have it on her site. :)

The php in content/blocks/whatever really lets you do some interesting stuff :)

-sp
---------
Test site...always start with a test site.
Drupal Best Practices Guide

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide