diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php index e9e049f98..815f3f5f4 100755 --- a/app/controllers/configureController.php +++ b/app/controllers/configureController.php @@ -259,6 +259,9 @@ class configureController extends ActionController { $this->view->themes = RSSThemes::get(); View::prependTitle (Translate::t ('general_and_reading_management') . ' - '); + + $entryDAO = new EntryDAO (); + $this->view->nb_total = $entryDAO->count (); } public function importExportAction () { diff --git a/app/models/Entry.php b/app/models/Entry.php index e40cb5992..c6715a431 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -456,15 +456,21 @@ class EntryDAO extends Model_pdo { $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); return array('total' => $res[0], 'unread' => $res[1], 'read' => $res[0] - $res[1]); } - public function count () { - $sql = 'SELECT COUNT(e.id) AS count FROM ' . $this->prefix . 'entry e INNER JOIN ' . $this->prefix . 'feed f ON e.id_feed = f.id WHERE priority > 0'; + public function count ($minPriority = null) { + $sql = 'SELECT COUNT(e.id) AS count FROM ' . $this->prefix . 'entry e INNER JOIN ' . $this->prefix . 'feed f ON e.id_feed = f.id'; + if ($minPriority !== null) { + $sql = ' WHERE priority > ' . intval($minPriority); + } $stm = $this->bd->prepare ($sql); $stm->execute (); $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); return $res[0]; } - public function countNotRead () { - $sql = 'SELECT COUNT(e.id) AS count FROM ' . $this->prefix . 'entry e INNER JOIN ' . $this->prefix . 'feed f ON e.id_feed = f.id WHERE priority > 0 AND is_read = 0'; + public function countNotRead ($minPriority = null) { + $sql = 'SELECT COUNT(e.id) AS count FROM ' . $this->prefix . 'entry e INNER JOIN ' . $this->prefix . 'feed f ON e.id_feed = f.id WHERE is_read = 0'; + if ($minPriority !== null) { + $sql = ' AND priority > ' . intval($minPriority); + } $stm = $this->bd->prepare ($sql); $stm->execute (); $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 20d1e7089..22fc72f1b 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -204,9 +204,10 @@
- +

nb_total; ?>

+

- +