Index: /trunk/about.php
===================================================================
--- /trunk/about.php	(revision 15577)
+++ /trunk/about.php	(revision 15578)
@@ -58,4 +58,5 @@
 
 include(PHPWG_ROOT_PATH.'include/page_header.php');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 $template->pparse('about');
 include(PHPWG_ROOT_PATH.'include/page_tail.php');
Index: /trunk/comments.php
===================================================================
--- /trunk/comments.php	(revision 15577)
+++ /trunk/comments.php	(revision 15578)
@@ -550,4 +550,5 @@
 // +-----------------------------------------------------------------------+
 include(PHPWG_ROOT_PATH.'include/page_header.php');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 $template->pparse('comments');
 include(PHPWG_ROOT_PATH.'include/page_tail.php');
Index: /trunk/identification.php
===================================================================
--- /trunk/identification.php	(revision 15577)
+++ /trunk/identification.php	(revision 15578)
@@ -108,4 +108,5 @@
 //----------------------------------------------------------- html code display
 include(PHPWG_ROOT_PATH.'include/page_header.php');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 $template->pparse('identification');
 include(PHPWG_ROOT_PATH.'include/page_tail.php');
Index: /trunk/include/page_header.php
===================================================================
--- /trunk/include/page_header.php	(revision 15577)
+++ /trunk/include/page_header.php	(revision 15578)
@@ -100,20 +100,5 @@
       ));
 }
-else
-{// messages only if no redirection
-  foreach (array('errors','infos') as $mode)
-  {
-    if (isset($_SESSION['page_'.$mode]))
-    {
-      $page[$mode] = array_merge($page[$mode], $_SESSION['page_'.$mode]);
-      unset($_SESSION['page_'.$mode]);
-    }
 
-    if (count($page[$mode]) != 0)
-    {
-      $template->assign($mode, $page[$mode]);
-    }
-  }
-}
 trigger_action('loc_end_page_header');
 
Index: /trunk/include/page_messages.php
===================================================================
--- /trunk/include/page_messages.php	(revision 15578)
+++ /trunk/include/page_messages.php	(revision 15578)
@@ -0,0 +1,42 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// messages only if no redirection
+if ($template->get_template_vars('page_refresh') === null)
+{
+  foreach (array('errors','infos') as $mode)
+  {
+    if (isset($_SESSION['page_'.$mode]))
+    {
+      $page[$mode] = array_merge($page[$mode], $_SESSION['page_'.$mode]);
+      unset($_SESSION['page_'.$mode]);
+    }
+
+    if (count($page[$mode]) != 0)
+    {
+      $template->assign($mode, $page[$mode]);
+    }
+  }
+}
+
+?>
Index: /trunk/index.php
===================================================================
--- /trunk/index.php	(revision 15577)
+++ /trunk/index.php	(revision 15578)
@@ -342,4 +342,5 @@
 include(PHPWG_ROOT_PATH.'include/page_header.php');
 trigger_action('loc_end_index');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 $template->pparse('index');
 //------------------------------------------------------------ log informations
Index: /trunk/nbm.php
===================================================================
--- /trunk/nbm.php	(revision 15577)
+++ /trunk/nbm.php	(revision 15578)
@@ -77,4 +77,5 @@
 // +-----------------------------------------------------------------------+
 include(PHPWG_ROOT_PATH.'include/page_header.php');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 $template->parse('nbm');
 include(PHPWG_ROOT_PATH.'include/page_tail.php');
Index: /trunk/notification.php
===================================================================
--- /trunk/notification.php	(revision 15577)
+++ /trunk/notification.php	(revision 15578)
@@ -113,4 +113,5 @@
 // +-----------------------------------------------------------------------+
 include(PHPWG_ROOT_PATH.'include/page_header.php');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 $template->pparse('notification');
 include(PHPWG_ROOT_PATH.'include/page_tail.php');
Index: /trunk/password.php
===================================================================
--- /trunk/password.php	(revision 15577)
+++ /trunk/password.php	(revision 15578)
@@ -355,4 +355,5 @@
 
 include(PHPWG_ROOT_PATH.'include/page_header.php');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 $template->pparse('password');
 include(PHPWG_ROOT_PATH.'include/page_tail.php');
Index: /trunk/picture.php
===================================================================
--- /trunk/picture.php	(revision 15577)
+++ /trunk/picture.php	(revision 15578)
@@ -981,4 +981,5 @@
 include(PHPWG_ROOT_PATH.'include/page_header.php');
 trigger_action('loc_end_picture');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 if ($page['slideshow'] and $conf['light_slideshow'])
 {
Index: /trunk/profile.php
===================================================================
--- /trunk/profile.php	(revision 15577)
+++ /trunk/profile.php	(revision 15578)
@@ -86,4 +86,5 @@
   include(PHPWG_ROOT_PATH.'include/page_header.php');
   trigger_action('loc_end_profile');
+  include(PHPWG_ROOT_PATH.'include/page_messages.php');
   $template->pparse('profile');
   include(PHPWG_ROOT_PATH.'include/page_tail.php');
Index: /trunk/register.php
===================================================================
--- /trunk/register.php	(revision 15577)
+++ /trunk/register.php	(revision 15578)
@@ -129,4 +129,5 @@
 
 include(PHPWG_ROOT_PATH.'include/page_header.php');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 $template->parse('register');
 include(PHPWG_ROOT_PATH.'include/page_tail.php');
Index: /trunk/search.php
===================================================================
--- /trunk/search.php	(revision 15577)
+++ /trunk/search.php	(revision 15578)
@@ -232,4 +232,5 @@
 //------------------------------------------------------------ html code display
 include(PHPWG_ROOT_PATH.'include/page_header.php');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 $template->pparse('search');
 include(PHPWG_ROOT_PATH.'include/page_tail.php');
Index: /trunk/tags.php
===================================================================
--- /trunk/tags.php	(revision 15577)
+++ /trunk/tags.php	(revision 15578)
@@ -203,4 +203,5 @@
 
 include(PHPWG_ROOT_PATH.'include/page_header.php');
+include(PHPWG_ROOT_PATH.'include/page_messages.php');
 $template->pparse('tags');
 include(PHPWG_ROOT_PATH.'include/page_tail.php');
