Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
A custom island that mentions today's birthdays!
see attachments
Enjoy!
Attachments
readme.txt (482 Bytes, 122 downloads) [goodisland] The instructions on how to install this island. SHA1: 6aba65416af369d3313b2c6fafc892fd19c3ae44 happybirthdayisland.txt (1.83 KB, 130 downloads) [goodisland] the cody for the island SHA1: 4a0fa6a1565bbb7393d9cdce11dfe71400a1bf42 birthdaymod-7-3.txt (1.58 KB, 32 downloads) 7.3 version SHA1: 645609a136a458405ad0854a56496fabb5a816a1
Last edited by Ian_W; 05/12/2008 1:28 AM . Reason: added 7.3 version
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Joined: Nov 2003
Posts: 482
dude, i so wanted to do that and it was on my list of 'sh*t i want to do, but don't have time' ty blaaask!!!!!
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Joined: Nov 2003
Posts: 482
boom.. quickest 'mod' ever. copy/paste, cpanel enable.. *poof* workie.. i bow to you!
Joined: Sep 2005
Posts: 136
Journeyman
Journeyman
Joined: Sep 2005
Posts: 136
so easy I could do it lol
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki OwnerTime Lord
UBBDev / UBBWiki OwnerTime Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Great job blaaask! Love it hehe... I am however moving you up to the templates forum
...
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
dude, i so wanted to do that and it was on my list of 'sh*t i want to do, but don't have time'
I didn't have the time too, so I copied over most of the code from the public calender island
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
I just added v2.00 to post #1. This one ignores banned users and users with a last visit day of more then X days ago (I set it to 60 days default).
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Joined: Nov 2003
Posts: 482
hrm i have a v2.10 now for the banned guys..
for them, the string is 'Happy Bday, you Lahewwwwwzer ..'
Joined: Apr 2001
Posts: 96
Power User
Power User
Joined: Apr 2001
Posts: 96
Very nice... thanks!!
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Joined: Nov 2003
Posts: 482
we need v2.10 (colorize names - based upon Display color, admin, mod)
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
we need v2.10 (colorize names - based upon Display color, admin, mod)
v2.10 is already there, with the banned guys special messages.
So that would be v2.20 atleast
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
So that would be v2.20 atleast
v2.20 it is
added name color stuff, stolen (but redid some of the if's) from showflat.inc.php
/* PHP CODE HERE */ $maxdaysago=60; $temp = getdate($now); $month = $temp["mon"]; $mday = $temp["mday"]; $year = $temp["year"]; $visitlimit=time()-60*60*24*$maxdaysago; if (isset($config['BIRTHDAYS_IN_CALENDAR']) && $config['BIRTHDAYS_IN_CALENDAR']) { $query = " SELECT t1.USER_DISPLAY_NAME,t2.USER_BIRTHDAY,t1.USER_IS_UNDERAGE,t1.USER_ID,t2.USER_NAME_COLOR FROM {$config['TABLE_PREFIX']}USERS as t1, {$config['TABLE_PREFIX']}USER_PROFILE as t2, {$config['TABLE_PREFIX']}USER_DATA as t3 WHERE t2.USER_BIRTHDAY LIKE ? AND t1.USER_IS_BANNED != '1' AND t2.USER_PUBLIC_BIRTHDAY = '1' AND t3.USER_LAST_VISIT_TIME >= ? AND t1.USER_ID = t2.USER_ID AND t1.USER_ID = t3.USER_ID "; $sth = $dbh -> do_placeholder_query($query,array("$month/$mday/%",$visitlimit),__LINE__,__FILE__); $marray[0] = ""; while(list($uname,$birthday,$coppauser,$birthdayuser,$Color) = $dbh -> fetch_array($sth)) { @list($bmonth,$bday,$byear) = @split("/",$birthday); $age = ""; if ($config['AGE_WITH_BIRTHDAYS'] && !$coppauser) { $age = $year - $byear; $age = " ($age)"; } // end if $Color = trim($Color); if ($Color) { $uname = "<span style=\"color:$Color;\">$uname</span>"; } else { if ($PostStatus == "Administrator") { $uname = "<span class=\"adminname\">$uname</span>"; } elseif ($PostStatus == "Moderator") { $uname = "<span class=\"modname\">$uname</span>"; } } $bdays .= "<a href=\"{$config['BASE_URL']}/ubbthreads.php?ubb=showprofile&User=$birthdayuser\">$uname</a>$age, "; } // end while } // end if if (!$bdays) { $bdays="No birthdays today"; } else { $bdays = substr($bdays,0,strlen($bdays)-2); $bdays = "Happy birthday ".$bdays."."; } /* BODY HERE */ $body = <<<EOF $bdays EOF;
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Joined: Nov 2003
Posts: 482
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Very nice, I'm gonna try this one
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Many thanks
Fans Focus - Focusing on Fans of Sport
(Okay - mainly football (the British variety at the moment - but expanding all the time....)
Joined: Sep 2005
Posts: 136
Journeyman
Journeyman
Joined: Sep 2005
Posts: 136
My other Admin Caught this: I noticed that the birthday thing on the main page was not actually doing its job, so have changed the cache setting so it actually shows up the people whose birthday it is. Guess why I noticed it doesn't work lol. Hope you don't mind! Balance
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Showing fine on our site
Fans Focus - Focusing on Fans of Sport
(Okay - mainly football (the British variety at the moment - but expanding all the time....)
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Joined: Nov 2003
Posts: 482
fyi,
for 7.3 the colorizing will be easier. just do:
$uname = $html -> user_color ( $uname , $Color , $PostStatus ); and it's done for you.
this will also take into account the globalmod color. :2c:
good stuff blaask
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Joined: Nov 2003
Posts: 482
hrm, you have a bug. $PostStatus is undefined.. fyi
SELECT t1.USER_DISPLAY_NAME,t2.USER_BIRTHDAY, t1.USER_IS_UNDERAGE,t1.USER_ID,t2.USER_NAME_COLOR, t1.USER_MEMBERSHIP_LEVELand
while(list($uname,$birthday,$coppauser,$birthdayuser,$Color,$PostStatus) = $dbh -> fetch_array($sth)) {i believe
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
that looks about right
I'll have a cleanup on post #1 tomorrow. There's a nice comfy bed waiting now.
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
Nice comfy bed could wait.../* PHP CODE HERE */ $maxdaysago=60; $temp = getdate($now); $month = $temp["mon"]; $mday = $temp["mday"]; $year = $temp["year"]; $visitlimit=time()-60*60*24*$maxdaysago; if (isset($config['BIRTHDAYS_IN_CALENDAR']) && $config['BIRTHDAYS_IN_CALENDAR']) { $query = " SELECT t1.USER_DISPLAY_NAME,t2.USER_BIRTHDAY,t1.USER_IS_UNDERAGE,t1.USER_ID,t2.USER_NAME_COLOR,t1.USER_MEMBERSHIP_LEVEL FROM {$config['TABLE_PREFIX']}USERS as t1, {$config['TABLE_PREFIX']}USER_PROFILE as t2, {$config['TABLE_PREFIX']}USER_DATA as t3 WHERE t2.USER_BIRTHDAY LIKE ? AND t1.USER_IS_BANNED != '1' AND t2.USER_PUBLIC_BIRTHDAY = '1' AND t3.USER_LAST_VISIT_TIME >= ? AND t1.USER_ID = t2.USER_ID AND t1.USER_ID = t3.USER_ID "; $sth = $dbh -> do_placeholder_query($query,array("$month/$mday/%",$visitlimit),__LINE__,__FILE__); $marray[0] = ""; while(list($uname,$birthday,$coppauser,$birthdayuser,$Color,$PostStatus) = $dbh -> fetch_array($sth)) { @list($bmonth,$bday,$byear) = @split("/",$birthday); $age = ""; if ($config['AGE_WITH_BIRTHDAYS'] && !$coppauser) { $age = $year - $byear; $age = " ($age)"; } // end if $Color = trim($Color); $bdays=$VERSION; if ($VERSION<'7.3') { if ($Color) { $uname = "<span style=\"color:$Color;\">$uname</span>"; } else { if ($PostStatus == "Administrator") { $uname = "<span class=\"adminname\">$uname</span>"; } elseif ($PostStatus == "Moderator") { $uname = "<span class=\"modname\">$uname</span>"; } } } else { $uname = $html->user_color($uname, $Color, $PostStatus); } $bdays .= "<a href=\"{$config['BASE_URL']}/ubbthreads.php?ubb=showprofile&User=$birthdayuser\">$uname</a>$age, "; } // end while } // end if if (!$bdays) { $bdays="No birthdays today"; } else { $bdays = substr($bdays,0,strlen($bdays)-2); $bdays = "Happy birthday ".$bdays."."; } /* BODY HERE */ $body = <<<EOF $bdays EOF; Fixes colorize bug, and introduces compatibility with 7.3 Untested that is Cleanup for post #1 I will still do tomorrow
Update: Hmm, doesn't seem to work yet, I'll have a test drive tomorrow
Don't know if the $VERSION variable is available in a custom island.
Last edited by blaaskaak; 09/22/2007 8:39 PM .
Joined: Sep 2005
Posts: 136
Journeyman
Journeyman
Joined: Sep 2005
Posts: 136
How about one that lists birthdays for the month instead of per day?
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
How about one that lists birthdays for the month instead of per day?
could be a busy screen if you have a lot of members. But "a month from now", because "in thos month" is not so interesting. It's not so interesting to see if somebody had it's birthday 30 days ago.
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
I'll have a cleanup on post #1 tomorrow.
The bed was very comfy
Post #1 now has been cleaned up with the latest greatest version, with the color stuff fixed for mods/admins.
Joined: Sep 2005
Posts: 136
Journeyman
Journeyman
Joined: Sep 2005
Posts: 136
Why are there lines all through it, is it safe to use?
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
No, I crossed it out because I didn't want to clear the messsage clear, but the code wasn't working in that message. Just take the island from post #1. There is always the most up-to-date, tested, version there!
Joined: Sep 2005
Posts: 136
Journeyman
Journeyman
Joined: Sep 2005
Posts: 136
I'm using the last safe version
I'm just anxious
Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
Very nice, thank you for sharing.
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
For some reason - mine has stopped working - it has been showing the same person for the last week or so
Fans Focus - Focusing on Fans of Sport
(Okay - mainly football (the British variety at the moment - but expanding all the time....)
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
Strange, it's still working fine here.
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Joined: Nov 2003
Posts: 482
works great here.. clear your cache ?
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Uploaded the latest version - all working again.
It is a shame when 90% of users hide their birthday's.
We get threads saying 'happy birthday x' when x is not showing on the birthday list
Fans Focus - Focusing on Fans of Sport
(Okay - mainly football (the British variety at the moment - but expanding all the time....)
Crasher
Unregistered
Crasher
Unregistered
just like to add my thanks for this simple but very effective mod.
Marvellous
Joined: Oct 2004
Posts: 9
Lurker
Lurker
Joined: Oct 2004
Posts: 9
I tried this, in the beginning worked fine, but after a fe days, it doesn't update anymore. Probably a caching prob, but how to avoid this? N
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
ensure you are running the latest version and clear your cache files - then rebuild the cache from your CP.
Fans Focus - Focusing on Fans of Sport
(Okay - mainly football (the British variety at the moment - but expanding all the time....)
Joined: Dec 2001
Posts: 87
Power User
Power User
Joined: Dec 2001
Posts: 87
I added the Birthday Island.. It's a big hit... But it seems to only post about one out of every 20 that show up in the Calendar. Any ideas why? I thought that if they showed in the calendar, then the permissions would allow them in the Island.
Here's the code that I used -- from this forum.
===========
/* PHP CODE HERE */ $maxdaysago=10; $temp = getdate($now); $month = $temp["mon"]; $mday = $temp["mday"]; $year = $temp["year"]; $visitlimit=time()-60*60*24*$maxdaysago; if (isset($config['BIRTHDAYS_IN_CALENDAR']) && $config['BIRTHDAYS_IN_CALENDAR']) { $query = " SELECT t1.USER_DISPLAY_NAME,t2.USER_BIRTHDAY,t1.USER_IS_UNDERAGE,t1.USER_ID,t2.USER_NAME_COLOR,t1.USER_MEMBERSHIP_LEVEL FROM {$config['TABLE_PREFIX']}USERS as t1, {$config['TABLE_PREFIX']}USER_PROFILE as t2, {$config['TABLE_PREFIX']}USER_DATA as t3 WHERE t2.USER_BIRTHDAY LIKE ? AND t1.USER_IS_BANNED != '1' AND t2.USER_PUBLIC_BIRTHDAY = '1' AND t3.USER_LAST_VISIT_TIME >= ? AND t1.USER_ID = t2.USER_ID AND t1.USER_ID = t3.USER_ID "; $sth = $dbh -> do_placeholder_query($query,array("$month/$mday/%",$visitlimit),__LINE__,__FILE__); $marray[0] = ""; while(list($uname,$birthday,$coppauser,$birthdayuser,$Color,$PostStatus) = $dbh -> fetch_array($sth)) { @list($bmonth,$bday,$byear) = @split("/",$birthday); $age = ""; if ($config['AGE_WITH_BIRTHDAYS'] && !$coppauser) { $age = $year - $byear; $age = " ($age)"; } // end if $Color = trim($Color); if ($Color) { $uname = "<span style=\"color:$Color;\">$uname</span>"; } else { if ($PostStatus == "Administrator") { $uname = "<span class=\"adminname\">$uname</span>"; } elseif ($PostStatus == "Moderator") { $uname = "<span class=\"modname\">$uname</span>"; } } $bdays .= "<a href=\"{$config['BASE_URL']}/ubbthreads.php?ubb=showprofile&User=$birthdayuser\">$uname</a>$age, "; } // end while } // end if if (!$bdays) { $bdays="No birthdays today"; } else { $bdays = substr($bdays,0,strlen($bdays)-2); $bdays = "Happy birthday ".$bdays."."; } /* BODY HERE */ $body = <<<EOF $bdays EOF; ===========
Bill Barker Issaquah, Wa
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
It looks like you have $maxdaysago=10 - which would mean that only those people who have been active in the last 10 days are shown. I have mine set to 400, to show anyone who has been online in the last year (or just over)
Fans Focus - Focusing on Fans of Sport
(Okay - mainly football (the British variety at the moment - but expanding all the time....)
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Joined: Feb 2007
Posts: 329
It looks like you have $maxdaysago=10 - which would mean that only those people who have been active in the last 10 days are shown.
That's indeed the secret. Also banned users are excluded.
Joined: Oct 2004
Posts: 9
Lurker
Lurker
Joined: Oct 2004
Posts: 9
Ignore previous mail, I didn't change anything, but now the double is gone.. :-(
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Posts:
254
Joined: January 2000
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139Sep 21st, 2024
Currently Online
Topics Created
Posts Made
Users Online
Birthdays