Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online Now
1 registered members (JAISP), 75 guests, and 414 spiders.
Key: Admin, Global Mod, Mod
Member Spotlight
TGCsanderson
TGCsanderson
Hackelton U.K.
Posts: 67
Joined: September 2007
Show All Member Profiles 
Top Posters(30 Days)
Gizmo 16
M4TT 12
FREAK 11
Ruben 8
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
Any new ISLANDS around? #254005
11/07/13 11:26 PM
11/07/13 11:26 PM
Joined: Oct 2006
Posts: 370
Issaquah, WA
Bill B Offline OP

enthusiast
Bill B  Offline OP

enthusiast
Joined: Oct 2006
Posts: 370
Issaquah, WA
I haven't added an Island in about a year.... I think that it would be nice to add one for the Holidays.

Does anyone have one that they've built recently (that they'd share with us)?

Or, does anyone have an "idea" for a good one?


--BIll B
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: Any new ISLANDS around? [Re: Bill B] #254006
11/07/13 11:38 PM
11/07/13 11:38 PM
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
I'm actually working to do one for one of my sites; we have a "seasonal ticker" that introduces users to a countdown of the next season, and as a part of that I'm working to introduce a holiday announcement; the issue though is that not all holidays are on a specific day of the year so the ticker has to be updated yearly, but this is what I have so far:

Code
/* PHP CODE HERE */
if((date("m") == 01) && (date("d") == 01)) {
	$holiday_blurb = "Happy New Year!";
	$holiday_name = "New Years Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 02) && (date("d") == 02)) {
	$holiday_blurb = "";
	$holiday_name = "Groundhog Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 02) && (date("d") == 14)) {
	$holiday_blurb = "";
	$holiday_name = "Valentine's Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 04) && (date("d") == 22)) {
	$holiday_blurb = "";
	$holiday_name = "Earth Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 04) && (date("d") == 25)) {
// Changes Every Year, Last Friday in April
	$holiday_blurb = "";
	$holiday_name = "Arbor Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 05) && (date("d") == 11)) {
// Changes Every Year, Second Sunday in May
	$holiday_blurb = "";
	$holiday_name = "Arbor Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 05) && (date("d") == 26)) {
// Changes Every Year, Last Monday in May
	$holiday_blurb = "";
	$holiday_name = "Memorial Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 06) && (date("d") == 14)) {
	$holiday_blurb = "";
	$holiday_name = "Flag Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 06) && (date("d") == 15)) {
// Changes Every Year, Third Sunday of June
	$holiday_blurb = "";
	$holiday_name = "Fathers Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 07) && (date("d") == 04)) {
	$holiday_blurb = "Happy 4th of July!";
	$holiday_name = "Independance Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 09) && (date("d") == 11)) {
	$holiday_blurb = "";
	$holiday_name = "Patriot Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 10) && (date("d") == 31)) {
	$holiday_blurb = "Happy Halloween!";
	$holiday_name = "Halloween";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 11) && (date("d") == 11)) {
	$holiday_blurb = "";
	$holiday_name = "Veterans Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 11) && (date("d") == 28)) {
// Changes Every Year, Fourth Thursday in November
	$holiday_blurb = "Happy Thanksgiving!";
	$holiday_name = "Thanksgiving";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 12) && (date("d") == 24)) {
	$holiday_blurb = "Merry Christmas!";
	$holiday_name = "Christmas Eve";
	$holiday_image = "";
	$holiday_url = "";
} elseif((date("m") == 12) && (date("d") == 25)) {
	$holiday_blurb = "Merry Christmas!";
	$holiday_name = "Christmas Day";
	$holiday_image = "";
	$holiday_url = "";
} elseif(date("m") == 12) {
	$holiday_blurb = "Happy Holiday's!";
	$holiday_name = "Holiday Season";
	$holiday_image = "";
	$holiday_url = "";
} else {
	$holiday_blurb = "None";
	$holiday_name = "None";
	$holiday_image = "";
	$holiday_url = "";
}

if($holiday_name != "") {
	$holiday = "\n\n<br /><br />\n\n<div align=\"center\">\n";

	if($holiday_image != "") { $holiday .= "\t<img src=\"". $holiday_image ."\" alt=\"". $holiday_blurb ."\" title=\"". $holiday_blurb ."\" />\n<br /><br />\n\n"; }
	if($holiday_url != "") { $holiday .= "\t<strong><a href=\"". $holiday_url ."\" target=\"_blank\">". $holiday_name ."</a></strong><hr />\n"; }
	if($holiday_url == "") { $holiday .= "\t<strong>". $holiday_name ."</strong><hr />\n"; }

	$holiday .= "\t". $holiday_blurb;
	$holiday .= "\n</div>\n\n";
} else { $holiday = ""; }

/* BODY HERE */
$body = <<<EOF
$holiday
EOF;


I've been working on this during the week but never really tested it in the UBB, what I put above is just what I've got working using a standalone script but put the ubb formatting for a custom island in place for you; your mileage may vary.

Basically the if statements have a date (with leading zero's), if it's that date then it uses the data supplied; URL is used if you want it to be linked to a URL (used as a description of the holiday), if it's not displayed then it'll be ignored by the "pull together" code at the bottom. The else statement holds the "no holiday" indication.


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: Any new ISLANDS around? [Re: Gizmo] #254008
11/07/13 11:46 PM
11/07/13 11:46 PM
Joined: Oct 2006
Posts: 370
Issaquah, WA
Bill B Offline OP

enthusiast
Bill B  Offline OP

enthusiast
Joined: Oct 2006
Posts: 370
Issaquah, WA
Oh, yes... This is a great idea... A couple of weeks ago I was thinking about adding a "count down" to the forum -- but then I forgot about it. Good reminder.

You can see one of mine at: http://portlandswapmeet.com/


--BIll B
Re: Any new ISLANDS around? [Re: Bill B] #254009
11/07/13 11:53 PM
11/07/13 11:53 PM
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
The funny part is, I'm in Portland...


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: Any new ISLANDS around? [Re: Bill B] #254010
11/07/13 11:56 PM
11/07/13 11:56 PM
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
My "Season Countdown" is:
Code
/* PHP CODE HERE */
if(date("U") <= mktime(0, 0, 0, 3, 20, 2013) /* hour, minute, second, month, day, year */) {
// Spring
$blurb = "until Summer begins";
$color = "FF0000";
$date = "June 21, 2013";
} elseif(date("U") <= mktime(0, 0, 0, 6, 21, 2013) /* hour, minute, second, month, day, year */) {
// Summer
$blurb = "until Summer begins";
$color = "FF0000";
$date = "June 21, 2013";
} elseif(date("U") <= mktime(0, 0, 0, 9, 22, 2013) /* hour, minute, second, month, day, year */) {
// Autumn
$blurb = "until Autumn begins";
$color = "F9930A";
$date = "September 22, 2013";
} elseif(date("U") <= mktime(0, 0, 0, 12, 21, 2013) /* hour, minute, second, month, day, year */) {
// Winter
$blurb = "until Winter begins";
$color = "81A4BA";
$date = "December 21, 2013";
} else {
$blurb = "";
$color = "";
$date = "";
}

/* BODY HERE */
$body = <<<EOF
<script language="JavaScript" type="text/javascript">
today = new Date();
BigDay = new Date("$date");
msPerDay = 24 * 60 * 60 * 1000;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
document.write("<span style=\"color: #$color; font-family:'Comic Sans MS';\">Only " + daysLeft + " days " + hrsLeft +" hours and " + minsLeft + " minutes $blurb!</span>");
</script>
EOF;


Each season has a color and a blurb about it, the MKTime/Date will need to be changed each year; output shows as:
Quote:
Only 43 days 3 hours and 4 minutes until Winter begins!


I thought about looking for a javascript ticker to visually count down, but on each page load works fine for my needs for now.


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: Any new ISLANDS around? [Re: Gizmo] #254011
11/07/13 11:59 PM
11/07/13 11:59 PM
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
For you guys you'd probably go with:
Code
/* PHP CODE HERE */
if(date("U") <= mktime(0, 0, 0, 4, 4, 2014) /* hour, minute, second, month, day, year */) {
// Spring
$blurb = "until our next Swap Meet";
$color = "FF0000";
$date = "April 04, 2014";
} else {
$blurb = "";
$color = "";
$date = "";
}

/* BODY HERE */
$body = <<<EOF
<script language="JavaScript" type="text/javascript">
today = new Date();
BigDay = new Date("$date");
msPerDay = 24 * 60 * 60 * 1000;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
document.write("<span style=\"color: #$color; font-family:'Comic Sans MS';\">Only " + daysLeft + " days " + hrsLeft +" hours and " + minsLeft + " minutes $blurb!</span>");
</script>
EOF;


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: Any new ISLANDS around? [Re: Bill B] #254012
11/08/13 12:00 AM
11/08/13 12:00 AM
Joined: Oct 2006
Posts: 370
Issaquah, WA
Bill B Offline OP

enthusiast
Bill B  Offline OP

enthusiast
Joined: Oct 2006
Posts: 370
Issaquah, WA
I just remembered WHY I was thinking about this -- our Forum's Birthday is Nov 21th... we will be 12 years old.

I installed this code with only minor tweaks and it worked PERFECTLY the very first time!!! Gizmo, you are DA MAN!!!!


--BIll B
Re: Any new ISLANDS around? [Re: Bill B] #254014
11/08/13 07:36 AM
11/08/13 07:36 AM
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
Lol, you're welcome tongue


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: Any new ISLANDS around? [Re: Bill B] #254015
11/09/13 01:31 AM
11/09/13 01:31 AM
Joined: Oct 2006
Posts: 370
Issaquah, WA
Bill B Offline OP

enthusiast
Bill B  Offline OP

enthusiast
Joined: Oct 2006
Posts: 370
Issaquah, WA
Now, one day later, I'm still PUMPED about this... I've wanted a way to have a custom messages/graphics to pop up on certain dates. (I'd also like to have my HEADER changed on specific dates, ie real Holidays - but that's a different issue).

So -- my question is, if I go crazy with the Custom Island and expand it to list 365 days, do you think that it would work? And is there a way to make sure that each date would be cached so that there's no performance hit for every user that logs in??

Or... maybe there should be a separate PHP file that is called by the Custom Island.... Thoughts???


--BIll B
Re: Any new ISLANDS around? [Re: Bill B] #254017
11/09/13 02:14 AM
11/09/13 02:14 AM
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
Gizmo Offline
UBB.threads Developer
Gizmo  Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 16,786
Portland, OR; USA
Well, unless it's pulling data from the db you shouldn't really have to worry about too much of a performance hit...


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: Any new ISLANDS around? [Re: Bill B] #254024
11/09/13 10:06 PM
11/09/13 10:06 PM
Joined: Oct 2006
Posts: 370
Issaquah, WA
Bill B Offline OP

enthusiast
Bill B  Offline OP

enthusiast
Joined: Oct 2006
Posts: 370
Issaquah, WA
Okay, thanks... i reset the "cache time" for the Custom Island to 240. That should keep it from being accessed except once every 4 hours - frequent enough to allow me to include an image and link for each day of the year.

Cool.


--BIll B

Shout Box
Today's Birthdays
No Birthdays
Recent Topics
Users Unable to Upload Avatar [Not a Bug]
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,540
Members12,045
Most Online978
Jun 24th, 2007
Random Image
Powered by UBB.threads™ PHP Forum Software 7.6.1
(Snapshot build 20171106)