Modification Name: Display Age In Posts And Profile v1.0

Modification Author: GuldantheWarlock

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.11

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:
=======
==============================================
Go To Admin Panel -> Translations & Download Language File:
==============================================
===============
Edit Language File:
===============
==========================
Add Code At Very Bottom Of File:
==========================

// Display Age In Posts And Profiles Mod Begin
$lang['textage'] = "Age:";
// Display Age In Posts And Profiles Mod End

============================================
Go To Admin Panel -> Translations & Upload Language File:
============================================
=======================================================================================================================
=======
Step 2:
=======
================
Edit viewthread.php:
================
======
Find:
======

            if ($post['location'] != '') {
                $post['location'] = censor($post['location']);
                $location = '<br />'.$lang['textlocation'].' '.$post['location'];
            } else {
                $location = '';
            }

===========
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 member.php:
==============

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

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

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

        // Display Age 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";
        }
        // 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:
===========

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

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