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: 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 Global Moderator 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: 303
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: 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: 303
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: 5133
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
Enthusiast

Registered: 02/25/07
Posts: 303
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: 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: 93
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: 303
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: 93
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: 303
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: 303
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: 303
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: 303
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 3 of 3 < 1 2 3


Moderator:  sirdude 
Who's Online
0 registered (), 27 Guests and 11 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
How to hide sub forums from summary page
by Ruben Rocha
Today at 02:58 PM
Spell Check [beta]
by Bill B
Yesterday at 09:16 PM
PhotoPost BB Code Popup
by AllenAyres
Yesterday at 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
Yesterday at 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
Yesterday at 09:33 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
David DelMonte, nick1, Begbie, cenk, MATTO
13363 Registered Users
Top Posters
AllenAyres 25452
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks