Location: PHPKode > scripts > Post Ratings > post-ratings/readme.txt
=== Post Ratings ===
Contributors: digitalnature
Support link: http://digitalnature.eu/forum/plugins/post-ratings/
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8UA4ZYEYUQTHA
Tags: ajax, post, rating, simple, jquery, vote, widget
Requires at least: 3.2
Tested up to: 3.3.2
Stable tag: Trunk
License: GPLv2 or later   

Simple, developer-friendly, straightforward post rating plugin. Relies on post meta to store avg. rating / vote count.

== Description ==

What does this plugin do:

* Allow your site users to rate posts (of any kind)
* Display the average post rating, vote count or weighted (bayesian) rating within your posts
* Display a widget with the top rated posts in your sidebar
* Allow you to create your own rating formula

Why another rating plugin? Because the existing ones are either outdated, bloated with useless functionality, or just too buggy :)

== Installation ==

Activate the plugin, and set it up as you wish from the Options dashboard menu

== Frequently Asked Questions ==

= How does this plugin log votes? =

Basic check trough cookies, IP match against a limited transient-cached IP list, and user meta records (if registration-only ratings are enabled). If any of these checks fail the user is not allowed to rate.

= How do I change the stars, CSS and the HTML generated by this plugin? =

Simply create your own styles and drop them inside a file called post-ratings.css in your theme or child theme folder.
Use the original styles as reference if you're doing minor changes.

If you want to change the HTML mark-up for the ratings create a "post-ratings-control.php" template within your theme folder.
Check out the original template from this package for help on how to edit it.

= How do I manually display the rating links where I want? =

Either fill the custom filter field with your own action tag in the plugin settings, or use  the `[rate]` shortcode. If you want to do this within template files, you can manually echo `PostRatings()->getControl();`

= How do I manually get the most rated posts using PHP? =

  `$posts = PostRatings()->getTopRated($arguments);`

Possible arguments, and their defaults:

    'post_type`    => 'post',
    'number'       => 10,                   // max. number of posts to retrieve
    'offset'       => 0,                    // offset from where to start
    'sortby'       => 'bayesian_rating',    // bayesian_rating, rating or votes
    'order'        => 'DESC',               // ASC or DESC
    'date_limit'   => 0,                    // date limit in days

Return value is an array of post objects containing the usual post properties + 3 extra properties:

    $post->votes                            // number of votes
    $post->rating                           // average rating
    $post->bayesian_rating                  // weighted rating

Example usage:

    global $post;
    $results = PostRatings()->getTopRated();

    foreach($results as $post){
      setup_postdata($post); ?>

      // here is the usual loop
      <?php the_title(); ?> - <?php printf(_n('%d vote', '%d votes', $post->votes), $post->votes); ?>

      <?php
    }

    // restore original post
    wp_reset_postdata();




== Changelog ==

= 2.4 =
* Added Slovak translation, tx Martin
* Fixed wrong path to .mo/.po files
* Added wrapper for current_user_can (experimental), eg. current_user_can('rate', $post_id)

= 2.3 =
* Added support for proxies that send the client IP
* Fixed a bug in the template loader, tx @ Spencer
* Fixed a bug with the transient post limit checks
* Added German translations (tx Thorsten) and fixed a possible localization issue

= 2.2 =
* The rating control (HTML) can now be fully customized trough the "post-ratings-control.php" template (create one inside your theme)
* Removed the formatRatingsMeta method, as it's now unnecessary
* Fixed a compatibility issue with certain PHP setups

= 2.1 =
* Fixed issue on widgets page from 2.0

= 2.0 =
* Fixed buggy rating records on multisite
* Themes can now override default CSS, if post-ratings.css is present in the theme dir

= 1.9 =
* Added cache flush triggers
* Decreased the_content filter priority to accomodate plugins that don't handle excerpts correctly
* Added CPT support for the "archives" page visibility setting
* Fixed an issue with duplicate user rated posts ID records

= 1.8 =
* Fixed an issue with the shortcode (not being displayed in certain situations)
* Added "force" argument to the shortcode; if present, page visibility setting is ignored

= 1.7 =
* Support for Google Rich Snippets, using microformats mark-up; note that this can only work on singular pages!

= 1.6 =
* Added a few filter tags (and a javascript event on succesful rate), so the output can be easily changed

= 1.5 =
* Fixed a js issue with voting introduced by mistake in 1.4
* Some updates to the Atom widget code (as Atom Widget API changed)

= 1.4 =
* Fixed 2 bugs related to Atom-based themes

= 1.3 =
* Fixed bug in which the user formula wasn't working outside the widget
* Fixed an issue where under certain conditions pages would be empty
* Added some API info the FAQ

= 1.2 =
* Added the ability to use a custom bayesian formula
* Made the IMDB rating formula as default
* Fixed some localization inconsistencies on the Atom widget

= 1.1 =
* Added Atom widget (replaces the default widget if the site runs on an Atom theme)
* Fixed javascript error when running non-Atom 2+ themes

= 1.0 =
* First public release.

== Screenshots ==

1. Plugin options
2. Rating controls in the front-end
3. "Top Rated" widget
4. Atom version of the "Top Rated" widget (for Atom themes only)
5. Ratings in Google search results


== Thanks ==

Thanks goes to:

* [thebroth](http://www.thebroth.com/blog/118/bayesian-rating)
* [Utku Yıldırım](http://stackoverflow.com/questions/8214902/order-database-results-by-bayesian-rating) on StackOverflow
Return current item: Post Ratings