diff options
Diffstat (limited to 'modules/gallery/helpers/random.php')
-rw-r--r-- | modules/gallery/helpers/random.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/gallery/helpers/random.php b/modules/gallery/helpers/random.php index a26762bd..6016df7b 100644 --- a/modules/gallery/helpers/random.php +++ b/modules/gallery/helpers/random.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access."); /** * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2010 Bharat Mediratta + * Copyright (C) 2000-2011 Bharat Mediratta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,9 +42,13 @@ class random_Core { } /** - * Return a random number between 0 and mt_getrandmax() + * Return a random number between $min and $max. If $min and $max are not specified, + * return a random number between 0 and mt_getrandmax() */ - static function int() { + static function int($min=null, $max=null) { + if ($min || $max) { + return mt_rand($min, $max); + } return mt_rand(); } }
\ No newline at end of file |