public function __construct() { global $config; parent::__construct(); // Look for smarty directories, since they are defined relative to jetbird root $this->template_dir = find($config['smarty']['template_dir']); $this->common_dir = find("template/common"); $this->compile_dir = find($config['smarty']['compile_dir']); $this->cache_dir = find($config['smarty']['cache_dir']); $this->config_dir = find($config['smarty']['config_dir']); if (!empty($_SESSION['template'])) { $config['smarty']['template'] = $_SESSION['template']; } if (!is_readable($this->template_dir . $config['smarty']['template'] . '/') || $config['smarty']['template'] == "rss") { $this->template = "default"; } else { $this->template = $config['smarty']['template']; } $this->template_dir .= $this->template; $this->compile_id = $this->template; // Assign some vars $this->assign("template_dir", $this->template_dir); $this->assign("common_dir", $this->common_dir); $this->assign("jquery", $this->common_dir . "/js/jquery-1.3.2.min.js"); $this->register_modifier('truncate', 'truncate'); $this->register_modifier('bbcode', 'BBCode'); $this->register_modifier('strip_bbcode', "strip_bbcode"); }