Wordpress review plugin (SB_Review)
This WordPress plugin allows you to turn your blog into a powerful review engine and gives your visitors the chance to rate your entries based on various categories. Also it includes some basic fraud protection to ensure the same visitor does not rate multiple times on a post but still can post comments. The overall score of a post is stored as custom field within each post which allows custom queries to be made in order to display highest rated lists or simply sort the posts by their rating. It's still very basic but shall be improved with the time.
If you like it, feel free to leave a comment or send us your improvement requests. If you use the script in your blog please submit your url here so we have an overview of the users and can help to improve this script.
Get it!
This Version: 0.9 beta released on 22/08/2007
Download: download sb_review-0.9.tar.gz
latest Version 0.9 beta
License
This plugin is released under the 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.
Screenshots
You can see this plugin in action at Ultimate freelancing job sites. Please don’t submit fake reviews just to test the plugin.
Inspiration
For our review section within the sourcebench project we were searching for a suitable plugin and ran into wp-dg-review-site by Dan Grossman who did a great job and the foundation of this script. But as we were out for more, we had to extend his script a bit to make it possible to have different rating categories and designs. Also we wanted a star based rating system for our project and needed to ensure that the same visitors can not vote multiple times on the same topic. So SB_Review was born and a first beta release was created.
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.
- Very basic fraud prevention.
- 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 SB_Review, 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 “SB_Review”. 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.
Enable star based visualization:
It is possible to change the number based visualization into nice, fancy stars. In order to do this the functions sb_get_comment_ratings() and sb_display_post_ratings() accept an additional parameter that if set to "true" will display stars instead of numbers.
TODO
- Making the whole thing category based comes with a small restriction. Each post can be only in one category otherwise the script will pick the first category in the list to determine the wordpress category of the post. Maybe we can solve this somehow but for now this is how it is.
- Replace dull drodowns with stars. Much cooler :)
- Increase fraud protection
121 comments to “Wordpress review plugin (SB_Review)”
[…] SB_Review WordPress plugin allows you to turn your blog into a powerful review engine and gives your visitors […]
This is great what you have done. How about having a function like amazon where you can vote if the review has helped you. So above each review post there is “x out of y found this review useful”. I believe this would be a great improvement and its also something that I am looking for
hi nightvision, this idea is pretty good. will keep this under consideration for the next version
What a great improvement! I’m going to test this!
I still miss the feature though that you just can comment, and not are obligated to rate. Maybe a built-in AJAX slider to show/hide rating option?
And instead of the dropdown boxes, the more fancy AJAX stars rating system (like http://lesterchan.net/wordpress/category/plugins/wp-postratings/ ) would also be great!
So, what is the exact parameter to enable the Star Based Visualization. Please advise if you can. Thanks.
In order to enable star based rating visualization the functions sb_get_comment_ratings() and sb_display_post_ratings() accept an additional parameter that if set to “true” will display stars instead of numbers.
this would be
<? echo sb_display_post_ratings($post->ID,true); ?>
I am having a small issue with using Spam Karma along with this plugin.
If a comment gets placed into moderation it seems like the ratings are stripped from the comment, even if I approve the comment in wp-admin.
Any way to get around this (apart from turning off Spam Karma)?
I can’t get this working at all.
I copied the folder into my plugins directory, then copied in comments.php below the url input field.
What am I missing? Is there a recommended template, or incompatible plugins?
I meant to say I copied the php snippet into the comments.php below the url input field.
Nevermind, I didn’t realize that the ratings input only shows up for new posts.
bigb: look at this comment… if it does not help let me know. i wrote you an email already.
One more question??
What is your code’s criteria for a ‘negative review’?
No matter what I do, even if I give it all 1s, it comes out as ‘postive’
Here is my test page:
http://www.ski-resorts.ca/blog/2007/09/08/fernie-alpine-resort-british-columbia/
Thanks - the advise in adding the ‘true’ parameter made the stars work perfectly.
Thanks kingo.
I don’t see the ratings input when I’m logged in, only comment textbox. My users will have to log out before they can rate another post. How do I fix this?
I’m clearly missing something but i’m not able to get this working.
I added the line in comments.php but nothing is showing up. When I check the source it even doesn’t show up! When I disable all my plugins instead of this one, still nothing is showing up. And when I finally dropped all the tables of my database still nothing is showing up…
What goes wrong here? Is it K2 maybe?
bigb: this behaviour is actually intended. it is made like this to prevent the same people rating over and over again on the same post.
jeroen: are you sure you enabled comments for the post at all?
Jeroen- i had the same issue. after enabling plugin, define your rating categories under options->sb rating.
I can’t get the stars working. Which file should I put the stars snippet in?
ID,true); ? >
Okay, for some reason I can’t even get this to show up in my plugins admin. I put it with the other plugins but it’s not showing up. The others are .php and that’s the only thing I can see that is different.
Any ideas on what may be wrong? This is a great plugin and I can’t wait to use it!
heather: have a look at your permissions. i ran into this whenever the directory and the files within were not having permissions that are readable for my webserver. usually chmod 755 is good for directories and 644 is working for files. also make sure the owner is the same as for your already working logins
All of that is set correctly. Permissions are as you suggested. It’s strange because I’ve never had this happen before.
Any other suggestions?
bigb: ok…it seems the star rating is an ongoing problem. as mentioned above a couple of times the functions sb_get_comment_ratings() and sb_display_post_ratings() accept an additional parameter. so if you want star based visualization of the rating the only thing you have to do is to put “true” as second parameter.
ie. if you have sb_get_comment_ratings($post->ID) in your single.php so far then you just replace it with sb_get_comment_ratings($post->ID,true) and the visualization of the rating will be star based.
thanks wanagi. i followed your instructions but only see question marks instead of stars.
bigb: can you point me the url to your installation. this sounds like the graphics for the stars are just not found.
How do you have the ratings default to 5 instead of 1? I wish it could default to nothing to MAKE the person actually rank it because people sometimes look over the ranking part. Can you make it default to ‘blank’ and make the person vote before the comment is accepted?
Still have one outstanding question?
No matter how bad a rating I submit using your script, it will never rate it as negative??
Can you check that positive/negative function and make sure its working the way it should? Even if I rate something with 1s across the board, it still comes out as a ‘positive’ rating?
Thanks in advance!
Same thing is happening on your site - i just posted a low rating for one of your freelancer sites and it still came out positive:
Hi,
Awesome plugin - I’m just having a few issues with it.
Main problem seems to be getting the stars to show up. Even when I use
ID,true); ?>
or something else like it no stars show up.
I’m hoping you can point me in the right direction.
Regards
Hi,
This is an awesome plugin, which I got to work for one post until it stopped displaying ratings. Can anyone help please? I pasted in my comment file, which shows the drop-down ratings below the comment box — that works fine. Then, I pasted ID, true); ?> into my post file (single.php), but nothing shows up when I rate the post — even a new post doesn’t show numbers or stars. I defined everything in the SB rating WP tab (options panel) and hooked it up to the appropriate category. Did I miss anything?
sorry for the double-post… didn’t realize you can’t paste code snippets in here
mike: i sent you an email. no need for donations although they are well received :) just a bit busy around here :)
[…] zou ik toch bijna nog een andere plugindevelopment vergeten; SB_review. Dit is een vervolg op Dan Grossmans DG Review Site plugin. Goede ontwikkeling. Werkt alleen nog […]
Hey, could you please mail me with the instructions on how to use this plugin with wordpress 2.3 because it won’t worl :(
THX!
I have been looking for plugins like this for a while : p
I am now trying to do two modifications to better fit my needs.
1. Optional comment area for every specific rating category.
(it will keep the original comments as an overall opinion and allow user to comment on specific areas follow behind their ratings.)
2. Make specific ratings categories optional and doesn’t include in overall ratings.
(I need a lot of rating categories and it’s difficult to just assigning each combination into categories.)
Since I’m a beginner in PHP (and SQL), I haven’t been able to put any of them into work. So, it will be great that if you can put these function into consideration of future builds. (or some hint on these)
Thanks
—————————–
To lef:
I tried this plugin on a clean install of wordpress 2.3 and it works just fine. Could you specific your problem?
Installed plugin and added required code to commments.php. Have a couple of error problems and plugin doesn’t work in displaying any ratings at all. I’m using WP 2.2.2 with some of the following plugins (which may affect the comments area): Captcha from ProtectWebForm, Sociable, Tagalize It, Ultimate Tag Warrior & What Would Seth Godin Do?. For my tests auto embed was Yes for both selections.
* The ratings drop down lists on the Comments form for each show only for Posts not Pages. Can Pages be activated?
* When I submit a Comment I get an error page. The comment is recorded when I check later but no ratings show for it. I can send the error page if I know where to email or pm it.
The error first says “Warning: mysql_query() [function.mysql-query]: Access denied for user ‘bikingtr’@'localhost’ (using password: NO) in /home/bikingtr/public_html/wp-content/plugins/sb_review/sb_review.php on line 125″
Maybe I missed a setting in WP as this is for a brand new blog.
* No ratings show for comments or posts or pages when submitted. Anywhere. I use auto embed. DO I have to add all those extra lines of code above even with auto embed one.
Sorry, I’m rather confused with this one as most plugins and themes usually work for me in WP. Any help would be appreciated.
Can someone send me detailed steps to get this to work?
I’ve tried it multiple times but it doesn’t show up.
Thanks in advance.
Hello,
Thanks for this awesome plugin!
I have one question: how do you display a ranking of the top reviews on your site like you have on the freelancer site?
What I want to do is display a box that says something like : “Best Sites” and have a toplist according to overall score.
Thanks again!
Awesome! I was hoping someone would make a mod to Dan’s Review plugin to allow only selected posts to have ratings. Thank you!! I just put it up here: http://www.yangtown.com/product-reviews/review-of-ideagasms-girlfriend-training-program/
and it’s been working great. I thought it wouldn’t work until I noticed that I had to activate the category in the options menu.
One feature that I would like to have is to have the default rating be blank in case a reviewer forgets to put it in, or to make the rating required.
Cheers, Ryan
Wondering how to get the stars in the comments, im not sure where they go… tried everything to get them actually in the comments without using the embed enabled.
Never mind, i managed it using this
comment_ID,true); ?>
So if anyone else needs it.
Ok I got it installed but I don’t get what I am to type into the sb page can someone walk me through this process… the instructions are a little vague for someone who has now idea what goes in each little box… maybe an example or a screenshot of what it is meant to look like? Anything really! Love the plugin and dying to try it out just confused on what information to input.. sorry to be vague I just want to use the plugin within one category on my website.
Thank you to anyone that can help the non techie person!
K: actually you need to tame it a bit with a custom query.
i send you a mail with details
Hey there,
Great plugin =)
I was wondering that same thing, how to get a Top 20 list. Is there any way you could post the query script mentioned above on this page? (an example script maybe.)
Thanks =)
Nice upgrade to the original plugin, i will be installing this soon.
Any chance of adding a mod so that people can opt out of leaving a review? For example if the author replied to a comment or review?
Will donate for response :)
(and even if there is no response, just because I love the plugin)
But the donation will come sooner otherwise!
Thank you again !!!
About the top lists…. I am achieving this with a custom query. Sadly there is no other way.
The query I use on my top20 page is
$querystrtop20 = "
SELECT $wpdb->posts.*
FROM $wpdb->posts
LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id)
LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id)
WHERE $wpdb->posts.post_status = 'publish'
AND $wpdb->posts.post_type = 'post'
AND $wpdb->post2cat.category_id IN ($catid)
AND $wpdb->postmeta.meta_key = 'sb_post_rating'
GROUP BY $wpdb->posts.ID
ORDER BY $wpdb->postmeta.meta_value DESC
LIMIT 0,20
";
$top20 = $wpdb->get_results($querystrtop20, OBJECT);
This can be used within the template and if you combine it with something like
<!– top 20 –>
<?php if ($top20): ?>
<div class="wide">
<h2>The current top 20</h2>
<ol>
<?php foreach ($top20 as $post): ?>
<?php setup_postdata($post); ?>
<li><a href="<?php the_permalink() ? rel="nofollow">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a> with <? echo sb_get_post_total_score_rating($post->ID); ?> benchmarks in <?php UTW_ShowTagsForCurrentPost("commalist") ?></li>
<?php endforeach; ?>
</ol>
</div>
<?php endif; ?>
<!– end top 20 –>
you end up with a top20 list.
If you need more details give me a note and we can discuss this.
It makes a good deal of sense to me, but so you know I got a parse error at SELECT $wpdb->posts.* that I am still trying to debug. Quite frankly, I don’t know what it is, or if it is simply my fault. Any input?
Ah! Found it.
It didn’t work because when you entered the quote into the comment field it changed the quotes. The quotes above aren’t UTF-8 and cause a parse error.
Just do a quick S&R for all the opening and closing single/double quotes to the UTF-8 double/single quotes and it’ll work. Or better yet, provide the above code in a text-area or ‘code’ block.
Thanks again! A donation will follow shortly. =)
Another note, that custom query wouldn’t be compatible with newer versions of Wordpress (I think 2.3) because the ‘post2cat’ table was depreciated and replaced with a ‘taxonomy’ table so that an internal tagging engine could be added. =)
yes…this is true…. i know about this but with my version still goes fine
Here is the WP 2.3 custom query for a top list.
NOTES:
1) When you copy and paste this code, the double/single quotes will need to be replaced with UTF-8 chars!!!!
2) This is only compatible with 2.3+!!!!
3) You can make it top whatever you want..
4) $catid is the ID of the current category (for if you have multiple ‘review categories’) this can be static or dynamic.
2.3 Top 10, 15, 20, 87, w/e…
SELECT wp_posts.*
FROM wp_posts
LEFT JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id)
LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE wp_posts.post_status = ‘publish’
AND wp_posts.post_type = ‘post’
AND wp_term_relationships.term_taxonomy_id IN (’$catid’)
AND wp_postmeta.meta_key = ’sb_post_rating’
GROUP BY wp_posts.ID
ORDER BY wp_postmeta.meta_value DESC
LIMIT 0,20
Enjoy!
Very cool plugin. But I have an issue Kingco had some posts back, no matter how low I rate something it gives me a positive rating. I see on your freelancers site it seems to work properly.
Any help would be great!
Thanks
Hi Wanagi,
I am having the same problem as kingco. Every review is counting as a positive review.
Please help.
Hi all,
we’ve been a bit busy lately but we will soon release a new version that should solve this problems. Thanks for all that are supporting this plugin and help us improve it with their feedback.
After install, go to options SB review and get this:
disabled most all other plug-ins and still get.
Any ideas?
Fatal error: Call to undefined function: get_categories() in /home/marshf86/public_html/wp-content/plugins/sb_review/sb_functions.php on line 58
Can’t wait for the new version. :-) I know you’re busy but can you give a rough release date?
Thankyou for this plugin, i just finished creating an amazing looking website with ratings and great appeal. could not of done it without this plugin.
Please help me with the plogin install.
is there only one .gz file to download and to upload?
I upload the sb_review-0.9.tar.gz file but it’s not in my Plugins tab in wp-admin, my other plugin does show up normally, pls help
The algorithm for “sb_get_post_negative_positive_ratings” is off, as mentioned many times above. I still haven’t figured out how the algorithm works, some enlightenment on the strategy could lead me to a solution however. Any information would help greatly…
Hi
Great plugin, it work like a charm on my site. I wonder how I can get a heading to show if there is any ratings, I tried this but no luck
$norating = sb_display_post_ratings($post->ID);
if ($norating == null) {
echo ‘‘;
} else {
echo ’show heading’;
}
Hi. We’ve upgraded our professionnal blog today after having tested it there : beta.datingwatch.org. On the test subdomain, everything worked well with SB_Review, so we installed the new template and SB_Review on the main site. And, I don’t know why, it didn’t work. Everything was set up the same. I’ve tried many things, I even upgraded wordpress to version 2.3.2, and i’ve got this error :
Warning: mysql_query() [function.mysql-query]: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) in /home/.drysdale/datingwatch/datingwatch.org/wp-content/plugins/sb_review/sb_review.php on line 125
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/.drysdale/datingwatch/datingwatch.org/wp-content/plugins/sb_review/sb_review.php on line 125
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/.drysdale/datingwatch/datingwatch.org/wp-content/plugins/sb_review/sb_review.php on line 423
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/.drysdale/datingwatch/datingwatch.org/wp-content/plugins/sb_review/sb_review.php on line 424
Warning: Cannot modify header information - headers already sent by (output started at /home/.drysdale/datingwatch/datingwatch.org/wp-content/plugins/sb_review/sb_review.php:424) in /home/.drysdale/datingwatch/datingwatch.org/wp-includes/pluggable.php on line 391
you can test it there if you want : http://www.datingwatch.org/category/comparatif/ (just click on one of the logos, when ratings work, it makes a comparative table).
Of course, as show the error, ratings are not saved into the DB.
I must say I do not have any clue about what the problem can be.
I must say I’ve modified just a little your script to have a javascript star input (I just replaced select boxes with radio buttons and used jquery star rating plugin, which replaces radio buttons).
So if you can help me, it would be great, you’re plugin is exactly what i was looking for.
Thanks a lot,
Julien Marie
Problem fixed once I upgraded to WP 2.3 Works great now and have it working here if want to have a look:
http://weightlossproductscompared.com
Am also looking for genuine reviews if anyone has tried any of these weight loss products.
One question: Is is easy to have the results sort to put the highest ranking reviews up top?
Thanks! Awesome plug in!
Wayne
Very excited to see an update to this plugin!
I may tinker with it in the meantime, but thanks for your efforts.
Awesome Plug-in!!! Took me a little while to get the stars and the average sections working correctly(probably because I am a .php noob). I am using on it my website for my friends and I to submit restuarant reviews and so far it has worked perfectly! Thanks, SB! You guys are great! Check it out here:
www.adam-richard.com/category/restaurant-review
If anyone needs/wants help installing this onto there wordpress setup and just can not figure it out. Let me know and I will install it for you. Just get my contact information from my website. (listed above)
I think others may have asked, but I’ll ask again since I haven’t seen an answer: is it possible to have the default rating be blank, instead of 1? I am setting the plugin up on my site so that certain categories have multiple rating options, some of which most people would not have the necessary knowledge to rate intelligently. I’d prefer they didn’t have to submit a rating at all when that is the case.
Also, would anyone know how to go about replacing the pulldown rating menu with a graphical star rating instead? (i.e. 5 blank stars are shown and they mouse over how ever many stars they wish to rate it)
Thanks
Is there a way to place the average ratings into the middle of a post text?
I’m setting up a ratings site and would like to have the average ratings appear in a blockquote within my post text rather than the default embed option which places the ratings at the end of your post.
I’d like to be able to enable star visualizations while displaying the total score for a post. How would I go about doing this?
Testing the script out, and a rating of 4 out of 5 comes up as a negative. How do I fix this so that anything 3 or higher = a positive rating?
Thanks.
Hi Wanagi,
Still waiting on the new release? :) Can you give us a release date?
Thanks.
Is this broken in WP 2.3? I have a brand new install in a test site (test.phillyrestaurantreview.com) and I can’t get it working…
I have the sb_get_rating_fields php call both inside the “endif” for comments and outside the “endif” and it’s not displaying the SB stuff.
Any ideas?
Anyone want to hazard a guess as to why Wordpress categories would not be showing up in the SB Rating configuration admin for me? I’m using WP 2.3.3
Nevermind, I figured it out. Just in case anyone else runs against this problem, you just need to create a post. It is using get_categories() to make a list of WP cats, and get_categories()defaults to hiding empty categories.
You could also change line 58 of sb_functions.php to read:
$categories = get_categories(’hide_empty=0′);
which is what I did.
There is only the file sb_review-0.9.tar.gz to download. Is this all that needs to be downloaded because it doest show in my plugins folder.
Would really appreciate some help.
ok i figured out i needed to use another program to unzip the file. Have activated it and followed all of the instructions but its still not showing on my site. Does it matter what version of wordpress im running?
I have uploaded/installed, activated it and added the code to the comments file, but nothing shows up
Did there ever appear a fix to this issue ?
Ok, its there now, but after making a comment its gone. I guess thats how its supposed to work right ?
[…] make it look really good, but before I started with that I found an update of this plugin made by sourcebench.com (based of Dan’s […]
Im on 2.3.3 but this query
SELECT wp_posts.*
FROM wp_posts
LEFT JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id)
LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE wp_posts.post_status = ‘publish’
AND wp_posts.post_type = ‘post’
AND wp_term_relationships.term_taxonomy_id IN (’$catid’)
AND wp_postmeta.meta_key = ’sb_post_rating’
GROUP BY wp_posts.ID
ORDER BY wp_postmeta.meta_value DESC
LIMIT 0,20
dont give me any results even I have comments on the posts with ratings
I have carefuly followed these posts and I know I’m close. I cant get my top 20 to work. This is what I’ve placed on my page:
get_results($querystrtop20, OBJECT);
?>
The current top 20 reviews
ID); ?> pepper rating in
Can anyone help?
This is what I have placed on my page. I have not had any success with top 20.
get_results($querystrtop20, OBJECT);
?>
The current top 20 reviews
with a
ID); ?>
Any help is greatly appreciated. Thanks.
previous post didn’t show the code. I’ll try again:
?php
$querystrtop20 = “
SELECT wp_posts . *
FROM wp_posts
LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )
LEFT JOIN wp_term_relationships ON ( wp_posts.ID = wp_term_relationships.object_id )
WHERE wp_posts.post_status = ‘publish’
AND wp_posts.post_type = ‘post’
AND wp_term_relationships.term_taxonomy_id
IN (
‘$catid’
)
AND wp_postmeta.meta_key = ’sb_post_rating’
GROUP BY wp_posts.ID
ORDER BY wp_postmeta.meta_value DESC
LIMIT 0 , 20
“;
$top20 = $wpdb->get_results($querystrtop20, OBJECT);
?
?php if ($top20): ?
div
h2 The current top 20 reviews /h2
ol
?php foreach ($top20 as $post): ?
?php setup_postdata($post); ?
li ?php the_title(); ? with a
? echo sb_get_post_total_score_rating($post->ID); ? /li
?php endforeach; ?
/ol
/div
?php endif; ?
Just found this script! Looks to do exactly what I want. I’ll be giving it a go in the near future.
This in a nutshell is what im trying to do. Have a txt link on a page that sends me to a post which you review. Im trying to send back the data of the post review (how many review, positive & negative) back to the txt link on the 1st page.
I’m running exec-php on the page with “ID); ?>”
I thought i could relay the post data to page by changing the ID? Am i losing it? can this be done?
I’m trying to turn off the auto embed for the ratings but it isn’t working in admin page. How can i do this through the code? I’m also still having problems with the positive and negative codes, is this all i put in?
ID,’positive’);?>
ID,’negative’); ?>
it is only showing this - 00
Saw this following a link from a forum I regularly use. Exactly what I’m looking for - thanks.
This is great but I have a small issue… when I click on a category on the site and it comes up with the individual posts listed (with a small snippet for each post) I want to stick the Average Rating also there with the small snippet… but I cannot locate which file looks after this. Any ideas?
Thanks!
Join my wordpress site and lets discuss further development of this module :)
Cheers
The plugin is just what I’ve been looking for.
But the thing is that I can’t get it work. And, yes, I really don’t know much about php.
I followed though the instructions above and added the code snippet in comments.php. Nothing happens in new posts nor in old posts.
Help would be much appreciated. I’m using WP 2.5.1.
Is there anyway to turn off the category feature? I want the review feature on every post regardless of category.
Hi there,
First of all; great plugin, ty…
I was wondering how to style the output better to my wishes. Right now I used a class on the output , so the layout is much better when displayed in a comment.
I was however wondering how I can alter the output more. What I would like to see is the output being displayed as a three column layout. The first column with the desciptions, the second with only ‘:’ and the third with the stars.
Right now the complete line of tekst (description and stars) are all in one single , and because of this I cannot style the output better. I am not a css wizzard, but perhaps somebody can help me out a bit?
A second question is related to the negative and positive reviews. In the installer I did not find the + and - bullets. When I activate the extra features, the result is plain tekst.
So in my blog I see:
Title: Title of the review
Text: Here the review
3 0
3.22
* Price / Quality: xxxxx
* Service: xxxxx
* Location: xxxxx
* Breakfast: xxxxx
* Rooms: xxxxx
* Overall: xxxxx
As you can see, there are 3 positive reviews and 0 negative ones. De average is also displayed as a number. Does anybody know where I can style this with some extra text?
It should be:
3 positive reviews - 0 negative reviews
Average score for this hotel: 3.22 (based on 3 reviews)
I saw this in this comment here: http://www.sourcebench.com/toolbox/sb_review-wordpress-review-plugin/#comment-71
How can I make this happen? How can I add the + and - icons. And also, how can I add the part ‘based on x reviews’, where this represents the amount of comments (review).
Thank you very much.
Edit:
I already figured out how to add the plain text and icons. Just op single.php and add the text before or after the php lines related to this script (the ones that you added manually).
Stil leaves me with the other questions:
1) How to style the layout of the reviews
2) How to add the ‘based on x reviews’ part
Where do I find the comments.php file? It seems that my WP doesn’t have that file. I don’t know where to insert the “” string. Can anyone tell me?
What else should i say? great plugin. filled the holes Dan’d left in it.
i have tried to get it work on wp 2.2. everything goes well except the “top 20″ thing. i put this code in the sidebar:
posts.*
FROM $wpdb->posts
LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id)
LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id)
WHERE $wpdb->posts.post_status = ‘publish’
AND $wpdb->posts.post_type = ‘post’
AND $wpdb->post2cat.category_id IN (’$catid’)
AND $wpdb->postmeta.meta_key = ’sb_post_rating’
GROUP BY $wpdb->posts.ID
ORDER BY $wpdb->postmeta.meta_value DESC
LIMIT 0,20
“;
$top20 = $wpdb->get_results($querystrtop20, OBJECT); ?>
The current top 20 reviews
with a
ID); ?>
but did nothing. missed something?
[…] Sourcebench has got what seems to be a nice Wordpress Review Plugin. Users can leave comments with multiple star ratings. Potentially very useful. Tags: Wordpress […]
Hi
after i updated my wordpress version to 2.51
this
is not returning any thing it was working i don’t know what went wrong plugin is working not trowing any error but neither showing the fields
please help me
Hi!
brilliant plugin, but any ideas if a new version will be out shortly to fix the items on the TODO list?
cheers!
This plugin is exactly what I was looking for. I had Dan Grossmans plugin first and working but I wanted to display stars for the rating. I am using this plugin to rate schools. I deactivated his plugin and activated yours and replaced the appropriate function calls in the comments.php and single.php since I am not using the automatic embedding. I cannot get this plugin to display the rating input code in comments or any rating at all. Any help would be greatly appreciated.
Never mind. I finally got the options set so that it works as I had hoped. I did have problems enable by category section. It is not very clear and it only allows selection of one category. I went in to the database and edited it there to get more than one category enabled and now it works fine. Thank you for this plugin it really helps.
Hi, cant get this working at all, not one cent, was using Comment Karma ok, and WP-PostRatings, figured id use this instead of either of them, but it just wont work, followed the instructions, read the other queries/comments, to be honest i dont understand what is meant to go in the options within wordpress, under Review Site General Configuration. I assumed this was atuo unless we specified otherwise, and then laid in seperateparameters for each. This is killing me here…
this bs is giving me a headache, the instructions for this are poor for the clueless drag and dropers…no help whatsoever,
[…] searching for a way to gather some user feedback for new features of our wordpress review plugin sb_review, I came up with the idea of using digg as a platform that will allow my users and other interested […]
Good news - we are planning a new version of this plugin and need your help. Please follow this post on digg and submit your ideas for features and improvements in form of comments to this post.
Feel free to vote existing comments up or down to share your opinion.

















