'; $rater.= '
'; if ($allow_vote) { $rater.= '
'; for ($ic = 0; $ic < $unit_count; $ic++) { $ncount = $unit_count - $ic; $url = $_SERVER['REQUEST_URI']; $url_pos = strpos($url, "?"); if ($url_pos === false) $first_char = '?'; else $first_char = '&'; $ajax_id = sprintf("gdsrX%sX%sX%sX%sX%sX%sX%sX%s", $id, $ncount, $user_id, $type, $rater_id, $loader_id, $template_id, $unit_width); $rater.=''; } $rater.= '
'; } $rater.= '
'; if ($allow_vote) $rater.= GDSRRender::rating_wait($loader_id, $rater_length."px", $typecls, $wait_msg); return $rater; } function rating_loader($id, $is_bot = false, $size = "small") { $render = '
'; $render.= 'GD Star Rating
'; if ($is_bot) { $render.= 'a WordPress rating system'; } else { $render.= ''.__("loading", "gd-star-rating").'...'; } $render.= '
'; return $render; } function render_locked_response($value = "nothing") { if ($value == "nothing") return ""; $render = '
'; if ($value == "promourl") $render.= 'GD Star Rating
'; else if ($value == "promoname") $render.= 'GD Star Rating
'; $render.= 'a WordPress rating system'; $render.= '
'; return $render; } function rating_wait($loader_id, $rater_length, $typecls, $wait_msg = '', $style = '') { $rater_length = $rater_length > 0 ? " width: ".$rater_length : ""; $loader = ''; return $loader; } function render_static_thumb($style, $size, $rating, $id = "", $rendering = "") { if ($rendering == "") $rendering = STARRATING_STARS_GENERATOR; switch ($rendering) { case "GFX": return GDSRRender::render_static_thumb_gfx($style, $size, $rating); break; default: case "DIV": return GDSRRender::render_static_thumb_div($style, $size, $rating); break; } } function render_static_thumb_div($style, $size, $rating, $id = "") { global $gdsr; $gfx = $gdsr->g->find_thumb($style); $path = is_null($gfx) ? "" : $gfx->get_url($size); return sprintf('', $id == "" ? '' : ' id="'.$id.'"', sprintf('text-align:left; padding: 0; margin: 0; background: url(%s) no-repeat 0px -%spx; height: %spx; width: %spx;', $path, $rating < 0 ? 3 * $size : 2 * $size, $size, $size) ); } function render_static_thumb_gfx($style, $size, $rating, $id = "") { $url = STARRATING_URL.sprintf("gfx.php?value=%s&type=thumbs&set=%s&size=%s", $rating, $style, $size); return sprintf('', $id == "" ? '' : ' id="'.$id.'"', $url, ($rating > 0 ? "+" : "").$rating); } function render_static_stars($star_style, $star_size, $star_max, $rating, $id = "", $rendering = "", $star_factor = 1) { if ($rendering == "") $rendering = STARRATING_STARS_GENERATOR; switch ($rendering) { case "GFX": return GDSRRender::render_static_stars_gfx($star_style, $star_size, $star_max, $rating, $id, $star_factor); break; default: case "DIV": return GDSRRender::render_static_stars_div($star_style, $star_size, $star_max, $rating, $id, $star_factor); break; } } function render_static_stars_div($star_style, $star_size, $star_max, $rating, $id = "", $star_factor = 1) { global $gdsr; $gfx = $gdsr->g->find_stars($star_style); $star_path = is_null($gfx) ? "" : $gfx->get_url($star_size); $full_width = $star_size * $star_max * $star_factor; $rate_width = $star_size * $rating * $star_factor; return sprintf('
', $id == "" ? '' : ' id="'.$id.'"', sprintf('text-align:left; padding: 0; margin: 0; background: url(%s); height: %spx; width: %spx;', $star_path, $star_size, $full_width), sprintf('background: url(%s) bottom left; padding: 0; margin: 0; height: %spx; width: %spx;', $star_path, $star_size, $rate_width) ); } function render_static_stars_gfx($star_style, $star_size, $star_max, $rating, $id = "", $star_factor = 1) { $url = STARRATING_URL.sprintf("gfx.php?value=%s&set=%s&size=%s&max=%s", $rating * $star_factor, $star_style, $star_size, $star_max * $star_factor); return sprintf('', $id == "" ? '' : ' id="'.$id.'"', $url, $rating, $star_max); } function rating_stars_multi($style, $post_id, $tpl_id, $set_id, $id, $height, $unit_count, $allow_vote = true, $value = 0, $xtra_cls = '', $review_mode = false) { $css_style = " gdsr-".$style; $css_sizes = " gdsr-size-".$height; $vote_class = "gdsr_multis_as"; $vote_current = "gdsr_mur_stars_current_"; if ($review_mode) { $current = $value; $vote_class = "gdsr_mur_static"; $vote_current = "gdsr_murvw_stars_current_"; } else $current = 0; $rater = '
'; $rater.= '
'; $rater.= '
'; if ($allow_vote) { $rater.= '
'; $rater.= '
'; for ($ic = 0; $ic < $unit_count; $ic++) { $ncount = $unit_count - $ic; $rater.=''; } $rater.= '
'; } $rater.= '
'; return $rater; } function rating_stars_local($style, $height, $unit_count, $allow_vote = true, $value = 0, $class_base = 'gdsr_cmm', $main_class = "reviewcmm") { $css_style = " gdsr-".$style; $css_sizes = " gdsr-size-".$height; $css_input = str_replace("_", "-", $class_base)."-cls-rt"; $rater = ''; $rater.= '
'; $rater.= '
'; if ($allow_vote) { $rater.= '
'; for ($ic = 0; $ic < $unit_count; $ic++) { $ncount = $unit_count - $ic; $rater.=''; } $rater.= '
'; } $rater.= '
'; return $rater; } } ?>