New feature: website thumbnail
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@62 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
3707bd1bd3
commit
7428a3467c
4 changed files with 76 additions and 6 deletions
|
@ -91,6 +91,8 @@ $dbname = 'scuttle';
|
||||||
# enableCommonTagDescription : true or false
|
# enableCommonTagDescription : true or false
|
||||||
# enableCommonBookmarkDescription : 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';
|
$sitename = 'SemanticScuttle';
|
||||||
|
@ -131,5 +133,8 @@ $antispamAnswer = 'semanticscuttle';
|
||||||
$enableCommonTagDescription = true;
|
$enableCommonTagDescription = true;
|
||||||
$enableCommonBookmarkDescription = true;
|
$enableCommonBookmarkDescription = true;
|
||||||
|
|
||||||
|
$enableWebsiteThumbnails = true; // see above, if you gain profit with your pages
|
||||||
|
|
||||||
|
|
||||||
include_once('debug.inc.php');
|
include_once('debug.inc.php');
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -163,6 +163,13 @@ html > body ol#bookmarks {
|
||||||
margin: 0 1em;
|
margin: 0 1em;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
img.thumbnail {
|
||||||
|
float: left;
|
||||||
|
padding: 1px;
|
||||||
|
margin-right: 6px;
|
||||||
|
margin-bottom:4px;
|
||||||
|
border:1px solid #AAA;
|
||||||
|
}
|
||||||
div.link a {
|
div.link a {
|
||||||
color: blue;
|
color: blue;
|
||||||
font-size: medium;
|
font-size: medium;
|
||||||
|
|
|
@ -157,6 +157,9 @@ window.onload = playerLoad;
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
echo '<li class="xfolkentry'. $access .'">'."\n";
|
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";
|
echo '<div class="link"><a href="'. $address .'"'. $rel .' class="taggedlink">'. filter($row['bTitle']) ."</a></div>\n";
|
||||||
if ($row['bDescription'] != '') {
|
if ($row['bDescription'] != '') {
|
||||||
echo '<div class="description">'. filter($row['bDescription']) ."</div>\n";
|
echo '<div class="description">'. filter($row['bDescription']) ."</div>\n";
|
||||||
|
@ -164,6 +167,7 @@ window.onload = playerLoad;
|
||||||
if(!isset($hash)) {
|
if(!isset($hash)) {
|
||||||
echo '<div class="address">'.$address.'</div>';
|
echo '<div class="address">'.$address.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<div class="meta">'. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . $cats . $copy . $edit ."</div>\n";
|
echo '<div class="meta">'. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . $cats . $copy . $edit ."</div>\n";
|
||||||
echo "</li>\n";
|
echo "</li>\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,7 +321,7 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
|
||||||
$this->assertTrue($tsts->existStat('a', '>', 10));
|
$this->assertTrue($tsts->existStat('a', '>', 10));
|
||||||
$this->assertFalse($tsts->existStat('a', '>', 20));
|
$this->assertFalse($tsts->existStat('a', '>', 20));
|
||||||
$tsts->increaseNbUpdate('a', '>', 10);
|
$tsts->increaseNbUpdate('a', '>', 10);
|
||||||
$this->assertSame(1, $tsts->getNbUpdate('a', '>', 10));
|
$this->assertSame(1, $tsts->getNbUpdates('a', '>', 10));
|
||||||
|
|
||||||
$tsts->deleteAll();
|
$tsts->deleteAll();
|
||||||
|
|
||||||
|
@ -339,11 +339,11 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
|
||||||
$tts->addLinkedTags('a', 'b', '>', 1);
|
$tts->addLinkedTags('a', 'b', '>', 1);
|
||||||
$tts->addLinkedTags('b', 'e', '>', 1);
|
$tts->addLinkedTags('b', 'e', '>', 1);
|
||||||
|
|
||||||
$this->assertSame(3, $tsts->getNbUpdate('a', '>', '1'));
|
$this->assertSame(3, $tsts->getNbUpdates('a', '>', '1'));
|
||||||
$this->assertSame(2, $tsts->getNbUpdate('b', '>', '1'));
|
$this->assertSame(2, $tsts->getNbUpdates('b', '>', '1'));
|
||||||
$this->assertSame(0, $tsts->getNbUpdate('c', '>', '1'));
|
$this->assertSame(0, $tsts->getNbUpdates('c', '>', '1'));
|
||||||
$this->assertSame(0, $tsts->getNbUpdate('d', '>', '1'));
|
$this->assertSame(0, $tsts->getNbUpdates('d', '>', '1'));
|
||||||
$this->assertSame(0, $tsts->getNbUpdate('e', '>', '1'));
|
$this->assertSame(0, $tsts->getNbUpdates('e', '>', '1'));
|
||||||
|
|
||||||
|
|
||||||
$nbC = $tsts->getNbChildren('a', '>', 1);
|
$nbC = $tsts->getNbChildren('a', '>', 1);
|
||||||
|
@ -391,6 +391,29 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
|
||||||
$this->assertSame(3, $nbD);
|
$this->assertSame(3, $nbD);
|
||||||
$this->assertSame(2, $maxDepth);
|
$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
|
// advanced case with fore loop
|
||||||
//$tts->addLinkedTags('d', 'c', '>', 1);
|
//$tts->addLinkedTags('d', 'c', '>', 1);
|
||||||
|
@ -398,5 +421,36 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
|
||||||
// advanced case with back loop
|
// advanced case with back loop
|
||||||
//$tts->addLinkedTags('e', 'a', '>', 1);
|
//$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
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue