Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online Now
2 registered members (JAISP, M4TT), 58 guests, and 254 spiders.
Key: Admin, Global Mod, Mod
Member Spotlight
Posts: 82
Joined: September 2008
Show All Member Profiles 
Top Posters(30 Days)
Gizmo 15
FREAK 11
M4TT 11
Ruben 5
mmkk 5
isaac 4
Latest Photos
Chinese Buddhist temple.
My buddha beads.
Rendered Walls
Multi-Screen wallpaper
Stockholm Metro
Previous Thread
Next Thread
Print Thread
Random image island #260118
05/02/17 07:39 AM
05/02/17 07:39 AM
Joined: Jun 2006
Posts: 518
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 518
Sweden
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


Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
Re: Random image island [Re: Morgan] #260119
05/02/17 12:23 PM
05/02/17 12:23 PM
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
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/17 02: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.
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!
Re: Random image island [Re: Morgan] #260122
05/02/17 02:29 PM
05/02/17 02:29 PM
Joined: Jun 2006
Posts: 518
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 518
Sweden
Gizmo I tried and did not get it to work,

First, my Table prefix is ubbt_bbf as you see I added "bbf" when I created the database.
Do I need to alter your code and insert the "bbf"?

second, I used all your code and emptied the box before I pasted in all code but got an error
what can I do wrong?



Last edited by Morgan; 05/02/17 02:32 PM.

Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: Random image island [Re: Morgan] #260124
05/02/17 02:32 PM
05/02/17 02:32 PM
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
ubbt_FILES should be changed to whatever your database prefix is (IE: bbf_FILES); again this is not my code, support is unavailable.


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.
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!
Re: Random image island [Re: Morgan] #260125
05/02/17 02:36 PM
05/02/17 02:36 PM
Joined: Jun 2006
Posts: 518
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 518
Sweden
ok the word ubbt_FILES maybe needs to be ubbt_bbfFILES or maybe ubbt_bbf
I maybe should stay out of it..


Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: Random image island [Re: Morgan] #260126
05/02/17 02:39 PM
05/02/17 02:39 PM
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
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.


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.
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!
Re: Random image island [Re: Morgan] #260127
05/02/17 02:42 PM
05/02/17 02:42 PM
Joined: Jun 2006
Posts: 518
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 518
Sweden
ok my prefix is ubbt_bbf so I should use ubbt_bbfFILES
I will try that once


Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: Random image island [Re: Morgan] #260128
05/02/17 02:47 PM
05/02/17 02:47 PM
Joined: Apr 2004
Posts: 1,004
California
isaac Offline
UBB.threads Developer
isaac  Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,004
California
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."

Re: Random image island [Re: Morgan] #260129
05/02/17 02:58 PM
05/02/17 02:58 PM
Joined: Jun 2006
Posts: 518
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 518
Sweden
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 wink


Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: Random image island [Re: Morgan] #260130
05/02/17 02:59 PM
05/02/17 02:59 PM
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Not really, it's showing that you can expand the product by use of custom islands.


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.
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!
Re: Random image island [Re: Morgan] #260133
05/02/17 03:22 PM
05/02/17 03:22 PM
Joined: Jun 2006
Posts: 518
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 518
Sweden
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.. smile
Maybe there will be a random image option in 8.0 grin

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.. smile


Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: Random image island [Re: Morgan] #260134
05/02/17 03:26 PM
05/02/17 03:26 PM
Joined: Apr 2004
Posts: 1,004
California
isaac Offline
UBB.threads Developer
isaac  Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,004
California
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 laugh

Cheers

Re: Random image island [Re: Morgan] #260135
05/02/17 03:43 PM
05/02/17 03:43 PM
Joined: Jun 2006
Posts: 518
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 518
Sweden
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.. wink
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


Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: Random image island [Re: Morgan] #260137
05/02/17 03:47 PM
05/02/17 03:47 PM
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Well, if there's free beer, I guess I need to renew my passport, lol.


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.
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!
Re: Random image island [Re: Morgan] #260139
05/02/17 03:57 PM
05/02/17 03:57 PM
Joined: Jun 2006
Posts: 518
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 518
Sweden
Speaking of beer this cooler is in my little BritBike museum smile

Attached Files DSCN1297.jpg

Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: Random image island [Re: Morgan] #260141
05/02/17 04:05 PM
05/02/17 04:05 PM
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
I approve!


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.
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!
Re: Random image island [Re: Morgan] #260146
05/04/17 12:12 PM
05/04/17 12:12 PM
Joined: Jun 2006
Posts: 518
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 518
Sweden
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?

Thanks

Last edited by Morgan; 05/04/17 12:13 PM.

Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: Random image island [Re: Morgan] #260147
05/04/17 02:12 PM
05/04/17 02:12 PM
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
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.


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.
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!
Re: Random image island [Re: Morgan] #260164
05/09/17 12:51 AM
05/09/17 12:51 AM
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
There are several items in Forum Permissions for the target forums that would affect guests, they're pretty descriptive.


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.
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!
Re: Random image island [Re: Gizmo] #260169
05/09/17 10:17 AM
05/09/17 10:17 AM
Joined: Mar 2007
Posts: 209
E
ECNet Offline
enthusiast
ECNet  Offline
enthusiast
E
Joined: Mar 2007
Posts: 209
Originally Posted by Gizmo
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.. facepalm

Re: Random image island [Re: Gizmo] #260171
05/09/17 08:54 PM
05/09/17 08:54 PM
Joined: Mar 2007
Posts: 209
E
ECNet Offline
enthusiast
ECNet  Offline
enthusiast
E
Joined: Mar 2007
Posts: 209
I did more investigation today and realized It was picking pictures from both public and private galleries.

I didn't get that at first Duh!!

blush

Re: Random image island [Re: Morgan] #260172
05/10/17 03:31 PM
05/10/17 03:31 PM
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,785
Portland, OR; USA
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.


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.
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!

Shout Box
Today's Birthdays
No Birthdays
Recent Topics
Users Unable to Upload Avatar
by M4TT. 12/13/17 08:51 AM
Shout Box Sound Effect
by M4TT. 11/29/17 08:28 PM
Ad island
by TGCsanderson. 11/25/17 06:41 PM
Taking to long to connect to DB
by AstroCat. 11/24/17 12:34 PM
Forum Statistics
Forums36
Topics35,015
Posts190,534
Members12,045
Most Online978
Jun 24th, 2007
Random Image
Powered by UBB.threads™ PHP Forum Software 7.6.1
(Snapshot build 20171106)