summaryrefslogtreecommitdiff
path: root/app/views/helpers
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
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')
-rwxr-xr-xapp/views/helpers/pagination.phtml4
-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
4 files changed, 9 insertions, 13 deletions
diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml
index 0b0d2f5ba..408cfca1b 100755
--- a/app/views/helpers/pagination.phtml
+++ b/app/views/helpers/pagination.phtml
@@ -8,8 +8,8 @@
<ul class="pagination">
<li class="item pager-next">
- <?php if ($this->next != '') { ?>
- <?php $params[$getteur] = $this->next; ?>
+ <?php if (!empty($this->nextId)) { ?>
+ <?php $params['next'] = $this->nextId; ?>
<a id="load_more" href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t ('load_more'); ?></a>
<?php } elseif ($markReadUrl) { ?>
<a id="bigMarkAsRead" href="<?php echo $markReadUrl; ?>">
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>