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?
The default database prefix is "ubbt_" and generally does not need to be changed, unless you're running multiple copies of UBB.threads.
In the code the database table is "ubbt_FILES", db prefix "ubbt_", so if your prefix in your config is "morgan_" the table would be: "morgan_FILES", likewise "morgan" would be "morganFILES".
The easiest thing to do would be to load PHPMyAdmin and look for the FILES table and use that.
Adjust the code as needed. Gizmo only shared it here for reference or as an example for building your own.
If its not part of the code that was downloaded from the Member Area in the forum software archive, it should be received as "Unsupported Custom Code."
I got it to work but after reading Isaac comment and Gizmos off course I decided to delete it and not use it. Don't like it is an "Unsupported Custom Code." .. Somehow I like to play by the UBBThreads official book. Still It's a bit strange to see the "unsupported" Random image island on the official UBBthreads forum
I get it Gizmo, Custom islands I understand and know how they work as long as its html and easy stuff inserted but when it comes to database queries etc then I don't know what the details means so I better stay out of those as it may cause faults and I really can't afford to cause it and not being able to get support.
Hope you understand sometimes its difficult to explain in English.. Maybe there will be a random image option in 8.0
I need to find another tactic to lure our members to use the gallery forum more.
Thanks again I like to discuss forum things one learns..
Morgan, its called a "Custom Portal Island" so that you can customize it. They are not officially supported, just as any Style customizations you may make. The options are there for you to change the presentation of your forums to your own liking.
I'd buy you a coffee and we could catch up on your british bikes, and all the cool things you've seen people do with them. I'd really enjoy that a lot! But there are two things standing in my way, that "pond" (small ocean between europe and north america) and the fact that I'd have to change my schedule to make it all happen. I could make it work, but I need to change a few things to begin making it a reality
Isaac, the pond is no big deal at all, It's like flying to your eastcoast just that they go north over the pole and you land here a few hours later and I'm 20min from the airport, you get to chose from 4 different bikes from 1955-70. Free beer included or coffe for that matter.. Remember rear brake pedal is on the left side on those bikes and gear shift on the right side.. I now have such offer for the Australian eastcoast Sydney/Melbourne in Nov 2018 (int BSA rally).. not decided yet but we may go. We did it in 2014 to San Fransisco.
About customize the islands thats no problem except for the mysql queries bit don't like it when not understanding it. Don't like if it can corrupt the forum with no support. Ride safe
So I'm at it again and added above script. the question now is I don't see that it changes the image that often. The
Quote
Cache Time In Minutes. If zero is specified, the body of this custom box will be static, ie. never updated. This setting would be used for things like links, banner ads, etc.
This is now set to 1 minute.
Quote
Portal Cache Settings Higher cache times are better for overall forum speed. Times should be entered as minutes. Forum Stats
Who's Online 90
Popular Topics 90
Public Calendar 90
Top Posters (All Time) 90
Top Posters (30 Days) 90
What I'm asking which is the best setting to keep the random gallery photo change continuesly?
A cache setting of "1" will update it every 1 minute. It's better to have the value something larger as it's a database query every time it's updated; after testing, on A Gardeners Forum, I have mine set to 5 minutes.
There are several items in Forum Permissions for the target forums that would affect guests, they're pretty descriptive.
You were too quick answering me... LOL
I made a Custom Island like this last nite (replacing a Gallery Island) and the first few times I clicked on it as a Guest I got the permissions error. I turned my Gallery Island back on and after that everything worked so I withdrew my question..
Yes, the query supplied does not check the forum(s) which supply the data; I offer development services if you're interested in having something custom built.
Based on the new gallery island in V7.6.2 I use this code:
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 class="p2" style="height:180px;overflow:hidden;position:relative;width:180px;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;min-height:100%;height:180px;">
</a>
</div>
EOF;
It use the medium picture for preview and crop it to a fill out the whole box. Please note that this code scan the content of the directory on the server and display orphaned files and the threads too. This gives me a lot of work to do on my board.
If you dont like to be transfered to the gallery if you click the thumb picture in the island you can use the code down there. This little modification bring up the full size picture in the lightbox view include the file description (if exists). My next goal: the click should bring you to the gallery and open the selected picture in the lightbox automaticly. A combination of both code boxes. Time will tell ...
Code
/* PHP CODE HERE */
$query = "
SELECT
`POST_ID`, `FILE_DIR`, `FILE_NAME` , FILE_DESCRIPTION
FROM
`{$config['TABLE_PREFIX']}FILES`
WHERE
`FILE_DIR`<>''
ORDER BY
rand()
LIMIT
1
";
$sth = $dbh->do_query($query,__LINE__,__FILE__);
list($postId,$fDir,$fName,$fDesc) = $dbh->fetch_array($sth);
/* BODY HERE */
$body = <<<EOF
<div class="p2" style="height:180px;overflow:hidden;position:relative;width:180px;display:inline-block;">
<a href="{$config['BASE_URL']}/gallery/$fDir/full/$fName" data-lightbox="gallery" data-title="$fDesc">
<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;min-height:100%;height:180px;">
</a>
</div>
EOF;