Changeset 21340


Ignore:
Timestamp:
03/07/13 22:06:42 (6 years ago)
Author:
mistic100
Message:

too many changes

Location:
extensions/Subscribe_to_comments
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • extensions/Subscribe_to_comments/include/functions.inc.php

    r17921 r21340  
    157157   
    158158  // check email 
    159   if ( !empty($email) and !is_valid_email($email) ) 
     159  if ( !empty($email) and !email_check_format($email) ) 
    160160  { 
    161161    array_push($page['errors'], l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)')); 
     
    172172  } 
    173173   
    174   // search if already registered (can use ODKU because we want to get the id of inserted OR updated row) 
     174  // search if already registered (can't use ODKU because we want to get the id of inserted OR updated row) 
    175175  $query = ' 
    176176SELECT id 
     
    213213   
    214214  // notify admins 
    215   if ( pwg_db_changes(null) != 0 and $conf['Subscribe_to_Comments']['notify_admin_on_subscribe'] ) 
     215  if ( pwg_db_changes() != 0 and $conf['Subscribe_to_Comments']['notify_admin_on_subscribe'] ) 
    216216  { 
    217217    stc_mail_notification_admins($email, $type, $element_id, $inserted_id); 
     
    219219   
    220220  // send validation mail 
    221   if ( is_a_guest() and pwg_db_changes(null) != 0 ) 
     221  if ( is_a_guest() and pwg_db_changes() != 0 ) 
    222222  { 
    223223    set_make_full_url(); 
     
    267267  } 
    268268  // just display confirmation message 
    269   else if (pwg_db_changes(null) != 0) 
     269  else if (pwg_db_changes() != 0) 
    270270  { 
    271271    array_push($page['infos'], l10n('You have been added to the list of subscribers.')); 
     
    285285function un_subscribe_to_comments($email, $id) 
    286286 
    287   if (empty($id)) 
    288   { 
    289     trigger_error('un_subscribe_to_comment: missing id', E_USER_WARNING); 
     287  if ( !empty($email) and !email_check_format($email) ) 
     288  { 
     289    trigger_error('un_subscribe_to_comment: bad email', E_USER_WARNING); 
     290    return false; 
     291  } 
     292   
     293  if (!preg_match('#^[0-9]+$#', $id)) 
     294  { 
     295    trigger_error('un_subscribe_to_comment: bad id', E_USER_WARNING); 
    290296    return false; 
    291297  } 
     
    308314  WHERE  
    309315    email = "'.pwg_db_real_escape_string($email).'" 
    310     AND id = "'.pwg_db_real_escape_string($id).'" 
     316    AND id = '.$id.' 
    311317;'; 
    312318  pwg_query($query); 
    313        
    314   if (pwg_db_changes(null) != 0) return true; 
    315   return false; 
     319   
     320  return (pwg_db_changes() != 0); 
    316321} 
    317322 
     
    325330function validate_subscriptions($email, $id) 
    326331{ 
    327   if (empty($email)) 
    328   { 
    329     trigger_error('validate_subscriptions: missing email', E_USER_WARNING); 
    330     return false; 
    331   } 
    332    
    333   if (empty($id)) 
    334   { 
    335     trigger_error('validate_subscriptions: missing id', E_USER_WARNING); 
     332  if (!email_check_format($email)) 
     333  { 
     334    trigger_error('validate_subscriptions: bad email', E_USER_WARNING); 
     335    return false; 
     336  } 
     337   
     338  if (!preg_match('#^[0-9]+$#', $id)) 
     339  { 
     340    trigger_error('validate_subscriptions: bad id', E_USER_WARNING); 
    336341    return false; 
    337342  } 
     
    342347  WHERE  
    343348    email = "'.pwg_db_real_escape_string($email).'" 
    344     AND id = '.pwg_db_real_escape_string($id).' 
     349    AND id = '.$id.' 
    345350;'; 
    346351  pwg_query($query); 
    347        
    348   if (pwg_db_changes(null) != 0) return true; 
    349   return false; 
     352   
     353  return (pwg_db_changes() != 0); 
    350354} 
    351355 
     
    371375  $template->set_filename('stc_mail', dirname(__FILE__).'/../template/mail/admin.tpl'); 
    372376     
    373   $subject = '['.strip_tags($conf['gallery_title']).'] '.sprintf(l10n('%s has subscribed to comments on'), is_a_guest()?$email:$user['username']); 
     377  $subject = '['.strip_tags($conf['gallery_title']).'] '.sprintf(l10n('%s has subscribed to comments on %s.'), is_a_guest()?$email:$user['username'], null); 
    374378     
    375379  switch ($type) 
     
    401405  $template->assign('STC', array( 
    402406    'ELEMENT' => $element['on'], 
    403     'USER' => sprintf(l10n('%s has subscribed to comments on'), is_a_guest() ? '<b>'.$email.'</b>' : '<b>'.$user['username'].'</b> ('.$email.')'),  
     407    'USER' => is_a_guest() ? '<b>'.$email.'</b>' : '<b>'.$user['username'].'</b> ('.$email.')',  
    404408    'GALLERY_TITLE' => $conf['gallery_title'], 
    405409    'TECHNICAL' => implode('<br>', $technical_infos), 
     
    504508  $headers.= 'MIME-Version: 1.0'."\n"; 
    505509  $headers.= 'X-Mailer: Piwigo Mailer'."\n"; 
    506   // $headers.= 'Content-Transfer-Encoding: Quoted-Printable'."\n"; 
    507510  $headers.= 'Content-Transfer-Encoding: 8bit'."\n"; 
    508511  $headers.= 'Content-Type: text/html; charset="'.get_pwg_charset().'";'."\n"; 
     
    523526  $content = $template->parse('stc_mail_header', true) . $content . $template->parse('stc_mail_footer', true); 
    524527   
    525   // $content = quoted_printable_encode($content); 
    526   $content = wordwrap($content, 70, "\n", true); 
     528  $content = wordwrap($content, 70, "\n", false); 
    527529 
    528530  unset_make_full_url(); 
     
    687689 
    688690/** 
    689  * check if mail adress is valid 
    690  * @param: string email 
    691  * @return: bool 
    692  */ 
    693 if (!function_exists('is_valid_email')) 
    694 { 
    695   function is_valid_email($mail_address) 
    696   { 
    697     if (version_compare(PHP_VERSION, '5.2.0') >= 0) 
    698     { 
    699       return filter_var($mail_address, FILTER_VALIDATE_EMAIL)!==false; 
    700     } 
    701     else 
    702     { 
    703       $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase 
    704       $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 
    705       $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 
    706  
    707       if (!preg_match($regex, $mail_address)) return false; 
    708       return true; 
    709     } 
    710   } 
    711 } 
    712  
    713  
    714 /** 
    715691 * crypt a string using mcrypt extension or 
    716692 * http://stackoverflow.com/questions/800922/how-to-encrypt-string-without-mcrypt-library-in-php/802957#802957 
  • extensions/Subscribe_to_comments/include/subscribe_to_comments.inc.php

    r17350 r21340  
    77function stc_detect_section() 
    88{ 
    9   global $tokens, $page; 
     9  global $tokens, $page, $conf; 
    1010   
    1111  if ($tokens[0] == 'subscriptions') 
    1212  { 
     13    add_event_handler('loc_begin_page_header', 'stc_page_header'); 
     14     
    1315    $page['section'] = 'subscriptions'; 
    1416    $page['title'] = l10n('Comments notifications'); 
    15   } 
     17    $page['section_title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].l10n('Comments notifications'); 
     18  } 
     19} 
     20 
     21function stc_page_header() 
     22{ 
     23  global $page; 
     24  $page['body_id'] = 'theSubscriptionsPage'; 
    1625} 
    1726 
     
    4958        { 
    5059          case 'all-images': 
    51             subscribe_to_comments(@$_POST['stc_mail'], 'all-images'); 
     60            subscribe_to_comments(@$_POST['email'], 'all-images'); 
    5261            break; 
    5362          case 'album-images': 
    5463            if (empty($page['category']['id'])) break; 
    55             subscribe_to_comments(@$_POST['stc_mail'], 'album-images', $page['category']['id']); 
     64            subscribe_to_comments(@$_POST['email'], 'album-images', $page['category']['id']); 
    5665            break; 
    5766          case 'image': 
    58             subscribe_to_comments(@$_POST['stc_mail'], 'image', $comm['image_id']); 
     67            subscribe_to_comments(@$_POST['email'], 'image', $comm['image_id']); 
    5968            break; 
    6069        } 
     
    6574        { 
    6675          case 'all-albums': 
    67             subscribe_to_comments(@$_POST['stc_mail'], 'all-albums'); 
     76            subscribe_to_comments(@$_POST['email'], 'all-albums'); 
    6877            break; 
    6978          case 'album': 
    70             subscribe_to_comments(@$_POST['stc_mail'], 'album', $comm['category_id']); 
     79            subscribe_to_comments(@$_POST['email'], 'album', $comm['category_id']); 
    7180            break; 
    7281        } 
     
    7685    { 
    7786      $template->assign('STC_MODE', $_POST['stc_mode']); 
    78       $template->assign('STC_MAIL', @$_POST['stc_mail']); 
    7987    } 
    8088  } 
     
    239247  } 
    240248   
    241   $template->assign('STC_ON_PICTURE', true); 
    242   if ( !empty($page['category']['id']) ) $template->assign('STC_ALLOW_ALBUM_IMAGES', true); 
    243   if ( $conf['Subscribe_to_Comments']['allow_global_subscriptions'] or is_admin() ) $template->assign('STC_ALLOW_GLOBAL', true); 
     249  $template->assign(array( 
     250    'STC_ON_PICTURE' => true, 
     251    'STC_ALLOW_ALBUM_IMAGES' => !empty($page['category']['id']), 
     252    'STC_ALLOW_GLOBAL' => $conf['Subscribe_to_Comments']['allow_global_subscriptions'] || is_admin(), 
     253    'SUBSCRIBE_TO_PATH' => SUBSCRIBE_TO_PATH, 
     254    )); 
    244255   
    245256  $template->set_prefilter('picture', 'stc_main_prefilter'); 
     
    263274  } 
    264275   
     276        // standalone subscription 
    265277  if (isset($_POST['stc_submit'])) 
    266278  { 
     
    346358  } 
    347359   
    348   $template->assign('STC_ON_ALBUM', true); 
    349   if ( $conf['Subscribe_to_Comments']['allow_global_subscriptions'] or is_admin() ) $template->assign('STC_ALLOW_GLOBAL', true); 
     360  $template->assign(array( 
     361    'STC_ON_ALBUM' => true, 
     362    'STC_ALLOW_GLOBAL' => $conf['Subscribe_to_Comments']['allow_global_subscriptions'] || is_admin(), 
     363    'SUBSCRIBE_TO_PATH' => SUBSCRIBE_TO_PATH, 
     364    )); 
    350365 
    351366  $template->set_prefilter('comments_on_albums', 'stc_main_prefilter'); 
  • extensions/Subscribe_to_comments/include/subscribtions_page.inc.php

    r17494 r21340  
    55 
    66// check input parameters 
    7 $_GET['verif_key'] = $_GET['action'].$_GET['email'].(isset($_GET['id'])?$_GET['id']:null); 
    8  
    9 if (  
    10   empty($_GET['action']) or empty($_GET['email']) or empty($_GET['key']) 
    11   or decrypt_value($_GET['key'], $conf['secret_key']) !== $_GET['verif_key'] 
    12   ) 
     7if ( empty($_GET['action']) or empty($_GET['email']) or empty($_GET['key']) ) 
    138{ 
    149  $_GET['action'] = null; 
    1510} 
    1611else 
     12{ 
     13  $_GET['verif_key'] = $_GET['action'].$_GET['email'].(isset($_GET['id'])?$_GET['id']:null); 
     14 
     15  if ( decrypt_value($_GET['key'], $conf['secret_key']) !== $_GET['verif_key'] ) 
     16  { 
     17    $_GET['action'] = null; 
     18  } 
     19} 
     20 
     21 
     22 
     23if ( !empty($_GET['action']) ) 
    1724{ 
    1825  // unsubscribe all 
     
    2734   
    2835  // bulk action 
    29   if (isset($_POST['apply_bulk'])) 
     36  else if (isset($_POST['apply_bulk'])) 
    3037  { 
    3138    foreach ($_POST['selected'] as $id) 
     
    4451   
    4552  // unsubscribe from manage page 
    46   if (isset($_GET['unsubscribe'])) 
     53  else if (isset($_GET['unsubscribe'])) 
    4754  { 
    4855    if (un_subscribe_to_comments($_GET['email'], $_GET['unsubscribe'])) 
     
    5259    else 
    5360    { 
    54      array_push($page['errors'], l10n('Not found.')); 
     61      array_push($page['errors'], l10n('Not found.')); 
    5562    } 
    5663  } 
    5764   
    5865  // validate from manage page 
    59   if (isset($_GET['validate'])) 
     66  else if (isset($_GET['validate'])) 
    6067  { 
    6168    if (validate_subscriptions($_GET['email'], $_GET['validate'])) 
     
    7885  case 'validate': 
    7986  { 
    80     $query = ' 
    81 SELECT 
    82     type, 
    83     element_id 
     87    // don't need to sanitize inputs, already checked with the unique key 
     88    $query = ' 
     89SELECT type, element_id 
    8490  FROM '.SUBSCRIBE_TO_TABLE.' 
    8591  WHERE  
     
    238244 
    239245$template->assign(array( 
    240   'TITLE' => l10n('Subscriptions of').' <i>'.$_GET['email'].'</i>', 
    241246  'SUBSCRIBE_TO_PATH' => SUBSCRIBE_TO_PATH, 
    242247  'SUBSCRIBE_TO_ABS_PATH' => realpath(SUBSCRIBE_TO_PATH).'/', 
    243248  )); 
     249   
     250if (!empty($_GET['email'])) 
     251{ 
     252  $template->assign('TITLE', '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator']. 
     253                              sprintf(l10n('Subscriptions of %s'), '<i>'.$_GET['email'].'</i>')); 
     254} 
    244255 
    245256$template->set_filenames(array('index'=> dirname(__FILE__).'/../template/subscribtions_page.tpl')); 
  • extensions/Subscribe_to_comments/language/en_UK/plugin.lang.php

    r15648 r21340  
    22 
    33$lang['Comments notifications'] = 'Comments notifications'; 
    4  
    5 /* messages */ 
    64$lang['Invalid email adress, your are not subscribed to comments.'] = 'Invalid email adress, your are not subscribed to comments.'; 
    75$lang['Confirm your subscribtion to comments'] = 'Confirm your subscribtion to comments'; 
     
    1311$lang['Please check your email inbox to confirm your subscription.'] = 'Please check your email inbox to confirm your subscription.'; 
    1412$lang['You have been added to the list of subscribers.'] = 'You have been added to the list of subscribers.'; 
    15  
    16 /* sprintf */ 
    1713$lang['the picture <a href="%s">%s</a>'] = 'the picture <a href="%s">%s</a>'; 
    1814$lang['all pictures of the album <a href="%s">%s</a>'] = 'all pictures of the album <a href="%s">%s</a>'; 
    1915$lang['the album <a href="%s">%s</a>'] = 'the album <a href="%s">%s</a>'; 
    20 $lang['%s has subscribed to comments on'] = '%s has subscribed to comments on'; 
    21  
    22 /* config */ 
     16$lang['%s has subscribed to comments on %s.'] = '%s has subscribed to comments on %s.'; 
    2317$lang['Notify administrators when a user take a new subscription'] = 'Notify administrators when a user take a new subscription'; 
    2418$lang['Allow users to subscribe to global notifications'] = 'Allow users to subscribe to global notifications'; 
    25  
    26 /* comment form */ 
    2719$lang['Subscribe to mail notifications'] = 'Subscribe to mail notifications'; 
    2820$lang['Notify me of followup comments'] = 'Notify me of followup comments'; 
    29 $lang['You are currently subscribed to comments on'] =  'You are currently subscribed to comments on'; 
     21$lang['You are currently subscribed to comments on %s.'] = 'You are currently subscribed to comments on %s.'; 
    3022$lang['this picture'] = 'this picture'; 
    3123$lang['all pictures of this album'] = 'all pictures of this album'; 
     
    3325$lang['this album'] = 'this album'; 
    3426$lang['all albums of the gallery'] = 'all albums of the gallery'; 
    35  
    36 /* buttons */ 
    3727$lang['Manage my subscriptions'] = 'Manage my subscriptions'; 
    3828$lang['Subscribe'] = 'Subscribe'; 
     
    4030$lang['Validate'] = 'Validate'; 
    4131$lang['Confirm subscription'] = 'Confirm subscription'; 
    42  
    43 /* email */ 
    44 $lang['New subscription on'] = 'New subscription on'; 
    45 $lang['Subscribe to comments on'] = 'Subscribe to comments on'; 
    46 $lang['You requested to subscribe by email to comments on'] = 'You requested to subscribe by email to comments on'; 
     32$lang['Stop receiving notifications'] = 'Stop receiving notifications'; 
     33$lang['New subscription on %s'] = 'New subscription on %s'; 
     34$lang['Subscribe to comments on %s'] = 'Subscribe to comments on %s'; 
     35$lang['You requested to subscribe by email to comments on %s'] = 'You requested to subscribe by email to comments on %s'; 
    4736$lang['To activate, click the confirm button. If you believe this is an error, please just ignore this message.'] = 'To activate, click the confirm button. If you believe this is an error, please just ignore this message.'; 
    4837$lang['Want to edit your notifications options?'] = 'Want to edit your notifications options?'; 
    49 $lang['New comment on'] = 'New comment on'; 
    50  
    51 /* manage page */ 
    52 $lang['Subscriptions of'] = 'Subscriptions of'; 
     38$lang['New comment on %s'] = 'New comment on %s'; 
     39$lang['Subscriptions of %s'] = 'Subscriptions of %s'; 
    5340$lang['Return to item page'] = 'Return to item page'; 
     41$lang['Global subscriptions'] = 'Global subscriptions'; 
    5442$lang['Subject'] = 'Subject'; 
    5543$lang['Followed on'] = 'Followed on'; 
  • extensions/Subscribe_to_comments/main.inc.php

    r17923 r21340  
    1313global $prefixeTable; 
    1414 
    15 define('SUBSCRIBE_TO_PATH' , PHPWG_PLUGINS_PATH . 'Subscribe_to_Comments/'); 
    16 define('SUBSCRIBE_TO_TABLE', $prefixeTable . 'subscribe_to_comments'); 
    17 define('SUBSCRIBE_TO_VERSION', '2.0.3'); 
     15define('SUBSCRIBE_TO_PATH' ,   PHPWG_PLUGINS_PATH . 'Subscribe_to_Comments/'); 
     16define('SUBSCRIBE_TO_TABLE',   $prefixeTable . 'subscribe_to_comments'); 
     17define('SUBSCRIBE_TO_VERSION', 'auto'); 
    1818 
    1919 
     
    3030  // apply upgrade if needed 
    3131  if ( 
     32    SUBSCRIBE_TO_VERSION == 'auto' or 
    3233    $pwg_loaded_plugins['Subscribe_to_Comments']['version'] == 'auto' or 
    3334    version_compare($pwg_loaded_plugins['Subscribe_to_Comments']['version'], SUBSCRIBE_TO_VERSION, '<') 
     
    3738    stc_install(); 
    3839     
    39     if ($pwg_loaded_plugins['Subscribe_to_Comments']['version'] != 'auto') 
     40    if ( $pwg_loaded_plugins['Subscribe_to_Comments']['version'] != 'auto' and SUBSCRIBE_TO_VERSION != 'auto' ) 
    4041    { 
    4142      $query = ' 
  • extensions/Subscribe_to_comments/template/form_comment.tpl

    r15677 r21340  
    11{if !$SUBSCRIBED_ALL_IMAGES && !$SUBSCRIBED_ALL_ALBUMS && !$SUBSCRIBED_ALBUM && !$SUBSCRIBED_ALBUM_IMAGES && !$SUBSCRIBED_IMAGE} 
     2 
    23<p> 
    34  {'Notify me of followup comments'|@translate} :<br> 
     
    56  {if $STC_ON_PICTURE} 
    67    {if $STC_ALLOW_GLOBAL}  
    7       <label><input type="radio" name="stc_mode" value="image" {if $STC_MODE == "image"}checked="checked"{/if}> {'this picture'|@translate}</label> 
    8       {if $STC_ALLOW_ALBUM_IMAGES}<label><input type="radio" name="stc_mode" value="album-images" {if $STC_MODE == "album-images"}checked="checked"{/if}> {'all pictures of this album'|@translate}</label>{/if} 
    9       <label><input type="radio" name="stc_mode" value="all-images" {if $STC_MODE == "all-images"}checked="checked"{/if}> {'all pictures of the gallery'|@translate}</label> 
     8      <label><input type="radio" name="stc_mode" value="image" {if $STC_MODE=="image"}checked="checked"{/if}> {'this picture'|@translate}</label> 
     9      {if $STC_ALLOW_ALBUM_IMAGES}<label><input type="radio" name="stc_mode" value="album-images" {if $STC_MODE=="album-images"}checked="checked"{/if}> {'all pictures of this album'|@translate}</label>{/if} 
     10      <label><input type="radio" name="stc_mode" value="all-images" {if $STC_MODE=="all-images"}checked="checked"{/if}> {'all pictures of the gallery'|@translate}</label> 
    1011    {else} 
    11       <label><input type="radio" name="stc_mode" value="image" {if $STC_MODE == "image"}checked="checked"{/if}> {'Yes'|@translate}</label> 
     12      <label><input type="radio" name="stc_mode" value="image" {if $STC_MODE=="image"}checked="checked"{/if}> {'Yes'|@translate}</label> 
    1213    {/if} 
    1314  {elseif $STC_ON_ALBUM} 
    1415    {if $STC_ALLOW_GLOBAL} 
    15       <label><input type="radio" name="stc_mode" value="album" {if $STC_MODE == "album"}checked="checked"{/if}> {'this album'|@translate}</label> 
    16       <label><input type="radio" name="stc_mode" value="all-albums" {if $STC_MODE == "all-albums"}checked="checked"{/if}> {'all albums of the gallery'|@translate}</label> 
     16      <label><input type="radio" name="stc_mode" value="album" {if $STC_MODE=="album"}checked="checked"{/if}> {'this album'|@translate}</label> 
     17      <label><input type="radio" name="stc_mode" value="all-albums" {if $STC_MODE=="all-albums"}checked="checked"{/if}> {'all albums of the gallery'|@translate}</label> 
    1718    {else} 
    18       <label><input type="radio" name="stc_mode" value="album" {if $STC_MODE == "album"}checked="checked"{/if}> {'Yes'|@translate}</label> 
     19      <label><input type="radio" name="stc_mode" value="album" {if $STC_MODE=="album"}checked="checked"{/if}> {'Yes'|@translate}</label> 
    1920    {/if} 
    2021  {/if} 
     
    2223 
    2324{if $STC_ASK_MAIL} 
    24   <p><label id="stc_mail" {if !$STC_MODE}style="display:none;"{/if}>{'Email address'|@translate} : <input type="text" name="stc_mail" value="{$STC_MAIL}"></label></p> 
    25   {footer_script require="jquery"}{literal} 
    26   jQuery(document).ready(function() { 
    27     $("#addComment input[name='stc_mode']").change(function() { 
    28       if ($(this).val() != "-1") 
    29         $("#stc_mail").css("display", ""); 
    30       else 
    31         $("#stc_mail").css("display", "none"); 
    32     }); 
     25{footer_script require="jquery"}{literal} 
     26        var $stc_email_input = $("#addComment input[name='email']"); 
     27  var stc_bordercolor = $stc_email_input.css('border-color'); 
     28   
     29  $("#addComment input[name='stc_mode']").change(function() { 
     30    if ($(this).val() != "-1") { 
     31      if ($stc_email_input.val()=="") { 
     32        $stc_email_input.css("border-color", "red"); 
     33      } 
     34    } 
     35    else { 
     36      $stc_email_input.css("border-color", stc_bordercolor); 
     37    } 
    3338  }); 
    34   {/literal}{/footer_script} 
     39  $stc_email_input.change(function() { 
     40    $(this).css('border-color', stc_bordercolor); 
     41  }); 
     42{/literal}{/footer_script} 
    3543{/if} 
     44 
    3645{/if} 
  • extensions/Subscribe_to_comments/template/form_standalone.tpl

    r15648 r21340  
     1{combine_css path=$SUBSCRIBE_TO_PATH|@cat:'template/style_form.css'} 
     2 
     3{if $STC_ALLOW_GLOBAL} 
     4  {footer_script require="jquery"}{literal} 
     5  jQuery("#stc_submit").hide(); 
     6  jQuery("#stc_standalone input[name='stc_mode']").change(function() { 
     7    jQuery("#stc_submit").show(); 
     8  }); 
     9  {/literal}{/footer_script} 
     10{/if} 
     11 
    112{if isset($comment_add)} 
    213<div id="pictureCommentList"> 
    314<form method="post" action="{$comment_add.F_ACTION}" id="stc_standalone"> 
    4   <fieldset> 
     15  <fieldset>{strip} 
    516  {if $SUBSCRIBED_ALL_IMAGES} 
    6     {'You are currently subscribed to comments on'|@translate} {'all pictures of the gallery'|@translate}. 
     17    {'You are currently subscribed to comments on %s.'|@translate|sprintf:'all pictures of the gallery'|@translate} 
    718    <a href="{$MANAGE_LINK}">{'Manage my subscriptions'|@translate}</a>  
    819     
    920  {elseif $SUBSCRIBED_ALBUM_IMAGES} 
    10     {'You are currently subscribed to comments on'|@translate} {'all pictures of this album'|@translate}. 
     21    {'You are currently subscribed to comments on %s.'|@translate|sprintf:'all pictures of this album'|@translate} 
    1122    <a href="{$UNSUB_LINK}">{'Unsubscribe'|@translate}</a> 
    1223     
    1324  {elseif $SUBSCRIBED_IMAGE} 
    14     {'You are currently subscribed to comments on'|@translate} {'this picture'|@translate}. 
     25    {'You are currently subscribed to comments on %s.'|@translate|sprintf:'this picture'|@translate} 
    1526    <a href="{$UNSUB_LINK}">{'Unsubscribe'|@translate}</a> 
    1627     
    1728  {elseif $SUBSCRIBED_ALL_ALBUMS} 
    18     {'You are currently subscribed to comments on'|@translate} {'all albums of the gallery'|@translate}. 
     29    {'You are currently subscribed to comments on %s.'|@translate|sprintf:'all albums of the gallery'|@translate} 
    1930    <a href="{$MANAGE_LINK}">{'Manage my subscriptions'|@translate}</a> 
    2031     
    2132  {elseif $SUBSCRIBED_ALBUM} 
    22     {'You are currently subscribed to comments on'|@translate} {'this album'|@translate}. 
     33    {'You are currently subscribed to comments on %s.'|@translate|sprintf:'this album'|@translate} 
    2334    <a href="{$UNSUB_LINK}">{'Unsubscribe'|@translate}</a> 
    2435     
     
    4253    {/if} 
    4354    {if $STC_ALLOW_GLOBAL and $STC_ASK_MAIL}<br>{/if} 
     55    <span id="stc_submit"> 
    4456    {if $STC_ASK_MAIL} 
    45       <label>{'Email address'|@translate} <input type="text" name="stc_mail" size="30"></label> 
     57        <label>{'Email'|@translate} <input type="text" name="stc_mail" size="30"></label> 
    4658    {/if} 
    47     <label><input type="submit" name="stc_submit" value="{'Subscribe'|@translate}"></label> 
     59      <label><input type="submit" name="stc_submit" value="{'Subscribe'|@translate}"></label> 
     60    </span> 
    4861  {/if} 
    49   </fieldset> 
     62  {/strip}</fieldset> 
    5063</form> 
    5164</div> 
  • extensions/Subscribe_to_comments/template/mail/admin.tpl

    r15641 r21340  
    11<div id="the_header"> 
    2 {'New subscription on'|@translate} <b>{$STC.GALLERY_TITLE}</b> 
     2{'New subscription on %s'|@translate|sprintf:$STC.GALLERY_TITLE}</b> 
    33</div> 
    44 
     
    77<p> 
    88  {'Hi administrators,'|@translate}<br> 
    9   {$STC.USER} {$STC.ELEMENT}. 
     9  {'%s has subscribed to comments on %s.'|@translate|sprintf:$STC.USER:$STC.ELEMENT} 
    1010</p> 
    1111 
  • extensions/Subscribe_to_comments/template/mail/confirm.tpl

    r15648 r21340  
    11<div id="the_header"> 
    2 {'Subscribe to comments on'|@translate} <b>{$STC.GALLERY_TITLE}</b> 
     2{'Subscribe to comments on %s'|@translate|sprintf:$STC.GALLERY_TITLE}</b> 
    33</div> 
    44 
    55<div id="the_content"> 
    66 
    7 <p>{'You requested to subscribe by email to comments on'|@translate} {$STC.element.on}.</p> 
     7<p>{'You requested to subscribe by email to comments on %s'|@translate|sprintf:$STC.element.on}.</p> 
    88 
    99{if not empty($STC.element.thumbnail)} 
  • extensions/Subscribe_to_comments/template/mail/notification.tpl

    r15648 r21340  
    11<div id="the_header"> 
    2 {'New comment on'|@translate} <b>{$STC.GALLERY_TITLE}</b> 
     2{'New comment on %s'|@translate|sprintf:$STC.GALLERY_TITLE}</b> 
    33</div> 
    44 
  • extensions/Subscribe_to_comments/template/style.css

    r15641 r21340  
    2525  } 
    2626    .subscriptions_list tr .actions { 
    27       display:none; 
     27      visibility:hidden; 
    2828    } 
    2929    .subscriptions_list tr:hover .actions { 
    30       display:block; 
     30      visibility:visible; 
    3131    } 
    3232  .subscriptions_list td.date { 
     
    6868 
    6969 
    70  
    7170.stc p { 
    7271  text-align:center; 
  • extensions/Subscribe_to_comments/template/subscribtions_page.tpl

    r17494 r21340  
    3131        <td> 
    3232          {if $sub.type == 'all-images'} 
    33             <img src="{$ROOT_URL}{$SUBSCRIBE_TO_PATH}template/image.png"> {'You are currently subscribed to comments on all pictures of the gallery.'|@translate} 
     33            <img src="{$ROOT_URL}{$SUBSCRIBE_TO_PATH}template/image.png"> {'You are currently subscribed to comments on %s.'|@translate|sprintf:'all pictures of the gallery'|@translate} 
    3434          {else $sub.type == 'all-albums'} 
    35             <img src="{$ROOT_URL}{$SUBSCRIBE_TO_PATH}template/album.png"> {'You are currently subscribed to comments on all albums of the gallery.'|@translate} 
     35            <img src="{$ROOT_URL}{$SUBSCRIBE_TO_PATH}template/album.png"> {'You are currently subscribed to comments on %s.'|@translate|sprintf:'all albums of the gallery'|@translate} 
    3636          {/if} 
    3737        </td> 
    3838        <td style="white-space:nowrap;"> 
    39           <a href="{$MANAGE_LINK}&amp;unsubscribe={$sub.id}">{'Unsubscribe'|@translate}</a> 
    40           {if $sub.validated == 'false'}<br> <a href="{$MANAGE_LINK}&amp;validate={$sub.id}">{'Validate'|@translate}</a>{/if} 
     39          <div class="actions"> 
     40            <a href="{$MANAGE_LINK}&amp;unsubscribe={$sub.id}">{'Unsubscribe'|@translate}</a> 
     41            {if $sub.validated == 'false'}<br> <a href="{$MANAGE_LINK}&amp;validate={$sub.id}">{'Validate'|@translate}</a>{/if} 
     42          </div> 
    4143        </td> 
    4244        <td style="white-space:nowrap;"> 
     
    6163      {foreach from=$subscriptions item=sub name=subs_loop} 
    6264      <tr class="{if $smarty.foreach.subs_loop.index is odd}row1{else}row2{/if} {if $sub.validated == 'false'}not-validated{/if}"> 
    63         <td class="chkb"><input type="checkbox" name="selected[]" value="{$sub.id}"></td> 
    64         <td class="thumb"><img src="{$sub.infos.thumbnail}" alt="{$sub.infos.name}" class="thumbnail"></td> 
     65        <td class="chkb"><input type="checkbox" name="selected[]" value="{$sub.id}" id="sub-{$sub.id}"></td> 
     66        <td class="thumb"><label for="sub-{$sub.id}"><img src="{$sub.infos.thumbnail}" alt="{$sub.infos.name}" class="thumbnail"></label></td> 
    6567        <td class="info"> 
    6668          <img src="{$ROOT_URL}{$SUBSCRIBE_TO_PATH}template/{$sub.type}.png"> 
    67           <a href="{$sub.infos.url}">{$sub.infos.name}</a> 
     69          <b><a href="{$sub.infos.url}">{$sub.infos.name}</a></b> 
    6870 
    6971          <div class="actions"> 
     
    8991     
    9092    <p> 
    91       <b>Legend :</b>  
    9293      <img src="{$ROOT_URL}{$SUBSCRIBE_TO_PATH}template/image.png"> {'comments on a picture'|@translate}.  
    9394      <img src="{$ROOT_URL}{$SUBSCRIBE_TO_PATH}template/album-images.png"> {'comments on all pictures of an album'|@translate}. 
     
    101102      <label><input type="checkbox" name="unsubscribe_all_check" value="1"> {'Unsubscribe from all email notifications'|@translate}</label> 
    102103      <input type="submit" name="unsubscribe_all" value="{'Submit'|@translate}"> 
     104    </p> 
    103105  {/if} 
    104106</form> 
Note: See TracChangeset for help on using the changeset viewer.