public function __construct() { parent::__construct(); // Eredito il costruttore della superclasse require_once $this->config[0]->root_rendering . '/Smarty.class.php'; $this->time_start = $this->microtime_float(); // Il timer lo avvio qui poichè la classe viene istanziata ad ogni script. $this->smarty = new Smarty(); $path = $this->config[0]->root_rendering; $this->smarty->cache_dir = $path . '/cache'; $this->smarty->template_dir = $path . '/templates'; $this->smarty->compile_dir = $path . '/templates_c'; $this->smarty->config_dir = $path . '/configs'; $this->smarty->error_reporting = E_ALL | E_STRICT; // 0 nasconde tutti gli errori. E_ALL | E_STRICT per mostrare tutti i tipi di errore $this->smarty->allow_php_tag = true; // Serve per leggere il numero di commenti di ogni news dalla index :( $this->smarty->force_compile = false; // Permette di non recompilare ogni volta il template $this->smarty->loadFilter('output', 'trimwhitespace'); // Plugin che comprime l'HTML velocizzando la renderizzazione da parte del browser /* Per i plugin. */ $this->addValue('head', ''); $this->addValue('body', ''); $this->addValue('menu', ''); $this->addValue('postmenu', ''); $this->addValue('stats', ''); $this->addValue('footer', ''); /* Per tutto il resto :D */ $this->addValue('versione', $this->config[0]->versione); $this->addValue('nomesito', $this->config[0]->nomesito); $this->addValue('url', $this->config[0]->url); $this->addValue('url_index', $this->config[0]->url_index); $this->addValue('url_admin', $this->config[0]->url_admin); $this->addValue('url_rendering', $this->config[0]->url_rendering); $this->addValue('url_immagini', $this->config[0]->url_immagini); $this->addValue('root', $this->config[0]->root); $this->addValue('root_index', $this->config[0]->root_index); $this->addValue('root_admin', $this->config[0]->root_admin); $this->addValue('root_rendering', $this->config[0]->root_rendering); $this->addValue('root_immagini', $this->config[0]->root_immagini); $this->addValue('time', $this->microtime_float() - $this->time_start); $this->addValue('utente', parent::isLogged() ? $this->username[0]->nickname : ''); $this->addValue('grado', parent::isLogged() ? $this->username[0]->grado : ''); $this->addValue('useronline', parent::getUserOnline()); $this->addValue('visitatoronline', parent::getVisitatorOnline()); $this->addValue('totaleaccessi', parent::getTotalVisits()); $this->addValue('numQuery', $this->countQuery); $this->addValue('numCache', $this->countCache); $this->addValue('numeromp', parent::countPM()); $this->addValue('countnews', parent::countNews()); $this->addValue('countpages', parent::countPage()); $this->addValue('countusers', parent::countUser()); $user = parent::getLastUser(); $this->addValue('lastuser', $user[0]->nickname); }