From b8c67f80688c8ba45e3207c6a212f97cac0537ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 20 Sep 2013 13:48:29 +0200 Subject: remove define.inc.php --- inc/poche/define.inc.php | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 inc/poche/define.inc.php (limited to 'inc/poche') diff --git a/inc/poche/define.inc.php b/inc/poche/define.inc.php deleted file mode 100644 index 40f77b5c..00000000 --- a/inc/poche/define.inc.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @copyright 2013 - * @license http://www.wtfpl.net/ see COPYING file - */ - -define ('STORAGE','sqlite'); # postgres, mysql, sqlite -define ('STORAGE_SERVER', 'localhost'); # leave blank for sqlite -define ('STORAGE_DB', 'poche'); # only for postgres & mysql -define ('STORAGE_SQLITE', __DIR__ . '/../../db/poche.sqlite'); -define ('STORAGE_USER', 'postgres'); # leave blank for sqlite -define ('STORAGE_PASSWORD', 'postgres'); # leave blank for sqlite - -define ('MODE_DEMO', FALSE); -define ('DEBUG_POCHE', FALSE); -define ('DOWNLOAD_PICTURES', FALSE); -define ('SHARE_TWITTER', TRUE); -define ('SHARE_MAIL', TRUE); -define ('SHARE_SHAARLI', FALSE); -define ('SHAARLI_URL', 'http://myshaarliurl.com'); -define ('FLATTR', TRUE); -define ('FLATTR_API', 'https://api.flattr.com/rest/v2/things/lookup/?url='); -define ('NOT_FLATTRABLE', '0'); -define ('FLATTRABLE', '1'); -define ('FLATTRED', '2'); -define ('ABS_PATH', 'assets/'); -define ('TPL', __DIR__ . '/../../tpl'); -define ('LOCALE', __DIR__ . '/../../locale'); -define ('CACHE', __DIR__ . '/../../cache'); -define ('PAGINATION', '10'); -define ('THEME', 'light'); - -define ('IMPORT_POCKET_FILE', './ril_export.html'); -define ('IMPORT_READABILITY_FILE', './readability'); -define ('IMPORT_INSTAPAPER_FILE', './instapaper-export.html'); \ No newline at end of file -- cgit v1.2.3 From 3408ed48ba66db8d93207507777be42759f7eb0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 20 Sep 2013 14:09:26 +0200 Subject: fix bug #225: blank page on article page --- inc/poche/Poche.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 18860ddc..561de808 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -381,17 +381,17 @@ class Poche $tidy = tidy_parse_string($content, array('indent'=>true, 'show-body-only' => true), 'UTF8'); $tidy->cleanRepair(); $content = $tidy->value; + } - # flattr checking - $flattr = new FlattrItem(); - $flattr->checkItem($entry['url']); + # flattr checking + $flattr = new FlattrItem(); + $flattr->checkItem($entry['url']); - $tpl_vars = array( - 'entry' => $entry, - 'content' => $content, - 'flattr' => $flattr - ); - } + $tpl_vars = array( + 'entry' => $entry, + 'content' => $content, + 'flattr' => $flattr + ); } else { Tools::logm('error in view call : entry is null'); -- cgit v1.2.3 From 37527034ab3d1e925b8e1806f17215979170c200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 21 Sep 2013 14:18:28 +0200 Subject: unactivate debug --- inc/poche/config.inc.php.new | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/config.inc.php.new b/inc/poche/config.inc.php.new index 48cc5783..7c407158 100755 --- a/inc/poche/config.inc.php.new +++ b/inc/poche/config.inc.php.new @@ -26,7 +26,7 @@ define ('STORAGE_PASSWORD', 'poche'); ################################################################################# define ('MODE_DEMO', FALSE); -define ('DEBUG_POCHE', true); +define ('DEBUG_POCHE', FALSE); define ('DOWNLOAD_PICTURES', FALSE); define ('CONVERT_LINKS_FOOTNOTES', FALSE); define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE); -- cgit v1.2.3 From 58ace4941ef3ec92ab71ae84df816343e2deb625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 21 Sep 2013 14:37:53 +0200 Subject: bug fix #229: theme not stored on updated poches --- inc/poche/Database.class.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 4d664992..0662581b 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -113,9 +113,17 @@ class Database { } public function updateUserConfig($userId, $key, $value) { - $sql_update = "UPDATE users_config SET `value`=? WHERE `user_id`=? AND `name`=?"; - $params_update = array($value, $userId, $key); - $query = $this->executeQuery($sql_update, $params_update); + $config = $this->getConfigUser($userId); + + if (!isset ($user_config[$key])) { + $sql = "INSERT INTO users_config (`value`, `user_id`, `name`) VALUES (?, ?, ?)"; + } + else { + $sql = "UPDATE users_config SET `value`=? WHERE `user_id`=? AND `name`=?"; + } + + $params = array($value, $userId, $key); + $query = $this->executeQuery($sql, $params); } private function executeQuery($sql, $params) { -- cgit v1.2.3 From 92cd6e9af8c49be7b06beb583ee1c3026fbe356d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 21 Sep 2013 21:44:49 +0200 Subject: change import files constants --- inc/poche/config.inc.php.new | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/config.inc.php.new b/inc/poche/config.inc.php.new index 7c407158..38d61e02 100755 --- a/inc/poche/config.inc.php.new +++ b/inc/poche/config.inc.php.new @@ -51,6 +51,10 @@ define ('PAGINATION', '10'); define ('POCHE_VERSION', '1.0-beta5'); -define ('IMPORT_POCKET_FILE', ROOT . '/ril_export.html'); -define ('IMPORT_READABILITY_FILE', ROOT . '/readability'); -define ('IMPORT_INSTAPAPER_FILE', ROOT . '/instapaper-export.html'); \ No newline at end of file +define ('POCKET_FILE', '/ril_export.html'); +define ('READABILITY_FILE', '/readability'); +define ('INSTAPAPER_FILE', '/instapaper-export.html'); + +define ('IMPORT_POCKET_FILE', ROOT . POCKET_FILE); +define ('IMPORT_READABILITY_FILE', ROOT . READABILITY_FILE); +define ('IMPORT_INSTAPAPER_FILE', ROOT . INSTAPAPER_FILE); \ No newline at end of file -- cgit v1.2.3 From 3cc22aab829f339ac6e1ce1af63d646efe4a227c Mon Sep 17 00:00:00 2001 From: NumEricR Date: Thu, 26 Sep 2013 23:37:07 +0200 Subject: Avoid ".git" option in themes list of config page --- 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 561de808..1bae2751 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -255,7 +255,7 @@ class Poche while (($theme = readdir($handle)) !== false) { # Themes are stored in a directory, so all directory names are themes # @todo move theme installation data to database - if (! is_dir(THEME . '/' . $theme) || in_array($theme, array('..', '.'))) { + if (! is_dir(THEME . '/' . $theme) || in_array($theme, array('..', '.', '.git'))) { continue; } -- cgit v1.2.3 From 4e5b04113d923b54206436c74ce1fa8649854046 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 27 Sep 2013 11:11:45 +0200 Subject: Changed Flattr Caching System From md5(url) to the ID of an article. Easier and faster. --- 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 561de808..6907e649 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -385,7 +385,7 @@ class Poche # flattr checking $flattr = new FlattrItem(); - $flattr->checkItem($entry['url']); + $flattr->checkItem($entry['url'],$entry['id']); $tpl_vars = array( 'entry' => $entry, -- cgit v1.2.3 From 7f17a38d358bdec609a98827991108032e9257ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 3 Oct 2013 14:23:03 +0200 Subject: change instructions messages --- inc/poche/Poche.class.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 1bae2751..d6dbd19a 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -109,6 +109,14 @@ class Poche return false; } + + if (! is_writable(CACHE)) { + $this->notInstalledMessage = '

error

You don\'t have write access on cache directory.

'; + + self::$canRenderTemplates = false; + + return false; + } # Check if the selected theme and its requirements are present if (! is_dir(THEME . '/' . $this->getTheme())) { @@ -145,16 +153,11 @@ class Poche if (empty($configSalt)) { $msg = '

error

You have not yet filled in the SALT value in the config.inc.php file.

'; - } else if (! is_writable(CACHE)) { - Tools::logm('you don\'t have write access on cache directory'); - $msg = '

error

You don\'t have write access on cache directory.

'; } else if (STORAGE == 'sqlite' && ! file_exists(STORAGE_SQLITE)) { Tools::logm('sqlite file doesn\'t exist'); $msg = '

error

sqlite file doesn\'t exist, you can find it in install folder. Copy it in /db folder.

'; - } else if (file_exists(ROOT . '/install/update.php') && ! DEBUG_POCHE) { - $msg = '

setup

It\'s your first time here? Please copy /install/poche.sqlite in db folder. Then, delete install folder.
If you have already installed poche, an update is needed by clicking here.

'; } else if (is_dir(ROOT . '/install') && ! DEBUG_POCHE) { - $msg = '

setup

If you want to update your poche, you just have to delete /install folder.
To install your poche with sqlite, copy /install/poche.sqlite in /db and delete the folder /install. you have to delete the /install folder before using poche.

'; + $msg = '

install folder

you have to delete the /install folder before using poche.

'; } else if (STORAGE == 'sqlite' && ! is_writable(STORAGE_SQLITE)) { Tools::logm('you don\'t have write access on sqlite file'); $msg = '

error

You don\'t have write access on sqlite file.

'; -- cgit v1.2.3 From 34d67c835e250c853fc8ff4230abd24ba521b878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 3 Oct 2013 14:46:46 +0200 Subject: bug fix #219: when archive last poched links from a page, redirect to an other page --- inc/poche/Poche.class.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index d6dbd19a..ffef1c3e 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -407,6 +407,12 @@ class Poche 'page_links' => '', 'nb_results' => '', ); + + # want to display a page too far? + if ((count($entries) % PAGINATION) + 1 < $_GET['p']) { + Tools::redirect(''); + } + if (count($entries) > 0) { $this->pagination->set_total(count($entries)); $page_links = $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . '&'); -- cgit v1.2.3 From 6cd8af85dac4a30784ff3cbeaaca91b8af8a44af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 3 Oct 2013 14:48:53 +0200 Subject: bug fix #227: Deleting element in archive redirect to home --- 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 ffef1c3e..8567cd8f 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -333,7 +333,7 @@ class Poche $msg = 'error : can\'t delete link #' . $id; } Tools::logm($msg); - Tools::redirect('?'); + Tools::redirect(); break; case 'toggle_fav' : $this->store->favoriteById($id, $this->user->getId()); -- cgit v1.2.3 From 8f91e10faa97df1a50cbbd5fb64eab5190361727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 3 Oct 2013 14:51:04 +0200 Subject: preparing to 1.0.0 --- inc/poche/config.inc.php.new | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/config.inc.php.new b/inc/poche/config.inc.php.new index 38d61e02..255b97e6 100755 --- a/inc/poche/config.inc.php.new +++ b/inc/poche/config.inc.php.new @@ -49,7 +49,7 @@ define ('CACHE', ROOT . '/cache'); define ('PAGINATION', '10'); -define ('POCHE_VERSION', '1.0-beta5'); +define ('POCHE_VERSION', '1.0.0'); define ('POCKET_FILE', '/ril_export.html'); define ('READABILITY_FILE', '/readability'); -- cgit v1.2.3 From 47baa1077e2923b8a87e458a6e826c2823ed3614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 3 Oct 2013 15:43:24 +0200 Subject: reopen #219 when archive last poched links from a page, redirect to an other page --- inc/poche/Poche.class.php | 5 ----- 1 file changed, 5 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 8f54267d..8fe7a4f5 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -407,11 +407,6 @@ class Poche 'page_links' => '', 'nb_results' => '', ); - - # want to display a page too far? - if ((count($entries) % PAGINATION) + 1 < $_GET['p']) { - Tools::redirect(''); - } if (count($entries) > 0) { $this->pagination->set_total(count($entries)); -- cgit v1.2.3 From d47d2533accb30a69fbbb964f63793b821300974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 3 Oct 2013 19:03:52 +0200 Subject: change doc link --- 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 8fe7a4f5..1ba8e7c1 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -105,7 +105,7 @@ class Poche public function themeIsInstalled() { # Twig is an absolute requirement for Poche to function. Abort immediately if the Composer installer hasn't been run yet if (! self::$canRenderTemplates) { - $this->notInstalledMessage = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. Have a look at the documentation.'; + $this->notInstalledMessage = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. Have a look at the documentation.'; return false; } -- cgit v1.2.3