aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_rate.inc.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2013-11-21 10:02:44 +0000
committermistic100 <mistic@piwigo.org>2013-11-21 10:02:44 +0000
commit9565aef3b0ad148bbc6dba11b99f451d906380f3 (patch)
tree0a611d8a4f97d156680049c2cd24cf751a816e97 /include/functions_rate.inc.php
parent277c7fe8f4de680e558895d7d310b9290ce9b004 (diff)
feature 2999: documentation of functions_rate and functions_session
git-svn-id: http://piwigo.org/svn/trunk@25614 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_rate.inc.php')
-rw-r--r--include/functions_rate.inc.php28
1 files changed, 17 insertions, 11 deletions
diff --git a/include/functions_rate.inc.php b/include/functions_rate.inc.php
index d0319bd5c..bfac30c75 100644
--- a/include/functions_rate.inc.php
+++ b/include/functions_rate.inc.php
@@ -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)
{