GD Star Rating

integration functions

  wp_gdsr_get_multi_set ($post_id=0)
  Get multi set id based on global and categoires rules.
  wp_gdsr_render_comment_aggregation ($post_id=0, $template_id=0, $show="total", $echo=true)
  This will render aggregated comments rating for the post.
  wp_gdsr_comment_integrate_multi_result ($comment_id, $multi_set_id=0, $template_id=0, $stars_set="oxygen", $stars_size=20, $stars_set_ie6="oxygen_gif", $avg_stars_set="oxygen", $avg_stars_size=20, $avg_stars_set_ie6="oxygen_gif", $echo=true)
  Integrate multi rating result into the comment.
  wp_gdsr_comment_integrate_multi_result_average ($comment_id, $multi_set_id=0, $template_id=0, $avg_stars_set="oxygen", $avg_stars_size=20, $avg_stars_set_ie6="oxygen_gif", $echo=true)
  Integrate average multi rating result into the comment.
  wp_gdsr_comment_integrate_standard_result ($comment_id, $stars_set="", $stars_size=0, $stars_set_ie6="", $echo=true)
  Integrate standard rating result into the comment.
  wp_gdsr_comment_integrate_multi_rating ($multi_set_id=0, $template_id=0, $value=0, $stars_set="oxygen", $stars_size=20, $stars_set_ie6="oxygen_gif", $echo=true)
  Integrate multi set post rating into the comment form.
  wp_gdsr_comment_integrate_standard_rating ($value=0, $stars_set="", $stars_size=0, $stars_set_ie6="", $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, $stars_set="", $stars_size=0, $stars_set_ie6="", $echo=true)
  Renders the rating stars.
  wp_gdsr_render_comment ($template_id=0, $read_only=false, $stars_set="", $stars_size=0, $stars_set_ie6="", $echo=true)
  Manual render of comment rating.
  wp_gdsr_render_multi ($multi_set_id=0, $template_id=0, $read_only=false, $post_id=0, $stars_set="", $stars_size=0, $stars_set_ie6="", $avg_stars_set="oxygen", $avg_stars_size=20, $avg_stars_set_ie6="oxygen_gif", $echo=true)
  Renders multi rating block.
  wp_gdsr_new_comment_review ($value=0, $stars_set="", $stars_size=0, $stars_set_ie6="", $echo=true)
  Renders stars for comment review used in the comment form for the comment author to place it's review rating.
  wp_gdsr_multi_review_editor ($multi_set_id=0, $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=0, $template_id=0, $post_id=0, $stars_set="", $stars_size=0, $stars_set_ie6="", $avg_stars_set="oxygen", $avg_stars_size=20, $avg_stars_set_ie6="oxygen_gif", $echo=true)
  Renders multi rating review for a post.
  wp_gdsr_multi_rating_average ($multi_set_id=0, $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=0, $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=0, $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 ($post_id=0, $template_id=0, $echo=true)
  Renders standard review for a post.
  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_dump ($msg, $obj, $block="none", $mode="a+", $force=false)
  Writes a object dump into the log file.
  wp_gdsr_debug_clean ()
  Truncates log file to zero lenght deleting all data inside.
  gd_get_multi_set ($id)
  Gets the multi rating set.
  is_msie6 ()
  Determines if the browser accessing the page is MS Internet Explorer 6.
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 = 0,
template_id = 0,
value = 0,
stars_set = "oxygen",
stars_size = 20,
stars_set_ie6 = "oxygen_gif",
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
string  $stars_set set to use for rendering
int  $stars_size set size to use for rendering
string  $stars_set_ie6 set to use for rendering in ie6
bool  $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_comment_integrate_multi_result ( comment_id,
multi_set_id = 0,
template_id = 0,
stars_set = "oxygen",
stars_size = 20,
stars_set_ie6 = "oxygen_gif",
avg_stars_set = "oxygen",
avg_stars_size = 20,
avg_stars_set_ie6 = "oxygen_gif",
echo = true  
)

Integrate multi rating result into the comment.

GDStarRating $gdsr main rating class instance

Parameters:
int  $comment_id id of the comment
int  $multi_set_id id of the multi rating set to use
int  $template_id id of the template to use
string  $stars_set set to use for rendering
int  $stars_size set size to use for rendering
string  $stars_set_ie6 set to use for rendering in ie6
string  $avg_stars_set set to use for rendering of average value
int  $avg_stars_size set size to use for rendering of average value
string  $avg_stars_set_ie6 set to use for rendering of average value in ie6
bool  $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_comment_integrate_multi_result_average ( comment_id,
multi_set_id = 0,
template_id = 0,
avg_stars_set = "oxygen",
avg_stars_size = 20,
avg_stars_set_ie6 = "oxygen_gif",
echo = true  
)

Integrate average multi rating result into the comment.

GDStarRating $gdsr main rating class instance

Parameters:
int  $comment_id id of the comment
int  $multi_set_id id of the multi rating set to use
int  $template_id id of the template to use
string  $avg_stars_set set to use for rendering of average value
int  $avg_stars_size set size to use for rendering of average value
string  $avg_stars_set_ie6 set to use for rendering of average value in ie6
bool  $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_comment_integrate_standard_rating ( value = 0,
stars_set = "",
stars_size = 0,
stars_set_ie6 = "",
echo = true  
)

Integrate standard post rating into the comment form.

GDStarRating $gdsr main rating class instance

Parameters:
int  $value inital value for the review
string  $stars_set set to use for rendering
int  $stars_size set size to use for rendering
string  $stars_set_ie6 set to use for rendering in ie6
bool  $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_comment_integrate_standard_result ( comment_id,
stars_set = "",
stars_size = 0,
stars_set_ie6 = "",
echo = true  
)

Integrate standard rating result into the comment.

GDStarRating $gdsr main rating class instance

Parameters:
int  $comment_id id of the comment
string  $stars_set set to use for rendering
int  $stars_size set size to use for rendering
string  $stars_set_ie6 set to use for rendering in ie6
bool  $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_get_multi_set ( post_id = 0  ) 

Get multi set id based on global and categoires rules.

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

Parameters:
int  $post_id post to get review for

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 = 0,
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 = 0,
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 = 0,
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,
stars_set = "",
stars_size = 0,
stars_set_ie6 = "",
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
string  $stars_set set to use for rendering
int  $stars_size set size to use for rendering
string  $stars_set_ie6 set to use for rendering in ie6
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 = 0,
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,
stars_set = "",
stars_size = 0,
stars_set_ie6 = "",
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
string  $stars_set set to use for rendering
int  $stars_size set size to use for rendering
string  $stars_set_ie6 set to use for rendering in ie6
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,
stars_set = "",
stars_size = 0,
stars_set_ie6 = "",
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
string  $stars_set set to use for rendering
int  $stars_size set size to use for rendering
string  $stars_set_ie6 set to use for rendering in ie6
bool  $echo echo results or return it as a string
Returns:
string html with rendered contents

wp_gdsr_render_comment_aggregation ( post_id = 0,
template_id = 0,
show = "total",
echo = true  
)

This will render aggregated comments rating for the post.

Parameters:
int  $post_id post to get review for
int  $template_id id of the template to use
string  $show votes to show: total, users, visitors
bool  $echo echo results or return it as a string

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 = 0,
template_id = 0,
read_only = false,
post_id = 0,
stars_set = "",
stars_size = 0,
stars_set_ie6 = "",
avg_stars_set = "oxygen",
avg_stars_size = 20,
avg_stars_set_ie6 = "oxygen_gif",
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
string  $stars_set set to use for rendering
int  $stars_size set size to use for rendering
string  $stars_set_ie6 set to use for rendering in ie6
string  $avg_stars_set set to use for rendering of average element
int  $avg_stars_size set size to use for rendering of average element
string  $avg_stars_set_ie6 set to use for rendering in ie6 of average element
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 ( post_id = 0,
template_id = 0,
echo = true  
)

Renders standard review for a post.

GDStarRating $gdsr main rating class instance

Parameters:
int  $post_id post to get review for
int  $template_id id of the template to use
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 = 0,
template_id = 0,
post_id = 0,
stars_set = "",
stars_size = 0,
stars_set_ie6 = "",
avg_stars_set = "oxygen",
avg_stars_size = 20,
avg_stars_set_ie6 = "oxygen_gif",
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
int  $template_id id of the template to use [RMB]
string  $stars_set set to use for rendering
int  $stars_size set size to use for rendering
string  $stars_set_ie6 set to use for rendering in ie6
string  $avg_stars_set set to use for rendering of average element
int  $avg_stars_size set size to use for rendering of average element
string  $avg_stars_set_ie6 set to use for rendering in ie6 of average element
bool  $echo echo results or return it as a string
Returns:
string html with rendered contents
gd_get_multi_set ( id  ) 

Gets the multi rating set.

Parameters:
int  $id set id
Returns:
GDMultiSingle multi rating set

is_msie6 (  ) 

Determines if the browser accessing the page is MS Internet Explorer 6.

Returns:
bool true if the browser is IE6

wp_gdsr_debug_clean (  ) 

Truncates log file to zero lenght deleting all data inside.

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

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
bool  $force force writing into debug file even if the debug directive is inactive