functions.php
changeset 8 a8d108f37363
parent 6 5f35ebc4f9bb
child 9 63a257541313
equal deleted inserted replaced
7:3ba432f8390b 8:a8d108f37363
   165   global $httpd;
   165   global $httpd;
   166   static $smarty = array();
   166   static $smarty = array();
   167   if ( !isset($smarty[$theme_id]) )
   167   if ( !isset($smarty[$theme_id]) )
   168   {
   168   {
   169     $smarty[$theme_id] = new Smarty();
   169     $smarty[$theme_id] = new Smarty();
   170     $smarty[$theme_id]->template_dir = "./themes/$theme_id";
   170     $smarty[$theme_id]->template_dir = GREY_ROOT . "/themes/$theme_id";
   171     $smarty[$theme_id]->compile_dir = "./themes/$theme_id/compiled";
   171     if ( !is_dir("./compiled/$theme_id") )
   172     $smarty[$theme_id]->cache_dir = "./cache";
   172       @mkdir("./compiled/$theme_id");
       
   173     $smarty[$theme_id]->compile_dir  = "./compiled/$theme_id";
   173     $smarty[$theme_id]->config_dir = "./config";
   174     $smarty[$theme_id]->config_dir = "./config";
   174     $httpd->add_handler("themes/$theme_id", 'dir', "./themes/$theme_id");
   175     $httpd->add_handler("themes/$theme_id", 'dir', GREY_ROOT . "/themes/$theme_id");
   175   }
   176   }
   176   return $smarty[$theme_id];
   177   return $smarty[$theme_id];
   177 }
   178 }