Random Image is a Custom Island that someone built; the contents are as follows:
Code
/* PHP CODE HERE */
$query = "
	SELECT
		`POST_ID`, `FILE_DIR`, `FILE_NAME`
	FROM
		`{$config['TABLE_PREFIX']}FILES`
	WHERE
		`FILE_DIR`<>''
	ORDER BY
		rand()
	LIMIT
		1
";
$sth = $dbh->do_query($query,__LINE__,__FILE__);
list($postId,$fDir,$fName) = $dbh->fetch_array($sth);

/* BODY HERE */
$body = <<<EOF
<div style="text-align: center;">
<a href="{$config['BASE_URL']}/ubbthreads.php?ubb=showgallery&Number=$postId">
<img src="{$config['BASE_URL']}/gallery/$fDir/thumbs/$fName" alt="" title="">
</a>
</div>
EOF;

Note that this code isn't very elegant, and is completely unsupported as it is not my code; your mileage may vary.

Last edited by Gizmo; 05/04/2017 3:30 PM. Reason: Cleaned database query

I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!