functions.php
changeset 4 cde92f6ec29f
parent 2 860ba7141641
child 5 9b96265b5918
equal deleted inserted replaced
3:e7447a6044ec 4:cde92f6ec29f
   130   if ( strlen($minutes) < 2 )
   130   if ( strlen($minutes) < 2 )
   131     $minutes = "0$minutes";
   131     $minutes = "0$minutes";
   132   return "$minutes:$seconds";
   132   return "$minutes:$seconds";
   133 }
   133 }
   134 
   134 
       
   135 /**
       
   136  * Loads the specified theme into Smarty
       
   137  * @param string Theme ID
       
   138  * @return object Smarty object
       
   139  */
       
   140 
       
   141 function load_theme($theme_id)
       
   142 {
       
   143   global $httpd;
       
   144   static $smarty = array();
       
   145   if ( !isset($smarty[$theme_id]) )
       
   146   {
       
   147     $smarty[$theme_id] = new Smarty();
       
   148     $smarty[$theme_id]->template_dir = "./themes/$theme_id";
       
   149     $smarty[$theme_id]->compile_dir = "./themes/$theme_id/compiled";
       
   150     $smarty[$theme_id]->cache_dir = "./cache";
       
   151     $smarty[$theme_id]->config_dir = "./config";
       
   152     $httpd->add_handler("themes/$theme_id", 'dir', "./themes/$theme_id");
       
   153   }
       
   154   return $smarty[$theme_id];
       
   155 }