Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Change Rating Amount

Quote Reply
Change Rating Amount
Which file or part to change the required Rating from 10 to 5 votes?

Also may I suggest this is an option in future releases as those of us who don't get much rating activity, lose out on this great feature due to lack of votes!

Cheers.
Quote Reply
Re: [Canoon] Change Rating Amount In reply to
You might be able to get by just by changing your ratings template, to have only 1-5 available.

You would also have to edit the

Links::User::Rate.pm file in the:

Code:
# Make sure we have a valid rating.
unless (($rating =~ /^\d\d?$/) and ($rating >= 1) and ($rating <= 10)) {
return { error => Links::language ('RATE_INVALIDRATE', $rating), %$rec };
}

routine, so it checks for 5 not 10.

Not sure if this will affect anything else, but give it a try.



PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Change Rating Amount In reply to
Thanks for your answer. I think the code you referenced is for the actual rating amount (1-10) but I need to change the actual number of votes to trigger a new rating from 10 to 5.

Any ides where this code be found or perhaps big changes are needed?

Tnanks.
Quote Reply
Re: [Canoon] Change Rating Amount In reply to
Im not quite sure what you mean. It only takes one vote to update the rating.
Quote Reply
Re: [PaulW] Change Rating Amount In reply to
Yes but required 10 votes to actually make a new link into the rating. It is this 10 I wish to change down to 5. Perhaps I not explain to well!

Thanks.

Last edited by:

Canoon: Dec 8, 2001, 9:13 AM
Quote Reply
Re: [Canoon] Change Rating Amount In reply to
Do you mean the top rated page?
Quote Reply
Re: [PaulW] Change Rating Amount In reply to
Bingo!
Quote Reply
Re: [Canoon] Change Rating Amount In reply to
Looks like lines:

353 & 356

in admin/Links/Build.pm (v2.0.5)... This is under the "build_rating" section.

(Should be obvious what to change...) I haven't tried this myself to verify it will work...

--
Matt G
Quote Reply
Re: [Matt Glaspie] Change Rating Amount In reply to
Cheers Matt, I'll give a try.

I would hope this makes it as an option to change the amount in future release Wink
Quote Reply
Re: [Canoon] Change Rating Amount In reply to
Hi,

I have made the changes from 10 to 1 but it still not shows until 10 votes have been cast Unsure

This is what has changed:

sub build_rating {
...

$link_db->select_options ("ORDER BY Rating DESC", "LIMIT 10");
$rated = $link_db->select ( GT::SQL::Condition->new('Votes', '>=', 1, 'isValidated', '=', 'Yes') );

$link_db->select_options ("ORDER BY Votes DESC", "LIMIT 10");
$voted = $link_db->select ( GT::SQL::Condition->new('Votes', '>=', 1, 'isValidated', '=', 'Yes') );

Last edited by:

Canoon: Dec 15, 2001, 6:35 AM
Quote Reply
Re: [Canoon] Change Rating Amount In reply to
Did you rebuild?

Last edited by:

PaulW: Dec 15, 2001, 6:38 AM
Quote Reply
Re: [PaulW] Change Rating Amount In reply to
Yeah, did a change & full build but no result. Perhaps there's other codes need changing??
Quote Reply
Re: [Canoon] Change Rating Amount In reply to
Alex?

Can you offer some advice? I really need the rating minimum brought down to 1 instead of 10. Thanks for you help.
Quote Reply
Re: [Canoon] Change Rating Amount In reply to
Hi,

That should be the only change needed. If you are under mod_perl, you would need to restart your mod_perl server. Also you may want to try viewing it under dynamic mode instead.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Change Rating Amount In reply to
Thanks a lot Alex.

I thought it may be something to do with mod_perl keeping the original code in memory. Now I just need to find how to re-start mod_perl to reload the new codes :-)
Quote Reply
Re: [Canoon] Change Rating Amount In reply to
That would definately be it. All the .pm files get pre-loaded into memory, so if you change one, it won't take affect until you restart mod_perl.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Change Rating Amount In reply to
All works great now - fantastic.

Thanks! Cool