Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Integrating ratings and reviews

Quote Reply
Integrating ratings and reviews
(i created a new post and moved this from a response to an old post because of no comments) ...

Ratings/Reviews features are redundant because each allow the user to assign a 1-5 or 1-10 star rating to the same link. This is complicated by the fact that the Rating (Votes) is part of the link's record, while the review is in a separate table. Maybe the designers didn't think any of us would want to use both, or if we want to use reviews we would only want to use them as a separate black box?

What I want to do is take the average 'rating' (i.e. number of stars) from the review and display it with the link on the link or details page. Since I am using reviews, in the interest of Usability, I *cannot* use the 'Rating' feature. So i need to get the average number of stars from the reviews of each link use that.

Here is a solution I just thought of and I'm wondering how to best implement it:

For each link
1. calculate the average rating from all reviews of a link
2. Insert that average rating into the 'Rating' field of the same link

IT would be perfect if this sort of routine could be called everytime I do a build.

Any ideas on how to do this?
Quote Reply
Re: [kerbouchard2] Integrating ratings and reviews In reply to
We could make a little global to calculate all the values of Ratings in all Reviews attached to a particular link and then display it as an Average Rating, would that work for you? Sounds like it could based on my reading of your post, but wanted to be sure...

Jack.
Quote Reply
Re: [Jack] Integrating ratings and reviews In reply to
Thanks Jack,

It works to the extent that i can post the average rating on the links page next to the name of the link and the summary description. But I also wanted to display the links sorted by highest rating to lowest rating. That is why I wanted to insert the value into the Rating filed of the link record.

Then i can sort on "Votes"

Is there anyway to sort on a global? If so it would work.
Quote Reply
Re: [kerbouchard2] Integrating ratings and reviews In reply to
A little bit more difficult then as we'd have to do a recalculate and write the new value everytime someone submits a rating, or we can add this process to the build function. Send me an email or PM if you want to go ahead with it, there would need to be a custom work order created for this unfortunately, my apologies. On the girlfriends example, the way it's setup is to amalgamate both link ratings and review ratings into an average, but it's not a value used in the sort order, so it's a little simpler than your requirement here.

Jack.
Quote Reply
Re: [Jack] Integrating ratings and reviews In reply to
Jack wrote:
A little bit more difficult then as we'd have to do a recalculate and write the new value everytime someone submits a rating, or we can add this process to the build function. Send me an email or PM if you want to go ahead with it, there would need to be a custom work order created for this unfortunately, my apologies. On the girlfriends example, the way it's setup is to amalgamate both link ratings and review ratings into an average, but it's not a value used in the sort order, so it's a little simpler than your requirement here.
Jack.

Yes it needs to be part of the build or it could be a special routine that could be run by the admin whenever a build is run or by cron at the same interval as the build. I would like to use this and I'm sure a lot of other people would as well, as there has been a bit of discussion on that. I would like to see that feature, but I don't want to pay for it.

I think the best solution looking forward, is to completely get rid of the rating/votes function and apply that whole thing to the part of reviews where a star rating is assigned to the review. That way the review remains in a separate table, but the review's rating gets assigned to the rating/votes field of the listing. Then you have the best of both worlds. No confusion and no conflicting features.
Quote Reply
Re: [kerbouchard2] Integrating ratings and reviews In reply to
We'll do our best to schedule this improvement, but it is quite a difficult thing to build these rating systems in a generic way for a product of this nature, hence the two separate methods we've provided. You can easily take out the rating features in the review part if you like as a stop-gap measure in the meantime just by editing the templates.

Jack.
Quote Reply
Re: [Jack] Integrating ratings and reviews In reply to
Hi Jack, Which improvement? The build that integrates the review rating into the 'votes' field? Thanks!

Jack wrote:
it is quite a difficult thing to build these rating systems in a generic way for a product of this nature, hence the two separate methods we've provided. You can easily take out the rating features in the review part if you like as a stop-gap measure in the meantime just by editing the templates. .

I did it the other way around (edited out the votes field) because it seemed that if i edited it would be better to have one feature rather than two that do the same thing. Unfortunately i didn't realize that the method i chose would prevent from sorting on the rating. I think if you were to provide a generic solution erring on the conservative side would mean providing one feature rather than two...just my two cents.
Quote Reply
Re: [kerbouchard2] Integrating ratings and reviews In reply to
Hi all, this is great. We are in need of exactly this feature as we prefer a unification of the ratings.

Juancho.

Monografias.com
Links 3.2.0

Quote Reply
Re: [kerbouchard2] Integrating ratings and reviews In reply to
Well it's not hard to be done, I've modified review ratings for one of my sites to work in exactly way, I'm not using voting system just rating votes to calculate link popularity.

Basically I've just overrided the voting system and now calculating Votes and Rating fields in Links table from reviews rating.

I hope this helps.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Integrating ratings and reviews In reply to
Hi eupos. Based on the terminology you're using it's hard to understand exactly what you are doing. The initial question was asking how to use both reviews and ratings (votes) together.
Quote Reply
Re: [kerbouchard2] Integrating ratings and reviews In reply to
Ehm, sorry then. It was my misunderstanding.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [Jack] Integrating ratings and reviews In reply to
Quote:
We could make a little global to calculate all the values of Ratings in all Reviews attached to a particular link and then display it as an Average Rating

Is this Global actually available ? as I could use it in it's simpler format. Smile

Andy
Quote Reply
Re: [chapelier] Integrating ratings and reviews In reply to
Not really, but if you send me an e-mail with access to your installation so that I can see how you're doing things Andy, I'll see what I can do.
-------------------------------------------------------------------------------------------
Jack Ong, C.O.O., Gossamer Threads, Inc.
9th Floor, 100 West Pender, Vancouver, BC, Canada, V6B 1R8
Email: <jack@gossamer-threads.com>
Tel: (604) 687-5804 Fax: (604) 687-5806
Quote Reply
Re: [Jack] Integrating ratings and reviews In reply to
Thanks Jack

Email sent Smile
Quote Reply
Re: [chapelier] Integrating ratings and reviews In reply to
Not sure if this is what you are trying to do, but it's fairly easy to disable the 'voting' system and just use the review ratings.

You need a global like so, call it get_ave_rating:

Code:
sub {
my $id = shift;
my ($avg) = $DB->table('Reviews')->select( 'AVG(Review_Rating)', { Review_LinkID => $id },
{Review_Validated => 'Yes'})->fetchrow_array;
$avg ||= 0;
return sprintf("%.0f", $avg);
}

Then you can use it to display stars or a comment with some logic e.g.:

Code:
<%set ave_rating = get_ave_rating($ID)%>
<%if ave_rating gt 0%>
<img src="/images/<%ave_rating%>star.gif" alt="<%ave_rating%> out of 5 stars"/>
<%else%>
Not rated yet
<%endif%>

We round off all the reviews in one part of the site, and on another page we have a Top 100 list that uses a different global to calculate the average to 2 decimal points and rank all the links. A very flexible system Wink.

I can't remember if the default setup uses review ratings out of 5 or 10, it shouldn't matter in the global anyway. You can disable the link voting system by template edits, there may be a few other things we did but that should be a good starting point.
Quote Reply
Re: [aus_dave] Integrating ratings and reviews In reply to
Hi Dave,

Thanks for sharing this!

Regards

n||i||k||o