<?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: theme.php,v 1.2.2.3 2004/08/01 17:05:25 kirilt Exp $

/**
 * This Theme Is Complete Recode Of The Original Somara-Grey
 * It Uses A Mixture Of Table And CSS Based Layout
 */

/**
 * 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.gif' );

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

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

/**
 * Background Colors
 */

    $bgcolor1 = '#ffffff';
    $bgcolor2 = '#eeeeee';
    $bgcolor3 = '#ffffff';
    $bgcolor4 = '#eeeeee'; // 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 = "<span 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 .= "</span>\n";

    return $content;

} // End Function

/**
 * Function 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_SOMARA-GREY INDEX ARTICLE: $title -->\n\n";

    // Start Article Table & Header

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

        echo "<tr><th>\n";

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

                echo $title;

            echo "</div>\n";

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

                // Posted By And Submitted By

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

                if ( _MPN_ADMIN )
                {
                   echo adminEditLinks();
                }

            echo "</p>\n";

    echo "</th></tr><tr><td>\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";

        // The Article Text

        echo $thetext;

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

        // Admin Notes

        if ( $notes != '' )
        {
            echo "<br /><br />\n";

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

                echo translate( 'Notes' ) . ":\n";

            echo "</p>\n";

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

                echo "<span class='font5'>\n";

                    echo $notes;

                echo "</span>\n";

            echo "</div>\n";
        }

    echo "</td></tr><tr><td class='artinfo'>\n";

        echo "<span class='notes'>\n";

            echo $morelink;

        echo "</span>\n";

    echo "</td></tr></table>\n\n"; // Close Article Table

}  // 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_SOMARA-GREY ARTICLE: $title -->\n\n";

    echo "<table class='content1' summary=''><tr>\n";

        echo "<th>\n";

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

                echo $title;

            echo "</div>\n";

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

                // Posted By And Submitted By

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

                if ( _MPN_ADMIN )
                {
                   echo adminEditLinks();
                }

            echo "</p>\n";

        echo "</th>\n";

    echo "</tr><tr><td>\n";

        // The Article Text

        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 $thetext;

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

    echo "</td></tr></table>\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 )
{
    echo "\n\n<!-- MPN_SOMARA-GREY $title SIDE BLOCK -->\n\n";

    echo "<div class='blockbar'></div>\n";

    echo "<table class='sideblock'>\n";

        echo "<tr><th>\n";

            echo $title;

        echo "</th></tr><tr><td>\n";

            echo $content;

        echo "</td></tr>\n";

    echo "</table>\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_SOMARA-GREY $title CENTER BLOCK -->\n\n";

    echo "<table class='content1' summary=''>\n";

       echo "<tr><th>\n";

            echo $title;

        echo "</th></tr><tr><td>\n";

            echo $content;

        echo "</td></tr>\n";

    echo "</table>\n";

}  // End Function

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

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

function sg_nav()
{
    echo "<img class='middle' src='" . _T_THEME_URI . "/images/arrow.gif' alt='&#045;&#062;' />&nbsp;\n";
    echo "<a href='./'>" . translate( 'Home' ). "</a>\n";

    echo "<img class='middle' src='" . _T_THEME_URI . "/images/arrow.gif' alt='&#045;&#062;' />&nbsp;\n";
    echo "<a href='./topics.php'>" . translate( 'Topics' ). "</a>\n";

    echo "<img class='middle' src='" . _T_THEME_URI . "/images/arrow.gif' alt='&#045;&#062;' />&nbsp;\n";
    echo "<a href='./download.php'>" . translate( 'Downloads' ). "</a>\n";

    echo "<img class='middle' src='" . _T_THEME_URI . "/images/arrow.gif' alt='&#045;&#062;' />&nbsp;\n";
    echo "<a href='./user.php'>" . translate( 'Your Account' ). "</a>\n";

    echo "<img class='middle' src='" . _T_THEME_URI . "/images/arrow.gif' alt='&#045;&#062;' />&nbsp;\n";
    echo "<a href='./submit.php'>" . translate( 'Submit News' ). "</a>\n";

    echo "<img class='middle' src='" . _T_THEME_URI . "/images/arrow.gif' alt='&#045;&#062;' />&nbsp;\n";
    echo "<a href='./top.php'>" . translate( 'Top 10' ). "</a>\n";

}

?>
