php forum
php mysql forum
php mysql smarty
 
Page 3 of 3 < 1 2 3
Topic Options
#316932 - 05/09/08 08:24 AM Re: Birthdays don't show consistently [Re: nans]
Ian_W Global Moderator Offline
Veteran

Registered: 02/22/02
Posts: 2554
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 Global Moderator Offline
Veteran

Registered: 02/22/02
Posts: 2554
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
Member

Registered: 02/25/07
Posts: 237
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 Global Moderator Offline
Veteran

Registered: 02/22/02
Posts: 2554
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
Member

Registered: 02/25/07
Posts: 237
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 Administrator Online   shocked
Wizard

Registered: 01/10/00
Posts: 5046
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 Owner

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

Registered: 02/25/07
Posts: 237
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 Global Moderator Offline
Veteran

Registered: 02/22/02
Posts: 2554
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: 81
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
Member

Registered: 02/25/07
Posts: 237
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 - Yesterday at 12:34 AM Re: Birthdays don't show consistently [Re: blaaskaak]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 81
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 - Yesterday at 03:32 AM Re: Birthdays don't show consistently [Re: jgeoff]
blaaskaak Offline
Member

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

Gotcha - point taken! cool


Updated code also? wink
_________________________

Top
Page 3 of 3 < 1 2 3


Moderator:  LK 
Who's Online
0 Registered (), 46 Guests and 31 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Custom Tag - MySpace
by Gizmo
Today at 06:58 PM
RSS Topic Creator [Release Candidate]
by Gizmo
Today at 06:55 PM
Custom island happy birthday
by blaaskaak
Today at 03:32 AM
Tags and tag cloud
by willing
Yesterday at 11:27 PM
Integrating UBB seamlessly with Drupal
by Obie
Yesterday at 12:03 PM
Team UBBDev Rides Again!
by Gizmo
05/14/08 06:09 PM
Faster! Faster!
by AllenAyres
05/14/08 05:13 PM
New Mods
Custom Tag - MySpace
by Gizmo
Today at 06:58 PM
How To Turn Off "no follow" in sigs?
by doug
05/13/08 08:30 AM
[7.x] [7.3+] [Final] pJIRC Addon v0.5
by Gizmo
05/12/08 03:27 AM
Rounded corners on boxes 7.2.2
by arentzen
05/04/08 02:13 PM
Blended Sponsor Bar
by Gizmo
04/29/08 07:29 AM
Newest Members
maximumrock, whychoseme, doug, Yakumo, paqueenie
13288 Registered Users

 

 

 
fusionbb message board php hacks