Commit 6e93e567 authored by Dries's avatar Dries

- Patch #19646 by JamesAn: code clean up, consistently use define.

parent 033f2f3f
......@@ -54,7 +54,7 @@ function aggregator_view() {
*/
function aggregator_form_feed(&$form_state, stdClass $feed = NULL) {
$period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval');
$period[0] = t('Never');
$period[AGGREGATOR_CLEAR_NEVER] = t('Never');
$form['title'] = array('#type' => 'textfield',
'#title' => t('Title'),
......
......@@ -6,6 +6,11 @@
* Used to aggregate syndicated content (RSS, RDF, and Atom).
*/
/**
* Denotes that a feed's items should never expire.
*/
define('AGGREGATOR_CLEAR_NEVER', 0);
/**
* Implement hook_help().
*/
......@@ -286,7 +291,10 @@ function aggregator_perm() {
* Checks news feeds for updates once their refresh interval has elapsed.
*/
function aggregator_cron() {
$result = db_query('SELECT * FROM {aggregator_feed} WHERE checked + refresh < :time AND refresh > 0', array(':time' => REQUEST_TIME));
$result = db_query('SELECT * FROM {aggregator_feed} WHERE checked + refresh < :time AND refresh != :never', array(
':time' => REQUEST_TIME,
':never' => AGGREGATOR_CLEAR_NEVER
));
foreach ($result as $feed) {
aggregator_refresh($feed);
}
......
......@@ -6,11 +6,6 @@
* Processor functions for the aggregator module.
*/
/**
* Denotes that a feed's items should never expire.
*/
define('AGGREGATOR_CLEAR_NEVER', 0);
/**
* Implement hook_aggregator_process_info().
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment