aboutsummaryrefslogtreecommitdiffstats
path: root/feed.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-10-23 00:08:48 +0000
committerrvelices <rv-github@modusoptimus.com>2007-10-23 00:08:48 +0000
commiteab34bed9c919e1d57736705d2e9a037b41a4a55 (patch)
treea5cefa9caebd6c0133c9237e06252c4d09419147 /feed.php
parent034e914870716f27a150884f8583a98468d890f6 (diff)
- update last_check from time to time even if no news, so that we don't delete used feeds
git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2151 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'feed.php')
-rw-r--r--feed.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/feed.php b/feed.php
index 1c215592a..58b5f5fdb 100644
--- a/feed.php
+++ b/feed.php
@@ -117,6 +117,7 @@ $rss->link = $conf['gallery_url'];
// | Feed creation |
// +-----------------------------------------------------------------------+
+$news = array();
if (!$image_only)
{
$news = news($feed_row['last_check'], $dbnow, true, true);
@@ -151,15 +152,17 @@ UPDATE '.USER_FEED_TABLE.'
pwg_query($query);
}
}
-else
-{
- if ( !empty($feed_id) )
- {// update the last check to avoid deletion by maintenance task
+
+if ( !empty($feed_id) and empty($news) )
+{// update the last check from time to time to avoid deletion by maintenance tasks
+ if ( !isset($feed_row['last_check'])
+ or time()-mysqldt_to_ts($feed_row['last_check']) > 30*24*3600 )
+ {
$query = '
- UPDATE '.USER_FEED_TABLE.'
- SET last_check = \''.$dbnow.'\'
- WHERE id = \''.$feed_id.'\'
- ;';
+UPDATE '.USER_FEED_TABLE.'
+ SET last_check = DATE_ADD(\''.$dbnow.'\', INTERVAL -15 DAY )
+ WHERE id = \''.$feed_id.'\'
+;';
pwg_query($query);
}
}