
##############################################################
## MOD Title: User Age in Profile (Birthday mod required)
## MOD Author: easygo < webmaster@net4seven.de > http://www.net4seven.de
## MOD Description: This hack will display the Age instead of birthday in user profiles
##
## MOD Version: 1.07
##
## Installation Level: easy
## Installation Time: 5 minutes
## Files To Edit: 2
##
## includes/usercp_viewprofile.php
## templates/subSilver/profile_view_body.tpl
##
##############################################################
## Before adding this hack to your forum, you should back up all files related to this hack
##############################################################
## MOD History:
##
## 2005-07-14 - Initial Release
## 2005-07-18 - Bugfixing
##
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
// Start add - Birthday MOD
if ($profiledata['user_birthday']!=999999)
{
$user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);
} else
{
$user_birthday = $lang['No_birthday_specify'];
}
// End add - Birthday MOD
#
#-----[ REPLACE, WITH ]------------------------------------------
#
// Start add - Birthday MOD
if ($profiledata['user_birthday']!=999999)
{
// $user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);
$user_birthdate = realdate('md', $profiledata['user_birthday']);
$this_year = create_date('Y', time(), $board_config['board_timezone']);
$this_date = create_date('md', time(), $board_config['board_timezone']);
$user_age = $this_year - realdate('Y', $profiledata['user_birthday']);
if ( $this_date < $user_birthdate )
{
$user_age--;
}
}
else
{
// $user_birthday = $lang['No_birthday_specify'];
$user_age = '';
}
// End add - Birthday MOD
#
#-----[ FIND ]------------------------------------------------
#
// Start add - Birthday MOD
'BIRTHDAY' => $user_birthday,
// End add - Birthday MOD
#
#-----[ REPLACE, WITH ]------------------------------------------
#
// Start add - Birthday MOD
// 'BIRTHDAY' => $user_birthday,
'L_AGE' => $lang['Age'],
'USER_AGE' => $user_age,
// End add - Birthday MOD
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_BIRTHDAY}:</span></td>
<td><b><span class="gen">{BIRTHDAY}</span></b></td>
</tr>
#
#-----[ REPLACE, WITH ]------------------------------------------
#
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_AGE}:</span></td>
<td><b><span class="gen">{USER_AGE}</span></b></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

#
#-----[ FIND ]------------------------------------------
#
$user_birthdate = realdate('md', $profiledata['user_birthday']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_age = $this_year - realdate('Y', $profiledata['user_birthday']);
if ( $this_date < $user_birthdate )
{
$user_age--;
} 
$user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']); $user_birthdate = realdate('md', $profiledata['user_birthday']); 
#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------------
#
// Start add - Birthday MOD
if ($profiledata['user_birthday']!=999999)
{
$user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);
} else
{
$user_birthday = $lang['No_birthday_specify'];
}
// End add - Birthday MOD
#
#-----[ REPLACE, WITH ]------------------------------------------
#
// Start add - Birthday MOD
if ($profiledata['user_birthday']!=999999)
{
// $user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);
$user_birthdate = realdate('md', $profiledata['user_birthday']);
$this_year = create_date('Y', time(), $board_config['board_timezone']);
$this_date = create_date('md', time(), $board_config['board_timezone']);
$user_age = $this_year - realdate('Y', $profiledata['user_birthday']);
if ( $this_date < $user_birthdate )
{
$user_age--;
}
}
else
{
// $user_birthday = $lang['No_birthday_specify'];
$user_age = '';
}
// End add - Birthday MOD
#
#-----[ FIND ]------------------------------------------------
#
// Start add - Birthday MOD
'BIRTHDAY' => $user_birthday,
// End add - Birthday MOD
#
#-----[ REPLACE, WITH ]------------------------------------------
#
// Start add - Birthday MOD
// 'BIRTHDAY' => $user_birthday,
'L_AGE' => $lang['Age'],
'USER_AGE' => $user_age,
// End add - Birthday MOD
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM

Return to Birthday [2.0.10/EM]
Users browsing this forum: No registered users and 1 guest