summaryrefslogtreecommitdiff
path: root/www/importNetscape.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2013-03-18 22:18:09 +0100
committerChristian Weiske <cweiske@cweiske.de>2013-03-18 23:06:41 +0100
commit943d149e31f5774208ce6619d1503d9c89ae72ae (patch)
treec41d813262a4565f8602d0023ddb1a1d8fdcbebb /www/importNetscape.php
parenta67a7f761d7f0b4567ba8e9903fbcae075df4c73 (diff)
downloadsemanticscuttle-943d149e31f5774208ce6619d1503d9c89ae72ae.tar.gz
semanticscuttle-943d149e31f5774208ce6619d1503d9c89ae72ae.tar.bz2
Fix bug #109: preserve privacy setting from Delicious export files.
Thanks for David Glenck for the initial version of this patch.
Diffstat (limited to 'www/importNetscape.php')
-rw-r--r--www/importNetscape.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/www/importNetscape.php b/www/importNetscape.php
index b476c40..a014b95 100644
--- a/www/importNetscape.php
+++ b/www/importNetscape.php
@@ -67,6 +67,8 @@ if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['si
$bDatetime = ""; //bDateTime optional
$bCategories = ""; //bCategories optional
+ $bPrivateNote = ""; //bPrivateNote optional
+ $bPrivate = $status; //bPrivate set default
foreach ($attributes[0] as $attribute) {
$att = preg_split('/\s*=\s*/s', $attribute, 2);
@@ -86,6 +88,11 @@ if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['si
break;
case "NOTE":
$bPrivateNote = $attrVal;
+ break;
+ case "PRIVATE":
+ if ($attrVal) {
+ $bPrivate = 2;//private
+ }
}
}
$bTitle = trim($titles[$i]);
@@ -102,7 +109,7 @@ if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['si
$bDatetime = gmdate('Y-m-d H:i:s');
}
- if ($bookmarkservice->addBookmark($bAddress, $bTitle, $bDescription, $bPrivateNote, $status, $bCategories, null, $bDatetime, false, true)) {
+ if ($bookmarkservice->addBookmark($bAddress, $bTitle, $bDescription, $bPrivateNote, $bPrivate, $bCategories, null, $bDatetime, false, true)) {
$countImportedBookmarks++;
} else {
$tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.');