mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 19:59:56 +03:00
merge r 2151 from branch-1_7 to trunk
- 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/trunk@2152 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
6a88ab4960
commit
6477e12654
1 changed files with 11 additions and 8 deletions
11
feed.php
11
feed.php
|
@ -117,6 +117,7 @@ $rss->link = $conf['gallery_url'];
|
||||||
// | Feed creation |
|
// | Feed creation |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
$news = array();
|
||||||
if (!$image_only)
|
if (!$image_only)
|
||||||
{
|
{
|
||||||
$news = news($feed_row['last_check'], $dbnow, true, true);
|
$news = news($feed_row['last_check'], $dbnow, true, true);
|
||||||
|
@ -151,13 +152,15 @@ UPDATE '.USER_FEED_TABLE.'
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
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 )
|
||||||
{
|
{
|
||||||
if ( !empty($feed_id) )
|
|
||||||
{// update the last check to avoid deletion by maintenance task
|
|
||||||
$query = '
|
$query = '
|
||||||
UPDATE '.USER_FEED_TABLE.'
|
UPDATE '.USER_FEED_TABLE.'
|
||||||
SET last_check = \''.$dbnow.'\'
|
SET last_check = DATE_ADD(\''.$dbnow.'\', INTERVAL -15 DAY )
|
||||||
WHERE id = \''.$feed_id.'\'
|
WHERE id = \''.$feed_id.'\'
|
||||||
;';
|
;';
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue