diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-01-28 14:55:07 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-01-28 14:55:07 +0000 |
commit | 3ef7b27643328861ab47bc1cfd8596bc747b5a09 (patch) | |
tree | 22ad2cd5d4742e9472ef3ea0d56af733a6bddf5b /services/tag2tagservice.php | |
parent | e740849d4c37dca5634e0ac39ffb6dfdb2aedf1e (diff) | |
download | semanticscuttle-3ef7b27643328861ab47bc1cfd8596bc747b5a09.tar.gz semanticscuttle-3ef7b27643328861ab47bc1cfd8596bc747b5a09.tar.bz2 |
new feature: structured tags, add synonym link
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@29 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'services/tag2tagservice.php')
-rw-r--r-- | services/tag2tagservice.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/services/tag2tagservice.php b/services/tag2tagservice.php index f46ef7c..d37ab8b 100644 --- a/services/tag2tagservice.php +++ b/services/tag2tagservice.php @@ -59,7 +59,7 @@ class Tag2TagService { if($uId != null) { $query.= " AND uId = '".$uId."'"; } - +//die($query); if (! ($dbresult =& $this->db->sql_query_limit($query, $limit)) ){ message_die(GENERAL_ERROR, 'Could not get related tags', '', __LINE__, __FILE__, $query, $this->db); return false; @@ -69,6 +69,7 @@ class Tag2TagService { $output = array(); foreach($rowset as $row) { if(!in_array($row['tag'], $stopList)) { + $output[] = $row['tag']; } } @@ -89,19 +90,18 @@ class Tag2TagService { $asFlatList = true; //we disable the tree list parameter for the moment if(in_array($tag1, $stopList)) { - return $tag1; + return array(); } - $stopList2 = $stopList; - $stopList2[] = $tag1; - $linkedTags = $this->getLinkedTags($tag1, $relationType, $uId, false, $stopList2); + $stopList[] = $tag1; + $linkedTags = $this->getLinkedTags($tag1, $relationType, $uId, false, $stopList); if($relationType != '=') { - $linkedTags = array_merge($linkedTags, $this->getLinkedTags($tag1, '=', $uId, false, $stopList2)); + $linkedTags = array_merge($linkedTags, $this->getLinkedTags($tag1, '=', $uId, false, $stopList)); } if(count($linkedTags) == 0) { - return $tag1; + return array(); } else { $output = array(); if($asFlatList == true) { @@ -110,13 +110,13 @@ class Tag2TagService { $output = array('node'=>$tag1); } - $stopList[] = $tag1; foreach($linkedTags as $linkedTag) { $allLinkedTags = $this->getAllLinkedTags($linkedTag, $relationType, $uId, $asFlatList, $stopList); if($asFlatList == true) { + $output[] = $linkedTag; if(is_array($allLinkedTags)) { - $output[] = $linkedTag; + $output = array_merge($output, $allLinkedTags); } else { $output[] = $allLinkedTags; |