diff options
-rw-r--r-- | admin/include/functions_notification_by_mail.inc.php | 18 | ||||
-rw-r--r-- | include/functions_mail.inc.php | 25 | ||||
-rw-r--r-- | include/functions_url.inc.php | 57 | ||||
-rw-r--r-- | template/yoga/mail/footer.tpl | 6 |
4 files changed, 82 insertions, 24 deletions
diff --git a/admin/include/functions_notification_by_mail.inc.php b/admin/include/functions_notification_by_mail.inc.php index 4bd2cfba3..05c3d0378 100644 --- a/admin/include/functions_notification_by_mail.inc.php +++ b/admin/include/functions_notification_by_mail.inc.php @@ -312,16 +312,11 @@ function display_counter_info() function get_mail_content_subscribe_unsubcribe($nbm_user) { - global $page, $env_nbm; + global $env_nbm; $content = "\n\n\n"; - if ( isset($page['root_path']) ) - { - $save_root_path = $page['root_path']; - } - - $page['root_path'] = 'http://'.$_SERVER['HTTP_HOST'].cookie_path(); + 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"; @@ -329,14 +324,7 @@ function get_mail_content_subscribe_unsubcribe($nbm_user) $content .= sprintf(l10n('nbm_content_subscribe_unsubscribe_contact'), $env_nbm['send_as_mail_address'])."\n"; $content .= "___________________________________________________\n\n\n\n"; - if (isset($save_root_path)) - { - $page['root_path'] = $save_root_path; - } - else - { - unset($page['root_path']); - } + unset_make_full_url();
return $content; } diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php index ff75d86b6..9850f9c6c 100644 --- a/include/functions_mail.inc.php +++ b/include/functions_mail.inc.php @@ -121,7 +121,7 @@ function get_mail_template() */
function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $format_infos = 'text/plain', $email_format = null) { - global $conf, $conf_mail, $lang_info, $user; + global $conf, $conf_mail, $lang_info, $user, $page; $cvt7b_subject = str_translate_to_ascii7bits($subject); @@ -141,6 +141,12 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for return false;
}
+ // Compute root_path in order have complete path + if ($email_format == 'text/html') + { + set_make_full_url();
+ } + $to = format_email('', $to); if ($from == '') @@ -179,9 +185,8 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for $page['body_id'] : '',
'CONTENT_ENCODING' => $lang_info['charset'],
- 'LANG'=>$lang_info['code'],
- 'DIR'=>$lang_info['direction']
-
+ 'LANG' => $lang_info['code'],
+ 'DIR' => $lang_info['direction']
));
$conf_mail[$email_format][$lang_info['charset']]['header'] =
@@ -220,8 +225,8 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for $page['gallery_title'] : $conf['gallery_title'],
'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '',
- 'L_TITLE_MAIL' => urlencode(l10n('title_send_mail')),
- 'MAIL' => get_webmaster_mail_address()
+ 'TITLE_MAIL' => urlencode(l10n('title_send_mail')),
+ 'MAIL' => get_webmaster_mail_address() ));
$conf_mail[$email_format][$lang_info['charset']]['footer'] =
@@ -233,7 +238,13 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for }
}
- $content.= $conf_mail[$email_format][$lang_info['charset']]['footer'];
+ $content.= $conf_mail[$email_format][$lang_info['charset']]['footer']; + + // Undo Compute root_path in order have complete path + if ($email_format == 'text/html') + {
+ unset_make_full_url(); + } if ($conf_mail['mail_options']) { diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php index 0d2ea4a7e..2b561f3d4 100644 --- a/include/functions_url.inc.php +++ b/include/functions_url.inc.php @@ -396,4 +396,61 @@ function make_section_in_url($params) return $section_string; } + +/** + * Indicate to build url with full path + * + * @param null + * @return null + */ +function set_make_full_url() +{ + global $page; + + if (!isset($page['save_root_path'])) + { + if (isset($page['root_path'])) + { + $page['save_root_path']['path'] = $page['root_path']; + } + $page['save_root_path']['count'] = 1; + $page['root_path'] = 'http://'.$_SERVER['HTTP_HOST'].cookie_path(); + } + else + { + $page['save_root_path']['count'] += 1; + } +} + +/** + * Restore old parameter to build url with full path + * + * @param null + * @return null + */ +function unset_make_full_url() +{ + global $page; + + if (isset($page['save_root_path'])) + { + if ($page['save_root_path']['count'] == 1) + { + if (isset($page['save_root_path']['path'])) + { + $page['root_path'] = $page['save_root_path']['path']; + } + else + { + unset($page['root_path']); + } + unset($page['save_root_path']); + } + else + { + $page['save_root_path']['count'] -= 1; + } + } +} + ?>
\ No newline at end of file diff --git a/template/yoga/mail/footer.tpl b/template/yoga/mail/footer.tpl index e0faa92f2..01c9e3c4a 100644 --- a/template/yoga/mail/footer.tpl +++ b/template/yoga/mail/footer.tpl @@ -5,10 +5,12 @@ to show the origin of the script...-->
<a href="{GALLERY_URL}" class="back">{GALLERY_TITLE}</a> -
- {lang:powered_by} <a href="http://www.phpwebgallery.net" class="back">PhpWebGallery</a>
+ <a href="http://www.phpwebgallery.net" class="back" title="{lang:powered_by}">
+ <img src="{pwg_root}{themeconf:icon_dir}/pwg_footer.png" alt="{lang:powered_by}">
+ </a>
{VERSION}
- {lang:send_mail}
- <a href="mailto:{MAIL}?subject={L_TITLE_MAIL}">{lang:Webmaster}</a>
+ <a href="mailto:{MAIL}?subject={TITLE_MAIL}">{lang:Webmaster}</a>
</div> <!-- copyright -->
</div> <!-- the_page -->
|