mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 19:29:58 +03:00
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
This commit is contained in:
parent
af138fa631
commit
f880be0609
7 changed files with 45 additions and 27 deletions
52
feed.php
52
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,
|
||||
|
|
|
@ -282,7 +282,7 @@ $template->assign_block_vars(
|
|||
$template->assign_block_vars(
|
||||
'summary',
|
||||
array(
|
||||
'TITLE'=>l10n('notification'),
|
||||
'TITLE'=>l10n('RSS feed'),
|
||||
'NAME'=>l10n('Notification'),
|
||||
'U_SUMMARY'=> get_root_url().'notification.php',
|
||||
'REL'=> 'rel="nofollow"'
|
||||
|
|
|
@ -312,6 +312,7 @@ $lang['Average rate'] = 'Average rate';
|
|||
$lang['Categories'] = 'Categories';
|
||||
$lang['Category'] = 'Category';
|
||||
$lang['Close this window'] = 'Close this window';
|
||||
$lang['Complete RSS feed'] = 'Complete RSS feed (images, comments)';
|
||||
$lang['Confirm Password'] = 'Confirm Password';
|
||||
$lang['Connection settings'] = 'Connection settings';
|
||||
$lang['Connection'] = 'Connection';
|
||||
|
@ -336,6 +337,7 @@ $lang['Forgot your password?'] = 'Forgot your password?';
|
|||
$lang['Go through the gallery as a visitor'] = 'Go through the gallery as a visitor';
|
||||
$lang['Help'] = 'Help';
|
||||
$lang['Identification'] = 'Identification';
|
||||
$lang['Image only RSS feed'] = 'Image only RSS feed';
|
||||
$lang['Keyword'] = 'Keyword';
|
||||
$lang['Keywords'] = 'Keywords';
|
||||
$lang['Links'] = 'Links';
|
||||
|
@ -508,7 +510,6 @@ $lang['next_page'] = 'Next';
|
|||
$lang['no'] = 'No';
|
||||
$lang['no_category'] = 'Home';
|
||||
$lang['no_rate'] = 'no rate';
|
||||
$lang['notification'] = 'notification';
|
||||
$lang['only_members'] = 'Only members can access this page';
|
||||
$lang['password updated'] = 'password updated';
|
||||
$lang['periods_error'] = 'Recent period must be a positive integer value';
|
||||
|
|
|
@ -311,6 +311,7 @@ $lang['Average rate'] = 'Note moyenne';
|
|||
$lang['Categories'] = 'Catégories';
|
||||
$lang['Category'] = 'Catégorie';
|
||||
$lang['Close this window'] = 'Fermer cette fenêtre';
|
||||
$lang['Complete RSS feed'] = 'Flux RSS complet (images, commentaires)';
|
||||
$lang['Confirm Password'] = 'Confirmer le mot de passe';
|
||||
$lang['Connection settings'] = 'Paramètres de connexion';
|
||||
$lang['Connection'] = 'Connexion';
|
||||
|
@ -335,6 +336,7 @@ $lang['Forgot your password?'] = 'Mot de passe oubli
|
|||
$lang['Go through the gallery as a visitor'] = 'Parcourir la galerie en tant que visiteur';
|
||||
$lang['Help'] = 'Aide';
|
||||
$lang['Identification'] = 'Identification';
|
||||
$lang['Image only RSS feed'] = 'Flux RSS des images';
|
||||
$lang['Keyword'] = 'Mot-clef';
|
||||
$lang['Keywords'] = 'Mots-clef';
|
||||
$lang['Links'] = 'Liens';
|
||||
|
@ -507,7 +509,6 @@ $lang['next_page'] = 'Suivant';
|
|||
$lang['no'] = 'Non';
|
||||
$lang['no_category'] = 'Accueil';
|
||||
$lang['no_rate'] = 'pas de note';
|
||||
$lang['notification'] = 'notification';
|
||||
$lang['only_members'] = 'Seuls les membres enregistrés peuvent accéder à cette page';
|
||||
$lang['password updated'] = 'mot de passe mis à jour';
|
||||
$lang['periods_error'] = 'La période de nouveauté doit être un entier positif';
|
||||
|
|
|
@ -52,6 +52,8 @@ INSERT INTO '.USER_FEED_TABLE.'
|
|||
pwg_query($query);
|
||||
|
||||
$feed_url=PHPWG_ROOT_PATH.'feed.php?feed='.$page['feed'];
|
||||
$feed_image_only_url=$feed_url.'&image_only';
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | template initialization |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
@ -74,7 +76,8 @@ $template->set_filenames(array('notification'=>'notification.tpl'));
|
|||
|
||||
$template->assign_vars(
|
||||
array(
|
||||
'FEED_URL' => $feed_url,
|
||||
'U_FEED' => $feed_url,
|
||||
'U_FEED_IMAGE_ONLY' => $feed_image_only_url,
|
||||
'U_HOME' => make_index_url(),
|
||||
)
|
||||
);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<link rel="search" title="{lang:search}" href="{pwg_root}search.php" >
|
||||
<!-- BEGIN first -->
|
||||
<link rel="first" title="{lang:first_page}" href="{first.U_IMG}" >
|
||||
<link rel="up" title="{lang:thumbails}" href="{U_UP}" >
|
||||
<link rel="up" title="{lang:thumbnails}" href="{U_UP}" >
|
||||
<!-- END first -->
|
||||
<!-- BEGIN previous -->
|
||||
<link rel="prev" title="{lang:previous_page}" href="{previous.U_IMG}" >
|
||||
|
@ -26,7 +26,7 @@
|
|||
<!-- END next -->
|
||||
<!-- BEGIN last -->
|
||||
<link rel="last" title="{lang:last_page}" href="{last.U_IMG}" >
|
||||
<link rel="up" title="{lang:thumbails}" href="{U_UP}" >
|
||||
<link rel="up" title="{lang:thumbnails}" href="{U_UP}" >
|
||||
<!-- END last -->
|
||||
<link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/layout.css">
|
||||
<!-- the next css is used to fix khtml (Konqueror/Safari) issue
|
||||
|
|
|
@ -9,5 +9,6 @@
|
|||
|
||||
<p>{lang:The RSS notification feed provides notification on news from this website : new pictures, updated categories, new comments. Use a RSS feed reader.}</p>
|
||||
|
||||
<p><a href="{FEED_URL}">{lang:RSS feed}</a></p>
|
||||
<p><a href="{U_FEED_IMAGE_ONLY}">{lang:Image only RSS feed}</a></p>
|
||||
<p><a href="{U_FEED}">{lang:Complete RSS feed}</a></p>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue