From 1e077160fca3306a273ecae5a366fd756c32baee Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 30 Nov 2013 22:47:48 +0100 Subject: Optimisation recherche et pagination MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Optimisation recherche SQL avec utilisation de HAVING plutôt que WHERE * Simplification et amélioration des performances en supprimant de RSSPaginator qui n'aidait plus vraiment et nécessitait plus de code et des copies de données. * Correction d'un bug dans le titre de la page introduit récemment, et simplification --- app/views/helpers/view/normal_view.phtml | 8 +++----- app/views/helpers/view/reader_view.phtml | 7 +++---- app/views/helpers/view/rss_view.phtml | 3 +-- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'app/views/helpers/view') diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index 0a03ea15a..1a7efa58f 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -3,8 +3,7 @@ $this->partial ('aside_flux'); $this->partial ('nav_menu'); -if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { - $items = $this->entryPaginator->items (); +if (!empty($this->entries)) { ?>
@@ -23,8 +22,7 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { $email = $this->conf->sharing ('email'); $print = $this->conf->sharing ('print'); ?> - - + entries as $item) { ?> isDay (Days::TODAY)) { ?>
@@ -199,7 +197,7 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) {
- entryPaginator->render ('pagination.phtml', 'next'); ?> + renderHelper('pagination'); ?>
partial ('nav_entries'); ?> diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml index 9b8ec6cde..30226af42 100644 --- a/app/views/helpers/view/reader_view.phtml +++ b/app/views/helpers/view/reader_view.phtml @@ -1,12 +1,11 @@ partial ('nav_menu'); -if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { - $items = $this->entryPaginator->items (); +if (!empty($this->entries)) { ?>
- + entries as $item) { ?>
@@ -38,7 +37,7 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) {
- entryPaginator->render ('pagination.phtml', 'next'); ?> + renderHelper('pagination'); ?>
diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/helpers/view/rss_view.phtml index e34f3b8b5..460146dc0 100755 --- a/app/views/helpers/view/rss_view.phtml +++ b/app/views/helpers/view/rss_view.phtml @@ -8,8 +8,7 @@ GMT entryPaginator->items (); -foreach ($items as $item) { +foreach ($this->entries as $item) { ?> <?php echo $item->title (); ?> -- cgit v1.2.3