A free, self-hostable news aggregator…
Ajout informations dans la sidebar
Marien Fressinaud08a01f87f156
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.phpindex b9e5f4f4a..a1b02196d 100755--- a/app/controllers/indexController.php+++ b/app/controllers/indexController.php@@ -38,6 +38,8 @@ class indexController extends ActionController {$this->view->entryPaginator->_currentPage ($page);$this->view->cat_aside = $catDAO->listCategories ();+ $this->view->nb_favorites = $entryDAO->countFavorites ();+ $this->view->nb_total = $entryDAO->count ();}public function changeModeAction () {diff --git a/app/layout/aside.phtml b/app/layout/aside.phtmlindex 51c64fa08..f1c838950 100644--- a/app/layout/aside.phtml+++ b/app/layout/aside.phtml@@ -12,7 +12,8 @@<?php if (isset ($this->cat_aside)) { ?><ul id="flux_menu">- <li><a href="<?php echo Url::display (array ('params' => array ('get' => 'favoris'))); ?>">Favoris</a></li>+ <li><a href="<?php echo Url::display (array ()); ?>">Tous <span><?php echo $this->nb_total; ?> article<?php echo $this->nb_total > 1 ? 's' : ''; ?></span></a></li>+ <li><a href="<?php echo Url::display (array ('params' => array ('get' => 'favoris'))); ?>">Favoris <span><?php echo $this->nb_favorites; ?> article<?php echo $this->nb_favorites > 1 ? 's' : ''; ?></span></a></li><?php foreach ($this->cat_aside as $cat) { ?><li><a href="<?php echo Url::display (array ('params' => array ('get' => $cat->id ()))); ?>"><?php echo $cat->name (); ?> <span><?php echo $cat->nbFeed (); ?> flux</span></a></li><?php } ?>diff --git a/app/models/Entry.php b/app/models/Entry.phpindex 6fcc821f4..654286bd7 100755--- a/app/models/Entry.php+++ b/app/models/Entry.php@@ -273,6 +273,15 @@ class EntryDAO extends Model_pdo {return $res[0]['count'];}++ public function countFavorites () {+ $sql = 'SELECT COUNT(*) AS count FROM entry WHERE is_favorite=1';+ $stm = $this->bd->prepare ($sql);+ $stm->execute ();+ $res = $stm->fetchAll (PDO::FETCH_ASSOC);++ return $res[0]['count'];+ }}class HelperEntry {diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtmlindex 8050d2cee..cf8af7ff9 100644--- a/app/views/configure/shortcut.phtml+++ b/app/views/configure/shortcut.phtml@@ -13,7 +13,7 @@<label for="mark_read">Marquer l'article comme lu / non lu</label><input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?php echo $s['mark_read']; ?>" />- <p>+ <code>shift</code> pour marquer tous les articles</p>+ <p>+ <code>shift</code> pour marquer tous les articles comme non lus</p><label for="mark_favorite">Mettre l'article en favori</label><input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?php echo $s['mark_favorite']; ?>" />diff --git a/public/theme/base.css b/public/theme/base.cssindex 298e43672..a6535d9dd 100644--- a/public/theme/base.css+++ b/public/theme/base.css@@ -233,7 +233,7 @@ form {}.post {- width: 80%;+ width: 90%;margin: 0 auto;}.post.flux {