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);
}
weaveriip_add_shortcode('weaver_sc', 'weaveriip_sc_shortcode');
                if (weaverii_pro_getopt($sname . '_vertical')) {
                    $img_url = weaverii_relative_url('includes/pro/images/' . $img_num . '-v.jpg');
                } else {
                    $img_url = weaverii_relative_url('includes/pro/images/' . $img_num . '.jpg');
                }
            }
            $menu_list .= '<li><img src="' . $img_url . '" alt="slider image" /></li>' . "\n";
        }
        $menu_list .= '</ul>';
    } else {
        $menu_list = "<h3>[weaver_slider id={$id}]: Menu not yet selected or defined.</h3>\n";
    }
    // $menu_list now ready to output
    $out .= $menu_list;
    $out .= "\n" . '</div> <!-- #weaver-slider' . $id . " -->\n";
    //$out .= '<div style="clear:both;"></div>' . "\n";
    /* compressSize = (MenuWidth-ImageWidth) / (NumImages-1)  (just for horizontal - use 50 for vertical) */
    $compressSize = (weaverii_pro_getopt($sname . '_menu_width') - weaverii_pro_getopt($sname . '_img_width')) / (weaverii_pro_getopt($sname . '_number_images') - 1);
    $vertical = 'false';
    if (weaverii_pro_getopt($sname . '_vertical')) {
        $compressSize = weaverii_pro_getopt($sname . '_vert_compress');
        $vertical = 'true';
    }
    if (!weaverii_pro_getopt($sname . '_noeffects')) {
        // no js for this menu
        $out .= "<script type=\"text/javascript\">window.addEvent('load', function(){\nnew BySlideMenu({\n'container' : 'menu-{$sname}',\n'selector' : 'li',\n'compressSize' : {$compressSize},\n'vertical' : {$vertical}\n}); });</script>\n";
    }
    return $out;
}
weaveriip_add_shortcode('weaver_slider', 'weaveriip_slider_shortcode');
	you want displayed in a new browser window. This can be an external web page, or an internal site page. One of the
	intended uses of the <em>Weaver Pop Up Page Template</em> is to serve as a target for this shortcode. When you create a
	'Pop Up' page, and also check the 'Hide Entire Header', 'Hide Entire Footer', 'Hide Sidebars', and 'Hide Page on
	the Primary Menu' per page options, the page will be displayed only with the content you enter into the page
	content area with the page editor. This content could be an image, a media player, or whatever you want.
	</li>
	<li><strong>h=</strong> - The desired height of the popup window. Most browsers will honor this size request, but
	not all browsers do (Chrome has minimum window sizes at the moment, for example). This height should correspond to
	the exact height of your popup content. Most current browsers also will leave their top bar and other parts
	displayed along with your content.
	</li>
	<li><strong>w=</strong> - The desired width of the popup window. Like the 'h' value, some browsers have minimum display sizes.
	</li>
	<li><strong>scrollbars=false</strong> - Use scrollbars=true if you want scrollbars on the popup on all browsers.</li>
	</ol>
</p>

<?php 
}
/* -------------- weaveriip_popup_link --------------- */
function weaveriip_popup_link_shortcode($args = '', $link)
{
    /* implement [weaver_popup_link opt1="val1" opt2="value"]link-html[/weaver_popu_link] shortcode */
    extract(shortcode_atts(array('href' => '#', 'w' => '100', 'h' => '100', 'scrollbars' => false), $args));
    $link = do_shortcode($link);
    $sb = $scrollbars ? 'scrollbars=1,' : 'scrollbars=no,';
    $content = '<a href="' . $href . '" onClick="window.open(this.href,' . "'_blank','toolbar=no,location=no,directories=no,status=no,{$sb}resizable=no, menubar=no, width={$w},height={$h}');return(false)\">{$link}</a>";
    return $content;
}
weaveriip_add_shortcode('weaver_popup_link', 'weaveriip_popup_link_shortcode');
        ?>
">
<?php 
        foreach ($styles as $style => $val) {
            $selected = $menu_style == $val ? ' selected="selected"' : '';
            echo '<option' . $selected . ' value="' . $val . '">' . $style . '</option>';
        }
        ?>
		</select>
		</p>
<?php 
    }
}
function weaveriip_extra_menu_shortcode($args = '')
{
    // [weaver_extra_menu menu='custom-menu-name' style='style-name']
    extract(shortcode_atts(array('menu' => 'primary', 'style' => 'menu-vertical', 'width' => '', 'border_color' => '', 'css' => '', 'wrap' => 'extra_menu'), $args));
    return weaverii_extra_menu_generate_code($menu, $wrap, $style, $border_color, $css, $width);
}
function weaveriip_extra_menu_output_style($sout)
{
    // CSS for weaveriip_extra_menu
    $menu = "/* Weaver II Pro: Simple Horizontal One Level Menu  */\n.menu-horizontal {clear:both;background:transparent;margin:0;padding:0;}\n.menu-horizontal ul {margin:0;padding:2px 2px 2px 20px;list-style-type:none !important;}\n.menu-horizontal li {display:inline;list-style-image:none !important;padding-right:15px;}\n/* Weaver II Pro: Default List Vertical Menu */\n.menu-vertical-default {clear:both; background:transparent;}\n";
    weaverii_f_write($sout, $menu);
}
weaveriip_add_shortcode('weaver_extra_menu', 'weaveriip_extra_menu_shortcode');
add_action('widgets_init', "weaveriip_load_menu_widget");
function weaveriip_load_menu_widget()
{
    register_widget("weaveriip_Widget_Extra_Menu");
}
        if ($img == '' && $text == '' && $textstyle == '') {
            continue;
        }
        echo '<span id="wvr_gadget_' . $i . '" class="wvr_gadget" style="position:absolute;z-index:4;left:' . $x . $xunits . ';top:' . $y . $yunits . ';' . $textstyle . '">';
        if ($link != '') {
            $target = $newpage ? ' target="_blank"' : '';
            echo '<a href="' . $link . '" title="' . $linkalt . '"' . $target . ' style="color:inherit;">';
        }
        if ($img != '') {
            echo '<img class="wvr_gadget_img" src="' . $img . '" title="' . $imgalt . '" alt="' . $imgalt . '" />';
        }
        if ($text != '') {
            echo $text;
        }
        if ($link != '') {
            echo "</a>";
        }
        echo "</span>\n";
    }
    ?>

<?php 
}
function weaveriip_gadget_shortcode($args = '')
{
    // [weaver_extra_menu menu='custom-menu-name' style='style-name']
    extract(shortcode_atts(array('gadget' => '1'), $args));
    return weaveriip_header_gadget_code($gadget);
}
weaveriip_add_shortcode('weaver_gadget', 'weaveriip_gadget_shortcode');
{
    if (weaverii_getopt('wii_post_info_hide_top') || weaverii_is_checked_page_opt('wvp_perpost_info_hide_top')) {
        return '';
    }
    $leftm = '8';
    $on = "\t<div class=\"entry-meta\" style=\"margin-botom:-5px;margin-top:-10px;\"><div " . weaverii_meta_icons_class() . ">\n\t\t";
    $on .= '<span class="sep">Posted on </span><time class="entry-date" >' . $date . '<span class="by-author"> <span class="sep"> by </span> <span class="author vcard">' . $author . '</span></span>';
    $on .= "\n    </div></div><!-- .entry-meta -->\n";
    return $on;
}
function weaveriip_tf($val)
{
    if ($val === true) {
        return true;
    }
    if ($val === false) {
        return false;
    }
    if ($val === 'false') {
        return false;
    }
    if ($val === 'no') {
        return false;
    }
    if ((int) $val == 0) {
        return false;
    }
    return true;
}
weaveriip_add_shortcode('weaver_feed', 'weaveriip_feed_shortcode');
                $imgsrc = $custom;
            } else {
                $imgsrc = apply_filters('weaverii-social-dir', weaverii_relative_url('includes/pro/social/1/')) . $id . '.png';
            }
            $target = '_blank';
            if (isset($soc[$id . '_stay']) && $soc[$id . '_stay']) {
                $target = '_self';
            }
            $out .= '<a class="wvr-social-a" href="' . $url . '" target="' . $target . '" title="' . $title . '">' . '<img class="wvr-social-img" style="margin-right:' . $rm . 'px; width:' . $height . 'px !important;"  src="' . $imgsrc . '"  height="' . $height . '" width="' . $height . '" title="' . $title . '" alt="' . $title . '" /></a>' . "\n";
            if (++$displayed >= $number) {
                $out .= '</' . $tag . '>' . "\n";
                return $out;
                // bail when display number reached
            }
            break;
        }
    }
    // end foreach
    $out .= '</' . $tag . '>' . "\n";
    if ($is_widget) {
        $out .= '<div style="clear:both;"></div>' . "\n";
    }
    return $out;
}
weaveriip_add_shortcode('weaver_social', 'weaveriip_social_shortcode');
/* ============================ weaveriip_social =============================== */
add_action('widgets_init', "weaveriip_load_social_widget");
function weaveriip_load_social_widget()
{
    register_widget("weaveriip_Widget_Social");
}
</p>
<?php 
}
function weaveriip_search_shortcode($args = '')
{
    extract(shortcode_atts(array('width' => ''), $args));
    $out = '';
    $placeholder = weaverii_getopt('wii_search_msg');
    if ($placeholder == '') {
        $placeholder = 'Search ' . get_bloginfo('name');
    }
    $use_img = 'images/search_button.gif';
    if (weaverii_getopt('wii_go_button')) {
        $use_img = 'images/go_button.gif';
    }
    $imgurl = weaverii_relative_url($use_img);
    $use_img = weaverii_getopt('_wii_search_button_url');
    if (strlen($use_img) > 0) {
        $imgurl = $use_img;
    }
    $f = '<form role="search" method="get" class="searchform" action="' . home_url('/') . '" >
		<section class="search"><label class="screen-reader-text" for="s">' . __('Search for:', 'weaver-ii') . '</label>
		<input style="width:' . $width . 'px;" type="search" value="' . get_search_query() . '" name="s" id="s" placeholder="' . $placeholder . '" />
		<input class="searchformimg" type="image" src="' . apply_filters('weaverii_css', $imgurl) . '" onsubmit="submit-form();" alt="Search" />
		</section>
		</form>';
    $out .= apply_filters('get_search_form', $f);
    return $out;
}
weaveriip_add_shortcode('weaver_search', 'weaveriip_search_shortcode');
<?php 
}
/* -------------- weaveriip_php--------------- */
function weaveriip_php_do_eval($code)
{
    $char_codes = array('&#8216;', '&#8217;', '&#8220;', '&#8221;', '&#8242;', '&#8243;', '&#8211;', '&#8212;', '&#8230;', '&#215;');
    $replacements = array("'", "'", '"', '"', "'", '"', '--', '---', '...', 'x');
    $php = str_replace($char_codes, $replacements, $code);
    // untexturize
    $php .= ';';
    $err_level = error_reporting(0);
    $out = '';
    ob_start();
    if (version_compare(PHP_VERSION, '5.0.0', '>')) {
        try {
            eval($php);
        } catch (Exception $e) {
        }
    } else {
        eval($php);
    }
    $out .= ob_get_clean();
    error_reporting($err_level);
    return $out;
}
function weaveriip_php_shortcode($args = '', $code)
{
    return weaveriip_php_do_eval($code);
}
weaveriip_add_shortcode('weaver_php', 'weaveriip_php_shortcode');
    $id = 'b' . $i;
    $img_url = $buttons[$id . '_img_url'];
    if ($img_url == '') {
        return $out;
    }
    $title = $buttons[$id . '_hover'];
    $url = $buttons[$id . '_link_url'];
    if ($buttons[$id . '_blank']) {
        $blank = ' target="_blank"';
    } else {
        $blank = '';
    }
    if ($url != '') {
        $out .= '<a href="' . $url . '" title="' . $title . '"' . $blank . '>';
    }
    $out .= '<img class="' . $btn_class . '" src="' . $img_url . '" title="' . $title . '" alt="' . $title . '" style="border:0;padding-right:3px;padding-bottom:3px;z-index:20;" />';
    // $out .= '<img class="btn-' . $i+1 . '" src="' . $img_url . '" title="'. $title . '" alt="' . $title .
    // '" style="border:0;padding-right:3px;padding-bottom:3px;z-index:20;" />';
    if ($url != '') {
        $out .= '</a>';
    }
    $out .= "\n";
    return $out;
}
weaveriip_add_shortcode('weaver_buttons', 'weaveriip_buttons_shortcode');
/* ============================ weaveriip_buttons =============================== */
add_action('widgets_init', "weaveriip_load_buttons_widget");
function weaveriip_load_buttons_widget()
{
    register_widget("weaveriip_Widget_Buttons");
}
{
    /* implement [weaver_widget_area id='name'] shortcode */
    extract(shortcode_atts(array('id' => '#', 'class' => '', 'style' => '"margin-left:auto;margin-right:auto;"'), $args));
    $area = 'per-page-' . $id;
    // retrieve meta value
    $bad = '<h3>[weaver_widget_area] - Area ' . $id . ' not defined.</h3>';
    $id_tag = 'per-page-widget';
    if ($class == 'primary') {
        $id_tag = $class;
        $class = '';
    }
    $content = '<div id="' . $id_tag . '" class="widget-area sidebar_extra ' . $area . ' ' . $class . '" style=' . weaveriip_bracket($style, '"', '"') . '><ul class="xoxo">' . "\n";
    if (strlen($id) > 0) {
        // want to display some areas
        if (!is_active_sidebar($area)) {
            return $bad;
        }
        ob_start();
        /* let's use output buffering to allow use of Dynamic Widgets plugin and not have empty sidebar */
        $success = dynamic_sidebar($area);
        $content .= ob_get_clean();
        if ($success && $content) {
            $content .= "\n</ul></div>\n";
        } else {
            $content = $bad;
        }
    }
    return $content;
}
weaveriip_add_shortcode('weaver_widget_area', 'weaveriip_widget_area_shortcode');
        // no paragraph - so make inline
        $out .= $show_img . '</a>';
        $has_p = stripos($text, '</p>');
        if ($has_p > 0) {
            $out .= '</p>';
            // after the </a> to make span work
        }
        $out .= '<span id="' . $rand . '"' . $style . ' ' . $class . '>';
        if ($has_p > 0) {
            $out .= '<p>';
            // to make span work
            $lead_br = stripos($text, '<br />');
            if ($lead_br !== false && $lead_br == 0) {
                $text = substr($text, 6);
            }
        }
        $out .= $text;
        if ($has_p !== false) {
            if ($has_p > 0) {
                $out .= "</p></span><p>";
            } else {
                $out .= "</p></span>";
            }
        } else {
            $out .= "</span>";
        }
    }
    return $out;
}
weaveriip_add_shortcode('weaver_showhide', 'weaveriip_showhide_shortcode');