]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
new feature: structured tags, add synonym link
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Mon, 28 Jan 2008 14:55:07 +0000 (14:55 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Mon, 28 Jan 2008 14:55:07 +0000 (14:55 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@29 b3834d28-1941-0410-a4f8-b48e95affb8f

locales/fr_FR/LC_MESSAGES/messages.mo
locales/fr_FR/LC_MESSAGES/messages.po
locales/messages.po
services/tag2tagservice.php
services/tagservice.php
templates/editbookmark.tpl.php
templates/sidebar.block.linked.php
tests/tag2TagTest.php

index c068266ec7a1559d42925a94a73832707778d04e..c075f597b1e8258ac97407a3a6ff8e047452d753 100644 (file)
Binary files a/locales/fr_FR/LC_MESSAGES/messages.mo and b/locales/fr_FR/LC_MESSAGES/messages.mo differ
index 5b1e1d5a49db497997d89e763306bf6c2d58d817..a7b6171986bd60b4ba95ba7ece26d8febdc9fe5e 100644 (file)
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Scuttle\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-01-22 16:54+0100\n"
-"PO-Revision-Date: 2008-01-22 16:55+0100\n"
+"POT-Creation-Date: 2008-01-28 15:37+0100\n"
+"PO-Revision-Date: 2008-01-28 15:54+0100\n"
 "Last-Translator: BenjaminHKB <benjamin.huynh-kim-bang@loria.fr>\n"
 "Language-Team: fr-FR <toony.sf@chezouam.net>\n"
 "MIME-Version: 1.0\n"
@@ -633,66 +633,70 @@ msgstr "Séparés par des virgules"
 msgid "Note: use \">\" to include one tag in another. e.g.: europe>france>paris"
 msgstr "Note: utiliser \">\" pour inclure un tag dans un autre. ex: europe>france>paris"
 
-#: ../../../templates/editbookmark.tpl.php:53
+#: ../../../templates/editbookmark.tpl.php:54
+msgid "Note: use \"=\" to make synonym two tags. e.g.: france=frenchcountry"
+msgstr "Note : utiliser \"=\" pour rendre deux tags synonymes ex: europe=eu"
+
+#: ../../../templates/editbookmark.tpl.php:57
 #: ../../../templates/importDelicious.tpl.php:15
 #: ../../../templates/importNetscape.tpl.php:16
 msgid "Privacy"
 msgstr "Vision"
 
-#: ../../../templates/editbookmark.tpl.php:56
+#: ../../../templates/editbookmark.tpl.php:60
 #: ../../../templates/importDelicious.tpl.php:18
 #: ../../../templates/importNetscape.tpl.php:19
 msgid "Public"
 msgstr "Publique"
 
-#: ../../../templates/editbookmark.tpl.php:57
+#: ../../../templates/editbookmark.tpl.php:61
 msgid "Shared with Watch List"
 msgstr "Partagé avec liste d'accès"
 
-#: ../../../templates/editbookmark.tpl.php:58
+#: ../../../templates/editbookmark.tpl.php:62
 #: ../../../templates/importDelicious.tpl.php:20
 #: ../../../templates/importNetscape.tpl.php:21
 msgid "Private"
 msgstr "Privée"
 
-#: ../../../templates/editbookmark.tpl.php:70
+#: ../../../templates/editbookmark.tpl.php:74
 msgid "Delete Bookmark"
 msgstr "Supprimer le signet"
 
-#: ../../../templates/editbookmark.tpl.php:97
+#: ../../../templates/editbookmark.tpl.php:101
 msgid "Bookmarklet"
 msgstr "Bookmarklet"
 
-#: ../../../templates/editbookmark.tpl.php:98
+#: ../../../templates/editbookmark.tpl.php:102
 #, php-format
 msgid "Drag one of the following bookmarklets to your browser's bookmarks and click it whenever you want to add the page you are on to %s"
 msgstr "Déplacez l'un des 'bookmarklet' suivants dans les marques-pages de votre navigateur et cliquez dessus chaque fois que vous souhaitez ajouter un signet pour la page courante dans %s "
 
-#: ../../../templates/editbookmark.tpl.php:110
+#: ../../../templates/editbookmark.tpl.php:114
 #, php-format
 msgid "Post to %s"
 msgstr "Ajouter à %s"
 
-#: ../../../templates/editbookmark.tpl.php:111
+#: ../../../templates/editbookmark.tpl.php:115
 #, php-format
 msgid "Post to %s (Pop-up)"
 msgstr "Ajouter à %s (Pop-up)"
 
-#: ../../../templates/editbookmark.tpl.php:115
+#: ../../../templates/editbookmark.tpl.php:119
 #: ../../../templates/importDelicious.tpl.php:26
 #: ../../../templates/importNetscape.tpl.php:27
 msgid "Import"
 msgstr "Importer"
 
-#: ../../../templates/editbookmark.tpl.php:117
+#: ../../../templates/editbookmark.tpl.php:121
 msgid "Import bookmarks from bookmark file"
 msgstr "Importer les signets depuis un fichier"
 
-#: ../../../templates/editbookmark.tpl.php:117
+#: ../../../templates/editbookmark.tpl.php:121
 msgid "Internet Explorer, Mozilla Firefox and Netscape"
 msgstr "Internet Explorer, Mozilla Firefox et Netscape"
 
-#: ../../../templates/editbookmark.tpl.php:118
+#: ../../../templates/editbookmark.tpl.php:122
 msgid "Import bookmarks from del.icio.us"
 msgstr "Importer les signets depuis del.icio.us"
 
@@ -851,11 +855,11 @@ msgstr "Enregistrez-vous ici pour créer un compte gratuit %s. Toutes les inform
 msgid "Antispam question"
 msgstr "Question antispam"
 
-#: ../../../templates/sidebar.block.linked.php:72
+#: ../../../templates/sidebar.block.linked.php:97
 msgid "Linked Tags"
 msgstr "Tags structurés"
 
-#: ../../../templates/sidebar.block.linked.php:75
+#: ../../../templates/sidebar.block.linked.php:100
 msgid "plus"
 msgstr "plus"
 
index a5301eb47973e40c6b06e99331a6843262d4c8d0..acd75741aa970b48f6acd96324f8ce3a4fa34bdf 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-01-22 16:54+0100\n"
+"POT-Creation-Date: 2008-01-28 15:37+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -620,68 +620,72 @@ msgid ""
 "Note: use \">\" to include one tag in another. e.g.: europe>france>paris"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:53
+#: ../../../templates/editbookmark.tpl.php:54
+msgid "Note: use \"=\" to make synonym two tags. e.g.: france=frenchcountry"
+msgstr ""
+
+#: ../../../templates/editbookmark.tpl.php:57
 #: ../../../templates/importDelicious.tpl.php:15
 #: ../../../templates/importNetscape.tpl.php:16
 msgid "Privacy"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:56
+#: ../../../templates/editbookmark.tpl.php:60
 #: ../../../templates/importDelicious.tpl.php:18
 #: ../../../templates/importNetscape.tpl.php:19
 msgid "Public"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:57
+#: ../../../templates/editbookmark.tpl.php:61
 msgid "Shared with Watch List"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:58
+#: ../../../templates/editbookmark.tpl.php:62
 #: ../../../templates/importDelicious.tpl.php:20
 #: ../../../templates/importNetscape.tpl.php:21
 msgid "Private"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:70
+#: ../../../templates/editbookmark.tpl.php:74
 msgid "Delete Bookmark"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:97
+#: ../../../templates/editbookmark.tpl.php:101
 msgid "Bookmarklet"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:98
+#: ../../../templates/editbookmark.tpl.php:102
 #, php-format
 msgid ""
 "Drag one of the following bookmarklets to your browser's bookmarks and click "
 "it whenever you want to add the page you are on to %s"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:110
+#: ../../../templates/editbookmark.tpl.php:114
 #, php-format
 msgid "Post to %s"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:111
+#: ../../../templates/editbookmark.tpl.php:115
 #, php-format
 msgid "Post to %s (Pop-up)"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:115
+#: ../../../templates/editbookmark.tpl.php:119
 #: ../../../templates/importDelicious.tpl.php:26
 #: ../../../templates/importNetscape.tpl.php:27
 msgid "Import"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:117
+#: ../../../templates/editbookmark.tpl.php:121
 msgid "Import bookmarks from bookmark file"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:117
+#: ../../../templates/editbookmark.tpl.php:121
 msgid "Internet Explorer, Mozilla Firefox and Netscape"
 msgstr ""
 
-#: ../../../templates/editbookmark.tpl.php:118
+#: ../../../templates/editbookmark.tpl.php:122
 msgid "Import bookmarks from del.icio.us"
 msgstr ""
 
@@ -853,11 +857,11 @@ msgstr ""
 msgid "Antispam question"
 msgstr ""
 
-#: ../../../templates/sidebar.block.linked.php:72
+#: ../../../templates/sidebar.block.linked.php:97
 msgid "Linked Tags"
 msgstr ""
 
-#: ../../../templates/sidebar.block.linked.php:75
+#: ../../../templates/sidebar.block.linked.php:100
 msgid "plus"
 msgstr ""
 
index f46ef7c1bf941b6939290a45e659ee99baca7056..d37ab8bd7f2087727760533ad7739a8734046870 100644 (file)
@@ -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;
index 509e5759d0879a81f939fa5b36b26ae01f965cee..bbf35746c366fc4e31155e5e24256ac110c6631c 100644 (file)
@@ -86,22 +86,37 @@ class TagService {
             }
         }
 
+       $bs =& ServiceFactory::getServiceInstance('BookmarkService');
+       $tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+
        // 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
-           }
+           if(strpos($tag, '=')) {
+                   // case "="
+                   $pieces = explode('=', $tag);
+                   $nbPieces = count($pieces);
+                   if($nbPieces > 1) {
+                       for($i = 0; $i < $nbPieces-1; $i++) {               
+                           $bookmark = $bs->getBookmark($bookmarkid);
+                           $uId = $bookmark['uId'];
+                           $tts->addLinkedTags($pieces[$i], $pieces[$i+1], '=', $uId);
+                       }
+                       $tags[$key] = $pieces[0]; // Attach just the last tag to the bookmark
+                   }
+           } else {
+                   // case ">"
+                   $pieces = explode('>', $tag);
+                   $nbPieces = count($pieces);
+                   if($nbPieces > 1) {
+                       for($i = 0; $i < $nbPieces-1; $i++) {               
+                           $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
+                   }
+           }    
+
 
        }
 
index f7076685cef8cf9dfe3539ad908c24e77a3217c2..31014315e772b263337dd6f2e1ea0060303ef725 100644 (file)
@@ -49,6 +49,10 @@ window.onload = function() {
     <th></th>
     <td align="right"><small><?php echo T_('Note: use ">" to include one tag in another. e.g.: europe>france>paris')?><small></td>
 </tr>
+<tr>
+    <th></th>
+    <td align="right"><small><?php echo T_('Note: use "=" to make synonym two tags. e.g.: france=frenchcountry')?><small></td>
+</tr>
 <tr>
     <th align="left"><?php echo T_('Privacy'); ?></th>
     <td>
index 24ca7e6e766e21e6af7846372037935a1a8762cf..74516ae78fe9573fadf63869a0eacf4a894ffa8f 100644 (file)
@@ -3,15 +3,30 @@ $tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
 $userservice =& ServiceFactory::getServiceInstance('UserService');
 
 function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode =false, $precedentTag =null, $level=0, $stopList=array()) {
+
+    if(in_array($tag, $stopList)) {
+       return array('output' => '', 'stoplist' => $stopList);
+    }
+
     $tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
     $tagstatservice =& ServiceFactory::getServiceInstance('TagStatService');
 
     $output = '';
     $output.= '<tr>';
     $output.= '<td></td>';
-    $output.= '<td>'. str_repeat('&nbsp;', $level*2) .'<a href="'. sprintf($cat_url, filter($user, 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>';
+    $output.= '<td>';
+    $output.= $level ==  0?'<b>':'';
+    $output.= str_repeat('&nbsp;', $level*2) .'<a href="'. sprintf($cat_url, filter($user, 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>';
+    $output.= $level ==  1?'</b>':'';
     //$output.= ' - '. $tagstatservice->getMaxDepth($tag, $linkType, $uId);
 
+    $synonymTags = $tag2tagservice->getAllLinkedTags($tag, '=', $uId);
+    $synonymTags = is_array($synonymTags)?$synonymTags:array($synonymTags);
+    sort($synonymTags);
+    foreach($synonymTags as $synonymTag) {
+       $output.= ", ".$synonymTag;
+    }
+
     if($editingMode) {
        $output.= ' (';
        $output.= '<a href="'.createURL('tag2tagadd', $tag).'">add</a>';
@@ -24,16 +39,26 @@ function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode
     $output.= '</td>';
     $output.= '</tr>';
 
-    if(!in_array($tag, $stopList)) {
-       $linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $uId);
-       $precedentTag = $tag;
-       $stopList[] = $tag;
-       $level = $level + 1;
-       foreach($linkedTags as $linkedTag) {
-           $output.= displayLinkedTags($linkedTag, $linkType, $uId, $cat_url, $user, $editingMode, $precedentTag, $level, $stopList);
-        }
-    }
-    return $output;
+    $tags = array($tag);
+    $tags = array_merge($tags, $synonymTags);
+    foreach($tags as $tag) {
+
+           if(!in_array($tag, $stopList)) {
+               $linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $uId);
+               $precedentTag = $tag;
+               $stopList[] = $tag;
+               foreach($linkedTags as $linkedTag) {
+                   $displayLinkedTags = displayLinkedTags($linkedTag, $linkType, $uId, $cat_url, $user, $editingMode, $precedentTag, $level + 1, $stopList);
+                   $output.= $displayLinkedTags['output'];
+               }
+               if(is_array($displayLinkedTags['stopList'])) {
+                   $stopList = array_merge($stopList, $displayLinkedTags['stopList']);
+                   $stopList = array_unique($stopList);
+               }
+           }
+
+    }  
+    return array('output' => $output, 'stopList' => $stopList);
 }
 
 $logged_on_userid = $userservice->getCurrentUserId();
@@ -59,7 +84,7 @@ if ($currenttag) {
 if(count($explodedTags) > 0) {
     $displayLinkedZone = false;
     foreach($explodedTags as $explodedTag) {
-       if($tag2tagservice->getLinkedTags($explodedTag, '>', $userid)) {
+       if($tag2tagservice->getLinkedTags($explodedTag, '>', $userid) || $tag2tagservice->getLinkedTags($explodedTag, '>', $userid, true) || $tag2tagservice->getLinkedTags($explodedTag, '=', $userid)) {
            $displayLinkedZone = true;    
            break;
        }
@@ -86,8 +111,26 @@ if(count($explodedTags) > 0) {
        } else {
            $editingMode = false;
        }
+       $stopList = array();
        foreach($explodedTags as $explodedTag) {
-               echo displayLinkedTags($explodedTag, '>', $userid, $cat_url, $user, $editingMode);
+           if(!in_array($explodedTag, $stopList)) {
+               // fathers tag
+               $fatherTags = $tag2tagservice->getLinkedTags($explodedTag, '>', $userid, true);
+               if(count($fatherTags)>0) {
+                   foreach($fatherTags as $fatherTag) {
+                       echo '<tr><td>';
+                       echo '<a href="'. sprintf($cat_url, filter($user, 'url'), filter($fatherTag, 'url')) .'" rel="tag">('. filter($fatherTag) .')</a>';
+                       echo '</td></tr>';
+                   }
+               }
+
+               $displayLinkedTags = displayLinkedTags($explodedTag, '>', $userid, $cat_url, $user, $editingMode, null, 0);
+               echo $displayLinkedTags['output'];
+               if(is_array($displayLinkedTags['stopList'])) {
+                   $stopList = array_merge($stopList, $displayLinkedTags['stopList']);
+               }
+           }
+
        }
     ?>
     </table>
index 83e7dbc68c90628583a5ac06bdd04c863a94acf6..9a72eb8da84d3e29ddcc81c02248ed54636b9620 100644 (file)
@@ -44,6 +44,9 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
 
        // basic test
 
+       $allLinkedTags = $tts->getAllLinkedTags('e', '>', 1, true); // as flat list
+       $this->assertEquals(array(), $allLinkedTags);
+
        $allLinkedTags = $tts->getAllLinkedTags('d', '>', 1, true); // as flat list
        $this->assertEquals(array('e'), $allLinkedTags);
 
@@ -125,8 +128,10 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
        $this->assertTrue(in_array('d', $linkedTags)); // '=' is bijective
 
        // test allLinkTags (with inference)
+       $allLinkedTags = $tts->getAllLinkedTags('a', '=', 1, true); // as flat list
+       $this->assertEquals(0, sizeof($allLinkedTags));
+
        $allLinkedTags = $tts->getAllLinkedTags('b', '=', 1, true); // as flat list
-       $this->assertEquals(array('d', 'e', 'f'), $allLinkedTags);
        $this->assertEquals(3, sizeof($allLinkedTags));
        $this->assertTrue(in_array('d', $allLinkedTags));
        $this->assertTrue(in_array('e', $allLinkedTags));
@@ -149,19 +154,36 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
        $this->assertTrue(in_array('f', $allLinkedTags));
        $this->assertTrue(in_array('g', $allLinkedTags));
 
+       $tts->addLinkedTags('g', 'h', '>', 1);
+       $tts->addLinkedTags('i', 'h', '=', 1);
+       $tts->addLinkedTags('j', 'f', '>', 1);
+
+       $allLinkedTags = $tts->getAllLinkedTags('j', '>', 1, true); // as flat list
+       $this->assertEquals(8, sizeof($allLinkedTags));
+       $this->assertTrue(in_array('b', $allLinkedTags));
+       $this->assertTrue(in_array('c', $allLinkedTags));
+       $this->assertTrue(in_array('d', $allLinkedTags));
+       $this->assertTrue(in_array('e', $allLinkedTags));
+       $this->assertTrue(in_array('f', $allLinkedTags));
+       $this->assertTrue(in_array('g', $allLinkedTags));
+       $this->assertTrue(in_array('h', $allLinkedTags));
+       $this->assertTrue(in_array('i', $allLinkedTags));
+
        // complex case: test cycle
        $tts->addLinkedTags('g', 'a', '>', 1);
        $allLinkedTags = $tts->getAllLinkedTags('b', '>', 1, true); // as flat list
-       $this->assertEquals(6, sizeof($allLinkedTags));
+       $this->assertEquals(8, sizeof($allLinkedTags));
        $this->assertTrue(in_array('a', $allLinkedTags));
        $this->assertTrue(in_array('c', $allLinkedTags));
        $this->assertTrue(in_array('d', $allLinkedTags));
        $this->assertTrue(in_array('e', $allLinkedTags));
        $this->assertTrue(in_array('f', $allLinkedTags));
        $this->assertTrue(in_array('g', $allLinkedTags));
+       $this->assertTrue(in_array('h', $allLinkedTags));
+       $this->assertTrue(in_array('i', $allLinkedTags));
 
     }
-/*
+
     // Test function that select the best tags to display? 
     public function testViewTag2TagRelations()
     {
@@ -207,17 +229,19 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
    public function testAddLinkedTagsThroughBookmarking()
     {
        $bs = $this->bs;
-       $tags = array('a>b', 'b>c', 'a>d>e', 'a>a', 'a');
+       $tags = array('a>b', 'b>c', 'a>d>e', 'a>a', 'a', 'r=s', 's=t=u');
        $bs->addBookmark("http://google.com", "title", "description", "status", $tags, null, false, false, 1);
        $bookmark = $bs->getBookmarkByAddress("http://google.com");
 
        $ts = $this->ts;
        $savedTags = $ts->getTagsForBookmark(intval($bookmark['bId']));
-       $this->assertEquals(4, sizeof($savedTags));
+       $this->assertEquals(6, sizeof($savedTags));
        $this->assertContains('b', $savedTags);
        $this->assertContains('c', $savedTags);
        $this->assertContains('e', $savedTags);
        $this->assertContains('a', $savedTags);
+       $this->assertContains('r', $savedTags);
+       $this->assertContains('s', $savedTags);
 
        $tts = $this->tts;
        $linkedTags = $tts->getLinkedTags('a', '>', 1);
@@ -240,7 +264,7 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
        $bs->addBookmark("web1.com", "B1", "description", "status", $tags, null, false, false, 1);
        $tags = array('bb>gg', 'ee>ff');
        $bs->addBookmark("web2.com", "B2", "description", "status", $tags, null, false, false, 1);
-       $tags = array('ee');
+       $tags = array('ee=ii');
        $bs->addBookmark("web3.com", "B3", "description", "status", $tags, null, false, false, 1);
 
        // Query format:
@@ -263,8 +287,13 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
 
        $results = $bs->getBookmarks(0, NULL, 1, 'ee');
        $this->assertSame(2, intval($results['total']));
-       $this->assertSame('B2', $results['bookmarks'][0]['bTitle']);
-       $this->assertSame('B3', $results['bookmarks'][1]['bTitle']);
+       $this->assertSame('B2', $results['bookmarks'][1]['bTitle']);
+       $this->assertSame('B3', $results['bookmarks'][0]['bTitle']);
+
+       $results = $bs->getBookmarks(0, NULL, 1, 'ii');
+       $this->assertSame(2, intval($results['total']));
+       $this->assertSame('B2', $results['bookmarks'][1]['bTitle']);
+       $this->assertSame('B3', $results['bookmarks'][0]['bTitle']);
 
        $results = $bs->getBookmarks(0, NULL, 1, 'aa+ee');
        $this->assertSame(1, intval($results['total']));
@@ -362,6 +391,6 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
 
        // advanced case with back loop
        //$tts->addLinkedTags('e', 'a', '>', 1);
-    }*/
+    }
 }
 ?>