aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/tags.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-21 17:16:11 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-21 17:16:11 +0000
commit009d3a5df1f35717a52d17b3b39ccdcd892bb94e (patch)
treec9f00b6a2a6277ff765f69ccbbd632a9584bf7bb /engine/lib/tags.php
parentf48adf4356dccf8d7769e12421a6ca4fdf6925dc (diff)
downloadelgg-009d3a5df1f35717a52d17b3b39ccdcd892bb94e.tar.gz
elgg-009d3a5df1f35717a52d17b3b39ccdcd892bb94e.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Tag cloud for files git-svn-id: https://code.elgg.org/elgg/trunk@674 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/tags.php')
-rw-r--r--engine/lib/tags.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/engine/lib/tags.php b/engine/lib/tags.php
index 9b675c018..9055a1d02 100644
--- a/engine/lib/tags.php
+++ b/engine/lib/tags.php
@@ -16,9 +16,8 @@
* The algorithm working out the size of font based on the number of tags.
* This is quick and dirty.
*/
- function calculate_tag_size($min, $max, $number_of_tags)
+ function calculate_tag_size($min, $max, $number_of_tags, $buckets = 6)
{
- $buckets = 6;
$delta = (($max - $min) / $buckets);
$thresholds = array();
@@ -45,7 +44,7 @@
* @param array $tags The array of tags.
* @return An associated array of tags with a weighting, this can then be mapped to a display class.
*/
- function generate_tag_cloud(array $tags)
+ function generate_tag_cloud(array $tags, $buckets = 6)
{
$cloud = array();
@@ -61,7 +60,7 @@
}
foreach ($cloud as $k => $v)
- $cloud[$k] = calculate_tag_size($min, $max, $v);
+ $cloud[$k] = calculate_tag_size($min, $max, $v, $buckets);
return $cloud;
}