aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers/view
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-30 22:47:48 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-30 22:47:48 +0100
commit1e077160fca3306a273ecae5a366fd756c32baee (patch)
tree942066b18dbf63c63f2dbddb547ed3e9bcc66d8d /app/views/helpers/view
parent37ce14c093c3dd009bcd7b627c5e819ac88dd5b7 (diff)
Optimisation recherche et pagination
* 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
Diffstat (limited to 'app/views/helpers/view')
-rw-r--r--app/views/helpers/view/normal_view.phtml8
-rw-r--r--app/views/helpers/view/reader_view.phtml7
-rwxr-xr-xapp/views/helpers/view/rss_view.phtml3
3 files changed, 7 insertions, 11 deletions
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)) {
?>
<div id="stream" class="normal<?php echo $this->conf->displayPosts () === 'no' ? ' hide_posts' : ''; ?>">
@@ -23,8 +22,7 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) {
$email = $this->conf->sharing ('email');
$print = $this->conf->sharing ('print');
?>
-
- <?php foreach ($items as $item) { ?>
+ <?php foreach ($this->entries as $item) { ?>
<?php if ($display_today && $item->isDay (Days::TODAY)) { ?>
<div class="day" id="day_today">
@@ -199,7 +197,7 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) {
</div>
<?php } ?>
- <?php $this->entryPaginator->render ('pagination.phtml', 'next'); ?>
+ <?php $this->renderHelper('pagination'); ?>
</div>
<?php $this->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 @@
<?php
$this->partial ('nav_menu');
-if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) {
- $items = $this->entryPaginator->items ();
+if (!empty($this->entries)) {
?>
<div id="stream" class="reader">
- <?php foreach ($items as $item) { ?>
+ <?php foreach ($this->entries as $item) { ?>
<div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>">
<div class="flux_content">
@@ -38,7 +37,7 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) {
</div>
<?php } ?>
- <?php $this->entryPaginator->render ('pagination.phtml', 'next'); ?>
+ <?php $this->renderHelper('pagination'); ?>
</div>
<?php } else { ?>
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 @@
<lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate>
<atom:link href="<?php echo Url::display ($this->rss_url, 'html', true); ?>" rel="self" type="application/rss+xml" />
<?php
-$items = $this->entryPaginator->items ();
-foreach ($items as $item) {
+foreach ($this->entries as $item) {
?>
<item>
<title><?php echo $item->title (); ?></title>