Source bench WordPress plugin allows you to turn your blog into a powerful review engine.
This Version: 1.1 released on 22/08/2007
Download: [@todo] link
Version 1.1
This plugin is released under the [@todo] Creative Commons Attribution-ShareAlike License. It is free for personal and commercial use as long as you maintain a link to this site as the original author within the code’s comments.
You can see this plugin in action at Ultimate freelancing job sites. Please don’t submit fake reviews just to test the plugin.
Inspiration
@todo why this. what used as source
Features
- Define categories of ratings you wish to collect. Rating is from 1 to maximum that you define. Setting minimum doesn't make much sense.
- Modify the order in which rating categories appear.
- Globally enable/dispable plugin per wordpress category
- Enable/disable given rating category per wordpress category
- Set weight of each rating category per wordpress category. For example one rating category has more importance in given wordpress category..and less in other.
- Set description per wordpress / rating category pair.
- There is default template initially used by all rating categories. Can define additional templates for display and set it wordpress category based.
- Collect ratings along with every new comment.
- Recalculating ratings on deleting comments
- Display ratings collected for each comment.
- Display average rating from all collected ratings for a post.
- Display the number of positive or negative ratings for each post (based on weight of rating categories).
- Display post score rating. Weighted avarage of all ratings to use as ultimate rate for a post. Uses meta store, hence is much faster as calculation is made on comment added and not each user request.
- Manage rating categories easily from your WordPress admin options tab.
- Define HTML to appear before and after rating labels and inputs easily from your WordPress admin options tab — no complicated function arguments.
- Drop-in to any existing blog to add ratings. Simply doesn’t display anything for comments or posts that didn’t include ratings.
- Flexible enough to be used as a post rating system, or to drive an entire rating & review site built on WordPress, depending entirely on how you customize the output.
- Fixed some XSS and slashes issues with original plugin
Installation
To install [@todo]DG-Review-Site, download the plugin from the link at the top of this page, and save it. Upload this to your WordPress plugins directory (usually wp-content/plugins). Then go to the Plugins tab in your WordPress administration area and click the Activate link next to [@todo] “DG Review Site”. The necessary database tables will be created automatically.
Important: You must add the rating input fields and post total score to your comments and posts respectively manually. There is no WordPress hook that allows this to be done automatically. It is the first code snippet below. The auto-embed option takes care of everything else.
Add Rating Inputs To Comments:
To add the set of labels and selection lists to collect ratings, edit your comments.php template and add this code beneath where the name, mail and website are collected:
<?php echo sb_get_rating_fields(); ?>
Additional Templating Functions Available
If you choose to disable auto-embed, you can use these functions to add the collected ratings and reviews to your comments and posts.
Display Ratings With Each Comment:
To display the ratings a commentor entered with their comment, edit your comments.php template and add this code within the main loop which displays each comment (you’ll see foreach ($comments as $comment)):
<?php echo sb_get_comment_ratings($comment->comment_ID); ?>
Display Number of Positive or Negative Reviews for a Post:
You can add this value anywhere posts are shown — the main loop of your index or archive pages, or the single post page, just make sure it’s somewhere within the loop (after the_post()):
Number of Positive Ratings:
<?php echo sb_get_post_negative_positive_ratings($post->ID,'positive'); ?>Number of Negative Ratings:
<?php echo sb_get_post_negative_positive_ratings($post->ID,'negative'); ?>
Display the Average Ratings For Each Category For a Post:
To display the average ratings for all the categories you’ve defined for a specific post, just like the positive and negative counts, add this code anywhere a post is displayed:
<?php echo sb_display_post_ratings($post->ID); ?>
That will display the categories and average ratings in your specified order as list items. For even more presentational control, you can get the data back as an array you can display yourself:
<?php $ratings = sb_get_post_ratings($post->ID); ?>
The $ratings array will be keyed by your categories, with the values being the average rating for that category.
Display total score for a Post:
To display the total score for a post you , add this code anywhere a post is displayed:
<?php echo sb_get_post_meta_total_score($post->ID); ?>
That will display total weighted avarage per post. Taking in consideration weighted avarages of each rating categories. Single unit the rates your post.
TODO[@todo]
Few words about restriction that gets only one wp-cat per post and comment.
Add few word about this sb_usestars() function
Replace dull drodowns with stars. Much cooler :)