============================================================================================================================
Modification Title: Calendar System

Version: 1.0

Author: John Briggs

Inspired By: Beta Calendar by WebNelly

Contributors: NHale623

Description:
This modification will provide a calendar system which allows events and holidays to be added with full admin controls.

Copyright:  2010 John Briggs. All Rights Reserved.

Compatability: 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 modification from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.
============================================================================================================================
=======
Step 1:
=======

Upload the following files to your "forum" path.

"install.php", "calendar.xmb", "calendar.php"

Upload the following file to your "lang" folder path.

"English.calendar.php"

============================================================================================================================
=======
Step 2:
=======

Upload the following image to your forum "images" folder path.

"birthday.gif"

Upload the following image to all of your theme folder paths.

"calendar.gif"

============================================================================================================================
=======
Step 3:
=======

Run the "install.php" file.

Example: http://www.yourdomain.com/forums/install.php

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

,'buddys','favorites','forums'

================
Replace Code With:
================

,'buddys','calendar','events','favorites','forums','holidays'

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

// Get the required language file
if (!file_exists(ROOT.'lang/'.$langfile.'.lang.php')) {
    exit('You do not have a language file present. Please upload one to proceed with use of the bulletin board.');
}
require_once(ROOT.'lang/'.$langfile.'.lang.php');

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

// Get the required calendar language file
if (file_exists(ROOT.'lang/'.$langfile.'.calendar.php')) {
    require_once(ROOT.'lang/'.$langfile.'.calendar.php');
} else {
    require_once(ROOT.'lang/English.calendar.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:
===============

// Calendar-link
if ($SETTINGS['calendar'] == 'on') {
    $links[] = '<img src="'.$imgdir.'/calendar.gif" alt="'.$lang['textcalendar'].'" title="'.$lang['textcalendar'].'" border="0" /> <a href="calendar.php"><font class="navtd">'.$lang['textcalendar'].'</font></a>';
}

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

        $notifycheck[0] = false;
        $notifycheck[1] = false;
        $notifycheck[2] = false;

        if ($SETTINGS['notifyonreg'] == "off") {
            $notifycheck[0] = true;
        } elseif ($SETTINGS['notifyonreg'] == "u2u") {
            $notifycheck[1] = true;
        } else {
            $notifycheck[2] = true;
        }

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

        // Calendar System Mod Begin
        $calendaron = $calendaroff = '';
        switch ($SETTINGS['calendar']) {
            case 'on':
                $calendaron = $selHTML;
                break;
            default:
                $calendaroff = $selHTML;
                break;
        }
        // Calendar System Mod End

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

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

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

        // Calendar System Mod Begin
        printsetting1($lang['calendarstatus'], 'calendarnew', $calendaron, $calendaroff);
        // Calendar System Mod End

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

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

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

        // Calendar System Mod Begin
        $calendarnew = ($calendarnew == 'on') ? 'on' : 'off';
        // Calendar System Mod End

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

        $db->query("UPDATE $table_settings SET

===========================================
Find Code In-line At Very End Of Above Query Statement:
===========================================

");

================
Replace Code With:
================

, calendar='$calendarnew'");

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

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

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

    // Calendar System Mod Begin
    } elseif (false !== strpos($url, '/calendar.php')) {
        $location = $lang['onlinecalendar'];
    // Calendar System Mod End

============================================================================================================================
=======
Step 7:
=======

Now upload the edited files to your forum folder path and make sure to delete "install.php" and "calendar.xmb" from the forum path.

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