============================================================================================================================
Modification: Name: Display Age in Posts and Profile

Version: 1.0

Author: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

Description:
This modification will use your birthday to calculate your age and display it in your posts and profile.
The Birthday field must be filled in for the age to display.

Supported Version: XMB 1.9.5 SP1

Installation Note: Before adding this modification to your forum, you should back up all files related to this modification.

License Note: This modification is released under the GPL License v3. A copy is provided with this software package.

Author Note:
You downloaded this hack from XMB Garage.
Please visit http://www.xmbgarage.com/ for support.

Copyright:  2010 XMB Garage. All Rights Reserved.

============================================================================================================================
=======
Step 1:
=======
=======================
Edit File: lang/English.lang.php
=======================
========================
Add To End Of File Above  ?>
========================

// Display Age in Posts and Profile Mod Begin
$lang['textage'] = "Age:";
// Display Age in Posts and Profile Mod End

============================================================================================================================
=======
Step 2:
=======
===================
Edit File: viewthread.php
===================
==========
Find Code:
==========

        if (!$notexist) {

===============
Add Code Above:
===============

        // Age Display In Posts and Profile Mod Begin
        $age = '';
        if ($post['bday'] != '' && $post['bday'] != iso8601_date()) {
            $bday = explode('-', $post['bday']);
            
            $age = date("Y") - $bday[0];
            $month = date("n");
            $day = date("j");
            $age = (($bday[1] > $month) ? $age-1 : ((($bday[1] == $month) && ($bday[2] >= $day)) ? $age-1 : $age));
            $age = "$lang[textage] $age<br />";
        }
        // Age Display In Posts and Profile Mod End

==========
Find Code:
==========

            $location = '';
            $mood = '';

===============
Add Code Below:
===============

            // Age Display In Posts and Profile Mod Begin
            $age = '';
            // Age Display In Posts and Profile Mod End
        
============================================================================================================================
=======
Step 3:
=======
=================
Edit File: member.php
=================
==========
Find Code:
==========

            $rank['avatarrank'] = trim($rank['avatarrank']);

===============
Add Code Above:
===============

            // Age Display In Posts and Profile Mod Begin
            $age = '';
            if ($memberinfo['bday'] != '' && $memberinfo['bday'] != iso8601_date()) {
                $bday = explode('-', $memberinfo['bday']);
            
                $age = date("Y") - $bday[0];
                $month = date("n");
                $day = date("j");
                $age = (($bday[1] > $month) ? $age-1 : ((($bday[1] == $month) && ($bday[2] >= $day)) ? $age-1 : $age));
                $age = "&nbsp;$age";
                eval('$ageblock = "'.template('member_profile_age').'";');
            }
            // Age Display In Posts and Profile Mod End

============================================================================================================================
=======
Step 4:
=======
===============================
Go To Administration Panel --> Templates
===============================
========================
Edit Template: viewthread_post
========================
==========
Find Code:
==========

$onlinenow

===============
Add Code Above:
===============

$age

============================================================================================================================
=======
Step 5:
=======
===============================
Go To Administration Panel --> Templates
===============================
=======================
Edit template: member_profile
=======================
==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" class="tablerow">$lang[textbday]</td>
<td bgcolor="$altbg2" class="tablerow">$memberinfo[bday]</td>
</tr>

==========
Add Below:
==========

$ageblock

============================================================================================================================
=======
Step 6:
=======
===============================
Go To Administration Panel --> Templates
===============================
================================
Create New Template: member_profile_age
================================
========================
Add Code and Submit Changes
========================

<tr class="tablerow">
<td bgcolor="$altbg1">$lang[textage]</td>
<td bgcolor="$altbg2">$age</td>
</tr>

============================================================================================================================
Enjoy!