function init_smarty() { global $smarty; global $cfg; if (!$smarty) { $smarty = new MySmarty(); $smarty->mySetCache(); } }