Dotclear

Changeset 510


Ignore:
Timestamp:
10/02/08 19:30:30 (15 years ago)
Author:
Moe
google:author:
appears
Message:

Subscribe to comments 1.2.3 :

  • fixed bug with PostgreSQL
  • added ability to change From: header on outbound emails
Location:
plugins/subscribeToComments
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • plugins/subscribeToComments/_define.php

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

    r490 r510  
    8989               'string','Allowed post types',true,true); 
    9090     } 
     91     # Change From: header of outbound emails 
     92     if (version_compare($i_version,'1.2.3','<')) { 
     93          $core->blog->settings->setNameSpace('subscribetocomments'); 
     94          $core->blog->settings->put('subscribetocomments_email_from', 
     95               'dotclear@'.$_SERVER['HTTP_HOST'], 
     96               'string','Change From: header of outbound emails',true,true); 
     97     } 
    9198} 
    9299  
  • plugins/subscribeToComments/class.subscriber.php

    r501 r510  
    235235                    { 
    236236                         $core->con->execute('DELETE FROM '.$core->prefix.'meta WHERE '. 
    237                               '(post_id = \''.$v.'\') AND (meta_type = \'subscriber\') AND '. 
     237                              '(post_id = '.$v.') AND (meta_type = \'subscriber\') AND '. 
    238238                              '(meta_id = \''.$this->id.'\');'); 
    239239                    } 
  • plugins/subscribeToComments/default-templates/subscribetocomments.html

    r489 r510  
    7878                              {{tpl:EntryTitle encode_html="1"}}</a></p> 
    7979                         <tpl:EntryIf show_comments="1"> 
    80                                    <h3>{{tpl:lang Subscribe to one entry}}</h3> 
     80                              <h3>{{tpl:lang Subscribe to one entry}}</h3> 
    8181                         </tpl:EntryIf> 
    8282                    </tpl:SubscribeToCommentsEntryIf> 
  • plugins/subscribeToComments/default_settings.php

    r489 r510  
    1010$core->blog->settings->put('subscribetocomments_active',true, 
    1111'boolean','Activate Subscribe to comments'); 
     12 
     13# Change From: header of outbound emails 
     14$core->blog->settings->put('subscribetocomments_email_from', 
     15'dotclear@'.$_SERVER['HTTP_HOST'], 
     16'string','Change From: header of outbound emails'); 
    1217 
    1318# Allowed post types 
  • plugins/subscribeToComments/index.php

    r499 r510  
    154154               (!empty($_POST['subscribetocomments_active'])),'boolean', 
    155155               'Activate Subscribe to comments'); 
     156 
     157          subscribeToComments::checkEmail( 
     158               $_POST['subscribetocomments_email_from']); 
     159          # Change From: header of outbound emails 
     160          $core->blog->settings->put('subscribetocomments_email_from', 
     161               $_POST['subscribetocomments_email_from'], 
     162               'text','Change From: header of outbound emails');            
    156163 
    157164          # Allowed post types 
     
    291298                    <?php printf(__('Activate %s'),__('Subscribe to comments')); ?></label> 
    292299               </p> 
     300               <p> 
     301                    <label class="classic" for="subscribetocomments_email_from"> 
     302                    <?php echo(__('Change From: header of outbound emails:')); ?> 
     303                    </label> 
     304                    <?php echo(form::field('subscribetocomments_email_from',80,80, 
     305                         $core->blog->settings->subscribetocomments_email_from)); ?>. 
     306               </p> 
    293307 
    294308               <h3><?php echo(__('Post types')); ?></h3> 
  • plugins/subscribeToComments/lib.subscribeToComments.php

    r499 r510  
    242242                    $core->prefix.'comment_subscriber S '. 
    243243                    'INNER JOIN '.$core->prefix.'meta M ON '. 
    244                     '(M.post_id = \''.$cur->post_id.'\') AND '. 
    245                     '(M.meta_type = \'subscriber\') AND (S.id = M.meta_id)'. 
     244                    (($core->con->driver() == 'pgsql') ? 
     245                    # CAST = PostgreSQL compatibility : 
     246                    # PGSQL need datas of the same type to compare 
     247                    '(S.id = CAST(M.meta_id AS integer))':  
     248                    '(S.id = M.meta_id)'). 
     249                    ' AND (M.meta_type = \'subscriber\') AND (M.post_id = '.$cur->post_id.')'. 
    246250                    ' AND (S.email != \''.$cur->comment_email.'\')'. 
    247251                    ' AND (S.status = \'1\');' 
     
    292296     public static function mail($to,$subject,$content) 
    293297     { 
     298          global $core; 
     299 
    294300          $headers = array( 
    295                'From: dotclear@'.$_SERVER['HTTP_HOST'], 
     301               'From: '.$core->blog->settings->subscribetocomments_email_from, 
    296302               'MIME-Version: 1.0', 
    297303               'Content-Type: text/plain; charset=UTF-8;', 
  • plugins/subscribeToComments/locales/fr/main.po

    r499 r510  
    33"Project-Id-Version: Subscribe to comments\n" 
    44"Report-Msgid-Bugs-To: \n" 
    5 "POT-Creation-Date: 2008-09-17 14:12+0100\n" 
    6 "PO-Revision-Date: 2008-09-17 14:13+0100\n" 
     5"POT-Creation-Date: 2008-10-02 19:10+0100\n" 
     6"PO-Revision-Date: 2008-10-02 19:11+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:83 
     19#: _public.php:65 
    2020#: class.subscriber.php:147 
    2121msgid "Invalid post ID." 
    2222msgstr "Identifiant du billet invalide." 
    2323 
    24 #: _public.php:140 
     24#: _public.php:123 
    2525msgid "Account informations sent" 
    2626msgstr "Informations sur le compte envoyées" 
    2727 
    28 #: _public.php:141 
     28#: _public.php:124 
    2929msgid "Subscriptions removed" 
    3030msgstr "Abonnements effacés" 
    3131 
    32 #: _public.php:142 
     32#: _public.php:125 
    3333msgid "Logged out" 
    3434msgstr "Déconnecté" 
    3535 
    36 #: _public.php:143 
    37 #: _public.php:443 
     36#: _public.php:126 
     37#: _public.php:431 
    3838msgid "Logged in" 
    3939msgstr "Connecté" 
    4040 
    41 #: _public.php:144 
     41#: _public.php:127 
    4242msgid "Emails blocked" 
    4343msgstr "Emails bloqués" 
    4444 
    45 #: _public.php:145 
     45#: _public.php:128 
    4646msgid "Emails allowed" 
    4747msgstr "Emails autorisés" 
    4848 
    49 #: _public.php:147 
     49#: _public.php:130 
    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:148 
     53#: _public.php:131 
    5454msgid "Email address changed" 
    5555msgstr "Adresse email changée" 
    5656 
    57 #: _public.php:149 
     57#: _public.php:132 
    5858msgid "Account deleted" 
    5959msgstr "Compte supprimé" 
    6060 
    61 #: _public.php:150 
     61#: _public.php:133 
    6262msgid "Subscribed to the entry" 
    6363msgstr "Abonné au billet" 
    6464 
    65 #: _public.php:450 
    66 #: index.php:453 
    67 #: index.php:466 
    68 #: index.php:473 
     65#: _public.php:438 
     66#: index.php:467 
     67#: index.php:480 
     68#: index.php:487 
    6969msgid "Receive following comments by email" 
    7070msgstr "Recevoir les commentaires suivants par email" 
    7171 
    72 #: _public.php:509 
     72#: _public.php:497 
    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:510 
     76#: _public.php:498 
    7777msgid "Subscribe to receive following comments by email" 
    7878msgstr "S'abonner pour recevoir les commentaires suivants par email" 
     
    8383 
    8484#: lib.subscribeToComments.php:54 
    85 #: class.subscriber.php:461 
     85#: class.subscriber.php:480 
    8686msgid "Invalid key." 
    8787msgstr "Clé invalide." 
     
    113113#: index.php:79 
    114114#: index.php:144 
    115 #: index.php:240 
    116 #: index.php:274 
    117 #: index.php:291 
    118 #: index.php:296 
    119 #: index.php:447 
    120 #: index.php:489 
    121 #: index.php:509 
     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 
    122122msgid "Subscribe to comments" 
    123123msgstr "Abonnement aux commentaires" 
    124124 
    125 #: default_settings.php:22 
     125#: default_settings.php:27 
    126126msgid "Hello [email]," 
    127127msgstr "" 
    128128 
    129 #: default_settings.php:24 
     129#: default_settings.php:29 
    130130msgid "To manage your subscriptions, change your email address or block emails, click here : [manageurl]" 
    131131msgstr "" 
    132132 
    133 #: default_settings.php:28 
     133#: default_settings.php:33 
    134134msgid "Your account on [blogname]" 
    135135msgstr "" 
    136136 
    137 #: default_settings.php:34 
     137#: default_settings.php:39 
    138138msgid "here are some informations about your account on [blogname] :" 
    139139msgstr "" 
    140140 
    141 #: default_settings.php:35 
     141#: default_settings.php:40 
    142142msgid "Email address : [email]" 
    143143msgstr "" 
    144144 
    145 #: default_settings.php:45 
     145#: default_settings.php:50 
    146146msgid "Subscribed to [posttitle] - [blogname]" 
    147147msgstr "" 
    148148 
    149 #: default_settings.php:51 
     149#: default_settings.php:56 
    150150msgid "you subscribed to [posttitle] : [posturl]" 
    151151msgstr "" 
    152152 
    153 #: default_settings.php:59 
     153#: default_settings.php:64 
    154154msgid "New comment on [posttitle] - [blogname]" 
    155155msgstr "" 
    156156 
    157 #: default_settings.php:65 
     157#: default_settings.php:70 
    158158msgid "a new comment has been posted by [commentauthor] on [posttitle] :" 
    159159msgstr "" 
    160160 
    161 #: default_settings.php:69 
     161#: default_settings.php:74 
    162162msgid "View the comment : [commenturl]" 
    163163msgstr "" 
    164164 
    165 #: default_settings.php:70 
     165#: default_settings.php:75 
    166166msgid "View the post : [posturl]" 
    167167msgstr "" 
    168168 
    169 #: default_settings.php:78 
     169#: default_settings.php:83 
    170170msgid "Change email address on [blogname]" 
    171171msgstr "" 
    172172 
    173 #: default_settings.php:84 
     173#: default_settings.php:89 
    174174msgid "you have requested to change the email address of your subscriptions to [newemail], click on this link : [emailurl]" 
    175175msgstr "" 
    176176 
    177 #: default_settings.php:85 
     177#: default_settings.php:90 
    178178msgid "This link is valid for 24 hours." 
    179179msgstr "" 
     
    189189 
    190190#: class.subscriber.php:196 
    191 #: class.subscriber.php:466 
     191#: class.subscriber.php:485 
    192192msgid "This email address already exists." 
    193193msgstr "Cette adresse email existe déjà." 
    194194 
    195 #: class.subscriber.php:470 
     195#: class.subscriber.php:489 
    196196msgid "Link expired, request another email." 
    197197msgstr "Lien périmé, demandez un autre email." 
     
    206206 
    207207#: index.php:77 
    208 #: index.php:520 
     208#: index.php:534 
    209209msgid "Email address" 
    210210msgstr "Adresse email" 
     
    255255msgstr "Le plugin %s fonctionne." 
    256256 
    257 #: index.php:225 
     257#: index.php:232 
    258258msgid "Test email sent." 
    259259msgstr "Email test envoyé." 
    260260 
    261 #: index.php:229 
     261#: index.php:236 
    262262msgid "Configuration successfully updated." 
    263263msgstr "Configuration mise à jour avec succès." 
    264264 
    265 #: index.php:280 
     265#: index.php:287 
    266266msgid "Error:" 
    267267msgstr "Erreur:" 
    268268 
    269 #: index.php:281 
     269#: index.php:288 
    270270msgid "Unable to find metadata plugin" 
    271271msgstr "Impossible de trouver l'extension metadata" 
    272272 
    273 #: index.php:285 
     273#: index.php:292 
    274274msgid "Settings" 
    275275msgstr "Paramètres" 
    276276 
    277 #: index.php:291 
     277#: index.php:298 
    278278#, php-format 
    279279msgid "Activate %s" 
    280280msgstr "Activer %s" 
    281281 
    282 #: index.php:294 
     282#: index.php:302 
     283msgid "Change From: header of outbound emails:" 
     284msgstr "Changer l'entête From: des emails sortants :" 
     285 
     286#: index.php:308 
    283287msgid "Post types" 
    284288msgstr "Types de billets" 
    285289 
    286 #: index.php:295 
     290#: index.php:309 
    287291#, php-format 
    288292msgid "Activate %s with the following post types :" 
    289293msgstr "Activer %s pour les types de billets suivants :" 
    290294 
    291 #: index.php:314 
     295#: index.php:328 
    292296msgid "No entry yet. Create a new entry." 
    293297msgstr "Pas encore de billet. Créez une nouveau billet." 
    294298 
    295 #: index.php:320 
     299#: index.php:334 
    296300msgid "Email formatting" 
    297301msgstr "Format des emails" 
    298302 
    299 #: index.php:321 
     303#: index.php:335 
    300304msgid "You can format the emails using the following tags." 
    301305msgstr "Vous pouvez formater les emails en utilisant les balises suivantes." 
    302306 
    303 #: index.php:322 
     307#: index.php:336 
    304308msgid "Each tag will be replaced by the associated value." 
    305309msgstr "Chaque balise sera remplacée par la valeur associée." 
    306310 
    307 #: index.php:323 
     311#: index.php:337 
    308312msgid "Tags available in all the contexts" 
    309313msgstr "Balises disponibles dans tous les contextes" 
    310314 
    311 #: index.php:327 
    312 #: index.php:361 
    313 #: index.php:386 
    314 #: index.php:411 
     315#: index.php:341 
     316#: index.php:375 
     317#: index.php:400 
     318#: index.php:425 
    315319msgid "Tag" 
    316320msgstr "Balise" 
    317321 
    318 #: index.php:327 
    319 #: index.php:361 
    320 #: index.php:386 
    321 #: index.php:411 
     322#: index.php:341 
     323#: index.php:375 
     324#: index.php:400 
     325#: index.php:425 
    322326msgid "Value" 
    323327msgstr "Valeur" 
    324328 
    325 #: index.php:335 
     329#: index.php:349 
    326330msgid "Email sent when an account is created or if a subscriber request it" 
    327331msgstr "Email envoyé quand un compte est créé ou si un abonné le demande" 
    328332 
    329 #: index.php:337 
    330 #: index.php:368 
    331 #: index.php:393 
    332 #: index.php:418 
     333#: index.php:351 
     334#: index.php:382 
     335#: index.php:407 
     336#: index.php:432 
    333337msgid "Subject" 
    334338msgstr "Sujet" 
    335339 
    336 #: index.php:343 
    337 #: index.php:374 
    338 #: index.php:399 
    339 #: index.php:424 
     340#: index.php:357 
     341#: index.php:388 
     342#: index.php:413 
     343#: index.php:438 
    340344msgid "Content" 
    341345msgstr "Contenu" 
    342346 
    343 #: index.php:351 
     347#: index.php:365 
    344348msgid "Email sent when a subscriber subscribe to the comments of a post" 
    345349msgstr "Email envoyé quand un abonné s'abonne aux commentaires d'un billet" 
    346350 
    347 #: index.php:356 
     351#: index.php:370 
    348352msgid "Send an email for each subscription to the comments of a post" 
    349353msgstr "Envoyer un email pour chaque abonnement aux commentaires d'un billet" 
    350354 
    351 #: index.php:358 
    352 #: index.php:383 
    353 #: index.php:408 
     355#: index.php:372 
     356#: index.php:397 
     357#: index.php:422 
    354358msgid "Available tags" 
    355359msgstr "Balises disponibles" 
    356360 
    357 #: index.php:382 
     361#: index.php:396 
    358362msgid "Email sent when a new comment is published" 
    359363msgstr "Email envoyé quand un nouveau commentaire est publié" 
    360364 
    361 #: index.php:407 
     365#: index.php:421 
    362366msgid "Email sent when a subscriber want to change his email address" 
    363367msgstr "Email envoyé quand un abonné veut changer d'adresse email" 
    364368 
    365 #: index.php:432 
    366 #: index.php:502 
     369#: index.php:446 
     370#: index.php:516 
    367371msgid "Save configuration" 
    368372msgstr "Enregistrer la configuration" 
    369373 
    370 #: index.php:436 
    371 #: index.php:437 
     374#: index.php:450 
     375#: index.php:451 
    372376msgid "Display" 
    373377msgstr "Affichage" 
    374378 
    375 #: index.php:439 
     379#: index.php:453 
    376380msgid "This plugin needs to add some code on the post page." 
    377381msgstr "Ce plugin a besoin d'ajouter du code sur la page du billet." 
    378382 
    379 #: index.php:440 
     383#: index.php:454 
    380384msgid "This can be done automatically by checking the following checkboxes." 
    381385msgstr "Cela peut être fait automatiquement en cochant les cases suivantes." 
    382386 
    383 #: index.php:441 
     387#: index.php:455 
    384388msgid "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 :" 
    385389msgstr "Si vous voulez modifier l'affichage sur la page du billet, décochez les cases suivantes et suivez les instructions sous chaque case :" 
    386390 
    387 #: index.php:442 
     391#: index.php:456 
    388392#, php-format 
    389393msgid "You can use the plugin <strong>%s</strong> to edit the file <strong>post.html</strong>." 
    390394msgstr "Vous pousez utiliser le plugin <strong>%s</strong> pour éditer le fichier <strong>post.html</strong>." 
    391395 
    392 #: index.php:443 
     396#: index.php:457 
    393397msgid "Theme Editor" 
    394398msgstr "" 
    395399 
    396 #: index.php:446 
     400#: index.php:460 
    397401#, php-format 
    398402msgid "Install %s on the post page." 
    399403msgstr "Installer %s sur la page du billet." 
    400404 
    401 #: index.php:452 
     405#: index.php:466 
    402406#, php-format 
    403407msgid "Add the <strong>%s</strong> checkbox in the comment form" 
    404408msgstr "Ajouter la case <strong>%s</strong> dans le formulaire de commentaire" 
    405409 
    406 #: index.php:457 
    407 #: index.php:477 
    408 #: index.php:493 
     410#: index.php:471 
     411#: index.php:491 
     412#: index.php:507 
    409413msgid "or" 
    410414msgstr "ou" 
    411415 
    412 #: index.php:458 
     416#: index.php:472 
    413417msgid "insert this in the comment form (suggestion : in the <code>&lt;fieldset&gt;</code> before the <code>&lt;/form&gt;</code> tag) :" 
    414418msgstr "insérez ceci dans le formulaire de commentaire (suggestion : dans le <code>&lt;fieldset&gt;</code> avant la balise <code>&lt;/form&gt;</code>) :" 
    415419 
    416 #: index.php:465 
     420#: index.php:479 
    417421#, php-format 
    418422msgid "If the <strong>%s</strong> checkbox is not displayed correctly and the blog use Blowup or Blue Silence theme, check this :" 
    419423msgstr "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 :" 
    420424 
    421 #: index.php:472 
     425#: index.php:486 
    422426#, php-format 
    423427msgid "Add a CSS rule to style the <strong>%1$s</strong> checkbox" 
    424428msgstr "Ajouter une règle CSS pour styler la case <strong>%1$s</strong>" 
    425429 
    426 #: index.php:478 
     430#: index.php:492 
    427431msgid "add this CSS rule at the end of the file <strong>style.css</strong>" 
    428432msgstr "ajoutez cette règle CSS à la fin du fichier <strong>style.css</strong>" 
    429433 
    430 #: index.php:488 
     434#: index.php:502 
    431435#, php-format 
    432436msgid "Add a link to the <strong>%s</strong> page between the comments and the trackbacks" 
    433437msgstr "Ajouter un lien vers la page <strong>%s</strong> entre les commentaires et les rétroliens" 
    434438 
    435 #: index.php:494 
     439#: index.php:508 
    436440msgid "insert this anywhere on the page (suggestion : just after the <code>&lt;/form&gt;</code> tag) :" 
    437441msgstr "insérez ceci n'importe où dans la page (suggestion : juste après la balise <code>&lt;/form&gt;</code>) :" 
    438442 
    439 #: index.php:506 
    440 #: index.php:508 
     443#: index.php:520 
     444#: index.php:522 
    441445msgid "Help" 
    442446msgstr "" 
    443447 
    444 #: index.php:509 
     448#: index.php:523 
    445449#, php-format 
    446450msgid "%s send notification emails to the subscribers of a post when :" 
    447451msgstr "%s envoie des emails de notification aux abonnés d'un billet quand :" 
    448452 
    449 #: index.php:511 
     453#: index.php:525 
    450454msgid "a comment is posted and published immediatly" 
    451455msgstr "un commentaire est posté et publié immédiatement" 
    452456 
    453 #: index.php:512 
     457#: index.php:526 
    454458msgid "a pending comment is published" 
    455459msgstr "un commentaire en attente est publié à partir de l'interface d'administation" 
    456460 
    457 #: index.php:514 
     461#: index.php:528 
    458462msgid "If this weblog is hosted by free.fr, create a <code>/sessions/</code> directory in the root directory of the website." 
    459463msgstr "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." 
    460464 
    461 #: index.php:515 
     465#: index.php:529 
    462466msgid "To use this plugin, you have to test if the server can send emails :" 
    463467msgstr "Pour utiliser ce plugin, vous devez tester si le serveur peut envoyer des emails :" 
    464468 
    465 #: index.php:518 
     469#: index.php:532 
    466470msgid "Test" 
    467471msgstr "Test" 
    468472 
    469 #: index.php:525 
     473#: index.php:539 
    470474#, php-format 
    471475msgid "This will send a email, if you don't receive it, try to <a href=\"%s\">change the way Dotclear send emails</a>." 
    472476msgstr "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>" 
    473477 
    474 #: index.php:528 
     478#: index.php:542 
    475479msgid "Try to send an email" 
    476480msgstr "Essayer d'envoyer un email" 
    477481 
    478 #: index.php:532 
     482#: index.php:546 
    479483#, php-format 
    480484msgid "Inspired by <a href=\"%1$s\">%2$s</a>" 
    481485msgstr "Inspiré par <a href=\"%1$s\">%2$s</a>" 
    482486 
    483 #: index.php:534 
     487#: index.php:548 
    484488msgid "Subscribe to comments for WordPress" 
    485489msgstr "Subscribe to comments pour WordPress" 
Note: See TracChangeset for help on using the changeset viewer.

Sites map