/** * Code for StarReview shortcode implementation * * @param array $atts */ function shortcode_starreview($atts = array()) { global $userdata; $user_id = is_object($userdata) ? $userdata->ID : 0; $this->cache_posts($user_id); $sett = shortcode_atts($this->default_shortcode_starreview, $atts); if ($sett["post"] == 0) { global $post; $sett["post"] = $post->ID; } $star_css = $sett["css"] != "" ? $sett["css"] : $this->o["review_class_block"]; $star_style = $sett["style"] != "" ? $sett["style"] : $this->o["review_style"]; $star_style_ie6 = $sett["style_ie6"] != "" ? $sett["style_ie6"] : $this->o["review_style_ie6"]; $star_size = $sett["size"] != "" ? $sett["size"] : $this->o['review_size']; $post_data = wp_gdget_post($sett["post"]); $rating = is_object($post_data) ? $post_data->review : -1; $rating = $rating < 0 ? 0 : $rating; return GDSRRenderT2::render_rsb($sett["tpl"], array("rating" => $rating, "star_style" => $this->is_ie6 ? $star_style_ie6 : $star_style, "star_size" => $star_size, "star_max" => $this->o["review_stars"], "header_text" => $this->o["review_header_text"], "css" => $star_css)); }
/** * Code for StarReview shortcode implementation * * @param array $atts */ function shortcode_starreview($atts = array()) { $sett = shortcode_atts($this->default_shortcode_starreview, $atts); if ($sett["post"] == 0) { global $post; $sett["post"] = $post->ID; } $rating = GDSRDatabase::get_review($sett["post"]); if ($rating < 0) { $rating = 0; } return GDSRRenderT2::render_rsb($sett["tpl"], $rating, $this->is_ie6 ? $this->o["review_style_ie6"] : $this->o["review_style"], $this->o['review_size'], $this->o["review_stars"], $this->o["review_header_text"], $this->o["review_class_block"]); }