Index: /extensions/Piwecard/CHANGELOG
===================================================================
--- /extensions/Piwecard/CHANGELOG	(revision 9341)
+++ /extensions/Piwecard/CHANGELOG	(revision 9342)
@@ -7,4 +7,6 @@
 Version 1.0.x
 -------------
+1.0.4 -->   - Correct warning when option "active on user cats" is active
+            - Add default mail for Guest eCard (in admin)
 1.0.3 -->   - Add RU, LV language
             - Add load language into ecard function
Index: /extensions/Piwecard/admin/params.php
===================================================================
--- /extensions/Piwecard/admin/params.php	(revision 9341)
+++ /extensions/Piwecard/admin/params.php	(revision 9342)
@@ -15,4 +15,6 @@
     $me->my_config['ecard_showinfos'] = isset($_POST['ecard_showinfos']);
     $me->my_config['nb_ecard_page'] = $_POST['ecard_nb_page'];
+
+    $me->my_config['defaultmail'] = $_POST['defaultmail'];
 
 	
@@ -41,4 +43,6 @@
 $template->assign('ECARD_SHOWINFOS', $me->my_config['ecard_showinfos'] ? 'checked="checked"' : '');
 
+$template->assign('ECARD_DEFAULT_MAIL', $me->my_config['defaultmail']);
+
 $template->assign('ECARD_SUBJECT_LINK', htmlspecialchars_decode($me->my_config['subject_link']));
 $template->assign('ECARD_MESSAGE_LINK', htmlspecialchars_decode($me->my_config['message_link']));
Index: /extensions/Piwecard/admin/template/params.tpl
===================================================================
--- /extensions/Piwecard/admin/template/params.tpl	(revision 9341)
+++ /extensions/Piwecard/admin/template/params.tpl	(revision 9342)
@@ -42,4 +42,8 @@
 		  </select>
     </li>
+    <li>
+		  {'ecard_default_mail'|@translate}     <input type="text" maxlength="50" size="50" name="defaultmail" id="defaultmail" value="{$ECARD_DEFAULT_MAIL}" />
+
+    </li>
   </ul>
 
Index: /extensions/Piwecard/include/default_values.inc.php
===================================================================
--- /extensions/Piwecard/include/default_values.inc.php	(revision 9341)
+++ /extensions/Piwecard/include/default_values.inc.php	(revision 9342)
@@ -47,3 +47,5 @@
 
 $ecard_default_values['ecard_showinfos']	= false;	// Default : dont show infos under image in ecard
+$ecard_default_values['defaultmail']	    = '';	    // Default mail used for guest user
+
 ?>
Index: /extensions/Piwecard/include/ecard.class.php
===================================================================
--- /extensions/Piwecard/include/ecard.class.php	(revision 9341)
+++ /extensions/Piwecard/include/ecard.class.php	(revision 9342)
@@ -393,16 +393,19 @@
 				// Check the category name, user name et img author
 				// Get all name for upper categories and current category
-				$catname[0] = $cat['name'];
-				if ($upper_ids != null)
-				{
-					$nb=1;
-					foreach ($upper_ids as $upper_cat)
-					{
-						// Get upper cat info and store the name
-						$cat_info = get_cat_info($upper_cat);
-						$catname[$nb++] = $cat_info['name'];
-						if ($this->debug)
-							echo "Catname[".($nb-1)."]=".$catname[$nb-1]." <br>";
-					}
+                if (isset($cat) and !empty($cat))
+                {
+                    $catname[0] = $cat['name'];
+                    if (isset($upper_ids) and $upper_ids != null)
+                    {
+                        $nb=1;
+                        foreach ($upper_ids as $upper_cat)
+                        {
+                            // Get upper cat info and store the name
+                            $cat_info = get_cat_info($upper_cat);
+                            $catname[$nb++] = $cat_info['name'];
+                            if ($this->debug)
+                                echo "Catname[".($nb-1)."]=".$catname[$nb-1]." <br>";
+                        }
+                    }
 				}
 				// Username or the current user
@@ -457,4 +460,14 @@
 					)
 				{
+
+                
+                // Check if user is guest. 
+                // In this case, force mail to default mail (in params)
+                if (is_a_guest())
+                {
+//                    $this->my_config['expmail_change'] = false; // Disable exp mail change
+                    if (!empty($this->my_config['defaultmail']))
+                        $user['email'] = $this->my_config['defaultmail'];
+                }
 				
 				
Index: /extensions/Piwecard/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/Piwecard/language/de_DE/plugin.lang.php	(revision 9341)
+++ /extensions/Piwecard/language/de_DE/plugin.lang.php	(revision 9342)
@@ -101,4 +101,6 @@
 $lang['ecard_admin_submit']				= 'Speichern';
 
+// ****** TODO *****
+$lang['ecard_default_mail']				= 'Default Mail for Guest ecard';
 
 
Index: /extensions/Piwecard/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Piwecard/language/en_UK/plugin.lang.php	(revision 9341)
+++ /extensions/Piwecard/language/en_UK/plugin.lang.php	(revision 9342)
@@ -101,4 +101,6 @@
 $lang['ecard_admin_submit']				= 'Save';
 
+$lang['ecard_default_mail']				= 'Default Mail for Guest ecard';
+
 
 ?>
Index: /extensions/Piwecard/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Piwecard/language/fr_FR/plugin.lang.php	(revision 9341)
+++ /extensions/Piwecard/language/fr_FR/plugin.lang.php	(revision 9342)
@@ -101,4 +101,5 @@
 $lang['ecard_admin_submit']				= 'Enregistrer';
 
+$lang['ecard_default_mail']				= 'Mail par défault pour les cartes Guest';
 
 ?>
Index: /extensions/Piwecard/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/Piwecard/language/it_IT/plugin.lang.php	(revision 9341)
+++ /extensions/Piwecard/language/it_IT/plugin.lang.php	(revision 9342)
@@ -101,4 +101,6 @@
 $lang['ecard_admin_submit']				= 'Salvare';
 
+// ******* TODO ******
+$lang['ecard_default_mail']				= 'Default Mail for Guest ecard';
 
 
Index: /extensions/Piwecard/language/lv_LV/plugin.lang.php
===================================================================
--- /extensions/Piwecard/language/lv_LV/plugin.lang.php	(revision 9341)
+++ /extensions/Piwecard/language/lv_LV/plugin.lang.php	(revision 9342)
@@ -101,4 +101,7 @@
 $lang['ecard_admin_submit'] = 'Saglabāt';
 
+// ****** TODO *****
+$lang['ecard_default_mail']				= 'Default Mail for Guest ecard';
+
 
 ?>
Index: /extensions/Piwecard/language/ru_RU/plugin.lang.php
===================================================================
--- /extensions/Piwecard/language/ru_RU/plugin.lang.php	(revision 9341)
+++ /extensions/Piwecard/language/ru_RU/plugin.lang.php	(revision 9342)
@@ -101,4 +101,7 @@
 $lang['ecard_admin_submit']				= 'Сохранить';
 
+// ******* TODO ******
+$lang['ecard_default_mail']				= 'Default Mail for Guest ecard';
+
 
 ?>
Index: /extensions/Piwecard/main.inc.php
===================================================================
--- /extensions/Piwecard/main.inc.php	(revision 9341)
+++ /extensions/Piwecard/main.inc.php	(revision 9342)
@@ -2,5 +2,5 @@
 /*
  * Plugin Name: Piwecard
- * Version: 1.0.3
+ * Version: 1.0.4
  * Description: envoi de Cartes Virtuelles
  * Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=487
@@ -16,5 +16,5 @@
 global $prefixeTable;
 
-define('ECARD_VERSION', '1.0.3');
+define('ECARD_VERSION', '1.0.4');
 
 define('ECARD_NAME', 'Piwecard');
