diff options
author | rub <rub@piwigo.org> | 2007-02-06 22:55:12 +0000 |
---|---|---|
committer | rub <rub@piwigo.org> | 2007-02-06 22:55:12 +0000 |
commit | e517cfad640d7697eb021cb698e5958f154f908b (patch) | |
tree | 8b386ddbcb42a7d09a7f2e6eafe64f1524075c22 | |
parent | 5f94909b4236730057499fd876ae96f88fcc95ff (diff) |
Issue 0000598: NBM: Add new informations
Notification by mail:
Add new informations about last categories and last images like new feature of RSS notification.
2 parts:
- Possibility to send HTML mail
- Include last categories and last images on HTML format into notification mail
ccs & HTML experts! Please! Check, fix, improve and enhance HTML mail content!
git-svn-id: http://piwigo.org/svn/trunk@1784 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/include/functions_notification_by_mail.inc.php | 125 | ||||
-rw-r--r-- | admin/notification_by_mail.php | 119 | ||||
-rw-r--r-- | feed.php | 66 | ||||
-rw-r--r-- | include/functions_mail.inc.php | 127 | ||||
-rw-r--r-- | include/functions_notification.inc.php | 95 | ||||
-rw-r--r-- | install/config.sql | 3 | ||||
-rw-r--r-- | install/db/49-database.php | 58 | ||||
-rw-r--r-- | language/en_UK.iso-8859-1/admin.lang.php | 51 | ||||
-rw-r--r-- | language/fr_FR.iso-8859-1/admin.lang.php | 59 | ||||
-rw-r--r-- | template/yoga/admin/notification_by_mail.tpl | 25 | ||||
-rw-r--r-- | template/yoga/mail/index.php | 2 | ||||
-rw-r--r-- | template/yoga/mail/text/html/footer.tpl (renamed from template/yoga/mail/footer.tpl) | 2 | ||||
-rw-r--r-- | template/yoga/mail/text/html/header.tpl (renamed from template/yoga/mail/header.tpl) | 0 | ||||
-rw-r--r-- | template/yoga/mail/text/html/index.php (renamed from template/yoga/mail/admin/index.php) | 2 | ||||
-rw-r--r-- | template/yoga/mail/text/index.php | 35 | ||||
-rw-r--r-- | template/yoga/mail/text/plain/footer.tpl | 3 | ||||
-rw-r--r-- | template/yoga/mail/text/plain/header.tpl | 1 | ||||
-rw-r--r-- | template/yoga/mail/text/plain/index.php | 35 |
18 files changed, 579 insertions, 229 deletions
diff --git a/admin/include/functions_notification_by_mail.inc.php b/admin/include/functions_notification_by_mail.inc.php index 29ec90372..89a69206c 100644 --- a/admin/include/functions_notification_by_mail.inc.php +++ b/admin/include/functions_notification_by_mail.inc.php @@ -2,8 +2,8 @@ // +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
-// | Copyright (C) 2006 Ruben ARNAUD - team@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | branch : BSF (Best So Far)
// | file : $RCSfile$
@@ -203,6 +203,7 @@ function begin_users_env_nbm($is_to_send_mail = false) if ($is_to_send_mail)
{
// Init mail configuration
+ $env_nbm['email_format'] = get_str_email_format($conf['nbm_send_html_mail']);
$env_nbm['send_as_name'] = ((isset($conf['nbm_send_mail_as']) and !empty($conf['nbm_send_mail_as'])) ? $conf['nbm_send_mail_as'] : $conf['gallery_title']);
$env_nbm['send_as_mail_address'] = get_webmaster_mail_address();
$env_nbm['send_as_mail_formated'] = format_email($env_nbm['send_as_name'], $env_nbm['send_as_mail_address']);
@@ -229,14 +230,34 @@ function end_users_env_nbm() $user = $env_nbm['save_user'];
$lang_info = $env_nbm['save_lang_info'];
$lang = $env_nbm['save_lang'];
+
+ if ($env_nbm['is_to_send_mail'])
+ {
+ unset($env_nbm['email_format']);
+ unset($env_nbm['send_as_name']);
+ unset($env_nbm['send_as_mail_address']);
+ unset($env_nbm['send_as_mail_formated']);
+ // Don t unset counter
+ //unset($env_nbm['error_on_mail_count']);
+ //unset($env_nbm['sent_mail_count']);
+ unset($env_nbm['msg_info']);
+ unset($env_nbm['msg_error']);
+ }
+
+ unset($env_nbm['save_user']);
+ unset($env_nbm['save_lang_info']);
+ unset($env_nbm['save_lang']);
+ unset($env_nbm['last_language']);
+ unset($env_nbm['is_to_send_mail']);
+
}
/*
- * Set user_id on nbm enviromnent
+ * Set user on nbm enviromnent
*
* Return none
*/
-function set_user_id_on_env_nbm($user_id)
+function set_user_on_env_nbm($user_id, $is_action_send)
{
global $user, $lang, $lang_info, $env_nbm;
@@ -260,6 +281,24 @@ function set_user_id_on_env_nbm($user_id) trigger_action('loading_lang');
@include(get_language_filepath('local.lang.php'));
}
+
+ if ($is_action_send)
+ {
+ $env_nbm['mail_template'] = get_mail_template($env_nbm['email_format']);
+ $env_nbm['mail_template']->set_filename('notification_by_mail', 'admin/notification_by_mail.tpl');
+ }
+}
+
+/*
+ * Unset user on nbm enviromnent
+ *
+ * Return none
+ */
+function unset_user_on_env_nbm()
+{
+ global $env_nbm;
+
+ unset($env_nbm['mail_template']);
}
/*
@@ -299,36 +338,40 @@ function display_counter_info() if ($env_nbm['error_on_mail_count'] != 0)
{
- array_push($page['errors'], sprintf(l10n('nbm_msg_no_mail_to_send'), $env_nbm['error_on_mail_count']));
+ array_push($page['errors'], l10n_dec('nbm_msg_n_mail_not_send', 'nbm_msg_n_mails_not_send', $env_nbm['error_on_mail_count']));
if ($env_nbm['sent_mail_count'] != 0)
- array_push($page['infos'], sprintf(l10n('nbm_msg_n_mails_sent'), $env_nbm['sent_mail_count']));
+ array_push($page['infos'], l10n_dec('nbm_msg_n_mail_sent', 'nbm_msg_n_mails_sent', $env_nbm['sent_mail_count']));
}
else
{
if ($env_nbm['sent_mail_count'] == 0)
array_push($page['infos'], l10n('nbm_no_mail_to_send'));
else
- array_push($page['infos'], sprintf(l10n('nbm_msg_n_mails_sent'), $env_nbm['sent_mail_count']));
+ array_push($page['infos'], l10n_dec('nbm_msg_n_mail_sent', 'nbm_msg_n_mails_sent', $env_nbm['sent_mail_count']));
}
}
-function get_mail_content_subscribe_unsubcribe($nbm_user)
+function assign_vars_nbm_mail_content($nbm_user)
{
global $env_nbm;
-
- $content = "\n\n\n";
-
+
set_make_full_url();
-
- $content .= "___________________________________________________\n\n";
- $content .= sprintf(l10n('nbm_content_unsubscribe_link'), add_url_params(get_root_url().'nbm.php', array('unsubscribe' => $nbm_user['check_key'])))."\n";
- $content .= sprintf(l10n('nbm_content_subscribe_link'), add_url_params(get_root_url().'nbm.php', array('subscribe' => $nbm_user['check_key'])))."\n";
- $content .= sprintf(l10n('nbm_content_subscribe_unsubscribe_contact'), $env_nbm['send_as_mail_address'])."\n";
- $content .= "___________________________________________________\n\n\n\n";
- unset_make_full_url();
+ $env_nbm['mail_template']->assign_vars
+ (
+ array
+ (
+ 'USERNAME' => $nbm_user['username'],
+
+ 'SEND_AS_NAME' => $env_nbm['send_as_name'],
- return $content;
+ 'UNSUBSCRIBE_LINK' => add_url_params(get_root_url().'nbm.php', array('unsubscribe' => $nbm_user['check_key'])),
+ 'SUBSCRIBE_LINK' => add_url_params(get_root_url().'nbm.php', array('subscribe' => $nbm_user['check_key'])),
+ 'CONTACT_EMAIL' => $env_nbm['send_as_mail_address']
+ )
+ );
+
+ unset_make_full_url();
}
/*
@@ -386,28 +429,27 @@ function do_subscribe_unsubcribe_notification_by_mail($is_admin_request, $is_sub if ($nbm_user['mail_address'] != '')
{
// set env nbm user
- set_user_id_on_env_nbm($nbm_user['user_id']);
-
- $message = '';
+ set_user_on_env_nbm($nbm_user['user_id'], true);
$subject = '['.$conf['gallery_title'].']: '.($is_subscribe ? l10n('nbm_object_subcribe'): l10n('nbm_object_unsubcribe'));
- $message .= sprintf(l10n('nbm_content_hello'), $nbm_user['username']).",\n\n";
-
- if ($is_subscribe)
- {
- $message .= l10n($is_admin_request ? 'nbm_content_subscribe_by_admin' : 'nbm_content_subscribe_by_himself');
- }
- else
- {
- $message .= l10n($is_admin_request ? 'nbm_content_unsubscribe_by_admin' : 'nbm_content_unsubscribe_by_himself');
- }
- $message .= "\n\n";
- $message .= l10n('nbm_content_byebye')."\n ".$env_nbm['send_as_name']."\n\n";
+ // Assign current var for nbm mail
+ assign_vars_nbm_mail_content($nbm_user);
- $message .= get_mail_content_subscribe_unsubcribe($nbm_user);
+ $section_action_by = ($is_subscribe ? 'subscribe_by_' : 'unsubscribe_by_');
+ $section_action_by .= ($is_admin_request ? 'admin' : 'himself');
+ $env_nbm['mail_template']->assign_block_vars
+ (
+ $section_action_by, array('DUMMY' => 'dummy')
+ );
- if (pwg_mail(format_email($nbm_user['username'], $nbm_user['mail_address']), $env_nbm['send_as_mail_formated'], $subject, $message))
+ if (pwg_mail(
+ format_email($nbm_user['username'], $nbm_user['mail_address']),
+ $env_nbm['send_as_mail_formated'],
+ $subject,
+ $env_nbm['mail_template']->parse('notification_by_mail', true),
+ $env_nbm['email_format'], $env_nbm['email_format']
+ ))
{
inc_mail_sent_success($nbm_user);
}
@@ -416,6 +458,10 @@ function do_subscribe_unsubcribe_notification_by_mail($is_admin_request, $is_sub inc_mail_sent_failed($nbm_user);
$do_update = false;
}
+
+ // unset env nbm user
+ unset_user_on_env_nbm();
+
}
if ($do_update)
@@ -456,10 +502,13 @@ function do_subscribe_unsubcribe_notification_by_mail($is_admin_request, $is_sub }
- array_push($page['infos'], sprintf(l10n('nbm_user_change_enabled_updated_data_count'), $updated_data_count));
+ array_push($page['infos'], l10n_dec('nbm_user_change_enabled_updated_data_count', 'nbm_users_change_enabled_updated_data_count', $updated_data_count));
if ($error_on_updated_data_count != 0)
{
- array_push($page['errors'], sprintf(l10n('nbm_user_change_enabled_error_on_updated_data_count'), $error_on_updated_data_count));
+ array_push($page['errors'],
+ l10n_dec('nbm_user_change_enabled_error_on_updated_data_count',
+ 'nbm_users_change_enabled_error_on_updated_data_count',
+ $error_on_updated_data_count));
}
return $check_key_treated;
diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php index 58badbe05..d2c6f76f4 100644 --- a/admin/notification_by_mail.php +++ b/admin/notification_by_mail.php @@ -84,7 +84,10 @@ function do_timeout_treatment($post_keyname, $check_key_treated = array()) $_POST[$post_keyname] = array_diff($_POST[$post_keyname], $check_key_treated); $must_repost = true; - array_push($page['errors'], sprintf(l10n('nbm_background_treatment_redirect'), $time_refresh)); + array_push($page['errors'], + l10n_dec('nbm_background_treatment_redirect_second', + 'nbm_background_treatment_redirect_seconds', + $time_refresh)); } } @@ -270,17 +273,17 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l } // set env nbm user - set_user_id_on_env_nbm($nbm_user['user_id']); + set_user_on_env_nbm($nbm_user['user_id'], $is_action_send); if ($is_action_send) { + set_make_full_url(); // Fill return list of "treated" check_key for 'send' array_push($return_list, $nbm_user['check_key']); - $message = ''; if ($conf['nbm_send_detailed_content']) { - $news = news($nbm_user['last_send'], $dbnow); + $news = news($nbm_user['last_send'], $dbnow, false, $conf['nbm_send_html_mail']); $exist_data = count($news) > 0; } else @@ -291,35 +294,96 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l if ($exist_data) { $subject = '['.$conf['gallery_title'].']: '.l10n('nbm_object_news'); - $message .= sprintf(l10n('nbm_content_hello'), $nbm_user['username']).",\n\n"; + + // Assign current var for nbm mail + assign_vars_nbm_mail_content($nbm_user); + + $end_punct = ($conf['nbm_send_detailed_content'] ? ':' : '.'); if (!is_null($nbm_user['last_send'])) - $message .= sprintf(l10n('nbm_content_new_elements_between'), $nbm_user['last_send'], $dbnow); + { + $env_nbm['mail_template']->assign_block_vars + ( + 'content_new_elements_between', + array + ( + 'DATE_BETWEEN_1' => $nbm_user['last_send'], + 'DATE_BETWEEN_2' => $dbnow, + 'END_PUNCT' => $end_punct + ) + ); + } else - $message .= sprintf(l10n('nbm_content_new_elements'), $dbnow); + { + $env_nbm['mail_template']->assign_block_vars + ( + 'content_new_elements_single', + array + ( + 'DATE_SINGLE' => $dbnow, + 'END_PUNCT' => $end_punct + ) + ); + } if ($conf['nbm_send_detailed_content']) { - $message .= ":\n"; - - foreach ($news as $line) + foreach ($news as $data) { - $message .= ' o '.$line."\n"; + $env_nbm['mail_template']->assign_block_vars + ( + 'global_new_line.new_line', array('DATA' => $data) + ); } - $message .= "\n"; } - else + + if (!empty($customize_mail_content)) { - $message .= ".\n"; + $env_nbm['mail_template']->assign_block_vars + ( + 'custom', array('CUSTOMIZE_MAIL_CONTENT' => $customize_mail_content) + ); } - $message .= sprintf(l10n('nbm_content_goto'), $conf['gallery_title'], $conf['gallery_url'])."\n\n"; - $message .= $customize_mail_content."\n\n"; - $message .= l10n('nbm_content_byebye')."\n ".$env_nbm['send_as_name']."\n\n"; - - $message .= get_mail_content_subscribe_unsubcribe($nbm_user); + if ($conf['nbm_send_html_mail'] and $conf['nbm_send_recent_post_dates']) + { + $recent_post_dates = get_recent_post_dates(7, 5, 9); + foreach ($recent_post_dates as $date_detail) + { + $env_nbm['mail_template']->assign_block_vars + ( + 'recent_post.recent_post_block', + array + ( + 'TITLE' => get_title_recent_post_date($date_detail), + 'HTML_DATA' => get_html_description_recent_post_date($date_detail) + ) + ); + } + } - if (pwg_mail(format_email($nbm_user['username'], $nbm_user['mail_address']), $env_nbm['send_as_mail_formated'], $subject, $message)) + $env_nbm['mail_template']->assign_block_vars + ( + 'goto', + array + ( + 'GALLERY_TITLE' => $conf['gallery_title'], + 'GALLERY_URL' => $conf['gallery_url'] + ) + ); + + $env_nbm['mail_template']->assign_block_vars + ( + 'byebye', array('SEND_AS_NAME' => $env_nbm['send_as_name']) + ); + + if (pwg_mail( + format_email($nbm_user['username'], $nbm_user['mail_address']), + $env_nbm['send_as_mail_formated'], + $subject, + $env_nbm['mail_template']->parse('notification_by_mail', true), + $env_nbm['email_format'], $env_nbm['email_format'] + )) { inc_mail_sent_success($nbm_user); @@ -331,6 +395,8 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l { inc_mail_sent_failed($nbm_user); } + + unset_make_full_url(); } } else @@ -341,6 +407,9 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l array_push($return_list, $nbm_user); } } + + // unset env nbm user + unset_user_on_env_nbm(); } // Restore nbm environment @@ -437,7 +506,9 @@ where } } - array_push($page['infos'], sprintf(l10n('nbm_updated_param_count'), $updated_param_count)); + array_push($page['infos'], + l10n_dec('nbm_updated_param_count', 'nbm_updated_params_count', + $updated_param_count)); // Reload conf with new values load_conf_from_db('param like \'nbm\\_%\''); @@ -542,10 +613,14 @@ switch ($page['mode']) $template->assign_block_vars( $page['mode'], array( + 'SEND_HTML_MAIL_YES' => ($conf['nbm_send_html_mail'] ? 'checked="checked"' : ''), + 'SEND_HTML_MAIL_NO' => (!$conf['nbm_send_html_mail'] ? 'checked="checked"' : ''), 'SEND_MAIL_AS' => $conf['nbm_send_mail_as'], 'SEND_DETAILED_CONTENT_YES' => ($conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''), 'SEND_DETAILED_CONTENT_NO' => (!$conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''), - 'COMPLEMENTARY_MAIL_CONTENT' => $conf['nbm_complementary_mail_content'] + 'COMPLEMENTARY_MAIL_CONTENT' => $conf['nbm_complementary_mail_content'], + 'SEND_RECENT_POST_DATES_YES' => ($conf['nbm_send_recent_post_dates'] ? 'checked="checked"' : ''), + 'SEND_RECENT_POST_DATES_NO' => (!$conf['nbm_send_recent_post_dates'] ? 'checked="checked"' : '') )); break; } @@ -34,27 +34,6 @@ include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php'); // +-----------------------------------------------------------------------+ /** - * explodes a MySQL datetime format (2005-07-14 23:01:37) in fields "year", - * "month", "day", "hour", "minute", "second". - * - * @param string mysql datetime format - * @return array - */ -function explode_mysqldt($mysqldt) -{ - $date = array(); - list($date['year'], - $date['month'], - $date['day'], - $date['hour'], - $date['minute'], - $date['second']) - = preg_split('/[-: ]/', $mysqldt); - - return $date; -} - -/** * creates a Unix timestamp (number of seconds since 1970-01-01 00:00:00 * GMT) from a MySQL datetime format (2005-07-14 23:01:37) * @@ -185,15 +164,13 @@ else } } -$dates = get_recent_post_dates( 5, 6, 6); +$dates = get_recent_post_dates(5, 6, 6); -foreach($dates as $date_detail) +foreach($dates as $date_detail) { // for each recent post date we create a feed item - $date = $date_detail['date_available']; - $exploded_date = explode_mysqldt($date); $item = new FeedItem(); - $item->title = l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements']); - $item->title .= ' ('.$lang['month'][(int)$exploded_date['month']].' '.$exploded_date['day'].')'; + $date = $date_detail['date_available']; + $item->title = get_title_recent_post_date($date_detail); $item->link = make_index_url( array( 'chronology_field' => 'posted', @@ -206,40 +183,7 @@ foreach($dates as $date_detail) $item->description .= '<a href="'.make_index_url().'">'.$conf['gallery_title'].'</a><br/> '; - $item->description .= - '<li>' - .l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements']) - .' (' - .'<a href="'.make_index_url(array('section'=>'recent_pics')).'">' - .l10n('recent_pics_cat').'</a>' - .')' - .'</li>'; - - foreach( $date_detail['elements'] as $element ) - { - $tn_src = get_thumbnail_url($element); - $item->description .= '<img src="'.$tn_src.'"/>'; - } - $item->description .= '...<br/>'; - - $item->description .= - '<li>' - .l10n_dec('%d category updated', '%d categories updated', - $date_detail['nb_cats']) - .'</li>'; - - $item->description .= '<ul>'; - foreach( $date_detail['categories'] as $cat ) - { - $item->description .= - '<li>' - .get_cat_display_name_cache($cat['uppercats']) - .' ('. - l10n_dec('%d new element', - '%d new elements', $cat['img_count']).')' - .'</li>'; - } - $item->description .= '</ul>'; + $item->description .= get_html_description_recent_post_date($date_detail); $item->descriptionHtmlSyndicated = true; diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php index 523bbd6fd..07be28b50 100644 --- a/include/functions_mail.inc.php +++ b/include/functions_mail.inc.php @@ -64,10 +64,6 @@ function get_mail_configuration() $conf_mail['formated_email_webmaster'] = format_email($conf['gallery_title'], $conf_mail['email_webmaster']); - // what to display at the bottom of each mail ? - $conf_mail['text_footer'] = - "\n\n-- \nPhpWebGallery ".($conf['show_version'] ? PHPWG_VERSION : ''); - return $conf_mail; } @@ -105,23 +101,34 @@ function format_email($name, $email) *
* @param none
*/
-function get_mail_template()
+function get_mail_template($email_format)
{
global $conf;
// for mail, default template are used
list($tmpl, $thm) = explode('/', $conf['default_template']);
- $mail_template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm);
+ $mail_template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm); + $mail_template->set_rootdir(PHPWG_ROOT_PATH.'template/'.$tmpl.'/mail/'.$email_format);
return $mail_template;
}
+
+/**
+ * Return string email format (html or not)
+ *
+ * @param string format
+ */
+function get_str_email_format($is_html)
+{
+ return ($is_html ? 'text/html' : 'text/plain');
+}
/** * sends an email, using PhpWebGallery specific informations */
function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $format_infos = 'text/plain', $email_format = null) { - global $conf, $conf_mail, $lang_info, $user, $page; + global $conf, $conf_mail, $lang_info, $page; $cvt7b_subject = str_translate_to_ascii7bits($subject); @@ -170,32 +177,48 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for $content = '';
- if (!isset($conf_mail[$email_format][$lang_info['charset']]['header']))
+ if (!isset($conf_mail[$email_format][$lang_info['charset']]))
{
- if ($email_format == 'text/html')
+ if (!isset($mail_template))
{
- $mail_template = get_mail_template();
+ $mail_template = get_mail_template($email_format);
+ }
- $mail_template->set_filenames(array('mail_header'=>'mail/header.tpl'));
+ $mail_template->set_filename('mail_header', 'header.tpl');
+ $mail_template->set_filename('mail_footer', 'footer.tpl');
- $mail_template->assign_vars(
- array(
- 'BODY_ID' =>
- isset($page['body_id']) ?
- $page['body_id'] : '',
+ $mail_template->assign_vars(
+ array(
+ //Header
+ 'BODY_ID' =>
+ isset($page['body_id']) ?
+ $page['body_id'] : '',
- 'CONTENT_ENCODING' => $lang_info['charset'],
- 'LANG' => $lang_info['code'],
- 'DIR' => $lang_info['direction']
- ));
+ 'CONTENT_ENCODING' => $lang_info['charset'],
+ 'LANG' => $lang_info['code'],
+ 'DIR' => $lang_info['direction'],
+
+ // Footer
+ 'GALLERY_URL' =>
+ isset($page['gallery_url']) ?
+ $page['gallery_url'] : $conf['gallery_url'],
+ 'GALLERY_TITLE' =>
+ isset($page['gallery_title']) ?
+ $page['gallery_title'] : $conf['gallery_title'],
+ 'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '',
+ 'PHPWG_URL' => PHPWG_URL,
- $conf_mail[$email_format][$lang_info['charset']]['header'] =
- $mail_template->parse('mail_header', true);
- }
- else
- {
- $conf_mail[$email_format][$lang_info['charset']]['header'] = '';
- }
+ 'TITLE_MAIL' => urlencode(l10n('title_send_mail')),
+ 'MAIL' => get_webmaster_mail_address()
+ ));
+
+ // what are displayed on the header of each mail ?
+ $conf_mail[$email_format][$lang_info['charset']]['header'] =
+ $mail_template->parse('mail_header', true); + + // what are displayed on the footer of each mail ?
+ $conf_mail[$email_format][$lang_info['charset']]['footer'] = + $mail_template->parse('mail_footer', true); }
$content.= $conf_mail[$email_format][$lang_info['charset']]['header'];
@@ -209,36 +232,6 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for $content.= $infos;
}
- if (!isset($conf_mail[$email_format][$lang_info['charset']]['footer']))
- {
- if ($email_format == 'text/html')
- {
- $mail_template->set_filenames(array('mail_footer'=>'mail/footer.tpl'));
-
- $mail_template->assign_vars(
- array(
- 'GALLERY_URL' =>
- isset($page['gallery_url']) ?
- $page['gallery_url'] : $conf['gallery_url'],
- 'GALLERY_TITLE' =>
- isset($page['gallery_title']) ?
- $page['gallery_title'] : $conf['gallery_title'],
- 'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '',
- 'PHPWG_URL' => PHPWG_URL,
-
- 'TITLE_MAIL' => urlencode(l10n('title_send_mail')),
- 'MAIL' => get_webmaster_mail_address() - ));
-
- $conf_mail[$email_format][$lang_info['charset']]['footer'] =
- $mail_template->parse('mail_footer', true);
- }
- else
- {
- $conf_mail[$email_format][$lang_info['charset']]['footer'] = $conf_mail['text_footer'];
- }
- }
-
$content.= $conf_mail[$email_format][$lang_info['charset']]['footer']; // Undo Compute root_path in order have complete path @@ -247,6 +240,26 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for unset_make_full_url(); } + /*Testing block
+ { + global $user; + @mkdir(PHPWG_ROOT_PATH.'testmail'); + $filename = PHPWG_ROOT_PATH.'testmail/mail.'.$user['username']; + if ($format_infos == 'text/plain') + { + $filename .= '.txt'; + } + else + { + $filename .= '.html'; + } + $file = fopen($filename, 'w+'); + fwrite($file, $content); + fclose($file); + return true; + }
+ */ + if ($conf_mail['mail_options']) { $options = '-f '.$conf_mail['email_webmaster']; diff --git a/include/functions_notification.inc.php b/include/functions_notification.inc.php index 631922303..78c561475 100644 --- a/include/functions_notification.inc.php +++ b/include/functions_notification.inc.php @@ -407,13 +407,15 @@ function news($start, $end, $exclude_img_cats=false, $add_url=false) if (!$exclude_img_cats) { add_news_line( $news, - nb_new_elements($start, $end), '%d new element', '%d new elements'); + nb_new_elements($start, $end), '%d new element', '%d new elements',
+ get_root_url().'index.php?/recent_pics', $add_url ); } if (!$exclude_img_cats) { add_news_line( $news, - nb_updated_categories($start, $end), '%d category updated', '%d categories updated'); + nb_updated_categories($start, $end), '%d category updated', '%d categories updated',
+ get_root_url().'/index.php?/recent_cats', $add_url ); } add_news_line( $news, @@ -508,5 +510,92 @@ SELECT DISTINCT c.uppercats, COUNT(DISTINCT i.id) img_count } } return $dates; -} +}
+
+/**
+ * returns html description about recently published elements grouped by post date
+ * @param $date_detail: selected date computed by get_recent_post_dates function
+ */
+function get_html_description_recent_post_date($date_detail)
+{
+ global $conf;
+
+ $description = '';
+
+ $description .=
+ '<li>'
+ .l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements'])
+ .' ('
+ .'<a href="'.make_index_url(array('section'=>'recent_pics')).'">'
+ .l10n('recent_pics_cat').'</a>'
+ .')'
+ .'</li><br/>';
+
+ foreach($date_detail['elements'] as $element)
+ {
+ $tn_src = get_thumbnail_url($element);
+ $description .= '<img src="'.$tn_src.'"/>';
+ }
+ $description .= '...<br/>';
+
+ $description .=
+ '<li>'
+ .l10n_dec('%d category updated', '%d categories updated',
+ $date_detail['nb_cats'])
+ .'</li>';
+
+ $description .= '<ul>';
+ foreach($date_detail['categories'] as $cat)
+ {
+ $description .=
+ '<li>'
+ .get_cat_display_name_cache($cat['uppercats'])
+ .' ('.
+ l10n_dec('%d new element',
+ '%d new elements', $cat['img_count']).')'
+ .'</li>';
+ }
+ $description .= '</ul>';
+
+ return $description;
+}
+
+/**
+ * explodes a MySQL datetime format (2005-07-14 23:01:37) in fields "year",
+ * "month", "day", "hour", "minute", "second".
+ *
+ * @param string mysql datetime format
+ * @return array
+ */
+function explode_mysqldt($mysqldt)
+{
+ $date = array();
+ list($date['year'],
+ $date['month'],
+ $date['day'],
+ $date['hour'],
+ $date['minute'],
+ $date['second'])
+ = preg_split('/[-: ]/', $mysqldt);
+
+ return $date;
+}
+
+/**
+ * returns title about recently published elements grouped by post date
+ * @param $date_detail: selected date computed by get_recent_post_dates function
+ */
+function get_title_recent_post_date($date_detail)
+{
+ global $lang;
+
+ $date = $date_detail['date_available'];
+ $exploded_date = explode_mysqldt($date);
+
+ $title = l10n_dec('%d new element', '%d new elements', $date_detail['nb_elements']);
+ $title .= ' ('.$lang['month'][(int)$exploded_date['month']].' '.$exploded_date['day'].')';
+
+ return $title;
+}
+ ?>
\ No newline at end of file diff --git a/install/config.sql b/install/config.sql index d4e597758..eaae01cfe 100644 --- a/install/config.sql +++ b/install/config.sql @@ -24,10 +24,11 @@ INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('history_admin',' INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('history_guest','true','keep a history of guest visits on your website'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('allow_user_registration','true','allow visitors to register?'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('secret_key', MD5(RAND()), 'a secret key specific to the gallery for internal use'); --- Notification by mail +INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_html_mail','true','Send mail on HTML format for notification by mail'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_mail_as','','Send mail as param value for notification by mail'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_detailed_content','true','Send detailed content for notification by mail'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_complementary_mail_content','','Complementary mail content for notification by mail'); +INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_recent_post_dates','true','Send recent post by dates for notification by mail'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('email_admin_on_new_user','false','Send an email to the admin when a user registers'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('email_admin_on_comment','false','Send an email to the admin when a valid comment is entered'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('email_admin_on_comment_validation','false','Send an email to the admin when a comment requires validation'); diff --git a/install/db/49-database.php b/install/db/49-database.php new file mode 100644 index 000000000..76a0ca910 --- /dev/null +++ b/install/db/49-database.php @@ -0,0 +1,58 @@ +<?php +// +-----------------------------------------------------------------------+ +// | PhpWebGallery - a PHP based picture gallery | +// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | +// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | +// +-----------------------------------------------------------------------+ +// | branch : BSF (Best So Far) +// | file : $Id: 45-database.php 1741 2007-01-22 21:47:03Z vdigital $ +// | last update : $Date: 2007-01-22 22:47:03 +0100 (lun., 22 janv. 2007) $ +// | last modifier : $Author: vdigital $ +// | revision : $Revision: 1741 $ +// +-----------------------------------------------------------------------+ +// | This program is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU General Public License as published by | +// | the Free Software Foundation | +// | | +// | This program is distributed in the hope that it will be useful, but | +// | WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | +// | USA. | +// +-----------------------------------------------------------------------+ + +if (!defined('PHPWG_ROOT_PATH')) +{ + die('Hacking attempt!'); +} + +$upgrade_description = 'Add notification by mail params (HTML mail and new informartions)'; + +include_once(PHPWG_ROOT_PATH.'include/constants.php'); + +// +-----------------------------------------------------------------------+ +// | Upgrade content | +// +-----------------------------------------------------------------------+ + +echo "Add params on ".CONFIG_TABLE; +$query = " +INSERT INTO ".CONFIG_TABLE." (param,value,comment) VALUES ('nbm_send_html_mail','true','Send mail on HTML format for notification by mail'); +"; +pwg_query($query); + +$query = " +INSERT INTO ".CONFIG_TABLE." (param,value,comment) VALUES ('nbm_send_recent_post_dates','true','Send recent post by dates for notification by mail'); +"; +pwg_query($query); + +echo +"\n" +.'"'.$upgrade_description.'"'.' ended' +."\n" +; + +?> diff --git a/language/en_UK.iso-8859-1/admin.lang.php b/language/en_UK.iso-8859-1/admin.lang.php index 68f7124ed..06ae1dd6c 100644 --- a/language/en_UK.iso-8859-1/admin.lang.php +++ b/language/en_UK.iso-8859-1/admin.lang.php @@ -269,7 +269,8 @@ $lang['metadata_basic'] = 'basic'; $lang['metadata_exif'] = 'EXIF'; $lang['metadata_iptc'] = 'IPTC'; $lang['name'] = 'name'; -$lang['nbm_background_treatment_redirect'] = 'Execution time is out, treatment must be continue [Estmated time: %d secondes].'; +$lang['nbm_background_treatment_redirect_second'] = 'Execution time is out, treatment must be continue [Estmated time: %d second].'; +$lang['nbm_background_treatment_redirect_seconds'] = 'Execution time is out, treatment must be continue [Estmated time: %d seconds].'; $lang['nbm_break_timeout_list_user'] = 'Prepared time for list of users to send mail is limited. Others users are not listed.'; $lang['nbm_break_timeout_send_mail'] = 'Time to send mail is limited. Others mails are skipped.'; $lang['nbm_col_check_user_send_mail'] = 'To send ?'; @@ -277,24 +278,32 @@ $lang['nbm_col_last_send'] = 'Last send'; $lang['nbm_col_mail'] = 'email'; $lang['nbm_col_user'] = 'User'; $lang['nbm_complementary_mail_content'] = 'Complementary mail content'; -$lang['nbm_content_byebye'] = 'See you soon'; -$lang['nbm_content_goto'] = 'Go to %s %s.'; -$lang['nbm_content_hello'] = 'Hello %s'; -$lang['nbm_content_new_elements'] = 'New elements were added on %s'; -$lang['nbm_content_new_elements_between'] = 'New elements were added between %s and %s'; +$lang['nbm_content_byebye'] = 'See you soon,'; +$lang['nbm_content_goto_1'] = 'Go to '; +$lang['nbm_content_goto_2'] = '.'; +$lang['nbm_content_hello_1'] = 'Hello '; +$lang['nbm_content_hello_2'] = ','; +$lang['nbm_content_new_elements'] = 'New elements were added '; +$lang['nbm_content_new_elements_single'] = ' on '; +$lang['nbm_content_new_elements_between_1'] = 'between '; +$lang['nbm_content_new_elements_between_2'] = ' and '; $lang['nbm_content_subscribe_by_admin'] = 'The webmaster has subcribed you for receiving notifications by mail'; $lang['nbm_content_subscribe_by_himself'] = 'You have subcribed to receiving notifications by mail'; -$lang['nbm_content_subscribe_link'] = 'To subscribe, click on %s .'; -$lang['nbm_content_subscribe_unsubscribe_contact'] = 'If you encounter problems or have any question, please send a message to %s.'; +$lang['nbm_content_subscribe_link'] = 'To subscribe'; +$lang['nbm_content_problem_contact'] = 'If you encounter problems or have any question, please send a message to '; +$lang['nbm_content_pb_contact_object'] = '[NBM] Problems or questions'; $lang['nbm_content_unsubscribe_by_admin'] = 'The webmaster has unsubcribed you from receiving notifications by mail'; $lang['nbm_content_unsubscribe_by_himself'] = 'You have unsubcribed from receiving notifications by mail'; -$lang['nbm_content_unsubscribe_link'] = 'To unsubscribe, click on %s .'; +$lang['nbm_content_click_on'] = ', click on '; +$lang['nbm_content_unsubscribe_link'] = 'To unsubscribe'; $lang['nbm_info_send_mail_as'] = 'With blank value, gallery title will be used'; $lang['nbm_item_notification'] = 'Notification'; $lang['nbm_msg_error_sending_email_to'] = 'Error when sending email to %s [%s].'; $lang['nbm_msg_mail_sent_to'] = 'Mail sent to %s [%s].'; +$lang['nbm_msg_n_mail_sent'] = '%d mail was sent.'; $lang['nbm_msg_n_mails_sent'] = '%d mails were sent.'; -$lang['nbm_msg_no_mail_to_send'] = '%d mails were not sent.'; +$lang['nbm_msg_n_mail_not_send'] = '%d mail was not sent.'; +$lang['nbm_msg_n_mails_not_send'] = '%d mails were not sent.'; $lang['nbm_no_mail_to_send'] = 'No mail to send.'; $lang['nbm_no_user_available_to_send_L1'] = 'No user are available in order to send mail.'; $lang['nbm_no_user_available_to_send_L2'] = 'A user is available, if there are new elements to notify.'; @@ -308,7 +317,7 @@ $lang['nbm_redirect_msg'] = 'Processing treatment.'."\n\n".'Please wait...'; $lang['nbm_repost_submit'] = 'Continue processing treatment'; $lang['nbm_send_check_all'] = 'Check All'; $lang['nbm_send_complementary_mail_content'] = 'Complementary mail content'; -$lang['nbm_send_detailed_content'] = 'Send detailed content'; +$lang['nbm_send_detailed_content'] = 'Add detailed content'; $lang['nbm_send_mail_as'] = 'Send mail as'; $lang['nbm_send_mail_to_users'] = 'Send mail to users'; $lang['nbm_send_mode'] = 'Send'; @@ -321,15 +330,21 @@ $lang['nbm_title_param'] = 'Parameters'; $lang['nbm_title_send'] = 'Select recipients'; $lang['nbm_title_subscribe'] = 'Subscribe/unsubscribe users'; $lang['nbm_unsubscribe_col'] = 'Unsubcribed'; -$lang['nbm_updated_param_count'] = '%d parameters are updated.'; -$lang['nbm_user_change_enabled_error_on_updated_data_count'] = '%d user(s) are not updated.'; -$lang['nbm_user_change_enabled_false'] = 'User %s [%s] removed from the subscription list.'; -$lang['nbm_user_change_enabled_true'] = 'User %s [%s] added to the subscription list.'; -$lang['nbm_user_change_enabled_updated_data_count'] = '%d user(s) are updated.'; -$lang['nbm_user_not_change_enabled_false'] = 'User %s [%s] not removed from the subscription list.'; -$lang['nbm_user_not_change_enabled_true'] = 'User %s [%s] not added to the subscription list.'; +$lang['nbm_updated_param_count'] = '%d parameter was updated.'; +$lang['nbm_updated_params_count'] = '%d parameters were updated.'; +$lang['nbm_user_change_enabled_error_on_updated_data_count'] = '%d user was not updated.'; +$lang['nbm_users_change_enabled_error_on_updated_data_count'] = '%d users were not updated.'; +$lang['nbm_user_change_enabled_false'] = 'User %s [%s] was removed from the subscription list.'; +$lang['nbm_user_change_enabled_true'] = 'User %s [%s] was added to the subscription list.'; +$lang['nbm_user_change_enabled_updated_data_count'] = '%d user was updated.'; +$lang['nbm_users_change_enabled_updated_data_count'] = '%d users were updated.'; +$lang['nbm_user_not_change_enabled_false'] = 'User %s [%s] was not removed from the subscription list.'; +$lang['nbm_user_not_change_enabled_true'] = 'User %s [%s] was not added to the subscription list.'; $lang['nbm_user_x_added'] = 'User %s [%s] added.'; $lang['nbm_warning_subscribe_unsubcribe'] = 'Warning: subscribing or unsubcribing will send mails to users'; +$lang['nbm_send_html_mail'] = 'Send mail on HTML format'; +$lang['nbm_send_recent_post_dates'] = 'Include display of recent pictures group by dates'; +$lang['nbm_info_send_recent_post_dates'] = 'Available only with HTML format'; $lang['no_write_access'] = 'no write access'; $lang['path'] = 'path'; $lang['permissions'] = 'Permissions'; diff --git a/language/fr_FR.iso-8859-1/admin.lang.php b/language/fr_FR.iso-8859-1/admin.lang.php index c93137e56..b50b1ace4 100644 --- a/language/fr_FR.iso-8859-1/admin.lang.php +++ b/language/fr_FR.iso-8859-1/admin.lang.php @@ -28,13 +28,13 @@ $lang['%d associations'] = '%d associations'; $lang['%d categories including %d physical and %d virtual'] = '%d catégories dont %d physiques et %d virtuelles'; $lang['%d categories moved'] = '%d catégories déplacées'; -$lang['%d comments'] = '%d commentaires utilisateur'; +$lang['%d comments'] = '%d commentaires d\'utilisateurs'; $lang['%d elements'] = '%d éléments'; $lang['%d groups'] = '%d groupes'; $lang['%d members'] = '%d membres'; $lang['%d tags'] = '%d tags'; -$lang['%d user comments rejected'] = '%d commentaires utilisateur rejetés'; -$lang['%d user comments validated'] = '%d commentaires utilisateur validés'; +$lang['%d user comments rejected'] = '%d commentaires d\'utilisateurs rejetés'; +$lang['%d user comments validated'] = '%d commentaires d\'utilisateurs validés'; $lang['%d users deleted'] = '%d utilisateurs supprimés'; $lang['%d users'] = '%d utilisateurs'; $lang['%d waiting for validation'] = '%d en attente de validation'; @@ -62,7 +62,7 @@ $lang['Categories ordered alphanumerically'] = 'Catégories ordonnées alphabético $lang['Category elements associated to the following categories: %s'] = 'Les éléments de la catégorie ont été associés aux catégories suivantes : %s'; $lang['Check for upgrade failed for unknown reasons.'] = 'La vérification de la dernière version sur le serveur a échouée pour une raison inconnue.'; $lang['Check for upgrade'] = 'Dernière version ?'; -$lang['Comments for all'] = 'Commentaires utilisateur pour tous'; +$lang['Comments for all'] = 'Commentaires pour tous'; $lang['Controversy'] = 'Controverse'; $lang['Creation date'] = 'Date de création'; $lang['Current name'] = 'Nom courant'; @@ -123,7 +123,7 @@ $lang['New parent category'] = 'Nouvelle catégorie parente'; $lang['New tag'] = 'Nouveau tag'; $lang['No tag defined. Use Administration>Pictures>Tags'] = 'Aucun tag défini. Utiliser l\'écran Adminstration>Images>Tags'; $lang['No'] = 'Non'; -$lang['Number of comments per page'] = 'Nombre de commentaires utilisateur par page'; +$lang['Number of comments per page'] = 'Nombre de commentaires par page'; $lang['Number of images per row'] = 'Nombre de miniatures par ligne'; $lang['Number of rates'] = 'Nombre de notes'; $lang['Number of rows per page'] = 'Nombre de lignes par page'; @@ -178,7 +178,7 @@ $lang['The %d following tags were deleted : %s'] = 'Les %d tags suivants ont été $lang['Unable to check for upgrade since allow_url_fopen is disabled.'] = 'Impossible de connaître la dernière version cat la fonction allow_url_fopen est désactivée.'; $lang['Uninstall'] = 'Désinstaller'; $lang['Use default sort order']='Utiliser l\'ordre de tri des images par défaut (défini dans le fichier de configuration)'; -$lang['User comments validation'] = 'Validation des commentaires utilisateur'; +$lang['User comments validation'] = 'Validation des commentaires d\'utilisateurs'; $lang['Users'] = 'Utilisateurs'; $lang['Validate All'] = 'Tout valider'; $lang['Validate'] = 'Valider'; @@ -215,13 +215,13 @@ $lang['cat_virtual_added'] = 'Catégorie virtuelle ajoutée'; $lang['cat_virtual_deleted'] = 'Catégorie virtuelle supprimée'; $lang['category'] = 'catégorie'; $lang['conf_access'] = 'Type d\'accès'; -$lang['conf_comments_title'] = 'Commentaires utilisateur'; +$lang['conf_comments_title'] = 'Commentaires d\'utilisateurs'; $lang['conf_confirmation'] = 'Informations enregistrées dans la base de données'; $lang['conf_default'] = 'Affichage par défaut'; $lang['conf_default_title'] = 'Affichage par défaut'; $lang['conf_gallery_url_error'] = 'L\'adresse de la galerie n\'est pas valide.'; $lang['conf_general_title'] = 'Configuration principale'; -$lang['conf_nb_comment_page_error'] = 'Le nombre de commentaires utilisateurs par page doit être compris entre 5 et 50.'; +$lang['conf_nb_comment_page_error'] = 'Le nombre de commentaires d\'utilisateurs par page doit être compris entre 5 et 50.'; $lang['config'] = 'Configuration'; $lang['confirm'] = 'confirmer'; $lang['date'] = 'date'; @@ -269,7 +269,8 @@ $lang['metadata_basic'] = 'basique'; $lang['metadata_exif'] = 'EXIF'; $lang['metadata_iptc'] = 'IPTC'; $lang['name'] = 'nom'; -$lang['nbm_background_treatment_redirect'] = 'Le temps d\'exécution étant dépassé, le traitement doit continuer [Temps estimé: %d secondes].'; +$lang['nbm_background_treatment_redirect_second'] = 'Le temps d\'exécution étant dépassé, le traitement doit continuer [Temps estimé: %d second].'; +$lang['nbm_background_treatment_redirect_seconds'] = 'Le temps d\'exécution étant dépassé, le traitement doit continuer [Temps estimé: %d secondes].'; $lang['nbm_break_timeout_list_user'] = 'Le temps de préparation de la liste des utilisateurs pour l\'envoi est limité. Les autres utilisateurs ne sont pas listés.'; $lang['nbm_break_timeout_send_mail'] = 'Le temps d\'envoi des mails est limité. Les autres envois de mail ont été ignorés.'; $lang['nbm_col_check_user_send_mail'] = 'A envoyer ?'; @@ -277,24 +278,32 @@ $lang['nbm_col_last_send'] = 'Dernier envoi'; $lang['nbm_col_mail'] = 'email'; $lang['nbm_col_user'] = 'Utilisateur'; $lang['nbm_complementary_mail_content'] = 'Contenu complémentaire au mail'; -$lang['nbm_content_byebye'] = 'A bientôt'; -$lang['nbm_content_goto'] = 'Rendez-vous sur %s %s.'; -$lang['nbm_content_hello'] = 'Bonjour %s'; -$lang['nbm_content_new_elements'] = 'Des nouveaux éléments ont été ajoutés le %s'; -$lang['nbm_content_new_elements_between'] = 'Des nouveaux éléments ont été ajoutés entre le %s et le %s'; +$lang['nbm_content_byebye'] = 'A bientôt,'; +$lang['nbm_content_goto_1'] = 'Rendez-vous sur '; +$lang['nbm_content_goto_2'] = '.'; +$lang['nbm_content_hello_1'] = 'Bonjour '; +$lang['nbm_content_hello_2'] = ','; +$lang['nbm_content_new_elements'] = 'De nouveaux éléments ont été ajoutés '; +$lang['nbm_content_new_elements_single'] = ' le '; +$lang['nbm_content_new_elements_between_1'] = 'entre le '; +$lang['nbm_content_new_elements_between_2'] = ' et le '; $lang['nbm_content_subscribe_by_admin'] = 'Vous venez d\'être inscrit par le webmestre du site pour recevoir la notification par mail.'; $lang['nbm_content_subscribe_by_himself'] = 'Vous venez de vous inscrire pour recevoir la notification par mail.'; -$lang['nbm_content_subscribe_link'] = 'Pour vous inscrire, cliquez sur %s .'; -$lang['nbm_content_subscribe_unsubscribe_contact'] = 'En cas de problèmes ou de questions, envoyer un mail à %s.'; +$lang['nbm_content_subscribe_link'] = 'Pour vous inscrire'; +$lang['nbm_content_problem_contact'] = 'En cas de problèmes ou de questions, envoyer un mail à '; +$lang['nbm_content_pb_contact_object'] = '[NBM] Problèmes ou de questions'; $lang['nbm_content_unsubscribe_by_admin'] = 'Vous venez d\'être désinscrit par le webmestre du site pour recevoir la notification par mail.'; $lang['nbm_content_unsubscribe_by_himself'] = 'Vous venez de vous désinscrire pour recevoir la notification par mail.'; -$lang['nbm_content_unsubscribe_link'] = 'Pour vous désinscrire, cliquez sur %s .'; +$lang['nbm_content_click_on'] = ', cliquez sur '; +$lang['nbm_content_unsubscribe_link'] = 'Pour vous désinscrire'; $lang['nbm_info_send_mail_as'] = 'Sans valeur, le titre de la galerie sera utilisé'; $lang['nbm_item_notification'] = 'Notification'; $lang['nbm_msg_error_sending_email_to'] = 'Erreur lors de l\'envoi du mail à %s [%s].'; $lang['nbm_msg_mail_sent_to'] = 'Mail envoyé à %s [%s].'; +$lang['nbm_msg_n_mail_sent'] = '%s mail a été envoyé.'; $lang['nbm_msg_n_mails_sent'] = '%s mails ont été envoyés.'; -$lang['nbm_msg_no_mail_to_send'] = '%s mails n\'ont pas été envoyés.'; +$lang['nbm_msg_n_mail_not_send'] = '%s mail n\'a pas été envoyé.'; +$lang['nbm_msg_n_mails_not_send'] = '%s mails n\'ont pas été envoyés.'; $lang['nbm_no_mail_to_send'] = 'Pas de mail à envoyer.'; $lang['nbm_no_user_available_to_send_L1'] = 'Il n\'y a pas d\'utilisateur à notifier par mail.'; $lang['nbm_no_user_available_to_send_L2'] = 'Un utilisateur est à notifier si de nouveaux éléments sont disponibles pour cet utilisateur.'; @@ -308,7 +317,7 @@ $lang['nbm_redirect_msg'] = 'Traitement en cours.'."\n".'Veuillez patienter...'; $lang['nbm_repost_submit'] = 'Continuer le traitement en cours...'; $lang['nbm_send_check_all'] = 'Tout cocher'; $lang['nbm_send_complementary_mail_content'] = 'Contenu complémentaire du mail'; -$lang['nbm_send_detailed_content'] = 'Envoi d\'un contenu détaillé'; +$lang['nbm_send_detailed_content'] = 'Ajout d\'un contenu détaillé'; $lang['nbm_send_mail_as'] = 'Envoyer le mail en tant que'; $lang['nbm_send_mail_to_users'] = 'Envoi de mail aux utilisateurs'; $lang['nbm_send_mode'] = 'Envoi'; @@ -321,15 +330,21 @@ $lang['nbm_title_param'] = 'Paramètres'; $lang['nbm_title_send'] = 'Sélection des envois'; $lang['nbm_title_subscribe'] = 'Inscrire/désinscrire les utilisateurs'; $lang['nbm_unsubscribe_col'] = 'Non Inscrits'; -$lang['nbm_updated_param_count'] = '%d paramètres ont été mis à jour.'; -$lang['nbm_user_change_enabled_error_on_updated_data_count'] = '%d utilisateurs n\'ont pas été mis à jour.'; +$lang['nbm_updated_param_count'] = '%d paramètre a été mis à jour.'; +$lang['nbm_updated_params_count'] = '%d paramètres ont été mis à jour.'; +$lang['nbm_user_change_enabled_error_on_updated_data_count'] = '%d utilisateur n\'a pas été mis à jour.'; +$lang['nbm_users_change_enabled_error_on_updated_data_count'] = '%d utilisateurs n\'ont pas été mis à jour.'; $lang['nbm_user_change_enabled_false'] = 'L\'utilisateur %s [%s] a été supprimé de la liste des inscrits.'; $lang['nbm_user_change_enabled_true'] = 'L\'utilisateur %s [%s] a été ajouté à la liste des inscrits.'; -$lang['nbm_user_change_enabled_updated_data_count'] = '%d utilisateurs ont été mis à jour.'; +$lang['nbm_user_change_enabled_updated_data_count'] = '%d utilisateur a été mis à jour.'; +$lang['nbm_users_change_enabled_updated_data_count'] = '%d utilisateurs ont été mis à jour.'; $lang['nbm_user_not_change_enabled_false'] = 'L\'utilisateur %s [%s] n\'a pas été supprimé de la liste des inscrits.'; $lang['nbm_user_not_change_enabled_true'] = 'L\'utilisateur %s [%s] n\'a pas été ajouté à la liste des inscrits.'; $lang['nbm_user_x_added'] = 'Utilisateur %s [%s] ajouté.'; $lang['nbm_warning_subscribe_unsubcribe'] = 'Attention, l\'inscription ou la désincription entraine l\'envoi de mails aux utilisateurs concernés'; +$lang['nbm_send_html_mail'] = 'Envoyer le mail au format HTML'; +$lang['nbm_send_recent_post_dates'] = 'Inclure l\'affichage des dernières images groupées par dates'; +$lang['nbm_info_send_recent_post_dates'] = 'Disponible uniquement avec le format HTML'; $lang['no_write_access'] = 'pas d\'accès en écriture'; $lang['path'] = 'chemin'; $lang['permissions'] = 'Permissions'; diff --git a/template/yoga/admin/notification_by_mail.tpl b/template/yoga/admin/notification_by_mail.tpl index 620f8a8dc..da61bcdfb 100644 --- a/template/yoga/admin/notification_by_mail.tpl +++ b/template/yoga/admin/notification_by_mail.tpl @@ -27,23 +27,40 @@ <legend>{lang:nbm_title_param}</legend> <table> <tr> + <td><label>{lang:nbm_send_html_mail}</label></td> + <td> + <label><input type="radio" name="nbm_send_html_mail" value="true" {param.SEND_HTML_MAIL_YES}/>{lang:yes}</label> + <label><input type="radio" name="nbm_send_html_mail" value="false" {param.SEND_HTML_MAIL_NO}/>{lang:no}</label> + </td> + </tr> + <tr> <td> <label for="send_mail_as">{lang:nbm_send_mail_as}</label> <br><i><small>{lang:nbm_info_send_mail_as}</small></i> </td> <td><input type="text" maxlength="35" size="35" name="nbm_send_mail_as" id="send_mail_as" value="{param.SEND_MAIL_AS}"/></td> </tr> - <tr> - <td><label>{lang:nbm_send_detailed_content} </label></td> + <tr> + <td><label>{lang:nbm_send_detailed_content}</label></td> <td> <label><input type="radio" name="nbm_send_detailed_content" value="true" {param.SEND_DETAILED_CONTENT_YES}/>{lang:yes}</label> <label><input type="radio" name="nbm_send_detailed_content" value="false" {param.SEND_DETAILED_CONTENT_NO}/>{lang:no}</label> </td> </tr> <tr> - <td><label for="complementary_mail_content">{lang:nbm_complementary_mail_content} </label></td> + <td><label for="complementary_mail_content">{lang:nbm_complementary_mail_content}</label></td> <td><textarea cols="50" rows="5" name="nbm_complementary_mail_content" id="complementary_mail_content">{param.COMPLEMENTARY_MAIL_CONTENT}</textarea></td> </tr> + <tr> + <td> + <label>{lang:nbm_send_recent_post_dates}</label> + <br><i><small>{lang:nbm_info_send_recent_post_dates}</small></i> + </td> + <td> + <label><input type="radio" name="nbm_send_recent_post_dates" value="true" {param.SEND_RECENT_POST_DATES_YES}/>{lang:yes}</label> + <label><input type="radio" name="nbm_send_recent_post_dates" value="false" {param.SEND_RECENT_POST_DATES_NO}/>{lang:no}</label> + </td> + </tr> </table> </fieldset> @@ -98,7 +115,7 @@ <legend>{lang:nbm_send_options}</legend> <table> <tr> - <td><label for="send_customize_mail_content">{lang:nbm_send_complementary_mail_content} </label></td> + <td><label for="send_customize_mail_content">{lang:nbm_send_complementary_mail_content}</label></td> <td><textarea cols="50" rows="5" name="send_customize_mail_content" id="send_customize_mail_content">{send.send_data.CUSTOMIZE_MAIL_CONTENT}</textarea></td> </tr> </table> diff --git a/template/yoga/mail/index.php b/template/yoga/mail/index.php index ad16c4524..871f06a8e 100644 --- a/template/yoga/mail/index.php +++ b/template/yoga/mail/index.php @@ -2,7 +2,7 @@ // +-----------------------------------------------------------------------+ // | PhpWebGallery - a PHP based picture gallery | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | -// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | +// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ // | branch : BSF (Best So Far) // | file : $RCSfile$ diff --git a/template/yoga/mail/footer.tpl b/template/yoga/mail/text/html/footer.tpl index 22076068a..ac0d2784f 100644 --- a/template/yoga/mail/footer.tpl +++ b/template/yoga/mail/text/html/footer.tpl @@ -1,5 +1,5 @@ <div id="copyright">
-
+<HR>
<!-- Please, do not remove this copyright. If you really want to,
contact us on http://phpwebgallery.net to find a solution on how
to show the origin of the script...-->
diff --git a/template/yoga/mail/header.tpl b/template/yoga/mail/text/html/header.tpl index fee4d441c..fee4d441c 100644 --- a/template/yoga/mail/header.tpl +++ b/template/yoga/mail/text/html/header.tpl diff --git a/template/yoga/mail/admin/index.php b/template/yoga/mail/text/html/index.php index ad16c4524..871f06a8e 100644 --- a/template/yoga/mail/admin/index.php +++ b/template/yoga/mail/text/html/index.php @@ -2,7 +2,7 @@ // +-----------------------------------------------------------------------+ // | PhpWebGallery - a PHP based picture gallery | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | -// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | +// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ // | branch : BSF (Best So Far) // | file : $RCSfile$ diff --git a/template/yoga/mail/text/index.php b/template/yoga/mail/text/index.php new file mode 100644 index 000000000..871f06a8e --- /dev/null +++ b/template/yoga/mail/text/index.php @@ -0,0 +1,35 @@ +<?php +// +-----------------------------------------------------------------------+ +// | PhpWebGallery - a PHP based picture gallery | +// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | +// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | +// +-----------------------------------------------------------------------+ +// | branch : BSF (Best So Far) +// | file : $RCSfile$ +// | last update : $Date: 2006-03-15 23:44:35 +0100 (mer., 15 mars 2006) $ +// | last modifier : $Author: plg $ +// | revision : $Revision: 1082 $ +// +-----------------------------------------------------------------------+ +// | This program is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU General Public License as published by | +// | the Free Software Foundation | +// | | +// | This program is distributed in the hope that it will be useful, but | +// | WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | +// | USA. | +// +-----------------------------------------------------------------------+ + +// recursive call of index.php + +$url = '../index.php'; +header( 'Request-URI: '.$url ); +header( 'Content-Location: '.$url ); +header( 'Location: '.$url ); +exit(); +?> diff --git a/template/yoga/mail/text/plain/footer.tpl b/template/yoga/mail/text/plain/footer.tpl new file mode 100644 index 000000000..7d97bba50 --- /dev/null +++ b/template/yoga/mail/text/plain/footer.tpl @@ -0,0 +1,3 @@ +
+------------------------
+PhpWebGallery {VERSION}
diff --git a/template/yoga/mail/text/plain/header.tpl b/template/yoga/mail/text/plain/header.tpl new file mode 100644 index 000000000..fec68b422 --- /dev/null +++ b/template/yoga/mail/text/plain/header.tpl @@ -0,0 +1 @@ +{FAKE_SIMULATE_EMPTY_FILE}
\ No newline at end of file diff --git a/template/yoga/mail/text/plain/index.php b/template/yoga/mail/text/plain/index.php new file mode 100644 index 000000000..871f06a8e --- /dev/null +++ b/template/yoga/mail/text/plain/index.php @@ -0,0 +1,35 @@ +<?php +// +-----------------------------------------------------------------------+ +// | PhpWebGallery - a PHP based picture gallery | +// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | +// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | +// +-----------------------------------------------------------------------+ +// | branch : BSF (Best So Far) +// | file : $RCSfile$ +// | last update : $Date: 2006-03-15 23:44:35 +0100 (mer., 15 mars 2006) $ +// | last modifier : $Author: plg $ +// | revision : $Revision: 1082 $ +// +-----------------------------------------------------------------------+ +// | This program is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU General Public License as published by | +// | the Free Software Foundation | +// | | +// | This program is distributed in the hope that it will be useful, but | +// | WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | +// | USA. | +// +-----------------------------------------------------------------------+ + +// recursive call of index.php + +$url = '../index.php'; +header( 'Request-URI: '.$url ); +header( 'Content-Location: '.$url ); +header( 'Location: '.$url ); +exit(); +?> |