X-Git-Url: https://projects.mako.cc/source/scuttle/blobdiff_plain/c7f63c8b9b12efd7b3c10b9f80cda06eaf32068f..1685ba1f8af80489da4f092a0adcced47a60e9fa:/import.php?ds=inline diff --git a/import.php b/import.php index f45da13..5f0c5ee 100644 --- a/import.php +++ b/import.php @@ -1,7 +1,6 @@ isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['size'] > 0) { $userinfo = $userservice->getCurrentUser(); if (isset($_POST['status']) && is_numeric($_POST['status'])) { - $status = intval($_POST['status']); - } else { - $status = 2; + $status = intval($_POST['status']); + } + else { + $status = 2; } $depth = array(); @@ -49,11 +51,12 @@ if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['si } xml_parser_free($xml_parser); header('Location: '. createURL('bookmarks', $userinfo[$userservice->getFieldName('username')])); -} else { - $templatename = 'importDelicious.tpl'; - $tplVars['subtitle'] = T_('Import Bookmarks from del.icio.us'); - $tplVars['formaction'] = createURL('import'); - $templateservice->loadTemplate($templatename, $tplVars); +} +else { + $templatename = 'importDelicious.tpl'; + $tplVars['subtitle'] = T_('Import Bookmarks from del.icio.us'); + $tplVars['formaction'] = createURL('import'); + $templateservice->loadTemplate($templatename, $tplVars); } function startElement($parser, $name, $attrs) { @@ -77,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; @@ -93,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.');