Birthdays

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
151
66%
Very Good
39
17%
Good
21
9%
Fair
5
2%
Poor
12
5%
 
Total votes: 228

User avatar
bamavamp
Registered User
Posts: 62
Joined: Wed Jan 24, 2007 5:13 am
Location: sweet home alabama

Re: Birthdays

Post by bamavamp » Sat Aug 25, 2007 9:23 pm

Thanks it worked just fine, now another question. How would I change it so that everytime the birthday appeared (like in their profile) that would be the setup for it. Like right now it has only changed it for the registration to the forum--how can you change it so that when I went to my profile to change my DOB it was in the Month, Day Year format or when we viewed someone's profile it was in the same format, as well as in the admin cp under user management?

User avatar
quahappy
Former Team Member
Posts: 1416
Joined: Tue Dec 12, 2006 8:19 pm
Location: South Yorkshire
Name: Andy Green

Re: Birthdays

Post by quahappy » Sat Aug 25, 2007 11:26 pm

bamavamp wrote:Thanks it worked just fine, now another question. How would I change it so that everytime the birthday appeared (like in their profile) that would be the setup for it. Like right now it has only changed it for the registration to the forum--how can you change it so that when I went to my profile to change my DOB it was in the Month, Day Year format or when we viewed someone's profile it was in the same format, as well as in the admin cp under user management?
If you want to change it so the format is the same across the whole of your Forum Board then change in language/lang_english/lang_main.tpl :

Code: Select all

#
# ----- [ FIND ]----------------
#
$lang['DATE_FORMAT'] =  'd M Y'; // This should be changed to the default date format for your language, php date() format

#
# ------ [ REPLACE WITH ] --------------
#
$lang['DATE_FORMAT'] =  'M d Y';

The only part that will remain the same is: The time now is 25 Aug 2007 10:51 pm, displayed on every page. Your Members will need to edit there Profile and change the Date format: to: M d Y h:i a. But this is just a personal preference for each individual.

Hope that answers your question. ;)
If you don't ask.....

Brinda
Registered User
Posts: 41
Joined: Fri Mar 02, 2007 7:54 pm
Contact:

Re: Birthdays

Post by Brinda » Mon Aug 27, 2007 12:43 am

Brinda wrote:In ACP when I want to select "Pm", I can't do it. I can choose only Email and Popup. I don't know why!
Brinda wrote:In memberlist doesn't appear any Age... :roll: :roll:
And I have another one...

If I choose for example a birthday before 1970, for example 20/01/1938, appears always 01/01/1970, but the age is correct in viewtopic (69 years).

Someone can help me?

Thanks!

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Birthdays

Post by RMcGirr83 » Mon Aug 27, 2007 1:14 am

Brinda wrote:
Brinda wrote:In ACP when I want to select "Pm", I can't do it. I can choose only Email and Popup. I don't know why!
need more info...what does "I can't do it" mean?
Brinda wrote:In memberlist doesn't appear any Age... :roll: :roll:
Post a text link to both memberlist.php and memberlist_body.tpl and I'll take a look
And I have another one...

If I choose for example a birthday before 1970, for example 20/01/1938, appears always 01/01/1970, but the age is correct in viewtopic (69 years).

Someone can help me?

Thanks!

Unix timestamps (most servers are a variant of Unix...like Redhat, et.) date starts at 01/01/1970 and am afraid there is nothing you can do about that. Not a very good answer, I know, but at least it is an answer.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Re: Birthdays

Post by TerraFrost » Mon Aug 27, 2007 3:34 am

Trish20646 - I tried replacing my template.php file with your template.php and didn't get any Parse errors... it looks like RMcGirr83 fixed that problem.

As for the other errors... how many MODs did you have installed? Honestly, I think recreating the phpBB files from scratch might be prudent. And try installing with EasyMOD. That should eliminate human error.

Brinda - the problem is this:

(from usercp_viewprofile.php)

Code: Select all

       $birthday = create_date('d/M/Y', gmmktime(12,0,0,$bday_month,$bday_day,2000), 0);
That 'd/M/Y' should be replaced with $birthday_format. $birthday_format had the Y removed on the previous line and replaced with the actual year. The 2000 is just arbitrary. It could be 1996 or 1992, too. The one caveat is that it ought to be a leap year, to display Feb. 29 birthdates without error. Off hand, I don't know if 0 is a leap year or not.

Regarding your error where birthdays before 1970 appear as though they were in 1970... try replacing the $birthday = line with the one above.
In ACP when I want to select "Pm", I can't do it. I can choose only Email and Popup. I don't know why!
It's a placeholder. The ability to do PM's hasn't been implemented, but should someone come along and implement that feature via a MOD, they may do so.

Regarding your memberlist problem... *sigh*

Can you post your memberlist.php file?
quahappy wrote:It didn't help the fact that Internet Explorer 7 isn't W3C compliant with the use of <BIG>, so I've removed that (I had only remembered!).
Interesting. Never even heard of the big tag, heh.

Also, the font tag is deprecated in XHTML, but... if you're not aiming for XHTML compliancy, that's not a problem :)

Trish20646
Registered User
Posts: 14
Joined: Sat Aug 11, 2007 4:54 am

Re: Birthdays

Post by Trish20646 » Mon Aug 27, 2007 4:41 pm

TerraFrost wrote:Trish20646 - I tried replacing my template.php file with your template.php and didn't get any Parse errors... it looks like RMcGirr83 fixed that problem.

As for the other errors... how many MODs did you have installed? Honestly, I think recreating the phpBB files from scratch might be prudent. And try installing with EasyMOD. That should eliminate human error.
I have Easy Mod installed and tried to install the bday mod using it the first time. I didn't get any errors and it said everything was fine. Only nothing got installed :(. I know easy mod works because I was able to install templates. I'm using the Acid Template and I made sure to go in and change all the files necessary for the bday mod to work.

Before I did the bday mod by hand everything was working just fine. Mod's I have are:
Easy Mod
My Quick Reply
Callite (calander)

Callite doens't work with easy mod and I got it all installed fine by hand. I don't understand why I'm getting all of these errors. It didn't happend until after I finished the bday mod. Everything was working just fine before that.

Oh well I guess I will just have to start over again. UGGGGHH. :cry:

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Re: Birthdays

Post by TerraFrost » Mon Aug 27, 2007 5:02 pm

The errors are happening after you installed it by hand (after the EasyMOD install failed)? If you made backups, I'd recommend restoring those and trying to do EasyMOD, again. It's easier to diagnose EasyMOD problems then it is to debug human errors.

Also, if you try to install with EasyMOD, again, and nothing happens, could you tell me if this MOD appears in the MOD History thing? If it does, then there's probably a MOD conflict (MOD conflicts are easier to find then human errors, too).

Trish20646
Registered User
Posts: 14
Joined: Sat Aug 11, 2007 4:54 am

Re: Birthdays

Post by Trish20646 » Mon Aug 27, 2007 5:07 pm

TerraFrost wrote:The errors are happening after you installed it by hand (after the EasyMOD install failed)? If you made backups, I'd recommend restoring those and trying to do EasyMOD, again. It's easier to diagnose EasyMOD problems then it is to debug human errors.

Also, if you try to install with EasyMOD, again, and nothing happens, could you tell me if this MOD appears in the MOD History thing? If it does, then there's probably a MOD conflict (MOD conflicts are easier to find then human errors, too).
I'll do that now and let you know what happens :)

Thanks a bunch.

User avatar
quahappy
Former Team Member
Posts: 1416
Joined: Tue Dec 12, 2006 8:19 pm
Location: South Yorkshire
Name: Andy Green

Re: Birthdays

Post by quahappy » Mon Aug 27, 2007 7:00 pm

TerraFrost wrote:
quahappy wrote:It didn't help the fact that Internet Explorer 7 isn't W3C compliant with the use of <BIG>, so I've removed that (I had only remembered!).
Interesting. Never even heard of the big tag, heh.

Also, the font tag is deprecated in XHTML, but... if you're not aiming for XHTML compliancy, that's not a problem :)
LOL. When testing visual changes I normally just view my website using IE7, Firefox, and more recently, Safari (it's well quick!). But yes, you are right about the font tag. I should really add a new css label for what I've done to keep everything "tidy" . ;)

Thanks again TerraFrost for your invaluable comments. :D
If you don't ask.....

Trish20646
Registered User
Posts: 14
Joined: Sat Aug 11, 2007 4:54 am

Re: Birthdays

Post by Trish20646 » Mon Aug 27, 2007 7:09 pm

Trish20646 wrote:
TerraFrost wrote:The errors are happening after you installed it by hand (after the EasyMOD install failed)? If you made backups, I'd recommend restoring those and trying to do EasyMOD, again. It's easier to diagnose EasyMOD problems then it is to debug human errors.

Also, if you try to install with EasyMOD, again, and nothing happens, could you tell me if this MOD appears in the MOD History thing? If it does, then there's probably a MOD conflict (MOD conflicts are easier to find then human errors, too).
I'll do that now and let you know what happens :)

Thanks a bunch.
Ok I ended up starting out fresh and going from there. Everything works just fine. I don't know why when I did it the first time with Easy Mod it didn't work. Strange ????? Anyway, I'm going to install the update that you posted to make it work with Cal Lite. I'll let you know if I have any problems.

Thanks again for all of your help :)

Brinda
Registered User
Posts: 41
Joined: Fri Mar 02, 2007 7:54 pm
Contact:

Re: Birthdays

Post by Brinda » Tue Aug 28, 2007 12:21 am

Terra, if you don't mind I'll send you by pm memberlist.php and also usercp_viewprofile.php because I tryed with your last suggestions and they don't work.

Thanks!

;)

Brinda

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Re: Birthdays

Post by TerraFrost » Tue Aug 28, 2007 3:34 am

Brinda -

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
           $birthday = create_date('d/M/Y', gmmktime(12,0,0,$bday_month,$bday_day,$bday_year), 0);
#
#-----[ REPLACE WITH ]----------------------------------
#
           $birthday = create_date($birthday_format, gmmktime(12,0,0,$bday_month,$bday_day,$bday_year), 0);
As for memberlist.php...

Code: Select all

    if ( $username && isset($HTTP_POST_VARS['submituser']) )
    {
       $sql = "SELECT username, user_id, user_viewemail, user_posts, user_birthday, birthday_display, user_regdate, user_session_time, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar, user_rank
          FROM " . USERS_TABLE . "
          WHERE username = '$username' AND user_id <> " . ANONYMOUS . " LIMIT 1";
    }
    else
    {
       $sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar, user_rank
          FROM " . USERS_TABLE . "
          WHERE user_id <> " . ANONYMOUS . "
          ORDER BY $order_by";
    }
What MOD is that from? The second query is the one that's usually going to be called and that one doesn't include the user_birthday or the birthday_display columns.

Brinda
Registered User
Posts: 41
Joined: Fri Mar 02, 2007 7:54 pm
Contact:

Re: Birthdays

Post by Brinda » Tue Aug 28, 2007 5:57 am

At the moment I don't remember which is that MOD, sorry... (maybe I have too MODS in my forum! XD )

However, I tryed:

Code: Select all

if ( $username && isset($HTTP_POST_VARS['submituser']) )
{
	$sql = "SELECT username, user_id, user_viewemail, user_posts, user_birthday, birthday_display, user_regdate, user_session_time, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar, user_rank 
		FROM " . USERS_TABLE . "
		WHERE username = '$username' AND user_id <> " . ANONYMOUS . " LIMIT 1";
}
else
{
	$sql = "SELECT username, user_id, user_viewemail, user_posts, user_birthday, birthday_display, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar, user_rank 
		FROM " . USERS_TABLE . "
		WHERE user_id <> " . ANONYMOUS . "
		ORDER BY $order_by";
}
I added "user_birthday, birthday_display" on the second query and it works!

Thank you very much! Also the usercp_viewprofile is working! ;)

Bye!

rebell1607
Registered User
Posts: 22
Joined: Tue Aug 14, 2007 4:22 pm

Re: Birthdays

Post by rebell1607 » Wed Aug 29, 2007 7:43 pm

Hey TerraFrost! If you're not busy I have a request for you! PLEASE HELP!
You know that in viewtopic after the avatar this mod added AGE :
and in viewprofile is the date of birth.
What I want is the B-Day (date of birth) in viewtopic, not the age!
Can you help me please ? :D
THANKS!

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Re: Birthdays

Post by TerraFrost » Thu Aug 30, 2007 3:10 am

Try this:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
		$bday_month_day = floor($postrow[$i]['user_birthday'] / 10000);
		$bday_year_age = ( $postrow[$i]['birthday_display'] != BIRTHDAY_NONE && $postrow[$i]['birthday_display'] != BIRTHDAY_DATE ) ? $postrow[$i]['user_birthday'] - 10000*$bday_month_day : 0;
		$fudge = ( gmdate('md') < $bday_month_day ) ? 1 : 0;
		$age = ( $bday_year_age ) ? gmdate('Y')-$bday_year_age-$fudge : false;
#
#-----[ REPLACE WITH ]----------------------------------
#
		$birthday = '&nbsp;';
		if ( !empty($postrow[$i]['user_birthday']) && $postrow[$i]['birthday_display'] != BIRTHDAY_AGE && $postrow[$i]['birthday_display'] != BIRTHDAY_NONE )
		{
			preg_match('/(..)(..)(....)/', sprintf('%08d',$postrow[$i]['user_birthday']), $bday_parts);
			$bday_month = $bday_parts[1];
			$bday_day = $bday_parts[2];
			$bday_year = ( $postrow[$i]['birthday_display'] != BIRTHDAY_DATE ) ? $bday_parts[3] : 0;
			// the next line converts $lang['DATE_FORMAT'] to something that'll work with years, as this MOD encodes them.  the preg_replace replaces things like ', Y' with '' when the year isn't
			// specified, to account for date formats that would result in strings like 'October 31, 2005'
			$birthday_format = ($bday_year != 0) ? str_replace(array('y','Y'),array($bday_year % 100,$bday_year),$lang['DATE_FORMAT']) : preg_replace('#[^djFmMnYy]*[Yy]#','',$lang['DATE_FORMAT']);
			$birthday = create_date($birthday_format, gmmktime(12,0,0,$bday_month,$bday_day,2000), 0);
		}
#
#-----[ FIND ]------------------------------------------
#
		'POSTER_AGE' => ( $age !== false ) ? sprintf($lang['Age'], $age) : '',
#
#-----[ REPLACE WITH ]----------------------------------
#
		'POSTER_AGE' => $lang['Birthday'] . ': ' . $birthday . '<br />',

Post Reply

Return to “[2.0.x] MOD Database Releases”