summaryrefslogtreecommitdiffstatshomepage
path: root/services/tagservice.php
diff options
context:
space:
mode:
authorGravatar mensonge2008-01-09 15:51:35 +0000
committerGravatar mensonge2008-01-09 15:51:35 +0000
commitef9143907f1ea6600a6c66065f0e18ac42f3535b (patch)
tree37382b6d5b8df60670cd5efecbcfd388d68d06e8 /services/tagservice.php
parentb1c3fbad478b43080e7506243d3fb77465a599d4 (diff)
downloadscuttle-ef9143907f1ea6600a6c66065f0e18ac42f3535b.tar.gz
scuttle-ef9143907f1ea6600a6c66065f0e18ac42f3535b.zip
Structured tags '>' for each user
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@3 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'services/tagservice.php')
-rw-r--r--services/tagservice.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/services/tagservice.php b/services/tagservice.php
index 6bfbf15..509e575 100644
--- a/services/tagservice.php
+++ b/services/tagservice.php
@@ -86,6 +86,25 @@ class TagService {
}
}
+ // Create links between tags
+ foreach($tags as $key => $tag) {
+ // case ">"
+ $pieces = explode('>', $tag);
+ $nbPieces = count($pieces);
+ if($nbPieces > 1) {
+ for($i = 0; $i < $nbPieces-1; $i++) {
+ $bs =& ServiceFactory::getServiceInstance('BookmarkService');
+ $tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+
+ $bookmark = $bs->getBookmark($bookmarkid);
+ $uId = $bookmark['uId'];
+ $tts->addLinkedTags($pieces[$i], $pieces[$i+1], '>', $uId);
+ }
+ $tags[$key] = $pieces[$nbPieces-1]; // Attach just the last tag to the bookmark
+ }
+
+ }
+
// Add the categories to the DB.
for ($i = 0; $i < count($tags); $i++) {
if ($tags[$i] != '') {
@@ -356,8 +375,14 @@ class TagService {
return $output;
}
+ function deleteAll() {
+ $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';
+ $this->db->sql_query($query);
+ }
+
+
// Properties
function getTableName() { return $this->tablename; }
function setTableName($value) { $this->tablename = $value; }
}
-?> \ No newline at end of file
+?>