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: 2570
Loc: England

   Re: Birthdays don Add to del.icio.us
  Digg Re: Birthdays don Digg it
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: 2570
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 Online   content
Member

Registered: 02/25/07
Posts: 287
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: 2570
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 Online   content
Member

Registered: 02/25/07
Posts: 287
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 Offline
Wizard

Registered: 01/10/00
Posts: 5119
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 Online   content
Member

Registered: 02/25/07
Posts: 287
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: 2570
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 Online   content
Member

Registered: 02/25/07
Posts: 287
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 Online   content
Member

Registered: 02/25/07
Posts: 287
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 Online   content
Member

Registered: 02/25/07
Posts: 287
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 Online   content
Member

Registered: 02/25/07
Posts: 287
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 Online   content
Member

Registered: 02/25/07
Posts: 287
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 
Top Posters Last 30 Days
AllenAyres 12
Gizmo 10
S7ARBVCK 2
blaaskaak 2
Cambridge 1
Murphdog 1
MattUK 1
Who's Online
1 Registered (blaaskaak), 31 Guests and 8 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
[7.3.1] add search to showmembers page
by blaaskaak
22 minutes 13 seconds ago
BeyondCompare v3.00
by blaaskaak
09/05/08 02:46 PM
Noob - need help, or a reality check!
by Gizmo
09/04/08 03:21 AM
Here I am! Rock me like a Hurricane!
by AllenAyres
09/02/08 03:05 PM
[7.x] Generic Page Outside of forum directory
by Gizmo
08/30/08 05:43 PM
Team UBBDev Rides Again!
by Gizmo
08/28/08 11:45 PM
Multiple Identity Detector
by MattUK
08/28/08 04:10 PM
New Mods
[7.3.1] add search to showmembers page
by blaaskaak
22 minutes 13 seconds ago
Installing FlashChat with 7.3
by Paug
08/23/08 12:14 AM
[7.3.x] ubb.links
by AllenAyres
06/20/08 11:50 PM
[7.2.1] - Naked shoutbox
by sirdude
08/17/07 10:36 PM
[7.x] Generic Page Outside of forum directory
by
01/14/07 10:58 PM
Newest Members
veedubb8, twentyseven, Claus1, welcomeback1, Paug
13327 Registered Users

 

 

 
fusionbb message board php hacks