<?php
// Theme colors defenition
require_once("themes/$ThemeSel/style/color.php");

// Function OpenTable()
function OpenTable() {
	global  $ThemeSel, $module_name, $bgcolor1, $bgcolor2, $bgcolor3 ,$bgcolor4, $bgcolor5 ,$textcolor1 ,$textcolor2;
	$modul_name = "$module_name.html";
	if (file_exists("themes/$ThemeSel/templates/OpenTable-$modul_name") AND $module_name != "") {
		$tmpl_file = "themes/$ThemeSel/templates/OpenTable-$modul_name";
	} else {
		$tmpl_file = "themes/$ThemeSel/templates/OpenTable.html";
	}
	$thefile = implode("", file($tmpl_file));
	$thefile = addslashes($thefile);
	$thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    echo $r_file;
}

// Function CloseTable()
function CloseTable() {
	global  $ThemeSel, $module_name, $bgcolor1, $bgcolor2, $bgcolor3 ,$bgcolor4 ,$textcolor1 ,$textcolor2;
	$modul_name = "$module_name.html";
	if (file_exists("themes/$ThemeSel/templates/CloseTable-$modul_name") AND $module_name != "") {
		$tmpl_file = "themes/$ThemeSel/templates/CloseTable-$modul_name";
	} else {
		$tmpl_file = "themes/$ThemeSel/templates/CloseTable.html";
	}
	$thefile = implode("", file($tmpl_file));
	$thefile = addslashes($thefile);
	$thefile = "\$r_file=\"".$thefile."\";";
	eval($thefile);
	echo $r_file;
}

// Function title()
function title($text) {
	global  $ThemeSel, $bgcolor1, $bgcolor2, $bgcolor3 ,$bgcolor4 ,$textcolor1 ,$textcolor2;
    $tmpl_file = "themes/$ThemeSel/templates/title.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    echo $r_file;
}

// Function messagebox()
function messagebox($title, $content) {
	global  $ThemeSel, $bgcolor1, $bgcolor2, $bgcolor3 ,$bgcolor4 ,$textcolor1 ,$textcolor2;
    $tmpl_file = "themes/$ThemeSel/templates/message-box.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    echo $r_file;
}

// Function themeheader()
function themeheader() {
	global  $ThemeSel, $user, $sitename, $slogan, $keywords, $cookie, $prefix, $db, $homeurl, $anonymous, $name, $module_name, $showbanners, $blocks, $bgcolor1, $bgcolor2, $bgcolor3 ,$bgcolor4 ,$textcolor1 ,$textcolor2;
	
	// Hello function
	if (is_user($user)) {
		$username = $cookie[1];
		$theuser = "<img src=\"themes/$ThemeSel/images/green_dot.gif\" width=\"10\" height=\"10\"> "._HELLO.", $username!";
    } else {
		$theuser = "<img src=\"themes/$ThemeSel/images/red_dot.gif\" width=\"10\" height=\"10\"> <a href=\"index.php?name=Your_Account\">"._BREG."";
    }

	// Startsite function
	$startseite = "<a href=\"#\" onClick=\"this.style.behavior='url(#default#homepage)'; this.setHomePage('$homeurl');\" title=\"$s_startseite\">";

	// Variablen defenition
	$s_home = ""._HOME."";
	$s_profil = ""._S_PROFIL."";
	$s_favoriten = ""._S_FAVORITEN."";
	$s_startseite = ""._S_STARTSEITE."";
	$s_feed = ""._FEEDBACK."";
	$s_recomm = ""._RECOMMEND."";
	
	$public_msg = public_message();
    $tmpl_file = "themes/$ThemeSel/templates/header.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    echo $r_file;
	if ($blocks == "" OR $blocks == "0" OR $blocks == "1") {
		blocks('left');
		echo "</td><td class=\"leftblock\">";
	}
}

// Function themeindex()
function themeindex ($aid, $informant, $time, $title, $counter, $topic, $hometext, $notes, $morelink, $topicname, $topicimage, $topictext) {
	global $ThemeSel, $anonymous, $tipath, $bgcolor1, $bgcolor2, $bgcolor3 ,$bgcolor4 ,$textcolor1 ,$textcolor2;
	$content = $hometext;
	$tmpl_file = "themes/$ThemeSel/templates/theme-index.html";
	$thefile = implode("", file($tmpl_file));
	$thefile = addslashes($thefile);
	$thefile = "\$r_file=\"".$thefile."\";";
	eval($thefile);
	echo $r_file;
}

// Function themearticle()
function themearticle ($aid, $informant, $datetime, $title, $bodytext, $topic, $topicname, $topicimage, $topictext) {
    global $ThemeSel, $anonymous, $tipath, $bgcolor1, $bgcolor2, $bgcolor3 ,$bgcolor4 ,$textcolor1 ,$textcolor2;
	if ($aid == $informant) {
		$posted = ""._POSTEDBY.": <a href=\"index.php?name=Your_Account&op=userinfo&username=$aid\">$aid</a> | "._DATE.": $datetime";
	} elseif ($informant != "" ) {
		$posted = ""._POSTEDBY.": <a href=\"index.php?name=Your_Account&op=userinfo&username=$informant\">$informant</a> | "._DATE.": $datetime";
	} else {
		$posted = ""._POSTEDBY.": $anonymous | "._DATE.": $datetime";
	}
	$content = $bodytext;
	$tmpl_file = "themes/$ThemeSel/templates/theme-article.html";
	$thefile = implode("", file($tmpl_file));
	$thefile = addslashes($thefile);
	$thefile = "\$r_file=\"".$thefile."\";";
	eval($thefile);
	echo $r_file;
}

// Function themesidebox()
function themesidebox($title, $content) {
	global  $ThemeSel, $pos, $blockfile, $bgcolor1, $bgcolor2, $bgcolor3 ,$bgcolor4 ,$textcolor1 ,$textcolor2;
	$block_name = str_replace(".php", ".html", $blockfile);
	if (file_exists("themes/$ThemeSel/templates/$block_name") AND $block_name != "") {
		$tmpl_file = "themes/$ThemeSel/templates/$block_name";
	} else {
		if ($pos == "l") {
			$tmpl_file = "themes/$ThemeSel/templates/block-left.html";
		} elseif ($pos == "r") {
			$tmpl_file = "themes/$ThemeSel/templates/block-right.html";
		} elseif ($pos == "c") {
			$tmpl_file = "themes/$ThemeSel/templates/block-center.html";
		} elseif ($pos == "d") {
			$tmpl_file = "themes/$ThemeSel/templates/block-down.html";
		} else {
			$tmpl_file = "themes/$ThemeSel/templates/block-all.html";
		}
	}
	$thefile = implode("", file($tmpl_file));
	$thefile = addslashes($thefile);
	$thefile = "\$r_file=\"".$thefile."\";";
	eval($thefile);
	echo $r_file;
}

// Function themefooter()
function themefooter() {
    global $ThemeSel, $blocks, $bgcolor1, $bgcolor2, $bgcolor3 ,$bgcolor4 ,$textcolor1 ,$textcolor2;
	if ($blocks == "" OR $blocks == "0" OR $blocks == "2") {
		echo "</td><td class=\"rightblock\">";
		blocks('right');
	}

	// Variablen defenition
	$s_home = ""._HOME."";
	$s_news = ""._NEWS."";
	$s_forum = ""._FORUM."";
	$s_startseite = ""._S_STARTSEITE."";
	$s_topic = ""._TOPICS."";
	$s_album = ""._ALBUM."";
	$s_faq = ""._FAQ."";
	$s_pages = ""._PAGES."";
	$s_feed = ""._FEEDBACK."";
	$s_recomm = ""._RECOMMEND."";
	
	$tmpl_file = "themes/$ThemeSel/templates/footer.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    echo $r_file;
	footmsg();
}
?>