<?php

/************************************************************/
/* Theme Name: Cobalt                                       */
/* Theme Port: disgruntledtech (www.voicesinmyhead.net)     */
/* Theme ported from the phpbb2 style Cobalt by             */
/* Jakob Persson (http://www.jakob-persson.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           */
/************************************************************/

$bgcolor1 = "transparent\" background=\"themes/Cobalt/forums/images/mainbox_bg.jpg";
$bgcolor2 = "transparent\" background=\"themes/Cobalt/forums/images/cellpic4.gif";
$bgcolor3 = "transparent\" background=\"themes/Cobalt/forums/images/mainbox_bg.jpg";
$bgcolor4 = "transparent\" background=\"themes/Cobalt/forums/images/formpic.gif";
$textcolor1 = "#FFFFFF";
$textcolor2 = "#FFFFFF";

global $ShowMiddleBars, $leftstring, $rightstring;

//if you want the left or right blocks to be hidden in a module, add its foldername to the end of this string
$leftstring = "ForumsMembers_ListPrivate_MessagesWeb_Linksgallery";
$rightstring = "ForumsMembers_ListPrivate_MessagesWeb_Linksgallery";

//this setting affects the side blocks -if you like the gray bar below the block title, then set this to 1 otherwise, set it to 0
$ShowMiddleBars = "1";

include("themes/Cobalt/tables.php");

/************************************************************/
/* 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, $dbi, $leftstring, $name;
    cookiedecode($user);
    $username = $cookie[1];
    if ($username == "") {
        $username = "Anonymous";
    }
    echo "<body background=\"themes/Cobalt/images/background.gif\" bgcolor=\"#000000\" text=\"#FFFFFF\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" leftmargin=\"0\" rightmargin=\"0\">";

    if ($username == "Anonymous") {
	$theuser = "&nbsp;&nbsp;<a href=\"modules.php?name=Your_Account&op=new_user\">Create an account";
    } else {
	$theuser = "&nbsp;&nbsp;Welcome $username!";
    }
    $tmpl_file = "themes/Cobalt/header1.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    if ($banners == 1) {
	echo "&nbsp;";
	include("banners.php");
	echo "&nbsp;";
	}
    $tmpl_file = "themes/Cobalt/header2.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
		    blocks(left);
    $tmpl_file = "themes/Cobalt/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, $rightstring, $name;
    if ($index == 1) {
	$tmpl_file = "themes/Cobalt/center_right.html";
	$thefile = implode("", file($tmpl_file));
	$thefile = addslashes($thefile);
	$thefile = "\$r_file=\"".$thefile."\";";
	eval($thefile);
	print $r_file;
			blocks(right);
    }
echo"    </td>\n"
  . "  </tr>\n"
  . "  <tr>\n"
  . "  	<td width=\"0%\" class=\"mainboxLefttop\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>\n"
  . "    <td width=\"100%\" valign=\"top\" class=\"mainboxTop\" colspan=\"5\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>\n"
  . "    <td width=\"0%\" class=\"mainboxRighttop\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>\n"
  . "  </tr>\n"
  . "  <tr>\n"
  . "  	<td width=\"0%\" class=\"mainboxLeft\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>\n"
  . "    <td height=\"85\" colspan=\"5\" class=\"mainbox\">\n"
  . "		<div align=\"center\"><font class=\"small\"><br>\n";
  footmsg();
echo"  </font></div>\n"
  . "		<div align=\"center\"><font class=\"small\">:: Cobalt phpbb2 style by <a href=\"http://www.jakob-persson.com\">Jakob Persson</a> ::</font></div>\n"
  . "    </td>\n"
  . "    <td width=\"0%\" class=\"mainboxRight\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>\n"
  . "  </tr>\n"
  . "  </table>\n";
}

/************************************************************/
/* Function themeindex()                                    */
/* This function format the stories on the Homepage         */
/************************************************************/

function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
    global $anonymous, $tipath;
    if ($notes != "") {
	$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
    } else {
	$notes = "";
    }
    if ("$aid" == "$informant") {
	$content = "$thetext$notes\n";
    } else {
	if($informant != "") {
	    $content = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
	} else {
	    $content = "$anonymous ";
	}
	$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
    }
    $posted = ""._POSTEDBY." ";
    $posted .= get_author($aid);
    $posted .= " "._ON." $time $timezone ($counter "._READS.")";
    $tmpl_file = "themes/Cobalt/story_home.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

/************************************************************/
/* Function themearticle()                                  */
/* This function format the stories on the story page, when */
/* you click on that "Read More..." link in the home        */
/************************************************************/

function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
    global $admin, $sid, $tipath;
    $posted = ""._POSTEDON." $datetime "._BY." ";
    $posted .= get_author($aid);
    if ($notes != "") {
	$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
    } else {
	$notes = "";
    }
    if ("$aid" == "$informant") {
	$content = "$thetext$notes\n";
    } else {
	if($informant != "") {
	    $content = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
	} else {
	    $content = "$anonymous ";
	}
	$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
    }
    $tmpl_file = "themes/Cobalt/story_page.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

/************************************************************/
/* Function sidebox()                                       */
/************************************************************/

function themesidebox($title, $content) {
	global $bgcolor1, $bgcolor2, $ShowMiddleBars;
echo"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" width=\"170\">"
  . "<tr>"
  . "<td width=\"0%\" class=\"mainboxLefttop\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>"
  . "<td width=\"100%\" class=\"mainboxTop\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>"
  . "<td width=\"0%\" class=\"mainboxRighttop\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>		  	"
  . "</tr>"
  . "<tr>"
  . "<td width=\"0%\" class=\"mainboxLeft\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>"
  . "<th width=\"100%\">$title</th>"
  . "<td width=\"0%\" class=\"mainboxRight\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>"
  . "</tr>";
if ($ShowMiddleBars) {
echo"<tr>"
  . "<td width=\"0%\" class=\"mainboxMiddleleft\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>"
  . "<td width=\"100%\" class=\"mainboxMiddlecenter\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>"
  . "<td width=\"0%\" class=\"mainboxMiddleRight\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>		  	"
  . "</tr>";
}
echo"<tr>"
  . "<td width=\"0%\" class=\"mainboxLeft\"><img src=\"themes/Cobalt/forums/images/spacer.gif\" width=\"6\" height=\"6\"></td>"
  . "<td width=\"100%\" class=\"mainbox\"><table cellspacing=\"5\" cellpadding=\"5\" align=\"center\" width=\"90%\" border=\"0\"><tr><td colpan=\"3\">";
echo $content;
CloseTable();
}

?>