From e6436444db9e1bcc13c02c132f327e80d6584df0 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 10 Apr 2013 20:55:12 +0200 Subject: Fix bug #49 : les flux sans auteur sont traités normalement désormais MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/controllers/feedController.php') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index e16161842..812227f89 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -33,9 +33,11 @@ class feedController extends ActionController { 'description' => $feed->description (), 'lastUpdate' => time () ); + if ($feedDAO->addFeed ($values)) { $entryDAO = new EntryDAO (); $entries = $feed->entries (); + foreach ($entries as $entry) { $values = $entry->toArray (); $entryDAO->addEntry ($values); -- cgit v1.2.3 From 42100a83223b93060eedc482eda94a890ee01e4a Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 10 Apr 2013 21:43:53 +0200 Subject: Fix issue #40 : test des erreurs SimplePie --- app/App_FrontController.php | 1 + app/controllers/feedController.php | 7 +++++++ app/models/Exception/FeedException.php | 7 +++++++ app/models/Feed.php | 4 ++++ 4 files changed, 19 insertions(+) create mode 100644 app/models/Exception/FeedException.php (limited to 'app/controllers/feedController.php') diff --git a/app/App_FrontController.php b/app/App_FrontController.php index fff238bf2..8a5dcdcba 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -24,6 +24,7 @@ class App_FrontController extends FrontController { } private function loadModels () { + include (APP_PATH . '/models/Exception/FeedException.php'); include (APP_PATH . '/models/RSSConfiguration.php'); include (APP_PATH . '/models/Days.php'); include (APP_PATH . '/models/Category.php'); diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 812227f89..c205801af 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -58,6 +58,13 @@ class feedController extends ActionController { ); Session::_param ('notification', $notif); } + } catch (FeedException $e) { + Log::record ($e->getMessage (), Log::ERROR); + $notif = array ( + 'type' => 'bad', + 'content' => 'Un problème interne a été rencontré, le flux n\'a pas pu être ajouté' + ); + Session::_param ('notification', $notif); } catch (FileNotExistException $e) { Log::record ($e->getMessage (), Log::ERROR); // notif diff --git a/app/models/Exception/FeedException.php b/app/models/Exception/FeedException.php new file mode 100644 index 000000000..3fe0f4ea0 --- /dev/null +++ b/app/models/Exception/FeedException.php @@ -0,0 +1,7 @@ +set_cache_location (CACHE_PATH); $feed->init (); + if ($feed->error()) { + throw new FeedException ($feed->error); + } + $subscribe_url = $feed->subscribe_url (); if (!is_null ($subscribe_url) && $subscribe_url != $this->url) { $this->_url ($subscribe_url); -- cgit v1.2.3 From 8938c2547d2bbdba9ee83d293b515d34034fd101 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 10 Apr 2013 22:20:45 +0200 Subject: Catch FeedException lors de l'actualisation --- app/controllers/feedController.php | 30 +++++++++++++++++------------- public/theme/base.css | 2 +- 2 files changed, 18 insertions(+), 14 deletions(-) (limited to 'app/controllers/feedController.php') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index c205801af..77893e547 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -98,23 +98,27 @@ class feedController extends ActionController { $date_min = time () - (60 * 60 * 24 * 30 * $nb_month_old); $i = 0; - foreach ($feeds as $feed) { - $feed->load (); - $entries = $feed->entries (); - - foreach ($entries as $entry) { - if ($entry->date (true) >= $date_min) { - $values = $entry->toArray (); - $entryDAO->addEntry ($values); + try { + foreach ($feeds as $feed) { + $feed->load (); + $entries = $feed->entries (); + + foreach ($entries as $entry) { + if ($entry->date (true) >= $date_min) { + $values = $entry->toArray (); + $entryDAO->addEntry ($values); + } } - } - $feedDAO->updateLastUpdate ($feed->id ()); + $feedDAO->updateLastUpdate ($feed->id ()); - $i++; - if ($i >= 10) { - break; + $i++; + if ($i >= 10) { + break; + } } + } catch (FeedException $e) { + Log::record ($e->getMessage (), Log::ERROR); } $entryDAO->cleanOldEntries ($nb_month_old); diff --git a/public/theme/base.css b/public/theme/base.css index 7e2ce0520..98d387150 100644 --- a/public/theme/base.css +++ b/public/theme/base.css @@ -693,7 +693,7 @@ input, select, textarea { width: 30px; height: 40px; vertical-align: middle; - line-height: 35px; + line-height: 40px; font-size: 12px; } .flux_header .item.website { -- cgit v1.2.3 From b9f883be693ecaf0c956c64b9f3bd52f854cb04a Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 11 Apr 2013 19:48:52 +0200 Subject: Gestion des flux https invalides + amélioration mise à jour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 30 +++++++++++++++--------------- app/models/Feed.php | 2 +- lib/SimplePie/SimplePie/File.php | 1 + 3 files changed, 17 insertions(+), 16 deletions(-) (limited to 'app/controllers/feedController.php') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 77893e547..3fbb20835 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -98,27 +98,27 @@ class feedController extends ActionController { $date_min = time () - (60 * 60 * 24 * 30 * $nb_month_old); $i = 0; - try { - foreach ($feeds as $feed) { + foreach ($feeds as $feed) { + try { $feed->load (); - $entries = $feed->entries (); + } catch (FeedException $e) { + Log::record ($e->getMessage (), Log::ERROR); + } + $entries = $feed->entries (); - foreach ($entries as $entry) { - if ($entry->date (true) >= $date_min) { - $values = $entry->toArray (); - $entryDAO->addEntry ($values); - } + foreach ($entries as $entry) { + if ($entry->date (true) >= $date_min) { + $values = $entry->toArray (); + $entryDAO->addEntry ($values); } + } - $feedDAO->updateLastUpdate ($feed->id ()); + $feedDAO->updateLastUpdate ($feed->id ()); - $i++; - if ($i >= 10) { - break; - } + $i++; + if ($i >= 10) { + break; } - } catch (FeedException $e) { - Log::record ($e->getMessage (), Log::ERROR); } $entryDAO->cleanOldEntries ($nb_month_old); diff --git a/app/models/Feed.php b/app/models/Feed.php index da75ae8c8..056cbf626 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -124,7 +124,7 @@ class Feed extends Model { ); } else { $feed = new SimplePie (); - $feed->set_feed_url ($this->url); + $feed->set_feed_url (preg_replace ('/&/', '&', $this->url)); $feed->set_cache_location (CACHE_PATH); $feed->init (); diff --git a/lib/SimplePie/SimplePie/File.php b/lib/SimplePie/SimplePie/File.php index b7d1a2ac9..063ad955e 100644 --- a/lib/SimplePie/SimplePie/File.php +++ b/lib/SimplePie/SimplePie/File.php @@ -107,6 +107,7 @@ class SimplePie_File curl_setopt($fp, CURLOPT_REFERER, $url); curl_setopt($fp, CURLOPT_USERAGENT, $useragent); curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2); + curl_setopt($fp, CURLOPT_SSL_VERIFYPEER, false); if (!ini_get('open_basedir') && !ini_get('safe_mode') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>=')) { curl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1); -- cgit v1.2.3 From 61943f1661383bf8017b4c2a76fd11618e4adae0 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 11 Apr 2013 20:32:10 +0200 Subject: Plus possible d'ajouter un flux déjà existant + meilleure gestion actualisation / import OPML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 60 +++++++++++++++++++++++--------------- app/models/Category.php | 4 --- app/models/Entry.php | 2 -- app/models/Feed.php | 18 ++++++++++-- 4 files changed, 52 insertions(+), 32 deletions(-) (limited to 'app/controllers/feedController.php') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 3fbb20835..d2a2f29f5 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -34,7 +34,13 @@ class feedController extends ActionController { 'lastUpdate' => time () ); - if ($feedDAO->addFeed ($values)) { + if ($feedDAO->searchByUrl ($values['url'])) { + $notif = array ( + 'type' => 'bad', + 'content' => 'Vous êtes déjà abonné à ' . $feed->name () . '' + ); + Session::_param ('notification', $notif); + } elseif ($feedDAO->addFeed ($values)) { $entryDAO = new EntryDAO (); $entries = $feed->entries (); @@ -101,19 +107,19 @@ class feedController extends ActionController { foreach ($feeds as $feed) { try { $feed->load (); - } catch (FeedException $e) { - Log::record ($e->getMessage (), Log::ERROR); - } - $entries = $feed->entries (); + $entries = $feed->entries (); - foreach ($entries as $entry) { - if ($entry->date (true) >= $date_min) { - $values = $entry->toArray (); - $entryDAO->addEntry ($values); + foreach ($entries as $entry) { + if ($entry->date (true) >= $date_min) { + $values = $entry->toArray (); + $entryDAO->addEntry ($values); + } } - } - $feedDAO->updateLastUpdate ($feed->id ()); + $feedDAO->updateLastUpdate ($feed->id ()); + } catch (FeedException $e) { + Log::record ($e->getMessage (), Log::ERROR); + } $i++; if ($i >= 10) { @@ -153,20 +159,26 @@ class feedController extends ActionController { $i = 0; foreach ($feeds as $feed) { - $feed->load (); + try { + $feed->load (); - // Enregistrement du flux - $values = array ( - 'id' => $feed->id (), - 'url' => $feed->url (), - 'category' => $feed->category (), - 'name' => $feed->name (), - 'website' => $feed->website (), - 'description' => $feed->description (), - 'lastUpdate' => 0 - ); + // Enregistrement du flux + $values = array ( + 'id' => $feed->id (), + 'url' => $feed->url (), + 'category' => $feed->category (), + 'name' => $feed->name (), + 'website' => $feed->website (), + 'description' => $feed->description (), + 'lastUpdate' => 0 + ); - $feedDAO->addFeed ($values); + if (!$feedDAO->searchByUrl ($values['url'])) { + $feedDAO->addFeed ($values); + } + } catch (FeedException $e) { + Log::record ($e->getMessage (), Log::ERROR); + } } Request::forward (array ( @@ -203,7 +215,7 @@ class feedController extends ActionController { $catDAO = new CategoryDAO (); foreach ($categories as $cat) { - if (!$catDAO->searchByName ()) { + if (!$catDAO->searchByName ($cat->name ())) { $values = array ( 'id' => $cat->id (), 'name' => $cat->name (), diff --git a/app/models/Category.php b/app/models/Category.php index a153b8838..ae803591f 100755 --- a/app/models/Category.php +++ b/app/models/Category.php @@ -130,8 +130,6 @@ class CategoryDAO extends Model_pdo { if (isset ($cat[0])) { return $cat[0]; } else { - $info = $stm->errorInfo(); - Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } @@ -148,8 +146,6 @@ class CategoryDAO extends Model_pdo { if (isset ($cat[0])) { return $cat[0]; } else { - $info = $stm->errorInfo(); - Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } diff --git a/app/models/Entry.php b/app/models/Entry.php index 4c672bcf3..c8d05c5eb 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -372,8 +372,6 @@ class EntryDAO extends Model_pdo { if (isset ($entry[0])) { return $entry[0]; } else { - $info = $stm->errorInfo(); - Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } diff --git a/app/models/Feed.php b/app/models/Feed.php index 056cbf626..2e6782921 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -287,8 +287,22 @@ class FeedDAO extends Model_pdo { if (isset ($feed[$id])) { return $feed[$id]; } else { - $info = $stm->errorInfo(); - Log::record ('SQL error : ' . $info[2], Log::ERROR); + return false; + } + } + public function searchByUrl ($url) { + $sql = 'SELECT * FROM feed WHERE url=?'; + $stm = $this->bd->prepare ($sql); + + $values = array ($url); + + $stm->execute ($values); + $res = $stm->fetchAll (PDO::FETCH_ASSOC); + $feed = current (HelperFeed::daoToFeed ($res)); + + if (isset ($feed)) { + return $feed; + } else { return false; } } -- cgit v1.2.3 From 327b4ed3740db45ae0b52528f5f3fd73e3ec87df Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 11 Apr 2013 21:47:39 +0200 Subject: Séparation du style en deux fichiers pour faciliter la lecture et les mises à jour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/App_FrontController.php | 3 +- app/controllers/feedController.php | 2 +- public/theme/base.css | 868 ------------------------------------- 3 files changed, 3 insertions(+), 870 deletions(-) delete mode 100644 public/theme/base.css (limited to 'app/controllers/feedController.php') diff --git a/app/App_FrontController.php b/app/App_FrontController.php index 8a5dcdcba..1ddbfd89c 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -33,7 +33,8 @@ class App_FrontController extends FrontController { } private function loadStylesAndScripts () { - View::prependStyle (Url::display ('/theme/base.css')); + View::prependStyle (Url::display ('/theme/global.css')); + View::prependStyle (Url::display ('/theme/freshrss.css')); View::appendScript ('https://login.persona.org/include.js'); View::appendScript (Url::display ('/scripts/jquery.js')); View::appendScript (Url::display ('/scripts/notification.js')); diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index d2a2f29f5..3e6ae4800 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -132,7 +132,7 @@ class feedController extends ActionController { // notif $notif = array ( 'type' => 'good', - 'content' => '10 flux ont été mis à jour' + 'content' => $i . ' flux ont été mis à jour' ); Session::_param ('notification', $notif); diff --git a/public/theme/base.css b/public/theme/base.css deleted file mode 100644 index 98d387150..000000000 --- a/public/theme/base.css +++ /dev/null @@ -1,868 +0,0 @@ -/* FONTS */ -@font-face { - font-family: 'OpenSans'; - src: local('fonts/openSans.woff') format('woff'); -} - - -* { - margin: 0; - padding: 0; -} -html, body { - height: 100%; - font-size: 95%; - font-family: "Cantarell", "Helvetica", "Arial", "sans-serif"; -} - -/* LIENS */ -a { - color: #0062BE; - text-decoration: none; -} - a:hover { - text-decoration: underline; - } - -/* LISTES */ -ul, ol, dl { - margin: 10px 0 10px 30px; - line-height: 190%; -} - dd { - margin: 0 0 10px 30px; - } - -/* TITRES */ -h1, h2, h3 { - min-height: 40px; - margin: 15px 0 5px; - line-height: 40px; -} - -/* IMG */ -img { - max-width: 100%; - vertical-align: middle; -} - a img { - border: none; - } - -/* FORMULAIRES */ -legend { - display: block; - width: 100%; - margin: 20px 0 5px; - padding: 5px 0; - border-bottom: 1px solid #ddd; - font-size: 150%; - clear: both; -} -label { - display: block; - min-height: 25px; - padding: 5px 0; - font-size: 14px; - line-height: 25px; - cursor: pointer; -} -input, select, textarea { - display: inline-block; - min-height: 25px; - padding: 5px; - background: #fdfdfd; - border: 1px solid #bbb; - border-radius: 3px; - color: #666; - line-height: 25px; - vertical-align: middle; - box-shadow: 0 2px 2px #eee inset; -} - input[type="radio"], - input[type="checkbox"] { - width: 15px; - min-height: 15px; - } - input:focus, select:focus, textarea:focus { - color: #0062BE; - border-color: #33BBFF; - box-shadow: 0 2px 2px #DDDDFF inset; - } - -.form-group { - margin: 0; - clear: both; -} - .form-group.form-actions { - min-width: 250px; - padding: 5px 0; - background: #f4f4f4; - border-top: 1px solid #ddd; - } - .form-group.form-actions .btn { - margin: 0 10px; - } - .form-group .group-name { - display: block; - float: left; - width: 200px; - padding: 10px 0; - text-align: right; - } - .form-group .group-controls { - min-width: 250px; - min-height: 25px; - margin: 0 0 0 220px; - padding: 5px 0; - } - .form-group .group-controls .control { - display: block; - min-height: 30px; - padding: 5px 0; - line-height: 25px; - font-size: 14px; - } - -.stick { - display: inline-block; - white-space: nowrap; - font-size: 0px; - vertical-align: middle; -} - .stick input { - border-radius: 0; - font-size: 14px; - } - .stick .btn { - border-radius: 0; - font-size: 14px; - } - .stick .btn:first-child, - .stick input:first-child { - border-radius: 3px 0 0 3px; - } - .stick .btn:last-child, - .stick input:last-child { - border-radius: 0 3px 3px 0; - } - .stick .btn + .btn, - .stick .btn + input, - .stick input + .btn, - .stick input + input { - border-left: none; - } - .stick input + .btn { - border-top: 1px solid #bbb; - } - .stick .btn + .dropdown > .btn { - border-left: none; - border-radius: 0 3px 3px 0; - } - .stick .btn + .dropdown a { - font-size: 12px; - } - -.btn { - display: inline-block; - min-height: 37px; - min-width: 15px; - padding: 5px 10px; - background: #fff; - background: linear-gradient(#fff, #eee); - border-radius: 3px; - border: 1px solid #ddd; - border-bottom: 1px solid #aaa; - border-right: 1px solid #aaa; - color: #666; - text-shadow: 0px -1px 0 #ddd; - line-height: 20px; - vertical-align: middle; - cursor: pointer; -} - a.btn { - min-height: 25px; - line-height: 25px; - } - .btn:hover { - background: #f0f0f0; - background: linear-gradient(#f8f8f8, #f0f0f0); - text-decoration: none; - } - .btn.active, - .btn:active { - box-shadow: 0px 2px 4px #e0e0e0 inset, 0px 1px 2px #fafafa; - background: #eee; - } - - .btn.btn-important { - background: #0084CC; - background: linear-gradient(#0084CC, #0045CC); - color: #fff; - border: 1px solid #0062B7; - text-shadow: 0px -1px 0 #aaa; - } - .btn.btn-important:hover { - background: linear-gradient(#0066CC, #0045CC); - } - .btn.btn-important:active { - background: #0044CB; - box-shadow: none; - } - - .btn.btn-attention { - background: #E95B57; - background: linear-gradient(#E95B57, #BD362F); - color: #fff; - border: 1px solid #C44742; - text-shadow: 0px -1px 0px #666; - } - .btn.btn-attention:hover { - background: linear-gradient(#D14641, #BD362F); - } - .btn.btn-attention:active { - background: #BD362F; - box-shadow: none; - } - -/* NAVIGATION */ -.nav.nav-list .nav-header, -.nav.nav-list .item { - display: block; - height: 35px; - line-height: 35px; -} - .nav.nav-list .item:hover { - background: #fafafa; - } - .nav.nav-list .item:hover a { - color: #003388; - } - .nav.nav-list .item.active { - background: #0062BE; - color: #fff; - } - .nav.nav-list .item.active a { - color: #fff; - } - .nav.nav-list .disable { - color: #aaa; - background: #fafafa; - text-align: center; - } - .nav.nav-list .item > * { - display: block; - padding: 0 10px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .nav.nav-list a:hover { - text-decoration: none; - } - - .nav.nav-list .nav-header { - padding: 0 10px; - color: #888; - background: #f4f4f4; - border-bottom: 1px solid #ddd; - font-weight: bold; - text-shadow: 0 0 1px #ddd; - } - .nav.nav-list .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #ddd; - } - - .nav.nav-list .nav-form { - padding: 3px; - text-align: center; - } - -.nav-head { - display: block; - margin: 0; - background: #fff; - background: linear-gradient(#fff, #f0f0f0); - border-bottom: 1px solid #ddd; - text-align: right; -} - .nav-head .item { - display: inline-block; - padding: 5px 10px; - } - -/* DROPDOWN */ -.dropdown { - position: relative; - display: inline-block; -} - .dropdown .dropdown-target { - display: none; - } - - .dropdown .dropdown-menu { - display: none; - min-width: 200px; - margin: 5px 0 0; - padding: 5px 0; - position: absolute; - right: 0px; - background: #fff; - border: 1px solid #ddd; - border-radius: 5px; - text-align: left; - box-shadow: 3px 3px 3px #ddd; - } - .dropdown .dropdown-menu .dropdown-header { - display: block; - padding: 0 5px; - color: #888; - font-weight: bold; - font-size: 14px; - line-height: 30px; - } - .dropdown .dropdown-menu .item { - display: block; - height: 30px; - font-size: 90%; - line-height: 30px; - } - .dropdown .dropdown-menu .item > * { - display: block; - padding: 0 25px; - line-height: 30px; - } - .dropdown .dropdown-menu .item:hover { - background: #0062BE; - color: #fff; - } - .dropdown .dropdown-menu .item:hover > * { - color: #fff; - text-decoration: none; - } - .dropdown .dropdown-menu .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #ddd; - } - .dropdown .dropdown-target:target ~ .dropdown-menu { - display: block; - z-index: 10; - } - .dropdown .dropdown-close { - display: inline-block; - position: absolute; - top: -16px; right: -16px; - width: 16px; - height: 16px; - padding: 5px; - background: #fff; - border-radius: 50px; - border: 1px solid #ddd; - line-height: 16px; - text-align: center; - } - .dropdown .dropdown-close:hover { - background: #f4f4f4; - } - -/* ALERTS */ -.alert { - display: block; - width: 90%; - margin: 15px auto; - padding: 10px 15px; - background: #f4f4f4; - border: 1px solid #ccc; - border-right: 1px solid #aaa; - border-bottom: 1px solid #aaa; - border-radius: 5px; - color: #aaa; - text-shadow: 0 0 1px #eee; - box-shadow: 1px 1px 3px #aaa inset; -} - .alert .alert-head { - margin: 0; - font-weight: bold; - font-size: 110%; - } - -/* ICONES */ -.icon { - display: inline-block; - width: 16px; - height: 16px; - vertical-align: middle; - line-height: 16px; - background: center center no-repeat; -} - .icon.i_refresh { - background-image: url("icons/refresh.svg"); - } - .icon.i_bookmark { - background-image: url("icons/starred.svg"); - } - .icon.i_not_bookmark { - background-image: url("icons/unstarred.svg"); - } - .icon.i_read { - background-image: url("icons/read.svg"); - } - .icon.i_unread { - background-image: url("icons/unread.svg"); - } - .icon.i_all { - background-image: url("icons/all.svg"); - } - .icon.i_close { - background-image: url("icons/close.svg"); - } - .icon.i_search { - background-image: url("icons/search.svg"); - } - .icon.i_configure { - background-image: url("icons/configure.svg"); - } - .icon.i_login { - background-image: url("icons/login.svg"); - } - .icon.i_logout { - background-image: url("icons/logout.svg"); - } - .icon.i_add { - background-image: url("icons/add.svg"); - } - .icon.i_link { - background-image: url("icons/link.svg"); - } - .icon.i_down { - background-image: url("icons/down.svg"); - } - .icon.i_up { - background-image: url("icons/up.svg"); - } - .icon.i_help { - background-image: url("icons/help.svg"); - } - .icon.i_note { - background-image: url("icons/note.svg"); - } - .icon.i_note_empty { - background-image: url("icons/note_empty.svg"); - } - -/* STRUCTURE */ -.header { - display: table; - width: 100%; - background: #f4f4f4; - table-layout: fixed; -} - .header > .item { - display: table-cell; - padding: 10px 0; - border-bottom: 1px solid #aaa; - vertical-align: middle; - text-align: center; - } - .header > .item.title { - width: 250px; - } - .header > .item.title h1 { - margin: 0; - text-shadow: 1px -1px 0 #ccc; - } - .header > .item.title a:hover { - text-decoration: none; - } - .header > .item.search input { - width: 200px; - transition: all 200ms linear; - } - .header .item.search input:focus { - width: 300px; - } - .header > .item.configure { - width: 100px; - } - -#global { - display: table; - width: 100%; - height: 100%; - background: #fafafa; - table-layout: fixed; -} - .aside { - display: table-cell; - height: 100%; - width: 250px; - vertical-align: top; - border-right: 1px solid #aaa; - background: #fff; - } - .aside .nav-form input { - width: 180px; - } - .aside.aside_flux { - padding: 10px 0; - } - .aside.aside_feed .nav-form input { - width: 140px; - } - .aside.aside_feed .nav-form .dropdown .dropdown-menu { - right: -20px; - } - - .nav_menu { - width: 100%; - background: #fafafa; - border-bottom: 1px solid #aaa; - text-align: center; - padding: 5px 0; - } - -.favicon { - width: 16px; -} - -.categories { - margin: 0; - padding: 0; - text-align: center; - list-style: none; -} - .categories .all, - .categories .favorites, - .categories .category { - display: block; - padding: 5px 0; - width: 220px; - margin: 5px auto; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .categories .all .btn, - .categories .favorites .btn, - .categories .category .btn:first-child { - width: 195px; - position: relative; - } - .categories .feeds { - width: 220px; - margin: 0 auto; - list-style: none; - } - .categories .feeds .item.active:after { - content: "⇢"; - line-height: 35px; - float: right; - } - .categories .feeds .item .feed { - display: inline-block; - margin: 0; - width: 165px; - line-height: 35px; - font-size: 90%; - vertical-align: middle; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .categories .feeds .dropdown .dropdown-menu { - left: 0; - } - .categories .feeds .item .dropdown-toggle i { - background-image: none; - } - .categories .feeds .item .dropdown-target:target ~ .dropdown-toggle i, - .categories .feeds .item:hover .dropdown-toggle i { - background-image: url("icons/configure.svg"); - } - .categories .notRead { - position: absolute; - top: 3px; right: 3px; - padding: 1px 5px; - background: #ccc; - color: #fff; - font-size: 90%; - border: 1px solid #bbb; - border-radius: 5px; - box-shadow: 1px 3px 3px #aaa inset; - text-shadow: 0 0 1px #aaa; - } - -.post { - padding: 10px 50px; -} - .post form { - margin: 10px 0; - } - -.day { - height: 50px; - padding: 0 10px; - font-size: 130%; - font-weight: bold; - line-height: 50px; - background: #fff; - border-top: 1px solid #aaa; - border-bottom: 1px solid #aaa; -} - .day:first-child { - border-top: none; - } - -.flux { - border-left: 10px solid #aaa; - background: #fafafa; -} - .flux:hover { - background: #fff; - } - .flux.active { - border-left: 10px solid #0062BE; - background: #fff; - } - .flux.not_read { - border-left: 10px solid #FF5300; - background: #FFF3ED; - } - .flux.favorite { - border-left: 10px solid #FFC300; - background: #FFF6DA; - } - - .flux_header { - display: table; - table-layout: fixed; - margin: 0; - padding: 0; - width: 100%; - height: 25px; - font-size: 12px; - line-height: 25px; - border-top: 1px solid #ddd; - } - .flux_header .item { - display: table-cell; - vertical-align: middle; - } - .flux_header .item.manage { - width: 90px; - white-space: nowrap; - font-size: 0px; - vertical-align: middle; - text-align: center; - } - .flux_header .item.manage .read { - display: inline-block; - width: 30px; - height: 40px; - background: url("icons/read.svg") center center no-repeat; - vertical-align: middle; - } - .flux_header .item.manage .read:hover { - text-decoration: none; - } - .flux.not_read .flux_header .item.manage .read { - background: url("icons/unread.svg") center center no-repeat; - } - .flux_header .item.manage .bookmark { - display: inline-block; - width: 30px; - height: 40px; - background: url("icons/non-starred.svg") center center no-repeat; - vertical-align: middle; - } - .flux_header .item.manage .bookmark:hover { - text-decoration: none; - } - .flux.favorite .flux_header .item.manage .bookmark { - background: url("icons/starred.svg") center center no-repeat; - } - .flux_header .item.manage .note { - display: inline-block; - width: 30px; - height: 40px; - vertical-align: middle; - line-height: 40px; - font-size: 12px; - } - .flux_header .item.website { - width: 200px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - line-height: 35px; - } - .flux_header .item.website a { - display: block; - padding: 0 5px; - height: 40px; - } - .flux_header .item.title { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - cursor: pointer; - } - .flux_header .item.title h1 { - font-size: 12px; - margin: 0; - font-weight: normal; - } - .flux.not_read .flux_header .item.title h1 { - font-weight: bold; - } - .flux_header .item.date { - width: 200px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - text-align: right; - font-size: 10px; - color: #666; - cursor: pointer; - } - .flux_header .item.link { - width: 35px; - text-align: center; - } - .flux_header .item.link a { - display: inline-block; - width: 35px; - height: 40px; - background: url("icons/link.svg") center center no-repeat; - vertical-align: middle; - } - .flux_header .item.link a:hover { - text-decoration: none; - } - -.content { - max-width: 550px; - margin: 0 auto; - padding: 10px; - line-height: 170%; - font-family: 'OpenSans'; -} - .content h1, .content h2, .content h3 { - margin: 20px 0 5px; - } - .content p { - margin: 0 0 20px; - } - .content img.big { - display: block; - margin: 10px 0; - width: 100%; - box-shadow: 0 0 5px #000; - border-radius: 5px; - } - .content pre { - width: 90%; - margin: 10px auto; - padding: 10px; - overflow: auto; - background: #666; - border: 1px solid #000; - color: #fafafa; - border-radius: 5px; - } - .content q, .content blockquote { - display: block; - margin: 5px 0; - padding: 5px 20px; - font-style: italic; - border-left: 4px solid #ccc; - color: #666; - } - .content blockquote p { - margin: 0; - } - -/*** PAGINATION ***/ -.pagination { - display: table; - width: 100%; - margin: 0; - background: #fafafa; - text-align: center; - color: #333; - font-size: 80%; - line-height: 200%; - table-layout: fixed; -} - .pagination .item { - display: table-cell; - padding: 5px 10px; - border-top: 1px solid #aaa; - } - .pagination .item a { - color: #333; - font-style: italic; - } - .pagination .pager-previous, .pagination .pager-next { - width: 200px; - } - .pagination .item.pager-current { - font-weight: bold; - } - -/*** NOTIFICATION ***/ -.notification { - position: fixed; - bottom: 0; - left: 5%; right: 5%; - min-height: 30px; - padding: 10px; - line-height: 30px; - text-align: center; - border-radius: 5px 5px 0 0; - box-shadow: 0 0 5px #666; - background: #ddd; - color: #666; - font-weight: bold; -} - .notification.good { - background: #f4f899; - } - .notification.bad { - background: #f4a899; - } - .notification a.close { - display: inline-block; - width: 16px; - height: 16px; - float: right; - margin: -20px -20px 0 0; - padding: 5px; - background: #fff; - border-radius: 50px; - border: 1px solid #aaa; - line-height: 16px; - } - -@media(max-width: 840px) { - .header, - .aside, - .flux_header .item.website span, - .flux_header .item.date { - display: none; - } - .flux_header .item.website { - width: 30px; - text-align: center; - } - .pagination .pager-previous, .pagination .pager-next { - width: 100px; - } -} -- cgit v1.2.3 From a4beb7b772fdc3c8c894b93611bfb030c9456f07 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 13 Apr 2013 14:26:13 +0200 Subject: Correction faute dans about + ajout options mise à jour et marquer comme lu pour un flux spécifiée MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 32 +++++++++++++++++++++++++++----- app/layout/aside_flux.phtml | 7 +++++-- app/views/index/about.phtml | 2 +- 3 files changed, 33 insertions(+), 8 deletions(-) (limited to 'app/controllers/feedController.php') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 3e6ae4800..d2a2184eb 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -97,7 +97,16 @@ class feedController extends ActionController { $feedDAO = new FeedDAO (); $entryDAO = new EntryDAO (); - $feeds = $feedDAO->listFeedsOrderUpdate (); + $id = Request::param ('id'); + $feeds = array (); + if ($id) { + $feed = $feedDAO->searchById ($id); + if ($feed) { + $feeds = array ($feed); + } + } else { + $feeds = $feedDAO->listFeedsOrderUpdate (); + } // pour ne pas ajouter des entrées trop anciennes $nb_month_old = $this->view->conf->oldEntries (); @@ -130,10 +139,23 @@ class feedController extends ActionController { $entryDAO->cleanOldEntries ($nb_month_old); // notif - $notif = array ( - 'type' => 'good', - 'content' => $i . ' flux ont été mis à jour' - ); + if ($i == 1) { + $feed = reset ($feeds); + $notif = array ( + 'type' => 'good', + 'content' => '' . $feed->name () . ' a été mis à jour' + ); + } elseif ($i > 0) { + $notif = array ( + 'type' => 'good', + 'content' => $i . ' flux ont été mis à jour' + ); + } else { + $notif = array ( + 'type' => 'bad', + 'content' => 'Aucun flux n\'a pu être mis à jour' + ); + } Session::_param ('notification', $notif); Request::forward (array (), true); diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index b12edfbc7..3a6ecb304 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -74,11 +74,14 @@ diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml index ad3eb6cc6..73f5f4001 100644 --- a/app/views/index/about.phtml +++ b/app/views/index/about.phtml @@ -20,5 +20,5 @@

FreshRSS est un agrégateur de flux RSS à auto-héberger à l'image de RSSLounge, TinyTinyRSS ou Leed. Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable. L'objectif étant d'offrir une alternative sérieuse au futur feu-Google Reader.

Crédits

- Les icônes sont issus du projet GNOME. La police Open Sans utilisée a été créée par Steve Matteson. Les favicons sont récupérés grâce au site getFavicon. FreshRSS repose sur Minz, un framework PHP. + Des éléments de design sont issus du projet Bootstrap bien que FreshRSS n'utilise pas ce framework. Les icônes sont issues du projet GNOME. La police Open Sans utilisée a été créée par Steve Matteson. Les favicons sont récupérés grâce au site getFavicon. FreshRSS repose sur Minz, un framework PHP. -- cgit v1.2.3 From 9b9543109e36a5409fe71eb084cfac680dfc7cbd Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 13 Apr 2013 15:27:36 +0200 Subject: Fix issue #39 : actualisation de tous les flux grâce à Ajax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 8 ++++-- app/controllers/indexController.php | 1 + app/controllers/javascriptController.php | 9 ++++--- app/layout/nav_menu.phtml | 2 +- app/views/javascript/actualize.phtml | 46 ++++++++++++++++++++++++++++++++ public/theme/freshrss.css | 20 ++++++++++++++ 6 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 app/views/javascript/actualize.phtml (limited to 'app/controllers/feedController.php') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index d2a2184eb..83fc19e20 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -156,9 +156,13 @@ class feedController extends ActionController { 'content' => 'Aucun flux n\'a pu être mis à jour' ); } - Session::_param ('notification', $notif); - Request::forward (array (), true); + if (Request::param ('ajax', 0) == 0) { + Session::_param ('notification', $notif); + Request::forward (array (), true); + } else { + $this->view->_useLayout (false); + } } public function massiveImportAction () { diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index a11c26044..8fa911631 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -8,6 +8,7 @@ class indexController extends ActionController { public function indexAction () { View::appendScript (Url::display ('/scripts/shortcut.js')); View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'main'))); + View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'actualize'))); $entryDAO = new EntryDAO (); $feedDAO = new FeedDAO (); diff --git a/app/controllers/javascriptController.php b/app/controllers/javascriptController.php index 8060f560c..071cf65a4 100755 --- a/app/controllers/javascriptController.php +++ b/app/controllers/javascriptController.php @@ -5,8 +5,11 @@ class javascriptController extends ActionController { $this->view->_useLayout (false); header('Content-type: text/javascript'); } - - public function mainAction () { - + + public function mainAction () {} + + public function actualizeAction () { + $feedDAO = new FeedDAO (); + $this->view->feeds = $feedDAO->listFeeds (); } } diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 90fe4aea1..5d7dd3091 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -1,7 +1,7 @@