<?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.3.2.3 2004/08/01 17:05:27 kirilt Exp $

/********************************************************************/
/* Theme Name: nn4_Icey (v1.2)                                      */
/* Original Developer: Ryan Gomez (http://www.kreativesource.com)   */
/* 02/08/2002                                                       */
/* Theme Modified for MPN: Paul Baldowski - http://www.boreders.com */
/* Modified for Version 4 Browsers: Kiril Threndor (mPN2 Dev Team)	*/
/********************************************************************/


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

/**
 * Background Colors
 */

	$bgcolor1 = "#ffffff";
	$bgcolor2 = "#8F9CAC";
	$bgcolor3 = "#ffffff";
	$bgcolor4 = "#8F9CAC";

/**
 * Text Colors
 */

	$textcolor1 = "#000000";
	$textcolor2 = "#000000";


/**
 * Provides Formatting For Story Content
 */

function FormatStory( $thetext, $notes, $aid, $informant )
{
    global $anonymous;

    if ( $notes != '' )
    {
		$notes = "<br /><br /><b>" . translate( 'Note' ) . ": </b><i>$notes</i>\n";
    }
    else
    {
		$notes = '';
    }

    if ( $aid == $informant )
   	{
		echo "<span class='content' color='#505050'>$thetext$notes</span>\n";
    }
    else
    {
        if( $informant != '' )
        {
        	$boxstuff = "<a href='user.php?op=userinfo&amp;uname=$informant'>$informant</a>";
        }
        else
        {
            $boxstuff = $anonymous;
        }

        $boxstuff .= " " . translate( 'writes' ) . " <i>$thetext</i>$notes\n";

        echo "<span class='content' color='#505050'>$boxstuff</span>\n";
    }
}  // 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 $sid, $query, $timezone;

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

    echo "\n\n<!-- NN4_ICEY $title INDEX ARTICLE -->\n\n";

    echo "<br />\n";

    echo "<table summary='' border='0' cellpadding='0' cellspacing='0' bgcolor='#ffffff' width='95%' align='center'><tr><td>\n";

		echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>\n";

    		echo "<td align='left' valign='top' width='26' height='30'>\n";

    		    echo "<img src='" . _T_THEME_URI . "/images/sidebox-title-left.gif' alt='' />\n";

    		echo "</td><td align='left' valign='middle' background='" . _T_THEME_URI . "/images/sidebox-title-bg.gif' width='100%' height='30'>\n";

                echo "<span class='option' color='#363636'>&nbsp;&nbsp;<b>$title</b></span>\n";

            echo "</td><td align='left' valign='top' width='6' height='30'>\n";

                echo "<img src='" . _T_THEME_URI . "/images/sidebox-title-right.gif' alt='' />\n";

    		echo "</td>\n";

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


	   	echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td>\n";

			echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>\n";

    			echo "<td align='left' valign='top' width='15' height='46'>\n";

    			    echo "<img src='" . _T_THEME_URI . "/images/storybox-left.gif' alt='' />\n";

          		echo "</td><td align='left' valign='middle' background='" . _T_THEME_URI . "/images/storybox-bg.gif' width='100%' height='46'>\n";

            		echo "<span color='#999999' size='1'>" . translate( 'Posted by' ) . "&nbsp;";

        				formatAidHeader( $aid );

        				echo "<br />" . translate( 'on' ) . "&nbsp;$time&nbsp;$timezone ($counter " . translate( 'reads' ) . ")</span>\n";

            	echo "</td><td width='6' align='left'>\n";

            	    echo "<img src='" . _T_THEME_URI . "/images/storybox-right.gif' alt='' />\n";

    	        echo "</td>\n";

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

	        echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>\n";

	       		echo "<td width='6' align='left' background='" . _T_THEME_URI . "/images/sidebox-bar-left.gif'>\n";

	       		    echo "<img src='" . _T_THEME_URI . "/images/sidebox-bar-px.gif' alt='' />\n";

	       		echo "</td><td align='left' width='100%'>\n";

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

	        			echo "<span color='#999999'>\n";

				        	echo "<b><a href='search.php?query=&amp;topic=$topic'>\n";

				        	    echo "<img class='topicimg' src='./images/topics/{$topicimage}' border='0' alt='$topictext' align='right' hspace='10' vspace='10' />\n";

				        	echo "</a></b>\n";

				        echo "</span>\n";

				    	FormatStory( $thetext, $notes, $aid, $informant );

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

				    	echo "<span color='#999999'>$morelink</span>\n";

					echo "</div>\n";

	    		echo "</td>\n";

	    		echo "<td width='6' align='left' background='" . _T_THEME_URI . "/images/storybox-content-right.gif'>\n";

	    		    echo "<img src='" . _T_THEME_URI . "/images/storybox-content-right-px.gif' alt='' />\n";

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

	        echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr valign='top'>\n";

	       		echo "<td width='9' height='29' align='left'>\n";

	       		    echo "<img src='" . _T_THEME_URI . "/images/storybox-bottom-left.gif' alt='' />\n";

	       		echo "</td><td width='100%' height='29' background='" . _T_THEME_URI . "/images/storybox-bottom-bg.gif'>&nbsp;</td>\n";

	        	echo "<td width='18' height='29' align='left' valign='top'>\n";

	        	    echo "<img src='" . _T_THEME_URI . "/images/storybox-bottom-right.gif' alt='' />\n";

	        	echo "</td>\n";

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

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

	echo "</td></tr></table>\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 $sid, $query, $counter;

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

    echo "\n\n<!-- NN4_ICEY $title ARTICLE -->\n\n";

    echo "<br />\n";

	echo "<table summary='' border='0' cellpadding='0' cellspacing='0' bgcolor='#ffffff' width='95%' align='center' valign='top'><tr><td>\n";

		echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>\n";

    		echo "<td align='left' valign='top' width='26' height='30'>\n";

    		    echo "<img src='" . _T_THEME_URI . "/images/sidebox-title-left.gif' alt='' />\n";

        	echo "</td><td align='left' valign='middle' background='" . _T_THEME_URI . "/images/sidebox-title-bg.gif' width='100%' height='30'>\n";

        		echo "<span class='option' color='#363636'><b>$title</b></span>\n";

    		echo "</td>\n";

            echo "<td align='left' valign='top' width='6' height='30'>\n";

                echo "<img src='" . _T_THEME_URI . "/images/sidebox-title-right.gif' alt='' />\n";

    		echo "</td>\n";

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

	   	echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td>\n";

			echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>\n";

				echo "<td align='left' valign='top' width='15' height='46'>\n";

				    echo "<img src='" . _T_THEME_URI . "/images/storybox-left.gif' alt='' /></td>\n";

	      		echo "<td align='left' valign='middle' background='" . _T_THEME_URI . "/images/storybox-bg.gif' width='100%' height='45'>\n";

	    			echo "<span class='content'>&nbsp;" . translate( 'Posted on' ) . "&nbsp;$datetime" . translate( 'by' ) . "&nbsp;";

					formatAidHeader( $aid );

				    if ( _MPN_ADMIN )
				    {
				        echo "<br />\n";

				        echo "[&nbsp;<a href='admin.php?op=EditStory&amp;sid=$sid'>" . translate("Edit") . "</a>&nbsp;|&nbsp;<a href='admin.php?op=RemoveStory&amp;sid=$sid'>" . translate("Delete") . "</a>&nbsp;]\n";
				    }

					echo "</span>\n";

    	   		echo "</td>\n";

	        	echo "<td width='6' align='left'>\n";

	        	    echo "<img src='" . _T_THEME_URI . "/images/storybox-right.gif' alt='' />\n";

	        	echo "</td>\n";

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

	        echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>\n";

	       		echo "<td width='6' align='left' background='" . _T_THEME_URI . "/images/sidebox-bar-left.gif'>\n";

	       		    echo "<img src='" . _T_THEME_URI . "/images/sidebox-bar-px.gif' alt='' />\n";

	       		echo "</td><td align='left' width='100%'>\n";

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

						echo "<a href='search.php?query=&amp;topic=$topic'>\n";

						    echo "<img class='topicimg' src='./images/topics/{$topicimage}' border='0' alt='$topictext' align='right' hspace='10' vspace='10' />\n";

						echo "</a>\n";

	    				FormatStory( $thetext, $notes = '', $aid, $informant );

	    			echo "</div>\n";

	    		echo "</td><td width='6' align='left' background='" . _T_THEME_URI . "/images/storybox-content-right.gif'>\n";

	    		    echo "<img src='" . _T_THEME_URI . "/images/storybox-content-right-px.gif' alt='' />\n";

	    		echo "</td>\n";

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

	        echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr valign='top'>\n";

	       		echo "<td width='9' height='10' align='left'>\n";

	       		    echo "<img src='" . _T_THEME_URI . "/images/storybox-bottom-left.gif' alt='' />\n";

	       		echo "</td><td width='100%' height='10' background='" . _T_THEME_URI . "/images/storybox-bottom-bg.gif'>&nbsp;</td>\n";

	        	echo "<td width='18' height='10' align='left' valign='top'>\n";

	        	    echo "<img src='" . _T_THEME_URI . "/images/storybox-bottom-right.gif' alt='' />\n";

	            echo "</td>\n";

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

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

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

}

/**
 * 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<!-- NN4_ICEY $title SIDE BLOCK -->\n\n";

    echo "<br />\n";

    echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='175'><tr><td>\n";

    	echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>\n";

			echo "<td align='left' valign='top' width='26' height='30'>\n";

			    echo "<img src='" . _T_THEME_URI . "/images/sidebox-title-left.gif' alt='' />\n";

        	echo "</td><td align='left' valign='middle' background='" . _T_THEME_URI . "/images/sidebox-title-bg.gif' width='100%' height='30'>\n";

        		echo "<span class='option' color='#ffffff'>&nbsp;&nbsp;<b>$title</b></span>\n";

        	echo "</td>\n";

        	echo "<td align='left' valign='top' width='6' height='30'>\n";

        	    echo "<img src='" . _T_THEME_URI . "/images/sidebox-title-right.gif' alt='' />\n";

        	echo "</td>\n";

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

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

    echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='175'><tr valign='top'>\n";

    	echo "<td width='6' align='left' background='" . _T_THEME_URI . "/images/sidebox-bar-left.gif'>\n";

    	    echo "<img src='" . _T_THEME_URI . "/images/sidebox-bar-px.gif' alt='' />\n";

    	echo "</td>\n";

    	echo "<td width='100%' align='center' valign='top' bgcolor='#ffffff'>\n";

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

 			    echo $content;

 			echo "</div>\n";

 		echo "</td>\n";

		echo "<td width='4' align='right' background='" . _T_THEME_URI . "/images/sidebox-bar-right.gif'>\n";

		    echo "<img src='" . _T_THEME_URI . "/images/sidebox-bar-px.gif' alt='' />\n";

		echo "</td>\n";

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

    echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='175'><tr>\n";

    	echo "<td align='left' valign='top' width='175' height='29'>\n";

    	    echo "<img src='" . _T_THEME_URI . "/images/sidebox-bottom.gif' alt='' />\n";

    	echo "</td>\n";

    echo "</tr></table>\n\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<!-- NN4_ICEY $title CENTER BLOCK -->\n\n";

    echo "<br />\n";

    echo "<table summary='' border='0' cellpadding='0' cellspacing='0' bgcolor='#ffffff' width='95%' align='center'><tr>\n";

		echo "<td>\n";

	        echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>\n";

	        	echo "<td align='left' valign='top' width='26' height='30'>\n";

	        	    echo "<img src='" . _T_THEME_URI . "/images/sidebox-title-left.gif' alt='' />\n";

	        	echo "</td><td align='left' valign='middle' background='" . _T_THEME_URI . "/images/sidebox-title-bg.gif' width='100%' height='30'>\n";

	        		echo "<span class='option' color='#363636'>&nbsp;&nbsp;<b>$title</b></span>\n";

	        	echo "</td><td align='left' valign='top' width='6' height='30'>\n";

	        	    echo "<img src='" . _T_THEME_URI . "/images/sidebox-title-right.gif' alt='' />\n";

	        	echo "</td>\n";

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

	        echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>\n";

	       		echo "<td width='6px' border='0' align='left' background='" . _T_THEME_URI . "/images/sidebox-bar-left.gif'>\n";

	       		    echo "<img src='" . _T_THEME_URI . "/images/sidebox-bar-px.gif' alt='' />\n";

	       		echo "</td><td width='100%' bgcolor='#ffffff' border='0' >\n";

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

	                    echo $content;

	                echo "</div>\n";

			    echo "</td>\n";

   				echo "<td align='right' width='6px' border='0' background='" . _T_THEME_URI . "/images/storybox-content-right.gif'>\n";

   				    echo "<img src='" . _T_THEME_URI . "/images/storybox-content-right-px.gif' alt='' />\n";

   				echo "</td>\n";

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

    		echo "<table summary='' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>\n";

	        	echo "<td width='9' height='29' align='left' valign='top'>\n";

	        	    echo "<img src='" . _T_THEME_URI . "/images/storybox-bottom-left.gif' alt='' />\n";

	        	echo "</td><td width='100%' height='29' background='" . _T_THEME_URI . "/images/storybox-bottom-bg.gif'>&nbsp;\n";

	        	echo "</td><td width='18' height='29' align='left' valign='top'>\n";

	        	    echo "<img src='" . _T_THEME_URI . "/images/storybox-bottom-right.gif' alt='' />\n";

	        	echo "</td>\n";

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

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

}  // End Function

?>
