Refactor idle feed stats

This commit is contained in:
Alexis Degrugillier
2014-06-13 18:19:09 -04:00
parent 181fcd9889
commit d9f570a84d
2 changed files with 16 additions and 54 deletions

View File

@@ -51,23 +51,23 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
continue;
}
if ($feedDate < $lastWeek) {
$idleFeeds['lastWeek'][] = $feed['name'];
$idleFeeds['last_week'][] = $feed['name'];
}
if ($feedDate < $lastMonth) {
$idleFeeds['lastMonth'][] = $feed['name'];
$idleFeeds['last_month'][] = $feed['name'];
}
if ($feedDate < $last3Month) {
$idleFeeds['last3Month'][] = $feed['name'];
$idleFeeds['last_3_month'][] = $feed['name'];
}
if ($feedDate < $last6Month) {
$idleFeeds['last6Month'][] = $feed['name'];
$idleFeeds['last_6_month'][] = $feed['name'];
}
if ($feedDate < $lastYear) {
$idleFeeds['lastYear'][] = $feed['name'];
$idleFeeds['last_year'][] = $feed['name'];
}
}
$this->view->idleFeeds = $idleFeeds;
$this->view->idleFeeds = array_reverse($idleFeeds);
}
}

View File

@@ -5,53 +5,15 @@
<h1><?php echo Minz_Translate::t ('stats_idle'); ?></h1>
<div class="stat">
<h2><?php echo Minz_Translate::t ('last_week'); ?></h2>
<?php foreach ($this->idleFeeds as $period => $feeds): ?>
<div class="stat">
<h2><?php echo Minz_Translate::t ($period); ?></h2>
<ul>
<?php foreach ($this->idleFeeds['lastWeek'] as $feed): ?>
<li><?php echo $feed; ?></li>
<?php endforeach; ?>
</ul>
</div>
<div class="stat">
<h2><?php echo Minz_Translate::t ('last_month'); ?></h2>
<ul>
<?php foreach ($this->idleFeeds['lastMonth'] as $feed): ?>
<li><?php echo $feed; ?></li>
<?php endforeach; ?>
</ul>
</div>
<div class="stat">
<h2><?php echo Minz_Translate::t ('last_3_month'); ?></h2>
<ul>
<?php foreach ($this->idleFeeds['last3Month'] as $feed): ?>
<li><?php echo $feed; ?></li>
<?php endforeach; ?>
</ul>
</div>
<div class="stat">
<h2><?php echo Minz_Translate::t ('last_6_month'); ?></h2>
<ul>
<?php foreach ($this->idleFeeds['last6Month'] as $feed): ?>
<li><?php echo $feed; ?></li>
<?php endforeach; ?>
</ul>
</div>
<div class="stat">
<h2><?php echo Minz_Translate::t ('last_year'); ?></h2>
<ul>
<?php foreach ($this->idleFeeds['lastYear'] as $feed): ?>
<li><?php echo $feed; ?></li>
<?php endforeach; ?>
</ul>
</div>
<ul>
<?php foreach ($feeds as $feed): ?>
<li><?php echo $feed; ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endforeach; ?>
</div>