Random Photo Block

This page displays a random photo from your database. You can move this functionality to any other TNG page by copying the PHP code from this page to your destination.


Cloyd Valentine
Cloyd Valentine

If you want to use this on a PHP page you created from scratch, you will need to include the PHP block at the top of this page as well.

Notes:
1) To simplify matters here, all photos attached to living individuals have been removed. No check is done, however, to see if the photo is attached to a source cited for a living individual or a family flagged as living.
2) To restrict a photo to certain dimensions, fill in the "maxwidth" and/or "maxheight" variables in the code. Please note that although this will resize the display dimensions, the file size and bandwidth requirements will not be affected. If you want to show random thumbnails instead, change each occurence of "path" above to "thumbpath" (lines 31, 40 and 59).