Thursday, June 13 in 2024
Modul: Random Image
Author: John Maats, Sgt.Nops (last)
Nick: pcwacht
Version: 0.12
State: Stable
License: GNU-GPL
Platform: 2.7 and 2.8
Last info: 2010-10-12
689 votes
1 2 3 4 5
Download: here
Description: This snippet adds the new function: "RandomImage()" to Website Baker. The function displays a random image from a specified directory. As parameter the directory path starting from the WB root directory is required.

To display a random image from the subfolder '/pics' within the MEDIA directory, use:

RandomImage(MEDIA_DIRECTORY .'/pics');
Info: Note: invoke the function from the index.php file of your template or from a page/section of type code; the specified subfolder must contain at least two images (other wise you will see an error message).