Welcome, Guest. Please Login or Register.
April 26, 2025, 11:34:20 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Done] Show Birthday When No Year Is Given « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [Done] Show Birthday When No Year Is Given  (Read 1383 times)
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
[Done] Show Birthday When No Year Is Given
« on: July 29, 2002, 05:11:05 AM »
Reply with quote

This has been a mod I have wanted for a while and no one wrote.  What it does is change it from showing N/A for your age and your birthday not showing on the calendar to showing your birthday in the place of your age. You can see an example of this here. http://www.boardnation.com/?action=viewprofile;user=david  That is a YaPP page but the line numbers are based off of YaBBSE 1.4 code.

Here is the Boardmod version.
http://www.boardnation.com/birthday.mod

Replace (line 723 of Profile.php):
   if (!isset($memsettings[16]) || $memsettings[16] =='0000-00-00' || $memsettings[16]=='')
      $age = "N/A";
   else
   {
      $age = substr($memsettings[16],0,4) == '0000' ? 'N/A' : $datearray['year']-substr($memsettings[16],0,4)-(($datearray['mon']>substr($memsettings[16],5,2)||$datearray['mon']==substr($memsettings[16],5,2) && $datearray['mday']>=substr($memsettings[16],8,2))?0:1);
      $isbday = ($datearray['mon']==substr($memsettings[16],5,2) && $datearray['mday']==substr($memsettings[16],8,2));
   }

With:
   if (!isset($memsettings[16]) || $memsettings[16] =='0000-00-00' || $memsettings[16]=='')
      $age = "N/A";
   elseif(substr($memsettings[16],0,4) == '0000') { //To display birthdate if no year is specified
      $age = date('F jS', strtotime($memsettings[16]));
      $txt[420] = 'Birthday';
   }
   else
   {
      $age = substr($memsettings[16],0,4) == '0000' ? 'N/A' : $datearray['year']-substr($memsettings[16],0,4)-(($datearray['mon']>substr($memsettings[16],5,2)||$datearray['mon']==substr($memsettings[16],5,2) && $datearray['mday']>=substr($memsettings[16],8,2))?0:1);
      $isbday = ($datearray['mon']==substr($memsettings[16],5,2) && $datearray['mday']==substr($memsettings[16],8,2));
   }
« Last Edit: July 29, 2002, 05:46:35 AM by David » Logged

PoohBear
Jr. Member
**
Posts: 66


Re:[Done] Show Birthday When No Year Is Given
« Reply #1 on: January 26, 2003, 10:04:44 AM »
Reply with quote

Any chance of the same for YaBBSE 1.5.1RC1?

Would be appreciated ;)
Logged
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:[Done] Show Birthday When No Year Is Given
« Reply #2 on: January 26, 2003, 06:19:58 PM »
Reply with quote

Quote from: PoohBear on January 26, 2003, 10:04:44 AMAny chance of the same for YaBBSE 1.5.1RC1?

Would be appreciated ;)
It should still work with 1.5.1, let me know if it does not.
Logged

N-Ur-Hand
Noobie
*
Posts: 38


I'm a llama!

Re:[Done] Show Birthday When No Year Is Given
« Reply #3 on: January 28, 2003, 08:35:58 PM »
Reply with quote

 In 1.5 there were a couple of differences that i changed so there would be no major change in format. It does not matter one way or the other but the 1.5.1 RC1 had it typed in differently

I changed:

$age = "N/A";

To:

$age = "$txt[470]

And changed:

'0000' ? 'N/A'

To:

'0000' ? '$txt[470]'


 No biggy either way it is the same thing, but i wanted to keep it calling from the english or what ever lng file like it had been before..

But it works great.

N-Ur-Hand
Logged
PoohBear
Jr. Member
**
Posts: 66


Re:[Done] Show Birthday When No Year Is Given
« Reply #4 on: February 02, 2003, 04:54:55 AM »
Reply with quote

Thanks, it is working but the day is displayed as four digits opposed to two?

ie. January 26 = January 2600

I guess it is just a typo I have made, but I can't see it?
« Last Edit: February 11, 2003, 02:08:42 PM by PoohBear » Logged
PoohBear
Jr. Member
**
Posts: 66


Re:[Done] Show Birthday When No Year Is Given
« Reply #5 on: February 11, 2003, 01:44:08 AM »
Reply with quote

Anybody got any ideas about this? Your assistance will be appreciated.  ;D
« Last Edit: February 11, 2003, 02:09:00 PM by PoohBear » Logged
PoohBear
Jr. Member
**
Posts: 66


Re:[Done] Show Birthday When No Year Is Given
« Reply #6 on: February 28, 2003, 02:48:29 PM »
Reply with quote

Well I guess nobody has this problem then?
Strange!
Logged
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:[Done] Show Birthday When No Year Is Given
« Reply #7 on: March 01, 2003, 02:25:59 AM »
Reply with quote

'0000' ? '$txt[470]'

Should be

'0000' ? $txt[470]
Logged

PoohBear
Jr. Member
**
Posts: 66


Re:[Done] Show Birthday When No Year Is Given
« Reply #8 on: March 21, 2003, 11:41:26 PM »
Reply with quote

Quote from: David on March 01, 2003, 02:25:59 AM
'0000' ? '$txt[470]'

Should be

'0000' ? $txt[470]

I have changed that in Profile.php but still got the four digit day "January 2600" when the year is not stated...?
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Done] Show Birthday When No Year Is Given « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.032 seconds with 16 queries.