diff options
| author | 2013-12-16 00:54:13 +0100 | |
|---|---|---|
| committer | 2013-12-16 00:54:13 +0100 | |
| commit | 847de9b3292ad854b281d7e12cc36ac93e745139 (patch) | |
| tree | 65ce480d622fd983d36df9d6a60e0249de053a1a /app/views/helpers | |
| parent | 529d6bcd15f7351cb7bdcf2f74c6a44930b0de55 (diff) | |
PHP : performances fonction isDay
Amélioration des performances de Entry->isDay()
Diffstat (limited to 'app/views/helpers')
| -rw-r--r-- | app/views/helpers/view/normal_view.phtml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index 094017957..d5328651d 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -21,24 +21,25 @@ if (!empty($this->entries)) { $facebook = $this->conf->sharing ('facebook'); $email = $this->conf->sharing ('email'); $print = $this->conf->sharing ('print'); + $today = $this->today; ?> <?php foreach ($this->entries as $item) { ?> - <?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY)) { ?> + <?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $today)) { ?> <div class="day" id="day_today"> <?php echo Minz_Translate::t ('today'); ?> <span class="date"> - <?php echo timestamptodate (time (), false); ?></span> <span class="name"><?php echo $this->currentName; ?></span> </div> <?php $display_today = false; } ?> - <?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY)) { ?> + <?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $today)) { ?> <div class="day" id="day_yesterday"> <?php echo Minz_Translate::t ('yesterday'); ?> <span class="date"> - <?php echo timestamptodate (time () - 86400, false); ?></span> <span class="name"><?php echo $this->currentName; ?></span> </div> <?php $display_yesterday = false; } ?> - <?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY)) { ?> + <?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $today)) { ?> <div class="day" id="day_before_yesterday"> <?php echo Minz_Translate::t ('before_yesterday'); ?> <span class="name"><?php echo $this->currentName; ?></span> |
