From 7b75289a294a0f4865e8d5b9564b6583f5d01aec Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Apr 2013 20:39:28 +0200 Subject: Fix issue #63 : gestion des couleurs dégradés et des transitions pour plus de navigateurs (utilisation des préfixes dans une feuille fallback.css) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/App_FrontController.php | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/App_FrontController.php b/app/App_FrontController.php index 5a66ae1dd..cf32a1c44 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -41,6 +41,7 @@ class App_FrontController extends FrontController { } private function loadStylesAndScripts () { + View::appendStyle (Url::display ('/theme/fallback.css')); View::appendStyle (Url::display ('/theme/global.css')); View::appendStyle (Url::display ('/theme/freshrss.css')); if (login_is_conf ($this->conf)) { -- cgit v1.2.3 From a6982216253d1356621916bb2b7734320fedec0d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Apr 2013 22:14:49 +0200 Subject: Fix issue #55 : affichage des tags associés aux articles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/Entry.php | 3 +- app/views/index/index.phtml | 18 ++++++ public/theme/global.css | 4 ++ public/theme/icons/tag.png | Bin 0 -> 196 bytes public/theme/icons/tag.svg | 134 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 public/theme/icons/tag.png create mode 100644 public/theme/icons/tag.svg (limited to 'app') diff --git a/app/models/Entry.php b/app/models/Entry.php index 230b457bf..3daec5aa9 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -216,7 +216,7 @@ class Entry extends Model { class EntryDAO extends Model_pdo { public function addEntry ($valuesTmp) { - $sql = 'INSERT INTO entry(id, guid, title, author, content, link, date, is_read, is_favorite, is_public, id_feed, lastUpdate) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; + $sql = 'INSERT INTO entry(id, guid, title, author, content, link, date, is_read, is_favorite, is_public, id_feed, lastUpdate, tags) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; $stm = $this->bd->prepare ($sql); $values = array ( @@ -232,6 +232,7 @@ class EntryDAO extends Model_pdo { $valuesTmp['is_public'], $valuesTmp['id_feed'], $valuesTmp['lastUpdate'], + $valuesTmp['tags'], ); if ($stm && $stm->execute ($values)) { diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 6889a8b51..ff7325996 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -89,6 +89,24 @@ if (isset ($this->entryPaginator)) { + tags(); ?> + +
  • + +
  • + diff --git a/public/theme/global.css b/public/theme/global.css index 84fbca3cb..d619c4e99 100644 --- a/public/theme/global.css +++ b/public/theme/global.css @@ -511,3 +511,7 @@ input, select, textarea { background-image: url("icons/share.png"); background-image: url("icons/share.svg"); } + .icon.i_tag { + background-image: url("icons/tag.png"); + background-image: url("icons/tag.svg"); + } diff --git a/public/theme/icons/tag.png b/public/theme/icons/tag.png new file mode 100644 index 000000000..cb1a13833 Binary files /dev/null and b/public/theme/icons/tag.png differ diff --git a/public/theme/icons/tag.svg b/public/theme/icons/tag.svg new file mode 100644 index 000000000..688aca7a4 --- /dev/null +++ b/public/theme/icons/tag.svg @@ -0,0 +1,134 @@ + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + + -- cgit v1.2.3 From a3b989b5e42618766bc8facb88ae448740c1ae1b Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 25 Apr 2013 23:26:29 +0200 Subject: Mise en place de la structure permettant de traduire l'appli (voir bug #38) pour le layout > encore beaucoup de boulot ! --- app/App_FrontController.php | 3 +++ app/i18n/fr.php | 42 ++++++++++++++++++++++++++++++++++++++++ app/layout/aside_configure.phtml | 8 ++++---- app/layout/aside_feed.phtml | 10 +++++----- app/layout/aside_flux.phtml | 20 +++++++++---------- app/layout/header.phtml | 18 ++++++++--------- app/layout/nav_menu.phtml | 22 ++++++++++----------- 7 files changed, 84 insertions(+), 39 deletions(-) create mode 100644 app/i18n/fr.php (limited to 'app') diff --git a/app/App_FrontController.php b/app/App_FrontController.php index cf32a1c44..177e83b66 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -11,6 +11,9 @@ class App_FrontController extends FrontController { $this->loadModels (); Session::init (); // lancement de la session doit se faire après chargement des modèles sinon bug (pourquoi ?) + Session::_param ('language', 'fr'); + Translate::init (); + $this->loadParamsView (); $this->loadStylesAndScripts (); $this->loadNotifications (); diff --git a/app/i18n/fr.php b/app/i18n/fr.php new file mode 100644 index 000000000..753a0d469 --- /dev/null +++ b/app/i18n/fr.php @@ -0,0 +1,42 @@ + 'Connexion', + 'logout' => 'Déconnexion', + 'search_on_title' => 'Rechercher sur les titres', + + 'configuration' => 'Configuration', + 'general_and_reading' => 'Général et lecture', + 'categories' => 'Catégories', + 'category' => 'Catégorie', + 'shortcuts' => 'Raccourcis', + 'about' => 'À propos', + + 'your_rss_feeds' => 'Vos flux RSS', + 'add_rss_feed' => 'Ajouter un flux RSS', + 'no_rss_feed' => 'Aucun flux RSS', + 'import_export_opml' => 'Importer / exporter (OPML)', + + 'subscription_management' => 'Gestion des abonnements', + 'all_feeds' => 'Tous (%d)', + 'favorite_feeds' => 'Favoris (%d)', + 'not_read' => '%d non lu', + 'not_reads' => '%d non lus', + + 'filter' => 'Filtrer', + 'see_website' => 'Voir le site', + 'administration' => 'Gestion', + 'actualize' => 'Actualiser', + + 'mark_read' => 'Marquer comme lu', + 'mark_all_read' => 'Tout marquer comme lu', + 'mark_feed_read' => 'Marquer le flux comme lu', + 'mark_cat_read' => 'Marquer la catégorie comme lue', + 'before_one_day' => 'Antérieurs à 1 jour', + 'before_one_week' => 'Antérieurs à 1 semaine', + 'display' => 'Affichage', + 'show_all' => 'Tout afficher', + 'show_not_reads' => 'Afficher les non lus', + 'older_first' => 'Plus anciens en premier', + 'newer_first' => 'Plus récents en premier', +); diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index ee527d75e..d91aebbdd 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -1,13 +1,13 @@ diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index bd92b3393..ff03b5552 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -1,9 +1,9 @@ diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index 3a6ecb304..60fcbe457 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -22,7 +22,7 @@ conf) || is_logged ()) { ?>
  • @@ -32,9 +32,9 @@ @@ -44,7 +44,7 @@ @@ -58,7 +58,7 @@ name (); ?> 0) { ?> - non lu 1 ? 's' : ''; ?> + 1 ? Translate::t ('not_reads', $catNotRead) : Translate::t ('not_read', $catNotRead); ?> @@ -73,14 +73,14 @@ diff --git a/app/layout/header.phtml b/app/layout/header.phtml index 77cd1b50a..cab56e7d8 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -1,23 +1,23 @@ conf)) { ?>
    -

    FreshRSS

    +

    diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 5d7dd3091..02e340ca1 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -5,19 +5,19 @@ get_f) { $get = 'f_' . $this->get_f; - $string_mark = 'Marquer le flux comme lu'; + $string_mark = Translate::t ('mark_feed_read'); } elseif ($this->get_c) { $get = 'c_' . $this->get_c; - $string_mark = 'Marquer la catégorie comme lue'; + $string_mark = Translate::t ('mark_cat_read'); } ?> conf) || is_logged ()) { ?>
    - Marquer comme lu +
    @@ -41,23 +41,23 @@ diff --git a/app/models/Feed.php b/app/models/Feed.php index 222e22256..08cf7425f 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -59,9 +59,13 @@ class Feed extends Model { if ($raw) { return $this->httpAuth; } else { + $pos_colon = strpos ($this->httpAuth, ':'); + $user = substr ($this->httpAuth, 0, $pos_colon); + $pass = substr ($this->httpAuth, $pos_colon + 1); + return array ( - 'username' => '', - 'password' => '' + 'username' => $user, + 'password' => $pass ); } } @@ -134,7 +138,12 @@ class Feed extends Model { ); } else { $feed = new SimplePie (); - $feed->set_feed_url (preg_replace ('/&/', '&', $this->url)); + $url = preg_replace ('/&/', '&', $this->url); + if ($this->httpAuth != '') { + $url = preg_replace ('#((.+)://)(.+)#', '${1}' . $this->httpAuth . '@${3}', $url); + } + + $feed->set_feed_url ($url); $feed->set_cache_location (CACHE_PATH); $feed->init (); @@ -144,6 +153,9 @@ class Feed extends Model { $subscribe_url = $feed->subscribe_url (); if (!is_null ($subscribe_url) && $subscribe_url != $this->url) { + if ($this->httpAuth != '') { + $subscribe_url = preg_replace ('#((.+)://)((.+)@)(.+)#', '${1}${5}', $subscribe_url); + } $this->_url ($subscribe_url); } $title = $feed->get_title (); @@ -205,7 +217,7 @@ class Feed extends Model { class FeedDAO extends Model_pdo { public function addFeed ($valuesTmp) { - $sql = 'INSERT INTO feed (id, url, category, name, website, description, lastUpdate, priority, error) VALUES(?, ?, ?, ?, ?, ?, ?, 10, 0)'; + $sql = 'INSERT INTO feed (id, url, category, name, website, description, lastUpdate, priority, httpAuth, error) VALUES(?, ?, ?, ?, ?, ?, ?, 10, ?, 0)'; $stm = $this->bd->prepare ($sql); $values = array ( @@ -216,6 +228,7 @@ class FeedDAO extends Model_pdo { $valuesTmp['website'], $valuesTmp['description'], $valuesTmp['lastUpdate'], + base64_encode ($valuesTmp['httpAuth']), ); if ($stm && $stm->execute ($values)) { @@ -231,6 +244,10 @@ class FeedDAO extends Model_pdo { $set = ''; foreach ($valuesTmp as $key => $v) { $set .= $key . '=?, '; + + if ($key == 'httpAuth') { + $valuesTmp[$key] = base64_encode ($v); + } } $set = substr ($set, 0, -2); @@ -408,7 +425,7 @@ class HelperFeed { $list[$key]->_lastUpdate ($dao['lastUpdate']); $list[$key]->_priority ($dao['priority']); $list[$key]->_pathEntries ($dao['pathEntries']); - $list[$key]->_httpAuth ($dao['httpAuth']); + $list[$key]->_httpAuth (base64_decode ($dao['httpAuth'])); if (isset ($dao['id'])) { $list[$key]->_id ($dao['id']); diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index 73b70ec4c..0d9c5cae6 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -58,20 +58,21 @@ - +
    @@ -82,5 +83,5 @@
    -
    +
    -- cgit v1.2.3 From 21dc4ceace513a0d6cd934f5fc4bb9cc643bb570 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 27 Apr 2013 22:33:14 +0200 Subject: Fix issue #64 : stockage des favicons en local --- app/layout/aside_feed.phtml | 2 +- app/layout/aside_flux.phtml | 2 +- app/models/Feed.php | 10 ++++++++++ app/views/index/index.phtml | 2 +- lib/lib_rss.php | 38 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index 4be37868d..ec4993a70 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -43,7 +43,7 @@ feeds as $feed) { ?>
  • - + name (); ?>
  • diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index 60fcbe457..d2e5341e3 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -87,7 +87,7 @@ nbNotRead (); ?> - + 0 ? '' : ''; ?> 0 ? '(' . $not_read . ') ' : ''; ?> diff --git a/app/models/Feed.php b/app/models/Feed.php index 08cf7425f..97cbe55d1 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -77,6 +77,16 @@ class Feed extends Model { $feedDAO = new FeedDAO (); return $feedDAO->countNotRead ($this->id ()); } + public function favicon () { + $file = '/data/favicons/' . $this->id () . '.ico'; + + $favicon_url = Url::display ($file); + if (!file_exists (PUBLIC_PATH . $file)) { + $favicon_url = dowload_favicon ($this->website (), $this->id ()); + } + + return $favicon_url; + } public function _id ($value) { $this->id = $value; diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index a7b67bcbc..c9be7169d 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -49,7 +49,7 @@ if (isset ($this->entryPaginator)) { feed (true); ?> -
  • name (); ?>
  • +
  • name (); ?>
  • title (); ?>
  • date (); ?>
  • diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 76c304064..e004b7498 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -152,3 +152,41 @@ function get_content_by_parsing ($url, $path) { throw new Exception (); } } + +/* Télécharge le favicon d'un site, le place sur le serveur et retourne l'URL */ +function dowload_favicon ($website, $id) { + $url = 'http://g.etfv.co/' . $website; + $favicons_dir = PUBLIC_PATH . '/data/favicons'; + $dest = $favicons_dir . '/' . $id . '.ico'; + $favicon_url = '/data/favicons/' . $id . '.ico'; + + if (!is_dir ($favicons_dir)) { + if (!mkdir ($favicons_dir, 0755, true)) { + return $url; + } + } + + if (!file_exists ($dest)) { + $c = curl_init ($url); + curl_setopt ($c, CURLOPT_HEADER, false); + curl_setopt ($c, CURLOPT_RETURNTRANSFER, true); + curl_setopt ($c, CURLOPT_BINARYTRANSFER, true); + $imgRaw = curl_exec ($c); + + if (curl_getinfo ($c, CURLINFO_HTTP_CODE) == 200) { + $file = fopen ($dest, 'w'); + if ($file === false) { + return $url; + } + + fwrite ($file, $imgRaw); + fclose ($file); + } else { + return $url; + } + + curl_close ($c); + } + + return $favicon_url; +} -- cgit v1.2.3 From a0d9d93ad2f6a174c0476bd596d6fddda77d0b04 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 28 Apr 2013 13:30:34 +0200 Subject: Fix issue #62 : création d'un logo (temporaire ?) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/layout/header.phtml | 1 + app/layout/layout.phtml | 3 + public/favicon.ico | Bin 0 -> 1150 bytes public/favicon.png | Bin 0 -> 685 bytes public/logo.png | Bin 0 -> 1743 bytes public/logo.svg | 535 ++++++++++++++++++++++++++++++++++++++++++++++ public/theme/freshrss.css | 7 + 7 files changed, 546 insertions(+) create mode 100644 public/favicon.ico create mode 100644 public/favicon.png create mode 100644 public/logo.png create mode 100644 public/logo.svg (limited to 'app') diff --git a/app/layout/header.phtml b/app/layout/header.phtml index cab56e7d8..d6fe41950 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -11,6 +11,7 @@

    +