Many of the Theme codes includes a Template option, which allows you to choose how you want the returned information displayed. You can include HTML in the function, including (but not limited to) <ul>, <li>, <br>, and others. Each template's available tokens are listed in the function description below.
This function must be added to your comment template, after the <form> tag, before this plugin will work! There will be no way for your users to rate the posts if this function isn't in your comment template.
<?php echo frev_get_rating_fields(IPAddress); ?>
frev_get_rating_fields($_SERVER['REMOTE_ADDR']); will display the rating fields so your viewers (or members) can rate the posts.
* Note: If you have PHP 4.1.0+, use $_SERVER['REMOTE_ADDR'] If you have a lesser version, use $HTTP_SERVER_VARS['REMOTE_ADDR'] (Most servers have 4.1.0+ installed)
(IE: "5/10 people found this review useful")
Add this to your comments code, where you want the useful numbers to be displayed
<?php frev_display_useful_numbers(CommentID); ?>
frev_display_useful_numbers(get_comment_ID()); will display the useful numbers if you use this code in your comment template (The get_comment_ID() function won't work unless you use this inside a the comment area)
These functions are not necessary if your theme uses widgets. With widgets, all you really need to understand is what the Tokens do for each function
<?php frev_display_best_rated(Template, RatingCategoryName, Max); ?>
Note: The RatingCategoryName must be the exact name you entered on the plugin options page
%t - Post Title
%1 - Average Rating
%2 - Maximum Rating
frev_display_best_rated("%t (%1/%2)<br />", "Overall Rating", 5); will
display the 5 best rated posts like this:
Post Title 3 (9.7/10)
Post Title 7 (8.5/10)
Post Title 1 (8/10)
Post Title 4 (7/10)
Post Title 10 (6.9/10)
This function will display the most helpful reviews, (Based on Helpfulness votes) with the highest rated review first.
<?php frev_display_helpful_reviews(Template, Max); ?>
%t - Post Title
%n - Reviewer Name
%1 - Total Useful Votes ("Yes" Votes)
%2 - Total Votes ("Yes" and "No" Votes)
frev_display_helpful_reviews("%n on %t (%1/%2)<br />", 3); will display
the 3 most helpful reviews like this:
User Name 1 on Post Title 3 (9/10)
User Name 4 on Post Title 1 (9/10)
User Name 1 on Post Title 7 (8/10)
This function displays the posts with the most reviews - which aren't necessarily the posts with the highest ratings
<?php frev_display_most_reviewed(Template, Max); ?>
%t - Post Title
%r - Total Reviews
frev_display_most_reviewed("%t (%r)<br />", 7); will display the posts
with the most reviews like this:
Post Title 1 (57)
Post Title 7 (55)
Post Title 15 (42)
Post Title 3 (33)
Post Title 6 (32)
This function displays the members with the most reviews - who aren't necessarily the members with the most helpful reviews
<?php frev_display_top_reviewers(Template, Max); ?>
%n - Member Name
%r - Total Number Of Reviews
frev_display_top_reviewers("%n (%r)<br />", 8) will display the users
with the most reviews like this:
User Name 7 (17)
User Name 12 (15)
User Name 3 (11)
User Name 1 (10)
User Name 5 (9)
User Name 6 (9)
User Name 9 (9)
User Name 13 (5)
This function is still provided for legacy support, but its' functionality is provided in most themes, so it's proably not necessary to use anymore. The Max parameter does nothing any longer.
<?php frev_display_most_cats(Template, Max); ?>
%c - Category Name
%n - Category Count (# of posts in the category)
%d - Category Description
frev_display_most_cats("%c<br />"); will display all of your categories, each on it's own line like this:
Category 1
Category 2
Cateogry 3
Category 4
Category 5
If you have set the "Automatically Embed Submitted Ratings Within Displayed Comments?" option to "No" then you can manually display a commenter's ratings for a post within the comment itself by using this function:
<?php frev_get_comment_ratings(CommentID[, template]); ?>
frev_get_comment_ratings(get_comment_ID()); will display the average rating for this comment, using the template you specify in the "HTML Template To Display The Rating In A Comment" field in the options menu
You can also include an optional template value if you don't want to use the default template to display this rating.
%c - Rating Category
%r - Rating
frev_get_comment_ratings(get_comment_ID(), "<div>%c - %r</div><br />"); will return
HTML like this: <div>Rating Category - 8.5/10</div><br />
(Or, if you set the plugin to display in-comment ratings as images, it will display 8.5/10 images,
instead of "8.5/10")
If you have set the "Automatically Embed Average Ratings Within Post Text?" option to "No" then you can manually display the average ratings within a post by using this function. You can also use this function with the option set to "Yes" if you want to highlight a certain rating, such as "Overall Rating", elsewhere in the post
<?php frev_display_post_ratings(PostID, RatingCategoryName); ?>
frev_display_post_ratings($post->ID, "Ease Of Use"); will display the average "Ease Of Use" value for this post, using the template you specify in the "HTML Template To Display The Rating In A Post" field in the options menu
You can also include an optional template value if you don't want to use the default template to display this rating.
%c - Rating Category
%r - Rating
frev_display_post_ratings($post->ID, "Ease Of Use", "<h3>%c:</h3> %r<br />");
will return HTML like this: <h3>Ease Of Use:</h3> 8.5/10<br />
(Or, if you set the plugin to display ratings as images, it will display 8.5/10 images,
instead of "8.5/10")