Modification Name: Display Age in Posts and Profile v1.0

Modification Author: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

Modification Description:
This modification will use your birthday to calculate your age and display it in your posts and in your profile.

Supported Version: XMB 1.9.8 SP3

Updated for 1.9.8 by: WormHole @ XMB Garage

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. A copy is provided with this software package.

==============================================================================================================

=======
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:
======

        if (!$notexist) {

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

        // Display Age 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  = "<br />$lang[textage] $age";
        }
        // Display Age in Posts and Profile Mod End

======
Find:
======

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

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

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

======
Find:
======

                if ($memberinfo['site'] != 'http://') {
                    $site = $memberinfo['site'];
                } else {
                    $site = '';
                }

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

                // Display Age in Posts and Profile Mod Begin
                // create age block
                $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  = "$age";
                    eval('$ageblock = "'.template('member_profile_age').'";');
                }
                // Display Age in Posts and Profile Mod End

==============================================================================================================

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

$onlinenow

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

$age

==============================================================================================================
=======
Step 5:
=======
==============================
Go to Administration Panel -> Templates
==============================
=======================
Edit Template: member_profile
=======================
======
Find:
======

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

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

$ageblock

=======================================================================================================
=======
Step 6:
=======
==============================
Go to Administration Panel -> Templates
==============================
================================
Create New Template: member_profile_age
================================

==================
Add Code and Submit
==================

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

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