Google Plus Profile Subscribe to RSS feed LinkedIn Profile Follow me on Pinterest Watch our Youtube Videos Find us on Flickr Stumbleupon Profile
GD Custom Posts And Taxonomies Tools

No comments reordering

Thumbnail for No comments reordering

To summarize the post, there will be no comments reordering using ratings in GD Star Rating. For now. Problem is not that I don’t want to make it, but that it cannot be done at the moment the way I would like it to be done. Here’s why.

Post loop that is controlled by the SQL query through WP_Query object, and this object allows us to expand the query and include anything we might need. That’s all used by GD Star Rating plugin already for reordering posts with various rating based data.

But, comments are at the moment coded much differently and may I say so, very bad compared to posts. And for who knows how many versions now, there are TODO notices through out WordPress that comments should be handled differently, but so far nothing has been done. Right now, when comments rendering is called, a SQL query is constructed, with all elements hard-coded that retrieves all comments for the post (even the ones that will not be displayed). And there is only one filter used there but it’s used on already retrieved array of comments. So, there is no way for any plugin to actually control how the comments are get, what tables will be joined to the main comments table. The only thing that can be done is to work with already retrieved array of comments. So far, the few plugins that reorder comments use only the basic comments array and sort data by standard columns like date or something like that. Complicated reordering that ratings require is very, very complicated to do now.

For me to make this reordering on comments, right now it’s very complicated and involves multiple SQL queries, complex sorting functions and all sorts of things that will be very slow and will require a lot of my time to do. On the side the fact that threaded comments will be completely broken. Also, I doubt that many users of GD Star Rating actually need such feature, and spending a lot of time on this is just not worth it. On the side the fact, that eventually WordPress developers will make comments handling as it should be. And than I will need to make it all over again.

Simply, cost of making comments reordering right now is very high on time I can dedicate to plugin. Until the problem is solved with the WordPress core, GD Star Rating will not be able to reorder comments.

GD Star Rating
loading...

Share this:

del.icio.us DiGG Google StumbleUpon Google Buzz Microsoft Live MiXX RSS PDF
No comments reordering, 4.3 out of 10 based on 13 ratings

6 Responses to “No comments reordering”

  1. Scorpio84 | July 19, 2009 at 12:39 PM

    :(

    BTW I understand all the points you said but one thing I would like to disagree is:
    Also, I doubt that many users of GD Star Rating actually need such feature, and spending a lot of time on this is just not worth it.

    Well I believe in a complete review site (users review inc) I would like to reorder comments(reviews) with the most rated (may be thumb/ may be star) comments at the top…!!! Anyways no option ther than to wait :)

    GD Star Rating
    loading...
    • MillaN | July 19, 2009 at 1:17 PM

      So far only few people asked for this comment reordering, and plugin is used on more than 4000 websites right now.

      The other problem is that comments code in WP core is not totally the same in last few releases of WP, so in some parts I would need to make changes for each of these versions, and that again will require time.

      Since I have planned many more new features, I still think that it’s best to work on them, than to work on something that will surely need to be fully rewritten down the road.

      GD Star Rating
      loading...
  2. Ray | July 23, 2009 at 12:34 AM

    I wouldn’t at all worry about comment threading.

    Comment sorting is a feature people will be asking for (me included!)
    But that depends on the WP core I guess.

    GD Star Rating
    loading...
  3. Scorpio84 | July 24, 2009 at 8:37 PM

    btw just thinking aloud… another use probably can be – with p2 theme it could be a wonderful Yahoo Answer clone.. !!! :)
    Anyways have to live without that unless WP guys do something

    GD Star Rating
    loading...
    • MillaN | July 24, 2009 at 11:49 PM

      I was thinking about this also and I made another review of this issue, and I am sorry, but I don’t have time for feature that I will need to rewrite from scratch in the next few months.

      GD Star Rating
      loading...
  4. AndyF | August 2, 2009 at 11:19 PM

    Just curious – is there an easy way to pull out the top 10 comments from a post and display them underneath the post (before the comments)? Doesn’t matter if the comments are repeated in the comments block. I’m willing to get my hands dirty with PHP and MySQL – just curious how easy it would be (would be very useful to highlight the most helpful comments in a post)…

    Thanks.

    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.