Birthday Without Year or Age

Mod that adds a birthday field to the users profile, theire age are displayed beside the posts, and on there birthday they will have a greeting popup
Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Birthday Without Year or Age

Postby talia679 on Tue 30. Apr, 2002 19:39

I don't know if you remember me ... but we talked about this on the phpBB message board ... over a month ago ... I can't find the post there anymore, but I was wondering if there was a way to have the Birthday Mod without showing the year a person was born or their age?

Thanks
Talia
talia679
Poster
Poster
 
Posts: 20
Joined: Tue 30. Apr, 2002 19:36
Location: PA

Postby Niels on Tue 30. Apr, 2002 21:10

the age in the viewtopic, is easely removed, just avoid doing the viewtopick_body.tpl

about avoiding the year in the user profile
find this in file usercp_viewprofile.php

'BIRTHDAY' => ($profiledata['user_birthday']!=999999) ? $poster_birthday=realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']) : $poster_birthday=$lang['No_birthday_specify'],

change it to something like this

'BIRTHDAY' => ($profiledata['user_birthday']!=999999) ? $poster_birthday=realdate('d-M', $profiledata['user_birthday']) : $poster_birthday=$lang['No_birthday_specify'],

if you also wan to remove the age on the birthday list on the index page then do this to page_header.php

[FIND]
$birthday_today_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $birthdayrow[$i]['user_id']) . '"' . $style_color .'><b>' . $birthdayrow[$i]['username'] . ' ('.($year- realdate ('Y',$birthdayrow[$i]['user_birthday'])).')</b></a>';

[REPLACE WITH]
$birthday_today_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $birthdayrow[$i]['user_id']) . '"' . $style_color .'><b>' . $birthdayrow[$i]['username'] . '</b></a>';

[FIND]:
$birthday_week_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $birthdayrow[$i]['user_id']) . '"' . $style_color .'><b>' . $birthdayrow[$i]['username'] . ' ('.$user_age.')</b></a>';

[REPLACE WITH]
$birthday_week_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $birthdayrow[$i]['user_id']) . '"' . $style_color .'><b>' . $birthdayrow[$i]['username'] . ' </b></a>';
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby talia679 on Wed 01. May, 2002 16:44

That worked great ... I have only one more request ... is there a way to make it so that the users don't have to put the year of their birth in at all? Some of the people here in the office want their age to be completely secret :) Some people are silly that way.

Thanks
Talia
talia679
Poster
Poster
 
Posts: 20
Joined: Tue 30. Apr, 2002 19:36
Location: PA

Postby Niels on Wed 01. May, 2002 16:54

I haven't tryed it yet, but maybe this would work

in file usercp_register.php
Code: Select all
[FIND]:
       case Y:   $year=$birthday_lengt;$date_count++;
         $birthday_lengt=$birthday_lengt+3;break;
      }
      $birthday_lengt++;
   }
   // did we find both day,month and year
   if ($date_count<3)

[REPLACE WITH]
//       case Y:   $year=$birthday_lengt;$date_count++;
//         $birthday_lengt=$birthday_lengt+3;break;
      }
      $birthday_lengt++;
   }
   // did we find both day,month and year
   if ($date_count<2)

[FIND]
      $year=$birthday[$year].$birthday[$year+1].$birthday[$year+2].$birthday[$year+3];

[REPLACE WITH
      $year=create_date('Y',time(),$board_config['board_timezone']);

[FIND]
      if ($user_age<$board_config['min_user_age']) $md=13  ;
[REPLACE WITH]
//      if ($user_age<$board_config['min_user_age']) $md=13  ;


I think what should do it
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby talia679 on Wed 01. May, 2002 17:55

And it does do it!!

Great!!

Thanks for all of your help!!

Talia
talia679
Poster
Poster
 
Posts: 20
Joined: Tue 30. Apr, 2002 19:36
Location: PA

Postby talia679 on Wed 01. May, 2002 18:00

I was wrong ... there is one more thing ... What do I change on the admin pages to make this change take effect?
talia679
Poster
Poster
 
Posts: 20
Joined: Tue 30. Apr, 2002 19:36
Location: PA

Postby Niels on Wed 01. May, 2002 18:11

I have made it so the age is only vieweble for the users, in admin panel the admin will se the year the change did take effekt

if you want to get this a way, then in file functions.php you should be able to out comment
thise 2 lines
Code: Select all
$year=$year+1970;
$date_syntax = str_replace('Y',$year,$date_syntax);


maybe you will also have to change the lang['birthday_submit_format']
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby talia679 on Thu 02. May, 2002 15:26

Here's what I mean.

If you go to the admin panel and click on Management Under Users, you have the ability to change the birthdate of the user. If I try to do this it tells me I need to put in the year.

I would like to edit the profiles of all of our staff that haven't put their birthday in ... I'd like to do it for them in the admin panel ... but I need to make the changes here that I made on the profile pages.

Does that make more sense?

Talia
talia679
Poster
Poster
 
Posts: 20
Joined: Tue 30. Apr, 2002 19:36
Location: PA

Next

Return to Birthday [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron