diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-04-17 08:02:09 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-04-17 08:02:09 +0000 |
commit | 3e2854611b5d73687a701b24dc58fd56d79be09d (patch) | |
tree | 4fad2b7ffa9e126613519a5e6d08a491d4723284 /services | |
parent | 39cf52851529c0d91d69307186c6bf5e9f362735 (diff) | |
download | semanticscuttle-3e2854611b5d73687a701b24dc58fd56d79be09d.tar.gz semanticscuttle-3e2854611b5d73687a701b24dc58fd56d79be09d.tar.bz2 |
New feature: menu box which displays tags included into the special tag menu [Config modified]
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@105 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'services')
-rw-r--r-- | services/tag2tagservice.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/services/tag2tagservice.php b/services/tag2tagservice.php index ee26a11..8b2b731 100644 --- a/services/tag2tagservice.php +++ b/services/tag2tagservice.php @@ -188,6 +188,31 @@ class Tag2TagService { return $this->db->sql_fetchrowset($dbresult); } + function getMenuTags($uId) { + if(strlen($GLOBALS['menuTag']) < 1) { + return array(); + } else { + // we don't use the getAllLinkedTags function in order to improve performance + $query = "SELECT tag2 as 'tag', COUNT(tag2) as 'count'"; + $query.= " FROM `". $this->getTableName() ."`"; + $query.= " WHERE tag1 = '".$GLOBALS['menuTag']."'"; + $query.= " AND relationType = '>'"; + if($uId > 0) { + $query.= " AND uId = '".$uId."'"; + } + $query.= " GROUP BY tag2"; + $query.= " ORDER BY count DESC"; + $query.= " LIMIT 0, ".$GLOBALS['maxSizeMenuBlock']; + + if (! ($dbresult =& $this->db->sql_query($query)) ){ + message_die(GENERAL_ERROR, 'Could not get linked tags', '', __LINE__, __FILE__, $query, $this->db); + return false; + } + return $this->db->sql_fetchrowset($dbresult); + } + } + + function existsLinkedTags($tag1, $tag2, $relationType, $uId) { $query = "SELECT tag1, tag2, relationType, uId FROM `". $this->getTableName() ."`"; $query.= " WHERE tag1 = '" .$tag1 ."'"; |