aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2012-01-20 22:10:30 +0100
committerChristian Weiske <cweiske@cweiske.de>2012-01-20 22:10:30 +0100
commit6ff4370a20e7da8d02239b387cc0db296d7bf466 (patch)
tree0166e5a7b78779675507086326efd67b4fef9eb3 /www
parentd16ca9235157042604f23949f2fa6e479e882d7d (diff)
parentd6d44c6cfa7e3e5cdb36d9e4abd3a62edad74eb9 (diff)
downloadsemanticscuttle-6ff4370a20e7da8d02239b387cc0db296d7bf466.tar.gz
semanticscuttle-6ff4370a20e7da8d02239b387cc0db296d7bf466.tar.bz2
Merge branch '0.98'
Diffstat (limited to 'www')
-rw-r--r--www/ajaxGetTitle.php3
-rw-r--r--www/import.php29
-rw-r--r--www/rss.php7
-rw-r--r--www/themes/default/scuttle.css1
4 files changed, 32 insertions, 8 deletions
diff --git a/www/ajaxGetTitle.php b/www/ajaxGetTitle.php
index 8e5d92c..e1fbe30 100644
--- a/www/ajaxGetTitle.php
+++ b/www/ajaxGetTitle.php
@@ -50,7 +50,10 @@ function getTitle($url) {
$title = @mb_convert_encoding($title, 'UTF-8', $encoding);
}
+ $title = trim($title);
+
if (utf8_strlen($title) > 0) {
+ $title = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
return $title;
} else {
// No title, so return filename
diff --git a/www/import.php b/www/import.php
index 3aa2714..1293a2f 100644
--- a/www/import.php
+++ b/www/import.php
@@ -27,7 +27,9 @@ require_once 'www-header.php';
/* Managing all possible inputs */
// First input is $_FILES
// Other inputs
-isset($_POST['status']) ? define('POST_STATUS', $_POST['status']): define('POST_STATUS', $GLOBALS['defaults']['privacy']);
+isset($_POST['status'])
+ ? define('POST_STATUS', $_POST['status'])
+ : define('POST_STATUS', $GLOBALS['defaults']['privacy']);
if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['size'] > 0) {
@@ -54,6 +56,7 @@ if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['si
}
}
xml_parser_free($xml_parser);
+ //FIXME: show errors and warnings
header('Location: '. createURL('bookmarks', $userinfo->getUsername()));
} else {
$templatename = 'importDelicious.tpl';
@@ -70,7 +73,8 @@ function startElement($parser, $name, $attrs) {
$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark');
if ($name == 'POST') {
- while(list($attrTitle, $attrVal) = each($attrs)) {
+ $newstatus = $status;
+ while (list($attrTitle, $attrVal) = each($attrs)) {
switch ($attrTitle) {
case 'HREF':
$bAddress = $attrVal;
@@ -87,6 +91,11 @@ function startElement($parser, $name, $attrs) {
case 'TAG':
$tags = strtolower($attrVal);
break;
+ case 'PRIVATE':
+ if ($attrVal == 'yes') {
+ $newstatus = 2;
+ }
+ break;
}
}
if ($bookmarkservice->bookmarkExists($bAddress, $userservice->getCurrentUserId())) {
@@ -100,12 +109,20 @@ function startElement($parser, $name, $attrs) {
$bDatetime = gmdate('Y-m-d H:i:s');
}
- if ($bookmarkservice->addBookmark($bAddress, $bTitle, $bDescription, '', $status, $tags, null, $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.');
+ $res = $bookmarkservice->addBookmark(
+ $bAddress, $bTitle, $bDescription, '', $newstatus, $tags,
+ null, $bDatetime, true, true
+ );
+ if ($res) {
+ $tplVars['msg'] = T_('Bookmark imported.');
+ } else {
+ $tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.');
+ }
}
}
+ if (!isset($depth[$parser])) {
+ $depth[$parser] = 0;
+ }
$depth[$parser]++;
}
diff --git a/www/rss.php b/www/rss.php
index d888726..1f88944 100644
--- a/www/rss.php
+++ b/www/rss.php
@@ -124,7 +124,8 @@ if ($cat) {
}
$tplVars['feedtitle'] = filter($GLOBALS['sitename'] . (isset($pagetitle) ? $pagetitle : ''));
-$tplVars['feedlink'] = ROOT;
+$tplVars['pagelink'] = addProtocolToUrl(ROOT);
+$tplVars['feedlink'] = addProtocolToUrl(ROOT) . 'rss?sort=' . getSortOrder();
$tplVars['feeddescription'] = sprintf(T_('Recent bookmarks posted to %s'), $GLOBALS['sitename']);
$bookmarks = $bookmarkservice->getBookmarks(
@@ -137,6 +138,7 @@ $bookmarks_tmp = filter($bookmarks['bookmarks']);
$bookmarks_tpl = array();
$latestdate = null;
+$guidBaseUrl = addProtocolToUrl(ROOT) . '#';
foreach ($bookmarks_tmp as $key => $row) {
$_link = $row['bAddress'];
// Redirection option
@@ -154,7 +156,8 @@ foreach ($bookmarks_tmp as $key => $row) {
'description' => $row['bDescription'],
'creator' => SemanticScuttle_Model_UserArray::getName($row),
'pubdate' => $_pubdate,
- 'tags' => $row['tags']
+ 'tags' => $row['tags'],
+ 'guid' => $guidBaseUrl . $row['bId'],
);
}
unset($bookmarks_tmp);
diff --git a/www/themes/default/scuttle.css b/www/themes/default/scuttle.css
index 9e87857..f37377d 100644
--- a/www/themes/default/scuttle.css
+++ b/www/themes/default/scuttle.css
@@ -223,6 +223,7 @@ li.xfolkentry {
border-bottom: 1px solid #DDD;
margin-bottom: 0;
padding: 1em 0.5em;
+ overflow: auto;
}
html > body li.xfolkentry {
border-bottom: 1px dotted #AAA;