function shortcode($atts) { global $last_usquare_id; extract(shortcode_atts(array( 'id' => '' ), $atts)); if (!$id && isset($last_usquare_id)) { $id=$last_usquare_id; } $usquare_id=$id; require_once($this->path . '/pages/usquare_functions.php'); $arr=load_usquare($usquare_id, $this); if ($arr===FALSE) return ''; $frontHtml=generate_usquare($this, $arr['settings'], $arr['items'], $this->url, $usquare_id, $arr['icons'], 2); $frontHtml = preg_replace('/\s+/', ' ',$frontHtml); /* $frontHtml = str_replace('<', '[usquare_open_tag]', $frontHtml); $frontHtml = str_replace('>', '[usquare_close_tag]', $frontHtml); */ return do_shortcode($frontHtml); }
$subkey = substr($ex2[0],strpos($ex2[0],'-')+1); $itemsArray[$key][$subkey] = $ex2[1]; $itemsArray[$key][$subkey] = str_replace('#|#|', '||', $itemsArray[$key][$subkey]); $itemsArray[$key][$subkey] = str_replace('#:#:', '::', $itemsArray[$key][$subkey]); if (substr($subkey,0,9)=="item-icon") { if (strpos($subkey, '-link')!==FALSE) { $num = substr($key,4); if (!isset($icon_link_count[$num])) $icon_link_count[$num]=0; $ikey=$icon_link_count[$num]; $icons[$num][$ikey]['link']=$itemsArray[$key][$subkey]; $icon_link_count[$num]++; } if (strpos($subkey, '-image')!==FALSE) { $num = substr($key,4); if (!isset($icon_image_count[$num])) $icon_image_count[$num]=0; $ikey=$icon_image_count[$num]; $icons[$num][$ikey]['image']=$itemsArray[$key][$subkey]; $icon_image_count[$num]++; } } } } require_once dirname( __FILE__ ) . '/usquare_functions.php'; $buf=generate_usquare($this, $settings, $itemsArray, $this->url, 0, $icons); $usquare_width=$settings['usquare-items-per-line']*$settings['item-width']; echo '<div style="width: '.$usquare_width.'px; position: relative; margin: 0 auto;">'.$buf.'</div>'; ?>