diff --git a/README.md b/README.md index ef1ecc4..d1ed79e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Abandon Pocket, Instapaper and other Readability service : adopt poche. It is th * multi users (very soon!) * update notification in configuration screen * many storage modes (sqlite, mysql, postgresql) -* many templates: [have a look here](https://github.com/inthepoche/poche-themes). +* many templates: [have a look here](https://github.com/inthepoche/poche/tree/master/themes). * ... To test poche, a demo website is online : [demo.inthepoche.com](http://demo.inthepoche.com) (login poche, password poche). @@ -26,4 +26,4 @@ Read the [INSTALL.md file](https://github.com/inthepoche/poche/blob/master/INSTA Copyright © 2010-2013 Nicolas Lœuillet This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, -as published by Sam Hocevar. See the COPYING file for more details. \ No newline at end of file +as published by Sam Hocevar. See the COPYING file for more details. diff --git a/inc/3rdparty/simplepie/SimplePie/Misc.php b/inc/3rdparty/simplepie/SimplePie/Misc.php index eabf273..17dbf96 100644 --- a/inc/3rdparty/simplepie/SimplePie/Misc.php +++ b/inc/3rdparty/simplepie/SimplePie/Misc.php @@ -1613,6 +1613,7 @@ class SimplePie_Misc case 'utf7': return 'UTF-7'; + case 'utf8lias': case 'utf8': return 'UTF-8'; diff --git a/inc/3rdparty/site_config/custom/dilbert.com.txt b/inc/3rdparty/site_config/custom/dilbert.com.txt new file mode 100644 index 0000000..6c8d95a --- /dev/null +++ b/inc/3rdparty/site_config/custom/dilbert.com.txt @@ -0,0 +1,4 @@ +title: //div[contains(@class, 'SB_Title')]//a +body: //div[contains(@class, 'STR_Content')] + +test_url: http://dilbert.com/strips/comic/2013-10-22 \ No newline at end of file diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 1d3ff0c..bf67de2 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -166,7 +166,7 @@ class Database { $query = $this->executeQuery($sql, $params); $entry = $query->fetchAll(); - return $entry[0]; + return isset($entry[0]) ? $entry[0] : null; } public function getEntriesByView($view, $user_id, $limit = '') { diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 0766cd5..3ecaf08 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -327,7 +327,7 @@ class Poche /** * Call action (mark as fav, archive, delete, etc.) */ - public function action($action, Url $url, $id = 0, $import = FALSE) + public function action($action, Url $url, $id = 0, $import = FALSE, $autoclose = FALSE) { switch ($action) { @@ -358,7 +358,11 @@ class Poche } if (!$import) { - Tools::redirect('?view=home'); + if ($autoclose == TRUE) { + Tools::redirect('?view=home'); + } else { + Tools::redirect('?view=home&closewin=true'); + } } break; case 'delete': @@ -374,7 +378,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()); diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 1d09282..750553f 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -53,12 +53,12 @@ class Tools $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]); - if (!isset($_SERVER["SERVER_NAME"])) { + if (!isset($_SERVER["HTTP_HOST"])) { return $scriptname; } return 'http' . ($https ? 's' : '') . '://' - . $_SERVER["SERVER_NAME"] . $serverport . $scriptname; + . $_SERVER["HTTP_HOST"] . $serverport . $scriptname; } public static function redirect($url = '') @@ -133,7 +133,9 @@ class Tools $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_TIMEOUT, $timeout); - curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + if (!ini_get('open_basedir') && !ini_get('safe_mode')) { + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + } curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); diff --git a/index.php b/index.php index 66a2e81..ba14625 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,7 @@ * @license http://www.wtfpl.net/ see COPYING file */ -define ('POCHE', '1.1.0'); +define ('POCHE', '1.2.0'); require_once 'inc/poche/global.inc.php'; session_start(); diff --git a/install/mysql.sql b/install/mysql.sql index cb232a8..9b01e32 100644 --- a/install/mysql.sql +++ b/install/mysql.sql @@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS `config` ( `name` varchar(255) NOT NULL, `value` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `entries` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS `entries` ( `content` blob NOT NULL, `user_id` int(11) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS `users` ( `name` int(255) NOT NULL, `email` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `users_config` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -31,4 +31,4 @@ CREATE TABLE IF NOT EXISTS `users_config` ( `name` varchar(255) NOT NULL, `value` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/locale/it_IT.utf8/LC_MESSAGES/it_IT.utf8.mo b/locale/it_IT.utf8/LC_MESSAGES/it_IT.utf8.mo new file mode 100644 index 0000000..e4d4fb3 Binary files /dev/null and b/locale/it_IT.utf8/LC_MESSAGES/it_IT.utf8.mo differ diff --git a/locale/it_IT.utf8/LC_MESSAGES/it_IT.utf8.po b/locale/it_IT.utf8/LC_MESSAGES/it_IT.utf8.po new file mode 100644 index 0000000..f4e69c0 --- /dev/null +++ b/locale/it_IT.utf8/LC_MESSAGES/it_IT.utf8.po @@ -0,0 +1,237 @@ +# +# Translators: +# Damtux , 2013 +msgid "" +msgstr "" +"Project-Id-Version: poche\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2013-11-25 09:47+0100\n" +"Last-Translator: Nicolas Lœuillet \n" +"Language-Team: Italian (http://www.transifex.com/projects/p/poche/language/" +"it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.5.4\n" + +msgid "config" +msgstr "configurazione" + +msgid "Poching a link" +msgstr "Pochare un link" + +msgid "read the documentation" +msgstr "leggi la documentazione" + +msgid "by filling this field" +msgstr "compilando questo campo" + +msgid "poche it!" +msgstr "pochalo!" + +msgid "Updating poche" +msgstr "Aggiornamento poche" + +msgid "your version" +msgstr "la tua versione" + +msgid "latest stable version" +msgstr "ultima versione stabile" + +msgid "a more recent stable version is available." +msgstr "è disponibile una versione stabile più recente." + +msgid "you are up to date." +msgstr "sei aggiornato." + +msgid "latest dev version" +msgstr "ultima versione di sviluppo" + +msgid "a more recent development version is available." +msgstr "è disponibile una versione di sviluppo più recente." + +msgid "Change your password" +msgstr "Cambia la tua password" + +msgid "New password:" +msgstr "Nuova password:" + +msgid "Password" +msgstr "Password" + +msgid "Repeat your new password:" +msgstr "Ripeti la nuova password:" + +msgid "Update" +msgstr "Aggiorna" + +msgid "Import" +msgstr "Importa" + +msgid "Please execute the import script locally, it can take a very long time." +msgstr "" +"Si prega di eseguire lo script di importazione a livello locale, può " +"richiedere un tempo molto lungo." + +msgid "More infos in the official doc:" +msgstr "Maggiori info nella documentazione ufficiale" + +msgid "import from Pocket" +msgstr "Importa da Pocket" + +msgid "import from Readability" +msgstr "Importa da Readability" + +msgid "import from Instapaper" +msgstr "Importa da Instapaper" + +msgid "Export your poche datas" +msgstr "Esporta i tuoi dati di poche" + +msgid "Click here" +msgstr "Fai clic qui" + +msgid "to export your poche datas." +msgstr "per esportare i tuoi dati di poche." + +msgid "back to home" +msgstr "torna alla home" + +msgid "installation" +msgstr "installazione" + +msgid "install your poche" +msgstr "installa il tuo poche" + +msgid "" +"poche is still not installed. Please fill the below form to install it. " +"Don't hesitate to read the documentation " +"on poche website." +msgstr "" +"poche non è ancora installato. Si prega di riempire il modulo sottostante " +"per completare l'installazione. Leggere " +"la documentazione sul sito di poche." + +msgid "Login" +msgstr "Nome utente" + +msgid "Repeat your password" +msgstr "Ripeti la tua password" + +msgid "Install" +msgstr "Installa" + +msgid "back to top" +msgstr "torna a inizio pagina" + +msgid "favoris" +msgstr "preferiti" + +msgid "archive" +msgstr "archivio" + +msgid "unread" +msgstr "non letti" + +msgid "by date asc" +msgstr "per data cresc" + +msgid "by date" +msgstr "per data" + +msgid "by date desc" +msgstr "per data decr" + +msgid "by title asc" +msgstr "per titolo cresc" + +msgid "by title" +msgstr "per titolo" + +msgid "by title desc" +msgstr "per titolo decr" + +msgid "No link available here!" +msgstr "Nessun link disponibile!" + +msgid "toggle mark as read" +msgstr "segna come letto / non letto" + +msgid "toggle favorite" +msgstr "segna come preferito" + +msgid "delete" +msgstr "elimina" + +msgid "original" +msgstr "originale" + +msgid "results" +msgstr "risultati" + +msgid "tweet" +msgstr "twitta" + +msgid "email" +msgstr "email" + +msgid "shaarli" +msgstr "shaarli" + +msgid "flattr" +msgstr "flattr" + +msgid "this article appears wrong?" +msgstr "articolo non visualizzato correttamente?" + +msgid "create an issue" +msgstr "crea una segnalazione" + +msgid "or" +msgstr "oppure" + +msgid "contact us by mail" +msgstr "contattaci via email" + +msgid "plop" +msgstr "plop" + +msgid "home" +msgstr "home" + +msgid "favorites" +msgstr "preferiti" + +msgid "logout" +msgstr "esci" + +msgid "powered by" +msgstr "realizzato con" + +msgid "debug mode is on so cache is off." +msgstr "modalità di debug attiva, cache disattivata." + +msgid "your poche version:" +msgstr "la tua versione di poche:" + +msgid "storage:" +msgstr "memoria:" + +msgid "login to your poche" +msgstr "accedi al tuo poche" + +msgid "you are in demo mode, some features may be disabled." +msgstr "" +"sei in modalità dimostrazione, alcune funzionalità potrebbero essere " +"disattivate." + +msgid "Stay signed in" +msgstr "Resta connesso" + +msgid "(Do not check on public computers)" +msgstr "(non selezionare su computer pubblici)" + +msgid "Sign in" +msgstr "Accedi" diff --git a/locale/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.mo b/locale/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.mo new file mode 100644 index 0000000..eea7ff0 Binary files /dev/null and b/locale/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.mo differ diff --git a/locale/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.po b/locale/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.po new file mode 100644 index 0000000..78ddb15 --- /dev/null +++ b/locale/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.po @@ -0,0 +1,228 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: Nicolas Lœuillet \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.4\n" + +msgid "config" +msgstr "настройки" + +msgid "Poching a link" +msgstr "Сохраняю ссылку" + +msgid "read the documentation" +msgstr "читать инструкцию" + +msgid "by filling this field" +msgstr "заполнением этого поля" + +msgid "poche it!" +msgstr "Прикарманить!" + +msgid "Updating poche" +msgstr "Обновляю poche" + +msgid "your version" +msgstr "Ваша версия" + +msgid "latest stable version" +msgstr "крайняя стабильная версия" + +msgid "a more recent stable version is available." +msgstr "есть более новая стабильная версия." + +msgid "you are up to date." +msgstr "у Вас всё самое новое." + +msgid "latest dev version" +msgstr "крайняя версия разработчиков" + +msgid "a more recent development version is available." +msgstr "есть более свежая версия разработчиков." + +msgid "Change your password" +msgstr "Смени пароль" + +msgid "New password:" +msgstr "Новый пароль:" + +msgid "Password" +msgstr "Пароль" + +msgid "Repeat your new password:" +msgstr "Ещё раз новый пароль:" + +msgid "Update" +msgstr "Обновить" + +msgid "Import" +msgstr "Импортировать" + +msgid "Please execute the import script locally, it can take a very long time." +msgstr "" +"Выполните сценарий импорта локально - он может занять слишком много времени." + +msgid "More infos in the official doc:" +msgstr "Больше сведений в официальной документации:" + +msgid "import from Pocket" +msgstr "импортировать из Pocket" + +msgid "import from Readability" +msgstr "импортировать из Readability" + +msgid "import from Instapaper" +msgstr "импортировать из Instapaper" + +msgid "Export your poche datas" +msgstr "Экспортировать данные poche" + +msgid "Click here" +msgstr "Кликни сюда" + +msgid "to export your poche datas." +msgstr "чтобы экспортировать твои записи из poche." + +msgid "back to home" +msgstr "домой" + +msgid "installation" +msgstr "установка" + +msgid "install your poche" +msgstr "установить твой poche" + +msgid "" +"poche is still not installed. Please fill the below form to install it. " +"Don't hesitate to read the documentation " +"on poche website." +msgstr "" +"poche всё ещё не установлен. Надо заполнить форму ниже, чтобы установить " +"его. Неплохо также прочесть документацию " +"на сайте poche." + +msgid "Login" +msgstr "Регистрационное имя" + +msgid "Repeat your password" +msgstr "Повтори пароль" + +msgid "Install" +msgstr "Установить" + +msgid "back to top" +msgstr "наверх" + +msgid "favoris" +msgstr "избранное" + +msgid "archive" +msgstr "архив" + +msgid "unread" +msgstr "нечитанное" + +msgid "by date asc" +msgstr "по дате, сперва старые" + +msgid "by date" +msgstr "по дате" + +msgid "by date desc" +msgstr "по дате, сперва новые" + +msgid "by title asc" +msgstr "по заголовку (прямой)" + +msgid "by title" +msgstr "по заголовку" + +msgid "by title desc" +msgstr "по заголовку (обратный)" + +msgid "No link available here!" +msgstr "Здесь нет линка!" + +msgid "toggle mark as read" +msgstr "изменить отметку 'прочитано'" + +msgid "toggle favorite" +msgstr "изменить избранность" + +msgid "delete" +msgstr "удалить" + +msgid "original" +msgstr "исходный" + +msgid "results" +msgstr "найдено" + +msgid "tweet" +msgstr "твитнуть" + +msgid "email" +msgstr "отправить по почте" + +msgid "shaarli" +msgstr "Шаарли" + +msgid "flattr" +msgstr "проспонсировать" + +msgid "this article appears wrong?" +msgstr "статья выглядит криво?" + +msgid "create an issue" +msgstr "оповестить об ошибке" + +msgid "or" +msgstr "или" + +msgid "contact us by mail" +msgstr "связаться по почте" + +msgid "plop" +msgstr "plop" + +msgid "home" +msgstr "домой" + +msgid "favorites" +msgstr "избранное" + +msgid "logout" +msgstr "выйти" + +msgid "powered by" +msgstr "на основе" + +msgid "debug mode is on so cache is off." +msgstr "включён режим отладки - кеш выключен." + +msgid "your poche version:" +msgstr "Ваша версия poche:" + +msgid "storage:" +msgstr "хранилище:" + +msgid "login to your poche" +msgstr "войти в свой poche" + +msgid "you are in demo mode, some features may be disabled." +msgstr "демонстрационный режим - работают не все возможности." + +msgid "Stay signed in" +msgstr "Оставаться зарегистрированным" + +msgid "(Do not check on public computers)" +msgstr "(Не отмечай на чужих компьютерах)" + +msgid "Sign in" +msgstr "Зарегистрироваться" diff --git a/poche_compatibility_test.php b/poche_compatibility_test.php index be4fd6f..eed3c39 100644 --- a/poche_compatibility_test.php +++ b/poche_compatibility_test.php @@ -1,7 +1,7 @@ =')); +$php_ok = (function_exists('version_compare') && version_compare(phpversion(), '5.3.3', '>=')); $pcre_ok = extension_loaded('pcre'); $zlib_ok = extension_loaded('zlib'); $mbstring_ok = extension_loaded('mbstring'); diff --git a/themes/dark/img/dark/backtotop.png b/themes/dark/img/dark/backtotop.png old mode 100755 new mode 100644 index 051238e..c885086 Binary files a/themes/dark/img/dark/backtotop.png and b/themes/dark/img/dark/backtotop.png differ diff --git a/themes/dark/img/dark/bad-display.png b/themes/dark/img/dark/bad-display.png old mode 100755 new mode 100644 index 6866799..66ea2e1 Binary files a/themes/dark/img/dark/bad-display.png and b/themes/dark/img/dark/bad-display.png differ diff --git a/themes/dark/img/dark/checkmark-off.png b/themes/dark/img/dark/checkmark-off.png index 3db5a06..661ea99 100644 Binary files a/themes/dark/img/dark/checkmark-off.png and b/themes/dark/img/dark/checkmark-off.png differ diff --git a/themes/dark/img/dark/checkmark-on.png b/themes/dark/img/dark/checkmark-on.png index cd3abb2..5ee8c8d 100644 Binary files a/themes/dark/img/dark/checkmark-on.png and b/themes/dark/img/dark/checkmark-on.png differ diff --git a/themes/dark/img/dark/down.png b/themes/dark/img/dark/down.png index b9d536a..4150e17 100644 Binary files a/themes/dark/img/dark/down.png and b/themes/dark/img/dark/down.png differ diff --git a/themes/dark/img/dark/envelop.png b/themes/dark/img/dark/envelop.png index 6be1c88..73d9b0b 100644 Binary files a/themes/dark/img/dark/envelop.png and b/themes/dark/img/dark/envelop.png differ diff --git a/themes/dark/img/dark/flattr.png b/themes/dark/img/dark/flattr.png old mode 100755 new mode 100644 index 0404aae..b457d08 Binary files a/themes/dark/img/dark/flattr.png and b/themes/dark/img/dark/flattr.png differ diff --git a/themes/dark/img/dark/left.png b/themes/dark/img/dark/left.png index a0a5363..c2f7a20 100644 Binary files a/themes/dark/img/dark/left.png and b/themes/dark/img/dark/left.png differ diff --git a/themes/dark/img/dark/link.png b/themes/dark/img/dark/link.png old mode 100755 new mode 100644 index db62819..a5b8d8d Binary files a/themes/dark/img/dark/link.png and b/themes/dark/img/dark/link.png differ diff --git a/themes/dark/img/dark/remove.png b/themes/dark/img/dark/remove.png index f8ad56a..0c3dcfd 100644 Binary files a/themes/dark/img/dark/remove.png and b/themes/dark/img/dark/remove.png differ diff --git a/themes/dark/img/dark/shaarli.png b/themes/dark/img/dark/shaarli.png index 1eb30f6..e68ac8b 100644 Binary files a/themes/dark/img/dark/shaarli.png and b/themes/dark/img/dark/shaarli.png differ diff --git a/themes/dark/img/dark/star-off.png b/themes/dark/img/dark/star-off.png index 6a0133a..8194bc2 100644 Binary files a/themes/dark/img/dark/star-off.png and b/themes/dark/img/dark/star-off.png differ diff --git a/themes/dark/img/dark/star-on.png b/themes/dark/img/dark/star-on.png index a9f96ea..109c3ae 100644 Binary files a/themes/dark/img/dark/star-on.png and b/themes/dark/img/dark/star-on.png differ diff --git a/themes/dark/img/dark/top.png b/themes/dark/img/dark/top.png index 954a8c0..d137bd2 100644 Binary files a/themes/dark/img/dark/top.png and b/themes/dark/img/dark/top.png differ diff --git a/themes/dark/img/dark/twitter.png b/themes/dark/img/dark/twitter.png index cfcfe41..6ce8a4d 100644 Binary files a/themes/dark/img/dark/twitter.png and b/themes/dark/img/dark/twitter.png differ diff --git a/themes/default/_head.twig b/themes/default/_head.twig index d0cbd32..577cc69 100644 --- a/themes/default/_head.twig +++ b/themes/default/_head.twig @@ -8,3 +8,4 @@ + \ No newline at end of file diff --git a/themes/default/config.twig b/themes/default/config.twig index 7267170..2134582 100644 --- a/themes/default/config.twig +++ b/themes/default/config.twig @@ -8,9 +8,10 @@

{% trans "Poching a link" %}

{% trans "You can poche a link by several methods:" %} (?)