summaryrefslogtreecommitdiffstatshomepage
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/tables.sqlite.sql207
-rw-r--r--data/templates/default/bookmarkcommondescriptionedit.tpl.php9
-rw-r--r--data/templates/default/bookmarks.tpl.php2
-rw-r--r--data/templates/default/sidebar.block.menu.php2
-rw-r--r--data/templates/default/tagcommondescriptionedit.tpl.php9
-rw-r--r--data/templates/minimal/bookmarkcommondescriptionedit.tpl.php9
-rw-r--r--data/templates/minimal/bookmarks.tpl.php2
-rw-r--r--data/templates/minimal/sidebar.block.menu.php2
-rw-r--r--data/templates/minimal/tagcommondescriptionedit.tpl.php9
-rw-r--r--data/templates/sscuttlizr/bookmarkcommondescriptionedit.tpl.php9
-rw-r--r--data/templates/sscuttlizr/bookmarks.tpl.php3
-rw-r--r--data/templates/sscuttlizr/importStructure.tpl.php10
-rw-r--r--data/templates/sscuttlizr/sidebar.block.menu.php2
-rw-r--r--data/templates/sscuttlizr/sidebar.linkedtags.inc.php2
-rw-r--r--data/templates/sscuttlizr/tagcommondescriptionedit.tpl.php9
15 files changed, 262 insertions, 24 deletions
diff --git a/data/tables.sqlite.sql b/data/tables.sqlite.sql
new file mode 100644
index 0000000..b7265cc
--- /dev/null
+++ b/data/tables.sqlite.sql
@@ -0,0 +1,207 @@
+-- Semantic Scuttle - Tables creation SQL script
+-- ! Dont forget to change table names according to $tableprefix defined in config.php !
+
+--
+-- Table structure for table `sc_bookmarks`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_bookmarks` (
+ `bId` integer NOT NULL,
+ `uId` int(11) NOT NULL default '0',
+ `bIp` varchar(40) default NULL,
+ `bStatus` tinyint(1) NOT NULL default '0',
+ `bDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
+ `bModified` datetime NOT NULL default '0000-00-00 00:00:00',
+ `bTitle` varchar(255) NOT NULL default '',
+ `bAddress` varchar(1500) NOT NULL,
+ `bDescription` text default NULL,
+ `bPrivateNote` text default NULL,
+ `bHash` varchar(32) NOT NULL default '',
+ `bVotes` int(11) NOT NULL default '0',
+ `bVoting` int(11) NOT NULL default '0',
+ `bShort` varchar(16) default NULL,
+ PRIMARY KEY (`bId`)
+);
+
+CREATE INDEX IF NOT EXISTS `sc_bookmarks_usd` ON `sc_bookmarks` (`uId`, `bStatus`, `bDatetime`);
+CREATE INDEX IF NOT EXISTS `sc_bookmarks_hui` ON `sc_bookmarks` (`bHash`, `uId`, `bId`);
+CREATE INDEX IF NOT EXISTS `sc_bookmarks_du` ON `sc_bookmarks` (`bDatetime`, `uId`);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `sc_tags`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_tags` (
+ `tId` integer NOT NULL,
+ `tag` varchar(100) NOT NULL default '',
+ `uId` int(11) NOT NULL default '0',
+ `tDescription` text default NULL,
+ PRIMARY KEY (`tId`),
+ CONSTRAINT `sc_tags_tag_uId` UNIQUE (`tag`, `uId`)
+);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `sc_bookmarks2tags`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_bookmarks2tags` (
+ `id` integer NOT NULL,
+ `bId` int(11) NOT NULL default '0',
+ `tag` varchar(100) NOT NULL default '',
+ PRIMARY KEY (`id`),
+ CONSTRAINT `sc_bookmarks2tags_tag_bId` UNIQUE (`tag`,`bId`)
+);
+
+CREATE INDEX IF NOT EXISTS `sc_bookmarks2tags_bId` ON `sc_bookmarks2tags` (`bId`);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `sc_users`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_users` (
+ `uId` integer NOT NULL,
+ `username` varchar(25) NOT NULL default '',
+ `password` varchar(40) NOT NULL default '',
+ `uDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
+ `uModified` datetime NOT NULL default '0000-00-00 00:00:00',
+ `name` varchar(50) default NULL,
+ `email` varchar(50) NOT NULL default '',
+ `homepage` varchar(255) default NULL,
+ `uContent` text,
+ `privateKey` varchar(33) default NULL,
+ PRIMARY KEY (`uId`),
+ CONSTRAINT `privateKey` UNIQUE (`privateKey`)
+);
+
+-- --------------------------------------------------------
+
+CREATE TABLE IF NOT EXISTS `sc_users_sslclientcerts` (
+ `id` INTEGER NOT NULL ,
+ `uId` INT NOT NULL ,
+ `sslSerial` VARCHAR( 32 ) NOT NULL ,
+ `sslClientIssuerDn` VARCHAR( 1024 ) NOT NULL ,
+ `sslName` VARCHAR( 64 ) NOT NULL ,
+ `sslEmail` VARCHAR( 64 ) NOT NULL ,
+ PRIMARY KEY ( `id` )
+);
+
+--
+-- Table structure for table `sc_watched`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_watched` (
+ `wId` integer NOT NULL,
+ `uId` int(11) NOT NULL default '0',
+ `watched` int(11) NOT NULL default '0',
+ PRIMARY KEY (`wId`)
+);
+
+CREATE INDEX IF NOT EXISTS `sc_watched_uId` ON `sc_watched` (`uId`);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `sc_tags2tags`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_tags2tags` (
+ `ttId` integer NOT NULL,
+ `tag1` varchar(100) NOT NULL default '',
+ `tag2` varchar(100) NOT NULL default '',
+ `relationType` varchar(32) NOT NULL default '',
+ `uId` int(11) NOT NULL default '0',
+ PRIMARY KEY (`ttId`),
+ CONSTRAINT `sc_tags2tags_tag1_tag2_uId` UNIQUE (`tag1`,`tag2`,`relationType`,`uId`)
+);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `sc_tagsstats`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_tagsstats` (
+ `tstId` integer NOT NULL,
+ `tag1` varchar(100) NOT NULL default '',
+ `relationType` varchar(32) NOT NULL default '',
+ `uId` int(11) NOT NULL default '0',
+ `nb` int(11) NOT NULL default '0',
+ `depth` int(11) NOT NULL default '0',
+ `nbupdate` int(11) NOT NULL default '0',
+ PRIMARY KEY (`tstId`),
+ CONSTRAINT `sc_tagsstats_tag1_type_uId` UNIQUE (`tag1`,`relationType`,`uId`)
+);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `sc_tagscache`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_tagscache` (
+ `tcId` integer NOT NULL,
+ `tag1` varchar(100) NOT NULL default '',
+ `tag2` varchar(100) NOT NULL default '',
+ `relationType` varchar(32) NOT NULL default '',
+ `uId` int(11) NOT NULL default '0',
+ PRIMARY KEY (`tcId`),
+ CONSTRAINT `sc_tagscache_tag1_tag2_type_uId` UNIQUE (`tag1`,`tag2`,`relationType`,`uId`)
+);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `sc_commondescription`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_commondescription` (
+ `cdId` integer NOT NULL,
+ `uId` int(11) NOT NULL default '0',
+ `tag` varchar(100) NOT NULL default '',
+ `bHash` varchar(32) NOT NULL default '',
+ `cdTitle` varchar(255) NOT NULL default '',
+ `cdDescription` text default NULL,
+ `cdDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`cdId`),
+ CONSTRAINT `sc_commondescription_tag_datetime` UNIQUE (`tag`,`CDDATETIME`),
+ CONSTRAINT `sc_commondescription_bookmark_datetime` UNIQUE (`bHash`,`cdDatetime`)
+);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `sc_searchhistory`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_searchhistory` (
+ `shId` integer NOT NULL,
+ `shTerms` varchar(255) NOT NULL default '',
+ `shRange` varchar(32) NOT NULL default '',
+ `shDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
+ `shNbResults` int(6) NOT NULL default '0',
+ `uId` int(11) NOT NULL default '0',
+ PRIMARY KEY (`shId`)
+);
+
+
+CREATE TABLE IF NOT EXISTS `sc_votes` (
+ `bId` INT NOT NULL ,
+ `uId` INT NOT NULL ,
+ `vote` INT( 2 ) NOT NULL ,
+ CONSTRAINT `bid_2` UNIQUE (`bId`,`uId`)
+);
+
+CREATE INDEX IF NOT EXISTS `bId` ON `sc_votes` (`bId`);
+CREATE INDEX IF NOT EXISTS `uId` ON `sc_votes` (`uId`);
+
+
+CREATE TABLE IF NOT EXISTS `sc_version` (
+ `schema_version` int(11) NOT NULL
+);
+INSERT INTO `sc_version` (`schema_version`) VALUES ('6');
diff --git a/data/templates/default/bookmarkcommondescriptionedit.tpl.php b/data/templates/default/bookmarkcommondescriptionedit.tpl.php
index 807c58b..306086e 100644
--- a/data/templates/default/bookmarkcommondescriptionedit.tpl.php
+++ b/data/templates/default/bookmarkcommondescriptionedit.tpl.php
@@ -30,8 +30,13 @@ window.onload = function() {
if(strlen($description['cdDatetime'])>0) {
echo T_('Last modification:').' '.$description['cdDatetime'].', ';
$lastUser = $userservice->getUser($description['uId']);
- echo '<a href="'.createURL('profile', $lastUser['username']).'">'
- . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ if ($lastUser) {
+ echo '<a href="'.createURL('profile', $lastUser['username']).'">'
+ . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ }
+ else {
+ echo 'Unknown user';
+ }
}
?>
</td>
diff --git a/data/templates/default/bookmarks.tpl.php b/data/templates/default/bookmarks.tpl.php
index 2a3d169..0f88a60 100644
--- a/data/templates/default/bookmarks.tpl.php
+++ b/data/templates/default/bookmarks.tpl.php
@@ -86,7 +86,7 @@ if ($userservice->isLoggedOn()) {
/* personal tag description */
if($currenttag!= '' && $user!='') {
$userObject = $userservice->getUserByUsername($user);
- if($tagservice->getDescription($currenttag, $userObject['uId'])) { ?>
+ if($userObject && $tagservice->getDescription($currenttag, $userObject['uId'])) { ?>
<p class="commondescription"><?php
$pDescription = $tagservice->getDescription($currenttag, $userObject['uId']);
diff --git a/data/templates/default/sidebar.block.menu.php b/data/templates/default/sidebar.block.menu.php
index 94a9fa2..dfb2c25 100644
--- a/data/templates/default/sidebar.block.menu.php
+++ b/data/templates/default/sidebar.block.menu.php
@@ -63,7 +63,7 @@ if (sizeof($menuTags) > 0 || ($userid != 0 && $userid === $logged_on_userid)) {
</table>
<?php $cUser = $userservice->getUser($userid); ?>
-<?php if($userid>0): ?>
+<?php if($cUser && $userid>0): ?>
<?php if($userid==$logged_on_userid): ?>
<p style="text-align:right"><a href="<?php echo createURL('alltags', $cUser['username']); ?>" title="<?php echo T_('See all your tags')?>"><?php echo T_('all your tags'); ?></a> →</p>
<?php else: ?>
diff --git a/data/templates/default/tagcommondescriptionedit.tpl.php b/data/templates/default/tagcommondescriptionedit.tpl.php
index 207cfd2..f52d5b0 100644
--- a/data/templates/default/tagcommondescriptionedit.tpl.php
+++ b/data/templates/default/tagcommondescriptionedit.tpl.php
@@ -20,8 +20,13 @@ window.onload = function() {
if(strlen($description['cdDatetime'])>0) {
echo T_('Last modification:').' '.$description['cdDatetime'].', ';
$lastUser = $userservice->getUser($description['uId']);
- echo '<a href="' . createURL('profile', $lastUser['username']) . '">'
- . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ if ($lastUser) {
+ echo '<a href="' . createURL('profile', $lastUser['username']) . '">'
+ . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ }
+ else {
+ echo 'Unknown user';
+ }
}
?>
</td>
diff --git a/data/templates/minimal/bookmarkcommondescriptionedit.tpl.php b/data/templates/minimal/bookmarkcommondescriptionedit.tpl.php
index b1114d7..4629d72 100644
--- a/data/templates/minimal/bookmarkcommondescriptionedit.tpl.php
+++ b/data/templates/minimal/bookmarkcommondescriptionedit.tpl.php
@@ -33,8 +33,13 @@ window.onload = function() {
if(strlen($description['cdDatetime'])>0) {
echo T_('Last modification:').' '.$description['cdDatetime'].', ';
$lastUser = $userservice->getUser($description['uId']);
- echo '<a href="'.createURL('profile', $lastUser['username']).'">'
- . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ if ($lastUser) {
+ echo '<a href="'.createURL('profile', $lastUser['username']).'">'
+ . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ }
+ else {
+ echo 'Unknown user';
+ }
}
?>
</td>
diff --git a/data/templates/minimal/bookmarks.tpl.php b/data/templates/minimal/bookmarks.tpl.php
index 1510d44..86749bc 100644
--- a/data/templates/minimal/bookmarks.tpl.php
+++ b/data/templates/minimal/bookmarks.tpl.php
@@ -87,7 +87,7 @@ if ($userservice->isLoggedOn()) {
/* personal tag description */
if($currenttag!= '' && $user!='') {
$userObject = $userservice->getUserByUsername($user);
- if($tagservice->getDescription($currenttag, $userObject['uId'])) { ?>
+ if($userObject && $tagservice->getDescription($currenttag, $userObject['uId'])) { ?>
<p class="commondescription"><?php
$pDescription = $tagservice->getDescription($currenttag, $userObject['uId']);
diff --git a/data/templates/minimal/sidebar.block.menu.php b/data/templates/minimal/sidebar.block.menu.php
index 94a9fa2..dfb2c25 100644
--- a/data/templates/minimal/sidebar.block.menu.php
+++ b/data/templates/minimal/sidebar.block.menu.php
@@ -63,7 +63,7 @@ if (sizeof($menuTags) > 0 || ($userid != 0 && $userid === $logged_on_userid)) {
</table>
<?php $cUser = $userservice->getUser($userid); ?>
-<?php if($userid>0): ?>
+<?php if($cUser && $userid>0): ?>
<?php if($userid==$logged_on_userid): ?>
<p style="text-align:right"><a href="<?php echo createURL('alltags', $cUser['username']); ?>" title="<?php echo T_('See all your tags')?>"><?php echo T_('all your tags'); ?></a> →</p>
<?php else: ?>
diff --git a/data/templates/minimal/tagcommondescriptionedit.tpl.php b/data/templates/minimal/tagcommondescriptionedit.tpl.php
index e46c184..bde2ff8 100644
--- a/data/templates/minimal/tagcommondescriptionedit.tpl.php
+++ b/data/templates/minimal/tagcommondescriptionedit.tpl.php
@@ -24,8 +24,13 @@ window.onload = function() {
if(strlen($description['cdDatetime'])>0) {
echo T_('Last modification:').' '.$description['cdDatetime'].', ';
$lastUser = $userservice->getUser($description['uId']);
- echo '<a href="' . createURL('profile', $lastUser['username']) . '">'
- . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ if ($lastUser) {
+ echo '<a href="' . createURL('profile', $lastUser['username']) . '">'
+ . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ }
+ else {
+ echo 'Unknown user';
+ }
}
?>
</td>
diff --git a/data/templates/sscuttlizr/bookmarkcommondescriptionedit.tpl.php b/data/templates/sscuttlizr/bookmarkcommondescriptionedit.tpl.php
index b1114d7..4629d72 100644
--- a/data/templates/sscuttlizr/bookmarkcommondescriptionedit.tpl.php
+++ b/data/templates/sscuttlizr/bookmarkcommondescriptionedit.tpl.php
@@ -33,8 +33,13 @@ window.onload = function() {
if(strlen($description['cdDatetime'])>0) {
echo T_('Last modification:').' '.$description['cdDatetime'].', ';
$lastUser = $userservice->getUser($description['uId']);
- echo '<a href="'.createURL('profile', $lastUser['username']).'">'
- . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ if ($lastUser) {
+ echo '<a href="'.createURL('profile', $lastUser['username']).'">'
+ . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ }
+ else {
+ echo 'Unknown user';
+ }
}
?>
</td>
diff --git a/data/templates/sscuttlizr/bookmarks.tpl.php b/data/templates/sscuttlizr/bookmarks.tpl.php
index 217043c..c87a337 100644
--- a/data/templates/sscuttlizr/bookmarks.tpl.php
+++ b/data/templates/sscuttlizr/bookmarks.tpl.php
@@ -87,7 +87,7 @@ if ($userservice->isLoggedOn()) {
/* personal tag description */
if($currenttag!= '' && $user!='') {
$userObject = $userservice->getUserByUsername($user);
- if($tagservice->getDescription($currenttag, $userObject['uId'])) { ?>
+ if($userObject && $tagservice->getDescription($currenttag, $userObject['uId'])) { ?>
<p class="commondescription"><?php
$pDescription = $tagservice->getDescription($currenttag, $userObject['uId']);
@@ -511,6 +511,7 @@ if ($currenttag!= '') {
include 'bookmarks-vote-horizontal.inc.tpl.php';
//echo " </div>\n";
echo '<div class="qr-code"></div>';
+ echo " </div>\n";
echo " </li>\n";
}
?>
diff --git a/data/templates/sscuttlizr/importStructure.tpl.php b/data/templates/sscuttlizr/importStructure.tpl.php
index 9c54612..580330a 100644
--- a/data/templates/sscuttlizr/importStructure.tpl.php
+++ b/data/templates/sscuttlizr/importStructure.tpl.php
@@ -24,11 +24,11 @@ $this->includeTemplate($GLOBALS['top_include']);
<p><?php echo T_('Create your structure into a simple text file and following this model:');?></p>
<ul>
<li>firstTagOfLevel1</li>
- <li>&nbsp;&nbsp;&nbsp;&nbsp;firstTagOfLevel2 <i>(the line starts with two spaces)</i></li>
- <li>&nbsp;&nbsp;&nbsp;&nbsp;secondTagOfLevel2</li>
- <li>&nbsp;&nbsp;&nbsp;&nbsp;thirdTagOfLevel2</li>
+ <li>&#160;&#160;&#160;&#160;firstTagOfLevel2 <i>(the line starts with two spaces)</i></li>
+ <li>&#160;&#160;&#160;&#160;secondTagOfLevel2</li>
+ <li>&#160;&#160;&#160;&#160;thirdTagOfLevel2</li>
<li>secondTagOfLevel1</li>
- <li>&nbsp;&nbsp;&nbsp;&nbsp;fourthTagOfLevel2 <i>(included into secondTagOfLevel1)</i></li>
+ <li>&#160;&#160;&#160;&#160;fourthTagOfLevel2 <i>(included into secondTagOfLevel1)</i></li>
</ul>
</li>
<li>
@@ -39,4 +39,4 @@ $this->includeTemplate($GLOBALS['top_include']);
<?php
$this->includeTemplate($GLOBALS['bottom_include']);
-?> \ No newline at end of file
+?>
diff --git a/data/templates/sscuttlizr/sidebar.block.menu.php b/data/templates/sscuttlizr/sidebar.block.menu.php
index 94a9fa2..dfb2c25 100644
--- a/data/templates/sscuttlizr/sidebar.block.menu.php
+++ b/data/templates/sscuttlizr/sidebar.block.menu.php
@@ -63,7 +63,7 @@ if (sizeof($menuTags) > 0 || ($userid != 0 && $userid === $logged_on_userid)) {
</table>
<?php $cUser = $userservice->getUser($userid); ?>
-<?php if($userid>0): ?>
+<?php if($cUser && $userid>0): ?>
<?php if($userid==$logged_on_userid): ?>
<p style="text-align:right"><a href="<?php echo createURL('alltags', $cUser['username']); ?>" title="<?php echo T_('See all your tags')?>"><?php echo T_('all your tags'); ?></a> →</p>
<?php else: ?>
diff --git a/data/templates/sscuttlizr/sidebar.linkedtags.inc.php b/data/templates/sscuttlizr/sidebar.linkedtags.inc.php
index 020d0f0..aef00f0 100644
--- a/data/templates/sscuttlizr/sidebar.linkedtags.inc.php
+++ b/data/templates/sscuttlizr/sidebar.linkedtags.inc.php
@@ -28,7 +28,7 @@ function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode
$output.= '<td></td>';
$output.= '<td>';
$output.= $level == 1?'<b>':'';
- $output.= str_repeat('&nbsp;', $level*2) .$link.'<a href="'. sprintf($cat_url, filter($user, 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>';
+ $output.= str_repeat('&#160;', $level*2) .$link.'<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);
diff --git a/data/templates/sscuttlizr/tagcommondescriptionedit.tpl.php b/data/templates/sscuttlizr/tagcommondescriptionedit.tpl.php
index e46c184..bde2ff8 100644
--- a/data/templates/sscuttlizr/tagcommondescriptionedit.tpl.php
+++ b/data/templates/sscuttlizr/tagcommondescriptionedit.tpl.php
@@ -24,8 +24,13 @@ window.onload = function() {
if(strlen($description['cdDatetime'])>0) {
echo T_('Last modification:').' '.$description['cdDatetime'].', ';
$lastUser = $userservice->getUser($description['uId']);
- echo '<a href="' . createURL('profile', $lastUser['username']) . '">'
- . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ if ($lastUser) {
+ echo '<a href="' . createURL('profile', $lastUser['username']) . '">'
+ . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>';
+ }
+ else {
+ echo 'Unknown user';
+ }
}
?>
</td>