MyBB Community Forums

Full Version: Birthday Bug-Fix
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This fixes the wrong Publicised Birthday details in RC4, and others I should imagine. Wink

Birthday Bug Fix:


OPEN: Admin CP / Templates - (Modify / Delete) / Default Templates / Expand / User Control Panel Templates / Expand / usercp_profile / Change Original

Find Line:

<input type="text" size="4" maxlength="4" name="bday3" value="$bday[2]">


Change Line to:

<input type="text" size="4" maxlength="4" name="bday3" value="$bday[2]" />

Shortcut: Just add the space and forward slash (/) to the end of the line. Smile

Save the usercp_profile Template. Toungue
hmmm......that's the only template my system tells me 'you're not authorized..'.....we'll see about that.....hmmmm
I don't know why, as templates to the best of my knowledge don't have permission restrictions.

I tested this on a 'fresh' install before adding any birthdays whatsoever, and tested it with three different users with lot's of changes to the dates... and they always came up correct.

If the change is done to an existing (Working) forum, and the wrong info has been passed to the database, it may need to have the Users info.. refreshed. (Not sure........ ).

I also note that this problem has been around for some time... So!

I hope the guys working on PR1 (Gold) have picked this thread up ?? because it works for me... and it works fine everytime. Wink
Quote:I hope the guys working on PR1 (Gold) have picked this thread up ?
Yes Wink
Hey! Hey! Tochjo..

What about applying the MOD here and I'll see if I'm 58 instead of being a 'teenager' again.... ROFL!
I think it worked for me.... can't remember what the problem was but my profile shows me and other people with the right age now Smile (kinda DouglasAdamsian -problem I know)

I ended up having to edit the template with phpmyadmin directly on the database as for some reason I was not allowed to edit it via the admincp....(the errormessage above)

Cheers,
Kimmo
for some reason the problem is back....or was it a different one...in any case I decided to hide the problem in the userprofiles by doing the following:

Open member.php and replace:
=======================
if($memprofile['birthday'])
	{
		$membday = explode("-", $memprofile['birthday']);
		if($membday[2])
		{
			$bdayformat = fixmktime($settings['dateformat'], $membday[2]);
			$membday = mktime(0, 0, 0, $membday[1], $membday[0], $membday[2]);
			$membdayage = "(" . floor((time() - $membday) / 31557600) . " years old)";
			$membday = gmdate($bdayformat, $membday);
		}
		else
		{
			$membday = mktime(0, 0, 0, $membday[1], $membday[0], 0);
			$membday = gmdate("F j", $membday);
			$membdayage = "";
		}
	}
	else
	{
		$membday = "Not Specified";
		$membdayage = "";
	}


with this:


	if($memprofile['birthday'])
	{
		$membday = $memprofile['birthday'];
		
	}
	else
	{
		$membday = "Not Specified";
	}


//if($memprofile['birthday'])
//	{
//		$membday = explode("-", $memprofile['birthday']);
//		if($membday[2])
//		{
//			$bdayformat = fixmktime($settings['dateformat'], $membday[2]);
//			$membday = mktime(0, 0, 0, $membday[1], $membday[0], $membday[2]);
//			$membdayage = "(" . floor((time() - $membday) / 31557600) . " years old)";
//			$membday = gmdate($bdayformat, $membday);
//		}
//		else
//		{
//			$membday = mktime(0, 0, 0, $membday[1], $membday[0], 0);
//			$membday = gmdate("F j", $membday);
//			$membdayage = "";
//		}
//	}
//	else
//	{
//		$membday = "Not Specified";
//		$membdayage = "";
//	}

notice I left the old code there....in my opinion it's better than just replacing the old code...allows you to go back at some point if necessary...

What this basically does is just show the birthdate on the userprofile as it is stored in the database ....in my case it is dd-mm-yyyy (but I don't know if this is universal), and drops the whole age-calculation....I know it's not as nice...but I thought I'd rather give a little bit of accurate information than a lot of misleading info.....
For me this is just a stop-gap-measure....I believe it's fixed in Gold anyway. Just thought if anyone else wants to take the easy way out then the code is above...

cheers,
Kimmo
Ozidave Wrote:This fixes the wrong Publicised Birthday details
Hi. I noticed the problem only after reading this post. Unfortunately your instructions didn't help. The fix doesn't work. My birthday it is still desplayed one with day earlier.
Any help?