coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: ibanez on December 05, 2006, 12:39:50 PM

Title: Rating
Post by: ibanez on December 05, 2006, 12:39:50 PM
Hello,
cpg rating system is insufficient! Please visit www.fotokritik.com
Rating system example:
rating1=-1
rating2= 0
rating3=+1
rating4=+2
rating5=+3
rating6=+4

for example 5 person
2+1+2+(-1)+3=7/5=1.4
can we recreate generate plug-in or code

Best regards
Title: Re: Rating
Post by: ibanez on January 04, 2007, 04:57:03 PM
we need geometric calculate!
Title: Re: Rating
Post by: Joachim Müller on January 05, 2007, 09:34:29 AM
OK, you're welcome to modify the code accordingly - go ahead.
Title: Re: Rating
Post by: ibanez on January 09, 2007, 10:21:16 AM
Quote from: GauGau on January 05, 2007, 09:34:29 AM
OK, you're welcome to modify the code accordingly - go ahead.
Formul is attached
example:
1.user 4 point
2.user 3 point
3.user 4 point

³√4x3x4



Title: Re: Rating
Post by: ibanez on January 12, 2007, 10:46:04 AM
okey
Formula:

a=user1(rate)*user2(rate)*user3(rate)
a=4*3*4
n=votes
n=3
pow(a,1/n)=3.6 Geometric Average

How is PHP code?

Title: Re: Rating
Post by: ibanez on January 18, 2007, 11:30:45 AM
open ratepic.php
and find
$new_rating = round(($row['votes'] * $row['pic_rating'] + $rate * 2000) / ($row['votes'] + 1));
and replace
$new_rating = pow( ( pow($row['pic_rating'],$row['votes'])*$rate*2000) , (1/($row['votes']+1)) );
that's all

rating = geometric average