exit();
}
+$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
+if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
+ $_ut = "strftime('%s','now')";
+} else {
+ $_ut = "UNIX_TIMESTAMP()";
+}
+
+//FIXME: Detect when user adds a known URL
$query = OC_DB::prepare("
- INSERT IGNORE INTO *PREFIX*bookmarks
+ INSERT INTO *PREFIX*bookmarks
(url, title, description, user_id, public, added, lastmodified)
- VALUES (?, ?, ?, ?, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())
+ VALUES (?, ?, ?, ?, 0, $_ut, $_ut)
");
+
$params=array(
urldecode($_GET["url"]),
urldecode($_GET["title"]),
$query->execute($params);
$b_id = OC_DB::insertid();
+
if($b_id !== false) {
$query = OC_DB::prepare("
INSERT INTO *PREFIX*bookmarks_tags
$offset = isset($_GET["page"]) ? intval($_GET["page"]) * 10 : 0;
$params[] = $offset;
+$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
+if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
+ $_gc_separator = ", ' '";
+} else {
+ $_gc_separator = "SEPARATOR ' '";
+}
+
//FIXME: bookmarks without tags are not being retrieved
$query = OC_DB::prepare("
- SELECT url, title, description, GROUP_CONCAT( tag SEPARATOR ' ' ) AS tags
+ SELECT url, title, description, GROUP_CONCAT( tag $_gc_separator ) AS tags
FROM *PREFIX*bookmarks, *PREFIX*bookmarks_tags
WHERE *PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id
AND *PREFIX*bookmarks.user_id = ?