<?php
// ======================================================================== //
//                                                                          //
//   KooBI- Webportalsystem                                                 //
//   2003-2005 © dream4 - http://www.dream4.de                              //
//   Removing this Info without permission breaks your License.             //
//   Please note: KooBI is no Freeware! Any Part of the Software is © by    //
//   their owner.                                                           //
//                                                                          //
//   ====================================================================   //
//                                                                          //   
//   dream4 | webservices - Am Michelsgrund 7 - 69469 Weinheim - Germany    //    
//   tel. +49(0) 6201 - 980442 / fax. +49(0) 6201 - 64809                   //
//                                                                          //
// ======================================================================== //
define ("BASE_DIR", substr(dirname(__FILE__), 0, -9));
define ("SMARTY_DIR", BASE_DIR . "class/tpl/");

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);

// zugriffsrechte
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

if(!defined("SMARTY")){
include_once SMARTY_DIR . "Smarty.class.php";
}
class Koobi extends Smarty {
	function Koobi($template_dir) {
	global $area, $lang, $langadmin;
		global $lang,$langadmin,$THEME;
		
		$this->template_dir = $template_dir;
		$this->compile_dir = BASE_DIR . "temp/$area/";
		$this->cache_dir = BASE_DIR . "temp/$area/";

		//$this->force_compile = 0;
		//$this->caching = 0;
		
		$this->assign('lang', $lang);
		$this->assign('langadmin', $langadmin);
		$this->assign('theme',$THEME);
		$this->assign('maxattachment', MAXATTACHMENT);
		$this->assign("max_post_length", MAXLENGTH_POST);
		$this->assign('get_mods', get_mods($_REQUEST['fid']));
		$this->assign('userid', UID);
		$this->assign('ugroup', UGROUP);
		$this->assign('area', ($_REQUEST['area']) ? $_REQUEST['area'] : 1);
		$this->assign('time', time());
		$this->assign('separator', SEPARATOR);
		$this->assign('regdate', REGDATE);
		
		$this->register_modifier("sslash", "stripslashes");
		
		$this->register_function('topnews','topnews');
		$this->register_function('newdownloads', 'getNewFiles');
		$this->register_function('newlinks', 'getnewlinks');
		$this->register_function('toparticles', 'toparticles');
		$this->register_function('newgals','newgals');
		$this->register_function('fetch_lastproduct','fetch_lastproduct');
		$this->register_function('checkactive', 'checkactive');
		$this->register_function('printnewsletter', 'printnewsletter');
		$this->register_function('fetchusername', 'fetchusername');
		$this->register_function('newgals','newgals');
		$this->register_function('fetch_lastproduct','fetch_lastproduct');
		$this->register_function('getdownloads', 'getdownloads');
		$this->register_function('checkactive', 'checkactive');
		$this->register_function('getaffiliates', 'getaffiliates');
		$this->register_function('printpoll', 'printpoll');
		$this->register_function('printnewsletter', 'printnewsletter');
		$this->register_function('useronline', 'useronline');
		$this->register_function('shortstats','shortstats');
		$this->register_function('stats_user','stats_user');
		$this->register_function('today_birthdays','today_birthdays');
		$this->register_function('getonlinestatus', 'getonlinestatus');
		$this->register_function('printpanel', 'printpanel');
		$this->register_function('checkactive', 'checkactive');
		$this->register_function('permission', 'permission');
		$this->register_function('lastthreads', 'getLastForumPosts');
		$this->register_function('banner', 'banner');
		$this->register_function('newpn', 'newpn');
		$this->register_function('numposts', 'numposts');
		
	}
}
?>