From b01990ebfc133371a8458c2231ff1b94891bd54b Mon Sep 17 00:00:00 2001 From: Mike Sheldon Date: Fri, 24 Dec 2010 15:10:25 +0000 Subject: [PATCH] Make caching period customisable when creating tag clouds --- nixtape/data/TagCloud.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixtape/data/TagCloud.php b/nixtape/data/TagCloud.php index d5d32ee1..095bff3e 100644 --- a/nixtape/data/TagCloud.php +++ b/nixtape/data/TagCloud.php @@ -34,7 +34,7 @@ class TagCloud { * inaccurate @param float $max_font_size maximum font size (px, em, %, etc) * @return array tagcloud */ - static function generateTagCloud($table, $field, $limit = 40, $constraint = null, $constrained_field = false) { + static function generateTagCloud($table, $field, $limit = 40, $constraint = null, $constrained_field = false, $cache_period = 7200) { global $adodb; if (!is_string($field)) return false; if (!is_string($table)) return false; @@ -57,7 +57,7 @@ class TagCloud { } $query .= ' GROUP BY ' . $field . ' ORDER BY count DESC LIMIT ' . $limit; $adodb->SetFetchMode(ADODB_FETCH_ASSOC); - $res = $adodb->CacheGetAll(7200,$query); + $res = $adodb->CacheGetAll($cache_period, $query); if (!$res) { throw new Exception('ERROR ' . $query); } else { -- GitLab