##############################################################
## MOD Title:          Birthdays by TerraFrost 2.0.x - User's Age ADD-ON
## MOD Author: 3Di < 3d AT phpbb2italia DOT za DOT net > (Marco) http://phpbb2italia.za.net/phpbb2/index.php
## MOD Description:    Adds a field that displays the current age of your users, just in view topic. If no date has been entered then N/A it is displayed instead in the same line.
## MOD Version:        0.2.0
##
## Installation Level: (Easy) 
## Installation Time:  5 Minutes
## Files To Edit:
##      viewtopic.php,
##      language/lang_english/lang_main.php,
## Included Files:
##      N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
##   2006-01-27 - Version 0.2.0
##      - Added the N/A bit when an user hides his own Birthday in profile
##
##   2006-01-27 - Version 0.1.0
##      - first public release
##      - tested on a fresh 2.0.19
##      - not tested on EM
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------------
#the line is longer...
$sql = "SELECT u.username, u.user_id, u.user_posts
#
#-----[ IN-LINE FIND ]----------------------------------------
#
u.user_allowsmile
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, u.user_birthday
#
#-----[ FIND ]------------------------------------------------
# the line is longer...
		$yim = ( $postrow[$i]['user_yim'] ) ?
#
#-----[ AFTER, ADD ]------------------------------------------
#
		$bday_month_day = floor($postrow[$i]['user_birthday'] / 10000);
		$bday_year = $postrow[$i]['user_birthday'] - 10000*$bday_month_day;
		$fudge = ( gmdate('md') < $bday_month_day ) ? 1 : 0;
		$age = ( $bday_year ) ? ' ('.(gmdate('Y')-$bday_year-$fudge).')' : '';
		$lang_bd = ( $bday_year ) ? $lang['bd_user'] : $lang['bd_user_none'];
#
#-----[ FIND ]------------------------------------------
#
		$yim = '';
#
#-----[ AFTER, ADD ]------------------------------------
#
		$age = '';
		$lang_bd = $lang['bd_user_none'];
#
#-----[ FIND ]------------------------------------------------
#
		'EDITED_MESSAGE' => $l_edited_by,
#
#-----[ AFTER, ADD ]------------------------------------------
#
		'POSTER_AGE' => $lang_bd . $age,
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------------
#
$lang['View_Birthdays'] = 'Happy Birthday!';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['bd_user'] = 'User\'s Age: ';
$lang['bd_user_none'] = 'User\'s Age: N/A';
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
	<!-- BEGIN postrow -->
	<tr>
#
#-----[ FIND ]------------------------------------------------
# the line is longer... 
		<td width="150"
#
#-----[ IN-LINE FIND ]------------------------------------------------
#
{postrow.POSTER_JOINED}<br />
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------
#
{postrow.POSTER_AGE}<br />
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM