Changeset 1636 for trunk/feed.php


Ignore:
Timestamp:
Dec 6, 2006, 2:07:03 AM (17 years ago)
Author:
rvelices
Message:

feature 583: notification infromation can be filtered by the requester
(optionnally no comments/new users...)
small lang correction in header.tpl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/feed.php

    r1604 r1636  
    145145// +-----------------------------------------------------------------------+
    146146
    147 $news = news($user['last_check'], $dbnow, true, true);
    148 
    149 if (count($news) > 0)
    150 {
    151   $item = new FeedItem();
    152   $item->title = sprintf(l10n('New on %s'), $dbnow);
    153   $item->link = $conf['gallery_url'];
    154 
    155   // content creation
    156   $item->description = '<ul>';
    157   foreach ($news as $line)
     147if ( !isset($_GET['image_only']) )
     148{
     149  $news = news($user['last_check'], $dbnow, true, true);
     150
     151  if (count($news) > 0)
    158152  {
    159     $item->description.= '<li>'.$line.'</li>';
    160   }
    161   $item->description.= '</ul>';
    162   $item->descriptionHtmlSyndicated = true;
    163 
    164   $item->date = ts_to_iso8601(mysqldt_to_ts($dbnow));
    165   $item->author = 'PhpWebGallery notifier';
    166   $item->guid= sprintf('%s', $dbnow);;
    167 
    168   $rss->addItem($item);
    169 
    170   $query = '
     153    $item = new FeedItem();
     154    $item->title = sprintf(l10n('New on %s'),
     155        format_date($dbnow, 'mysql_datetime') );
     156    $item->link = $conf['gallery_url'];
     157
     158    // content creation
     159    $item->description = '<ul>';
     160    foreach ($news as $line)
     161    {
     162      $item->description.= '<li>'.$line.'</li>';
     163    }
     164    $item->description.= '</ul>';
     165    $item->descriptionHtmlSyndicated = true;
     166
     167    $item->date = ts_to_iso8601(mysqldt_to_ts($dbnow));
     168    $item->author = 'PhpWebGallery notifier';
     169    $item->guid= sprintf('%s', $dbnow);;
     170
     171    $rss->addItem($item);
     172
     173    $query = '
    171174UPDATE '.USER_FEED_TABLE.'
    172175  SET last_check = \''.$dbnow.'\'
    173176  WHERE id = \''.$_GET['feed'].'\'
    174177;';
     178    pwg_query($query);
     179  }
     180}
     181else
     182{ // update the last check to avoid deletion by maintenance task
     183  $query = '
     184UPDATE '.USER_FEED_TABLE.'
     185  SET last_check = \''.$dbnow.'\'
     186  WHERE id = \''.$_GET['feed'].'\'
     187;';
    175188  pwg_query($query);
    176189}
    177 
    178190
    179191// build items for new images/albums
Note: See TracChangeset for help on using the changeset viewer.