Google Plus Profile Subscribe to RSS feed LinkedIn Profile Follow me on Pinterest Watch our Youtube Videos Find us on Flickr Stumbleupon Profile
GD Simple Widgets

Widget: GD Star Rating #2

Thumbnail for Widget: GD Star Rating #2

With the release of 1.2.0 version of the plugin, there are many changes and improvements added to main plugin widget. Because of that I have decided to describe these additional features and changes. For all of you that wanted to see certain features in the widget, good news is that most of that requests are built into this new version. There are still few things left out for now, but am still going to expand widget options soon.

widgets newex Widget: GD Star Rating #2

New Widget Example

Very important update is full support for WordPress 2.8 and the new WP_Widget class. If you upgrade from 2.7 to 2.8, all widget settings will be lost due to the changes in widget API, but there is no way around that. Remove all instances of Star Rating widget, and add it again. Also, check the widget settings after you upgrade GD Star Rating, because some changes can cause all the ratings to disappear from the widget.

Image on the right is an example from my www.dev4press.com website. As you can see, widget looks much different then it used to be. Each element is controled by the templates as before, but now there are few additional template tags you can use.

Post Image

New tag %IMAGE% is added, and this tag will be replaced by the URL to the image from the post. There are 2 methods of getting this image. One is from the custom field and the other from the post content. If you want custom field image, you will get the list of custom fields in the posts, and you can choose one of them. If you decide you want the image from the post, first image found within the content will be used for this tag.

widgets newopt 1 300x95 Widget: GD Star Rating #2

Image and Stars options

Stars

Now you can also show rating stars in the widget. You need to select set to use and the size of the stars. Add the tag into template, and you will get rating stars for each post. You can use tags to display regular avearge rating or recalculated bayesian estimate mean.

Multi Ratings

Yes, widget now supports multi ratings data. Change  the source from Standard to Multis, and select multi rating set you want to display results for, and that’s all. You can’t mix results from different multi sets. If you want to display 2 multi sets results add 2 widgets. Also, you can’t mix multi rating results with standard ratings. If you want both, add different wigdet instances and set them differently. These things will not be allowed in any of the future versions, so don’t ask for them. One widget – one multi result set.

Filtering

There are 2 new filter options. First one allows you to use subcategories for a selected category (new checkbox added). And the other is to display only posts that  have received votes in the last 10 or 20 days. Enter the number of days for using the filter, or leave blank (or enter 0) to disable this check. In one of the next versions I will add more advanced category filter allowing you to select any number of categories.

Templates

Default widget template is not changed. But if you want to get widget as the one in the example above, you need to enable image support, select where the images are coming from, and change item template:

<li style=”background: none”><div style=”float: left; margin-right: 6px;”><a href=”%PERMALINK%”><img src=”%IMAGE%” width=”38″ height=”38″ /></a></div><div style=”float: left;”>%STARS%<div style=”margin-top: 3px;”><strong style=”color:red”>%RATING%</strong> : <a href=”%PERMALINK%”>%TITLE%</a> (%VOTES% %WORD_VOTES%)</div></div><div style=”clear: both”></div></li>

Check the SRC for the image tag, because your image URL can be relative path to the image, so you might need to add domain or something else to complete the image URL. Soon, the current templates will be  replaced with T2 system, and this will simplify the use of different templates for widgets.

GD Star Rating
loading...

Share this:

del.icio.us DiGG Google StumbleUpon Google Buzz Microsoft Live MiXX RSS PDF
Widget: GD Star Rating #2, 7.5 out of 10 based on 239 ratings

23 Responses to “Widget: GD Star Rating #2”

  1. paul2008 | April 22, 2009 at 7:13 AM

    Mwahaha. I am beginner in HTML and I just spent 40 minutes trying to understand why your item template from this post doesn’t work on my website.
    Turns out it’s because the code is inside a blockquote, so everything is in italic font, and italicized quotation marks are not recognized as HTML.

    GD Star Rating
    loading...
    • MillaN | April 22, 2009 at 9:58 AM

      This template have tags that are supported only by upcoming 1.2.0 version of the plugin that will be released tonight.

      GD Star Rating
      loading...
  2. paul2008 | April 22, 2009 at 10:21 AM

    Really, which ones? I pasted everything and it works, showing the rating stars, the numerical rating value, the thumbnail – looks just like your example.

    GD Star Rating
    loading...
    • MillaN | April 22, 2009 at 11:04 AM

      %IMAGE% tag for post thumbnail is added in 1.2.0 and there was no way that can work with previous version.

      GD Star Rating
      loading...
  3. paul2008 | April 22, 2009 at 7:07 PM

    I’m using GDStarRating 1.1.9.1, I copied the above example in your post, and it works just like on your screenshot, except that my current theme puts text lines too close to each other. You can check it here: http://tee.awardspace.biz

    GD Star Rating
    loading...
    • MillaN | April 22, 2009 at 7:30 PM

      There are few bugs in the widget implemntation for this version, so be sure to update tonight when 1.2.0 is released.

      GD Star Rating
      loading...
  4. Andrew | April 22, 2009 at 7:26 PM

    Hi chief, can you help me out? cause i’m trying to put a rating on the comments area…using your plugin… i barely know how to do php cause i’m a designer.. so i have little to none experience in php.. so my problem is.. how can i prevent visitors to comment twice with a rating.. okay thats kinda unclear..

    i guess what i’m trying do is a visitor can comment as much as he/she wants at a post.. but will be just be able to place a comment with a rating once..

    i read the pdf file manual.. but can’t seem to find a solution.. cheers!!

    GD Star Rating
    loading...
    • MillaN | April 22, 2009 at 7:29 PM

      That can’t be done at this point.

      GD Star Rating
      loading...
  5. Andrew | April 22, 2009 at 7:47 PM

    But will it on the coming versions??

    GD Star Rating
    loading...
  6. Andrew | April 22, 2009 at 7:49 PM

    i mean.. is that thing can be done?? if ever ..can i modify your code??

    GD Star Rating
    loading...
    • MillaN | April 22, 2009 at 7:52 PM

      You can try, but that’s not going to be easy. Plugin is very complicated. And, at this point I am not sure when this will be added as a standard feature.

      GD Star Rating
      loading...
  7. Andrew | April 22, 2009 at 7:55 PM

    yeah.. i wished.. hehe.. RATS.. ^__^ anyway thanks master Millan.. I’ll try.. even though it will be hard.. har har har

    GD Star Rating
    loading...
  8. Adam | April 23, 2009 at 4:45 AM

    Hi, Millan.

    First, I just want to express my thanks for an amazing plugin. This is, literally, one of the most in-depth plugins I’ve ever used, and with all the work it appears that you put into this, I don’t see how you manage to do anything else! I’ll be donating soon, as this is one of the most important plugins I use on my new site.

    Anyway, here’s my question. I would guess that this can’t/won’t be done, but I thought I’d ask. If you look at a website like http://www.dailykos.com (a very popular US political discussion blog), you’ll see they have a “user diary” system. Users basically create their own posts, and these posts can be “recommended” by other users. Recommended posts go into a “Recommended Diaries” section.

    So far, your plugin is perfect for this. I’ve set my site up so users can post their own diaries, and readers can rate the post with GDStar Rating. Top rated posts then go into the GDStar Rating widget labeled “Top Diaries.”

    Here’s the thing, though. On sites like dailykos.com, newer posts are given more “weight.” For example, a post rated 3.0 posted today would be listed much higher in a “Recommended Diaries” section than one rated 3.0 that was posted 5 days ago. In this way, newer posts, even if they’re rated exactly the same as other posts, are listed higher than the old posts.

    So the goal would be, at least for display in the WIDGET, that as a post gets older it’s spot in the widget list decays until it eventually drops off the list due to age.

    I know that right now in GD Star Rating, you can choose a date for the widget to consider (e.g. 30 days), and after that date the post is no longer listed in the widget. But as far as I know there’s no way to have a post’s rank within the widget slowly decay as the post gets older.

    You can SORT of obtain this functionality by setting the date range to a short period, like 1 day. The problem then is that for a new website with very few posts or user diaires, after 1 day ALL posts older than 1 day disappear from the widget. Rather, the desired functionality for what I’m suggesting is that older posts don’t drop off the list UNLESS they’re pushed off the list by newer, rated posts.

    So it would be some sort of new calculation for the widget that lowered a posts EFFECTIVE rating (just for the widget) the older the post got.

    I understand that your plugin wasn’t really designed to take this into consideration. Obviously it does many other things very very well and has many other uses. But I was just wondering about your thoughts on whether this could be implemented at some point even if it was ONLY in the widget – not affecting the actual rating, but just having the ranking within the widget DECAY the older the post gets, so it’s pushed off the list if new rated posts exist.

    Really sorry for the long post, I hope I was clear in all this. If the answer is “this will not be implemented” I certainly understand! Thanks again for a great plugin.

    GD Star Rating
    loading...
    • MillaN | April 23, 2009 at 9:57 AM

      Well, there is a way to modify the list before the list is displayed, and you can write your own filter that will reorder the list before display. At this point this is not in a plans to be implemented.

      GD Star Rating
      loading...
      • Adam | April 23, 2009 at 3:41 PM

        Thanks, Millan. I’ll take a look at writing a filter. I’ve looked at the GDSR code and it’s very complex. Any hint on the code to review for the filter?

        Also looking forward to sorting options in 1.2.1, which I think would help my issue too.

        Thanks again.

        GD Star Rating
        loading...
  9. etche | April 23, 2009 at 5:05 AM

    Hi, first of all thanks for your hard effort and your great plugin!!

    Two features I would really like in the rating widget is to have the possibility of adding a shortcode to show the post author, with no grouping enabled.(ie: 5.0: A post (5 votes) author: xx)
    And the otherone is that for example I have lots of posts with 5/5 rating. The problem is that maybe a post was voted 3 times and another one was voted 7 times. I set the minimum votes to 3 and the widget shows first the post rated 5 stars with 3 votes and secondly the post rated 5 stars with 7 votes. Is there a way that the widget sorting column takes account of rating AND number of votes? so that it shows first 5/5 (7 votes) and second 5/5 (3 votes) and so on?…
    thank you very much

    p.s. sorry for copying the forum question into here..maybe you check more often here.
    thanks again

    GD Star Rating
    loading...
    • MillaN | April 23, 2009 at 9:53 AM

      Author tag will be added in 1.2.1. As for sorting, I can change that so that will be also added in 1.2.1.

      GD Star Rating
      loading...
  10. andrew | April 24, 2009 at 10:46 AM

    Hi millan,

    can you lighten me up on how do i can check if the comments has been rated?

    cause i wanna disable the star rater if a certain comment had been rated…

    i tried to modify.. but being noob in php.. the code is very hard to modify..

    I’m refering to this function

    i just want to check if a visitor already rated a certain comment

    GD Star Rating
    loading...
  11. andrew | April 24, 2009 at 10:47 AM

    wp_gdsr_new_comment_review();

    GD Star Rating
    loading...
  12. David Bravo | May 10, 2009 at 11:03 AM

    Is there any way to use your FAB plugin to display just a list of the most voted (just the page with its permalink) without using all the bells and wishtels. What I’m trying to do is a multitab menu (like the one you have in your page in the upper-right part), so I have most viewed (using “recently popular” plugin), most commented (using “most popular posts” plugin) and I need the info from your plugin in the third tab. Domething like “show_most_voted(parameters)” like I have for the others. Is this possible? Anyway, thanks for doing such a great job. I think your plugin is one of the most complete plugin avaliable (and well developed) ever! :)
    Dave

    GD Star Rating
    loading...
  13. David Bravo | May 10, 2009 at 11:51 AM

    Never mind. I’ve just seen you have special shortcodes to do this. Sorry for wasting your time! O:)

    GD Star Rating
    loading...
  14. Kyle | May 21, 2009 at 1:52 AM

    How do I modify the number of entries included in the Default Star Rating widget? Only 3 entries appear in the widget and in the template settings I only see how to edit what each entry looks like, not how many of them appear.

    Help is appreciated.
    Thanks

    GD Star Rating
    loading...
    • MillaN | May 21, 2009 at 2:24 AM

      Maximal number of entries is controled by the widget settings. Default is 10.

      GD Star Rating
      loading...

Comments are closed.

www.dev4Press.com

Dev4Press is a premium service dedicated to developing of high quality plugins and themes for WordPress, custom development and consulting. Follow this link to find out more...

Feedburner Feedburner updates

Sign up to receive all latest news about GD Star Rating directly to your email.