]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
New feature: website thumbnail
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Tue, 11 Mar 2008 12:36:23 +0000 (12:36 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Tue, 11 Mar 2008 12:36:23 +0000 (12:36 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@62 b3834d28-1941-0410-a4f8-b48e95affb8f

config.inc.php.example
scuttle.css
templates/bookmarks.tpl.php
tests/tag2TagTest.php

index f6f7e45ed9a1634e4dfd78f776e50ef9162e48e9..1adc7404b7eb980368a4c8fd87e4d0e20d8c293b 100644 (file)
@@ -91,6 +91,8 @@ $dbname = 'scuttle';
 # enableCommonTagDescription     : true or false
 # enableCommonBookmarkDescription : true or false
 #
+# enableWebsiteThumbnails : true or false.  According to artviper.net license, buy a license if you gain profit with your pages. (see http://www.websitethumbnail.de/)
+#
 ######################################################################
 
 $sitename           = 'SemanticScuttle';
@@ -131,5 +133,8 @@ $antispamAnswer = 'semanticscuttle';
 $enableCommonTagDescription = true;
 $enableCommonBookmarkDescription = true;
 
+$enableWebsiteThumbnails = true;   // see above, if you gain profit with your pages
+
+
 include_once('debug.inc.php');
 ?>
index 2303ff4af9aa6dd11cb8ec9c9cafa0442b1b0f00..1e80cb152cf61b1239c1a6226cb8c74b1dc11221 100644 (file)
@@ -163,6 +163,13 @@ html > body ol#bookmarks {
     margin: 0 1em;
     padding: 0;
 }
+img.thumbnail {
+    float: left;
+    padding: 1px;
+    margin-right: 6px;
+    margin-bottom:4px;
+    border:1px solid #AAA;
+}
 div.link a {
     color: blue;
     font-size: medium;
index e4cfe0462d1e9997bd260515534d6524c1242ebb..90d1e58ad2f3b3deef78b867d9c2310bd164807a 100644 (file)
@@ -157,6 +157,9 @@ window.onload = playerLoad;
         
         // Output
         echo '<li class="xfolkentry'. $access .'">'."\n";
+       if ($GLOBALS['enableWebsiteThumbnails']) {
+           echo '<a href="'. $address .'"'. $rel .' ><img class="thumbnail" src="http://www.artviper.net/screenshots/screener.php?sdx=1024&sdy=768&w=90&h=68&url='.$address.'"></a>';
+       }
         echo '<div class="link"><a href="'. $address .'"'. $rel .' class="taggedlink">'. filter($row['bTitle']) ."</a></div>\n";
         if ($row['bDescription'] != '') {
             echo '<div class="description">'. filter($row['bDescription']) ."</div>\n";
@@ -164,6 +167,7 @@ window.onload = playerLoad;
        if(!isset($hash)) {
            echo '<div class="address">'.$address.'</div>';
        }
+
         echo '<div class="meta">'. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . $cats . $copy . $edit ."</div>\n";
         echo "</li>\n";
     }
index 87dde52a32807611615ef3907f52a79e9f081d45..ea0adf0a7d804dd0caf75c0faf9c0ac05b34c422 100644 (file)
@@ -321,7 +321,7 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
        $this->assertTrue($tsts->existStat('a', '>', 10));
        $this->assertFalse($tsts->existStat('a', '>', 20));
        $tsts->increaseNbUpdate('a', '>', 10);
-       $this->assertSame(1, $tsts->getNbUpdate('a', '>', 10));
+       $this->assertSame(1, $tsts->getNbUpdates('a', '>', 10));
 
        $tsts->deleteAll();
 
@@ -339,11 +339,11 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
        $tts->addLinkedTags('a', 'b', '>', 1);
        $tts->addLinkedTags('b', 'e', '>', 1);
 
-       $this->assertSame(3, $tsts->getNbUpdate('a', '>', '1'));
-       $this->assertSame(2, $tsts->getNbUpdate('b', '>', '1'));
-       $this->assertSame(0, $tsts->getNbUpdate('c', '>', '1'));
-       $this->assertSame(0, $tsts->getNbUpdate('d', '>', '1'));
-       $this->assertSame(0, $tsts->getNbUpdate('e', '>', '1'));
+       $this->assertSame(3, $tsts->getNbUpdates('a', '>', '1'));
+       $this->assertSame(2, $tsts->getNbUpdates('b', '>', '1'));
+       $this->assertSame(0, $tsts->getNbUpdates('c', '>', '1'));
+       $this->assertSame(0, $tsts->getNbUpdates('d', '>', '1'));
+       $this->assertSame(0, $tsts->getNbUpdates('e', '>', '1'));
 
 
        $nbC = $tsts->getNbChildren('a', '>', 1);
@@ -391,6 +391,29 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
        $this->assertSame(3, $nbD);
        $this->assertSame(2, $maxDepth);
 
+       //do cases for synonyms
+
+       $tsts->deleteAll();
+       $tts->deleteAll();
+
+       $tts->addLinkedTags('a', 'b', '>', 1);
+       $tts->addLinkedTags('b', 'c', '=', 1);
+       /*$tts->addLinkedTags('a', 'c', '>', 1);
+       $tts->addLinkedTags('j', 'i', '=', 1);
+       $tts->addLinkedTags('f', 'i', '=', 1);
+       $tts->addLinkedTags('d', 'f', '>', 1);
+       $tts->addLinkedTags('d', 'e', '>', 1);
+       $tts->addLinkedTags('j', 'k', '>', 1);*/
+
+       $nbC = $tsts->getNbChildren('a', '>', 1);
+       $nbD = $tsts->getNbDescendants('a', '>', 1);
+       $nbU = $tsts->getNbUpdates('a', '>', 1);
+       $maxDepth = $tsts->getMaxDepth('a', '>', 1);
+       //$this->assertSame(2, $tts->getLinkedTags('a', '>', 1));
+       $this->assertSame(1, $nbC);
+       $this->assertSame(2, $nbD);
+       $this->assertSame(2, $nbU);
+       $this->assertSame(1, $maxDepth);
 
        // advanced case with fore loop
        //$tts->addLinkedTags('d', 'c', '>', 1);
@@ -398,5 +421,36 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
        // advanced case with back loop
        //$tts->addLinkedTags('e', 'a', '>', 1);
     }
+
+    public function testRenameFunction()
+    {
+       $tts = $this->tts;
+       $ts = $this->ts;
+       $bs = $this->bs;
+       $tsts = $this->tsts;
+
+       // with classic tags (users 10 & 20)
+       $tags = array('a', 'b', 'c');
+       $bs->addBookmark("http://site1.com", "title", "description", "status", $tags, null, false, false, 10);
+
+       $tags = array('a', 'b', 'c');
+       $bs->addBookmark("http://site2.com", "title", "description", "status", $tags, null, false, false, 20);
+
+       $bookmarks = $bs->getBookmarks(0, NULL, 10, 'a');
+       $this->assertSame(array(), $bookmarks);
+
+       $ts->renameTag(10, 'a', 'ddd');
+       $tags1 = $ts->getTagsForBookmark(1);
+       $this->assertSame(array('b', 'c', 'ddd'), $tags1);
+       
+
+       // with linked tags
+
+       $tts->addLinkedTags('b', 'c', '>', 1);
+       $tts->addLinkedTags('a', 'd', '>', 1);
+
+       //with stats
+
+    }
 }
 ?>