Location: PHPKode > projects > Content*Builder > modules/article2/print_template.php
<?php
	$rel = "../../";
	include($rel."prepend.php");
	include_once($rel."libraries/BTPL_functions.inc.php");
	
	$BTPL_skinSelected = $path['defaultSkin'] ? $path['defaultSkin'] : "default/";
	$BTPL_skinModule   = $path['defaultSkin'] ? $path['defaultSkin'] : "default/";
	
	### Starting the template output ###
	$t_basedir    = "templates/";
	$t_compiledir = $rel."templates/".$BTPL_skinSelected."/compiled";

	$tpl = new Smarty;
	$tpl->template_dir = $t_basedir;
	$tpl->compile_dir  = $t_compiledir;
	$tpl->config_dir   = $t_basedir."config/";
	
	require_once($path['cb'].$cbDirLib.'CB_media.class.php');
	$myMedia  = new MediaManagement();
	$myMedia->setOptionObject($cbOption);
	$myMedia->setBranchID($cbOption->getSingleOption("rpBranch"));
	$rpBranch = $myMedia->getBranchDirectory();
	
	if(!isset($page)) $page = 0;
	if(!isset($openfolder)) {
		$article_res = mysql_query("SELECT ide, folderID FROM ".TABLE."_art_general WHERE ide = '$id'");
		$article_row = mysql_fetch_array($article_res);
		$openfolder = $article_row['folderID'];
	}
	
	if(!is_object($artOption)) {
		//Ableitung des Article Option Objektes
		$artOption = new CBOption();
		$artOption->setModule("art");
		$artOption->getOptionList();
	}
	
	$id = $_REQUEST['id'];
	$ide = $id;
	
	extract($HTTP_POST_VARS);
		
	/*
	* Ermittlung der Default Sprache ... wird leider noch als article Option gesetzt
	*/
	$dlQuery = mysql_fetch_array(mysql_query("SELECT * FROM ".TABLE."_options WHERE name = 'default_lang' AND module = 'art'"));
	$defaultLanguage = $dlQuery[value];
	
	/*
	* Wenn im Cookie ne andere Sprache steht, diese nehmen
	*/
	if(!empty($_COOKIE['main_language'])) {
		if(ereg("^[0-9]*$", $_COOKIE['main_language'])) {
			$defaultLanguage = $_COOKIE['main_language'];
		}
	}
	
	/*
	* Wenn per URL explizit eine andere Sprache angefordert wurde
	*/
	if(!empty($_REQUEST[language]) && ereg("^[0-9]*$", $_REQUEST['language'])) {
		$defaultLanguage = $_REQUEST['language'];
	}
	
	$articleQuery = mysql_query("SELECT * FROM ".TABLE."_art_general AS general LEFT JOIN ".TABLE."_art_content AS content ON general.ide = content.ide WHERE general.ide = '$id' AND content.language = '$defaultLanguage'");
	$article = mysql_fetch_object($articleQuery);
	
	extract($HTTP_POST_VARS);
	
	$intro   = stripslashes($article->intro);
	$content = stripslashes($article->content);
	$title   = $article->title;
	
	$author = mysql_fetch_object(mysql_query("SELECT * FROM ".TABLE."_user WHERE userid = '".$article->userID."'"));
	$pref   = $author->initial;
	
	/********* REPLACEMENT START **********/
	$intro	 = str_replace('[REPLACEDIR]', $path["cb"].'uploads/cgfx/icons/', $intro);
	$content = str_replace('[REPLACEDIR]', $path["cb"].'uploads/cgfx/icons/', $content);
	/********** REPLACEMENT END ***********/
	
	$intro	 = str_replace('[CBDIR]', $path["cb"], $intro);
	$content = str_replace('[CBDIR]', $path["cb"], $content);
	
	$dat      = getGermanDate($article->datum);
	$email    = $author->email;
	$fullname = $author->fullname;
	
	$tpl->assign(
		array ( "title"    => $title,
				"intro"    => $intro,
				"content"  => $content,
				"dat"      => $dat,
				"email"    => $email,
				"fullname" => $fullname,
				"pref"     => $pref
		)
	);
	$tpl->display("print_template.template");
?>
Return current item: Content*Builder