<?php

/************************************************************/
/* PHP-Nuke Theme Enhancements                              */
/* By: NukeScripts Network (webmaster@nukescripts.net)      */
/* http://www.nukescripts.net                               */
/* Copyright © 2000-2005 by NukeScripts Network             */
/************************************************************/

$bgcolor1 = "#ffffff";
$bgcolor2 = "#9cbee6";
$bgcolor3 = "#d3e2ea";
$bgcolor4 = "#0E3259";
$textcolor1 = "#000000";
$textcolor2 = "#000000";

function OpenTable() {
    global $bgcolor1, $bgcolor2;
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\"><tr><td>\n";
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"$bgcolor1\"><tr><td>\n";
}

function CloseTable() {
    echo "</td></tr></table></td></tr></table>\n";
}

function OpenTable2() {
    global $bgcolor1, $bgcolor2;
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\" align=\"center\"><tr><td>\n";
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"$bgcolor1\"><tr><td>\n";
}

function CloseTable2() {
    echo "</td></tr></table></td></tr></table>\n";
}

function FormatStory($thetext, $notes, $aid, $informant) {
    global $anonymous;
    if ($notes != "") {
	$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
    } else {
	$notes = "";
    }
    if ("$aid" == "$informant") {
	echo "<font class=\"content\">$thetext$notes</font>\n";
    } else {
	if($informant != "") {
	    $boxstuff = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
	} else {
	    $boxstuff = "$anonymous ";
	}
	$boxstuff .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
	echo "<font class=\"content\">$boxstuff</font>\n";
    }
}

/************************************************************/
/* Function themeheader()                                   */
/************************************************************/

function themeheader() {
  global $banners, $index;
  echo "<body bgcolor=\"#0E3259\" text=\"#000000\" link=\"0000ff\">";
  echo "<br>";
  if ($banners) {
    include("banners.php");
    echo "<br>";
  }
  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"840\" align=\"center\">\n";
  echo "<tr><td width=\"100%\">\n";
  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"840\">\n";
  echo "<tr><td width=\"100%\">\n";
  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"840\">\n";
  echo "<tr><td width=\"100%\" height=\"88\" bgcolor=\"#FFFFFF\">\n";
  echo "<table border=0 width=100% cellpadding=0 cellspacing=0><tr><td align=\"left\"><a href=\"index.php\"><img border=\"0\" src=\"themes/DeepBlue/images/logo.gif\" alt=\"Welcome to $sitename!\" hspace=\"20\"></a></td><td align=\"right\"><img border=\"0\" src=\"themes/DeepBlue/images/logo-graphic.gif\"></td></tr></table></td></tr>\n";
  echo "<tr><td width=\"100%\" bgcolor=\"#000000\" height=\"19\" valign=\"bottom\">\n";
  echo "<a href=\"index.php\"><img border=\"0\" src=\"themes/DeepBlue/images/home.gif\" width=\"140\" height=\"18\"></a>";
  echo "<a href=\"modules.php?name=Your_Account\"><img border=\"0\" src=\"themes/DeepBlue/images/account.gif\" width=\"140\" height=\"18\"></a>";
  echo "<a href=\"modules.php?name=Downloads\"><img border=\"0\" src=\"themes/DeepBlue/images/downloads.gif\" width=\"140\" height=\"18\"></a>";
  echo "<a href=\"modules.php?name=Submit_News\"><img border=\"0\" src=\"themes/DeepBlue/images/submit.gif\" width=\"140\" height=\"18\"></a>";
  echo "<a href=\"modules.php?name=Topics\"><img border=\"0\" src=\"themes/DeepBlue/images/topics.gif\" width=\"140\" height=\"18\"></a>";
  echo "<a href=\"modules.php?name=Top\"><img border=\"0\" src=\"themes/DeepBlue/images/top10.gif\" width=\"140\" height=\"18\"></a>";
  echo "</td></tr><tr><td width=\"100%\" height=\"10\" bgcolor=\"#d3e2ea\">\n";
  echo "</td></tr></table>\n";
  echo "</td></tr>";
  $public_msg = public_message();
  if($public_msg) {
    echo "<tr><td width=\"100%\"><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td bgcolor='#d3e2ea'>\n";
    echo "$public_msg<br>";
    echo "</td></tr></table>\n";
  }
  echo "<table width=\"840\" cellpadding=\"0\" bgcolor=\"d3e2ea\" cellspacing=\"0\" border=\"0\">\n";
  echo "<tr valign=\"top\">\n";
  if ($index == 0 OR $index == 1) {
    echo "<td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"6\" height=\"1\" border=\"0\" alt=\"\"></td>\n";
    echo "<td width=\"138\" bgcolor=\"d3e2ea\" valign=\"top\">\n";
    blocks(left);
    echo "</td>";
  }
  echo "<td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"10\" height=\"1\" border=\"0\" alt=\"\"></td>";
  echo "<td width=\"100%\">\n";
}

/************************************************************/
/* 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;
  echo "</td>";
  echo "<td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"10\" height=\"1\" border=\"0\" alt=\"\"></td>";
  if ($index == 1 OR $index == 2) {
    echo "<td valign=\"top\" width=\"138\" bgcolor=\"d3e2ea\">\n";
    blocks(right);
    echo "</td>";
    echo "<td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"6\" height=\"1\" border=\"0\" alt=\"\"></td>";
  }
  echo "</tr></table>\n";
  echo "<br><center>";
  footmsg();
  echo "</center>";
}


function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
    global $anonymous, $tipath;
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td bgcolor=\"#000000\">\n"
	."<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"#FFFFFF\">\n"
	."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td bgcolor=\"#FFFFFF\">\n"
	."<img src=\"themes/DeepBlue/images/dot.gif\" border=\"0\"></td><td width=\"100%\" bgcolor=\"#FFFFFF\"><font class=\"option\"><b>&nbsp;$title</b></font></td></tr>\n"
	."<tr><td colspan=\"2\" bgcolor=\"#FFFFFF\"><br>\n"
	."<table border=\"0\" width=\"98%\" align=\"center\"><tr><td>\n"
	."<a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$tipath$topicimage\" alt=\"$topictext\" border=\"0\" align=\"right\"></a>";
    FormatStory($thetext, $notes, $aid, $informant);
    echo "</td></tr></table>\n"
	."</td></tr></table><br>\n"
	."</td></tr><tr><td bgcolor=\"#FFFFFF\" align=\"center\">\n"
	."<font class=\"tiny\">"._POSTEDBY." ";
    formatAidHeader($aid);
    echo " "._ON." $time $timezone ($counter "._READS.")<br></font>\n"
	."<font class=\"content\">$morelink</font></center><br>\n"
	."<img src=\"themes/DeepBlue/images/pixel.gif\" border=\"0\" height=\"3\">\n"
	."</td></tr></table>\n"
	."</td></tr></table><br>\n";
}

function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
    global $admin, $sid, $tipath;
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td bgcolor=\"#000000\">\n"
	."<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"#FFFFFF\">\n"
	."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td bgcolor=\"#FFFFFF\">\n"
	."<img src=\"themes/DeepBlue/images/dot.gif\" border=\"0\"></td><td width=\"100%\" bgcolor=\"#FFFFFF\"><font class=\"option\"><b>&nbsp;$title</b></font></td></tr>\n"
	."<tr><td colspan=\"2\" bgcolor=\"#FFFFFF\"><br>\n"
	."<table border=\"0\" width=\"98%\" align=\"center\"><tr><td>\n"
	."<a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$tipath$topicimage\" alt=\"$topictext\" border=\"0\" align=\"right\"></a>";
    FormatStory($thetext, $notes="", $aid, $informant);
    echo "</td></tr></table>\n"
	."</td></tr></table><br>\n"
	."</td></tr></table>\n"
	."</td></tr></table><br><br>\n";
}

function themesidebox($title, $content) {
    echo "<table border=\"0\" align=\"center\" width=\"138\" cellpadding=\"0\" cellspacing=\"0\">"
	."<tr><td background=\"themes/DeepBlue/images/table-title.gif\" width=\"138\" height=\"20\">"
	."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#FFFFFF\"><b>$title</b></font>"
	."</td></tr><tr><td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"100%\" height=\"3\"></td></tr></table>\n"
	."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"138\">\n"
	."<tr><td width=\"138\" bgcolor=\"#000000\">\n"
	."<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"138\">\n"
	."<tr><td width=\"138\" bgcolor=\"#ffffff\">\n"
	."$content"
	."</td></tr></table></td></tr></table><br>";
}

// ADDED BY Bob Marion for NSN-Nuke theme system enhancements
function themeleftbox($title, $content) {
  echo "<table border=\"0\" align=\"center\" width=\"138\" cellpadding=\"0\" cellspacing=\"0\">";
  echo "<tr><td align=\"left\" background=\"themes/DeepBlue/images/lefttable-title.png\" width=\"138\" height=\"20\">";
  echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#FFFFFF\"><b>$title</b></font>";
  echo "</td></tr><tr><td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"100%\" height=\"3\"></td></tr></table>\n";
  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"138\">\n";
  echo "<tr><td width=\"138\" bgcolor=\"#000000\">\n";
  echo "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"138\">\n";
  echo "<tr><td width=\"138\" bgcolor=\"#ffffff\">\n";
  echo "$content";
  echo "</td></tr></table></td></tr></table><br>";
}

function themerightbox($title, $content) {
  echo "<table border=\"0\" align=\"center\" width=\"138\" cellpadding=\"0\" cellspacing=\"0\">";
  echo "<tr><td align=\"right\" background=\"themes/DeepBlue/images/righttable-title.png\" width=\"138\" height=\"20\">";
  echo "<font color=\"#FFFFFF\"><b>$title</b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  echo "</td></tr><tr><td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"100%\" height=\"3\"></td></tr></table>\n";
  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"138\">\n";
  echo "<tr><td width=\"138\" bgcolor=\"#000000\">\n";
  echo "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"138\">\n";
  echo "<tr><td width=\"138\" bgcolor=\"#ffffff\">\n";
  echo "$content";
  echo "</td></tr></table></td></tr></table><br>";
}

function thememessagebox($title, $content) {
  echo "<table border=\"0\" align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">";
  echo "<tr><td align=\"center\" background=\"themes/DeepBlue/images/messagetable-title.png\" width=\"100%\" height=\"20\">";
  echo "<font color=\"#FFFFFF\"><b>$title</b></font>";
  echo "</td></tr><tr><td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"100%\" height=\"3\"></td></tr></table>\n";
  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
  echo "<tr><td width=\"100%\" bgcolor=\"#000000\">\n";
  echo "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"100%\">\n";
  echo "<tr><td width=\"100%\" bgcolor=\"#ffffff\">\n";
  echo "$content";
  echo "</td></tr></table></td></tr></table><br>";
}

if(!function_exists(themecenterbox)) {
  function themecenterbox($title, $content) {
    echo "<table border=\"0\" align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">";
    echo "<tr><td align=\"center\" background=\"themes/DeepBlue/images/centertable-title.png\" width=\"100%\" height=\"20\">";
    echo "<font color=\"#FFFFFF\"><b>$title</b></font>";
    echo "</td></tr><tr><td><img src=\"themes/DeepBlue/images/pixel.gif\" width=\"100%\" height=\"3\"></td></tr></table>\n";
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
    echo "<tr><td width=\"100%\" bgcolor=\"#000000\">\n";
    echo "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"100%\">\n";
    echo "<tr><td width=\"100%\" bgcolor=\"#ffffff\">\n";
    echo "$content";
    echo "</td></tr></table></td></tr></table><br>";
  }
}

if(!function_exists(themepreview)) {
  function themepreview($title, $hometext, $bodytext="", $notes="") {
    global $admin, $sid, $tipath;
    $thetext = $hometext.$bodytext;
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td bgcolor=\"#000000\">\n";
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"#FFFFFF\">\n";
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td bgcolor=\"#FFFFFF\">\n";
    echo "<img src=\"themes/DeepBlue/images/dot.gif\" border=\"0\"></td><td width=\"100%\" bgcolor=\"#FFFFFF\"><font class=\"option\"><b>&nbsp;$title</b></font></td></tr>\n";
    echo "<tr><td colspan=\"2\" bgcolor=\"#FFFFFF\"><br>\n";
    echo "<table border=\"0\" width=\"98%\" align=\"center\"><tr><td>\n";
    echo "<a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$tipath$topicimage\" alt=\"$topictext\" border=\"0\" align=\"right\"></a>";
    FormatStory($thetext, $notes="", "", "");
    echo "</td></tr></table>\n";
    echo "</td></tr></table><br>\n";
    echo "</td></tr></table>\n";
    echo "</td></tr></table><br><br>\n";
  }
}

?>