diff options
| author | 2014-07-06 00:09:31 +0200 | |
|---|---|---|
| committer | 2014-07-06 00:09:31 +0200 | |
| commit | bc8eb560afd50290745ea6a500c0f930df2559eb (patch) | |
| tree | 476fe293b7d06841105bd5fbb211fd24861a87b0 /app/views | |
| parent | b48dc25963553e4596a5ca10a3c823e895fbfd92 (diff) | |
Add TTL to control feed freshness
https://github.com/marienfressinaud/FreshRSS/issues/250
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/configure/archiving.phtml | 21 | ||||
| -rw-r--r-- | app/views/configure/feed.phtml | 21 |
2 files changed, 42 insertions, 0 deletions
diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index e144d0f45..04fa19b0d 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -24,6 +24,27 @@ ?></select> (<?php echo Minz_Translate::t('by_default'); ?>) </div> </div> + <div class="form-group"> + <label class="group-name" for="ttl_default"><?php echo Minz_Translate::t('ttl'), ' ', Minz_Translate::t('by_feed'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl_default" id="ttl_default" required="required"><?php + $found = false; + foreach (array(1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', + 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', + 36000 => '10h', 43200 => '12h', 64800 => '18h', + 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', + 604800 => '1wk', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->conf->ttl_default == $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if ($this->conf->ttl_default == $v) { + $found = true; + } + } + if (!$found) { + echo '<option value="' . intval($this->conf->ttl_default) . '" selected="selected">' . intval($this->conf->ttl_default) . 's</option>'; + } + ?></select> (<?php echo Minz_Translate::t('by_default'); ?>) + </div> + </div> <div class="form-group form-actions"> <div class="group-controls"> diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index 27b0990ff..a8dd9a8cb 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -103,6 +103,27 @@ ?></select> </div> </div> + <div class="form-group"> + <label class="group-name" for="ttl"><?php echo Minz_Translate::t('ttl'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl" id="ttl" required="required"><?php + $found = false; + foreach (array(-2 => Minz_Translate::t('by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', + 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', + 36000 => '10h', 43200 => '12h', 64800 => '18h', + 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', + 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->flux->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if ($this->flux->ttl() == $v) { + $found = true; + } + } + if (!$found) { + echo '<option value="' . intval($this->flux->ttl()) . '" selected="selected">' . intval($this->flux->ttl()) . 's</option>'; + } + ?></select> + </div> + </div> <div class="form-group form-actions"> <div class="group-controls"> <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> |
