Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jul 2006
Posts: 4,057
Joined: Jul 2006
Posts: 4,057
Non Static : Custom island (Mysql)

I'm looking for pointers or help to make a database query
rotate on page refreshes in a custom island?

Currently : 7.3b4
I have a Custom island pulling quotes from a database.
But when there in a custom island the update is not
(min 1min) its much longer.

(It will work as expected in the Community Introduction Body )

Ive been testing this on my test forum.
Okay there is only me floating around, but it remains for
the best part "Static" not rotating quotes.

How can i get around this problem?
Is there a javascript or somthing i can make so it
either caches as expected (1min) or every refresh?
Or a cron job, but i'm not sure if that would actually update?

help / advice / pointers appreciated smile


BOOM !! Version v7.6.1.1
People who inspire me Isaac ME Gizmo
Joined: Aug 2006
Posts: 1,649
Likes: 1
Pooh-Bah
Pooh-Bah
Joined: Aug 2006
Posts: 1,649
Likes: 1

I would think that you'd want Cache Time = 0 -- banner ads rotate w/ page refreshes this way.

How many quotes are we talking about here?

I have a JavaScript banner rotation (in my header, not a custom island) that rotates images randomly with each page reload. I've stripped it down to just text here (think of "ads" as "quotes"):
HTML
<SCRIPT LANGUAGE="JavaScript">
<!--//

var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
var border = 0;
ad +=1;


if (ad==1) {
txt="Here's a quote"; 
}

if (ad==2) {
txt="Here's another quote"; 
}

if (ad==3) {
txt="Here's yet another quote!"; 
}

document.write('<small>' + txt + '</small>');

//-->
</SCRIPT>
(I see JavaScript isn't one of the CODE options here ;))

Perhaps you can use this as a starting point to rotate your quotes...?


GangsterBB.NET (Ver. 7.6.1.1)
PHP Version 5.6.40 / MySQL 5.7.23-23 (was 5.6.41-84.1) / Apache 2.4.54
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Joined: Jul 2006
Posts: 4,057
Joined: Jul 2006
Posts: 4,057
Cheers jgeoff,
But my code will work fine in a header a footer
or as above in the Community Welcome Notice area.

Only when its in a Custom Island Does it freeze.
It will update, but not

a) To a page refresh.
b) Nor after 1min has passed, it can be a lot longer (15mins to ??)
I don't know what the trigger is you see.

Ive now copied the script into the custom island to remove
the possibility of it being an "include file" as the fail point.

I have it as a php code, as i get it to switch between
Help quotes/questions and then forum hot topics at certain
times of the day, and even just turn off at another time of
the day.

Mark


BOOM !! Version v7.6.1.1
People who inspire me Isaac ME Gizmo
Joined: Aug 2006
Posts: 1,649
Likes: 1
Pooh-Bah
Pooh-Bah
Joined: Aug 2006
Posts: 1,649
Likes: 1

Did you try Cache Time = 0 ?

I don't know, you seem to have lots of problems with the custom islands! lol



GangsterBB.NET (Ver. 7.6.1.1)
PHP Version 5.6.40 / MySQL 5.7.23-23 (was 5.6.41-84.1) / Apache 2.4.54
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Joined: Jul 2006
Posts: 4,057
Joined: Jul 2006
Posts: 4,057
Yeh as '0' is the default but ive just tried it again.

This is on my 7.3b4 Test Forum from a clean install wink
But i remember the behavior is the same on my live 7.2.2

I have this and another topic running about custom islands,
the other could be related to a "Custom Header" issue with
a custom island.

But on this one, i'm trying to get the Custom Island to
update either every min, or every refresh.
At the moment it behaves as Static, where if i place
it anywhere else on my forum (not custom islands)
it will work off every page re-fresh.

Its a puzzler for me?
Even logging out and logging back in, it remains the same.

Didn't you have a similar issue where we thought it would
update after midnight? And it didn't ??


BOOM !! Version v7.6.1.1
People who inspire me Isaac ME Gizmo
Joined: Aug 2006
Posts: 1,649
Likes: 1
Pooh-Bah
Pooh-Bah
Joined: Aug 2006
Posts: 1,649
Likes: 1

I have no clue, Mark. I didn't in the other thread either. laugh Hopefully Rick or someone else will be able to chime in here.

As for my issue, the <? echo date("F j, g:i a"); ?> always updates upon reload, but if I remember correctly I had to set the cache to 30 minutes so the php/mysql data would reload at least every half hour, so it'd update within 30 minutes of midnight. I'm not sure why that didn't load in real time...

Maybe it's related?


GangsterBB.NET (Ver. 7.6.1.1)
PHP Version 5.6.40 / MySQL 5.7.23-23 (was 5.6.41-84.1) / Apache 2.4.54
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Joined: Jul 2006
Posts: 4,057
Joined: Jul 2006
Posts: 4,057
Yeh i have a sun set sunrise using the date function
and that updates + midnight, but thats more to do with
the date function than the forum cache.

If you like the top 30 posters, that updates too.

My quotes script thing just doesn't stick to the rules?
select 1min (updates in 7mins or alot longer).
Ive forgot what the trigger is for the custom island cache.

It is a puzzler....


BOOM !! Version v7.6.1.1
People who inspire me Isaac ME Gizmo
Joined: Sep 2006
Posts: 9
stranger
stranger
Joined: Sep 2006
Posts: 9
I'm having a similar problem with a random quote/banner ad script. The script only randomizes if I manually clear the cache or manually edit the custom island. I've tried setting it to static, 1-10 minutes cache time, and always build, but nothing seems to work. Any ideas?

Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Use a PHP include...

Dump the data into a file, then use a phpinclude in the island. The "cached" data will be the include then it will always load when requested.


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!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (Ruben), 661 guests, and 171 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 20240430)