Title: Calendar System v2.0

Author: John Briggs

Inspired By: Beta Calendar by WebNelly

Contributors: NHale623

v2.0 Additions by: GuldantheWarlock (for 1.9.5) and WormHole (for 1.9.8)

Description:
This modification will provide a calendar system which allows events and holidays to be added with full admin controls.
Events List Page is a new feature added to v2.0
You can either add a link to your forum header for the Events List page. Or you can link to it from a page outside of your forum if your forum is a part of a website instead of the forum being the actual website itself.

Copyright:  2009 John Briggs. All rights reserved.

Compatability: XMB 1.9.8 SP3

Updated for 1.9.8 by: WormHole @ XMB Garage

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

License Note: This modification is released under the GPL License. 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", "eventlist.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 images to all of your theme folder paths.

"top_calendar.gif" and "top_events.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',
    'captchaimages',
    'favorites',
    'forums',

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

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

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

// Get the required language file
if (file_exists(ROOT.'lang/'.$langfile.'.lang.php')) {
    require ROOT.'lang/'.$langfile.'.lang.php';
} else {
    require ROOT.'lang/English.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.'/top_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.'/top_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] = $notifycheck[1] = $notifycheck[2] = false;
        if ($SETTINGS['notifyonreg'] == 'off') {
            $notifycheck[0] = true;
        } else if ($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:
==========

        $smileyinsertnew = formOnOff('smileyinsertnew');

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

        // Calendar System Mod Begin
        $calendarnew = formOnOff('calendarnew');
        // Calendar System Mod End

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

        $db->query("UPDATE ".X_PREFIX."settings SET

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

        $db->query("UPDATE ".X_PREFIX."settings SET
            calendar='$calendarnew',

=======================================================================================================================================
=======
Step 6:
=======
========================
Edit File: /include/online.inc.php
========================
==========
Find Code:
==========

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

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

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

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

You can either add a link to your forum header for the Events List page. Or you can link to it from a page outside of your forum if your forum is a part of a website instead of the forum
being the actual website itself.

Here's a link for your forum header navigation:

================
Edit File: header.php
================

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

// 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>';
}

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

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

=======================================================================================================================================
=======
Step 8:
=======

Now upload the edited files to your forum folder path and make sure to delete "install.php" and "calendar.xmb" from the forum path if they aren't automatically deleted by the server.

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