"; } while( $name = $myDir->read() ) { if(substr($name,0,strlen($preInc)) == $preInc && substr($name,0,strlen($preExc)) != $preExc && $name != "." && $name != "..") { $images[] = $name; } } $myDir->close(); $randimage = rand(0,count($images)-1); return $dirn . "/" . $images[$randimage]; } function smarty_cms_help_function_random_image() { ?>
Grabs a random image from the image directory specified
Just insert the tag into your template/page like: {random_image dir="images/albums"}
Author: Aaron King <Ezerick@gmail.com>, based on the original Random Image tag created by Robert Campbell<rob@techcom.dyndns.org>
Version: 1.0
Change History:
Inital Release of 1.0