Changeset 534
- Timestamp:
- 10/23/08 22:41:04 (15 years ago)
- google:author:
- appears
- Location:
- plugins/subscribeToComments
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/subscribeToComments/_define.php
r511 r534 30 30 /* Description*/ "Subscribe to comments", 31 31 /* Author */ "Moe (http://gniark.net/)", 32 /* Version */ '1.2. 4',32 /* Version */ '1.2.5', 33 33 /* Permissions */ 'admin' 34 34 ); -
plugins/subscribeToComments/_install.php
r511 r534 82 82 $core->con->execute('DROP TABLE '.$core->prefix.'comment_notification;'); 83 83 } 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 } 84 105 } 106 85 107 # 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); 102 119 103 120 # table -
plugins/subscribeToComments/_prepend.php
r511 r534 29 29 $__autoload['subscriber'] = dirname(__FILE__).'/class.subscriber.php'; 30 30 31 $core->url->register('subscribetocomments','subscribetocomments', 32 '^subscribetocomments(/.+)?$',array('subscribeToCommentsDocument','page')); 33 31 34 ?> -
plugins/subscribeToComments/_public.php
r501 r534 35 35 'subscribeToCommentsIsActive'); 36 36 37 38 # load locales for the blog language 39 l10n::set(dirname(__FILE__).'/locales/'.$core->blog->settings->lang.'/public'); 40 41 /** 42 @ingroup Subscribe to comments 43 @brief Document 44 */ 45 class 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 */ 201 class 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') ? '&' : '?').". 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") ? "&" : "?"). 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 37 504 if ($core->blog->settings->subscribetocomments_active) 38 505 { 39 # load locales for the blog language40 l10n::set(dirname(__FILE__).'/locales/'.$core->blog->settings->lang.'/public');41 42 /**43 @ingroup Subscribe to comments44 @brief Document45 */46 class subscribeToCommentsDocument extends dcUrlHandlers47 {48 /**49 serve the document50 */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 key74 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 # subscribe82 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 informations102 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 address110 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 # messages119 $_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 address142 $_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 in150 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 comments198 @brief Template199 */200 class subscribeToCommentsTpl201 {202 /**203 check the box on post.html if a cookie is present204 @return <b>string</b> PHP block205 */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 page217 @return <b>string</b> text and PHP block218 */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') ? '&' : '?').".227 "'post_id='.\$_ctx->posts->post_id); ?>");228 }229 }230 231 /**232 if there is an error233 @param attr <b>array</b> Attribute234 @param content <b>string</b> Content235 @return <b>string</b> PHP block236 */237 public static function ifError($attr,$content)238 {239 return240 "<?php if (\$_ctx->subscribeToCommentsError !== null) : ?>"."\n".241 $content.242 "<?php endif; ?>";243 }244 245 /**246 display an error247 @return <b>string</b> PHP block248 */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 message259 @param attr <b>array</b> Attribute260 @param content <b>string</b> Content261 @return <b>string</b> PHP block262 */263 public static function ifMessage($attr,$content)264 {265 return266 "<?php if (\$_ctx->subscribeToCommentsMessage !== null) : ?>"."\n".267 $content.268 "<?php endif; ?>";269 }270 271 /**272 display a message273 @return <b>string</b> PHP block274 */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 nonce284 @return <b>string</b> Nonce285 */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 post293 @param attr <b>array</b> Attribute294 @param content <b>string</b> Content295 @return <b>string</b> PHP block296 */297 public static function entryIf($attr,$content)298 {299 return300 "<?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 in316 @param attr <b>array</b> Attribute317 @param content <b>string</b> Content318 @return <b>string</b> PHP block319 */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 in329 @param attr <b>array</b> Attribute330 @param content <b>string</b> Content331 @return <b>string</b> PHP block332 */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 blocked342 @param attr <b>array</b> Attribute343 @param content <b>string</b> Content344 @return <b>string</b> PHP block345 */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 blocked355 @param attr <b>array</b> Attribute356 @param content <b>string</b> Content357 @return <b>string</b> PHP block358 */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 posts368 @param attr <b>array</b> Attribute369 @param content <b>string</b> Content370 @return <b>string</b> PHP block371 */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 address392 @return <b>string</b> PHP block393 */394 public static function email()395 {396 return('<?php echo($_ctx->subscribeToCommentsEmail); ?>');397 }398 399 /**400 get the URL of the subscriptions page401 @return <b>string</b> URL402 */403 public static function url()404 {405 return("<?php echo(subscribeToComments::url()); ?>");406 }407 408 /**409 display checkbox to subscribe to comments410 */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 it421 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 themes445 */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> tag456 @param core <b>core</b> Dotclear core457 @param b <b>array</b> tag458 @param attr <b>array</b> attributes459 */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)) OR470 (subscribeToComments::getPost($_ctx->posts->post_id) == false))471 {472 return;473 }474 # else475 return476 '<?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") ? "&" : "?").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 # strings497 __("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 506 506 # behaviors 507 507 $core->addBehavior('coreAfterCommentCreate',array('subscribeToComments', -
plugins/subscribeToComments/class.subscriber.php
r510 r534 126 126 127 127 # email 128 $subject = sprintf( $core->blog->settings->subscribetocomments_account_subject,128 $subject = sprintf(subscribeToComments::getSetting('account_subject'), 129 129 $core->blog->name,$core->blog->url,$email, 130 130 self::pageLink($email,$key)); 131 $content = sprintf( $core->blog->settings->subscribetocomments_account_content,131 $content = sprintf(subscribeToComments::getSetting('account_content'), 132 132 $core->blog->name,$core->blog->url,$email, 133 133 self::pageLink($email,$key)); … … 170 170 # email 171 171 $subject = sprintf( 172 $core->blog->settings->subscribetocomments_subscribe_subject,172 subscribeToComments::getSetting('subscribe_subject'), 173 173 $this->blog_name,$this->blog_url,$this->email,$this->link, 174 174 $post['title'],$post['url']); 175 175 $content = sprintf( 176 $core->blog->settings->subscribetocomments_subscribe_content,176 subscribeToComments::getSetting('subscribe_content'), 177 177 $this->blog_name,$this->blog_url,$this->email,$this->link, 178 178 $post['title'],$post['url']); … … 211 211 'new_email='.urlencode($new_email).'&temp_key='.$key; 212 212 213 $subject = sprintf( $core->blog->settings->subscribetocomments_email_subject,213 $subject = sprintf(subscribeToComments::getSetting('email_subject'), 214 214 $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'), 216 216 $this->blog_name,$this->blog_url,$this->email,$this->link,$new_email,$url); 217 217 … … 331 331 # email 332 332 $subject = sprintf( 333 $core->blog->settings->subscribetocomments_account_subject,333 subscribeToComments::getSetting('account_subject'), 334 334 $core->blog->name,$core->blog->url,$rs->email, 335 335 self::pageLink($rs->email,$rs->user_key)); 336 336 $content = sprintf( 337 $core->blog->settings->subscribetocomments_account_content,337 subscribeToComments::getSetting('account_content'), 338 338 $core->blog->name,$core->blog->url,$rs->email, 339 339 self::pageLink($rs->email,$rs->user_key)); … … 501 501 $cur->update('WHERE (id = '.$rs->id.') AND (temp_key = \''.$temp_key.'\');'); 502 502 503 $subject = sprintf( $core->blog->settings->subscribetocomments_account_subject,503 $subject = sprintf(subscribeToComments::getSetting('account_subject'), 504 504 $core->blog->name,$core->blog->url,$new_email, 505 505 self::pageLink($new_email,$key)); 506 $content = sprintf( $core->blog->settings->subscribetocomments_account_content,506 $content = sprintf(subscribeToComments::getSetting('account_content'), 507 507 $core->blog->name,$core->blog->url,$new_email, 508 508 self::pageLink($new_email,$key)); -
plugins/subscribeToComments/default_settings.php
r510 r534 3 3 if (!defined('DC_RC_PATH')) { return; } 4 4 5 $settings = new dcSettings($core,$core->blog->id);5 $settings =& $core->blog->settings; 6 6 7 $ core->blog->settings->setNameSpace('subscribetocomments');7 $settings->setNameSpace('subscribetocomments'); 8 8 9 # Activate Subscribe to comments10 $ 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'); 12 12 13 13 # Change From: header of outbound emails 14 $ core->blog->settings->put('subscribetocomments_email_from',14 $settings->put('subscribetocomments_email_from', 15 15 'dotclear@'.$_SERVER['HTTP_HOST'], 16 16 'string','Change From: header of outbound emails'); 17 17 18 18 # Allowed post types 19 $ core->blog->settings->put('subscribetocomments_post_types',19 $settings->put('subscribetocomments_post_types', 20 20 serialize(subscribeToComments::getPostTypes()), 21 21 'string','Allowed post types'); … … 30 30 31 31 # 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', 34 35 'Email subject'); 35 36 # 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, 38 39 $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. 40 42 __('Email address : [email]').$nls. 41 43 $account.$nls. 42 $foot_separator.$nl.'[blogurl]' 43 ),'text','Email content');44 $foot_separator.$nl.'[blogurl]',false,true) 45 ,'text','Email content'); 44 46 45 47 # Send an email for each subscription 46 $ core->blog->settings->put('subscribetocomments_subscribe_active',48 $settings->put('subscribetocomments_subscribe_active', 47 49 false,'boolean','Send an email for each subscription'); 48 50 # 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'); 52 55 # 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, 55 58 $hello.$nl. 56 59 __('you subscribed to [posttitle] : [posturl]').$nls. 57 60 $separator.$nls. 58 61 $account.$nls. 59 $foot_separator.$nl.'[blogurl]' 60 ),'text','Subscription content');62 $foot_separator.$nl.'[blogurl]',false,true) 63 ,'text','Subscription content'); 61 64 62 65 # 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', 65 69 'Comment subject'); 66 70 # 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, 69 73 $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. 71 76 $separator.$nls. 72 77 '[commentcontent]'.$nls. … … 76 81 $separator.$nls. 77 82 $account.$nls. 78 $foot_separator.$nl.'[blogurl]' 79 ),'text','Comment content');83 $foot_separator.$nl.'[blogurl]',false,true) 84 ,'text','Comment content'); 80 85 81 86 # 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); 85 91 # 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, 88 94 $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. 90 97 __('This link is valid for 24 hours.').$nls. 91 98 $separator.$nls. 92 99 $account.$nls. 93 $foot_separator.$nl.'[blogurl]' 94 ),'text','Email content');100 $foot_separator.$nl.'[blogurl]',false,true) 101 ,'text','Email content'); 95 102 96 103 # display 97 $ core->blog->settings->put('subscribetocomments_tpl_checkbox',true,104 $settings->put('subscribetocomments_tpl_checkbox',true, 98 105 'boolean','Checkbox in comment form'); 99 106 100 107 $subscribetocomments_tpl_css = false; 101 $theme = $ core->blog->settings->theme;108 $theme = $settings->theme; 102 109 if (($theme == 'default') OR ($theme == 'blueSilence')) 103 110 { 104 111 $subscribetocomments_tpl_css = true; 105 112 } 106 $ core->blog->settings->put('subscribetocomments_tpl_css',113 $settings->put('subscribetocomments_tpl_css', 107 114 $subscribetocomments_tpl_css,'boolean','Add CSS rule'); 108 115 109 $ core->blog->settings->put('subscribetocomments_tpl_link',true,116 $settings->put('subscribetocomments_tpl_link',true, 110 117 'boolean','Link to Subscribe to comments page'); 111 118 -
plugins/subscribeToComments/index.php
r511 r534 96 96 '[emailurl]' => array('name'=> 97 97 __('URL to confirm the change of email address'),'tag'=>'%6$s') 98 99 98 ); 100 99 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 120 100 $msg = ''; 121 101 … … 124 104 $available_tags = array(); 125 105 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; 137 107 138 108 try 139 109 { 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'])) 141 127 { 142 128 # mail … … 149 135 elseif (!empty($_POST['saveconfig'])) 150 136 { 151 $ core->blog->settings->setNameSpace('subscribetocomments');152 # Activate Subscribe to comments153 $ core->blog->settings->put('subscribetocomments_active',137 $settings->setNameSpace('subscribetocomments'); 138 # Enable Subscribe to comments 139 $settings->put('subscribetocomments_active', 154 140 (!empty($_POST['subscribetocomments_active'])),'boolean', 155 ' Activate Subscribe to comments');141 'Enable Subscribe to comments'); 156 142 157 143 subscribeToComments::checkEmail( 158 144 $_POST['subscribetocomments_email_from']); 159 # Change From: header of outbound emails160 $ core->blog->settings->put('subscribetocomments_email_from',145 # Define From: header of outbound emails 146 $settings->put('subscribetocomments_email_from', 161 147 $_POST['subscribetocomments_email_from'], 162 'text',' Change From: header of outbound emails');148 'text','Define From: header of outbound emails'); 163 149 164 150 # Allowed post types 165 $ core->blog->settings->put('subscribetocomments_post_types',151 $settings->put('subscribetocomments_post_types', 166 152 serialize($_POST['post_types']), 167 153 'string','Allowed post types'); 168 154 169 155 # 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), 172 158 'text','Account subject'); 173 159 # 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), 176 162 'text','Account content'); 177 163 178 164 $available_tags = $tags_subscribe; 179 165 # Send an email for each subscription 180 $ core->blog->settings->put('subscribetocomments_subscribe_active',166 $settings->put('subscribetocomments_subscribe_active', 181 167 (!empty($_POST['subscribetocomments_subscribe_active'])),'boolean', 182 168 'Send an email for each subscription'); 183 169 # 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'); 186 172 # 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'); 189 175 190 176 $available_tags = $tags_comment; 191 177 # 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'); 194 180 # 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'); 197 183 198 184 $available_tags = $tags_email; 199 185 # 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'); 202 188 # 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'); 205 191 206 192 http::redirect($p_url.'&saveconfig=1'); … … 208 194 elseif (!empty($_POST['saveconfig_display'])) 209 195 { 210 $ core->blog->settings->setNameSpace('subscribetocomments');196 $settings->setNameSpace('subscribetocomments'); 211 197 # display 212 $ core->blog->settings->put('subscribetocomments_tpl_checkbox',198 $settings->put('subscribetocomments_tpl_checkbox', 213 199 (!empty($_POST['subscribetocomments_tpl_checkbox'])),'boolean', 214 200 'Checkbox in comment form'); 215 $ core->blog->settings->put('subscribetocomments_tpl_css',201 $settings->put('subscribetocomments_tpl_css', 216 202 (!empty($_POST['subscribetocomments_tpl_css'])),'boolean', 217 203 'Add CSS rule'); 218 $ core->blog->settings->put('subscribetocomments_tpl_link',204 $settings->put('subscribetocomments_tpl_link', 219 205 (!empty($_POST['subscribetocomments_tpl_link'])),'boolean', 220 206 'Link to Subscribe to comments page'); … … 279 265 <body> 280 266 281 <h2><?php echo html::escapeHTML($core->blog->name).' & gt'.__('Subscribe to comments'); ?></h2>267 <h2><?php echo html::escapeHTML($core->blog->name).' › '.__('Subscribe to comments'); ?></h2> 282 268 283 269 <?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>';} 285 271 if (!$GLOBALS['core']->plugins->moduleExists('metadata')) { 286 272 echo … … 290 276 ?> 291 277 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 { ?> 292 293 <div class="multi-part" id="settings" title="<?php echo __('Settings'); ?>"> 293 294 <form method="post" action="<?php echo http::getSelfURI(); ?>"> 294 295 <p> 295 296 <?php echo(form::checkbox('subscribetocomments_active',1, 296 $ core->blog->settings->subscribetocomments_active)); ?>297 $settings->subscribetocomments_active)); ?> 297 298 <label class="classic" for="subscribetocomments_active"> 298 <?php printf(__(' Activate %s'),__('Subscribe to comments')); ?></label>299 <?php printf(__('Enable %s'),__('Subscribe to comments')); ?></label> 299 300 </p> 300 301 <p> 301 302 <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:')); ?> 303 304 </label> 304 305 <?php echo(form::field('subscribetocomments_email_from',80,80, 305 $ core->blog->settings->subscribetocomments_email_from)); ?>.306 $settings->subscribetocomments_email_from)); ?>. 306 307 </p> 307 308 308 309 <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 :'), 310 311 __('Subscribe to comments')); ?></p> 311 312 <?php 312 $available_post_types = subscribeToComments::getPostTypes( );313 $available_post_types = subscribeToComments::getPostTypes(true); 313 314 $post_types = subscribeToComments::getAllowedPostTypes(); 314 315 if (!empty($available_post_types)) … … 351 352 <label for="account_subject"><?php echo(__('Subject')); ?></label> 352 353 <?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)))); ?> 355 356 </p> 356 357 <p class="field"> 357 358 <label for="account_content"><?php echo(__('Content')); ?></label> 358 359 <?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)))); ?> 361 362 </p> 362 363 </fieldset> … … 366 367 <p> 367 368 <?php echo(form::checkbox('subscribetocomments_subscribe_active',1, 368 $ core->blog->settings->subscribetocomments_subscribe_active)); ?>369 $settings->subscribetocomments_subscribe_active)); ?> 369 370 <label class="classic" for="subscribetocomments_subscribe_active"> 370 371 <?php echo(__('Send an email for each subscription to the comments of a post')); ?></label> … … 382 383 <label for="subscription_subject"><?php echo(__('Subject')); ?></label> 383 384 <?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)))); ?> 386 387 </p> 387 388 <p class="field"> 388 389 <label for="subscription_content"><?php echo(__('Content')); ?></label> 389 390 <?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)))); ?> 392 393 </p> 393 394 </fieldset> … … 407 408 <label for="comment_subject"><?php echo(__('Subject')); ?></label> 408 409 <?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)))); ?> 411 412 </p> 412 413 <p class="field"> 413 414 <label for="comment_content"><?php echo(__('Content')); ?></label> 414 415 <?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)))); ?> 417 418 </p> 418 419 </fieldset> … … 432 433 <label for="email_subject"><?php echo(__('Subject')); ?></label> 433 434 <?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)))); ?> 436 437 </p> 437 438 <p class="field"> 438 439 <label for="email_content"><?php echo(__('Content')); ?></label> 439 440 <?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)))); ?> 442 443 </p> 443 444 </fieldset> … … 462 463 <p> 463 464 <?php echo(form::checkbox('subscribetocomments_tpl_checkbox',1, 464 $ core->blog->settings->subscribetocomments_tpl_checkbox)); ?>465 $settings->subscribetocomments_tpl_checkbox)); ?> 465 466 <label class="classic" for="subscribetocomments_tpl_checkbox"> 466 467 <?php printf(__('Add the <strong>%s</strong> checkbox in the comment form'), … … 482 483 <p> 483 484 <?php echo(form::checkbox('subscribetocomments_tpl_css',1, 484 $ core->blog->settings->subscribetocomments_tpl_css)); ?>485 $settings->subscribetocomments_tpl_css)); ?> 485 486 <label class="classic" for="subscribetocomments_tpl_css"> 486 487 <?php printf(__('Add a CSS rule to style the <strong>%1$s</strong> checkbox'), … … 498 499 <p> 499 500 <?php echo(form::checkbox('subscribetocomments_tpl_link',1, 500 $ core->blog->settings->subscribetocomments_tpl_link)); ?>501 $settings->subscribetocomments_tpl_link)); ?> 501 502 <label class="classic" for="subscribetocomments_tpl_link"> 502 503 <?php printf(__('Add a link to the <strong>%s</strong> page between the comments and the trackbacks'), … … 549 550 </div> 550 551 </div> 551 552 <?php } ?> 552 553 </body> 553 554 </html> -
plugins/subscribeToComments/lib.subscribeToComments.php
r510 r534 85 85 { 86 86 global $core; 87 88 $core->url->register('subscribetocomments','subscribetocomments', 89 '^subscribetocomments(/.+)?$',array('subscribeToCommentsDocument','page')); 87 90 88 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); 91 139 } 92 140 … … 118 166 @return <b>array</b> Array with post types 119 167 */ 120 public static function getPostTypes( )168 public static function getPostTypes($blog=false) 121 169 { 122 170 global $core; 123 171 124 172 $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;'); 126 176 127 177 if ($rs->isEmpty()) {return(array());} … … 131 181 while ($rs->fetch()) 132 182 { 133 array_push($types,$rs->type);183 $types[] = $rs->type; 134 184 } 135 185 … … 145 195 global $core; 146 196 147 $post_types = unserialize(197 $post_types = @unserialize( 148 198 $core->blog->settings->subscribetocomments_post_types); 149 199 … … 271 321 # email 272 322 $subject = sprintf( 273 $core->blog->settings->subscribetocomments_comment_subject,323 self::getSetting('comment_subject'), 274 324 $core->blog->name,$core->blog->url,$rs->email, 275 325 subscriber::pageLink($rs->email,$rs->user_key), … … 277 327 $cur->comment_author,$comment); 278 328 $content = sprintf( 279 $core->blog->settings->subscribetocomments_comment_content,329 self::getSetting('comment_content'), 280 330 $core->blog->name,$core->blog->url,$rs->email, 281 331 subscriber::pageLink($rs->email,$rs->user_key), -
plugins/subscribeToComments/locales/fr/default_settings.po
r451 r534 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "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" 7 7 "Last-Translator: Moe <poedit@gniark.net>\n" 8 8 "Language-Team: Moe <poedit@gniark.net>\n" … … 31 31 #: default_settings.php:26 32 32 msgid "here are some informations about your account on [blogname] :" 33 msgstr "voici quelques informations survotre compte sur [blogname] :"33 msgstr "voici quelques informations à propos de votre compte sur [blogname] :" 34 34 35 35 #: default_settings.php:27 -
plugins/subscribeToComments/locales/fr/main.po
r510 r534 3 3 "Project-Id-Version: Subscribe to comments\n" 4 4 "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" 7 7 "Last-Translator: Moe <poedit@gniark.net>\n" 8 8 "Language-Team: Moe <poedit@gniark.net>\n" … … 17 17 "X-Poedit-SearchPath-0: .\n" 18 18 19 #: _public.php:6 519 #: _public.php:66 20 20 #: class.subscriber.php:147 21 21 msgid "Invalid post ID." 22 22 msgstr "Identifiant du billet invalide." 23 23 24 #: _public.php:12 324 #: _public.php:124 25 25 msgid "Account informations sent" 26 26 msgstr "Informations sur le compte envoyées" 27 27 28 #: _public.php:12 428 #: _public.php:125 29 29 msgid "Subscriptions removed" 30 30 msgstr "Abonnements effacés" 31 31 32 #: _public.php:12 532 #: _public.php:126 33 33 msgid "Logged out" 34 34 msgstr "Déconnecté" 35 35 36 #: _public.php:12 637 #: _public.php:43 136 #: _public.php:127 37 #: _public.php:432 38 38 msgid "Logged in" 39 39 msgstr "Connecté" 40 40 41 #: _public.php:12 741 #: _public.php:128 42 42 msgid "Emails blocked" 43 43 msgstr "Emails bloqués" 44 44 45 #: _public.php:12 845 #: _public.php:129 46 46 msgid "Emails allowed" 47 47 msgstr "Emails autorisés" 48 48 49 #: _public.php:13 049 #: _public.php:131 50 50 msgid "An email has been sent to the new email address" 51 51 msgstr "Un email a été envoyé à la nouvelle adresse email" 52 52 53 #: _public.php:13 153 #: _public.php:132 54 54 msgid "Email address changed" 55 55 msgstr "Adresse email changée" 56 56 57 #: _public.php:13 257 #: _public.php:133 58 58 msgid "Account deleted" 59 59 msgstr "Compte supprimé" 60 60 61 #: _public.php:13 361 #: _public.php:134 62 62 msgid "Subscribed to the entry" 63 63 msgstr "Abonné au billet" 64 64 65 #: _public.php:43 866 #: index.php:46 767 #: index.php:4 8068 #: index.php:48 765 #: _public.php:439 66 #: index.php:464 67 #: index.php:477 68 #: index.php:484 69 69 msgid "Receive following comments by email" 70 70 msgstr "Recevoir les commentaires suivants par email" 71 71 72 #: _public.php:49 772 #: _public.php:498 73 73 msgid "Subscribe to receive following comments by email or manage subscriptions" 74 74 msgstr "S'abonner pour recevoir les commentaires suivants par email ou modifier les abonnements" 75 75 76 #: _public.php:49 876 #: _public.php:499 77 77 msgid "Subscribe to receive following comments by email" 78 78 msgstr "S'abonner pour recevoir les commentaires suivants par email" … … 87 87 msgstr "Clé invalide." 88 88 89 #: lib.subscribeToComments.php:2 0589 #: lib.subscribeToComments.php:259 90 90 #, php-format 91 91 msgid "<img src=\"images/check-off.png\" alt=\"%1$s\" title=\"%1$s\" /> Notification email not sent, click on <strong>%2$s</strong>." 92 92 msgstr "<img src=\"images/check-off.png\" alt=\"%1$s\" title=\"%1$s\" /> Email de notification non envoyé, cliquez sur <strong>%2$s</strong>." 93 93 94 #: lib.subscribeToComments.php:2 0594 #: lib.subscribeToComments.php:259 95 95 msgid "not sent" 96 96 msgstr "" 97 97 98 #: lib.subscribeToComments.php:2 0598 #: lib.subscribeToComments.php:259 99 99 msgid "save" 100 100 msgstr "" 101 101 102 #: lib.subscribeToComments.php:2 09102 #: lib.subscribeToComments.php:263 103 103 #, php-format 104 104 msgid "<img src=\"images/check-on.png\" alt=\"%1$s\" title=\"%1$s\" /> Notification email sent." 105 105 msgstr "<img src=\"images/check-on.png\" alt=\"%1$s\" title=\"%1$s\" /> Email de notification envoyé." 106 106 107 #: lib.subscribeToComments.php:2 09107 #: lib.subscribeToComments.php:263 108 108 msgid "sent" 109 109 msgstr "" 110 110 111 #: lib.subscribeToComments.php:2 11111 #: lib.subscribeToComments.php:265 112 112 #: _admin.php:28 113 113 #: 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 122 123 msgid "Subscribe to comments" 123 124 msgstr "Abonnement aux commentaires" … … 206 207 207 208 #: index.php:77 208 #: index.php:53 4209 #: index.php:531 209 210 msgid "Email address" 210 211 msgstr "Adresse email" … … 246 247 msgstr "URL pour confirmer le changement d'adresse email" 247 248 248 #: index.php:1 43249 #: index.php:125 249 250 #, php-format 250 251 msgid "Test email from your blog - %s" 251 252 msgstr "Email test depuis votre blog - %s" 252 253 253 #: index.php:1 44254 #: index.php:126 254 255 msgid "The plugin % works." 255 256 msgstr "Le plugin %s fonctionne." 256 257 257 #: index.php:2 32258 #: index.php:214 258 259 msgid "Test email sent." 259 260 msgstr "Email test envoyé." 260 261 261 #: index.php:2 36262 #: index.php:218 262 263 msgid "Configuration successfully updated." 263 264 msgstr "Configuration mise à jour avec succès." 264 265 265 #: index.php:2 87266 #: index.php:269 266 267 msgid "Error:" 267 268 msgstr "Erreur:" 268 269 269 #: index.php:2 88270 #: index.php:270 270 271 msgid "Unable to find metadata plugin" 271 272 msgstr "Impossible de trouver l'extension metadata" 272 273 273 #: index.php:292 274 #: index.php:277 275 msgid "The plugin is not enable." 276 msgstr "Ce plugin n'est pas activé." 277 278 #: index.php:282 279 #: index.php:295 280 #, php-format 281 msgid "Enable %s" 282 msgstr "Activer %s" 283 284 #: index.php:286 285 #: index.php:443 286 #: index.php:513 287 msgid "Save configuration" 288 msgstr "Enregistrer la configuration" 289 290 #: index.php:289 274 291 msgid "Settings" 275 292 msgstr "Paramètres" 276 293 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 295 msgid "Define From: header of outbound emails:" 296 msgstr "Définir l'entête From: des emails sortants :" 297 298 #: index.php:305 287 299 msgid "Post types" 288 300 msgstr "Types de billets" 289 301 290 #: index.php:30 9291 #, php-format 292 msgid " Activate %s with the following post types :"302 #: index.php:306 303 #, php-format 304 msgid "Enable %s with the following post types :" 293 305 msgstr "Activer %s pour les types de billets suivants :" 294 306 295 #: index.php:32 8307 #: index.php:325 296 308 msgid "No entry yet. Create a new entry." 297 309 msgstr "Pas encore de billet. Créez une nouveau billet." 298 310 299 #: index.php:33 4311 #: index.php:331 300 312 msgid "Email formatting" 301 313 msgstr "Format des emails" 302 314 303 #: index.php:33 5315 #: index.php:332 304 316 msgid "You can format the emails using the following tags." 305 317 msgstr "Vous pouvez formater les emails en utilisant les balises suivantes." 306 318 307 #: index.php:33 6319 #: index.php:333 308 320 msgid "Each tag will be replaced by the associated value." 309 321 msgstr "Chaque balise sera remplacée par la valeur associée." 310 322 311 #: index.php:33 7323 #: index.php:334 312 324 msgid "Tags available in all the contexts" 313 325 msgstr "Balises disponibles dans tous les contextes" 314 326 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 355 328 #: index.php:372 356 329 #: index.php:397 357 330 #: index.php:422 331 msgid "Tag" 332 msgstr "Balise" 333 334 #: index.php:338 335 #: index.php:372 336 #: index.php:397 337 #: index.php:422 338 msgid "Value" 339 msgstr "Valeur" 340 341 #: index.php:346 342 msgid "Email sent when an account is created or if a subscriber request it" 343 msgstr "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 349 msgid "Subject" 350 msgstr "Sujet" 351 352 #: index.php:354 353 #: index.php:385 354 #: index.php:410 355 #: index.php:435 356 msgid "Content" 357 msgstr "Contenu" 358 359 #: index.php:362 360 msgid "Email sent when a subscriber subscribe to the comments of a post" 361 msgstr "Email envoyé quand un abonné s'abonne aux commentaires d'un billet" 362 363 #: index.php:367 364 msgid "Send an email for each subscription to the comments of a post" 365 msgstr "Envoyer un email pour chaque abonnement aux commentaires d'un billet" 366 367 #: index.php:369 368 #: index.php:394 369 #: index.php:419 358 370 msgid "Available tags" 359 371 msgstr "Balises disponibles" 360 372 361 #: index.php:39 6373 #: index.php:393 362 374 msgid "Email sent when a new comment is published" 363 375 msgstr "Email envoyé quand un nouveau commentaire est publié" 364 376 365 #: index.php:4 21377 #: index.php:418 366 378 msgid "Email sent when a subscriber want to change his email address" 367 379 msgstr "Email envoyé quand un abonné veut changer d'adresse email" 368 380 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 376 383 msgid "Display" 377 384 msgstr "Affichage" 378 385 379 #: index.php:45 3386 #: index.php:450 380 387 msgid "This plugin needs to add some code on the post page." 381 388 msgstr "Ce plugin a besoin d'ajouter du code sur la page du billet." 382 389 383 #: index.php:45 4390 #: index.php:451 384 391 msgid "This can be done automatically by checking the following checkboxes." 385 392 msgstr "Cela peut être fait automatiquement en cochant les cases suivantes." 386 393 387 #: index.php:45 5394 #: index.php:452 388 395 msgid "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 :" 389 396 msgstr "Si vous voulez modifier l'affichage sur la page du billet, décochez les cases suivantes et suivez les instructions sous chaque case :" 390 397 391 #: index.php:45 6398 #: index.php:453 392 399 #, php-format 393 400 msgid "You can use the plugin <strong>%s</strong> to edit the file <strong>post.html</strong>." 394 401 msgstr "Vous pousez utiliser le plugin <strong>%s</strong> pour éditer le fichier <strong>post.html</strong>." 395 402 403 #: index.php:454 404 msgid "Theme Editor" 405 msgstr "" 406 396 407 #: index.php:457 397 msgid "Theme Editor"398 msgstr ""399 400 #: index.php:460401 408 #, php-format 402 409 msgid "Install %s on the post page." 403 410 msgstr "Installer %s sur la page du billet." 404 411 405 #: index.php:46 6412 #: index.php:463 406 413 #, php-format 407 414 msgid "Add the <strong>%s</strong> checkbox in the comment form" 408 415 msgstr "Ajouter la case <strong>%s</strong> dans le formulaire de commentaire" 409 416 410 #: index.php:4 71411 #: index.php:4 91412 #: index.php:50 7417 #: index.php:468 418 #: index.php:488 419 #: index.php:504 413 420 msgid "or" 414 421 msgstr "ou" 415 422 416 #: index.php:4 72423 #: index.php:469 417 424 msgid "insert this in the comment form (suggestion : in the <code><fieldset></code> before the <code></form></code> tag) :" 418 425 msgstr "insérez ceci dans le formulaire de commentaire (suggestion : dans le <code><fieldset></code> avant la balise <code></form></code>) :" 419 426 420 #: index.php:47 9427 #: index.php:476 421 428 #, php-format 422 429 msgid "If the <strong>%s</strong> checkbox is not displayed correctly and the blog use Blowup or Blue Silence theme, check this :" 423 430 msgstr "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 :" 424 431 425 #: index.php:48 6432 #: index.php:483 426 433 #, php-format 427 434 msgid "Add a CSS rule to style the <strong>%1$s</strong> checkbox" 428 435 msgstr "Ajouter une règle CSS pour styler la case <strong>%1$s</strong>" 429 436 430 #: index.php:4 92437 #: index.php:489 431 438 msgid "add this CSS rule at the end of the file <strong>style.css</strong>" 432 439 msgstr "ajoutez cette règle CSS à la fin du fichier <strong>style.css</strong>" 433 440 434 #: index.php: 502441 #: index.php:499 435 442 #, php-format 436 443 msgid "Add a link to the <strong>%s</strong> page between the comments and the trackbacks" 437 444 msgstr "Ajouter un lien vers la page <strong>%s</strong> entre les commentaires et les rétroliens" 438 445 439 #: index.php:50 8446 #: index.php:505 440 447 msgid "insert this anywhere on the page (suggestion : just after the <code></form></code> tag) :" 441 448 msgstr "insérez ceci n'importe où dans la page (suggestion : juste après la balise <code></form></code>) :" 442 449 450 #: index.php:517 451 #: index.php:519 452 msgid "Help" 453 msgstr "" 454 443 455 #: index.php:520 444 #: index.php:522445 msgid "Help"446 msgstr ""447 448 #: index.php:523449 456 #, php-format 450 457 msgid "%s send notification emails to the subscribers of a post when :" 451 458 msgstr "%s envoie des emails de notification aux abonnés d'un billet quand :" 452 459 453 #: index.php:52 5460 #: index.php:522 454 461 msgid "a comment is posted and published immediatly" 455 462 msgstr "un commentaire est posté et publié immédiatement" 456 463 457 #: index.php:52 6464 #: index.php:523 458 465 msgid "a pending comment is published" 459 466 msgstr "un commentaire en attente est publié à partir de l'interface d'administation" 460 467 461 #: index.php:52 8468 #: index.php:525 462 469 msgid "If this weblog is hosted by free.fr, create a <code>/sessions/</code> directory in the root directory of the website." 463 470 msgstr "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." 464 471 465 #: index.php:52 9472 #: index.php:526 466 473 msgid "To use this plugin, you have to test if the server can send emails :" 467 474 msgstr "Pour utiliser ce plugin, vous devez tester si le serveur peut envoyer des emails :" 468 475 469 #: index.php:5 32476 #: index.php:529 470 477 msgid "Test" 471 478 msgstr "Test" 472 479 473 #: index.php:53 9480 #: index.php:536 474 481 #, php-format 475 482 msgid "This will send a email, if you don't receive it, try to <a href=\"%s\">change the way Dotclear send emails</a>." 476 483 msgstr "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>" 477 484 478 #: index.php:5 42485 #: index.php:539 479 486 msgid "Try to send an email" 480 487 msgstr "Essayer d'envoyer un email" 481 488 482 #: index.php:54 6489 #: index.php:543 483 490 #, php-format 484 491 msgid "Inspired by <a href=\"%1$s\">%2$s</a>" 485 492 msgstr "Inspiré par <a href=\"%1$s\">%2$s</a>" 486 493 487 #: index.php:54 8494 #: index.php:545 488 495 msgid "Subscribe to comments for WordPress" 489 496 msgstr "Subscribe to comments pour WordPress" 490 497 498 #~ msgid "Activate %s" 499 #~ msgstr "Activer %s" 500
Note: See TracChangeset
for help on using the changeset viewer.