DuncsWeb

Computing. Internet. Life.


While looking for a suitable solution for ratings for the Freeware Section on the site, it became apparent that there were no real solutions to allow multiple ratings on a single WordPress Page/Post. Wordpress.com blog owners are lucky enough to have PollDaddy Ratings built in, but they haven’t released it on the Wordpress Plugins Site just yet.


You may think “surely there are loads of ratings plugins you can use?”, I thought that too, and here is some that may turn up in your search results:

I could go on… and me and Dan spent well over 4 hours trying to find a solution to get multiple rating systems on just one page, either using services like Widgetbox or looking through custom coded things like the NoFunc Ajax Star Rating Script. Our search came to an end when we found the following:


ColorRating: http://colorpowered.com/colorrating/


This script allows you to put a nice looking 5 star script that uses SQLlite (no messing with phpmyadmin and creating databases and tables!) which looks like the following:


The instructions looked simple, but integrating them with WordPress was far more difficult (even when asking the author for help, he was not sure what to do). Lets run through the instructions:


Firstly, grab PHP Execution for WordPress. You’ll need this to invoke the rating in your post.

Note: You will need to use the editor to put the rating system on. Windows Live Writer (our blogging tool of choice) likes to mess with the PHP coding.

After unzipping the files and placing them in a folder called “rating” inside your template folder:

code

(the above shows an image to stop it executing in the post, grab the code here)


The first question here would be, “where do we put this code?”. After messing around for 20 minutes we found it best to put it in header.php in your templates directory just under the “rel” tags.



Next, change that rating.css, rating.js and rating.php to point directly to their destinations (e.g. http://yoursite.com/wp-content/themes/name/rating/rating.css), you’ll also need to head into the rating.js file and change to a direct link (just after “$.get”)


You may find at this point that you can only rate one star. This is because the links to rate are actually below each other. This is because (for some reason) the PHP execution, or something in WordPress decided to put random
tags after each hyperlink to rate. Simply open up rating.css and add the following line:


.score br{display:hidden}


You should now have multiple rating goodness! Next time you need to add a rating system into your page/post (replacing table name with your name):

code2

Last 6 posts by DuncanM

  • Share/Bookmark
Posted in: Websites
  • Kelly
    this messed up my wordpress site at all, giving lots of erros
  • danofmayz
    Nice post. Brings back some memories. Thank god for FireBug!
blog comments powered by Disqus
SUGGESTIONS:
Your Tips, Software Suggestions, Questions, Feedback or Queries: admin@duncsweb.com


 Subscribe in a Reader
 Follow Us on Twitter

SUPPORTERS:
Brandon M (Brandonio21), Rees B (GoonerGod), Adam D (AdamD), Sam G (iDominateU), Your Name Here?