Snippet to display a different image for each day of the week
Last modified: October 6, 2006 - 02:46
PLEASE NOTE: The php snippets are user submitted and it is impossible to check every one, so use at your own risk. For users who have setup drupal using an alternate database to the default, please note that the snippets may contain some database queries that may or may not work.
The following snippet displays a specific image depending on the day of the wee
<?php
/**
* The following displays a specific image depending
* on the day of the week
*
* Simple to use, just name your graphics to be Monday.jpg,
* Tuesday.jpg, Wednesday.jpg etc. upoad them to
* a /daily_images/ folder and paste this php snippet into
* a block/page/front_page and remember to select
* PHP INPUT FILTER
*
* Note: when naming your images, capitalise the spelling
* Monday.jpg, Tuesday.jpg, Wednesday.jpg, Thursday.jpg etc.
*
* Dublin Drupaller: Tested and works with Drupal 4.5, 4.6 and 4.7
*/
// Change the path and file type to suit.
$image_folder = "daily_images";
$file_type = ".jpg";
$today = date('l');
$image_name = $today . $file_type;
print "<img src=\"$image_folder/$image_name\" alt=\"put some text here\" />";
?>