<?php
/**
 * 侧边栏
 */
if (!defined('EMLOG_ROOT')) {exit('error!');}
?>
<aside class="joe_aside">
    <?php
    $widgets = !empty($options_cache['widgets1']) ? unserialize($options_cache['widgets1']) : array();
    doAction('diff_side');
    foreach ($widgets as $val) {
        $widget_title = @unserialize($options_cache['widget_title']);
        $custom_widget = @unserialize($options_cache['custom_widget']);
        if (strpos($val, 'custom_wg_') === 0) {
            $callback = 'widget_custom_text';
            if (function_exists($callback)) {
                call_user_func($callback, htmlspecialchars($custom_widget[$val]['title']), $custom_widget[$val]['content']);
            }
        } else {
            $callback = 'widget_' . $val;
            if (function_exists($callback)) {
                preg_match("/^.*\s\((.*)\)/", $widget_title[$val], $matchs);
                $wgTitle = isset($matchs[1]) ? $matchs[1] : $widget_title[$val];
                call_user_func($callback, htmlspecialchars($wgTitle));
            }
        }
    }
    ?>
<?php if($wzpeizhi['config_sylink']=="on"): ?>
<section class="joe_aside__item flatterer">
    <div class="joe_aside__item-title">
        <span class="text">友情链接</span>
    </div>
     <div class="joe_aside__item-contain">
		<?php shouye_links();?> 
    </div>
</section>
<?php else: ?>
<?php endif; ?>
<?php 
echo preg_replace("/(.*?) \|\| (.*?)/iU", '<a class="joe_aside__item advert" href="$1"><img class=" lazyloaded" width="100%" src="$2"><span class="icon">广告</span></a>', $wzpeizhi['config_ggcbl']);
?>
<?php /**widget_page($title);  */?>
</aside></div>