Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Birthdays don't show consistently
nans #316932 05/09/2008 7:24 AM
Joined: Feb 2002
Posts: 2,286
Veteran
Offline
Veteran
Joined: Feb 2002
Posts: 2,286
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....)
Sponsored Links
Re: Birthdays don't show consistently
Ian_W #316933 05/09/2008 7:25 AM
Joined: Feb 2002
Posts: 2,286
Veteran
Offline
Veteran
Joined: Feb 2002
Posts: 2,286
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....)
Re: Birthdays don't show consistently
Ian_W #316934 05/09/2008 4:05 PM
Joined: Feb 2007
Posts: 329
Yarp™
OP Offline
Yarp™
Joined: Feb 2007
Posts: 329
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 ) {

Re: Birthdays don't show consistently
blaaskaak #316936 05/10/2008 4:05 AM
Joined: Feb 2002
Posts: 2,286
Veteran
Offline
Veteran
Joined: Feb 2002
Posts: 2,286
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....)
Re: Birthdays don't show consistently
Ian_W #316941 05/11/2008 4:29 PM
Joined: Feb 2007
Posts: 329
Yarp™
OP Offline
Yarp™
Joined: Feb 2007
Posts: 329
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 = " ($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.

Sponsored Links
Re: Birthdays don't show consistently
blaaskaak #316942 05/11/2008 4:50 PM
Joined: Jan 2000
Posts: 5,795
Likes: 8
UBB.Dev / UBB.Wiki Owner
Time Lord
Online Tapedshut
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,795
Likes: 8
BTW, it'd be good to have seperate UBB7.3 and Pre7.3 versions listed wink...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.Sitemaps
Re: Birthdays don't show consistently
Gizmo #316944 05/11/2008 5:26 PM
Joined: Feb 2007
Posts: 329
Yarp™
OP Offline
Yarp™
Joined: Feb 2007
Posts: 329
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

Re: Birthdays don't show consistently
blaaskaak #316947 05/12/2008 12:29 AM
Joined: Feb 2002
Posts: 2,286
Veteran
Offline
Veteran
Joined: Feb 2002
Posts: 2,286
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....)
Re: Birthdays don't show consistently
Ian_W #316948 05/12/2008 12:31 AM
Joined: Apr 2001
Posts: 96
Power User
Offline
Power User
Joined: Apr 2001
Posts: 96

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
Re: Birthdays don't show consistently
jgeoff #316949 05/12/2008 1:43 AM
Joined: Feb 2007
Posts: 329
Yarp™
OP Offline
Yarp™
Joined: Feb 2007
Posts: 329
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.

Sponsored Links
Re: Birthdays don't show consistently
blaaskaak #316977 05/15/2008 11:34 PM
Joined: Apr 2001
Posts: 96
Power User
Offline
Power User
Joined: Apr 2001
Posts: 96

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
Re: Birthdays don't show consistently
jgeoff #316978 05/16/2008 2:32 AM
Joined: Feb 2007
Posts: 329
Yarp™
OP Offline
Yarp™
Joined: Feb 2007
Posts: 329
Originally Posted by jgeoff

Gotcha - point taken! cool


Updated code also? wink

Re: Custom island happy birthday
blaaskaak #317105 05/30/2008 8:10 PM
Joined: Apr 2007
Posts: 42
User
Offline
User
Joined: Apr 2007
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

Re: Custom island happy birthday
willing #317134 06/01/2008 4:29 AM
Joined: Feb 2007
Posts: 329
Yarp™
OP Offline
Yarp™
Joined: Feb 2007
Posts: 329
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.

Re: Custom island happy birthday
blaaskaak #317135 06/01/2008 4:46 AM
Joined: Apr 2007
Posts: 42
User
Offline
User
Joined: Apr 2007
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

Re: Custom island happy birthday
willing #317136 06/01/2008 3:14 PM
Joined: Feb 2007
Posts: 329
Yarp™
OP Offline
Yarp™
Joined: Feb 2007
Posts: 329
Okay, I need to take the server offset time into considiration. Never throught of that one.

Re: Custom island happy birthday
blaaskaak #317137 06/01/2008 3:32 PM
Joined: Feb 2007
Posts: 329
Yarp™
OP Offline
Yarp™
Joined: Feb 2007
Posts: 329
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.

Page 2 of 2 1 2

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 2001
Forum Statistics
Forums63
Topics37,529
Posts293,721
Members13,834
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online 147
Topics Created 0
Posts Made 0
Users Online 1
Birthdays 26
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,795
Greg Hard 4,625
Top Posters(30 Days)
isaac 3
Top Likes Received
isaac 33
Gizmo 8
Brett 7
Morgan 2
Top Likes Received (30 Days)
isaac 3
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2020 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Snapshot build 20200228.dev)
Responsive Width:

PHP: 5.4.45 Page Time: 0.065s Queries: 50 (0.026s) Memory: 3.4222 MB (Peak: 3.6755 MB) Data Comp: Zlib Server Time: 2020-02-29 06:46:30 UTC
Valid HTML 5 and Valid CSS