From: Benjamin Mako Hill Date: Sun, 8 Apr 2012 19:21:20 +0000 (-0400) Subject: Merge branch 'autocomplete-tags' X-Git-Url: https://projects.mako.cc/source/scuttle/commitdiff_plain/050b5adfe71a4d515996dcb24dcdf070feb014bb?hp=7e8b3ec9903f52ae787c67f27761ed3a7baf6d11 Merge branch 'autocomplete-tags' --- diff --git a/api/posts_all.php b/api/posts_all.php index 4f05d39..747741a 100644 --- a/api/posts_all.php +++ b/api/posts_all.php @@ -8,6 +8,9 @@ require_once 'httpauth.inc.php'; require_once '../header.inc.php'; +// set user as logged in so private bookmarks are exported +$loggedon = true; + $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService'); $userservice =& ServiceFactory::getServiceInstance('UserService'); @@ -42,8 +45,14 @@ foreach($bookmarks['bookmarks'] as $row) { } else { $taglist = 'system:unfiled'; } + // The privacy setting in scuttle is to set bStatus to 2 in the database. + if(trim($row['bStatus']) == '2') { + $shared = "no"; + } else { + $shared = "yes"; + } - echo "\t\r\n"; + echo "\t\r\n"; } echo ''; diff --git a/api/posts_get.php b/api/posts_get.php index d54f86a..2c875ec 100644 --- a/api/posts_get.php +++ b/api/posts_get.php @@ -54,8 +54,14 @@ foreach ($bookmarks['bookmarks'] as $row) { } else { $taglist = 'system:unfiled'; } + // The privacy setting in scuttle is to set bStatus to 2 in database. + if(trim($row['bStatus']) == '2') { + $shared = "no"; + } else { + $shared = "yes"; + } - echo "\t\r\n"; + echo "\t\r\n"; } echo ''; diff --git a/api/posts_recent.php b/api/posts_recent.php index 476eecb..38124d2 100644 --- a/api/posts_recent.php +++ b/api/posts_recent.php @@ -1,3 +1,4 @@ + \r\n"; + echo "\t\r\n"; } echo ''; diff --git a/config.inc.php.example b/config.inc.php.example index 9d52a2f..f690aee 100644 --- a/config.inc.php.example +++ b/config.inc.php.example @@ -64,14 +64,18 @@ $adminemail = 'admin@example.org'; # be considered recent. # defaultOrderBy: The default order in which bookmarks will appear. # Possible values are: -# date_desc - By date of entry descending. -# Latest entry first. (Default) -# date_asc - By date of entry ascending. -# Earliest entry first. -# title_desc - By title, descending alphabetically. -# title_asc - By title, ascending alphabetically. -# url_desc - By URL, descending alphabetically. -# url_asc - By URL, ascending alphabetically. +# date_desc - By date of entry descending. +# Latest entry first. (Default) +# date_asc - By date of entry ascending. +# Earliest entry first. +# mod_date_desc - By modification date descending. +# Latest modified entry first. +# mod_date_asc - By modification date ascending. +# Earliest modified entry first. +# title_desc - By title, descending alphabetically. +# title_asc - By title, ascending alphabetically. +# url_desc - By URL, descending alphabetically. +# url_asc - By URL, ascending alphabetically. # TEMPLATES_DIR: The directory where the template files should be # loaded from (the *.tpl.php files) # root : Set to NULL to autodetect the root url of the website diff --git a/import.php b/import.php index 9f29728..5f0c5ee 100644 --- a/import.php +++ b/import.php @@ -80,6 +80,9 @@ function startElement($parser, $name, $attrs) { case 'TIME': $bDatetime = $attrVal; break; + case 'PRIVATE': + $bStatus = (strcasecmp('yes', $attrVal) == 0) ? 2 : $status ; + break; case 'TAG': $tags = strtolower($attrVal); break; @@ -96,7 +99,7 @@ function startElement($parser, $name, $attrs) { $bDatetime = gmdate('Y-m-d H:i:s'); } - if ($bookmarkservice->addBookmark($bAddress, $bTitle, $bDescription, $status, $tags, $bDatetime, true, true)) + if ($bookmarkservice->addBookmark($bAddress, $bTitle, $bDescription, $bStatus, $tags, $bDatetime, true, true)) $tplVars['msg'] = T_('Bookmark imported.'); else $tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.'); diff --git a/includes/db/mysql4.php b/includes/db/mysql4.php index 0639518..f074e19 100644 --- a/includes/db/mysql4.php +++ b/includes/db/mysql4.php @@ -44,6 +44,8 @@ class sql_db { if (@mysql_select_db($this->dbname)) { + #Set utf-8 + mysql_query('SET CHARACTER SET utf8', $this->db_connect_id); return $this->db_connect_id; } } diff --git a/readme.txt b/readme.txt index 58a703b..faf788e 100644 --- a/readme.txt +++ b/readme.txt @@ -1,7 +1,9 @@ -Scuttle 0.9.0 +Scuttle (Development Snapshot) http://scuttle.org/ Copyright (C) 2004 - 2010 Marcus Campbell +Copyright (C) 2011 Thomas Niepraschk +Copyright (C) 2011 Benjamin Mako Hill Available under the GNU General Public License ============ @@ -12,4 +14,4 @@ INSTALLATION * Edit config.inc.php.example and save the changes as a new config.inc.php file in the same directory. -* Set the CHMOD permissions on the /cache/ subdirectory to 777 \ No newline at end of file +* Set the CHMOD permissions on the /cache/ subdirectory to 777 diff --git a/scuttle.css b/scuttle.css index fba6933..57b1ae0 100644 --- a/scuttle.css +++ b/scuttle.css @@ -181,6 +181,14 @@ div.meta { div.meta span { color: #F00; } +/* bookmark date fields: updated and created */ +div.meta span#date-updated { + color: #285; +} +div.meta span#date-original { + background: #eee; + color: #aaa; +} li.xfolkentry { border-bottom: 1px solid #DDD; margin-bottom: 0; diff --git a/services/bookmarkservice.php b/services/bookmarkservice.php index 2a8fb0d..3d532f6 100644 --- a/services/bookmarkservice.php +++ b/services/bookmarkservice.php @@ -276,6 +276,12 @@ class BookmarkService { case 'date_asc': $query_5 = ' ORDER BY B.bDatetime ASC '; break; + case 'mod_date_desc': + $query_5 = ' ORDER BY B.bModified DESC '; + break; + case 'mod_date_asc': + $query_5 = ' ORDER BY B.bModified ASC '; + break; case 'title_desc': $query_5 = ' ORDER BY B.bTitle DESC '; break; diff --git a/tables.sql b/tables.sql index 578fa06..84cf153 100644 --- a/tables.sql +++ b/tables.sql @@ -11,7 +11,7 @@ CREATE TABLE `sc_bookmarks` ( `bModified` datetime NOT NULL default '0000-00-00 00:00:00', `bTitle` varchar(255) NOT NULL default '', `bAddress` text NOT NULL, - `bDescription` varchar(255) default NULL, + `bDescription` varchar(1000) default NULL, `bHash` varchar(32) NOT NULL default '', PRIMARY KEY (`bId`), KEY `sc_bookmarks_usd` (`uId`,`bStatus`,`bDatetime`), @@ -65,4 +65,4 @@ CREATE TABLE `sc_watched` ( `watched` int(11) NOT NULL default '0', PRIMARY KEY (`wId`), KEY `sc_watched_uId` (`uId`) -); \ No newline at end of file +); diff --git a/templates/bookmarks.tpl.php b/templates/bookmarks.tpl.php index c79655e..a535590 100644 --- a/templates/bookmarks.tpl.php +++ b/templates/bookmarks.tpl.php @@ -100,7 +100,11 @@ if (count($bookmarks) > 0) { if ($row['bDescription'] != '') { echo '
'. filter($row['bDescription']) ."
\n"; } - echo '
'. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . $cats . $copy . $edit ."
\n"; + if ($row['bDatetime'] == $row['bModified']) { + echo '
'. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . $cats . $copy . $edit ."
\n"; + } else { + echo '
updated: '. date($GLOBALS['shortdate'], strtotime($row['bModified'])) . ', original: '. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . "" . $cats . $copy . $edit ."
\n"; + } echo "\n"; } ?> diff --git a/templates/editbookmark.tpl.php b/templates/editbookmark.tpl.php index 16b56c7..2304134 100644 --- a/templates/editbookmark.tpl.php +++ b/templates/editbookmark.tpl.php @@ -31,7 +31,7 @@ switch ($row['bStatus']) { - + @@ -69,7 +69,7 @@ switch ($row['bStatus']) { @@ -108,4 +108,4 @@ document.write('<\/ul>'); includeTemplate($GLOBALS['bottom_include']); -?> \ No newline at end of file +?> diff --git a/templates/toolbar.inc.php b/templates/toolbar.inc.php index 2eb56ac..023ed3b 100644 --- a/templates/toolbar.inc.php +++ b/templates/toolbar.inc.php @@ -10,6 +10,7 @@ if ($userservice->isLoggedOn()) {
  • +
  • '. $subtitle ."\n"; + echo '

    '. $subtitle; + if (isset($total)) { + echo " (" . $total . ")"; + } + echo "

    \n"; } if (isset($error)) { echo '

    '. $error ."

    \n";