Location: PHPKode > projects > Skrupel User Game Administration > include/inc_template.php
<?php
// inc_template.php
if(!defined("TPL_INC")&&(TPL_INC==true)){
        define("TPL_INC",true);
// template class
require(INSTALL_DIR."/include/template.php");
/*
	** layout stuff **
*/
function phpbb_realpath($path)
{
	global $root_path, $phpEx;

	return (!@function_exists('realpath') || !@realpath($phpbb_root_path . 'includes/functions.'.$phpEx)) ? $path : @realpath($path);
}
/*
	## function set_template($id)
	##
	## Aufruf: set_template($id);
	## Parameter:
	##				CharakterId - optional
	##				template_root - optional
	## Funktion: setzt alle relevanten Dinge fürs Template
*/
function set_template( $path, $id="", $root_path="", $server_path, $layout = "", $color = "")
{
	global $template;
	
        //path in filesys
	if ($root_path == "")
		$root_path=$_SERVER["DOCUMENT_ROOT"];

        //path in url
	if ($path == "" )
		$path="bilder/";

	$template_path = "/templates/"; //filesyspath extension

	if (is_int($id))
	{	// user stuff
		/*
		$RStemplate = new db_query;
		$RStemplate->execute("SELECT template, style FROM char_options WHERE id=".$id);
		$RStemplate->next();
		$template_name = $RStemplate->value("template");
		$template_style = $RStemplate->value("style")."css";
		*/
		$template_name = "base";
		$template_style = "standard.css";
	}
	else
	{	// fallback
		$template_name = "base";
		$template_style = "standard.css";
	}

	$template = new Template($root_path . $template_path . $template_name,$root_path . $template_path . "base" );

	/* ====================================== */
	// add filenames for template files here
	$template->set_filenames(
	        array(  'xhtmlhead' => 'xhtml_head.html',
	                'installation' => 'install.html',
	                'sugaindex' => 'index.html',
	                'sugawelcome' => 'welcome.html',
	                'statisticgames' => 'statistic_games.html',
	                'sugamenu' => 'menu.html',
	                'spielinfo' => 'spielinfo.html',
	                'waiting' => 'wartend.html',
	                'active' => 'aktiv.html',		
		        )
	);
	/* ====================================== */



        if ($color != "")
        {
        	$color = $color."_";
        }

        if($layout != "")
        {
        	$layout = $layout."/";

            
        }
        else
        {
            
        }
	// set css file
	$template->assign_vars(array(
		'css_file' => $template_style,
		'server_title' => $nicename." - ".$lang_out["generic"]["spaceisyours"],
		'template_path' => $root_path . $template_path . $template_name,
		'template_style_path' => $path . $template_path . $template_name . "/styles/",
		'path_graphic_base' => $path,
		'server_path' => $server_path,
		));
}
}
?>
Return current item: Skrupel User Game Administration