function smarty_array_assign_by_reference($atts, $content = null, $code = "") { extract(shortcode_atts(array('tpl' => '#', 'name' => '', 'value' => ''), $atts)); $tpl = "{$tpl}"; $t1 = explode(",", $name); $t2 = explode(",", $value); global $s4w_smarty; if (get_option('s4w_smartybc', '0') == '1') { $s4w_smarty = new Smarty(); } else { $s4w_smarty = new SmartyBC(); } $theme_path = smarty_get_themes_path(); for ($i = 0; $i < count($t1); $i++) { /** * per ticket #79 - function call 'assign_by_ref' is unknown or deprecated * * $s4w_smarty->assign_by_ref($t1[$i],$t2[$i]); */ $s4w_smarty->assignByRef($t1[$i], $t2[$i]); } 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); }