Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Turn off link rating + 1 other question

Quote Reply
Turn off link rating + 1 other question
I'm using glinks for a review web site, and I don't want users to be able to rate the individual links on a 1-10 scale but would rather turn that feature off entirely. I've searched the manual and may have missed it, but how would I accomplish this?

Other question is, Is there a way to display the average of reviews (not rating) each particular item gets? Such as under the name of the item being reviewed?

Thanks for any help!
Quote Reply
Re: [somedevil] Turn off link rating + 1 other question In reply to
click on the database link on the top menu

choose review and properties and click on go

click on review rating and change "not null to" no

hope that helps
Quote Reply
Re: [theguy] Turn off link rating + 1 other question In reply to
In Reply To:
click on the database link on the top menu

choose review and properties and click on go

click on review rating and change "not null to" no

hope that helps



I gave this a try and it didn't work....

After looking further, should it be:

links and properties, click go
click on rating and change not null to no?

Last edited by:

somedevil: Jun 25, 2006, 4:55 PM
Quote Reply
Re: [somedevil] Turn off link rating + 1 other question In reply to
Simplest way would be, within the userside templates, just don't display link rating tags/codes.

Hope this helps.

Vishal

In Reply To:
I'm using glinks for a review web site, and I don't want users to be able to rate the individual links on a 1-10 scale but would rather turn that feature off entirely. I've searched the manual and may have missed it, but how would I accomplish this?

Other question is, Is there a way to display the average of reviews (not rating) each particular item gets? Such as under the name of the item being reviewed?

Thanks for any help!

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Turn off link rating + 1 other question In reply to
Thanks. I'm new to working with this, so I'm not sure I have this right. I went to user templates, and see 3 of them which are titled rate, such as rate.html, rate success and one other.

If these are the right templates, which I'm not totally sure about, which portions of these templates do I remove?
Quote Reply
Re: [somedevil] Turn off link rating + 1 other question In reply to
you still have to turn it off like i sugetsed before
otherwise you will get an error when someone submit a review
Quote Reply
Re: [theguy] Turn off link rating + 1 other question In reply to
In Reply To:
you still have to turn it off like i sugetsed before
otherwise you will get an error when someone submit a review


Thanks again for your reply!

I did as you explained and it didn't work at all...the rate it function still works and is still visable. I've gone thru the manual and see nothing that addresses this. I really need to get rid of the link ratings as it makes no sense to have a link rating show 10 stars and a review show 2 stars. It's going to cause confusion for my readers.
Quote Reply
Re: [somedevil] Turn off link rating + 1 other question In reply to
You need to go through the templates and remove all references to the ratings, then you probably want to remove rate.cgi as well.

so for example, in link.html, you want to remove:

Code:
<%~if Votes%>
<%~set intRating = $Rating i/ 1%>
<img src="<%Links::Utils::image_url("stars-10-${intRating}.gif")%>" alt="<%intRating%> out of 10 stars" title="<%intRating%> out of 10 stars" /> (<%Votes%> vote<%if Votes != 1%>s<%endif%>)
<%~endif%>

Code:
<a href="<%config.db_cgi_url%>/rate.cgi?ID=<%ID%>">Rate It</a>

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] Turn off link rating + 1 other question In reply to
you are right, that did not work

i thought if a field is okay to be null then why i'm getting an error when i leave it null

anyone know the solution for this?
Quote Reply
Re: [theguy] Turn off link rating + 1 other question In reply to
As far as I can remember, there is something in the core code that checks whether the review rating is within the correct bounds. Therefore it is not possible to remove it without editing the core code (or writing a plugin!)

I think that the easiest way to do this would be to add a hidden field that gives the review a rating <input type="hidden" name="Review_Rating" value="1"/> (check name of field is correct) and then just remove all the parts in the template where the rating is shown.
Quote Reply
Re: [afinlr] Turn off link rating + 1 other question In reply to
Quote:
'Rating' => {
'default' => '0.00',
'form_display' => 'Rating',
'not_null' => '1',
'pos' => '15',
'precision' => '4',
'regex' => '^(?:10(?:\.0*)?|\d(?:\.\d*)?)$',
'scale' => '2',
'type' => 'DECIMAL'
},


The .def file shows that there a regex attached to the field.

You would need to edit the database properties, make sure "not null" is "0" and the regex field is empty.

So, go back to database=>properties of the Links table, and set the not_null to 0 and empty the regex field.

If that doesn't work,

You could also try removing the precision and scale lines from the .def file manually. Not sure what they do. There is a lot of hidden/non-doc stuff in the various parts of links you can only get an idea of by reading the actual code, and that is sooooo time consuming.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [somedevil] Turn off link rating + 1 other question In reply to
Sorry - my reply didn't make sense as I had understood from a brief read of the thread that you wanted to remove the review rating. This thread has become a bit confusing now! Pugdog's reply is more useful. Tongue

To show an average of the review ratings, you can use a global - something like this:

sub {
my $rec = shift;
my $reviews = $DB->table('Reviews');
my ($review_stats,$review_count);
%$review_stats = map {$_ => $reviews->count({ Review_LinkID => $rec->{ID}, Review_Rating => $_, Review_Validated => 'Yes'})} (1..5);
$review_count = $reviews->count({ Review_LinkID => $rec->{ID}, Review_Validated => 'Yes'} );
my $average=0;
if ($review_count) {
for (1..5) {
$average=($average+($review_stats->{$_}*$_));
}
$rec->{'AvgRating'}=$average/$review_count;
$rec->{'NumVotes'}=$review_count;
}
return $rec;
}
Quote Reply
Re: [afinlr] Turn off link rating + 1 other question In reply to
Hi,

when I try the global nothing apears

could you take a look at it?

Thanks
Quote Reply
Re: [incik] Turn off link rating + 1 other question In reply to
Hi,

It doesn't return anything - it gives you two new tags to use:
<%AvgRating%> and <%NumVotes%>
Quote Reply
Re: [afinlr] Turn off link rating + 1 other question In reply to
Thanks
Quote Reply
Re: [incik] Turn off link rating + 1 other question In reply to
I agree that the 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?