Index: /extensions/Subscribe_to_comments/include/functions.inc.php
===================================================================
--- /extensions/Subscribe_to_comments/include/functions.inc.php	(revision 12608)
+++ /extensions/Subscribe_to_comments/include/functions.inc.php	(revision 12609)
@@ -98,5 +98,5 @@
   
   // check email
-  if ( is_a_guest() and empty($email) )
+  if ( ( is_a_guest() or empty($user['email']) ) and empty($email) )
   {
     return false;
@@ -175,5 +175,5 @@
   
   // check email
-  if ( is_a_guest() and empty($email) )
+  if ( ( is_a_guest() or empty($user['email']) ) and empty($email) )
   {
     return false;
Index: /extensions/Subscribe_to_comments/include/subscribe_to_comments.inc.php
===================================================================
--- /extensions/Subscribe_to_comments/include/subscribe_to_comments.inc.php	(revision 12608)
+++ /extensions/Subscribe_to_comments/include/subscribe_to_comments.inc.php	(revision 12609)
@@ -130,5 +130,5 @@
   $infos = $array = array();
   
-  if (isset($_POST['stc_check_stdl']))
+  if (isset($_POST['stc_submit']))
   {
     $return = subscribe_to_comments($picture['current']['id'], @$_POST['stc_mail_stdl'], 'image');
@@ -171,11 +171,11 @@
 }
 
-function stc_on_picture_prefilter($template, &$smarty)
+function stc_on_picture_prefilter($content, &$smarty)
 {
   global $user, $picture;
   
-  // if registered user we check if already subscribed
+  // if registered user with mail we check if already subscribed
   $subscribed = false;
-  if (!is_a_guest())
+  if ( !is_a_guest() and !empty($user['email']) )
   {
     $query = '
@@ -194,7 +194,7 @@
   
   ## subscribe at any moment ##
-  $search[1] = '{if isset($comment_add)}';
-  
-  $replace[1] = $search[1].'
+  $search = '#\<\/div\>(.{0,5})\{\/if\}(.{0,5})\{\*comments\*\}#is';
+  
+  $replace = '
 <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="stc_standalone">
   <fieldset>';
@@ -202,5 +202,5 @@
   if ($subscribed)
   {
-    $replace[1].= '
+    $replace.= '
     {\'You are currently subscribed to comments of this picture.\'|@translate}
     <a href="'.add_url_params($picture['current']['url'], array('stc_unsubscribe'=>'1')).'">{\'Unsubscribe\'|@translate}';
@@ -208,69 +208,55 @@
   else
   {
-    $replace[1].= '
-    <label><a href="#" id="stc_check_stdl">{\'Subscribe to new comments\'|@translate}</a> <input type="checkbox" name="stc_check_stdl" value="1" style="display:none;"></label>';
-    
-    // form for guests
-    if (is_a_guest())
-    {
-      $replace[1].= ' 
-      <label style="display:none;">{\'Email address\'|@translate} <input type="text" name="stc_mail_stdl"></label>
-      <label style="display:none;"><input type="submit" id="stc_submit" value="{\'Submit\'|@translate}"></label>
+    $replace.= '
+    <legend>{\'Subscribe without commenting\'|@translate}</legend>';
+    if ( is_a_guest() or empty($user['email']) ) // email input for guest or users without mail
+    {
+      $replace.= '
+      <label>{\'Email address\'|@translate} <input type="text" name="stc_mail_stdl"></label>
+      <label><input type="submit" name="stc_submit" value="{\'Submit\'|@translate}"></label>';
+    }
+    else
+    {
+      $replace.= '
+      <label><input type="submit" name="stc_submit" value="{\'Subscribe\'|@translate}"></label>';
+    }
+  }
+      
+  $replace.= '
+  </fieldset>
+</form>
+</div>
+{/if}{*comments*}';
+
+  $content = preg_replace($search, $replace, $content);
+
+
+  ## subscribe while add a comment ##
+  $search = '<input type="submit" value="{\'Submit\'|@translate}">';
+  $replace = null;
+  
+  if (!$subscribed)
+  {
+    $replace.= '
+    <label>{\'Notify me of followup comments\'|@translate} <input type="checkbox" name="stc_check" value="1"></label>';
+  }
+  if ( is_a_guest() or empty($user['email']) )
+  {
+    $replace.= ' 
+    <label id="stc_mail" style="display:none;">{\'Email address\'|@translate} <input type="text" name="stc_mail"></label>
     {footer_script require="jquery"}{literal}
     jQuery(document).ready(function() {
-      $("a#stc_check_stdl").click(function() {
-        $("input[name=stc_check_stdl]").prop("checked", true);
-        $("#stc_standalone label").toggle();
-        return false;
+      $("input[name=stc_check]").change(function() {
+        if ($(this).is(":checked")) $("#stc_mail").css("display", "");
+        else $("#stc_mail").css("display", "none");
       });
     });
     {/literal}{/footer_script}';
-    }
-    // simple link for registered users
-    else
-    {
-      $replace[1].= '
-    {footer_script require="jquery"}{literal}
-    jQuery(document).ready(function() {
-      $("a#stc_check_stdl").click(function() {
-        $("input[name=stc_check_stdl]").prop("checked", true);
-        $(this).parents("form#stc_standalone").submit();
-        return false;
-      });
-    });
-    {/literal}{/footer_script}';
-    }
-  }
-      
-  $replace[1].= '
-  </fieldset>
-</form>';
-
-
-  ## subscribe while add a comment ##
-  $search[0] = '<input type="submit" value="{\'Submit\'|@translate}">';
-  $replace[0] = null;
-  
-  if (!$subscribed)
-  {
-    $replace[0].= '
-<label>{\'Subscribe to new comments\'|@translate} <input type="checkbox" name="stc_check" value="1"></label>';
-  }
-  if (is_a_guest())
-  {
-    $replace[0].= ' 
-<label id="stc_mail" style="display:none;">{\'Email address\'|@translate} <input type="text" name="stc_mail"></label>
-{footer_script require="jquery"}{literal}
-jQuery(document).ready(function() {
-  $("input[name=stc_check]").change(function() {
-    if ($(this).is(":checked")) $("#stc_mail").css("display", "");
-    else $("#stc_mail").css("display", "none");
-  });
-});
-{/literal}{/footer_script}';
-  }
-  $replace[0].= $search[0];
-  
-  return str_replace($search, $replace, $template);
+  }
+  $replace.= $search;
+  
+  $content = str_replace($search, $replace, $content);
+  
+  return $content;
 }
 
@@ -294,5 +280,5 @@
   }
   
-  if (isset($_POST['stc_check_stdl']))
+  if (isset($_POST['stc_submit']))
   {
     $return = subscribe_to_comments($page['category']['id'], @$_POST['stc_mail_stdl'], 'category');
@@ -337,5 +323,5 @@
 }
 
-function stc_on_album_prefilter($template, &$smarty)
+function stc_on_album_prefilter($content, &$smarty)
 {
   global $user, $page;
@@ -343,5 +329,5 @@
   // if registered user we check if already subscribed
   $subscribed = false;
-  if (!is_a_guest())
+  if ( !is_a_guest() and !empty($user['email']) )
   {
     $query = '
@@ -360,11 +346,10 @@
   
   ## subscribe at any moment ##
-  $search[1] = '{if isset($comment_add)}';
-  
-  $replace[1] = $search[1].'
+  $search = '#\<\/div\>(.{0,5})\{\/if\}(.{0,5})\{\*comments\*\}#is';
+  
+  $replace = '
 <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="stc_standalone">
   <fieldset>';
   
-  // if registered user we check if already subscribed
   if ($subscribed)
   {
@@ -374,5 +359,5 @@
     $element_url = make_index_url($url_params);
   
-    $replace[1].= '
+    $replace.= '
     {\'You are currently subscribed to comments of this album.\'|@translate}
     <a href="'.add_url_params($element_url, array('stc_unsubscribe'=>'1')).'">{\'Unsubscribe\'|@translate}';
@@ -380,69 +365,55 @@
   else
   {
-    $replace[1].= '
-    <label><a href="#" id="stc_check_stdl">{\'Subscribe to new comments\'|@translate}</a> <input type="checkbox" name="stc_check_stdl" value="1" style="display:none;"></label>';
-    
-    // form for guests
-    if (is_a_guest())
-    {
-      $replace[1].= ' 
-      <label style="display:none;">{\'Email address\'|@translate} <input type="text" name="stc_mail_stdl"></label>
-      <label style="display:none;"><input type="submit" id="stc_submit" value="{\'Submit\'|@translate}"></label>
+    $replace.= '
+    <legend>{\'Subscribe without commenting\'|@translate}</legend>';
+    if ( is_a_guest() or empty($user['email']) ) // email input for guest or users without mail
+    {
+      $replace.= '
+      <label>{\'Email address\'|@translate} <input type="text" name="stc_mail_stdl"></label>
+      <label><input type="submit" name="stc_submit" value="{\'Submit\'|@translate}"></label>';
+    }
+    else
+    {
+      $replace.= '
+      <label><input type="submit" name="stc_submit" value="{\'Subscribe\'|@translate}"></label>';
+    }
+  }
+      
+  $replace.= '
+  </fieldset>
+</form>
+</div>
+{/if}{*comments*}';
+
+  $content = preg_replace($search, $replace, $content);
+
+
+  ## subscribe while add a comment ##
+  $search = '<input type="submit" value="{\'Submit\'|@translate}">';
+  $replace = null;
+  
+  if (!$subscribed)
+  {
+    $replace.= '
+    <label>{\'Notify me of followup comments\'|@translate} <input type="checkbox" name="stc_check" value="1"></label>';
+  }
+  if ( is_a_guest() or empty($user['email']) )
+  {
+    $replace.= ' 
+    <label id="stc_mail" style="display:none;">{\'Email address\'|@translate} <input type="text" name="stc_mail"></label>
     {footer_script require="jquery"}{literal}
     jQuery(document).ready(function() {
-      $("a#stc_check_stdl").click(function() {
-        $("input[name=stc_check_stdl]").prop("checked", true);
-        $("#stc_standalone label").toggle();
-        return false;
+      $("input[name=stc_check]").change(function() {
+        if ($(this).is(":checked")) $("#stc_mail").css("display", "");
+        else $("#stc_mail").css("display", "none");
       });
     });
     {/literal}{/footer_script}';
-    }
-    // simple link for registered users
-    else
-    {
-      $replace[1].= '
-    {footer_script require="jquery"}{literal}
-    jQuery(document).ready(function() {
-      $("a#stc_check_stdl").click(function() {
-        $("input[name=stc_check_stdl]").prop("checked", true);
-        $(this).parents("form#stc_standalone").submit();
-        return false;
-      });
-    });
-    {/literal}{/footer_script}';
-    }
-  }
-      
-  $replace[1].= '
-  </fieldset>
-</form>';
-
-
-  ## subscribe while add a comment ##
-  $search[0] = '<input type="submit" value="{\'Submit\'|@translate}">';
-  $replace[0] = null;
-  
-  if (!$subscribed)
-  {
-    $replace[0].= '
-<label>{\'Subscribe to new comments\'|@translate} <input type="checkbox" name="stc_check" value="1"></label>';
-  }
-  if (is_a_guest())
-  {
-    $replace[0].= ' 
-<label id="stc_mail" style="display:none;">{\'Email address\'|@translate} <input type="text" name="stc_mail"></label>
-{footer_script require="jquery"}{literal}
-jQuery(document).ready(function() {
-  $("input[name=stc_check]").change(function() {
-    if ($(this).is(":checked")) $("#stc_mail").css("display", "");
-    else $("#stc_mail").css("display", "none");
-  });
-});
-{/literal}{/footer_script}';
-  }
-  $replace[0].= $search[0];
-
-  return str_replace($search, $replace, $template);
+  }
+  $replace.= $search;
+
+  $content = str_replace($search, $replace, $content);
+  
+  return $content;
 }
 
@@ -453,7 +424,10 @@
 function stc_profile_link()
 {
-  global $template;
-  
-  $template->set_prefilter('profile_content', 'stc_profile_link_prefilter'); 
+  global $template, $user;
+  
+  if (!empty($user['email']))
+  {
+    $template->set_prefilter('profile_content', 'stc_profile_link_prefilter');
+  }
 }
 
Index: /extensions/Subscribe_to_comments/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Subscribe_to_comments/language/en_UK/plugin.lang.php	(revision 12608)
+++ /extensions/Subscribe_to_comments/language/en_UK/plugin.lang.php	(revision 12609)
@@ -9,5 +9,7 @@
 $lang['You are currently subscribed to comments of this album.'] = 'You are currently subscribed to comments of this album.';
 $lang['Unsubscribe'] = 'Unsubscribe';
-$lang['Subscribe to new comments'] = 'Subscribe to new comments';
+$lang['Subscribe'] = 'Subscribe';
+$lang['Subscribe without commenting'] = 'Subscribe without commenting';
+$lang['Notify me of followup comments'] = 'Notify me of followup comments';
 $lang['Invalid email adress.'] = 'Invalid email adress.';
 $lang['Your subscribtion has been validated, thanks you.'] = 'Your subscribtion has been validated, thanks you.';
Index: /extensions/Subscribe_to_comments/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Subscribe_to_comments/language/fr_FR/plugin.lang.php	(revision 12608)
+++ /extensions/Subscribe_to_comments/language/fr_FR/plugin.lang.php	(revision 12609)
@@ -9,5 +9,7 @@
 $lang['You are currently subscribed to comments of this album.'] = 'Vous êtes actuellement inscrit aux commentaires de cet album.';
 $lang['Unsubscribe'] = 'Se désinscrire';
-$lang['Subscribe to new comments'] = 'S\'inscrire aux nouveaux commentaires';
+$lang['Subscribe'] = 'S\'inscrire';
+$lang['Subscribe without commenting'] = 'S\'inscrire sans commenter';
+$lang['Notify me of followup comments'] = 'Me notifier des nouveaux commentaires';
 $lang['Invalid email adress.'] = 'Adress email invalide.';
 $lang['Your subscribtion has been validated, thanks you.'] = 'Votre inscription a été validée, merci.';
