Dotclear

Changeset 534


Ignore:
Timestamp:
10/23/08 22:41:04 (15 years ago)
Author:
Moe
google:author:
appears
Message:

Subscribe to comments 1.2.5 :

  • fixed bug with about:config :

added getSetting()
added update mechanism
moved format() to subscribeToComments library

  • fixed bug with _install.php and settings required not only for upgrades
  • fixed bug with empty post types setting
  • added new separator for titles
  • improved compatibility with myUrlHandlers
  • improved getPostTypes() to only show post types from the blog
  • removed auto-install, replaced it by added manual install
Location:
plugins/subscribeToComments
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • plugins/subscribeToComments/_define.php

    r511 r534  
    3030     /* Description*/                "Subscribe to comments", 
    3131     /* Author */                    "Moe (http://gniark.net/)", 
    32      /* Version */                   '1.2.4', 
     32     /* Version */                   '1.2.5', 
    3333     /* Permissions */               'admin' 
    3434); 
  • plugins/subscribeToComments/_install.php

    r511 r534  
    8282          $core->con->execute('DROP TABLE '.$core->prefix.'comment_notification;'); 
    8383     } 
     84      
     85     # serialize and encode settings 
     86     if (version_compare($i_version,'1.2.5','<')) 
     87     { 
     88          $values = array('account_subject','account_content', 
     89               'subscribe_subject','subscribe_content', 
     90               'comment_subject','comment_content', 
     91               'email_subject','email_content' 
     92          ); 
     93          $settings = $core->blog->settings; 
     94          foreach ($values as $k) 
     95          { 
     96               $setting = 'subscribetocomments_'.$k; 
     97               $cur = $core->con->openCursor($core->prefix.'setting'); 
     98               $cur->setting_value = base64_encode( 
     99                    serialize($settings->{$setting}) 
     100               ); 
     101               $cur->update('WHERE setting_ns = \'subscribetocomments\' '. 
     102                    'AND setting_id = \''.$setting.'\';'); 
     103          }          
     104     } 
    84105} 
     106 
    85107# add post types 
    86 if (version_compare($i_version,'1.2.4','<')) 
    87 { 
    88      $core->blog->settings->setNameSpace('subscribetocomments'); 
    89      # Allowed post types 
    90      $core->blog->settings->put('subscribetocomments_post_types', 
    91           serialize(subscribeToComments::getPostTypes()), 
    92           'string','Allowed post types',false,true); 
    93 } 
    94 # Change From: header of outbound emails 
    95 if (version_compare($i_version,'1.2.4','<')) 
    96 { 
    97      $core->blog->settings->setNameSpace('subscribetocomments'); 
    98      $core->blog->settings->put('subscribetocomments_email_from', 
    99           'dotclear@'.$_SERVER['HTTP_HOST'], 
    100           'string','Change From: header of outbound emails',false,true); 
    101 } 
     108$core->blog->settings->setNameSpace('subscribetocomments'); 
     109# Allowed post types 
     110$core->blog->settings->put('subscribetocomments_post_types', 
     111     serialize(subscribeToComments::getPostTypes()), 
     112     'string','Allowed post types',false,true); 
     113 
     114# Define From: header of outbound emails 
     115$core->blog->settings->setNameSpace('subscribetocomments'); 
     116$core->blog->settings->put('subscribetocomments_email_from', 
     117     'dotclear@'.$_SERVER['HTTP_HOST'], 
     118     'string','Define From: header of outbound emails',false,true); 
    102119 
    103120# table 
  • plugins/subscribeToComments/_prepend.php

    r511 r534  
    2929$__autoload['subscriber'] = dirname(__FILE__).'/class.subscriber.php'; 
    3030 
     31$core->url->register('subscribetocomments','subscribetocomments', 
     32     '^subscribetocomments(/.+)?$',array('subscribeToCommentsDocument','page')); 
     33 
    3134?> 
  • plugins/subscribeToComments/_public.php

    r501 r534  
    3535          'subscribeToCommentsIsActive'); 
    3636 
     37 
     38# load locales for the blog language 
     39l10n::set(dirname(__FILE__).'/locales/'.$core->blog->settings->lang.'/public'); 
     40 
     41/** 
     42@ingroup Subscribe to comments 
     43@brief Document 
     44*/ 
     45class subscribeToCommentsDocument extends dcUrlHandlers 
     46{ 
     47     /** 
     48     serve the document 
     49     */ 
     50     public static function page() 
     51     { 
     52          global $core; 
     53 
     54          if (!$core->blog->settings->subscribetocomments_active) {self::p404();} 
     55           
     56          $session_id = session_id(); 
     57          if (empty($session_id)) {session_start();} 
     58           
     59          $_ctx =& $GLOBALS['_ctx']; 
     60 
     61          try { 
     62               subscribeToComments::cleanKeys(); 
     63 
     64               if (((isset($_GET['post_id']))) && (!is_numeric($_GET['post_id']))) 
     65               { 
     66                    throw new Exception(__('Invalid post ID.')); 
     67               } 
     68 
     69               if (isset($_POST['logout'])) { 
     70                    subscriber::checkNonce(); 
     71                    subscriber::logout(); 
     72                    subscribeToComments::redirect('loggedout'); 
     73               } 
     74               # login with key 
     75               elseif ((isset($_GET['email'])) AND (isset($_GET['key']))) 
     76               { 
     77                    subscribeToComments::checkEmail($_GET['email']); 
     78                    subscribeToComments::checkKey($_GET['key']); 
     79                    subscriber::loginKey($_GET['email'],$_GET['key']); 
     80                    subscribeToComments::redirect('loggedin'); 
     81               } 
     82               # subscribe 
     83               elseif ((isset($_POST['subscribe'])) AND (isset($_POST['post_id']))) 
     84               { 
     85                    subscriber::checkNonce(); 
     86                    if (isset($_POST['email'])) 
     87                    { 
     88                         subscribeToComments::checkEmail($_POST['email']); 
     89                         $email = $_POST['email']; 
     90                    } 
     91                    elseif (subscriber::checkCookie()) 
     92                    { 
     93                         $email = subscriber::getCookie('email'); 
     94                    } 
     95                    if (!empty($email)) 
     96                    { 
     97                         $subscriber = new subscriber($email); 
     98                         $subscriber->subscribe($_POST['post_id']); 
     99                         subscribeToComments::redirect('subscribed'); 
     100                    } 
     101               } 
     102               # request account informations 
     103               elseif ((isset($_POST['resend'])) AND (isset($_POST['email']))) 
     104               { 
     105                    subscriber::checkNonce(); 
     106                    subscribeToComments::checkEmail($_POST['email']); 
     107                    subscriber::resendInformations($_POST['email']); 
     108                    subscribeToComments::redirect('informationsresent'); 
     109               } 
     110               # update the email address 
     111               elseif ((isset($_GET['new_email'])) AND (isset($_GET['temp_key']))) 
     112               { 
     113                    subscribeToComments::checkEmail($_GET['new_email']); 
     114                    subscribeToComments::checkKey($_GET['temp_key']); 
     115                    subscriber::updateEmail($_GET['new_email'],$_GET['temp_key']); 
     116                    subscribeToComments::redirect('updatedemail'); 
     117               } 
     118 
     119               # messages 
     120               $_ctx->subscribeToCommentsMessage = null;  
     121               if (isset($_GET['message'])) 
     122               { 
     123                    $messages = array( 
     124                     'informationsresent' => __('Account informations sent'), 
     125                     'removedsubscriptions' => __('Subscriptions removed'), 
     126                     'loggedout' => __('Logged out'), 
     127                     'loggedin' => __('Logged in'), 
     128                     'emailsblocked' => __('Emails blocked'), 
     129                     'emailsallowed' => __('Emails allowed'), 
     130                     'requestsent' =>  
     131                         __('An email has been sent to the new email address'), 
     132                     'updatedemail' => __('Email address changed'), 
     133                     'accountdeleted' => __('Account deleted'), 
     134                     'subscribed' => __('Subscribed to the entry') 
     135                  ); 
     136                    if (array_key_exists($_GET['message'],$messages)) 
     137                    { 
     138                         $_ctx->subscribeToCommentsMessage = $messages[$_GET['message']]; 
     139                    } 
     140               } 
     141 
     142               # email address 
     143               $_ctx->subscribeToCommentsEmail = ''; 
     144               if (isset($_COOKIE['comment_info'])) 
     145               { 
     146                    $_ctx->subscribeToCommentsEmail = explode("\n",$_COOKIE['comment_info']); 
     147                    $_ctx->subscribeToCommentsEmail = $_ctx->subscribeToCommentsEmail['1']; 
     148               } 
     149 
     150               # subscriber is logged in 
     151               if (subscriber::checkCookie()) 
     152               { 
     153                    $subscriber = new subscriber(subscriber::getCookie('email')); 
     154                    $_ctx->subscribeToCommentsEmail = $subscriber->email; 
     155      
     156                    if ((isset($_POST['requestChangeEmail'])) AND (isset($_POST['new_email']))) 
     157                    { 
     158                         subscriber::checkNonce(); 
     159                         subscribeToComments::checkEmail($_POST['new_email']); 
     160                         $subscriber->requestUpdateEmail($_POST['new_email']); 
     161                         subscribeToComments::redirect('requestsent');      
     162                    } 
     163                    elseif ((isset($_POST['remove'])) AND (isset($_POST['entries']))) 
     164                    { 
     165                         subscriber::checkNonce(); 
     166                         $subscriber->removeSubscription($_POST['entries']); 
     167                         subscribeToComments::redirect('removedsubscriptions'); 
     168                    } 
     169                    elseif (isset($_POST['deleteAccount'])) { 
     170                         subscriber::checkNonce(); 
     171                         $subscriber->deleteAccount(); 
     172                         subscribeToComments::redirect('accountdeleted'); 
     173                    } 
     174                    elseif (isset($_POST['blockEmails'])) { 
     175                         subscriber::checkNonce(); 
     176                         $subscriber->blockEmails(true); 
     177                         subscribeToComments::redirect('emailsblocked'); 
     178                    } 
     179                    elseif (isset($_POST['allowEmails'])) { 
     180                         subscriber::checkNonce(); 
     181                         $subscriber->blockEmails(false); 
     182                         subscribeToComments::redirect('emailsallowed'); 
     183                    } 
     184               } 
     185          } 
     186          catch (Exception $e) 
     187          { 
     188               $_ctx->subscribeToCommentsError = $e->getMessage(); 
     189          } 
     190 
     191          $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'); 
     192 
     193          self::serveDocument('subscribetocomments.html','text/html',false,false); 
     194     } 
     195} 
     196 
     197/** 
     198@ingroup Subscribe to comments 
     199@brief Template 
     200*/ 
     201class subscribeToCommentsTpl 
     202{ 
     203     /** 
     204     check the box on post.html if a cookie is present 
     205     @return   <b>string</b> PHP block 
     206     */ 
     207     public static function formChecked() 
     208     { 
     209          return("<?php ". 
     210          "if (isset(\$_POST['subscribeToComments'])) {echo(' checked=\"checked\" ');}". 
     211          "elseif (isset(\$_COOKIE['subscribetocomments']))". 
     212          "{echo(' checked=\"checked\" ');}". 
     213          " ?>"); 
     214     } 
     215 
     216     /** 
     217     get link from post.html to subscriptions page 
     218     @return   <b>string</b> text and PHP block 
     219     */ 
     220     public static function formLink() 
     221     { 
     222          global $core; 
     223 
     224          if ($core->blog->settings->subscribetocomments_active) 
     225          { 
     226               return("<?php echo(subscribeToComments::url().". 
     227               "((\$core->blog->settings->url_scan == 'query_string') ? '&amp;' : '?').". 
     228               "'post_id='.\$_ctx->posts->post_id); ?>"); 
     229          } 
     230     } 
     231 
     232     /** 
     233     if there is an error 
     234     @param    attr <b>array</b>   Attribute 
     235     @param    content   <b>string</b>  Content 
     236     @return   <b>string</b> PHP block 
     237     */ 
     238     public static function ifError($attr,$content) 
     239     { 
     240          return 
     241          "<?php if (\$_ctx->subscribeToCommentsError !== null) : ?>"."\n". 
     242          $content. 
     243          "<?php endif; ?>"; 
     244     } 
     245 
     246     /** 
     247     display an error 
     248     @return   <b>string</b> PHP block 
     249     */ 
     250     public static function error() 
     251     { 
     252          return("<?php if (\$_ctx->subscribeToCommentsError !== null) :"."\n". 
     253          "echo(\$_ctx->subscribeToCommentsError);". 
     254          "endif; ?>"); 
     255     } 
     256 
     257      
     258     /** 
     259     if there is a message 
     260     @param    attr <b>array</b>   Attribute 
     261     @param    content   <b>string</b>  Content 
     262     @return   <b>string</b> PHP block 
     263     */ 
     264     public static function ifMessage($attr,$content) 
     265     { 
     266          return 
     267          "<?php if (\$_ctx->subscribeToCommentsMessage !== null) : ?>"."\n". 
     268          $content. 
     269          "<?php endif; ?>"; 
     270     } 
     271 
     272     /** 
     273     display a message 
     274     @return   <b>string</b> PHP block 
     275     */ 
     276     public static function message() 
     277     { 
     278          return("<?php if (\$_ctx->subscribeToCommentsMessage !== null) :"."\n". 
     279          "echo(\$_ctx->subscribeToCommentsMessage);". 
     280          "endif; ?>"); 
     281     } 
     282 
     283     /** 
     284     get nonce 
     285     @return   <b>string</b> Nonce 
     286     */ 
     287     public static function getNonce() 
     288     { 
     289          return "<?php echo(crypt::hmac(DC_MASTER_KEY,session_id())); ?>"; 
     290     } 
     291 
     292     /** 
     293     if it's a post 
     294     @param    attr <b>array</b>   Attribute 
     295     @param    content   <b>string</b>  Content 
     296     @return   <b>string</b> PHP block 
     297     */ 
     298     public static function entryIf($attr,$content) 
     299     { 
     300          return 
     301          "<?php if ((isset(\$_GET['post_id'])) AND ". 
     302          "(is_numeric(\$_GET['post_id']))) : "."\n". 
     303          "\$_ctx->posts = \$core->blog->getPosts(". 
     304          "array('no_content' => true, 'post_id' => \$_GET['post_id'],". 
     305          "'post_open_comment' => 1,". 
     306          "'post_type' => subscribeToComments::getAllowedPostTypes())". 
     307          "); "."\n". 
     308          "if (!\$_ctx->posts->isEmpty()) : ?>"."\n". 
     309          $content. 
     310          "<?php unset(\$_ctx->posts); ". 
     311          "endif;"."\n". 
     312          "endif; ?>"; 
     313     } 
     314 
     315     /** 
     316     if user is not logged in 
     317     @param    attr <b>array</b>   Attribute 
     318     @param    content   <b>string</b>  Content 
     319     @return   <b>string</b> PHP block 
     320     */ 
     321     public static function loggedIfNot($attr,$content) 
     322     { 
     323          return('<?php if (!subscriber::checkCookie()) : ?>'."\n". 
     324          $content."\n". 
     325          "<?php endif; ?>"); 
     326     } 
     327 
     328     /** 
     329     if user is logged in 
     330     @param    attr <b>array</b>   Attribute 
     331     @param    content   <b>string</b>  Content 
     332     @return   <b>string</b> PHP block 
     333     */ 
     334     public static function loggedIf($attr,$content) 
     335     { 
     336          return('<?php if (subscriber::checkCookie()) : ?>'."\n". 
     337          $content."\n". 
     338          "<?php endif; ?>"); 
     339     } 
     340 
     341     /** 
     342     if user is not blocked 
     343     @param    attr <b>array</b>   Attribute 
     344     @param    content   <b>string</b>  Content 
     345     @return   <b>string</b> PHP block 
     346     */ 
     347     public static function blockedIfNot($attr,$content) 
     348     { 
     349          return('<?php if (!subscriber::blocked()) : ?>'."\n". 
     350          $content."\n". 
     351          "<?php endif; ?>"); 
     352     } 
     353 
     354     /** 
     355     if user is blocked 
     356     @param    attr <b>array</b>   Attribute 
     357     @param    content   <b>string</b>  Content 
     358     @return   <b>string</b> PHP block 
     359     */ 
     360     public static function blockedIf($attr,$content) 
     361     { 
     362          return('<?php if (subscriber::blocked()) : ?>'."\n". 
     363          $content."\n". 
     364          "<?php endif; ?>"); 
     365     } 
     366 
     367     /** 
     368     loop on posts 
     369     @param    attr <b>array</b>   Attribute 
     370     @param    content   <b>string</b>  Content 
     371     @return   <b>string</b> PHP block 
     372     */ 
     373     public static function entries($attr,$content) 
     374     { 
     375          return("<?php ". 
     376          '$_ctx->meta = new dcMeta($core);'. 
     377          "\$_ctx->posts = \$_ctx->meta->getPostsByMeta(array(". 
     378          "'meta_type' => 'subscriber','meta_id' => ". 
     379          "subscriber::getCookie('id'),". 
     380          "'no_content' => true,". 
     381          "'post_type' => subscribeToComments::getAllowedPostTypes()));". 
     382          "if (!\$_ctx->posts->isEmpty()) :"."\n". 
     383          "while (\$_ctx->posts->fetch()) : ?>"."\n". 
     384          $content. 
     385          "<?php endwhile; "."\n". 
     386          " endif;"."\n". 
     387          'unset($_ctx->meta);'. 
     388          "unset(\$_ctx->posts); ?>"); 
     389     } 
     390 
     391     /** 
     392     get email address 
     393     @return   <b>string</b> PHP block 
     394     */ 
     395     public static function email() 
     396     { 
     397          return('<?php echo($_ctx->subscribeToCommentsEmail); ?>');   
     398     } 
     399 
     400     /** 
     401     get the URL of the subscriptions page 
     402     @return   <b>string</b> URL 
     403     */ 
     404     public static function url() 
     405     { 
     406          return("<?php echo(subscribeToComments::url()); ?>"); 
     407     } 
     408 
     409     /** 
     410     display checkbox to subscribe to comments 
     411     */ 
     412     public static function publicCommentFormAfterContent() 
     413     { 
     414          global $_ctx; 
     415 
     416          if (subscribeToComments::getPost($_ctx->posts->post_id) == false) 
     417          {return;} 
     418 
     419          $checked = null; 
     420 
     421          # if checkbox is unchecked, don't check it 
     422          if (isset($_POST['subscribeToComments'])) 
     423               {$checked = true;} 
     424          elseif (isset($_COOKIE['subscribetocomments'])) 
     425               {$checked = true;} 
     426          if ($checked) {$checked =  ' checked="checked" ';} 
     427 
     428          $logged =  
     429          (subscriber::checkCookie()) 
     430          ? 
     431               $logged = ' (<strong><a href="'.subscribeToComments::url().'">'. 
     432                    __('Logged in').'</a></strong>)' 
     433          : ''; 
     434 
     435          echo '<p>'. 
     436          '<input type="checkbox" name="subscribeToComments" '. 
     437          'id="subscribeToComments"'.$checked.' />'. 
     438          '<label for="subscribeToComments">'. 
     439          __('Receive following comments by email').'</label>'. 
     440          $logged. 
     441          '</p>'; 
     442     } 
     443      
     444     /** 
     445     display a CSS rule for default themes 
     446     */ 
     447     public static function publicHeadContent() 
     448     { 
     449          echo '<style type="text/css" media="screen">'."\n". 
     450          '#comment-form #subscribeToComments '. 
     451          '{width:auto;border:0;margin:0 5px 0 140px;}'."\n". 
     452          '</style>'; 
     453     } 
     454 
     455     /** 
     456     add tpl code after the <tpl:EntryIf comments_active="1">...</tpl:EntryIf> tag 
     457     @param    core <b>core</b>    Dotclear core 
     458     @param    b    <b>array</b>   tag 
     459     @param    attr <b>array</b>   attributes 
     460     */ 
     461     public static function templateAfterBlock(&$core,$b,$attr) 
     462     { 
     463          global $_ctx; 
     464 
     465          if ($core->url->type == 'feed') {return;} 
     466 
     467          if ($b == 'EntryIf' && isset($attr['comments_active']) 
     468               && $attr['comments_active'] == 1 && !isset($attr['pings_active'])) 
     469          { 
     470               if ((!is_numeric($_ctx->posts->post_id)) OR 
     471               (subscribeToComments::getPost($_ctx->posts->post_id) == false)) 
     472               { 
     473                    return; 
     474               } 
     475               # else 
     476               return  
     477               '<?php if (($core->blog->settings->subscribetocomments_active) && 
     478                    $_ctx->posts->commentsActive()) : ?> 
     479                    <div id="subscribetocomments_block"> 
     480                         <h3><?php echo __("Subscribe to comments"); ?></h3> 
     481                         <p> 
     482                              <a href="<?php echo(subscribeToComments::url(). 
     483                              (($core->blog->settings->url_scan == "query_string") ? "&amp;" : "?"). 
     484                              "post_id=".$_ctx->posts->post_id); ?>"> 
     485                                   <!-- # If the subscriber is logged in --> 
     486                                   <?php if (subscriber::checkCookie()) : ?> 
     487                                        <?php echo __("Subscribe to receive following comments by email or manage subscriptions"); ?> 
     488                                   <?php endif; ?> 
     489                                   <!-- # If the subscriber is not logged in --> 
     490                                   <?php if (!subscriber::checkCookie()) : ?> 
     491                                        <?php echo __("Subscribe to receive following comments by email"); ?> 
     492                                   <?php endif; ?> 
     493                              </a> 
     494                         </p> 
     495                    </div> 
     496               <?php endif; ?>'; 
     497               # strings 
     498               __("Subscribe to receive following comments by email or manage subscriptions"); 
     499               __("Subscribe to receive following comments by email"); 
     500          } 
     501     } 
     502} 
     503 
    37504if ($core->blog->settings->subscribetocomments_active) 
    38505{ 
    39      # load locales for the blog language 
    40      l10n::set(dirname(__FILE__).'/locales/'.$core->blog->settings->lang.'/public'); 
    41  
    42      /** 
    43      @ingroup Subscribe to comments 
    44      @brief Document 
    45      */ 
    46      class subscribeToCommentsDocument extends dcUrlHandlers 
    47      { 
    48           /** 
    49           serve the document 
    50           */ 
    51           public static function page() 
    52           { 
    53                global $core; 
    54  
    55                $session_id = session_id(); 
    56                if (empty($session_id)) {session_start();} 
    57                 
    58                $_ctx =& $GLOBALS['_ctx']; 
    59  
    60                try { 
    61                     subscribeToComments::cleanKeys(); 
    62       
    63                     if (((isset($_GET['post_id']))) && (!is_numeric($_GET['post_id']))) 
    64                     { 
    65                          throw new Exception(__('Invalid post ID.')); 
    66                     } 
    67       
    68                     if (isset($_POST['logout'])) { 
    69                          subscriber::checkNonce(); 
    70                          subscriber::logout(); 
    71                          subscribeToComments::redirect('loggedout'); 
    72                     } 
    73                     # login with key 
    74                     elseif ((isset($_GET['email'])) AND (isset($_GET['key']))) 
    75                     { 
    76                          subscribeToComments::checkEmail($_GET['email']); 
    77                          subscribeToComments::checkKey($_GET['key']); 
    78                          subscriber::loginKey($_GET['email'],$_GET['key']); 
    79                          subscribeToComments::redirect('loggedin'); 
    80                     } 
    81                     # subscribe 
    82                     elseif ((isset($_POST['subscribe'])) AND (isset($_POST['post_id']))) 
    83                     { 
    84                          subscriber::checkNonce(); 
    85                          if (isset($_POST['email'])) 
    86                          { 
    87                               subscribeToComments::checkEmail($_POST['email']); 
    88                               $email = $_POST['email']; 
    89                          } 
    90                          elseif (subscriber::checkCookie()) 
    91                          { 
    92                               $email = subscriber::getCookie('email'); 
    93                          } 
    94                          if (!empty($email)) 
    95                          { 
    96                               $subscriber = new subscriber($email); 
    97                               $subscriber->subscribe($_POST['post_id']); 
    98                               subscribeToComments::redirect('subscribed'); 
    99                          } 
    100                     } 
    101                     # request account informations 
    102                     elseif ((isset($_POST['resend'])) AND (isset($_POST['email']))) 
    103                     { 
    104                          subscriber::checkNonce(); 
    105                          subscribeToComments::checkEmail($_POST['email']); 
    106                          subscriber::resendInformations($_POST['email']); 
    107                          subscribeToComments::redirect('informationsresent'); 
    108                     } 
    109                     # update the email address 
    110                     elseif ((isset($_GET['new_email'])) AND (isset($_GET['temp_key']))) 
    111                     { 
    112                          subscribeToComments::checkEmail($_GET['new_email']); 
    113                          subscribeToComments::checkKey($_GET['temp_key']); 
    114                          subscriber::updateEmail($_GET['new_email'],$_GET['temp_key']); 
    115                          subscribeToComments::redirect('updatedemail'); 
    116                     } 
    117  
    118                     # messages 
    119                     $_ctx->subscribeToCommentsMessage = null;  
    120                     if (isset($_GET['message'])) 
    121                     { 
    122                          $messages = array( 
    123                           'informationsresent' => __('Account informations sent'), 
    124                           'removedsubscriptions' => __('Subscriptions removed'), 
    125                           'loggedout' => __('Logged out'), 
    126                           'loggedin' => __('Logged in'), 
    127                           'emailsblocked' => __('Emails blocked'), 
    128                           'emailsallowed' => __('Emails allowed'), 
    129                           'requestsent' =>  
    130                               __('An email has been sent to the new email address'), 
    131                           'updatedemail' => __('Email address changed'), 
    132                           'accountdeleted' => __('Account deleted'), 
    133                           'subscribed' => __('Subscribed to the entry') 
    134                        ); 
    135                          if (array_key_exists($_GET['message'],$messages)) 
    136                          { 
    137                               $_ctx->subscribeToCommentsMessage = $messages[$_GET['message']]; 
    138                          } 
    139                     } 
    140  
    141                     # email address 
    142                     $_ctx->subscribeToCommentsEmail = ''; 
    143                     if (isset($_COOKIE['comment_info'])) 
    144                     { 
    145                          $_ctx->subscribeToCommentsEmail = explode("\n",$_COOKIE['comment_info']); 
    146                          $_ctx->subscribeToCommentsEmail = $_ctx->subscribeToCommentsEmail['1']; 
    147                     } 
    148  
    149                     # subscriber is logged in 
    150                     if (subscriber::checkCookie()) 
    151                     { 
    152                          $subscriber = new subscriber(subscriber::getCookie('email')); 
    153                          $_ctx->subscribeToCommentsEmail = $subscriber->email; 
    154            
    155                          if ((isset($_POST['requestChangeEmail'])) AND (isset($_POST['new_email']))) 
    156                          { 
    157                               subscriber::checkNonce(); 
    158                               subscribeToComments::checkEmail($_POST['new_email']); 
    159                               $subscriber->requestUpdateEmail($_POST['new_email']); 
    160                               subscribeToComments::redirect('requestsent');      
    161                          } 
    162                          elseif ((isset($_POST['remove'])) AND (isset($_POST['entries']))) 
    163                          { 
    164                               subscriber::checkNonce(); 
    165                               $subscriber->removeSubscription($_POST['entries']); 
    166                               subscribeToComments::redirect('removedsubscriptions'); 
    167                          } 
    168                          elseif (isset($_POST['deleteAccount'])) { 
    169                               subscriber::checkNonce(); 
    170                               $subscriber->deleteAccount(); 
    171                               subscribeToComments::redirect('accountdeleted'); 
    172                          } 
    173                          elseif (isset($_POST['blockEmails'])) { 
    174                               subscriber::checkNonce(); 
    175                               $subscriber->blockEmails(true); 
    176                               subscribeToComments::redirect('emailsblocked'); 
    177                          } 
    178                          elseif (isset($_POST['allowEmails'])) { 
    179                               subscriber::checkNonce(); 
    180                               $subscriber->blockEmails(false); 
    181                               subscribeToComments::redirect('emailsallowed'); 
    182                          } 
    183                     } 
    184                } 
    185                catch (Exception $e) 
    186                { 
    187                     $_ctx->subscribeToCommentsError = $e->getMessage(); 
    188                } 
    189  
    190                $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'); 
    191  
    192                self::serveDocument('subscribetocomments.html','text/html',false,false); 
    193           } 
    194      } 
    195  
    196      /** 
    197      @ingroup Subscribe to comments 
    198      @brief Template 
    199      */ 
    200      class subscribeToCommentsTpl 
    201      { 
    202           /** 
    203           check the box on post.html if a cookie is present 
    204           @return   <b>string</b> PHP block 
    205           */ 
    206           public static function formChecked() 
    207           { 
    208                return("<?php ". 
    209                "if (isset(\$_POST['subscribeToComments'])) {echo(' checked=\"checked\" ');}". 
    210                "elseif (isset(\$_COOKIE['subscribetocomments']))". 
    211                "{echo(' checked=\"checked\" ');}". 
    212                " ?>"); 
    213           } 
    214       
    215           /** 
    216           get link from post.html to subscriptions page 
    217           @return   <b>string</b> text and PHP block 
    218           */ 
    219           public static function formLink() 
    220           { 
    221                global $core; 
    222       
    223                if ($core->blog->settings->subscribetocomments_active) 
    224                { 
    225                     return("<?php echo(subscribeToComments::url().". 
    226                     "((\$core->blog->settings->url_scan == 'query_string') ? '&amp;' : '?').". 
    227                     "'post_id='.\$_ctx->posts->post_id); ?>"); 
    228                } 
    229           } 
    230  
    231           /** 
    232           if there is an error 
    233           @param    attr <b>array</b>   Attribute 
    234           @param    content   <b>string</b>  Content 
    235           @return   <b>string</b> PHP block 
    236           */ 
    237           public static function ifError($attr,$content) 
    238           { 
    239                return 
    240                "<?php if (\$_ctx->subscribeToCommentsError !== null) : ?>"."\n". 
    241                $content. 
    242                "<?php endif; ?>"; 
    243           } 
    244  
    245           /** 
    246           display an error 
    247           @return   <b>string</b> PHP block 
    248           */ 
    249           public static function error() 
    250           { 
    251                return("<?php if (\$_ctx->subscribeToCommentsError !== null) :"."\n". 
    252                "echo(\$_ctx->subscribeToCommentsError);". 
    253                "endif; ?>"); 
    254           } 
    255  
    256            
    257           /** 
    258           if there is a message 
    259           @param    attr <b>array</b>   Attribute 
    260           @param    content   <b>string</b>  Content 
    261           @return   <b>string</b> PHP block 
    262           */ 
    263           public static function ifMessage($attr,$content) 
    264           { 
    265                return 
    266                "<?php if (\$_ctx->subscribeToCommentsMessage !== null) : ?>"."\n". 
    267                $content. 
    268                "<?php endif; ?>"; 
    269           } 
    270  
    271           /** 
    272           display a message 
    273           @return   <b>string</b> PHP block 
    274           */ 
    275           public static function message() 
    276           { 
    277                return("<?php if (\$_ctx->subscribeToCommentsMessage !== null) :"."\n". 
    278                "echo(\$_ctx->subscribeToCommentsMessage);". 
    279                "endif; ?>"); 
    280           } 
    281  
    282           /** 
    283           get nonce 
    284           @return   <b>string</b> Nonce 
    285           */ 
    286           public static function getNonce() 
    287           { 
    288                return "<?php echo(crypt::hmac(DC_MASTER_KEY,session_id())); ?>"; 
    289           } 
    290  
    291           /** 
    292           if it's a post 
    293           @param    attr <b>array</b>   Attribute 
    294           @param    content   <b>string</b>  Content 
    295           @return   <b>string</b> PHP block 
    296           */ 
    297           public static function entryIf($attr,$content) 
    298           { 
    299                return 
    300                "<?php if ((isset(\$_GET['post_id'])) AND ". 
    301                "(is_numeric(\$_GET['post_id']))) : "."\n". 
    302                "\$_ctx->posts = \$core->blog->getPosts(". 
    303                "array('no_content' => true, 'post_id' => \$_GET['post_id'],". 
    304                "'post_open_comment' => 1,". 
    305                "'post_type' => subscribeToComments::getAllowedPostTypes())". 
    306                "); "."\n". 
    307                "if (!\$_ctx->posts->isEmpty()) : ?>"."\n". 
    308                $content. 
    309                "<?php unset(\$_ctx->posts); ". 
    310                "endif;"."\n". 
    311                "endif; ?>"; 
    312           } 
    313       
    314           /** 
    315           if user is not logged in 
    316           @param    attr <b>array</b>   Attribute 
    317           @param    content   <b>string</b>  Content 
    318           @return   <b>string</b> PHP block 
    319           */ 
    320           public static function loggedIfNot($attr,$content) 
    321           { 
    322                return('<?php if (!subscriber::checkCookie()) : ?>'."\n". 
    323                $content."\n". 
    324                "<?php endif; ?>"); 
    325           } 
    326       
    327           /** 
    328           if user is logged in 
    329           @param    attr <b>array</b>   Attribute 
    330           @param    content   <b>string</b>  Content 
    331           @return   <b>string</b> PHP block 
    332           */ 
    333           public static function loggedIf($attr,$content) 
    334           { 
    335                return('<?php if (subscriber::checkCookie()) : ?>'."\n". 
    336                $content."\n". 
    337                "<?php endif; ?>"); 
    338           } 
    339  
    340           /** 
    341           if user is not blocked 
    342           @param    attr <b>array</b>   Attribute 
    343           @param    content   <b>string</b>  Content 
    344           @return   <b>string</b> PHP block 
    345           */ 
    346           public static function blockedIfNot($attr,$content) 
    347           { 
    348                return('<?php if (!subscriber::blocked()) : ?>'."\n". 
    349                $content."\n". 
    350                "<?php endif; ?>"); 
    351           } 
    352  
    353           /** 
    354           if user is blocked 
    355           @param    attr <b>array</b>   Attribute 
    356           @param    content   <b>string</b>  Content 
    357           @return   <b>string</b> PHP block 
    358           */ 
    359           public static function blockedIf($attr,$content) 
    360           { 
    361                return('<?php if (subscriber::blocked()) : ?>'."\n". 
    362                $content."\n". 
    363                "<?php endif; ?>"); 
    364           } 
    365  
    366           /** 
    367           loop on posts 
    368           @param    attr <b>array</b>   Attribute 
    369           @param    content   <b>string</b>  Content 
    370           @return   <b>string</b> PHP block 
    371           */ 
    372           public static function entries($attr,$content) 
    373           { 
    374                return("<?php ". 
    375                '$_ctx->meta = new dcMeta($core);'. 
    376                "\$_ctx->posts = \$_ctx->meta->getPostsByMeta(array(". 
    377                "'meta_type' => 'subscriber','meta_id' => ". 
    378                "subscriber::getCookie('id'),". 
    379                "'no_content' => true,". 
    380                "'post_type' => subscribeToComments::getAllowedPostTypes()));". 
    381                "if (!\$_ctx->posts->isEmpty()) :"."\n". 
    382                "while (\$_ctx->posts->fetch()) : ?>"."\n". 
    383                $content. 
    384                "<?php endwhile; "."\n". 
    385                " endif;"."\n". 
    386                'unset($_ctx->meta);'. 
    387                "unset(\$_ctx->posts); ?>"); 
    388           } 
    389       
    390           /** 
    391           get email address 
    392           @return   <b>string</b> PHP block 
    393           */ 
    394           public static function email() 
    395           { 
    396                return('<?php echo($_ctx->subscribeToCommentsEmail); ?>');   
    397           } 
    398       
    399           /** 
    400           get the URL of the subscriptions page 
    401           @return   <b>string</b> URL 
    402           */ 
    403           public static function url() 
    404           { 
    405                return("<?php echo(subscribeToComments::url()); ?>"); 
    406           } 
    407  
    408           /** 
    409           display checkbox to subscribe to comments 
    410           */ 
    411           public static function publicCommentFormAfterContent() 
    412           { 
    413                global $_ctx; 
    414  
    415                if (subscribeToComments::getPost($_ctx->posts->post_id) == false) 
    416                {return;} 
    417  
    418                $checked = null; 
    419  
    420                # if checkbox is unchecked, don't check it 
    421                if (isset($_POST['subscribeToComments'])) 
    422                     {$checked = true;} 
    423                elseif (isset($_COOKIE['subscribetocomments'])) 
    424                     {$checked = true;} 
    425                if ($checked) {$checked =  ' checked="checked" ';} 
    426  
    427                $logged =  
    428                (subscriber::checkCookie()) 
    429                ? 
    430                     $logged = ' (<strong><a href="'.subscribeToComments::url().'">'. 
    431                          __('Logged in').'</a></strong>)' 
    432                : ''; 
    433  
    434                echo '<p>'. 
    435                '<input type="checkbox" name="subscribeToComments" '. 
    436                'id="subscribeToComments"'.$checked.' />'. 
    437                '<label for="subscribeToComments">'. 
    438                __('Receive following comments by email').'</label>'. 
    439                $logged. 
    440                '</p>'; 
    441           } 
    442            
    443           /** 
    444           display a CSS rule for default themes 
    445           */ 
    446           public static function publicHeadContent() 
    447           { 
    448                echo '<style type="text/css" media="screen">'."\n". 
    449                '#comment-form #subscribeToComments '. 
    450                '{width:auto;border:0;margin:0 5px 0 140px;}'."\n". 
    451                '</style>'; 
    452           } 
    453  
    454           /** 
    455           add tpl code after the <tpl:EntryIf comments_active="1">...</tpl:EntryIf> tag 
    456           @param    core <b>core</b>    Dotclear core 
    457           @param    b    <b>array</b>   tag 
    458           @param    attr <b>array</b>   attributes 
    459           */ 
    460           public static function templateAfterBlock(&$core,$b,$attr) 
    461           { 
    462                global $_ctx; 
    463  
    464                if ($core->url->type == 'feed') {return;} 
    465  
    466                if ($b == 'EntryIf' && isset($attr['comments_active']) 
    467                     && $attr['comments_active'] == 1 && !isset($attr['pings_active'])) 
    468                { 
    469                     if ((!is_numeric($_ctx->posts->post_id)) OR 
    470                     (subscribeToComments::getPost($_ctx->posts->post_id) == false)) 
    471                     { 
    472                          return; 
    473                     } 
    474                     # else 
    475                     return  
    476                     '<?php if (($core->blog->settings->subscribetocomments_active) && 
    477                          $_ctx->posts->commentsActive()) : ?> 
    478                          <div id="subscribetocomments_block"> 
    479                               <h3><?php echo __("Subscribe to comments"); ?></h3> 
    480                               <p> 
    481                                    <a href="<?php echo(subscribeToComments::url(). 
    482                                    (($core->blog->settings->url_scan == "query_string") ? "&amp;" : "?"). 
    483                                    "post_id=".$_ctx->posts->post_id); ?>"> 
    484                                         <!-- # If the subscriber is logged in --> 
    485                                         <?php if (subscriber::checkCookie()) : ?> 
    486                                              <?php echo __("Subscribe to receive following comments by email or manage subscriptions"); ?> 
    487                                         <?php endif; ?> 
    488                                         <!-- # If the subscriber is not logged in --> 
    489                                         <?php if (!subscriber::checkCookie()) : ?> 
    490                                              <?php echo __("Subscribe to receive following comments by email"); ?> 
    491                                         <?php endif; ?> 
    492                                    </a> 
    493                               </p> 
    494                          </div> 
    495                     <?php endif; ?>'; 
    496                     # strings 
    497                     __("Subscribe to receive following comments by email or manage subscriptions"); 
    498                     __("Subscribe to receive following comments by email"); 
    499                } 
    500           } 
    501      } 
    502  
    503      $core->url->register('subscribetocomments','subscribetocomments', 
    504           '^subscribetocomments(/.+)?$',array('subscribeToCommentsDocument','page')); 
    505  
    506506     # behaviors 
    507507     $core->addBehavior('coreAfterCommentCreate',array('subscribeToComments', 
  • plugins/subscribeToComments/class.subscriber.php

    r510 r534  
    126126 
    127127          # email 
    128           $subject = sprintf($core->blog->settings->subscribetocomments_account_subject, 
     128          $subject = sprintf(subscribeToComments::getSetting('account_subject'), 
    129129               $core->blog->name,$core->blog->url,$email, 
    130130               self::pageLink($email,$key)); 
    131           $content = sprintf($core->blog->settings->subscribetocomments_account_content, 
     131          $content = sprintf(subscribeToComments::getSetting('account_content'), 
    132132               $core->blog->name,$core->blog->url,$email, 
    133133               self::pageLink($email,$key)); 
     
    170170                    # email 
    171171                    $subject = sprintf( 
    172                          $core->blog->settings->subscribetocomments_subscribe_subject, 
     172                         subscribeToComments::getSetting('subscribe_subject'), 
    173173                         $this->blog_name,$this->blog_url,$this->email,$this->link, 
    174174                         $post['title'],$post['url']); 
    175175                    $content = sprintf( 
    176                          $core->blog->settings->subscribetocomments_subscribe_content, 
     176                         subscribeToComments::getSetting('subscribe_content'), 
    177177                         $this->blog_name,$this->blog_url,$this->email,$this->link, 
    178178                         $post['title'],$post['url']); 
     
    211211          'new_email='.urlencode($new_email).'&temp_key='.$key; 
    212212 
    213           $subject = sprintf($core->blog->settings->subscribetocomments_email_subject, 
     213          $subject = sprintf(subscribeToComments::getSetting('email_subject'), 
    214214               $this->blog_name,$this->blog_url,$this->email,$this->link,$new_email,$url); 
    215           $content = sprintf($core->blog->settings->subscribetocomments_email_content, 
     215          $content = sprintf(subscribeToComments::getSetting('email_content'), 
    216216               $this->blog_name,$this->blog_url,$this->email,$this->link,$new_email,$url); 
    217217 
     
    331331               # email 
    332332               $subject = sprintf( 
    333                     $core->blog->settings->subscribetocomments_account_subject, 
     333                    subscribeToComments::getSetting('account_subject'), 
    334334                    $core->blog->name,$core->blog->url,$rs->email, 
    335335                    self::pageLink($rs->email,$rs->user_key)); 
    336336               $content = sprintf( 
    337                     $core->blog->settings->subscribetocomments_account_content, 
     337                    subscribeToComments::getSetting('account_content'), 
    338338                    $core->blog->name,$core->blog->url,$rs->email, 
    339339                    self::pageLink($rs->email,$rs->user_key)); 
     
    501501          $cur->update('WHERE (id = '.$rs->id.') AND (temp_key = \''.$temp_key.'\');'); 
    502502 
    503           $subject = sprintf($core->blog->settings->subscribetocomments_account_subject, 
     503          $subject = sprintf(subscribeToComments::getSetting('account_subject'), 
    504504               $core->blog->name,$core->blog->url,$new_email, 
    505505               self::pageLink($new_email,$key)); 
    506           $content = sprintf($core->blog->settings->subscribetocomments_account_content, 
     506          $content = sprintf(subscribeToComments::getSetting('account_content'), 
    507507               $core->blog->name,$core->blog->url,$new_email, 
    508508               self::pageLink($new_email,$key)); 
  • plugins/subscribeToComments/default_settings.php

    r510 r534  
    33if (!defined('DC_RC_PATH')) { return; } 
    44 
    5 $settings = new dcSettings($core,$core->blog->id); 
     5$settings =& $core->blog->settings; 
    66 
    7 $core->blog->settings->setNameSpace('subscribetocomments'); 
     7$settings->setNameSpace('subscribetocomments'); 
    88 
    9 # Activate Subscribe to comments 
    10 $core->blog->settings->put('subscribetocomments_active',true, 
    11 'boolean','Activate Subscribe to comments'); 
     9# Enable Subscribe to comments 
     10$settings->put('subscribetocomments_active',true, 
     11'boolean','Enable Subscribe to comments'); 
    1212 
    1313# Change From: header of outbound emails 
    14 $core->blog->settings->put('subscribetocomments_email_from', 
     14$settings->put('subscribetocomments_email_from', 
    1515'dotclear@'.$_SERVER['HTTP_HOST'], 
    1616'string','Change From: header of outbound emails'); 
    1717 
    1818# Allowed post types 
    19 $core->blog->settings->put('subscribetocomments_post_types', 
     19$settings->put('subscribetocomments_post_types', 
    2020serialize(subscribeToComments::getPostTypes()), 
    2121'string','Allowed post types'); 
     
    3030 
    3131# Account subject 
    32 $core->blog->settings->put('subscribetocomments_account_subject', 
    33      format($tags_account,__('Your account on [blogname]')),'text', 
     32$settings->put('subscribetocomments_account_subject', 
     33     subscribeToComments::format($tags_account,__('Your account on [blogname]'), 
     34          false,true),'text', 
    3435     'Email subject'); 
    3536# Account content 
    36 $core->blog->settings->put('subscribetocomments_account_content', 
    37      format($tags_account, 
     37$settings->put('subscribetocomments_account_content', 
     38     subscribeToComments::format($tags_account, 
    3839          $hello.$nl. 
    39           __('here are some informations about your account on [blogname] :').$nls. 
     40          __('here are some informations about your account on [blogname] :'). 
     41          $nls. 
    4042          __('Email address : [email]').$nls. 
    4143          $account.$nls. 
    42           $foot_separator.$nl.'[blogurl]' 
    43 ),'text','Email content'); 
     44          $foot_separator.$nl.'[blogurl]',false,true) 
     45     ,'text','Email content'); 
    4446 
    4547# Send an email for each subscription 
    46 $core->blog->settings->put('subscribetocomments_subscribe_active', 
     48$settings->put('subscribetocomments_subscribe_active', 
    4749     false,'boolean','Send an email for each subscription'); 
    4850# Subscription subject 
    49 $core->blog->settings->put('subscribetocomments_subscribe_subject', 
    50      format($tags_subscribe,__('Subscribed to [posttitle] - [blogname]')), 
    51           'text','Subscription subject'); 
     51$settings->put('subscribetocomments_subscribe_subject', 
     52     subscribeToComments::format($tags_subscribe, 
     53          __('Subscribed to [posttitle] - [blogname]'),false,true),'text', 
     54          'Subscription subject'); 
    5255# Subscription content 
    53 $core->blog->settings->put('subscribetocomments_subscribe_content', 
    54      format($tags_subscribe, 
     56$settings->put('subscribetocomments_subscribe_content', 
     57     subscribeToComments::format($tags_subscribe, 
    5558          $hello.$nl. 
    5659          __('you subscribed to [posttitle] : [posturl]').$nls. 
    5760          $separator.$nls. 
    5861          $account.$nls. 
    59           $foot_separator.$nl.'[blogurl]' 
    60 ),'text','Subscription content'); 
     62          $foot_separator.$nl.'[blogurl]',false,true) 
     63     ,'text','Subscription content'); 
    6164 
    6265# Comment subject 
    63 $core->blog->settings->put('subscribetocomments_comment_subject', 
    64      format($tags_comment,__('New comment on [posttitle] - [blogname]')),'text', 
     66$settings->put('subscribetocomments_comment_subject', 
     67     subscribeToComments::format($tags_comment, 
     68     __('New comment on [posttitle] - [blogname]'),false,true),'text', 
    6569     'Comment subject'); 
    6670# Comment content 
    67 $core->blog->settings->put('subscribetocomments_comment_content', 
    68      format($tags_comment, 
     71$settings->put('subscribetocomments_comment_content', 
     72     subscribeToComments::format($tags_comment, 
    6973          $hello.$nl. 
    70           __('a new comment has been posted by [commentauthor] on [posttitle] :').$nls.  
     74          __('a new comment has been posted by [commentauthor] on [posttitle] :'). 
     75          $nls.  
    7176          $separator.$nls. 
    7277          '[commentcontent]'.$nls. 
     
    7681          $separator.$nls. 
    7782          $account.$nls. 
    78           $foot_separator.$nl.'[blogurl]' 
    79 ),'text','Comment content'); 
     83          $foot_separator.$nl.'[blogurl]',false,true) 
     84     ,'text','Comment content'); 
    8085 
    8186# Email subject 
    82 $core->blog->settings->put('subscribetocomments_email_subject', 
    83      format($tags_email,__('Change email address on [blogname]')),'text', 
    84      'Email subject'); 
     87$settings->put('subscribetocomments_email_subject', 
     88     subscribeToComments::format($tags_email, 
     89          __('Change email address on [blogname]')),'text','Email subject', 
     90          false,true); 
    8591# Email content 
    86 $core->blog->settings->put('subscribetocomments_email_content', 
    87      format($tags_email, 
     92$settings->put('subscribetocomments_email_content', 
     93     subscribeToComments::format($tags_email, 
    8894          $hello.$nl. 
    89           __('you have requested to change the email address of your subscriptions to [newemail], click on this link : [emailurl]').$nls. 
     95          __('you have requested to change the email address of your subscriptions to [newemail], click on this link : [emailurl]'). 
     96          $nls. 
    9097          __('This link is valid for 24 hours.').$nls. 
    9198          $separator.$nls. 
    9299          $account.$nls. 
    93           $foot_separator.$nl.'[blogurl]' 
    94 ),'text','Email content'); 
     100          $foot_separator.$nl.'[blogurl]',false,true) 
     101     ,'text','Email content'); 
    95102 
    96103# display 
    97 $core->blog->settings->put('subscribetocomments_tpl_checkbox',true, 
     104$settings->put('subscribetocomments_tpl_checkbox',true, 
    98105     'boolean','Checkbox in comment form'); 
    99106 
    100107$subscribetocomments_tpl_css = false; 
    101 $theme = $core->blog->settings->theme; 
     108$theme = $settings->theme; 
    102109if (($theme == 'default') OR ($theme == 'blueSilence')) 
    103110{ 
    104111     $subscribetocomments_tpl_css = true; 
    105112} 
    106 $core->blog->settings->put('subscribetocomments_tpl_css', 
     113$settings->put('subscribetocomments_tpl_css', 
    107114     $subscribetocomments_tpl_css,'boolean','Add CSS rule'); 
    108115 
    109 $core->blog->settings->put('subscribetocomments_tpl_link',true, 
     116$settings->put('subscribetocomments_tpl_link',true, 
    110117     'boolean','Link to Subscribe to comments page'); 
    111118           
  • plugins/subscribeToComments/index.php

    r511 r534  
    9696     '[emailurl]' => array('name'=> 
    9797          __('URL to confirm the change of email address'),'tag'=>'%6$s') 
    98       
    9998); 
    10099 
    101 function format($tags,$str,$flip=false) 
    102 { 
    103      global $tags_global; 
    104      $array = array(); 
    105      foreach ($tags_global as $k => $v) 
    106      { 
    107           $array[$k] = $v['tag']; 
    108      } 
    109      if (empty($tags)) {$tags = array();} 
    110      foreach ($tags as $k => $v) 
    111      { 
    112           $array[$k] = $v['tag']; 
    113      } 
    114      if ($flip) {$array = array_flip($array);} 
    115      $str = str_replace(array_keys($array),array_values($array),$str); 
    116  
    117      return($str); 
    118 } 
    119  
    120100$msg = ''; 
    121101 
     
    124104$available_tags = array(); 
    125105 
    126 # if there is no settings 
    127 if ($core->blog->settings->subscribetocomments_subscribe_active === null) 
    128 { 
    129      # load locales for the blog language 
    130      l10n::set(dirname(__FILE__).'/locales/'.$core->blog->settings->lang. 
    131           '/default_settings'); 
    132  
    133      require_once(dirname(__FILE__).'/default_settings.php'); 
    134  
    135      http::redirect($p_url.'&saveconfig=1'); 
    136 } 
     106$settings =& $core->blog->settings; 
    137107 
    138108try 
    139109{ 
    140      if (isset($_POST['test'])) 
     110     # install the plugin 
     111     if (($settings->subscribetocomments_subscribe_active === null) 
     112          && (!empty($_POST['enable']))) 
     113     { 
     114          if (!empty($_POST['subscribetocomments_active'])) 
     115          { 
     116               # load locales for the blog language 
     117               l10n::set(dirname(__FILE__).'/locales/'.$settings->lang. 
     118                    '/default_settings'); 
     119           
     120               require_once(dirname(__FILE__).'/default_settings.php'); 
     121           
     122               http::redirect($p_url.'&saveconfig=1'); 
     123          } else { 
     124               http::redirect($p_url); 
     125          } 
     126     } elseif (isset($_POST['test'])) 
    141127     { 
    142128          # mail 
     
    149135     elseif (!empty($_POST['saveconfig'])) 
    150136     { 
    151           $core->blog->settings->setNameSpace('subscribetocomments'); 
    152           # Activate Subscribe to comments 
    153           $core->blog->settings->put('subscribetocomments_active', 
     137          $settings->setNameSpace('subscribetocomments'); 
     138          # Enable Subscribe to comments 
     139          $settings->put('subscribetocomments_active', 
    154140               (!empty($_POST['subscribetocomments_active'])),'boolean', 
    155                'Activate Subscribe to comments'); 
     141               'Enable Subscribe to comments'); 
    156142 
    157143          subscribeToComments::checkEmail( 
    158144               $_POST['subscribetocomments_email_from']); 
    159           # Change From: header of outbound emails 
    160           $core->blog->settings->put('subscribetocomments_email_from', 
     145          # Define From: header of outbound emails 
     146          $settings->put('subscribetocomments_email_from', 
    161147               $_POST['subscribetocomments_email_from'], 
    162                'text','Change From: header of outbound emails');            
     148               'text','Define From: header of outbound emails');            
    163149 
    164150          # Allowed post types 
    165           $core->blog->settings->put('subscribetocomments_post_types', 
     151          $settings->put('subscribetocomments_post_types', 
    166152               serialize($_POST['post_types']), 
    167153               'string','Allowed post types'); 
    168154 
    169155          # Account subject 
    170           $core->blog->settings->put('subscribetocomments_account_subject', 
    171                format($available_tags,$_POST['account_subject']), 
     156          $settings->put('subscribetocomments_account_subject', 
     157               subscribeToComments::format($available_tags,$_POST['account_subject'],false,true), 
    172158               'text','Account subject'); 
    173159          # Account content 
    174           $core->blog->settings->put('subscribetocomments_account_content', 
    175                format($available_tags,$_POST['account_content']), 
     160          $settings->put('subscribetocomments_account_content', 
     161               subscribeToComments::format($available_tags,$_POST['account_content'],false,true), 
    176162               'text','Account content'); 
    177163 
    178164          $available_tags = $tags_subscribe; 
    179165          # Send an email for each subscription 
    180           $core->blog->settings->put('subscribetocomments_subscribe_active', 
     166          $settings->put('subscribetocomments_subscribe_active', 
    181167               (!empty($_POST['subscribetocomments_subscribe_active'])),'boolean', 
    182168               'Send an email for each subscription'); 
    183169          # Subscription subject 
    184           $core->blog->settings->put('subscribetocomments_subscribe_subject', 
    185                format($available_tags,$_POST['subscribe_subject']),'text','Subscription subject'); 
     170          $settings->put('subscribetocomments_subscribe_subject', 
     171               subscribeToComments::format($available_tags,$_POST['subscribe_subject'],false,true),'text','Subscription subject'); 
    186172          # Subscription content 
    187           $core->blog->settings->put('subscribetocomments_subscribe_content', 
    188                format($available_tags,$_POST['subscribe_content']),'text','Subscription content'); 
     173          $settings->put('subscribetocomments_subscribe_content', 
     174               subscribeToComments::format($available_tags,$_POST['subscribe_content'],false,true),'text','Subscription content'); 
    189175 
    190176          $available_tags = $tags_comment; 
    191177          # Comment subject 
    192           $core->blog->settings->put('subscribetocomments_comment_subject', 
    193                format($available_tags,$_POST['comment_subject']),'text','Comment subject'); 
     178          $settings->put('subscribetocomments_comment_subject', 
     179               subscribeToComments::format($available_tags,$_POST['comment_subject'],false,true),'text','Comment subject'); 
    194180          # Comment content 
    195           $core->blog->settings->put('subscribetocomments_comment_content', 
    196                format($available_tags,$_POST['comment_content']),'text','Comment content'); 
     181          $settings->put('subscribetocomments_comment_content', 
     182               subscribeToComments::format($available_tags,$_POST['comment_content'],false,true),'text','Comment content'); 
    197183 
    198184          $available_tags = $tags_email; 
    199185          # Email subject 
    200           $core->blog->settings->put('subscribetocomments_email_subject', 
    201                format($available_tags,$_POST['email_subject']),'text','Email subject'); 
     186          $settings->put('subscribetocomments_email_subject', 
     187               subscribeToComments::format($available_tags,$_POST['email_subject'],false,true),'text','Email subject'); 
    202188          # Email content 
    203           $core->blog->settings->put('subscribetocomments_email_content', 
    204                format($available_tags,$_POST['email_content']),'text','Email content'); 
     189          $settings->put('subscribetocomments_email_content', 
     190               subscribeToComments::format($available_tags,$_POST['email_content'],false,true),'text','Email content'); 
    205191 
    206192          http::redirect($p_url.'&saveconfig=1'); 
     
    208194     elseif (!empty($_POST['saveconfig_display'])) 
    209195     { 
    210           $core->blog->settings->setNameSpace('subscribetocomments'); 
     196          $settings->setNameSpace('subscribetocomments'); 
    211197          # display 
    212           $core->blog->settings->put('subscribetocomments_tpl_checkbox', 
     198          $settings->put('subscribetocomments_tpl_checkbox', 
    213199               (!empty($_POST['subscribetocomments_tpl_checkbox'])),'boolean', 
    214200               'Checkbox in comment form'); 
    215           $core->blog->settings->put('subscribetocomments_tpl_css', 
     201          $settings->put('subscribetocomments_tpl_css', 
    216202               (!empty($_POST['subscribetocomments_tpl_css'])),'boolean', 
    217203               'Add CSS rule'); 
    218           $core->blog->settings->put('subscribetocomments_tpl_link', 
     204          $settings->put('subscribetocomments_tpl_link', 
    219205               (!empty($_POST['subscribetocomments_tpl_link'])),'boolean', 
    220206               'Link to Subscribe to comments page'); 
     
    279265<body> 
    280266 
    281      <h2><?php echo html::escapeHTML($core->blog->name).' &gt '.__('Subscribe to comments'); ?></h2> 
     267     <h2><?php echo html::escapeHTML($core->blog->name).' &rsaquo; '.__('Subscribe to comments'); ?></h2> 
    282268 
    283269     <?php  
    284           if (!empty($msg)) {echo '<div class="message">'.$msg.'</div><p></p>';} 
     270          if (!empty($msg)) {echo '<div class="message"><p>'.$msg.'</p></div>';} 
    285271          if (!$GLOBALS['core']->plugins->moduleExists('metadata')) { 
    286272               echo  
     
    290276     ?> 
    291277 
     278<?php if ($settings->subscribetocomments_subscribe_active === null) 
     279{ ?> 
     280     <form method="post" action="<?php echo http::getSelfURI(); ?>"> 
     281               <p><?php echo(__('The plugin is not enable.')); ?></p> 
     282               <p> 
     283                    <?php echo(form::checkbox('subscribetocomments_active',1, 
     284                         $settings->subscribetocomments_active)); ?> 
     285                    <label class="classic" for="subscribetocomments_active"> 
     286                    <?php printf(__('Enable %s'),__('Subscribe to comments')); ?></label> 
     287               </p> 
     288 
     289               <p><?php echo $core->formNonce(); ?></p> 
     290               <p><input type="submit" name="enable" value="<?php echo __('Save configuration'); ?>" /></p> 
     291          </form> 
     292<?php } else { ?> 
    292293     <div class="multi-part" id="settings" title="<?php echo __('Settings'); ?>"> 
    293294          <form method="post" action="<?php echo http::getSelfURI(); ?>"> 
    294295               <p> 
    295296                    <?php echo(form::checkbox('subscribetocomments_active',1, 
    296                          $core->blog->settings->subscribetocomments_active)); ?> 
     297                         $settings->subscribetocomments_active)); ?> 
    297298                    <label class="classic" for="subscribetocomments_active"> 
    298                     <?php printf(__('Activate %s'),__('Subscribe to comments')); ?></label> 
     299                    <?php printf(__('Enable %s'),__('Subscribe to comments')); ?></label> 
    299300               </p> 
    300301               <p> 
    301302                    <label class="classic" for="subscribetocomments_email_from"> 
    302                     <?php echo(__('Change From: header of outbound emails:')); ?> 
     303                    <?php echo(__('Define From: header of outbound emails:')); ?> 
    303304                    </label> 
    304305                    <?php echo(form::field('subscribetocomments_email_from',80,80, 
    305                          $core->blog->settings->subscribetocomments_email_from)); ?>. 
     306                         $settings->subscribetocomments_email_from)); ?>. 
    306307               </p> 
    307308 
    308309               <h3><?php echo(__('Post types')); ?></h3> 
    309                <p><?php printf(__('Activate %s with the following post types :'), 
     310               <p><?php printf(__('Enable %s with the following post types :'), 
    310311                    __('Subscribe to comments')); ?></p> 
    311312               <?php 
    312                     $available_post_types = subscribeToComments::getPostTypes(); 
     313                    $available_post_types = subscribeToComments::getPostTypes(true); 
    313314                    $post_types = subscribeToComments::getAllowedPostTypes(); 
    314315                    if (!empty($available_post_types)) 
     
    351352                         <label for="account_subject"><?php echo(__('Subject')); ?></label> 
    352353                         <?php echo(form::field('account_subject',80,255, 
    353                               html::escapeHTML(format($tags_global, 
    354                               $core->blog->settings->subscribetocomments_account_subject,true)))); ?> 
     354                              html::escapeHTML(subscribeToComments::format($tags_global, 
     355                              subscribeToComments::getSetting('account_subject'),true)))); ?> 
    355356                    </p> 
    356357                    <p class="field"> 
    357358                         <label for="account_content"><?php echo(__('Content')); ?></label> 
    358359                         <?php echo(form::textarea('account_content',80,15, 
    359                               html::escapeHTML(format($tags_global, 
    360                               $core->blog->settings->subscribetocomments_account_content,true)))); ?> 
     360                              html::escapeHTML(subscribeToComments::format($tags_global, 
     361                              subscribeToComments::getSetting('account_content'),true)))); ?> 
    361362                    </p> 
    362363               </fieldset> 
     
    366367                    <p> 
    367368                         <?php echo(form::checkbox('subscribetocomments_subscribe_active',1, 
    368                               $core->blog->settings->subscribetocomments_subscribe_active)); ?> 
     369                              $settings->subscribetocomments_subscribe_active)); ?> 
    369370                         <label class="classic" for="subscribetocomments_subscribe_active"> 
    370371                         <?php echo(__('Send an email for each subscription to the comments of a post')); ?></label> 
     
    382383                         <label for="subscription_subject"><?php echo(__('Subject')); ?></label> 
    383384                         <?php echo(form::field('subscribe_subject',80,255, 
    384                               html::escapeHTML(format($tags_subscribe, 
    385                               $core->blog->settings->subscribetocomments_subscribe_subject,true)))); ?> 
     385                              html::escapeHTML(subscribeToComments::format($tags_subscribe, 
     386                              subscribeToComments::getSetting('subscribe_subject'),true)))); ?> 
    386387                    </p> 
    387388                    <p class="field"> 
    388389                         <label for="subscription_content"><?php echo(__('Content')); ?></label> 
    389390                         <?php echo(form::textarea('subscribe_content',80,15, 
    390                               html::escapeHTML(format($tags_subscribe, 
    391                               $core->blog->settings->subscribetocomments_subscribe_content,true)))); ?> 
     391                              html::escapeHTML(subscribeToComments::format($tags_subscribe, 
     392                              subscribeToComments::getSetting('subscribe_content'),true)))); ?> 
    392393                    </p> 
    393394               </fieldset> 
     
    407408                         <label for="comment_subject"><?php echo(__('Subject')); ?></label> 
    408409                         <?php echo(form::field('comment_subject',80,255, 
    409                               html::escapeHTML(format($tags_comment, 
    410                               $core->blog->settings->subscribetocomments_comment_subject,true)))); ?> 
     410                              html::escapeHTML(subscribeToComments::format($tags_comment, 
     411                              subscribeToComments::getSetting('comment_subject'),true)))); ?> 
    411412                    </p> 
    412413                    <p class="field"> 
    413414                         <label for="comment_content"><?php echo(__('Content')); ?></label> 
    414415                         <?php echo(form::textarea('comment_content',80,15, 
    415                               html::escapeHTML(format($tags_comment, 
    416                               $core->blog->settings->subscribetocomments_comment_content,true)))); ?> 
     416                              html::escapeHTML(subscribeToComments::format($tags_comment, 
     417                              subscribeToComments::getSetting('comment_content'),true)))); ?> 
    417418                    </p> 
    418419               </fieldset> 
     
    432433                         <label for="email_subject"><?php echo(__('Subject')); ?></label> 
    433434                         <?php echo(form::field('email_subject',80,255, 
    434                               html::escapeHTML(format($tags_email, 
    435                               $core->blog->settings->subscribetocomments_email_subject,true)))); ?> 
     435                              html::escapeHTML(subscribeToComments::format($tags_email, 
     436                              subscribeToComments::getSetting('email_subject'),true)))); ?> 
    436437                    </p> 
    437438                    <p class="field"> 
    438439                         <label for="email_content"><?php echo(__('Content')); ?></label> 
    439440                         <?php echo(form::textarea('email_content',80,15, 
    440                               html::escapeHTML(format($tags_email, 
    441                               $core->blog->settings->subscribetocomments_email_content,true)))); ?> 
     441                              html::escapeHTML(subscribeToComments::format($tags_email, 
     442                              subscribeToComments::getSetting('email_content'),true)))); ?> 
    442443                    </p> 
    443444               </fieldset> 
     
    462463                    <p> 
    463464                         <?php echo(form::checkbox('subscribetocomments_tpl_checkbox',1, 
    464                               $core->blog->settings->subscribetocomments_tpl_checkbox)); ?> 
     465                              $settings->subscribetocomments_tpl_checkbox)); ?> 
    465466                         <label class="classic" for="subscribetocomments_tpl_checkbox"> 
    466467                              <?php printf(__('Add the <strong>%s</strong> checkbox in the comment form'), 
     
    482483                    <p> 
    483484                         <?php echo(form::checkbox('subscribetocomments_tpl_css',1, 
    484                               $core->blog->settings->subscribetocomments_tpl_css)); ?> 
     485                              $settings->subscribetocomments_tpl_css)); ?> 
    485486                         <label class="classic" for="subscribetocomments_tpl_css"> 
    486487                              <?php printf(__('Add a CSS rule to style the <strong>%1$s</strong> checkbox'), 
     
    498499                    <p> 
    499500                         <?php echo(form::checkbox('subscribetocomments_tpl_link',1, 
    500                               $core->blog->settings->subscribetocomments_tpl_link)); ?> 
     501                              $settings->subscribetocomments_tpl_link)); ?> 
    501502                         <label class="classic" for="subscribetocomments_tpl_link"> 
    502503                              <?php printf(__('Add a link to the <strong>%s</strong> page between the comments and the trackbacks'), 
     
    549550          </div> 
    550551     </div> 
    551  
     552<?php } ?> 
    552553</body> 
    553554</html> 
  • plugins/subscribeToComments/lib.subscribeToComments.php

    r510 r534  
    8585     { 
    8686          global $core; 
    87  
    88           $core->url->register('subscribetocomments','subscribetocomments', 
    89                '^subscribetocomments(/.+)?$',array('subscribeToCommentsDocument','page')); 
     87           
    9088          return($core->blog->url.$core->url->getBase('subscribetocomments')); 
     89     } 
     90      
     91     /** 
     92     get a plugin's setting 
     93     @param    setting   <b>string</b>  Setting 
     94     @return   <b>string</b> setting 
     95     */ 
     96     public static function getSetting($setting) 
     97     { 
     98          global $core; 
     99           
     100          $setting = $core->blog->settings->{'subscribetocomments_'.$setting}; 
     101           
     102          if (strlen($setting) == 0) {return '';} 
     103          # else          
     104          return(unserialize(base64_decode($setting))); 
     105     } 
     106      
     107     /** 
     108     format settings 
     109     @param    tags <b>array</b>   Tags array 
     110     @param    str  <b>string</b>  String 
     111     @param    flip <b>boolean</b> Flip the tags array 
     112     @param    encode    <b>boolean</b> Serialize and encode returned string 
     113     @return   <b>string</b> string 
     114     */ 
     115     public static function format($tags,$str,$flip=false,$encode=false) 
     116     { 
     117          global $tags_global; 
     118          $array = array(); 
     119          foreach ($tags_global as $k => $v) 
     120          { 
     121               $array[$k] = $v['tag']; 
     122          } 
     123          if (empty($tags)) {$tags = array();} 
     124          foreach ($tags as $k => $v) 
     125          { 
     126               $array[$k] = $v['tag']; 
     127          } 
     128          if ($flip) { 
     129               $array = array_flip($array); 
     130          } 
     131          $str = str_replace(array_keys($array),array_values($array),$str); 
     132           
     133          if ($encode) 
     134          { 
     135               $str = base64_encode(serialize($str)); 
     136          } 
     137           
     138          return($str); 
    91139     } 
    92140 
     
    118166     @return   <b>array</b>   Array with post types 
    119167     */ 
    120      public static function getPostTypes() 
     168     public static function getPostTypes($blog=false) 
    121169     { 
    122170          global $core; 
    123171 
    124172          $rs = $core->con->select('SELECT post_type AS type '. 
    125           'FROM '.$core->prefix.'post GROUP BY type ORDER BY type ASC;'); 
     173          'FROM '.$core->prefix.'post '. 
     174          (($blog) ? 'WHERE blog_id = \''.$core->blog->id.'\' ' : ''). 
     175          'GROUP BY type ORDER BY type ASC;'); 
    126176 
    127177          if ($rs->isEmpty()) {return(array());} 
     
    131181          while ($rs->fetch()) 
    132182          { 
    133                array_push($types,$rs->type); 
     183               $types[] = $rs->type; 
    134184          } 
    135185 
     
    145195          global $core; 
    146196 
    147           $post_types = unserialize( 
     197          $post_types = @unserialize( 
    148198               $core->blog->settings->subscribetocomments_post_types); 
    149199 
     
    271321                         # email 
    272322                         $subject = sprintf( 
    273                               $core->blog->settings->subscribetocomments_comment_subject, 
     323                              self::getSetting('comment_subject'), 
    274324                              $core->blog->name,$core->blog->url,$rs->email, 
    275325                              subscriber::pageLink($rs->email,$rs->user_key), 
     
    277327                              $cur->comment_author,$comment); 
    278328                         $content = sprintf( 
    279                               $core->blog->settings->subscribetocomments_comment_content, 
     329                              self::getSetting('comment_content'), 
    280330                              $core->blog->name,$core->blog->url,$rs->email, 
    281331                              subscriber::pageLink($rs->email,$rs->user_key), 
  • plugins/subscribeToComments/locales/fr/default_settings.po

    r451 r534  
    44"Report-Msgid-Bugs-To: \n" 
    55"POT-Creation-Date: 2008-05-12 21:09+0100\n" 
    6 "PO-Revision-Date: 2008-05-12 21:39+0100\n" 
     6"PO-Revision-Date: 2008-10-23 21:20+0100\n" 
    77"Last-Translator: Moe <poedit@gniark.net>\n" 
    88"Language-Team: Moe <poedit@gniark.net>\n" 
     
    3131#: default_settings.php:26 
    3232msgid "here are some informations about your account on [blogname] :" 
    33 msgstr "voici quelques informations sur votre compte sur [blogname] :" 
     33msgstr "voici quelques informations à propos de votre compte sur [blogname] :" 
    3434 
    3535#: default_settings.php:27 
  • plugins/subscribeToComments/locales/fr/main.po

    r510 r534  
    33"Project-Id-Version: Subscribe to comments\n" 
    44"Report-Msgid-Bugs-To: \n" 
    5 "POT-Creation-Date: 2008-10-02 19:10+0100\n" 
    6 "PO-Revision-Date: 2008-10-02 19:11+0100\n" 
     5"POT-Creation-Date: 2008-10-23 19:17+0100\n" 
     6"PO-Revision-Date: 2008-10-23 19:19+0100\n" 
    77"Last-Translator: Moe <poedit@gniark.net>\n" 
    88"Language-Team: Moe <poedit@gniark.net>\n" 
     
    1717"X-Poedit-SearchPath-0: .\n" 
    1818 
    19 #: _public.php:65 
     19#: _public.php:66 
    2020#: class.subscriber.php:147 
    2121msgid "Invalid post ID." 
    2222msgstr "Identifiant du billet invalide." 
    2323 
    24 #: _public.php:123 
     24#: _public.php:124 
    2525msgid "Account informations sent" 
    2626msgstr "Informations sur le compte envoyées" 
    2727 
    28 #: _public.php:124 
     28#: _public.php:125 
    2929msgid "Subscriptions removed" 
    3030msgstr "Abonnements effacés" 
    3131 
    32 #: _public.php:125 
     32#: _public.php:126 
    3333msgid "Logged out" 
    3434msgstr "Déconnecté" 
    3535 
    36 #: _public.php:126 
    37 #: _public.php:431 
     36#: _public.php:127 
     37#: _public.php:432 
    3838msgid "Logged in" 
    3939msgstr "Connecté" 
    4040 
    41 #: _public.php:127 
     41#: _public.php:128 
    4242msgid "Emails blocked" 
    4343msgstr "Emails bloqués" 
    4444 
    45 #: _public.php:128 
     45#: _public.php:129 
    4646msgid "Emails allowed" 
    4747msgstr "Emails autorisés" 
    4848 
    49 #: _public.php:130 
     49#: _public.php:131 
    5050msgid "An email has been sent to the new email address" 
    5151msgstr "Un email a été envoyé à la nouvelle adresse email" 
    5252 
    53 #: _public.php:131 
     53#: _public.php:132 
    5454msgid "Email address changed" 
    5555msgstr "Adresse email changée" 
    5656 
    57 #: _public.php:132 
     57#: _public.php:133 
    5858msgid "Account deleted" 
    5959msgstr "Compte supprimé" 
    6060 
    61 #: _public.php:133 
     61#: _public.php:134 
    6262msgid "Subscribed to the entry" 
    6363msgstr "Abonné au billet" 
    6464 
    65 #: _public.php:438 
    66 #: index.php:467 
    67 #: index.php:480 
    68 #: index.php:487 
     65#: _public.php:439 
     66#: index.php:464 
     67#: index.php:477 
     68#: index.php:484 
    6969msgid "Receive following comments by email" 
    7070msgstr "Recevoir les commentaires suivants par email" 
    7171 
    72 #: _public.php:497 
     72#: _public.php:498 
    7373msgid "Subscribe to receive following comments by email or manage subscriptions" 
    7474msgstr "S'abonner pour recevoir les commentaires suivants par email ou modifier les abonnements" 
    7575 
    76 #: _public.php:498 
     76#: _public.php:499 
    7777msgid "Subscribe to receive following comments by email" 
    7878msgstr "S'abonner pour recevoir les commentaires suivants par email" 
     
    8787msgstr "Clé invalide." 
    8888 
    89 #: lib.subscribeToComments.php:205 
     89#: lib.subscribeToComments.php:259 
    9090#, php-format 
    9191msgid "<img src=\"images/check-off.png\" alt=\"%1$s\" title=\"%1$s\" /> Notification email not sent, click on <strong>%2$s</strong>." 
    9292msgstr "<img src=\"images/check-off.png\" alt=\"%1$s\" title=\"%1$s\" /> Email de notification non envoyé, cliquez sur <strong>%2$s</strong>." 
    9393 
    94 #: lib.subscribeToComments.php:205 
     94#: lib.subscribeToComments.php:259 
    9595msgid "not sent" 
    9696msgstr "" 
    9797 
    98 #: lib.subscribeToComments.php:205 
     98#: lib.subscribeToComments.php:259 
    9999msgid "save" 
    100100msgstr "" 
    101101 
    102 #: lib.subscribeToComments.php:209 
     102#: lib.subscribeToComments.php:263 
    103103#, php-format 
    104104msgid "<img src=\"images/check-on.png\" alt=\"%1$s\" title=\"%1$s\" /> Notification email sent." 
    105105msgstr "<img src=\"images/check-on.png\" alt=\"%1$s\" title=\"%1$s\" /> Email de notification envoyé." 
    106106 
    107 #: lib.subscribeToComments.php:209 
     107#: lib.subscribeToComments.php:263 
    108108msgid "sent" 
    109109msgstr "" 
    110110 
    111 #: lib.subscribeToComments.php:211 
     111#: lib.subscribeToComments.php:265 
    112112#: _admin.php:28 
    113113#: index.php:79 
    114 #: index.php:144 
    115 #: index.php:247 
    116 #: index.php:281 
    117 #: index.php:298 
    118 #: index.php:310 
    119 #: index.php:461 
    120 #: index.php:503 
    121 #: index.php:523 
     114#: index.php:126 
     115#: index.php:229 
     116#: index.php:263 
     117#: index.php:282 
     118#: index.php:295 
     119#: index.php:307 
     120#: index.php:458 
     121#: index.php:500 
     122#: index.php:520 
    122123msgid "Subscribe to comments" 
    123124msgstr "Abonnement aux commentaires" 
     
    206207 
    207208#: index.php:77 
    208 #: index.php:534 
     209#: index.php:531 
    209210msgid "Email address" 
    210211msgstr "Adresse email" 
     
    246247msgstr "URL pour confirmer le changement d'adresse email" 
    247248 
    248 #: index.php:143 
     249#: index.php:125 
    249250#, php-format 
    250251msgid "Test email from your blog - %s" 
    251252msgstr "Email test depuis votre blog - %s" 
    252253 
    253 #: index.php:144 
     254#: index.php:126 
    254255msgid "The plugin % works." 
    255256msgstr "Le plugin %s fonctionne." 
    256257 
    257 #: index.php:232 
     258#: index.php:214 
    258259msgid "Test email sent." 
    259260msgstr "Email test envoyé." 
    260261 
    261 #: index.php:236 
     262#: index.php:218 
    262263msgid "Configuration successfully updated." 
    263264msgstr "Configuration mise à jour avec succès." 
    264265 
    265 #: index.php:287 
     266#: index.php:269 
    266267msgid "Error:" 
    267268msgstr "Erreur:" 
    268269 
    269 #: index.php:288 
     270#: index.php:270 
    270271msgid "Unable to find metadata plugin" 
    271272msgstr "Impossible de trouver l'extension metadata" 
    272273 
    273 #: index.php:292 
     274#: index.php:277 
     275msgid "The plugin is not enable." 
     276msgstr "Ce plugin n'est pas activé." 
     277 
     278#: index.php:282 
     279#: index.php:295 
     280#, php-format 
     281msgid "Enable %s" 
     282msgstr "Activer %s" 
     283 
     284#: index.php:286 
     285#: index.php:443 
     286#: index.php:513 
     287msgid "Save configuration" 
     288msgstr "Enregistrer la configuration" 
     289 
     290#: index.php:289 
    274291msgid "Settings" 
    275292msgstr "Paramètres" 
    276293 
    277 #: index.php:298 
    278 #, php-format 
    279 msgid "Activate %s" 
    280 msgstr "Activer %s" 
    281  
    282 #: index.php:302 
    283 msgid "Change From: header of outbound emails:" 
    284 msgstr "Changer l'entête From: des emails sortants :" 
    285  
    286 #: index.php:308 
     294#: index.php:299 
     295msgid "Define From: header of outbound emails:" 
     296msgstr "Définir l'entête From: des emails sortants :" 
     297 
     298#: index.php:305 
    287299msgid "Post types" 
    288300msgstr "Types de billets" 
    289301 
    290 #: index.php:309 
    291 #, php-format 
    292 msgid "Activate %s with the following post types :" 
     302#: index.php:306 
     303#, php-format 
     304msgid "Enable %s with the following post types :" 
    293305msgstr "Activer %s pour les types de billets suivants :" 
    294306 
    295 #: index.php:328 
     307#: index.php:325 
    296308msgid "No entry yet. Create a new entry." 
    297309msgstr "Pas encore de billet. Créez une nouveau billet." 
    298310 
    299 #: index.php:334 
     311#: index.php:331 
    300312msgid "Email formatting" 
    301313msgstr "Format des emails" 
    302314 
    303 #: index.php:335 
     315#: index.php:332 
    304316msgid "You can format the emails using the following tags." 
    305317msgstr "Vous pouvez formater les emails en utilisant les balises suivantes." 
    306318 
    307 #: index.php:336 
     319#: index.php:333 
    308320msgid "Each tag will be replaced by the associated value." 
    309321msgstr "Chaque balise sera remplacée par la valeur associée." 
    310322 
    311 #: index.php:337 
     323#: index.php:334 
    312324msgid "Tags available in all the contexts" 
    313325msgstr "Balises disponibles dans tous les contextes" 
    314326 
    315 #: index.php:341 
    316 #: index.php:375 
    317 #: index.php:400 
    318 #: index.php:425 
    319 msgid "Tag" 
    320 msgstr "Balise" 
    321  
    322 #: index.php:341 
    323 #: index.php:375 
    324 #: index.php:400 
    325 #: index.php:425 
    326 msgid "Value" 
    327 msgstr "Valeur" 
    328  
    329 #: index.php:349 
    330 msgid "Email sent when an account is created or if a subscriber request it" 
    331 msgstr "Email envoyé quand un compte est créé ou si un abonné le demande" 
    332  
    333 #: index.php:351 
    334 #: index.php:382 
    335 #: index.php:407 
    336 #: index.php:432 
    337 msgid "Subject" 
    338 msgstr "Sujet" 
    339  
    340 #: index.php:357 
    341 #: index.php:388 
    342 #: index.php:413 
    343 #: index.php:438 
    344 msgid "Content" 
    345 msgstr "Contenu" 
    346  
    347 #: index.php:365 
    348 msgid "Email sent when a subscriber subscribe to the comments of a post" 
    349 msgstr "Email envoyé quand un abonné s'abonne aux commentaires d'un billet" 
    350  
    351 #: index.php:370 
    352 msgid "Send an email for each subscription to the comments of a post" 
    353 msgstr "Envoyer un email pour chaque abonnement aux commentaires d'un billet" 
    354  
     327#: index.php:338 
    355328#: index.php:372 
    356329#: index.php:397 
    357330#: index.php:422 
     331msgid "Tag" 
     332msgstr "Balise" 
     333 
     334#: index.php:338 
     335#: index.php:372 
     336#: index.php:397 
     337#: index.php:422 
     338msgid "Value" 
     339msgstr "Valeur" 
     340 
     341#: index.php:346 
     342msgid "Email sent when an account is created or if a subscriber request it" 
     343msgstr "Email envoyé quand un compte est créé ou si un abonné le demande" 
     344 
     345#: index.php:348 
     346#: index.php:379 
     347#: index.php:404 
     348#: index.php:429 
     349msgid "Subject" 
     350msgstr "Sujet" 
     351 
     352#: index.php:354 
     353#: index.php:385 
     354#: index.php:410 
     355#: index.php:435 
     356msgid "Content" 
     357msgstr "Contenu" 
     358 
     359#: index.php:362 
     360msgid "Email sent when a subscriber subscribe to the comments of a post" 
     361msgstr "Email envoyé quand un abonné s'abonne aux commentaires d'un billet" 
     362 
     363#: index.php:367 
     364msgid "Send an email for each subscription to the comments of a post" 
     365msgstr "Envoyer un email pour chaque abonnement aux commentaires d'un billet" 
     366 
     367#: index.php:369 
     368#: index.php:394 
     369#: index.php:419 
    358370msgid "Available tags" 
    359371msgstr "Balises disponibles" 
    360372 
    361 #: index.php:396 
     373#: index.php:393 
    362374msgid "Email sent when a new comment is published" 
    363375msgstr "Email envoyé quand un nouveau commentaire est publié" 
    364376 
    365 #: index.php:421 
     377#: index.php:418 
    366378msgid "Email sent when a subscriber want to change his email address" 
    367379msgstr "Email envoyé quand un abonné veut changer d'adresse email" 
    368380 
    369 #: index.php:446 
    370 #: index.php:516 
    371 msgid "Save configuration" 
    372 msgstr "Enregistrer la configuration" 
    373  
    374 #: index.php:450 
    375 #: index.php:451 
     381#: index.php:447 
     382#: index.php:448 
    376383msgid "Display" 
    377384msgstr "Affichage" 
    378385 
    379 #: index.php:453 
     386#: index.php:450 
    380387msgid "This plugin needs to add some code on the post page." 
    381388msgstr "Ce plugin a besoin d'ajouter du code sur la page du billet." 
    382389 
    383 #: index.php:454 
     390#: index.php:451 
    384391msgid "This can be done automatically by checking the following checkboxes." 
    385392msgstr "Cela peut être fait automatiquement en cochant les cases suivantes." 
    386393 
    387 #: index.php:455 
     394#: index.php:452 
    388395msgid "If you want to customize the display on the post page (the post.hml file of your theme), uncheck the following checkboxes and follow the instructions under each checkbox :" 
    389396msgstr "Si vous voulez modifier l'affichage sur la page du billet, décochez les cases suivantes et suivez les instructions sous chaque case :" 
    390397 
    391 #: index.php:456 
     398#: index.php:453 
    392399#, php-format 
    393400msgid "You can use the plugin <strong>%s</strong> to edit the file <strong>post.html</strong>." 
    394401msgstr "Vous pousez utiliser le plugin <strong>%s</strong> pour éditer le fichier <strong>post.html</strong>." 
    395402 
     403#: index.php:454 
     404msgid "Theme Editor" 
     405msgstr "" 
     406 
    396407#: index.php:457 
    397 msgid "Theme Editor" 
    398 msgstr "" 
    399  
    400 #: index.php:460 
    401408#, php-format 
    402409msgid "Install %s on the post page." 
    403410msgstr "Installer %s sur la page du billet." 
    404411 
    405 #: index.php:466 
     412#: index.php:463 
    406413#, php-format 
    407414msgid "Add the <strong>%s</strong> checkbox in the comment form" 
    408415msgstr "Ajouter la case <strong>%s</strong> dans le formulaire de commentaire" 
    409416 
    410 #: index.php:471 
    411 #: index.php:491 
    412 #: index.php:507 
     417#: index.php:468 
     418#: index.php:488 
     419#: index.php:504 
    413420msgid "or" 
    414421msgstr "ou" 
    415422 
    416 #: index.php:472 
     423#: index.php:469 
    417424msgid "insert this in the comment form (suggestion : in the <code>&lt;fieldset&gt;</code> before the <code>&lt;/form&gt;</code> tag) :" 
    418425msgstr "insérez ceci dans le formulaire de commentaire (suggestion : dans le <code>&lt;fieldset&gt;</code> avant la balise <code>&lt;/form&gt;</code>) :" 
    419426 
    420 #: index.php:479 
     427#: index.php:476 
    421428#, php-format 
    422429msgid "If the <strong>%s</strong> checkbox is not displayed correctly and the blog use Blowup or Blue Silence theme, check this :" 
    423430msgstr "Si la case <strong>%s</strong> n'est pas affichée correctement et que le blog utilise le thème Blowup ou Blue Silence, cochez ceci :" 
    424431 
    425 #: index.php:486 
     432#: index.php:483 
    426433#, php-format 
    427434msgid "Add a CSS rule to style the <strong>%1$s</strong> checkbox" 
    428435msgstr "Ajouter une règle CSS pour styler la case <strong>%1$s</strong>" 
    429436 
    430 #: index.php:492 
     437#: index.php:489 
    431438msgid "add this CSS rule at the end of the file <strong>style.css</strong>" 
    432439msgstr "ajoutez cette règle CSS à la fin du fichier <strong>style.css</strong>" 
    433440 
    434 #: index.php:502 
     441#: index.php:499 
    435442#, php-format 
    436443msgid "Add a link to the <strong>%s</strong> page between the comments and the trackbacks" 
    437444msgstr "Ajouter un lien vers la page <strong>%s</strong> entre les commentaires et les rétroliens" 
    438445 
    439 #: index.php:508 
     446#: index.php:505 
    440447msgid "insert this anywhere on the page (suggestion : just after the <code>&lt;/form&gt;</code> tag) :" 
    441448msgstr "insérez ceci n'importe où dans la page (suggestion : juste après la balise <code>&lt;/form&gt;</code>) :" 
    442449 
     450#: index.php:517 
     451#: index.php:519 
     452msgid "Help" 
     453msgstr "" 
     454 
    443455#: index.php:520 
    444 #: index.php:522 
    445 msgid "Help" 
    446 msgstr "" 
    447  
    448 #: index.php:523 
    449456#, php-format 
    450457msgid "%s send notification emails to the subscribers of a post when :" 
    451458msgstr "%s envoie des emails de notification aux abonnés d'un billet quand :" 
    452459 
    453 #: index.php:525 
     460#: index.php:522 
    454461msgid "a comment is posted and published immediatly" 
    455462msgstr "un commentaire est posté et publié immédiatement" 
    456463 
    457 #: index.php:526 
     464#: index.php:523 
    458465msgid "a pending comment is published" 
    459466msgstr "un commentaire en attente est publié à partir de l'interface d'administation" 
    460467 
    461 #: index.php:528 
     468#: index.php:525 
    462469msgid "If this weblog is hosted by free.fr, create a <code>/sessions/</code> directory in the root directory of the website." 
    463470msgstr "Si ce blog est hébergé chez free.fr, créez un répertoire <code>/sessions/</code> dans le répertoire racine de ce site." 
    464471 
    465 #: index.php:529 
     472#: index.php:526 
    466473msgid "To use this plugin, you have to test if the server can send emails :" 
    467474msgstr "Pour utiliser ce plugin, vous devez tester si le serveur peut envoyer des emails :" 
    468475 
    469 #: index.php:532 
     476#: index.php:529 
    470477msgid "Test" 
    471478msgstr "Test" 
    472479 
    473 #: index.php:539 
     480#: index.php:536 
    474481#, php-format 
    475482msgid "This will send a email, if you don't receive it, try to <a href=\"%s\">change the way Dotclear send emails</a>." 
    476483msgstr "Ceci enverra un email, si vous ne le recevez pas, essayez de <a href=\"%s\">changer la façon dont Dotclear envoie les emails</a>" 
    477484 
    478 #: index.php:542 
     485#: index.php:539 
    479486msgid "Try to send an email" 
    480487msgstr "Essayer d'envoyer un email" 
    481488 
    482 #: index.php:546 
     489#: index.php:543 
    483490#, php-format 
    484491msgid "Inspired by <a href=\"%1$s\">%2$s</a>" 
    485492msgstr "Inspiré par <a href=\"%1$s\">%2$s</a>" 
    486493 
    487 #: index.php:548 
     494#: index.php:545 
    488495msgid "Subscribe to comments for WordPress" 
    489496msgstr "Subscribe to comments pour WordPress" 
    490497 
     498#~ msgid "Activate %s" 
     499#~ msgstr "Activer %s" 
     500 
Note: See TracChangeset for help on using the changeset viewer.

Sites map