Thread Like Summary
Gizmo, isaac
Total Likes: 2
Original Post (Thread Starter)
#260118 05/02/2017 12:39 PM
by Morgan
Morgan
Hi,

I'm trying to lure our members to visit our Gallery forum more.
Tried to put latest gallery image in the left column however the same photo
is there to long as there is not so many new posts.

I see there is a Randome image Island here on UBBCentral but there is no such Island
in the portal layout, at least I have not seen anyone.

Is there a way/place to pick up the code for the Randome image Island?

Cheers
Liked Replies
#263823 May 10th a 09:09 PM
by isaac
isaac
As of 2020-03-07 (last updated/file date), the Custom Portal Island code for "Random Gallery Image" used on UBBCentral is:

Code
/* PHP CODE HERE */

$query = "
	SELECT POST_ID, FILE_DIR, FILE_NAME
	FROM {$config['TABLE_PREFIX']}FILES
	WHERE (FILE_DIR <> '' AND FILE_DIR IS NOT NULL)
	  AND (FILE_TYPE = 'jpg'
	   OR FILE_TYPE = 'gif'
	   OR FILE_TYPE = 'jpg'
	   OR FILE_TYPE = 'jpeg'
	   OR FILE_TYPE = 'png')
	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 class="acvt">
<div style="height:{$config['MAX_THUMB_W_H']}px;overflow:hidden;position:relative;width:100%;display:inline-block;">
<a href="{$config['BASE_URL']}/ubbthreads.php?ubb=showgallery&Number=$postId"><img src="{$config['BASE_URL']}/gallery/$fDir/medium/$fName" alt="" title="" class="p2 cp oi" style="position:absolute;left:-100%;right:-100%;top:-100%;bottom:-100%;margin:auto;max-width:280px;min-height:100%;"></a>
</div>
</div>

EOF;

Attachments
1 member likes this
#263834 May 15th a 06:26 AM
by Morgan
Morgan
Isaac, I added above code and it is better that previous so Thank you!!!
1 member likes this
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
0 members (), 744 guests, and 147 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)