예제 #1
0
 function showInvite($page, $hidden)
 {
     if (isset($_REQUEST['invite_code'])) {
         $data['message'] = 'Incorrect invitation code.';
         $data['invite_code'] = $this->SfStr->getSafeString($_REQUEST['invite_code'], SAFE_STRING_TEXT);
     }
     $data['page'] = $page;
     if (is_array($hidden)) {
         foreach ($hidden as $key => $val) {
             $data['hiddenkey'][] = $key;
             $data['hiddenval'][] = $val;
         }
     }
     $this->smarty->assign_by_ref('data', $data);
     return $this->smarty->Fetch($this->template . '/invite_code.tpl');
 }
function smarty_load_template($atts, $content = null, $code = "")
{
    extract(shortcode_atts(array('tpl' => '#', 'name' => '', 'value' => ''), $atts));
    $tpl = "{$tpl}";
    $name = "{$name}";
    $value = "{$value}";
    global $s4w_smarty;
    if (get_option('s4w_smartybc', '0') == '1') {
        $s4w_smarty = new Smarty();
    } else {
        $s4w_smarty = new SmartyBC();
    }
    $s4w_smarty->assign_by_ref($name, $value);
    $theme_path = smarty_get_themes_path();
    if (defined('WP_USE_THEMES') && WP_USE_THEMES == true) {
        $s4w_smarty->template_dir = $theme_path . "/templates";
        $s4w_smarty->compile_dir = $theme_path . "/templates_c";
        $s4w_smarty->config_dir = $theme_path . "/config";
        $s4w_smarty->cache_dir = $theme_path . "/cache";
        //$s4w_smarty->plugins_dir[]  = $theme_path . "/plugins";
        //$s4w_smarty->trusted_dir  = $theme_path . "/trusted";
    } else {
        if (defined('SMARTY_PATH')) {
            $s4w_smarty->template_dir = SMARTY_PATH . "/templates";
            $s4w_smarty->compile_dir = SMARTY_PATH . "/templates_c";
            $s4w_smarty->config_dir = SMARTY_PATH . "/config";
            $s4w_smarty->cache_dir = SMARTY_PATH . "/cache";
            //$s4w_smarty->plugins_dir[]  = SMARTY_PATH . "/plugins";
            //$s4w_smarty->trusted_dir  = SMARTY_PATH . "/trusted";
        }
    }
    smarty_create_tempdir($s4w_smarty);
    $s4w_smarty->smartybc = get_option('s4w_smartybc', '0') == '1' ? true : false;
    $s4w_smarty->auto_literal = get_option('s4w_auto_literal', '0') == '1' ? true : false;
    $s4w_smarty->cache_lifetime = get_option('s4w_cache_lifetime');
    $s4w_smarty->cache_modified_check = get_option('s4w_cache_modified_check', '0') == '1' ? true : false;
    $s4w_smarty->config_booleanize = get_option('s4w_config_bolleanized', '0') == '1' ? true : false;
    $s4w_smarty->config_overwrite = get_option('s4w_config_overwrite', '0') == '1' ? true : false;
    $s4w_smarty->config_read_hidden = get_option('s4w_config_read_hidden', '0') == '1' ? true : false;
    $s4w_smarty->debugging = get_option('s4w_debugging', '0') == '1' ? true : false;
    $s4w_smarty->force_compile = get_option('s4w_force_compile', '0') == '1' ? true : false;
    $s4w_smarty->php_handling = get_option('s4w_php_handling', 0);
    $s4w_smarty->use_sub_dirs = get_option('s4w_use_sub_dirs', '0') == '1' ? true : false;
    $s4w_smarty->display($tpl);
}