aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_rate.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions_rate.inc.php')
-rw-r--r--include/functions_rate.inc.php30
1 files changed, 18 insertions, 12 deletions
diff --git a/include/functions_rate.inc.php b/include/functions_rate.inc.php
index d0319bd5c..2644caad9 100644
--- a/include/functions_rate.inc.php
+++ b/include/functions_rate.inc.php
@@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2013 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2008-2014 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
@@ -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)
{