<?php

/********************************************************/
/*  Tema KidsAndToys                                    */
/*  Theme ToysKids For CMS Maximus BS                   */
/*  Created by _-PaKi-_                                 */
/*  Phpnuke Island (http://www.phpnukeisland.com)       */
/********************************************************/
/************************************************************/
/* Theme Colors Definition                                  */
/*                                                          */
/* Define colors for your web site. $bgcolor2 is generaly   */
/* used for the tables border as you can see on OpenTable() */
/* function, $bgcolor1 is for the table background and the  */
/* other two bgcolor variables follows the same criteria.   */
/* $texcolor1 and 2 are for tables internal texts           */
/************************************************************/

global $loonr, $prefix, $db, $kokku;
$kokku = $db->sql_numrows($db->sql_query("select * from ".$prefix."_stories LIMIT 0, 30 "));


$bgcolor1 = "#2D6386";
$bgcolor2 = "#2D6386";
$bgcolor3 = "#2D6386";
$bgcolor4 = "#2D6386";
$textcolor1 = "#000000";
$textcolor2 = "#000000";

if ($loonr == "") {
    $loonr = "0";
}

/************************************************************/
/* Function themeheader()                                   */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/

function themeheader() {
    global $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $cacheblocsl, $cacheblocsr, $module_name;
    cookiedecode($user); 
    $username = $cookie[1]; 
    if ($username == "") {$username = "Anonymous";} 
    if ($username == "Anonymous") {$theuser = "&nbsp;&nbsp;<a href=\"modules.php?name=Your_Account\">"._LOGIN."</a> / <a href=\"modules.php?name=Your_Account&op=new_user\">"._CREATACC."</a>"; 
    } else {$theuser = "&nbsp;&nbsp;"._HELLO." $username!"; 
    }
	$datetime = "<script type=\"text/javascript\">\n\n" 
     ."<!--   // Array ofmonth Names\n" 
     ."var monthNames = new Array( \""._JANUARY."\",\""._FEBRUARY."\",\""._MARCH."\", 
\""._APRIL."\",\""._MAY."\",\""._JUNE."\",\""._JULY."\",\""._AUGUST."\", 
\""._SEPTEMBER."\",\""._OCTOBER."\",\""._NOVEMBER."\",\""._DECEMBER."\");\n" 
     ."var now = new Date();\n" 
     ."thisYear = now.getYear();\n" 
     ."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n" 
     ."document.write(now.getDate() + \" \" + monthNames[now.getMonth()] + \" \" + thisYear);\n" 
     ."// -->\n\n" 
     ."</script>";
    echo "<body bgcolor=\"#FFFFFF\" text=\"#000000\"  leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\"><a name='max_top'></a>";
    if ($banners == 1 AND file_exists("kernel/babanners1.php"))
	{include_once("kernel/babanners1.php");}
    $topics_list = "<select name=\"topic\" onChange='submit()'>\n";
    $topics_list .= "<option value=\"\">All Topics</option>\n";
    $toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext");
    while(list($topicid, $topics) = $db->sql_fetchrow($toplist)) {
	$topicid = intval($topicid);
    if ($topicid==$topic) { $sel = "selected "; }
	$topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
	$sel = "";
    }
    if ($username == "Anonymous") {
	$theuser = "&nbsp;&nbsp;<a href=\"modules.php?name=Your_Account\">Create an account";
    } else {
	$theuser = "&nbsp;&nbsp;Welcome $username!";
    }
	if (defined('HOME_FILE')) { 
      $fleshblockl="$cacheblocsl"; 
      $fleshblockr="$cacheblocsr"; 
   } else { 
      $resultl = $GLOBALS['db']->sql_query( "SELECT m.bid, m.title, m.bposition, b.bid, b.active FROM ".TABLE_BLOCKSMANAGER." m, ".TABLE_BLOCKS." b WHERE (m.bid = b.bid) AND (m.title = '$module_name') AND (b.active='1') AND (m.bposition='l')" ); 
      $resultl1 = $GLOBALS['db']->sql_numrows($resultl); 
      if ($resultl1 != ''){ $fleshblockl="$cacheblocsl"; } 
      $resultr = $GLOBALS['db']->sql_query( "SELECT m.bid, m.title, m.bposition, b.bid, b.active FROM ".TABLE_BLOCKSMANAGER." m, ".TABLE_BLOCKS." b WHERE (m.bid = b.bid) AND (m.title = '$module_name') AND (b.active='1') AND (m.bposition='r')" ); 
      $resultr1 = $GLOBALS['db']->sql_numrows( $resultr ); 
      if (($resultr1 != '') and ($module_name != 'News')){ $fleshblockr="$cacheblocsr"; } 
   }
   
    $public_msg = public_message();
    $tmpl_file = "themes/KidsAndToys/header.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    if ($_COOKIE['blo']['900'] == "") { blocks(left); }
	$tmpl_file = "themes/KidsAndToys/left_center.html";
	$thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

/************************************************************/
/* Function themefooter()                                   */
/*                                                          */
/* Control the footer for your site. You don't need to      */
/* close BODY and HTML tags at the end. In some part call   */
/* the function for right blocks with: blocks(right);       */
/* Also, $index variable need to be global and is used to   */
/* determine if the page your're viewing is the Homepage or */
/* and internal one.                                        */
/************************************************************/

function themefooter() {
    global $index, $foot1, $foot2, $foot3, $foot4, $banners, $module_name;
    if ($banners == 1 AND file_exists("kernel/babanners2.php"))
	{include_once("kernel/babanners2.php");}
	if (defined('HOME_FILE') or $module_name!="News") {
	$tmpl_file = "themes/KidsAndToys/center_right.html";
	$thefile = implode("", file($tmpl_file));
	$thefile = addslashes($thefile);
	$thefile = "\$r_file=\"".$thefile."\";";
	eval($thefile);
	print $r_file;
	if ($_COOKIE['blo']['901'] == "") { blocks(right); }
	}
	
	?></td></tr></table>
	<table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td>
		<table width="100%" border="0" cellspacing="0" cellpadding="4"><tr>
          	<td width="100%" height="10" bgcolor="#D0F7FB"><div align="center"><font class="footmsg">::: Optimized for PHP-Maximus - Phpnuke 7.x by <a href="http://www.phpnukeisland.com">Paki</a> :::</font><br></div></td>
        </tr><tr>
          	<td><?php
    $footer_message = "<font color=\"white\">$foot1$foot2$foot3$foot4</font";
    $tmpl_file = "themes/KidsAndToys/footer.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}




?>