From 9de34d4e8430b8b2d994aa9b681ec9f11dabf0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 3 Jan 2014 10:06:26 +0100 Subject: [fix] error in query to get entries and tags --- inc/poche/Database.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index afe02a41..d8b63859 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -337,7 +337,7 @@ class Database { public function retrieveEntriesByTag($tag_id) { $sql = - "SELECT * FROM entries + "SELECT entries.* FROM entries LEFT JOIN tags_entries ON tags_entries.entry_id=entries.id WHERE tags_entries.tag_id = ?"; $query = $this->executeQuery($sql, array($tag_id)); @@ -348,7 +348,7 @@ class Database { public function retrieveTagsByEntry($entry_id) { $sql = - "SELECT * FROM tags + "SELECT tags.* FROM tags LEFT JOIN tags_entries ON tags_entries.tag_id=tags.id WHERE tags_entries.entry_id = ?"; $query = $this->executeQuery($sql, array($entry_id)); -- cgit v1.2.3 From 0b57c6825aa0bf88d10a2c420875f6cf9afe17c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 3 Jan 2014 10:15:05 +0100 Subject: [fix] bugs #374 and #376 - encoding in rss --- inc/poche/Poche.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 4f70afb7..d3eb71d2 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -951,7 +951,7 @@ class Poche if (count($entries) > 0) { foreach ($entries as $entry) { $newItem = $feed->createNewItem(); - $newItem->setTitle(htmlentities($entry['title'])); + $newItem->setTitle($entry['title']); $newItem->setLink(Tools::getPocheUrl() . '?view=view&id=' . $entry['id']); $newItem->setDate(time()); $newItem->setDescription($entry['content']); -- cgit v1.2.3 From b5c1ed12273d72888b443e801123252d92f8c8ec Mon Sep 17 00:00:00 2001 From: FireFox Date: Fri, 3 Jan 2014 11:17:15 +0100 Subject: Change Permissions in pochePictures.php Stored Pictures are not accessible (on my server), when permission is set to 0705, but instead, when using 0755 (or for example to 0715) all is working as expected. So maybe it would be good, considering in changing the permission of created directories in the assets directory --- inc/poche/pochePictures.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/pochePictures.php b/inc/poche/pochePictures.php index 4e4a0b08..b0cfb9df 100644 --- a/inc/poche/pochePictures.php +++ b/inc/poche/pochePictures.php @@ -84,12 +84,12 @@ function create_assets_directory($id) { $assets_path = ABS_PATH; if(!is_dir($assets_path)) { - mkdir($assets_path, 0705); + mkdir($assets_path, 0715); } $article_directory = $assets_path . $id; if(!is_dir($article_directory)) { - mkdir($article_directory, 0705); + mkdir($article_directory, 0715); } return $article_directory; @@ -107,4 +107,4 @@ function remove_directory($directory) } return rmdir($directory); } -} \ No newline at end of file +} -- cgit v1.2.3 From 9bc32632af80130ca6aff968b800ceb43aa86576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 3 Jan 2014 15:18:13 +0100 Subject: [fix] #375 Readability.com changed its export format --- inc/poche/Poche.class.php | 53 +++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index d3eb71d2..e9ff7b46 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -806,34 +806,37 @@ class Poche $url = NULL; $favorite = FALSE; $archive = FALSE; - foreach ($value as $attr => $attr_value) { - if ($attr == 'article__url') { - $url = new Url(base64_encode($attr_value)); - } - $sequence = ''; - if (STORAGE == 'postgres') { - $sequence = 'entries_id_seq'; - } - if ($attr_value == 'true') { - if ($attr == 'favorite') { - $favorite = TRUE; + foreach ($value as $item) { + foreach ($item as $attr => $value) { + if ($attr == 'article__url') { + $url = new Url(base64_encode($value)); } - if ($attr == 'archive') { - $archive = TRUE; + $sequence = ''; + if (STORAGE == 'postgres') { + $sequence = 'entries_id_seq'; + } + if ($value == 'true') { + if ($attr == 'favorite') { + $favorite = TRUE; + } + if ($attr == 'archive') { + $archive = TRUE; + } } } - } - # we can add the url - if (!is_null($url) && $url->isCorrect()) { - $this->action('add', $url, 0, TRUE); - $count++; - if ($favorite) { - $last_id = $this->store->getLastId($sequence); - $this->action('toggle_fav', $url, $last_id, TRUE); - } - if ($archive) { - $last_id = $this->store->getLastId($sequence); - $this->action('toggle_archive', $url, $last_id, TRUE); + + # we can add the url + if (!is_null($url) && $url->isCorrect()) { + $this->action('add', $url, 0, TRUE); + $count++; + if ($favorite) { + $last_id = $this->store->getLastId($sequence); + $this->action('toggle_fav', $url, $last_id, TRUE); + } + if ($archive) { + $last_id = $this->store->getLastId($sequence); + $this->action('toggle_archive', $url, $last_id, TRUE); + } } } } -- cgit v1.2.3 From a562e3905ac67983b85853e5ace813b2de0e3807 Mon Sep 17 00:00:00 2001 From: adev Date: Sun, 5 Jan 2014 15:03:05 +0100 Subject: Create sqlite table tags_entries only if not already exists --- inc/poche/Database.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index d8b63859..04731821 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -81,7 +81,7 @@ class Database { if (STORAGE == 'sqlite') { $sql = ' - CREATE TABLE tags_entries ( + CREATE TABLE IF NOT EXISTS tags_entries ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE, entry_id INTEGER, tag_id INTEGER, -- cgit v1.2.3 From e1cf0fda27df031e478e55d6df08823d42fe2220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 7 Jan 2014 13:15:43 +0100 Subject: [add] user_agent in file_get_contents --- inc/poche/Poche.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index e9ff7b46..76a73be2 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -333,7 +333,9 @@ class Poche switch ($action) { case 'add': - $json = file_get_contents(Tools::getPocheUrl() . '/inc/3rdparty/makefulltextfeed.php?url='.urlencode($url->getUrl()).'&max=5&links=preserve&exc=&format=json&submit=Create+Feed'); + $options = array('http' => array('user_agent' => 'poche')); + $context = stream_context_create($options); + $json = file_get_contents(Tools::getPocheUrl() . '/inc/3rdparty/makefulltextfeed.php?url='.urlencode($url->getUrl()).'&max=5&links=preserve&exc=&format=json&submit=Create+Feed', false, $context); $content = json_decode($json, true); $title = $content['rss']['channel']['item']['title']; $body = $content['rss']['channel']['item']['description']; -- cgit v1.2.3