<?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 Default Theme                                |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 Kiril Threndor                                    |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: Kiril Threndor <mpnx@dev.illearth.net>                       |
// +----------------------------------------------------------------------+
//
// $Id: theme.php,v 1.19.2.3 2004/08/30 19:28:07 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 below.
 */

/**
 * Set Some Global Variable For Theme Files
 */

    global $actif, $storynum;

/**
 * This theme is a 188_8 revision of the MPN 189 default theme
 * The following required file is for this theme only
 * You may use it in your themems as well
 */

    require_once './theme_functions.php';

/**
 * Themes Logo File Name Constant (case sensitive).
 */

    define( '_T_THEME_LOGO' , 'mpn189.jpg' );

/**
 * Enable Theme Extended Options.
 *
 * IMPORTANT NOTE:
 *   In order for block formatting to be applied properly,
 *   ALL blocks MUST have a custom title defined when adding blocks
 */

    define( '_T_EXT_OPTIONS_', (bool)TRUE );


/**
 * Allow User Choice Of No Blocks Displayed ( Used In User Theme Layout Option Selection ).
 */

define( '_T_ALLOW_NOBLOCKS' , (bool)TRUE );

/**
 * Define Page Layout And Block Formatting Defaults ( See constant definitions for choices ).
 */

$pagelayout = 1; // Set Your Default Page Layout ( See Options Listed Below )
$blkformat = 3; // Set Your Default CSS Format Class ( See Options Listed Below )

/**
 * If Extended Options Are Enabled, Set Layout And Format To User Preference
 */

if ( _T_EXT_OPTIONS_ && ( _MPN_USER || _MPN_ADMIN ) )
{
    if ( $GLOBALS['uinf']['theme_format'] != 0 )
    {
        $blkformat = $GLOBALS['uinf']['theme_format']; // Set Block Format To Users Preference
    }

    if ( $GLOBALS['uinf']['theme_layout'] != 0 )
    {
        $pagelayout = $GLOBALS['uinf']['theme_layout']; // Set Page Layout To Users Preference
    }
}

/**
 * Theme Page Layout Options ( Set Default Above -> $pagelayout )
 *
 * Option 1: Three Column Main Body, Show Both Left And Right Blocks ( All Blocks )
 * Option 2: Two Column Main Body, Only Show Left Blocks ( Left Blocks Only )
 * Option 3: Two Column Main Body, Only Show Right Blocks ( Right Blocks Only )
 * Option 4: No Blocks At All, ALL BLOCKS ARE OFF INCLUDING MAIN MENU ( No Blocks )
 */

    define( '_T_PAGE_LAYOUT', $pagelayout );

/**
 * Theme Block Formatting ( Set Default Above -> $blkformat )
 *
 * Option 1: Format Blocks By Side (Left & Right)
 * Option 2: Format Blocks By Type
 * Option 3: Format Blocks By Block Category
 * Option 4: Format Blocks By Type, Show ONLY Custom, Login, Include A File, And Theme Options Blocks
 */

    define( '_T_BLOCK_FORMAT', $blkformat );

/**
 * Layout CSS File Name Constant (case sensitive)
 */

    define( '_T_LAYOUT_CSS', '2-3col_cssp.css' );

/**
 * Get The Appropriate Blocks To Format
 * Builds an array from the DB based on _T_BLOCK_FORMAT
 */

    define( '_T_BLOCK_ARRAY' , customBlockArray() );

/**
 * Background Colors
 */

    $bgcolor1 = '#798a99';
    $bgcolor2 = '#7a92b6';
    $bgcolor3 = '#929ba2';
    $bgcolor4 = '#929ba2'; // For Scrolling Headlines & News

/**
 * Text Colors
 */

    $textcolor1 = '#000000';
    $textcolor2 = '#000000';
    $textcolor3 = '#000000'; // For Scrolling Headlines & News

/**
 * Function Who()
 * Used to format addition story content
 *
 * MPN Scripts That Call This Function
 *
 * No calling scripts.
 * These functions are used only in the theme.php
 */

function Who( $aid, $informant, $counter, $time )
{
    global $anonymous;

    $content = '';

    $content .= "<b>" . translate( 'Posted By' ) . ":</b>&nbsp;";

    $content .= formatAidHeader( $aid );

    if ( $aid == $informant )
    {
        $informant = '';
    }
    else
    {
        if ( $informant != '' )
        {
            $content .= "<br /><b>" . translate( 'Submitted By' ) . ":</b>&nbsp;\n";
            $content .= "<a class='notes' href='./user.php&#063;uname&#061;$informant' title='$informant " . translate( 'information' ) . "'>$informant</a>\n";
        }
        else
        {
            $content .= "<br /><b>" . translate( 'Submitted By' ) . ":</b>&nbsp;<i>$anonymous</i>\n";
        }
    }

    if ( $counter != '' && $time != '' )
    {
        $content .= "<br />$time\n";

        $content .= "<br /><b>" . translate( 'Viewed' ) . " \n";

        $content .= "<em class='look'>$counter</em> " . translate( 'Times' ) . "</b>\n";
    }

    return $content;

} // End Function

/**
 * Function adminEditLinks()
 *
 * Used to display administrative
 * edit/delete links for articles
 *
 * MPN Scripts That Call This Function
 *
 * No calling scripts.
 * This function is used internally
 */

function adminEditLinks()
{
    global $sid;

    $content = "<p class='font6'>\n";

        $content .= "<br />&#091;&nbsp;";

        $content .= "<a href='admin.php&#063;op&#061;EditStory&#038;sid&#061;$sid'>" . translate( 'Edit' ) . "</a>\n";

        $content .= "&nbsp;&#124;&nbsp;\n";

        $content .= "<a href='admin.php&#063;op&#061;RemoveStory&#038;sid&#061;$sid'>" . translate( 'Delete' ) . "</a>\n";

        $content .= "&nbsp;&#093;";

    $content .= "</p>\n";

    return $content;

} // End Function

/**
 * Functions themeindex()
 * Used to format Topics/articles/news display on the main page.
 *
 * MPN Scripts That Call This Function
 *
 *   -> index.php
 *   -> categories.php
 */

function themeindex( $aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext )
{
    global $query;

    if ( ! @is_file( './images/topics/' . $topicimage ) )
    {
        $topicimage = 'myphpnuke.gif';
    }

    echo "\n\n<!-- MPN_FRESHAIR 2 INDEX ARTICLE: $title -->\n\n";

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

        echo "<div class='title1'>$title</div><br />\n";

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

            echo "<a class='right' href='./search.php&#063;query&#061;$query&#038;topic&#061;$topic'>\n";

                echo "<img class='topicart' src='./images/topics/{$topicimage}' alt='$topictext' />\n";

            echo "</a>\n";

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

                // Posted by and submitted by

                echo Who( $aid, $informant, $counter, $time );

                if ( _MPN_ADMIN )
                {
                   echo adminEditLinks();
                }

            echo "</div>\n";

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

                echo "<p class='story'>\n";

                    // The Article Text

                    echo $thetext;

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

                echo "</p>\n";

                echo "<hr class='art' />\n";

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

                    // Admin Notes

                    if ( $notes != '' )
                    {
                        echo "<span class='font5'>\n";

                            echo translate( 'Notes' ) . ":&nbsp;&nbsp;" . $notes;

                        echo "</span>\n";
                    }

                echo "<p>\n";

                    echo $morelink;

                echo "</p>\n";

            echo "</div>\n";

        echo "</div>\n";

    echo "</div>\n";

} // End Function

/**
 * Function themearticle()
 *
 * Used to display full article/story
 * This is the view that is NOT on the main page
 *
 * MPN Scripts That Call This Function
 *
 *   -> article.php
 */

function themearticle( $aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext )
{
    global $query, $counter;

    if ( ! @is_file( './images/topics/' . $topicimage ) )
    {
        $topicimage = 'myphpnuke.gif';
    }

    echo "\n\n<!-- MPN_FRESHAIR 2 ARTICLE: $title -->\n\n";

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

        echo "<div class='title1'>$title</div><br />\n";

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

            echo "<a class='right' href='./search.php&#063;query&#061;$query&#038;topic&#061;$topic'>\n";

                echo "<img class='topicart' src='./images/topics/{$topicimage}' alt='$topictext' />\n";

            echo "</a>\n";

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

                // Posted by and submitted by

                echo Who( $aid, $informant, $counter, $datetime );

                if ( _MPN_ADMIN )
                {
                    echo adminEditLinks();
                }

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

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

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

                    echo $thetext;

                    echo "<br />\n";

                echo "</div>\n";

            echo "</div>\n";

        echo "</div>\n";

    echo "</div>\n";

} // End Function

/**
 * Function themesidebox()
 *
 * Used for formatting sideblocks.
 * This is the view that is NOT on the main page
 *
 * MPN Scripts That Call This Function
 *
 *   -> article.php
 *   -> chatboxII.php
 *   -> mainfile.php
 */

function themesidebox( $title, $content )
{
    // Call layout function to determine what CSS class
    // and block layout to use for formatting

    $block_class = formatSideBlocks( $title );

    echo "\n\n<!-- MPN_FRESHAIR 2 $title SIDEBLOCK, BLOCK FORMAT " . _T_BLOCK_FORMAT . " -->\n\n";

    if ( _T_PAGE_LAYOUT != 4 )
    {
        if ( $block_class != 'hide' )
        {
            echo "<div class='blocktitles'>$title</div>\n";

            echo "<div class='$block_class'>\n";

                echo $content . "\n";

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

} // End Function

/**
 * Function themecenterposts()
 *
 * Used for formatting center blocks (Top 3 tables).
 * This is the view that is NOT on the main page
 *
 * These Blocks Include If Enabled In Preferences:
 *
 *   -> What's New
 *   -> Forum Center Block
 *   -> News Block (downloads, links, reviews, topics)
 *
 * MPN Scripts That Call This Function
 *
 *   -> index.php
 *   -> chatboxII.php
 *   -> mainfile.php
 *   -> mymsg2_functions.php
 *   -> myyp.php
 */

function themecenterposts( $title, $content )
{
    echo "\n\n<!-- MPN_FRESHAIR 2 $title CENTER BLOCK, BLOCK FORMAT " . _T_BLOCK_FORMAT . " -->\n\n";

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

        echo $title;

    echo "</div>\n";

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

        echo $content . "\n";

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

} // End Function

/**
 * CUSTOM THEME FUNCTIONS
 *
 * Custom Functions Specific To This Theme Only
 */

/**
 * Navigation Row In header.php
 */

function qNav1()
{
    global $sitename;

    // Information Variables

    $homeinfo = "<b>$sitename</b><br /><br />" . translate( 'Take me home mama!' ) . "";

    $topicinfo = translate( 'This is where you will find all the topics we have available for posting news and articles' );

    $forumsinfo = translate( 'Have questions or information you would like to pass along to the community, this is a great place to start.' );

    $accountinfo = translate( 'If your a member of this site, your can access your account settings here.  You may also use this link to login if you need to.' );

    $submitinfo = translate( 'Want to post an article into one of the topics?  This is how you do it.  All submissions are posted pending administrative approval.' );

    $top10info = translate( 'Find out what the top 10 most popular features of this site are.  This covers many of the major sections of the site like forums, sections, topics, etc...' );

    $friendinfo = "<img class='left' src='" . _T_THEME_URI . "images/smile3.gif' alt='smile' />" . translate( 'So your really impressed with this site?<br />Click here to send your friend a link.' ) . "";

    $linksinfo = translate( 'Looking for some links?  Check out our collection of links to various resources around the world.' );

    $sectionsinfo = translate( 'This is where we store all of our tutorials and reference documents.  If your looking for help or a hack, check this section out.' );


    // Links


    echo '<a class="nav" href="' . _MPN_ROOT_URI . '">' . translate( 'Home' ) . '<span>' . $homeinfo . '</span></a>' . "&nbsp;\n";
    echo '<a class="nav" href="./topics.php">' . translate( 'Topics' ) . '<span>' . $topicinfo . '</span></a>' . "&nbsp;\n";
    echo '<a class="nav" href="./forum.php">' . translate( 'Forum' ) . '<span>' . $forumsinfo . '</span></a>' . "&nbsp;\n";
    echo '<a class="nav" href="./user.php">' . translate( 'Account' ) . '<span>' . $accountinfo . '</span></a>' . "&nbsp;\n";
    echo '<a class="nav" href="./submit.php">' . translate( 'Submit' ) . '<span>' . $submitinfo . '</span></a>' . "&nbsp;\n";
    echo '<a class="nav" href="./top.php">' . translate( 'Top 10' ) . '<span>' . $top10info . '</span></a>' . "&nbsp;\n";
    echo '<a class="nav" href="./friend.php">' . translate( 'Friend' ) . '<span>' . $friendinfo . '</span></a>' . "&nbsp;\n";
    echo '<a class="nav" href="./links.php">' . translate( 'Links' ) . '<span>' . $linksinfo . '</span></a>' . "&nbsp;\n";
    echo '<a class="nav" href="./sections.php">' .translate( 'Sections' ) . '<span>' . $sectionsinfo . '</span></a>' . "&nbsp;\n";

}  // End Function

?>