- Code: Select all
#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------------
#
$user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);
#
#-----[ AFTER, ADD ]------------------------------------------------
#
$this_year = create_date('Y', time(), $board_config['board_timezone']);
$this_date = create_date('md', time(), $board_config['board_timezone']);
$user_birthdate = realdate('md', $profiledata['user_birthday']);
$user_age = $this_year - realdate ('Y',$profiledata['user_birthday']);
if ($this_date < $user_birthdate)
{
$user_age--;
}
#
#-----[ FIND ]------------------------------------------------
#
'BIRTHDAY' => $user_birthday,
#
#-----[ AFTER, ADD ]------------------------------------------------
#
'AGE' => $user_age,
'L_AGE' => $lang['Age'],
#
#-----[ OPEN ]------------------------------------------------
#
templates/{TEMPLATENAME}/profile_view_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
<tr>
<td valign="top" align="right" nowrap="nowrap" class="explaintitle"><span class="gensmall">{L_BIRTHDAY}:</span></td>
<td><b><span class="gensmall">{BIRTHDAY}</span></b></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------------
#
<tr>
<td valign="top" align="right" nowrap="nowrap" class="explaintitle"><span class="gensmall">{L_AGE}:</span></td>
<td><b><span class="gensmall">{AGE}</span></b></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
...works fine for me with 1.5.7.....

