php forum
php mysql forum
php mysql smarty
 
Page 1 of 3 1 2 3 >
Topic Options
#315575 - 09/07/07 05:34 PM Custom island happy birthday
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
A custom island that mentions today's birthdays!

see attachments smile

Enjoy!


Attachments
readme.txt (122 downloads)
Description: [goodisland] The instructions on how to install this island.

happybirthdayisland.txt (130 downloads)
Description: [goodisland] the cody for the island

birthdaymod-7-3.txt (32 downloads)
Description: 7.3 version




Edited by Ian_W (05/12/08 01:28 AM)
Edit Reason: added 7.3 version
_________________________

Top
#315576 - 09/07/07 08:07 PM Re: Custom island happy birthday [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
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!!!!!
_________________________

Top
#315577 - 09/07/07 08:11 PM Re: Custom island happy birthday [Re: sirdude]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
boom.. quickest 'mod' ever. copy/paste, cpanel enable.. *poof*

workie..

i bow to you!
_________________________

Top
#315578 - 09/07/07 11:10 PM Re: Custom island happy birthday [Re: sirdude]
AshtarRose Offline
Journeyman

Registered: 09/22/05
Posts: 137
Loc: Columbus, OH
so easy I could do it lol
_________________________
http://www.riddledindarkness.com * Yeah I need the Crazy Mods.

Top
#315584 - 09/08/07 01:04 AM Re: Custom island happy birthday [Re: AshtarRose]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Great job blaaask! Love it hehe... I am however moving you up to the templates forum wink...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#315588 - 09/08/07 02:40 AM Re: Custom island happy birthday [Re: sirdude]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: sirdude
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 smile
_________________________

Top
#315589 - 09/08/07 04:30 AM Re: Custom island happy birthday [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
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).
_________________________

Top
#315590 - 09/08/07 10:54 AM Re: Custom island happy birthday [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
hrm i have a v2.10 now for the banned guys..

for them, the string is 'Happy Bday, you Lahewwwwwzer ..'

laugh
_________________________

Top
#315601 - 09/09/07 01:01 AM Re: Custom island happy birthday [Re: sirdude]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

Very nice... thanks!! cool
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#315608 - 09/09/07 09:41 AM Re: Custom island happy birthday [Re: jgeoff]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
we need v2.10 (colorize names - based upon Display color, admin, mod) laugh
_________________________

Top
#315615 - 09/10/07 12:22 AM Re: Custom island happy birthday [Re: sirdude]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: sirdude
we need v2.10 (colorize names - based upon Display color, admin, mod) laugh


v2.10 is already there, with the banned guys special messages.

So that would be v2.20 atleast smile
_________________________

Top
#315616 - 09/10/07 03:00 PM Re: Custom island happy birthday [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: blaaskaak
So that would be v2.20 atleast smile


v2.20 it is smile

added name color stuff, stolen (but redid some of the if's) from showflat.inc.php smile

Code:
/* 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;
_________________________

Top
#315617 - 09/10/07 04:31 PM Re: Custom island happy birthday [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
mr blaaask.. sexaaay...!
_________________________

Top
#315625 - 09/11/07 03:49 PM Re: Custom island happy birthday [Re: sirdude]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Very nice, I'm gonna try this one smile
_________________________
- Allen wavey
- What Drives You?

Top
#315691 - 09/15/07 05:58 AM Re: Custom island happy birthday [Re: AllenAyres]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
Many thanks smile
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#315704 - 09/16/07 11:58 AM Re: Custom island happy birthday [Re: Ian_W]
AshtarRose Offline
Journeyman

Registered: 09/22/05
Posts: 137
Loc: Columbus, OH
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
_________________________
http://www.riddledindarkness.com * Yeah I need the Crazy Mods.

Top
#315709 - 09/16/07 03:15 PM Re: Custom island happy birthday [Re: AshtarRose]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
Showing fine on our site smile
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#315777 - 09/22/07 03:57 PM Re: Custom island happy birthday [Re: Ian_W]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
fyi,

for 7.3 the colorizing will be easier. just do:
Php Code:
$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 wink
_________________________

Top
#315778 - 09/22/07 04:28 PM Re: Custom island happy birthday [Re: sirdude]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
hrm, you have a bug. $PostStatus is undefined.. fyi

Code:
SELECT t1.USER_DISPLAY_NAME,t2.USER_BIRTHDAY,
t1.USER_IS_UNDERAGE,t1.USER_ID,t2.USER_NAME_COLOR,
t1.USER_MEMBERSHIP_LEVEL


and
Code:
while(list($uname,$birthday,$coppauser,$birthdayuser,$Color,$PostStatus) = $dbh -> fetch_array($sth)) {


i believe smile
_________________________

Top
#315779 - 09/22/07 08:20 PM Re: Custom island happy birthday [Re: sirdude]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
that looks about right smile

I'll have a cleanup on post #1 tomorrow. There's a nice comfy bed waiting now.
_________________________

Top
#315780 - 09/22/07 08:31 PM Re: Custom island happy birthday [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Nice comfy bed could wait...

Code:
/* 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 = "&nbsp;($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 smile Untested that is laugh


Cleanup for post #1 I will still do tomorrow smile

Update: Hmm, doesn't seem to work yet, I'll have a test drive tomorrow smile Don't know if the $VERSION variable is available in a custom island.


Edited by blaaskaak (09/22/07 08:39 PM)
_________________________

Top
#315781 - 09/22/07 09:47 PM Re: Custom island happy birthday [Re: blaaskaak]
AshtarRose Offline
Journeyman

Registered: 09/22/05
Posts: 137
Loc: Columbus, OH
How about one that lists birthdays for the month instead of per day?
_________________________
http://www.riddledindarkness.com * Yeah I need the Crazy Mods.

Top
#315783 - 09/23/07 03:46 AM Re: Custom island happy birthday [Re: AshtarRose]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: AshtarRose
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.
_________________________

Top
#315784 - 09/23/07 04:23 AM Re: Custom island happy birthday [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: blaaskaak
I'll have a cleanup on post #1 tomorrow.


The bed was very comfy smile

Post #1 now has been cleaned up with the latest greatest version, with the color stuff fixed for mods/admins.
_________________________

Top
#315793 - 09/23/07 11:57 PM Re: Custom island happy birthday [Re: blaaskaak]
AshtarRose Offline
Journeyman

Registered: 09/22/05
Posts: 137
Loc: Columbus, OH
Why are there lines all through it, is it safe to use?
_________________________
http://www.riddledindarkness.com * Yeah I need the Crazy Mods.

Top
#315794 - 09/24/07 01:52 AM Re: Custom island happy birthday [Re: AshtarRose]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
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!
_________________________

Top
#315795 - 09/24/07 10:24 AM Re: Custom island happy birthday [Re: blaaskaak]
AshtarRose Offline
Journeyman

Registered: 09/22/05
Posts: 137
Loc: Columbus, OH
I'm using the last safe version smile I'm just anxious
_________________________
http://www.riddledindarkness.com * Yeah I need the Crazy Mods.

Top
#316190 - 10/31/07 02:02 PM Re: Custom island happy birthday [Re: blaaskaak]
Zarzal Offline
Coder

Registered: 07/03/01
Posts: 811
Loc: Berlin, Germany
Very nice, thank you for sharing.
_________________________
my forum: http://www.dragon-clan.de
my hobby: http://www.biker-reise.de

Top
#316246 - 11/05/07 09:01 AM Re: Custom island happy birthday [Re: Zarzal]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
For some reason - mine has stopped working - it has been showing the same person for the last week or so frown
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#316247 - 11/05/07 10:04 AM Re: Custom island happy birthday [Re: Ian_W]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Strange, it's still working fine here.
_________________________

Top
#316255 - 11/05/07 01:01 PM Re: Custom island happy birthday [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
works great here..

clear your cache ?
_________________________

Top
#316259 - 11/05/07 07:35 PM Re: Custom island happy birthday [Re: sirdude]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
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 frown
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#316263 - 11/06/07 11:33 AM Re: Custom island happy birthday [Re: blaaskaak]
Crasher Offline
Newbie

Registered: 10/18/07
Posts: 10
just like to add my thanks for this simple but very effective mod.
Marvellous smile
_________________________
I don't do a lot, but i do do this

Top
#316540 - 12/31/07 04:16 AM Re: Custom island happy birthday [Re: blaaskaak]
nans Offline
Lurker

Registered: 10/10/04
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

Top
#316541 - 12/31/07 07:39 AM Re: Custom island happy birthday [Re: nans]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
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 wink at the moment - but expanding all the time....)

Top
#316600 - 01/11/08 04:35 PM Birthdays don't show consistently
Bill B Offline
User

Registered: 12/23/01
Posts: 47
Loc: Issaquah, WA
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.
===========
Code:
/* 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 = "&nbsp;($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

Top
#316603 - 01/11/08 07:20 PM Re: Birthdays don't show consistently [Re: Bill B]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
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 wink at the moment - but expanding all the time....)

Top
#316690 - 02/08/08 04:47 PM Re: Birthdays don't show consistently [Re: Ian_W]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: Ian_W
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.
_________________________

Top
#316692 - 02/10/08 06:34 AM Re: Birthdays don't show consistently [Re: Bill B]
nans Offline
Lurker

Registered: 10/10/04
Posts: 9
I used the same code, and the result is quiet weird, one user, but mentioned twice:


Happy birthday Happy birthday Alone.Alone.

(http://www.femistyle.be/ubbthreads/ubbthreads.php)

Top
#316693 - 02/10/08 07:21 AM Re: Birthdays don't show consistently [Re: nans]
nans Offline
Lurker

Registered: 10/10/04
Posts: 9
Ignore previous mail, I didn't change anything, but now the double is gone.. :-(

Top
#316932 - 05/09/08 08:24 AM Re: Birthdays don't show consistently [Re: nans]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
If no year of birth is included by the user, then this box is showing the current year - i.e. 2008, as the age.
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#316933 - 05/09/08 08:25 AM Re: Birthdays don't show consistently [Re: Ian_W]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
BTW - this is probably because the profile shows the year of birth as 0!
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#316934 - 05/09/08 05:05 PM Re: Birthdays don't show consistently [Re: Ian_W]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Yeah, it takes the current year minus the birth year as age.

Have to update this for 7.3 anyway for usercolorcoding, will fix this too.

edit:

change line:
Code:
		if ($config['AGE_WITH_BIRTHDAYS'] && !$coppauser) {


into:

Code:
		if ($config['AGE_WITH_BIRTHDAYS'] && !$coppauser && $byear ) {
_________________________

Top
#316936 - 05/10/08 05:05 AM Re: Birthdays don't show consistently [Re: blaaskaak]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
Thanks - let us know when you have an updated version released.
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#316941 - 05/11/08 05:29 PM Re: Birthdays don't show consistently [Re: Ian_W]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: Ian_W
Thanks - let us know when you have an updated version released.


I just made an update, but permissions don't seem to be correct here yet in this subforum, I can't edit my first post.

Code:
/* 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 && $byear) {
			$age = $year - $byear;
			$age = "&nbsp;($age)";
		} // end if
		$Color = trim($Color);
		$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;


This is the latest/greatest for 7.3.
_________________________

Top
#316942 - 05/11/08 05:50 PM Re: Birthdays don't show consistently [Re: blaaskaak]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
BTW, it'd be good to have seperate UBB7.3 and Pre7.3 versions listed wink...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#316944 - 05/11/08 06:26 PM Re: Birthdays don't show consistently [Re: Gizmo]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: Gizmo
BTW, it'd be good to have seperate UBB7.3 and Pre7.3 versions listed wink...


It be even better if I were able do to just that in post #1 smile
_________________________

Top
#316947 - 05/12/08 01:29 AM Re: Birthdays don't show consistently [Re: blaaskaak]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
I have added the 7.3 version to the first post smile

Let me know if you would like the other version removed or updated.
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#316948 - 05/12/08 01:31 AM Re: Birthdays don't show consistently [Re: Ian_W]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

But it never stopped working, at least for me... any major change?
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#316949 - 05/12/08 02:43 AM Re: Birthdays don't show consistently [Re: jgeoff]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: jgeoff

But it never stopped working, at least for me... any major change?


Username color coding is added for 7.3, because you also have global mods in it with their own color. And a bug is fixed that Ian mentioned, if a user has no birthyear filled in in their profile, the age was wrong.
_________________________

Top
#316977 - 05/16/08 12:34 AM Re: Birthdays don't show consistently [Re: blaaskaak]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

Gotcha - point taken! cool
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#316978 - 05/16/08 03:32 AM Re: Birthdays don't show consistently [Re: jgeoff]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: jgeoff

Gotcha - point taken! cool


Updated code also? wink
_________________________

Top
#317105 - 05/30/08 09:10 PM Re: Custom island happy birthday [Re: blaaskaak]
willing Offline
User

Registered: 04/17/07
Posts: 42
Nice one.

Is there a way to "offset time".

So for example if we are in Japan then "today" is today as it is in Japan? Right now I have 2 birthdays for today, but they did not show up (even though they were active members).

Thanks

Top
#317134 - 06/01/08 05:29 AM Re: Custom island happy birthday [Re: willing]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Since this is all cached stuff, doing timezones per user is a bit difficult. Everything now has to be based on servertime.

would be cool if a cached version would be created per timezone.
_________________________

Top
#317135 - 06/01/08 05:46 AM Re: Custom island happy birthday [Re: blaaskaak]
willing Offline
User

Registered: 04/17/07
Posts: 42
I wasn't asking for "per user", but to be "set" to the timeozone for all users.

(Our server is not based in the same time zone as where we are and where I want it set for and when I tried the above it semeingly was using the server time).

Thanks

Top
#317136 - 06/01/08 04:14 PM Re: Custom island happy birthday [Re: willing]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Okay, I need to take the server offset time into considiration. Never throught of that one.
_________________________

Top
#317137 - 06/01/08 04:32 PM Re: Custom island happy birthday [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
okay, just before:

Php Code:

$temp = getdate($now);
 


add
Php Code:

$now = time()+($config['SERVER_TIME_OFFSET']*60*60);
 


Should work, not tested yet since I don't have an install at hand where I can easely test this. Will test this and update the first post.
_________________________

Top
Page 1 of 3 1 2 3 >



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks