<?php

/************************************************************************/
/* PHP-NUKE: ShadowV1 theme for nuke 6.5                                */
/* ============================================                         */
/* Copyright (c) 2003 by ShadowGfx                                      */
/* http://www.ShadowGfx.com                                             */
/* Made for PHP-NUKE 6.0-6.5: Advanced Content Management System        */
/* ============================================                         */
/* Copyright (c) 2003 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/************************************************************************/
// ShadowV1 Public Release theme
// Original Author of file: ShadowGfx - http://www.ShadowGfx.com
// Purpose of file: Public Release phpnuke 6.0-6.5 Theme
// Copyright © 2003 by ShadowGfx All Rights Reserved
// ----------------------------------------------------------------------

/************************************************************/
/* Theme Colors Definition                                  */
/************************************************************/

$bgcolor1 = "#ffffff";
$bgcolor2 = "#ffffff";
$bgcolor3 = "#7E8B9C";
$bgcolor4 = "#4D5764";
$textcolor1 = "#000000";
$textcolor2 = "#000000";

function OpenTable() {
echo "<table text=\"#000000\" bgcolor=\"ffffff\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  <tr> 
    <td bgcolor=\"ffffff\" background=\"themes/ShadowV1/images/comm_t.gif\" height=\"32\"><img src=\"themes/ShadowV1/images/comm_tl.gif\" width=\"30\" height=\"32\" border=\"0\"></td>
    <td bgcolor=\"ffffff\" background=\"themes/ShadowV1/images/comm_t.gif\" align=\"center\" width=\"100%\" height=\"32\"><img src=\"themes/ShadowV1/images/comm_tr.gif\" width=\"100\" height=\"32\" align=\"right\"></td>
    <td bgcolor=\"ffffff\" width=\"29\"><img src=\"themes/ShadowV1/images/comm_tr2.gif\" width=\"29\" height=\"32\" border=\"0\"></td>
  </tr>
  <td bgcolor=\"ffffff\" background=\"themes/ShadowV1/images/comm_l.gif\" width=\"30\">&nbsp;</td><td background=\"themes/ShadowV1/images/comm_bg.gif\">";
}

function OpenTable2() { 
echo "<table text=\"#000000\" bgcolor=\"#ffffff\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">
    <tr> 
      <td bgcolor=\"ffffff\" width=\"30\" height=\"32\"><img src=\"themes/ShadowV1/images/comm_tl.gif\" width=\"30\" height=\"32\" border=\"0\"></td>
      <td bgcolor=\"ffffff\" background=\"themes/ShadowV1/images/comm_t.gif\" align=\"center\" width=\"100%\" height=\"32\"><img src=\"themes/ShadowV1/images/comm_tr.gif\" width=\"100\" height=\"32\" align=\"right\"></td>
      <td bgcolor=\"ffffff\"><img src=\"themes/ShadowV1/images/comm_tr2.gif\" width=\"29\" height=\"32\" border=\"0\"></td>
    </tr>
    <tr> 
      <td bgcolor=\"ffffff\" background=\"themes/ShadowV1/images/comm_l.gif\" width=\"30\"></td>
      <td background=\"themes/ShadowV1/images/comm_bg.gif\">";
}	  
	
function CloseTable() {
echo "</td>
      <td bgcolor=\"ffffff\" background=\"themes/ShadowV1/images/comm_r.gif\" width=\"29\">&nbsp;</td>
    </tr>
    <tr> 
      <td bgcolor=\"ffffff\" width=\"30\" height=\"32\"><img src=\"themes/ShadowV1/images/comm_bl.gif\" border=\"0\"></td>
      <td bgcolor=\"ffffff\" background=\"themes/ShadowV1/images/comm_b.gif\" align=\"center\" height=\"32\">&nbsp;</td>
      <td bgcolor=\"ffffff\"><img src=\"themes/ShadowV1/images/comm_br.gif\" width=\"29\" height=\"32\" border=\"0\"></td>
    </tr></td></tr>
  </table>";
}  

function CloseTable2() {
echo "</td>
  <td bgcolor=\"ffffff\" width=\"29\" background=\"themes/ShadowV1/images/comm_r.gif\">&nbsp;</td>
  </tr>
  <tr> 
    <td bgcolor=\"ffffff\" width=\"30\" height=\"32\"><img src=\"themes/ShadowV1/images/comm_bl.gif\" width=\"30\" height=\"32\" border=\"0\"></td>
    <td bgcolor=\"ffffff\" width=\"100%\" height=\"32\" align=\"center\" background=\"themes/ShadowV1/images/comm_b.gif\">&nbsp;</td>
    <td bgcolor=\"ffffff\" width=\"29\" height=\"32\"><p><img src=\"themes/ShadowV1/images/comm_br.gif\" width=\"29\" height=\"32\" border=\"0\"></p>
      </td>
  </tr></td>
</table>";
}
    
	
    
/************************************************************/
/* FormatStory                                              */
/************************************************************/

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\" color=\"#505050\">$thetext$notes</font>\n";
    } else {
        if($informant != "") {
            $boxstuff = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;uname=$informant\">$informant</a> ";
        } else {
            $boxstuff = "$anonymous ";
        }
        $boxstuff .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
        echo "<font class=\"content\" color=\"#505050\">$boxstuff</font>\n";
    }
}

/************************************************************/
/* Function themeheader()                                   */
/************************************************************/
    function themeheader() {
    global $user, $banners, $sitename, $slogan, $cookie, $prefix, $dbi;
    cookiedecode($user);
    $username = $cookie[1];
    if ($username == "") {
        $username = "Anonymous";
    }

    echo "<body text=\"#000000\" topmargin=\"0\" bottommargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">";
    if ($banners == 1) {
        include("banners.php");
    }
   
    $topics_list = "<select name=\"topic\" onChange='submit()'>\n";
    $topics_list .= "<option value=\"\">All Topics</option>\n";
    $toplist = sql_query("select topicid, topictext from $prefix"._topics." order by topictext", $dbi);
    while(list($topicid, $topics) = sql_fetch_row($toplist, $dbi)) {
    if ($topicid==$topic) { $sel = "selected "; }
        $topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
        $sel = "";
    }
    if ($username == "Anonymous") {
        $theuser = "<a href=\"modules.php?name=Your_Account\">Login/Register</a>";
    } else {
        $theuser = "Welcome $username!";
    }
    $public_msg = public_message();
    $hits = mysql_query("SELECT count FROM ".$prefix."_counter WHERE type='total' AND var='hits'");
    $hits = mysql_fetch_row($hits);
    $tmpl_file = "themes/ShadowV1/header.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    blocks(left);
    $tmpl_file = "themes/ShadowV1/left_center.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}


/************************************************************/
/* Function themefooter()                                   */
/************************************************************/

function themefooter() {
    global $index;
    if ($index == 1) {
	echo "</td><td><img src=\"themes/ShadowV1/images/pixel.gif\" width=\"15\" height=\"1\" border=\"0\" alt=\"\"></td><td valign=\"top\" width=\"150\">\n";
	blocks(right);
    }
    echo "</td></tr></table>\n";
   
    OpenTable();
    echo "<center>";
    footmsg();
    echo "</center>";
    CloseTable();
}

/************************************************************/
/* 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> $notes\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;uname=$informant\">$informant</a> ";
        } else {
            $content = "$anonymous ";
        }
        $content .= ""._WRITES." \"$thetext\"$notes\n";
    }
    //Code Changed - just show posted by
    $posted = ""._POSTEDBY." ";
    $posted .= get_author($aid);
    
    //End Code Change
    $datetime = substr($morelink, 0, strpos($morelink, "|") - strlen($morelink));
    $morelink = substr($morelink, strlen($datetime) + 2);
    $tmpl_file = "themes/ShadowV1/story_home.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;

}

/************************************************************/
/* Function themeindex()                                    */
/************************************************************/

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=\"user.php?op=userinfo&amp;uname=$informant\">$informant</a> ";
        } else {
            $content = "$anonymous ";
        }
        $content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
    }
    $tmpl_file = "themes/ShadowV1/story_page.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

/************************************************************/
/* Function themesidebox()                                  */
/************************************************************/

echo "<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">";
function themesidebox($title, $content) {
    $tmpl_file = "themes/ShadowV1/blocks.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

?>