<?php

if ( ! @include_once( './mainfile.php' ) ) { exit( '!! INCLUDE ERROR. ACCESS DENIED !!' ); }
error_reporting( _E_VALUE );


/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003-2004 myPHPNuke Development Team                   |
// | Copyright (c) 2003-2004 Kiril Threndor                               |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: Kiril Threndor < mpnx@dev.illearth.net >                     |
// +----------------------------------------------------------------------+
// $Id: header.php,v 1.8.2.2 2004/04/18 12:47:21 ajvwaay Exp $

/**
 * This theme is a quick downgrade of the default MPN_189 theme for 188_8
 * This theme is designed to allow for dynamic layout and formatting switching
 *
 * This feature is DISABLED in this version.
 * Each theme using this code structure must hardcode
 * the layout and block formatting in theme.php.
 */

echo "\n\n<!-- Theme Copyright 2003 Kiril Threndor [ http://mpn.illearth.net/ ] -->\n\n";

/**
 * Link The Themes Style Sheets ( layout & formatting )
 * Style Sheets should be named same as theme
 * Style sheet names ARE case sensitive
 *
 * MPN_189 NOTES:
 *
 * Style sheet linking is NOT required in 189 themes.
 * The only thing you will need to put here is embedded style.
 * As you can see below, I choose to put it in a separate file.
 *
 * I have included ALL the "core" CSS style sheets that are currently
 * in development for MPN 189+.  While much of this code is probably
 * unecessary for this theme, it is provided as a instructional tool
 * for theme developers and as a test for how CSS loading will effect
 * page load times.  Remember, CSS files only need to be loaded once
 * as they are cached by the browser.
 */

echo include _T_THEME_PATH . '/style/mpn_FreshAir2_embed.php';

echo "</head>\n\n";

echo "<body>\n\n";

/**
 * Open Header Division
 * This wrapper division holds the page header content
 */

    echo "\n\n<!-- MPN_FRESHAIR 2 HEADER CONTENT  -->\n\n";

    echo "<div id='header'>\n\n";

        echo "<div class='logo'>\n";

            getLogo(); // Load Site Logo

        echo "</div>\n";

        echo "<div class='aid'>\n";

            welcomeUser(); // Welcome User

        echo "</div>\n";

    echo "</div>\n\n\n"; // Close Header Division

    echo "<div id='navrow1'>\n\n";

        echo "<div id='navrow'>\n\n";

            echo "<div id='info'>\n\n";

                qNav1();    // Quick Navigation Cells

            echo "</div>\n";

        echo "</div>\n";

    echo "</div>\n\n\n"; // Close Nav Division


/********************   MAIN CONTENT BODY BEGINS HERE ********************/


    echo "\n\n<!-- MPN_FRESHAIR2 MAIN BODY CONTENT  -->\n\n";

    /**
     * Define CSS Class To Use For Main Body Layout
     */

    switch ( _T_PAGE_LAYOUT )
    {
        // 3-2 Column Layout ( MPN Default )

        case 1:
            $mainbody = ( $index == 1 || $index == 2 ) ? ( 'centercol123' ) : ( 'centercol12' );
        break;

        // 2 Column Layout, Left Blocks Only

        case 2:
            $mainbody = 'centercol12';
        break;

        // 2 Column Layout, Right Blocks Only

        case 3:
            $mainbody = 'centercol13';
        break;

        // One Main Column

        case 4:
            $mainbody = 'centercol1';
        break;

        // 2 Column Layout, Left Blocks Only

        default:
            $mainbody = 'centercol12';
        break;

    } // End Switch

    /**
     * Make Left And Right Side Blocks
     * Based On Layout Choice In theme.php
     *
     * MPN_189 NOTES:
     *
     * Use of the sideblock functions has been DEPRECATED
     * in favor of a unified function structure.
     *
     * Example: buildBlocks( 0, 'side' ); will build left blocks
     */

    if ( _T_PAGE_LAYOUT == 1 || _T_PAGE_LAYOUT == 2 )
    {
        echo "<div id='leftcol'>\n\n";

            echo "<div id='blocksleft'>\n";

                // Build Left Side Blocks

                make_sidebar( 0, $storynum );

                // Build Right Side User Blocks

                if ( _T_PAGE_LAYOUT == 2 && $index == 2 )
                {
                    make_userbar( 1, $storynum );
                }

                // Build Right Side Blocks

                if ( _T_PAGE_LAYOUT == 2 )
                {
                    make_sidebar( 1, $storynum );
                }

            echo "</div>\n";

        echo "</div>\n\n\n";
    }

    if ( $index == 2 && _T_PAGE_LAYOUT != 2 )
    {
        echo "<div id='rightcol'>\n";

            echo "<div id='blocksright'>\n";

               make_userbar( 1, $storynum ); // Build User Side Blocks

               make_sidebar( 1, $storynum ); // Build Right Side Blocks

            echo "</div>\n";

        echo "</div>\n";

        /**
         * Start Center Content Division
         * Table are used here for all browsers versions < 5.
         *
         * Internet Explorer has well known CSS bugs in all their
         * browser versions that can affect centerblock display.
         *
         * If you see centerblock content dropping down to the bottom
         * of the left column then you are a victim of this bug.
         *
         * While the CSS that comes with this theme provides
         * a relatively stable "fix", it is only good for viewports
         * of approx. 800*600 and larger.
         */

        if ( defined( '_T_USE_TABLES' ) )
        {
            echo "<table id='main' summary=''><tr>\n";

                echo "<td id='centerblocks'>\n";
        }
        else
        {
            echo "<div id='$mainbody'>\n\n";
        }
    }
    else if ( $index == 1 )
    {
        $cbclasses = formatCentBlocks();

        if ( _T_PAGE_LAYOUT == 1 || _T_PAGE_LAYOUT == 3 )
        {
            echo "<div id='rightcol'>\n";

                echo "<div id='blocksright'>\n";

                    if ( _T_PAGE_LAYOUT == 3 )
                    {
                        make_sidebar( 0, $storynum ); // Build Left Side Blocks
                    }

                    make_sidebar( 1, $storynum );  // Build Right Side Blocks

                echo "</div>\n";

            echo "</div>\n";

            if ( defined( '_T_USE_TABLES' ) )
            {
                echo "<table id='main' summary=''><tr>\n";

                    echo "<td id='centerblocks'>\n";
            }
            else
            {
                echo "<div id='$mainbody'>\n\n";  // Start Center Content Division
            }
        }
        else
        {
            if ( defined( '_T_USE_TABLES' ) )
            {
                echo "<table id='main' summary=''><tr>\n";

                    echo "<td id='centerblocks'>\n";
            }
            else
            {
                echo "<div id='$mainbody'>\n\n";  // Start Center Content Division
            }
        }

        /**
         * Build Your CenterBlocks
         *
         * MPN_189 NOTES:
         *
         * This syntax has been DEPRECATED.
         *
         * Centerblocks will be control through administration
         * in the same manner as side blocks.
         * The only thing you will need to call here will be a function
         * with arguments. Example: buildBlocks( 0, "center" );
         */

        echo "<div class='cposts'>\n";

            // Recent Forum Topics Block

            if ( $mpn_display_recenttopics == 1 )
            {
                echo "<div class='$cbclasses[0]'>\n";

                    recenttopics(); // Format Using Class "recenttopicssblk"

                echo "</div>\n";
            }

            // MyMessage II CenterBlock

            include_once './mymsg2_functions.php';

            echo "<div class='$cbclasses[3]'>\n";

                display_mymsg2(); // Format Using Class "mm2"

            echo "</div>\n";

            // Recent News Block

            if ( $mpn_display_whatsnews == 1 )
            {

                echo "<div class='$cbclasses[1]'>\n";

                    recentnews(); // Format Using Class "recentnewsblk"

                echo "</div>\n";
            }

            // Center Multi Block

            if ( $actif == 1 )
            {
                echo "<div class='$cbclasses[2]'>\n";

                    cblock(); // Format Using Class "newsblk"

                echo "</div>\n";
            }

        echo "</div>\n\n\n";
    }
   else
    {
        if ( _T_PAGE_LAYOUT == 3 )
        {
            echo "<div id='rightcol'>\n";

                echo "<div id='blocksright'>\n";

                    make_sidebar( 0, $storynum );  // Build Left Side Blocks

                    make_sidebar( 1, $storynum );  // Build Right Side Blocks

                echo "</div>\n";

            echo "</div>\n";
        }

        if ( defined( '_T_USE_TABLES' ) )
        {
            echo "<table summary=''><tr>\n";

                echo "<td id='content1'>\n";
        }
        else
        {
            echo "<div id='$mainbody'>\n\n";    // Start Center Content Division
        }
    }

    echo "<div class='cindex'>\n\n";

?>
