aboutsummaryrefslogtreecommitdiffstats
path: root/feed.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-12-06 01:07:03 +0000
committerrvelices <rv-github@modusoptimus.com>2006-12-06 01:07:03 +0000
commitf880be0609a63046c2f8fe961467f97a8a943f10 (patch)
tree55f8c759e903e37d37bd9bacf69f9c1e9002cdf4 /feed.php
parentaf138fa6311ac686ec7f256788eb2a07784ac215 (diff)
feature 583: notification infromation can be filtered by the requester
(optionnally no comments/new users...) small lang correction in header.tpl git-svn-id: http://piwigo.org/svn/trunk@1636 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'feed.php')
-rw-r--r--feed.php52
1 files changed, 32 insertions, 20 deletions
diff --git a/feed.php b/feed.php
index 8026b4def..64dc12aae 100644
--- a/feed.php
+++ b/feed.php
@@ -144,29 +144,42 @@ $rss->link = $conf['gallery_url'];
// | Feed creation |
// +-----------------------------------------------------------------------+
-$news = news($user['last_check'], $dbnow, true, true);
-
-if (count($news) > 0)
+if ( !isset($_GET['image_only']) )
{
- $item = new FeedItem();
- $item->title = sprintf(l10n('New on %s'), $dbnow);
- $item->link = $conf['gallery_url'];
+ $news = news($user['last_check'], $dbnow, true, true);
- // content creation
- $item->description = '<ul>';
- foreach ($news as $line)
+ if (count($news) > 0)
{
- $item->description.= '<li>'.$line.'</li>';
+ $item = new FeedItem();
+ $item->title = sprintf(l10n('New on %s'),
+ format_date($dbnow, 'mysql_datetime') );
+ $item->link = $conf['gallery_url'];
+
+ // content creation
+ $item->description = '<ul>';
+ foreach ($news as $line)
+ {
+ $item->description.= '<li>'.$line.'</li>';
+ }
+ $item->description.= '</ul>';
+ $item->descriptionHtmlSyndicated = true;
+
+ $item->date = ts_to_iso8601(mysqldt_to_ts($dbnow));
+ $item->author = 'PhpWebGallery notifier';
+ $item->guid= sprintf('%s', $dbnow);;
+
+ $rss->addItem($item);
+
+ $query = '
+UPDATE '.USER_FEED_TABLE.'
+ SET last_check = \''.$dbnow.'\'
+ WHERE id = \''.$_GET['feed'].'\'
+;';
+ pwg_query($query);
}
- $item->description.= '</ul>';
- $item->descriptionHtmlSyndicated = true;
-
- $item->date = ts_to_iso8601(mysqldt_to_ts($dbnow));
- $item->author = 'PhpWebGallery notifier';
- $item->guid= sprintf('%s', $dbnow);;
-
- $rss->addItem($item);
-
+}
+else
+{ // update the last check to avoid deletion by maintenance task
$query = '
UPDATE '.USER_FEED_TABLE.'
SET last_check = \''.$dbnow.'\'
@@ -175,7 +188,6 @@ UPDATE '.USER_FEED_TABLE.'
pwg_query($query);
}
-
// build items for new images/albums
$query = '
SELECT date_available,