============================================================================================================================
Modification Name: Birthday Page

Version: 3.2

Last modified: 04/21/2010

Description:
This modification will add a birthday page to your forum.
This modification will add an on/off switch in AdminPanel --> Settings.
This modification will display the members ages next to their names on the birthday page.

Compatibility: XMB 1.9.5 SP1

Authors: Darryl (BBK@Bigpond.net.au) and lee jian yuan
Code Developed By: Darryl and Lee Jian Yuan

Code contributers:
 - WormHole @ XMB Garage : Converted to 1.9
 - Chrno : Updated to 1.9.3 and recoded
 - WormHole @ XMB Garage : Fixed missing php echos and <img src> tags
 - WormHole @ XMB Garage : On/Off switch added
 - FunForum : Updated to 1.9.5; Recoded; Removed useless coding; Fixed undefined vars; Moved all language to the lang file.
 - Xian: Added age display to birthday page under the monthly listings.
 - Adam: Fixed the Daylight Saving Time variable to prevent injections.

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

Note: This is now a compilation of the two hacks by the two listed authors.
Note: Backup all affected files, templates & database tables.
============================================================================================================================
=======
Step 1:
=======

- UPLOAD BDAY.PHP TO YOUR FORUM DIRECTORY

- UPLOAD birthday.gif  and divider200.gif to all your theme images folders.

============================================================================================================================
=======
Step 2:
=======
====================================
Go To Administration Panel --> Insert Raw SQL
====================================
===========================
Paste In Code and Submit Changes:
===========================

ALTER TABLE `$table_settings` ADD `bday_status` SET('on', 'off') NOT NULL default 'on';

============================================================================================================================
=======
Step 3:
=======
==============
Edit File: cp.php
==============
==========
Find Code:
==========

        $avchecked[0] = $avchecked[1] = $avchecked[2] = false;
        if (!empty($avatarlist)) {
            $avchecked[1] = true;
        } elseif (!empty($avataroff)) {
            $avchecked[2] = true;
        } else {
            $avchecked[0] = true;
        }

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

        // Birthday Page Mod Begin
        $bday_status_on = $bday_status_off = '';
        switch ($SETTINGS['bday_status']) {
            case 'on':
                $bday_status_on = $selHTML;
                break;
            default:
                $bday_status_off = $selHTML;
                break;
        }
        // Birthday Page Mod End

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

        printsetting1($lang['reportpoststatus'], 'reportpostnew', $reportposton, $reportpostoff);

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

        // Birthday Page Mod Begin
        printsetting1($lang['bday_06'], 'bday_statusnew', $bday_status_on, $bday_status_off);
        // Birthday Page Mod End

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

        $resetSigNew = ($resetSigNew == 'on') ? 'on' : 'off';

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

        // Birthday Page Mod Begin
        $bday_statusnew = ($bday_statusnew == 'on') ? 'on' : 'off';
        // Birthday Page Mod End

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

$db->query("UPDATE $table_settings SET

==================================
Add Code To End Of Statement BEFORE  ");
==================================

, bday_status='$bday_statusnew'

============================================================================================================================
=======
Step 4:
=======
=================
Edit File: header.php
=================
==========
Find Code:
==========

// 'Forum Rules'-link
if ($SETTINGS['bbrules'] == "on") {
    $links[] = "<img src=\"$imgdir/bbrules.gif\" alt=\"$lang[altrules]\" border=\"0\" /> <a href=\"faq.php?page=forumrules\"><font class=\"navtd\">$lang[textbbrules]</font></a>";
}

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

// Birthday Page-link
if ($SETTINGS['bday_status'] == 'on' && X_MEMBER) {
    $links[] = "<img src=\"$imgdir/birthday.gif\" alt=\"$lang[bday_05]\" border=\"0\" /> <a href=\"bday.php\"><font class=\"navtd\">$lang[bday_01]</font></a>";
}

============================================================================================================================
=======
Step 5:
=======
===============
Edit File: misc.php
================
==========
Find Code:
==========

    } elseif (false !== strpos($url, "/topicadmin.php")) {
        $location = $lang['onlinetopicadmin'];

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

    // Birthday Page Mod Begin
    } elseif (false !== strpos($url, "/bday.php")) {
        $location = $lang['bday_07'];
    // Birthday Page Mod End

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

// Birthday Page Mod Begin
$lang['bday_01'] = "Birthdays";
$lang['bday_02'] = "$bbname Member Birthdays";
$lang['bday_03'] = "Happy Birthday!";
$lang['bday_04'] = "HAPPY BIRTHDAY!";
$lang['bday_05'] = "Birthday List";
$lang['bday_06'] = "Birthday List Status:";
$lang['bday_07'] = "Viewing Birthdays";
$lang['bday_08'] = "$bbname would like to say Happy Birthday to the people who are celebrating their birthday today, they are:";
$lang['bday_09'] = "There are no registered birthdays today on $bbname.<br />";
$lang['bday_10'] = "<center>This is the complete list of all $bbname members birthdays.<br />If you're not in here, remember to add your birthday info in your profile. Thank you!</center><br /><br />";
$lang['bday_11'] = "Birthday Listing";
// Birthday Page Mod End

============================================================================================================================
=======
Step 7:
=======
===============================
Go To Administration Panel --> Templates
===============================
======================
Create New Template: bday
======================
===========================
Paste In Code and Submit Changes
===========================

<table cellspacing="0" cellpadding="0" border="0" width="$tablewidth" align="center"> 
<tr>
<td bgcolor="$bordercolor">
<table border="0" cellspacing="$borderwidth" cellpadding="$tablespace" width="100%">
<tr class="tablerow"> 
<td class="mediumtxt" $catbgcode align="center">
<font color="$cattext"><strong>$lang[bday_03]</strong></font>
</td>
</tr>
<tr class="tablerow">
<td bgcolor="$altbg1" class="mediumtxt">
$lang[bday_08]
<br /><br />
<strong>$happybday</strong>
<br /><br />
<big><strong>$lang[bday_04]</strong></big>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />

============================================================================================================================
=======
Step 8:
=======
===============================
Go To Administration Panel --> Templates
===============================
=======================
Create New Template: bdayno
=======================
===========================
Paste In Code and Submit Changes
===========================

<table cellspacing="0" cellpadding="0" border="0" width="$tablewidth" align="center"> 
<tr>
<td bgcolor="$bordercolor">
<table border="0" cellspacing="$borderwidth" cellpadding="$tablespace" width="100%">
<tr class="tablerow"> 
<td class="mediumtxt" $catbgcode align="center">
<font color="$cattext"><strong>$lang[bday_03]</strong></font>
</td>
</tr>
<tr class="tablerow">
<td bgcolor="$altbg1" class="mediumtxt">$lang[bday_09]
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />

============================================================================================================================
=======
Step 9:
=======
===============================
Go To Administration Panel --> Templates
===============================
=========================
Create New Template: bdaypage
=========================
===========================
Paste In Code and Submit Changes
===========================

<table cellspacing="0" cellpadding="0" border="0" width="$tablewidth" align="center"> 
<tr>
<td bgcolor="$bordercolor"> 
<table border="0" cellspacing="$borderwidth" cellpadding="$tablespace" width="100%">
<tr> 
<td class="mediumtxt" $catbgcode align="center" colspan="2">
<font color="$cattext"><strong>$lang[bday_02]</strong></font>
</td>
</tr>
<tr> 
<td class="mediumtxt" bgcolor="$altbg1" align="center">
$lang[bday_10]
<a href="#1">$lang[textjan]</a> : <a href="#2">$lang[textfeb]</a> : <a href="#2"></a><a href="#3">$lang[textmar]</a> 
: <a href="#2"></a><a href="#4">$lang[textapr]</a> : <a href="#2"></a><a href="#5">$lang[textmay]</a> 
: <a href="#2"></a><a href="#6">$lang[textjun]</a> : <a href="#2"></a><a href="#7">$lang[textjul]</a> 
: <a href="#2"></a><a href="#8">$lang[textaug]</a> : <a href="#2"></a><a href="#9">$lang[textsep]</a> 
: <a href="#2"></a><a href="#10">$lang[textoct]</a> : <a href="#2"></a><a href="#11">$lang[textnov]</a> 
: <a href="#2"></a><a href="#12">$lang[textdec]</a>
<br />
<br />

<table width="90%" border="0" cellspacing="0" cellpadding="4" align="center" class="smalltxt">
<tr valign="top"> 
<td width="33%">
<a name="1"></a>
<strong>$lang[textjan]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_1<br />
</td>
<td width="33%"><a name="2"></a><strong>$lang[textfeb]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_2<br />
</td>
<td width="33%"><a name="3"></a><strong>$lang[textmar]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_3
<br />
</td>
</tr>
<tr valign="top"> 
<td width="33%"><a name="4"></a><strong>$lang[textapr]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_4
<br />
</td>
<td width="33%"><a name="5"></a><strong>$lang[textmay]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_5
<br />
</td>
<td width="33%"><a name="6"></a><strong>$lang[textjun]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_6
<br />
</td>
</tr>
<tr valign="top"> 
<td width="33%"><a name="7"></a><strong>$lang[textjul]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_7
<br />
</td>
<td width="33%"><a name="8"></a><strong>$lang[textaug]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_8
<br />
</td>
<td width="33%"><a name="9"></a><strong>$lang[textsep]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_9
<br />
</td>
</tr>
<tr valign="top"> 
<td width="33%"><a name="10"></a><strong>$lang[textoct]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_10
<br />
</td>
<td width="33%"><a name="11"></a><strong>$lang[textnov]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_11
<br />
</td>
<td width="33%"><a name="12"></a><strong>$lang[textdec]</strong><br />
<img src="$imgdir/divider200.gif" width="200" height="7"><br />
$list_12
<br />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="mediumtxt" $catbgcode align="right" colspan="2">
<font color="$cattext"><strong>Developed by lee jian yuan. V3.1</strong></font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />

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