Beispiel #1
0
 function load_template($template_name)
 {
     if (empty($template_name)) {
         return false;
     }
     ezphp::set_template($template_name);
     ezphp::ez_set('ez_templath_path', './template/' . $template_name . '/');
     ezphp::ez_set('ez_full_path', __SITE_PATH . '/template/' . $template_name . '/');
     // set path vars
     $this->vars['ez_template_path'] = ezphp::ez_get('ez_templath_path');
     $this->vars['ez_full_path'] = ezphp::ez_get('ez_full_path');
 }
Beispiel #2
0
define('__CACHE_TIME', $ezphp_config->get['cache']['cache_lifetime']);
// do we have to use the template in the first place ?
$use_template = $ezphp_config->get['template']['use_template'];
if (!in_array($use_template, $possible_values)) {
    exit('[template]<br /> use_template should have a value 0 or 1');
}
ezphp::ez_set('use_template', $use_template);
# get template name and path
$template_dir = $ezphp_config->get['template']['template_dir'];
if (ezphp::ez_get('use_template') == '1' && !strlen(trim($template_dir))) {
    exit('template directory needs to be specified in the config file !!');
}
define('__TEMPLATE_PATH', './template/' . $template_dir . '/');
define('__FULL_PATH', __SITE_PATH . '/template/' . $template_dir . '/');
// set the template options
ezphp::set_template($template_dir);
ezphp::ez_set('ez_templath_path', __TEMPLATE_PATH);
ezphp::ez_set('ez_full_path', __FULL_PATH);
ezphp::ez_set('ez_template_name', $template_dir);
ezphp::ez_set('ez_content_path', __SITE_PATH . '/content/');
ezphp::ez_set('ez_base_path', __SITE_PATH . '/');
# get database info
$__use_db = $ezphp_config->get['database']['use_db'];
if (!in_array($__use_db, $possible_values)) {
    exit('[security]<br /> use_db should have a value 0 or 1');
}
if ($__use_db == '1') {
    $__host = $ezphp_config->get['database']['db_hostname'];
    $__user = $ezphp_config->get['database']['db_username'];
    $__password = $ezphp_config->get['database']['db_password'];
    $__database = $ezphp_config->get['database']['db_name'];