<?php
define ("KOOBIDEMO",0);
define ("CNPF", "");
define ("FORUM_STATUS_OPEN", 0);
define ("FORUM_STATUS_CLOSED", 1);
define ("FORUM_STATUS_MOVED", 2);
define ("FORUM_DEFAULT_TOPIC_LIMIT", 10);
define ("FORUM_AGE_LIMIT", 10);
define ("FORUM_PERMISSION_CAN_SEE", 0);
define ("FORUM_PERMISSION_CAN_SEE_TOPIC", 1);
define ("FORUM_PERMISSION_CAN_SEE_DELETE_MESSAGE", 2);
define ("FORUM_PERMISSION_CAN_SEARCH_FORUM", 3);
define ("FORUM_PERMISSION_CAN_DOWNLOAD_ATTACHMENT", 4);
define ("FORUM_PERMISSION_CAN_CREATE_TOPIC", 5);
define ("FORUM_PERMISSION_CAN_REPLY_OWN_TOPIC", 6);
define ("FORUM_PERMISSION_CAN_REPLY_OTHER_TOPIC", 7);
define ("FORUM_PERMISSION_CAN_UPLOAD_ATTACHMENT", 8);
define ("FORUM_PERMISSION_CAN_RATE_TOPIC", 9);
define ("FORUM_PERMISSION_CAN_EDIT_OWN_POST", 10);
define ("FORUM_PERMISSION_CAN_DELETE_OWN_POST", 11);
define ("FORUM_PERMISSION_CAN_MOVE_OWN_TOPIC", 12);
define ("FORUM_PERMISSION_CAN_CLOSE_OPEN_OWN_TOPIC", 13);
define ("FORUM_PERMISSION_CAN_DELETE_OWN_TOPIC", 14);
define ("FORUM_PERMISSION_CAN_DELETE_OTHER_POST", 15);
define ("FORUM_PERMISSION_CAN_EDIT_OTHER_POST", 16);
define ("FORUM_PERMISSIONS_CAN_OPEN_TOPIC", 17);
define ("FORUM_PERMISSIONS_CAN_CLOSE_TOPIC", 18);
define ("FORUM_PERMISSIONS_CAN_CHANGE_TOPICTYPE", 19);
define ("FORUM_PERMISSIONS_CAN_MOVE_TOPIC", 20);
define ("FORUM_PERMISSIONS_CAN_DELETE_TOPIC", 21);
define ("TOPIC_TYPE_NONE", 0);
define ("TOPIC_TYPE_STICKY", 1);
define ("TOPIC_TYPE_ANNOUNCE", 100);
define ("EXPIRE_MINUTE", time() + 60);
define ("EXPIRE_HOURS",  time() + 60*60);
define ("EXPIRE_DAY",    time() + 60*60*24);
define ("EXPIRE_MONTH",  time() + 60*60*24*30);
define ("EXPIRE_YEAR",   time() + 60*60*24*30*265);
define ("MAX_EDIT_PERIOD", 672); // Zeit in Stunden, in der der ein Beitrag editiert werden kann 672 = 1 Monat
define ("KOOBI_BOARD_NEWPOSTMAXAGE", "-2 weeks");

class Koobi_Smarty extends Smarty 
{
	function Koobi_Smarty($template_dir,$theme,$area,$row_lang_settings)
	{
		$path = $_SERVER['SCRIPT_NAME'];
		$path = explode('index',$path);
		$path_theme_abs = $path[0];
		$homelink = "http://" . $_SERVER['HTTP_HOST'] . str_replace('/index.php','',$_SERVER['PHP_SELF']);
		
		if (stristr($_SERVER['HTTP_USER_AGENT'],"firefox")) $agent = "Firefox";
		elseif (stristr($_SERVER['HTTP_USER_AGENT'],"safari")) $agent = "Safari";
		elseif (stristr($_SERVER['HTTP_USER_AGENT'],"msie 7")) $agent = "IE7";
		elseif (stristr($_SERVER['HTTP_USER_AGENT'],"opera")) $agent = "Opera";
		elseif (stristr($_SERVER['HTTP_USER_AGENT'],"msie 6")) $agent = "IE6";
		else $agent = "UNKNOWN";
	
		define("AGENT", strtolower($agent));
		define("IMGPATH", "theme/{$theme}/images");
		define("START_PATH", $path_theme_abs);
		define("AREA", $_SESSION['a_area']);
		define("HOME_PATH2", $homelink);
		
		$this->compile_dir = BASE_DIR . "/compiled/{$area}";
		$this->cache_dir = BASE_DIR . "/compiled/{$area}";
		
		$this->assign('homelink', "http://" . $_SERVER['HTTP_HOST'] . str_replace('admin/index.php','',$_SERVER['PHP_SELF']));
		$this->assign('koobidemo', ((defined('KOOBIDEMO') && KOOBIDEMO==1) ? 1 : 0) );
		$this->assign('browser', $agent);
		$this->assign('browser_s', strtolower($agent));
		$this->assign('lang_settings', $row_lang_settings);
		$this->assign('startpath', $path_theme_abs);
		$this->assign('theme', $theme);
		$this->assign('area', $area);
		$this->assign('csspath', "theme/{$theme}/css");
		$this->assign('jspath', "theme/{$theme}/js");
		$this->assign('imgpath', "theme/{$theme}/images");
		$this->assign('base', BASE_DIR);
		$this->assign('incpath', BASE_DIR . "/admin/theme/{$theme}");
		$this->assign('is_pro', (VERSION=='PRO') ? 1 : 0);
		$this->assign('BetriebsOs', array('Windows 98', 'Windows 2000','Windows XP', 'Windows XP (32 bit)','Windows XP (64 bit)','Windows Vista','Windows Vista (32 bit)','Windows Vista (64 bit)','Windows CE','Windows CE/PocketPC','Windows Mobile','Windows Server 2003','Windows Server 2008','MAC OS','Mac OS X','Unix','Linux','SunOS','EPOC','Palm OS','Symbian OS','OS X'));
		$this->assign('SoftwareTyp', array('Vollversion','Schareware','Demo (15 Tage)','Demo (30 Tage)','Demo','Freeware'));
		
		
		$this->register_function('perm', 'perm');
		$this->register_function('redir', 'redir');
		
	}
}
?>