WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Rating authors - any suggestions? (4 posts)

  1. do77
    Member
    Posted 3 years ago #

    I want to give users the option to rate authors on my blog. By rating I mean that they are able to write a comment as well as give each author 0-5 Stars (or so).

    I initially had planned to simply add the default comments template to the author.php file along with some comments rating plugin but I guess that this is not possible as you can add the comments template only to posts/pages.

    Does anyone has another idea how to achieve that?

    Giving each author an actual page will not work as I hope to have many authors at one point and I do not want to manually create a page for each one of them. I read something about an assigned hidden post that is linked to each author but I didn't really get it.

    I also thought about achieving it by using the GD Star Rating Plugin but ... well ... lets say, this plugin is quite complex :) I kind of dont know where do start...

    I would appreciate any suggestions and thank you guys in advance!!
    do77

  2. ambrosite
    Member
    Posted 3 years ago #

    I've built a custom post rating system on one of my WP sites. It's a more complicated problem than you probably realize. It doesn't necessarily have to be as complicated as GD Star Rating (IMO that plugin is too complicated), but still ...

    Let me ask you one thing at the start: do you want anyone who visits your blog to be able to cast votes (anonymous voting), or will you require the visitor to create an account and log in before they can vote? It's less complicated if you require people to log in, but then you can expect to receive far fewer votes.

    From a non-technical standpoint, you also need to consider the sociological implications. Will your other authors become jealous if one of them gets a lot more positive ratings and reviews than everyone else? If one particular author receives a bunch of negative ratings, are they going to get angry or discouraged and possibly stop contributing to your blog? And why do you want to collect this information anyway? Are you going to use it to determine which authors to invite back to write more content? If so, how do you stop your authors from gaming the system by stuffing the virtual ballot box? (It is very difficult to prevent double-voting in a web-based rating system, and if you need to do it reliably it will greatly increase the technical challenges.)

    IMO, it is much less problematic to simply have comments/ratings on the individual articles. That way, your authors don't need to take it so personally, since a negative rating is not a judgment against them, but only against something they wrote.

  3. do77
    Member
    Posted 3 years ago #

    Hey ambrosite,

    thank you for your answer and also for putting further thoughts into the whole idea. To answer your first question: Only logged in users can/should vote. Which I guess makes it easier ;)

    The authors on my blog are not actually "authors" in the sense of writing articles or posts. I just referred to them as authors because I thought it was easier and in the end it doesn't really matter. Users on my blog are more volunteers that offer their services through my website. People that have worked with them should be able to leave a comment and rate them, saying "great guy. did a good job." and give the person 5 stars.

    Its not a job board or anything close so there is no need to create a complex rating system. That's why simple adding comments to the author page would be totally sufficient but unfortunately doesn't work :(

    Best,
    do77

  4. ambrosite
    Member
    Posted 3 years ago #

    I understand. Yes, requiring people to log in does make it somewhat easier.

    The first thing you need to figure out is, where and how do you store the rating data? There is a usermeta table in the WordPress database, where you can create "custom fields" for users just like you can for posts. If you wanted to keep it really simple, you could create two custom fields for each user: 'rating' and 'who_voted'. The 'rating' field contains the current rating, and it gets updated every time someone rates that user. The 'who_voted' field contains a comma-delimited list of all the user IDs who have already rated that user (that's how you prevent double-voting, by checking IDs against the list).

    The other option would be to create a new, custom table to store the rating information, with a separate record for each vote. That is how I did it on my site, and that is how GD Star Rating does it (they create a whole bunch of tables, actually). I had to do it that way because I allow anonymous voting, so in order to prevent double-voting I have to keep track of IP addresses and session cookies (and even then it is still not foolproof). You probably don't need anything that complicated though.

    And of course, you also need custom scripts to hook all this together and make it work. But the first step is always to figure out what data you need to store and how, because that is the foundation for everything else.

Topic Closed

This topic has been closed to new replies.

About this Topic