Added functionality to keep privacy settings when bookmarks exported via API.
[scuttle] / api / posts_all.php
index 0831d9fa12c55f351d39b70dce1b897ab20b96bf..747741a695b94f0bf28f01a419a7976fa1f67335 100644 (file)
@@ -45,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<post href=\"". filter($row['bAddress'], 'xml') .'" description="'. filter($row['bTitle'], 'xml') .'" '. $description .'hash="'. md5($row['bAddress']) . ($row['bStatus'] ? '" shared="no' : '') .'" tag="'. filter($taglist, 'xml') .'" time="'. gmdate('Y-m-d\TH:i:s\Z', strtotime($row['bDatetime'])) ."\" />\r\n";
+    echo "\t<post href=\"". filter($row['bAddress'], 'xml') .'" shared="' . $shared . '" description="'. filter($row['bTitle'], 'xml') .'" '. $description .'hash="'. md5($row['bAddress']) . ($row['bStatus'] ? '" shared="no' : '') .'" tag="'. filter($taglist, 'xml') .'" time="'. gmdate('Y-m-d\TH:i:s\Z', strtotime($row['bDatetime'])) ."\" />\r\n";
 }
 
 echo '</posts>';

Benjamin Mako Hill || Want to submit a patch?