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:
mistic100
2013-11-21 10:02:44 +00:00
parent 277c7fe8f4
commit 9565aef3b0
2 changed files with 94 additions and 67 deletions
+17 -11
View File
@@ -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)
{