From f880be0609a63046c2f8fe961467f97a8a943f10 Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 6 Dec 2006 01:07:03 +0000 Subject: 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 --- feed.php | 52 +++++++++++++++++++------------ include/menubar.inc.php | 2 +- language/en_UK.iso-8859-1/common.lang.php | 3 +- language/fr_FR.iso-8859-1/common.lang.php | 3 +- notification.php | 5 ++- template/yoga/header.tpl | 4 +-- template/yoga/notification.tpl | 3 +- 7 files changed, 45 insertions(+), 27 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 = ''; - $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, diff --git a/include/menubar.inc.php b/include/menubar.inc.php index 8b7c816c3..b84d9f09e 100755 --- a/include/menubar.inc.php +++ b/include/menubar.inc.php @@ -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"' diff --git a/language/en_UK.iso-8859-1/common.lang.php b/language/en_UK.iso-8859-1/common.lang.php index 94d352b01..e23cdac02 100644 --- a/language/en_UK.iso-8859-1/common.lang.php +++ b/language/en_UK.iso-8859-1/common.lang.php @@ -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'; diff --git a/language/fr_FR.iso-8859-1/common.lang.php b/language/fr_FR.iso-8859-1/common.lang.php index b6e4af2ff..1652a0524 100644 --- a/language/fr_FR.iso-8859-1/common.lang.php +++ b/language/fr_FR.iso-8859-1/common.lang.php @@ -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'; diff --git a/notification.php b/notification.php index ea6381ebf..177ddb654 100644 --- a/notification.php +++ b/notification.php @@ -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(), ) ); diff --git a/template/yoga/header.tpl b/template/yoga/header.tpl index fe3e1da02..3e2b43634 100644 --- a/template/yoga/header.tpl +++ b/template/yoga/header.tpl @@ -16,7 +16,7 @@ - + @@ -26,7 +26,7 @@ - +