Is it possible (with PHP) to "tag" an image? The scenario is as follows: 1) I add a new image to my website. 2) The script automatically places a "banner" across that image that says "new" 3) After 7 days the script automatically removes the "banner" from the image. Is this possible?
I'd check the file's date (filectime?), and add the 'new' banner in the markup, not to the actual image. Maybe a sibling span apo'd over the IMG tag. This is very rough/untested: define('SECONDS_AS_NEW',604800); $imageFile = 'test.png'; $imageText = 'Describe the Image'; $imageURL = 'images/'.$imageFile; $imagePath = 'images/'.$imageFile; /* above $imagePath example assumes images is subdirectory of script location - if not you might have to make $imagePath something like: '/var/web/account/www/images/' */ echo ' <span class="galleryImage"> <img src="',$imageURL,'" alt="',$imageText,'" />',( (filectime($filename) > (time() - SECONDS_AS_NEW)) ? '<span></span>' : '' ), </span>'; Code (markup): The inner span would only be included when the item is 'new', so your css to show it is simply to apo it off span.galleryImage with your 'new' image on it as a background.