function weaveriip_sc_shortcode($args = '') { extract(shortcode_atts(array('id' => '', 'v1' => '', 'v2' => '', 'v3' => '', 'v4' => '', 'v5' => '', 'v6' => '', 'v7' => '', 'v8' => '', 'v9' => '', 'php' => ''), $args)); $text = "[*** ERROR: weaveriip_sc undefined id: '{$id}' *** ]"; $out = ''; // no php yet if ($php != '') { if (function_exists('weaveriip_php_do_eval')) { $out = weaveriip_php_do_eval($php); } else { $out = '[**** ERROR: weaveriip_sc: php not allowed ****]'; } } for ($i = 1; $i <= weaverii_pro_getopt('wvpsc_num_opts'); $i++) { // look for our id $base = 'wvpsc_' . $i . '_'; $cur_id = weaverii_pro_getopt($base . 'id'); if ($cur_id == $id) { $text = weaverii_pro_getopt($base . 'text'); break; } } for ($i = 1; $i <= 9; $i++) { // process parameters $name = 'v' . $i; if (${$name} != '') { $text = str_replace("%{$name}%", ${$name}, $text); // replace params } } if ($out != '') { $text = str_replace('%php%', $out, $text); } return do_shortcode($text); }
function weaveriip_php_shortcode($args = '', $code) { return weaveriip_php_do_eval($code); }