GD Star Rating

custom functions

 wp_gdsr_dump ($msg, $obj, $block="none", $mode="a+")
 Writes a object dump into the log file.
 wp_gdsr_debug_clean ()
 Truncates log file to zero lenght deleting all data inside.
 wp_gdsr_comment_integrate_multi_rating ($multi_set_id=1, $template_id=0, $value=0, $echo=true)
 Integrate multi set post rating into the comment form.
 wp_gdsr_comment_integrate_standard_rating ($value=0, $echo=true)
 Integrate standard post rating into the comment form.
 wp_gdsr_integration_readonly ($standard=false, $multis=false)
 Makes rating blocks readonly regardless of other settings.
 wp_gdsr_render_powered_by ($echo=true)
 Renders small 80x15 powered by GD Star Rating button.
 wp_gdsr_render_article ($template_id=0, $read_only=false, $echo=true)
 Renders the rating stars.
 wp_gdsr_render_comment ($template_id=0, $read_only=false, $echo=true)
 Manual render of comment rating.
 wp_gdsr_new_comment_review ($value=0, $echo=true)
 Renders stars for comment review used in the comment form for the comment author to place it's review rating.
 wp_gdsr_render_multi ($multi_set_id, $post_id=0, $template_id=0, $read_only=false, $echo=true)
 Renders multi rating block.
 wp_gdsr_multi_review_editor ($multi_set_id, $post_id=0, $template_id=0, $echo=true)
 Renders multi rating review editor block.
 wp_gdsr_multi_review_editor_header ($echo=true)
 Renders multi rating review header elements css and javascript.
 wp_gdsr_show_multi_review ($multi_set_id, $post_id=0, $template_id=0, $echo=true)
 Renders multi rating review for a post.
 wp_gdsr_multi_rating_average ($multi_set_id, $post_id=0, $show="total", $echo=true)
 Renders single rating stars image with average rating for the multi rating review.
 wp_gdsr_multi_review_average ($multi_set_id, $post_id=0, $echo=true)
 Renders single rating stars image with average rating for the multi rating review.
 wp_gdsr_rating_article ($post_id=0)
 Returns object with all needed rating properties for post or page.
 wp_gdsr_rating_comment ($comment_id=0)
 Returns object with all needed rating properties for comment.
 wp_gdsr_rating_multi ($multi_set_id, $post_id=0)
 Returns object with all needed multi rating properties for post or page.
 wp_gdsr_blog_rating ($select="postpage", $show="total")
 Returns calculated data for average blog rating including bayesian estimate mean.
 wp_gdsr_render_review ($echo=true)
 GDStarRating $gdsr main rating class instance
 wp_gdsr_render_star_rating_widget ($widget=array(), $echo=true)
 Renders widget-like element based on the $widget settings array.
 wp_gdsr_render_blog_rating_widget ($widget=array(), $echo=true)
 Renders blog rating widget element based on the $widget settings array.
 wp_gdsr_render_comments_rating_widget ($widget=array(), $echo=true)
 Renders comments rating widget element based on the $widget settings array.
 wp_gdsr_show_comment_review ($comment_id=0, $use_default=true, $size=20, $style="oxygen", $echo=true)
 Shows stars with review rating of a comment.
 wp_gdsr_show_article_review ($post_id=0, $use_default=true, $size=20, $style="oxygen", $echo=true)
 Shows review rating for the post with stars.
 wp_gdsr_show_article_rating ($post_id=0, $use_default=true, $size=20, $style="oxygen", $echo=true)
 Shows rating for the post with stars.
wp_gdsr_blog_rating ( $  select = "postpage",
$  show = "total" 
)

Returns calculated data for average blog rating including bayesian estimate mean.

class $gdsr

Parameters:
string $select articles to select postpage|post|page
string $show votes to use: total|users|visitors
Returns:
object with average blog rating values

wp_gdsr_comment_integrate_multi_rating ( $  multi_set_id = 1,
$  template_id = 0,
$  value = 0,
$  echo = true 
)

Integrate multi set post rating into the comment form.

GDStarRating $gdsr main rating class instance

Parameters:
int $multi_set_id id of the multi rating set to use
int $template_id id of the template to use
int $value inital value for the review
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_comment_integrate_standard_rating ( $  value = 0,
$  echo = true 
)

Integrate standard post rating into the comment form.

GDStarRating $gdsr main rating class instance

Parameters:
int $template_id id of the template to use
int $value inital value for the review
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_debug_clean (  ) 

Truncates log file to zero lenght deleting all data inside.

wp_gdsr_dump ( $  msg,
$  obj,
$  block = "none",
$  mode = "a+" 
)

Writes a object dump into the log file.

Parameters:
string $msg log entry message
mixed $object object to dump
string $block adds start or end dump limiters { none | start | end }
string $mode file open mode

wp_gdsr_integration_readonly ( $  standard = false,
$  multis = false 
)

Makes rating blocks readonly regardless of other settings.

GDStarRating $gdsr main rating class instance

Parameters:
bool $standard standard ratings will be read only
bool $multis multi ratings will be read only

wp_gdsr_multi_rating_average ( $  multi_set_id,
$  post_id = 0,
$  show = "total",
$  echo = true 
)

Renders single rating stars image with average rating for the multi rating review.

object $post post data GDStarRating $gdsr main rating class instance

Parameters:
int $set_id id of the multi rating set
int $post_id id of the post rating will be attributed to
string $show what data to use: total, visitors or users votes only
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_multi_review_average ( $  multi_set_id,
$  post_id = 0,
$  echo = true 
)

Renders single rating stars image with average rating for the multi rating review.

object $post post data GDStarRating $gdsr main rating class instance

Parameters:
int $set_id id of the multi rating set
int $post_id id of the post rating will be attributed to
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_multi_review_editor ( $  multi_set_id,
$  post_id = 0,
$  template_id = 0,
$  echo = true 
)

Renders multi rating review editor block.

object $post post data GDStarRating $gdsr main rating class instance

Parameters:
int $post_id id of the post rating will be attributed to
bool $echo echo results or return it as a string
array $settings override settings for rendering the block
Returns:
string html with rendered contents

wp_gdsr_multi_review_editor_header ( $  echo = true  ) 

Renders multi rating review header elements css and javascript.

GDStarRating $gdsr main rating class instance

Parameters:
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_new_comment_review ( $  value = 0,
$  echo = true 
)

Renders stars for comment review used in the comment form for the comment author to place it's review rating.

GDStarRating $gdsr main rating class instance

Parameters:
int $value inital value for the review
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_rating_article ( $  post_id = 0  ) 

Returns object with all needed rating properties for post or page.

object $post post data GDStarRating $gdsr main rating class instance

Parameters:
int $post_id post to get rating for, leave 0 to get post from loop
Returns:
object rating post properties

wp_gdsr_rating_comment ( $  comment_id = 0  ) 

Returns object with all needed rating properties for comment.

object $comment comment data GDStarRating $gdsr main rating class instance

Parameters:
int $post_id post to get rating for, leave 0 to get post from loop
Returns:
object rating post properties

wp_gdsr_rating_multi ( $  multi_set_id,
$  post_id = 0 
)

Returns object with all needed multi rating properties for post or page.

object $post post data GDStarRating $gdsr main rating class instance

Parameters:
int $set_id id of the multi rating set
int $post_id post to get rating for, leave 0 to get post from loop
Returns:
object rating post properties

wp_gdsr_render_article ( $  template_id = 0,
$  read_only = false,
$  echo = true 
)

Renders the rating stars.

This function call must be withing the post loop.

object $post post data object $userdata user data GDStarRating $gdsr main rating class instance

Parameters:
int $template_id standard rating block template id
bool $read_only render block as a read only, voting not allowed
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_render_blog_rating_widget ( $  widget = array(),
$  echo = true 
)

Renders blog rating widget element based on the $widget settings array.

Parameters:
array $widget settings to use for rendering
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_render_comment ( $  template_id = 0,
$  read_only = false,
$  echo = true 
)

Manual render of comment rating.

object $comment comment data object $post post data object $userdata user data GDStarRating $gdsr main rating class instance

Parameters:
bool $read_only render block as a read only, voting not allowed
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_render_comments_rating_widget ( $  widget = array(),
$  echo = true 
)

Renders comments rating widget element based on the $widget settings array.

Parameters:
array $widget settings to use for rendering
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_render_multi ( $  multi_set_id,
$  post_id = 0,
$  template_id = 0,
$  read_only = false,
$  echo = true 
)

Renders multi rating block.

This function call must be withing the post loop.

object $post post data object $userdata user data GDStarRating $gdsr main rating class instance

Parameters:
int $multi_set_id id of the multi rating set to use
int $post_id id of the post rating will be attributed to
int $template_id id of the template to use
bool $read_only render block as a read only, voting not allowed
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_render_powered_by ( $  echo = true  ) 

Renders small 80x15 powered by GD Star Rating button.

GDStarRating $gdsr main rating class instance

Parameters:
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_render_review ( $  echo = true  ) 

GDStarRating $gdsr main rating class instance

Parameters:
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_render_star_rating_widget ( $  widget = array(),
$  echo = true 
)

Renders widget-like element based on the $widget settings array.

Parameters:
array $widget settings to use for rendering
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_show_article_rating ( $  post_id = 0,
$  use_default = true,
$  size = 20,
$  style = "oxygen",
$  echo = true 
)

Shows rating for the post with stars.

object $post post data GDStarRating $gdsr main rating class instance

Parameters:
int $post_id ID for the article to display rating from. If this is set to 0, than it must be used within the loop, and id of current article will be used.
bool $use_default set to true tell this function to render stars using default settings for stars set on settings panel, false tells to use $size and $style parameters.
int $size size of the stars to render, must be valid value: 12, 20, 30, 46
string $style name of the stars set to use, name of the folder for the set
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_show_article_review ( $  post_id = 0,
$  use_default = true,
$  size = 20,
$  style = "oxygen",
$  echo = true 
)

Shows review rating for the post with stars.

object $post post data GDStarRating $gdsr main rating class instance

Parameters:
int $post_id ID for the article to display rating from. If this is set to 0, than it must be used within the loop, and id of current article will be used.
bool $use_default set to true tell this function to render stars using default settings for stars set on settings panel, false tells to use $size and $style parameters.
int $size size of the stars to render, must be valid value: 12, 20, 30, 46
string $style name of the stars set to use, name of the folder for the set
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_show_comment_review ( $  comment_id = 0,
$  use_default = true,
$  size = 20,
$  style = "oxygen",
$  echo = true 
)

Shows stars with review rating of a comment.

object $comment comment data GDStarRating $gdsr main rating class instance

Parameters:
int $comment_id ID for the comment to display rating from. If this is set to 0, than it must be used within the comment loop, and id of current comment will be used.
bool $use_default set to true tell this function to render stars using default settings for stars set on settings panel, false tells to use $size and $style parameters.
int $size size of the stars to render, must be valid value: 12, 20, 30, 46
string $style name of the stars set to use, name of the folder for the set
bool $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_show_multi_review ( $  multi_set_id,
$  post_id = 0,
$  template_id = 0,
$  echo = true 
)

Renders multi rating review for a post.

object $post post data GDStarRating $gdsr main rating class instance

Parameters:
int $post_id id of the post rating will be attributed to
array $settings override settings for rendering the block
bool $echo echo results or return it as a string
Returns:
string html with rendered contents