mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-09 10:13:00 +02:00
feature 2999: documentation of functions_rate and functions_session
git-svn-id: http://piwigo.org/svn/trunk@25614 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -22,11 +22,16 @@
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
/**
|
||||
* rate a picture by a user
|
||||
* @package functions\rate
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Rate a picture by the current user.
|
||||
*
|
||||
* @param int image identifier
|
||||
* @param int rate
|
||||
* @return void
|
||||
* @param int $image_id
|
||||
* @param float $rate
|
||||
* @return array as return by update_rating_score()
|
||||
*/
|
||||
function rate_picture($image_id, $rate)
|
||||
{
|
||||
@@ -120,13 +125,14 @@ INSERT
|
||||
}
|
||||
|
||||
|
||||
/* 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(rating_score, count) if element_id is specified
|
||||
/**
|
||||
* 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|false $element_id if false applies to all
|
||||
* @return array (score, average, count) values are null if $element_id is false
|
||||
*/
|
||||
function update_rating_score($element_id = false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user