Image rotator snippet for phpTemplate

This is the implementation of a random image rotator of automaticlab's rotate.php on your Drupal theme's header

While the rotator script can be used as an image reference replacement within a style.css (insead of image.png you refer the directory and rotate.php) the snippet i use below implements the rotator script to a Drupal page.tpl.php with the all php theme ($logo) and ('Home') functions intact

info
http://automaticlabs.com/products/rotator
the script
http://alistapart.com/d/randomizer/rotate.txt

into to Drupal...
- download the script and name it to rotate.php
- create a folder and name it 'header'
- put the rotate.php and all the images you want to be rotated on your theme in the folder
- upload it to your theme's directory
so te resulting directory will be

-your_theme/
header/
image01.png
image02.png
image03.png
/

copy&paste the snippet below to your theme's page.tpl.php in place of the 'header'

<?php /* THE HEADER */ ?>
<div id="header">
      <?php if ($logo) { ?><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print base_path() . path_to_theme() ?>/header/rotate.php" alt="<?php print t('Home') ?>" /></a><?php } ?>

now each image you have in the folder 'header' should rotate on each page refresh

 
 

Drupal is a registered trademark of Dries Buytaert.