diff options
author | rvelices <rv-github@modusoptimus.com> | 2011-08-02 19:20:50 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2011-08-02 19:20:50 +0000 |
commit | 86ae4d8b3ae8d1a4b3f78567dd8f67aa48ef43a8 (patch) | |
tree | cf4067b3b6298d2f700b6b5f59187ffe8e4efc55 /include/functions_rate.inc.php | |
parent | a61fea92834dcadc8c1a648ca1fdb2c56d2079cd (diff) |
rename #images.average_rate to rating_score
git-svn-id: http://piwigo.org/svn/trunk@11893 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions_rate.inc.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/functions_rate.inc.php b/include/functions_rate.inc.php index de52c37f3..4cf6cc9ca 100644 --- a/include/functions_rate.inc.php +++ b/include/functions_rate.inc.php @@ -120,13 +120,13 @@ INSERT } -/* update images.average_rate field +/* update images.rating_score field * we use a bayesian average (http://en.wikipedia.org/wiki/Bayesian_average) with C = average number of rates per item m = global average rate (all rates) * param int $element_id optional, otherwise applies to all - * @return array(average_rate, count) if element_id is specified + * @return array(rating_score, count) if element_id is specified */ function update_rating_score($element_id = false) { @@ -166,13 +166,13 @@ SELECT element_id, 'count' => $rate_summary['rcount'], ); } - $updates[] = array( 'id'=>$id, 'average_rate'=>$score ); + $updates[] = array( 'id'=>$id, 'rating_score'=>$score ); } mass_updates( IMAGES_TABLE, array( 'primary' => array('id'), - 'update' => array('average_rate') + 'update' => array('rating_score') ), $updates ); @@ -183,7 +183,7 @@ SELECT element_id, $query=' SELECT id FROM '.IMAGES_TABLE .' LEFT JOIN '.RATE_TABLE.' ON id=element_id - WHERE element_id IS NULL AND average_rate IS NOT NULL'; + WHERE element_id IS NULL AND rating_score IS NOT NULL'; $to_update = array_from_query( $query, 'id'); @@ -191,7 +191,7 @@ SELECT id FROM '.IMAGES_TABLE .' { $query=' UPDATE '.IMAGES_TABLE .' - SET average_rate=NULL + SET rating_score=NULL WHERE id IN (' . implode(',',$to_update) . ')'; pwg_query($query); } |