Dotclear

Changeset 793


Ignore:
Timestamp:
02/21/09 00:49:57 (15 years ago)
Author:
kwon
Message:

newsletter rc8 ; solved Ticket #67, Ticket #69, etc

Location:
plugins/newsletter/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • plugins/newsletter/trunk/_admin.php

    r788 r793  
    5757               $w->create(pluginNewsletter::pname(), __('Newsletter'), array('WidgetsNewsletter', 'widget')); 
    5858 
    59          $w->newsletter->setting('title', __('Title:'), __('Newsletter')); 
     59               $w->newsletter->setting('title', __('Title:'), __('Newsletter')); 
    6060               $w->newsletter->setting('showtitle', __('Show title'), 1, 'check'); 
    6161               $w->newsletter->setting('homeonly', __('Home page only'), 0, 'check'); 
     
    7272     * avant suppression du plugin par le gestionnaire, on le déinstalle proprement 
    7373     */ 
    74    public static function pluginsBeforeDelete($plugin) 
    75    { 
     74     public static function pluginsBeforeDelete($plugin) 
     75     { 
    7676          global $core; 
    77       try { 
    78           $name = (string) $plugin['name']; 
    79          if (strcmp($name, pluginNewsletter::pname()) == 0) { 
    80           require dirname(__FILE__).'/class.admin.php'; 
    81             adminNewsletter::Uninstall(); 
    82           } 
     77          try { 
     78               $name = (string) $plugin['name']; 
     79               if (strcmp($name, pluginNewsletter::pname()) == 0) { 
     80                    require dirname(__FILE__).'/class.admin.php'; 
     81                    adminNewsletter::Uninstall(); 
     82               } 
    8383          } catch (Exception $e) {  
    8484               $core->error->add($e->getMessage());  
     
    8989     * après création d'un billet dans l'admin 
    9090     */ 
    91    public static function adminAutosend($cur, $post_id) 
    92    { 
    93      dcNewsletter::autosendNewsletter(); 
    94    } 
     91     public static function adminAutosend($cur, $post_id) 
     92     { 
     93          dcNewsletter::autosendNewsletter(); 
     94     } 
    9595} 
    9696      
  • plugins/newsletter/trunk/changelog.txt

    r790 r793  
    66* ajout d'une période de temps pour les billets de la newsletter (fixée à 1 mois dans cette version)  
    77* remaniement du code 
    8 * resolution du Ticket #47 : bug d'affichage d'une page vide lors du submit 
     8* correction du Ticket #47 : bug d'affichage d'une page vide lors du submit 
    99* resolution du Ticket #61 : bug avec le caratère '=' dans l'URL 
    1010* resolution du Ticket #62 : bug dans l'envoi automatique 
    1111* résolution du Ticket #65 : création de templates spécifiques 
    1212* résolution du Ticket #67 : définir l'intitulé du bouton "S'abonner"  
    13  
     13* correction de la mise en page du widget 
     14* résolution du Ticket #69 : inclure une partie du contenu du post dans la mail 
     15* correction de la fonction suspend en mode page 
    1416 
    15173.4.2 
  • plugins/newsletter/trunk/class.admin.php

    r788 r793  
    290290          try { 
    291291               $blog = &$core->blog; 
    292            $auth = &$core->auth; 
     292               $auth = &$core->auth; 
    293293               $url = &$core->url; 
    294294               $themes = &$core->themes; 
     
    299299 
    300300               // paramétrage de l'état d'activation du plugin 
    301            if (pluginNewsletter::isActive())  
    302                $pactive = 'checked'; 
     301               if (pluginNewsletter::isActive())  
     302                    $pactive = 'checked'; 
    303303               else  
    304304                    $pactive = ''; 
     
    310310 
    311311               $feditorname = pluginNewsletter::getEditorName(); 
    312           $feditoremail = pluginNewsletter::getEditorEmail(); 
    313           $fmode = pluginNewsletter::getSendMode(); 
    314           $fmaxposts = pluginNewsletter::getMaxPosts(); 
     312               $feditoremail = pluginNewsletter::getEditorEmail(); 
     313               $fmode = pluginNewsletter::getSendMode(); 
     314               $fmaxposts = pluginNewsletter::getMaxPosts(); 
    315315               $fautosend = pluginNewsletter::getAutosend(); 
    316316               $fcaptcha = pluginNewsletter::getCaptcha(); 
     317               $f_view_content_post = pluginNewsletter::getViewContentPost(); 
     318               $f_size_content_post = pluginNewsletter::getSizeContentPost(); 
    317319               /* 
    318320               $f_subscribe_link = pluginNewsletter::getSubscribeLink(); 
     
    322324               //*/ 
    323325 
    324           $core->themes = new dcModules($core); 
    325           $core->themes->loadModules($blog->themes_path, NULL); 
    326           $theme = $blog->settings->theme; 
     326               $core->themes = new dcModules($core); 
     327               $core->themes->loadModules($blog->themes_path, NULL); 
     328               $theme = $blog->settings->theme; 
    327329               $bthemes = array(); 
    328330               foreach ($themes->getModules() as $k => $v) 
     
    332334               } 
    333335                
    334              echo 
     336               echo 
    335337               '<fieldset>' . 
    336338 
     
    378380                              form::combo(array('fmode'), $mode_combo, $fmode). 
    379381                              '</label></p>'. 
     382                              '<p class="field">'. 
     383                              form::checkbox('f_view_content_post',1,$f_view_content_post). 
     384                              '<label class="classic" for="f_view_content_post">'.__('View contents posts'). 
     385                              '</label></p>'. 
     386                              '<p><label class="classic" for="f_size_content_post">'. __('Size contents posts').' : '. 
     387                              form::field(array('f_size_content_post'),4,4, $f_size_content_post). 
     388                              '</label></p>'.                                                             
    380389                              /* for 3.5.1 : add period 
    381390                              '<p class="field">'. 
     
    450459               } 
    451460               //*/ 
     461          } catch (Exception $e) {  
     462               $core->error->add($e->getMessage());  
    452463          } 
    453          catch (Exception $e) { $core->error->add($e->getMessage()); } 
    454464     } 
    455  
    456      /** 
    457      * notice d'utilisation 
    458      */ 
    459      /* déplacée dans l'aide en ligne 
    460      public static function Usage() 
    461      { 
    462         echo 
    463           '<fieldset>' . 
    464           '<legend>'.__('Gestion').'</legend>'. 
    465           '</fieldset>'. 
    466           '<fieldset>' . 
    467           '<legend>'.__('Settings').'</legend>'. 
    468                __('Change settings:').'<br /><a href="'.pluginNewsletter::admin().'&tab=settings" title="'.__('Clic here to edit your settings.').'">'.__('Clic here to edit your settings.').'</a>'. 
    469           '</fieldset>'. 
    470           '<fieldset>' . 
    471           '<legend>'.__('Widget').'</legend>'. 
    472                __('Widget manager:').'<br /><a href="'.pluginNewsletter::urlwidgets().'" title="'.__('Clic here to edit your widgets.').'">'.__('Clic here to edit your widgets.').'</a>'. 
    473           '</fieldset>'. 
    474           '<fieldset>' . 
    475           '<legend>'.__('Theme').'</legend>'. 
    476                __('Theme integration:'). 
    477                '<ul>'. 
    478                     '<li>'. 
    479                          __('You can add this code into your theme to display the Newsletter subscription form:').'<br />'. 
    480                          '<span class="tpl">{{tpl:NewsletterSubscription}}</span>'. 
    481                     '</li>'. 
    482                '</ul>'. 
    483           '</fieldset>'; 
    484      } 
    485      //*/ 
    486  
    487      /** 
    488      * à propos du plugin 
    489      */ 
    490      /* déplacée dans l'aide en ligne    
    491      public static function About() 
    492      { 
    493         echo 
    494           '<fieldset>' . 
    495           '<legend>'.__('Authors').'</legend>'. 
    496                '<ul>'. 
    497                     '<li>'.'<a href="http://phoenix.cybride.net/" title="Olivier Le Bris">Olivier Le Bris</a>'.'</li>'. 
    498                '</ul>'. 
    499           '</fieldset>'. 
    500           '<fieldset>' . 
    501           '<legend>'.__('Licence').'</legend>'. 
    502                '<ul>'. 
    503                     '<li>'. 
    504                     '<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/fr/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/2.0/fr/88x31.png" /></a>'. 
    505                     '</li>'. 
    506                     '<li>'. 
    507                     __('This work is released under a ').'<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/fr/">'.__('Creative Commons contract').'</a>.'. 
    508                     '</li>'. 
    509                '</ul>'. 
    510           '</fieldset>'. 
    511           '<fieldset>' . 
    512           '<legend>'.__('Greets').'</legend>'. 
    513                '<ul>'. 
    514                '<li>'.__('Flannelle (http://flannelle.cybride.net/)').'</li>'. 
    515                '<li>'.__('Mumu (http://www.chez-mumu.com/blog/)').'</li>'. 
    516                '<li>'.__('Guizbizet (http://guillaumebizet.free.fr/)').'</li>'. 
    517                '<li>'.__('kinanveu').'</li>'. 
    518                '<li>'.__('baboon, Richard, brol, Vincent, Nathalie').'</li>'. 
    519                '<li>'.__('k-netweb.net, for Contact2 plugin for Dotclear 2').'</li>'. 
    520                '<li>'.__('All the peoples who tested it !').'</li>'. 
    521                '</ul>'. 
    522           '</fieldset>'. 
    523           '<fieldset>' . 
    524           '<legend>'.__('Usefull informations').'</legend>'. 
    525                '<ul>'. 
    526                     '<li>'.__('Support:').' <a href="http://www.cybride.net/redirect/support/'.pluginNewsletter::pname().'" title="'.__('Clic here to go to the support.').'">'.__('Clic here to go to the support.').'</a>'.'</li>'. 
    527                     '<li>'.__('Files:').' '.__('Read authors.txt and changelog.txt in the doc folder.').'</a>'.'</li>'. 
    528                     '<li>'.__('Dotclear:').' <a href="http://www.dotclear.net/" title="'.__('Clic here to go to Dotclear.').'">'.__('Clic here to go to Dotclear.').'</a>'.'</li>'. 
    529                '</ul>'. 
    530           '</fieldset>'; 
    531      } 
    532      //*/ 
    533465 
    534466     /** 
     
    541473 
    542474          $datas = dcNewsletter::getlist(); 
    543       if (!is_object($datas)) 
    544       { 
    545           echo __('No subscriber for this blog.'); 
    546       } else { 
     475          if (!is_object($datas)) { 
     476               echo __('No subscriber for this blog.'); 
     477          } else { 
    547478               global $core; 
    548               try 
    549               { 
    550                    $blog = &$core->blog; 
    551                    $settings = &$blog->settings; 
    552  
    553                    // début du tableau et en-têtes 
    554                 echo 
    555                    '<form action="plugin.php" method="post" name="listblog">' . 
    556                         $core->formNonce() . 
    557                         form::hidden(array('p'),pluginNewsletter::pname()). 
    558                         form::hidden(array('op'),'remove'). 
    559                         form::hidden(array('id'),''). 
    560                         '<table class="clear" id="userslist">'. 
    561                              '<tr>'. 
    562                                   '<th>&nbsp;</th>'. 
    563                                   '<th class="nowrap">'.__('Subscriber').'</th>' . 
    564                                   '<th class="nowrap">'.__('Subscribed').'</th>' . 
    565                                   '<th class="nowrap">'.__('Status').'</th>' . 
    566                                   '<th class="nowrap">'.__('Last sent').'</th>' . 
    567                                   '<th class="nowrap" colspan="2">'.__('Edit').'</th>'. 
    568                              '</tr>'; 
    569  
    570                    // parcours la liste pour l'affichage 
    571                 $datas->moveStart(); 
    572                 while ($datas->fetch()) 
    573                 { 
    574                         $k = (integer)$datas->subscriber_id; 
    575                         $editlink = 'onclick="ledit('.$k.'); return false"'; 
    576                     $guilink = '<a href="#" '.$editlink.' title="'.__('Edit subscriber').'"><img src="images/edit-mini.png" alt="'.__('Edit subscriber').'" /></a>'; 
    577  
    578                          if ($datas->subscribed != null) $subscribed = dt::dt2str('%d/%m/%Y', $datas->subscribed).' '.dt::dt2str('%H:%M', $datas->subscribed); 
    579                     else $subscribed = __('Never'); 
    580                          if ($datas->lastsent != null) $lastsent = dt::dt2str('%d/%m/%Y', $datas->lastsent).' '.dt::dt2str('%H:%M', $datas->lastsent); 
    581                     else $lastsent = __('Never'); 
    582  
    583                     echo 
    584                         '<tr class="line">'. 
    585                              '<td>'.form::checkbox(array('subscriber['.html::escapeHTML($k).']'), 1).'</td>'. 
    586                              '<td class="maximal nowrap">'.html::escapeHTML(text::cutString($datas->email, 50)).'</td>'. 
    587                              '<td class="minimal nowrap">'.html::escapeHTML(text::cutString($subscribed, 50)).'</td>'. 
    588                              '<td class="minimal nowrap">'.html::escapeHTML(text::cutString(__($datas->state), 50)).'</td>'. 
    589                              '<td class="minimal nowrap">'.html::escapeHTML(text::cutString($lastsent, 50)).'</td>'. 
    590                              '<td class="status">'.$guilink.'</td>'. 
    591                         '</tr>'; 
    592                    } 
    593  
    594                 $bstates = array(); 
    595                 $bstates['-'] = '-'; 
    596                 $bstates[__('Suspend')] = 'suspend'; 
    597                 $bstates[__('Disable')] = 'disable'; 
    598                 $bstates[__('Enable')] = 'enable'; 
    599                 $bstates[__('Last sent')] = 'lastsent'; 
    600  
    601                 $bmails = array(); 
    602                 $bmails[__('Newsletter')] = 'send'; 
    603                 $bmails[__('Confirm')] = 'sendconfirm'; 
    604                 $bmails[__('Suspend')] = 'sendsuspend'; 
    605                 $bmails[__('Disable')] = 'senddisable'; 
    606                 $bmails[__('Enable')] = 'sendenable'; 
    607  
    608                    // fermeture du tableau 
    609                 echo 
    610                    '</table>'. 
    611                     
    612                     
     479               try { 
     480                    $blog = &$core->blog; 
     481                    $settings = &$blog->settings; 
     482 
     483                    // début du tableau et en-têtes 
     484                    echo 
     485                    '<form action="plugin.php" method="post" name="listblog">' . 
     486                         $core->formNonce() . 
     487                         form::hidden(array('p'),pluginNewsletter::pname()). 
     488                         form::hidden(array('op'),'remove'). 
     489                         form::hidden(array('id'),''). 
     490                         '<table class="clear" id="userslist">'. 
     491                              '<tr>'. 
     492                                   '<th>&nbsp;</th>'. 
     493                                   '<th class="nowrap">'.__('Subscriber').'</th>' . 
     494                                   '<th class="nowrap">'.__('Subscribed').'</th>' . 
     495                                   '<th class="nowrap">'.__('Status').'</th>' . 
     496                                   '<th class="nowrap">'.__('Last sent').'</th>' . 
     497                                   '<th class="nowrap" colspan="2">'.__('Edit').'</th>'. 
     498                              '</tr>'; 
     499 
     500                    // parcours la liste pour l'affichage 
     501                    $datas->moveStart(); 
     502                    while ($datas->fetch()) { 
     503                         $k = (integer)$datas->subscriber_id; 
     504                         $editlink = 'onclick="ledit('.$k.'); return false"'; 
     505                         $guilink = '<a href="#" '.$editlink.' title="'.__('Edit subscriber').'"><img src="images/edit-mini.png" alt="'.__('Edit subscriber').'" /></a>'; 
     506 
     507                         if ($datas->subscribed != null)  
     508                              $subscribed = dt::dt2str('%d/%m/%Y', $datas->subscribed).' '.dt::dt2str('%H:%M', $datas->subscribed); 
     509                         else  
     510                              $subscribed = __('Never'); 
     511                          
     512                         if ($datas->lastsent != null)  
     513                              $lastsent = dt::dt2str('%d/%m/%Y', $datas->lastsent).' '.dt::dt2str('%H:%M', $datas->lastsent); 
     514                         else  
     515                              $lastsent = __('Never'); 
     516 
     517                         echo 
     518                         '<tr class="line">'. 
     519                              '<td>'.form::checkbox(array('subscriber['.html::escapeHTML($k).']'), 1).'</td>'. 
     520                              '<td class="maximal nowrap">'.html::escapeHTML(text::cutString($datas->email, 50)).'</td>'. 
     521                              '<td class="minimal nowrap">'.html::escapeHTML(text::cutString($subscribed, 50)).'</td>'. 
     522                              '<td class="minimal nowrap">'.html::escapeHTML(text::cutString(__($datas->state), 50)).'</td>'. 
     523                              '<td class="minimal nowrap">'.html::escapeHTML(text::cutString($lastsent, 50)).'</td>'. 
     524                              '<td class="status">'.$guilink.'</td>'. 
     525                         '</tr>'; 
     526                    } 
     527 
     528                    $bstates = array(); 
     529                    $bstates['-'] = '-'; 
     530                    $bstates[__('Suspend')] = 'suspend'; 
     531                    $bstates[__('Disable')] = 'disable'; 
     532                    $bstates[__('Enable')] = 'enable'; 
     533                    $bstates[__('Last sent')] = 'lastsent'; 
     534 
     535                    $bmails = array(); 
     536                    $bmails[__('Newsletter')] = 'send'; 
     537                    $bmails[__('Confirm')] = 'sendconfirm'; 
     538                    $bmails[__('Suspend')] = 'sendsuspend'; 
     539                    $bmails[__('Disable')] = 'senddisable'; 
     540                    $bmails[__('Enable')] = 'sendenable'; 
     541 
     542                    // fermeture du tableau 
     543                    echo 
     544                    '</table>'. 
    613545                    '<p>'. 
    614                '<a class="small" href="'.html::escapeHTML(pluginNewsletter::admin()).'">'.__('refresh').'</a> - ' . 
     546                    '<a class="small" href="'.html::escapeHTML(pluginNewsletter::admin()).'">'.__('refresh').'</a> - ' . 
    615547                    '<a class="small" href="#" onclick="checkAll(\'userslist\'); return false">'.__('check all').'</a> - ' . 
    616548                    '<a class="small" href="#" onclick="uncheckAll(\'userslist\'); return false">'.__('uncheck all').'</a> - ' . 
    617549                    '<a class="small" href="#" onclick="invertcheckAll(\'userslist\'); return false">'.__('toggle check all').'</a></p>'.                  
    618                     
    619                    '<p>'. 
    620                    '<input type="submit" value="'.__('Delete').'" /><br /><br />'. 
     550 
     551                    '<p>'. 
     552                    '<input type="submit" value="'.__('Delete').'" /><br /><br />'. 
    621553                    '<label for "fstates">'.__('Set state:').'</label>'. 
    622554                    form::combo('fstates', $bstates).'<input type="button" value="'.__('Set').'" onclick="lset(); return false" />'. 
    623555                    '<label for "fmails">'.__('Mail to send:').'</label>'. 
    624556                    form::combo('fmails', $bmails).'<input type="button" value="'.__('Send').'" onclick="lsend(); return false" />'. 
    625                    '</p></form>'; 
    626                } 
    627              catch (Exception $e) { $core->error->add($e->getMessage()); } 
     557                    '</p></form>'; 
     558                     
     559               } catch (Exception $e) {  
     560                    $core->error->add($e->getMessage());  
     561               } 
    628562          } 
    629563     } 
  • plugins/newsletter/trunk/class.modele.php

    r790 r793  
    5656     } 
    5757 
     58     // Fonction récupérée dans le plugin dCom 
     59     public static function cutString($str,$maxlength=false) 
     60     { 
     61          if (mb_strlen($str) > $maxlength && $maxlength) 
     62               return self::myCutString($str,$maxlength).'...'; 
     63          return $str; 
     64     } 
     65      
     66     // Fonction cutString() de Dotclear écrite par Olivier Meunier 
     67     // Corrigée pour supporter le UTF-8 
     68     // https://clearbricks.org/svn/trunk/common/lib.text.php [72] 
     69     public static function myCutString($str,$l) 
     70     { 
     71          $s = preg_split('/([\s]+)/u',$str,-1,PREG_SPLIT_DELIM_CAPTURE); 
     72           
     73          $res = ''; 
     74          $L = 0; 
     75           
     76          if (mb_strlen($s[0]) >= $l) { 
     77               return mb_substr($s[0],0,$l); 
     78          } 
     79           
     80          foreach ($s as $v) 
     81          { 
     82               $L = $L+strlen($v); 
     83                
     84               if ($L > $l) { 
     85                    break; 
     86               } else { 
     87                    $res .= $v; 
     88               } 
     89          } 
     90           
     91          return trim($res); 
     92     } 
     93 
    5894     /** 
    5995     * retourne le contenu total de la table sous forme de tableau de données brutes 
     
    392428     { 
    393429          // test sur la valeur de l'id qui doit être positive ou null 
    394           if ($id < 0) return null; 
    395  
    396           // modifie l'état des abonnés 
    397         else 
    398         { 
    399               // filtrage sur le code de status 
    400               switch ($_state) 
    401               { 
    402                   case 'pending': 
    403                   case 'enabled': 
    404                   case 'suspended': 
    405                   case 'disabled': 
    406                      break; 
    407  
    408                   default: 
     430          if ($id < 0) { 
     431               return null; 
     432          } else {  
     433               // modifie l'état des abonnés 
     434           
     435               // filtrage sur le code de status 
     436               switch ($_state) { 
     437                    case 'pending': 
     438                    case 'enabled': 
     439                    case 'suspended': 
     440                    case 'disabled': 
     441                         break; 
     442                    default: 
    409443                         return false; 
    410               } 
    411  
    412                global $core; 
    413              try 
    414              { 
     444               } 
     445 
     446               global $core; 
     447               try { 
    415448                    $blog = &$core->blog; 
    416449                    $con = &$core->con; 
    417450                    $blogid = $con->escape((string)$blog->id); 
    418451 
    419                 // mise en forme du tableau d'id 
    420                 if (is_array($id)) $ids = implode(", ", $id); 
    421                 else $ids = $id; 
    422  
    423                 // génération de la requète 
     452                    // mise en forme du tableau d'id 
     453                    if (is_array($id))  
     454                         $ids = implode(", ", $id); 
     455                    else  
     456                         $ids = $id; 
     457 
     458                    // génération de la requète 
    424459                    $cur = $con->openCursor($core->prefix.pluginNewsletter::pname()); 
    425460 
     
    428463                    $cur->update('WHERE blog_id=\''.$con->escape($blogid).'\' AND subscriber_id IN('.$ids.')'); 
    429464                    return true; 
    430              } 
    431               catch (Exception $e) { $core->error->add($e->getMessage()); } 
    432         } 
     465               } catch (Exception $e) {  
     466                    $core->error->add($e->getMessage());  
     467               } 
     468          } 
    433469     } 
    434470 
     
    522558     { 
    523559          global $core; 
    524       try { 
     560          try  { 
    525561           
    526562               $con = &$core->con; 
     
    530566               // pas de contenu, uniquement les billets publiés, sans mot de passe 
    531567               $params = array(); 
    532                $params['no_content'] = true; 
     568 
     569               // Ticket #69 
     570               $params['no_content'] = (pluginNewsletter::getViewContentPost() ? false : true);  
    533571               $params['post_type'] = 'post'; 
    534572               $params['post_status'] = 1; 
     
    554592               } 
    555593                
    556          $year = dt::dt2str('%Y', $dt); 
    557          $month = dt::dt2str('%m', $dt); 
    558          $day = dt::dt2str('%d', $dt); 
    559          $hours = dt::dt2str('%H', $dt); 
    560          $minutes = dt::dt2str('%M', $dt); 
    561          $seconds = dt::dt2str('%S', $dt); 
     594              $year = dt::dt2str('%Y', $dt); 
     595              $month = dt::dt2str('%m', $dt); 
     596              $day = dt::dt2str('%d', $dt); 
     597              $hours = dt::dt2str('%H', $dt); 
     598              $minutes = dt::dt2str('%M', $dt); 
     599              $seconds = dt::dt2str('%S', $dt); 
    562600 
    563601               // depuis lastsent 
    564          $params['sql'] .= ' AND '.$con->dateFormat('P.post_dt','%Y-%m-%d %H:%M:%S')."> '$year-$month-$day $hours:$minutes:$seconds'"; 
     602              $params['sql'] .= ' AND '.$con->dateFormat('P.post_dt','%Y-%m-%d %H:%M:%S')."> '$year-$month-$day $hours:$minutes:$seconds'"; 
    565603 
    566604               // for 3.5.1 : définir un champ dans l'admin 
    567605               // intervalle de récupération des messages (fixé à 1 mois pour le moment) 
    568606               //$params['sql'] .= ' AND P.post_dt BETWEEN SUBDATE(CURDATE(), INTERVAL 1 MONTH) AND NOW() '; 
    569          // $params['sql'] .= ' AND P.post_dt BETWEEN SUBDATE(NOW(), INTERVAL 1 MONTH) AND NOW() '; 
     607               // $params['sql'] .= ' AND P.post_dt BETWEEN SUBDATE(NOW(), INTERVAL 1 MONTH) AND NOW() '; 
    570608 
    571609               // récupération des billets 
    572          $rs = $blog->getPosts($params, false); 
     610               $rs = $blog->getPosts($params, false); 
    573611             
    574           return($rs->isEmpty()?null:$rs); 
    575  
    576      } catch (Exception $e) {  
    577           $core->error->add($e->getMessage());  
    578       } 
     612               return($rs->isEmpty()?null:$rs); 
     613 
     614          } catch (Exception $e) {  
     615               $core->error->add($e->getMessage());  
     616          } 
    579617     } 
    580618 
     
    586624     * convertit le texte en 7 bits 
    587625     */ 
    588     private static function to7bit($text, $from_enc) 
    589     { 
     626     private static function to7bit($text, $from_enc) 
     627     { 
    590628          global $core; 
    591629        try { 
     
    597635          $core->error->add($e->getMessage());  
    598636        } 
    599     } 
     637     } 
    600638 
    601639     /** 
    602640     * envoi de mail 
    603641     */ 
    604    public static function Sendmail($_from, $_name, $_email, $_subject, $_body, $_type = 'text', $_lang = 'fr') 
    605    { 
     642     public static function Sendmail($_from, $_name, $_email, $_subject, $_body, $_type = 'text', $_lang = 'fr') 
     643     { 
    606644          if (empty($_from) || empty($_email) || empty($_subject) || empty($_body)) { 
    607645               return false; 
     
    718756 
    719757                    // prise en compte du paramètres: liste d'id ou id simple 
    720                 if (is_array($id)) $ids = $id; 
    721                 else { $ids = array(); $ids[] = $id; } 
     758                    if (is_array($id)) { 
     759                         $ids = $id; 
     760                    } else {  
     761                         $ids = array();  
     762                         $ids[] = $id;  
     763                    } 
    722764 
    723765                    // initialisation du moteur de template 
     
    732774                    $mode = pluginNewsletter::getSendMode(); 
    733775                    $subject = text::toUTF8(__('Newsletter for ').$blogname); 
     776                    /* 
     777                    $view_content_post = pluginNewsletter::getViewContentPost(); 
     778                    $size_content_post = pluginNewsletter::getSizeContentPost(); 
     779                    //*/ 
    734780 
    735781                    // boucle sur les ids des abonnés à mailer 
     
    741787                         // récupération des billets en fonction de l'abonné (date de dernier envoi et billets déja envoyés) 
    742788                         $posts = self::getPosts($subscriber->lastsent); 
    743                          if ($posts == null) $send['nothing'][] = $subscriber->email; // rien à envoyer (aucun billet) 
    744                          else 
    745                          { 
     789                         if ($posts == null) { 
     790                              $send['nothing'][] = $subscriber->email; // rien à envoyer (aucun billet) 
     791                         } else { 
    746792                              $body = ''; 
    747793                              $bodies = array(); 
     
    754800                              while ($posts->fetch()) 
    755801                              { 
    756                                   $p_ids[] = $posts->post_id; 
     802                                   $p_ids[] = $posts->post_id; 
    757803 
    758804                                   // récupération des informations du billet 
    759                                    $bodies[] = array( 
    760                                    'title' => $posts->post_title, 
    761                                    'url' => $posts->getURL(), 
    762                                    'date' => $posts->getDate($format), 
    763                                    'category' => $posts->getCategoryURL(), 
    764                                    'author' => $posts->getAuthorCN() 
    765                                    ); 
     805                                   if(pluginNewsletter::getViewContentPost()) { 
     806                                        $bodies[] = array( 
     807                                        'title' => $posts->post_title, 
     808                                        'url' => $posts->getURL(), 
     809                                        'date' => $posts->getDate($format), 
     810                                        'category' => $posts->getCategoryURL(), 
     811                                        'content' => html::escapeHTML(self::cutString(html::decodeEntities(html::clean($posts->getContent())),pluginNewsletter::getSizeContentPost())), 
     812                                        'author' => $posts->getAuthorCN() 
     813                                        ); 
     814                                   } else { 
     815                                        $bodies[] = array( 
     816                                        'title' => $posts->post_title, 
     817                                        'url' => $posts->getURL(), 
     818                                        'date' => $posts->getDate($format), 
     819                                        'category' => $posts->getCategoryURL(), 
     820                                        'author' => $posts->getAuthorCN() 
     821                                        ); 
     822                                   } 
    766823                              } 
    767824 
    768825                              // intégration dans le template des billets en génération du rendu 
    769                             nlTemplate::assign('urlSuspend', self::url('suspend/'.base64_encode($subscriber->email))); 
    770                             nlTemplate::assign('urlDisable', self::url('disable/'.base64_encode($subscriber->email))); 
     826                              nlTemplate::assign('urlSuspend', self::url('suspend/'.base64_encode($subscriber->email))); 
     827                              nlTemplate::assign('urlDisable', self::url('disable/'.base64_encode($subscriber->email))); 
    771828                              nlTemplate::assign('posts', $bodies); 
    772829                              $body = nlTemplate::render('newsletter', $mode); 
    773830 
    774831                              // envoi du mail et log 
    775                               if (self::Sendmail($editorEmail, $editorName, $subscriber->email, $subject, $body, $mode)) 
    776                               { 
    777                                   // prise en compte email envoyé et mise à jour de l'abonné (date de dernier envoi et liste de billets déja envoyés) 
     832                              if (self::Sendmail($editorEmail, $editorName, $subscriber->email, $subject, $body, $mode)) { 
     833                                   // prise en compte email envoyé et mise à jour de l'abonné (date de dernier envoi et liste de billets déja envoyés) 
    778834                                   $send['ok'][] = $subscriber->email; 
    779                             $states[] = $subscriber->subscriber_id; 
     835                                   $states[] = $subscriber->subscriber_id; 
     836                              } else {  
     837                                   // erreur d'envoi de mail 
     838                                   $send['error'][] = $subscriber->email; 
    780839                              } 
    781                               // erreur d'envoi de mail 
    782                               else $send['error'][] = $subscriber->email; 
     840                               
    783841                         } 
    784842                    } 
     
    915973     public static function sendSuspend($id = -1) 
    916974     { 
    917           // test si le plugin est actif 
    918           if (!pluginNewsletter::isActive()) return false; 
    919  
    920           // test sur la valeur de l'id qui doit être positive ou null 
    921           else if ($id == -1) return false; 
    922  
    923           // envoi des mails aux abonnés 
    924           else 
    925           { 
     975          if (!pluginNewsletter::isActive()) { // test si le plugin est actif 
     976               return false; 
     977           
     978          } else if ($id == -1) { // test sur la valeur de l'id qui doit être positive ou null 
     979               return false; 
     980          } else {   
     981               // envoi des mails aux abonnés 
    926982               global $core; 
    927983               try 
     
    932988 
    933989                    // prise en compte du paramètres: liste d'id ou id simple 
    934                 if (is_array($id)) $ids = $id; 
    935                 else { $ids = array(); $ids[] = $id; } 
     990                    if (is_array($id))  
     991                         $ids = $id; 
     992                    else {  
     993                         $ids = array();  
     994                         $ids[] = $id;  
     995                    } 
    936996 
    937997                    // initialisation du moteur de template 
     
    11371197     } 
    11381198 
     1199     /** 
     1200     * envoi d'un resumé du compte 
     1201     */ 
     1202     public static function sendResume($id = -1) 
     1203     { 
     1204          if (!pluginNewsletter::isActive()) { // test si le plugin est actif 
     1205               return false; 
     1206          } else if ($id == -1) { // test sur la valeur de l'id qui doit être positive ou null 
     1207               return false; 
     1208          } else {   
     1209               // envoi des mails aux abonnés 
     1210               global $core; 
     1211               try 
     1212               { 
     1213                   $url = &$core->url; 
     1214                   $blog = &$core->blog; 
     1215                   $blogurl = &$blog->url; 
     1216 
     1217                    // prise en compte du paramètres: liste d'id ou id simple 
     1218                    if (is_array($id))  
     1219                         $ids = $id; 
     1220                    else {  
     1221                         $ids = array();  
     1222                         $ids[] = $id;  
     1223                    } 
     1224 
     1225                    // initialisation du moteur de template 
     1226                    $send_ok = array(); 
     1227                    $send_error = array(); 
     1228                    $states = array(); 
     1229                    self::BeforeSendmailTo(__('Newsletter account resume for'), __('Have a nice day !')); 
     1230 
     1231                    // initialisation des variables de travail 
     1232                    $blogname = &$blog->name; 
     1233                    $editorName = pluginNewsletter::getEditorName(); 
     1234                    $editorEmail = pluginNewsletter::getEditorEmail(); 
     1235                    $mode = pluginNewsletter::getSendMode(); 
     1236                    $subject = text::toUTF8(__('Newsletter account resume for ').$blogname); 
     1237 
     1238                    // boucle sur les ids des abonnés à mailer 
     1239                    foreach ($ids as $subscriber_id) 
     1240                    { 
     1241                         // récupération de l'abonné et extraction des données 
     1242                        $subscriber = self::get($subscriber_id); 
     1243 
     1244                         // génération du rendu 
     1245                         /* 
     1246                         nlTemplate::assign('urlEnable', self::url('enable/'.base64_encode($subscriber->email))); 
     1247                         //*/ 
     1248                         //nlTemplate::assign('urlEnable', self::url('enable/'.str_replace('=','',base64_encode($subscriber->email)))); 
     1249                         //$body = nlTemplate::render('suspend', $mode); 
     1250 
     1251                         // envoi du mail et log 
     1252                         if (self::Sendmail($editorEmail, $editorName, $subscriber->email, $subject, $body, $mode)) 
     1253                         { 
     1254                              $send_ok[] = $subscriber->email; 
     1255                              $states[] = $subscriber_id; 
     1256                         } 
     1257                         else $send_error[] = $subscriber->email; 
     1258                    } 
     1259                
     1260                    /* 
     1261                    // positionnement de l'état des comptes sur 'compte suspendu' 
     1262                    if (is_array($states) && count($states) > 0) 
     1263                         self::suspend($states); 
     1264                    //*/ 
     1265 
     1266                    $msg = ''; 
     1267                    if (count($send_ok) > 0) $msg .= __('Successful mail sent for ').implode(', ', $send_ok); 
     1268                    if (count($send_ok) > 0 && count($send_error) > 0) $msg .= '<br />'; 
     1269                    if (count($send_error) > 0) $msg .= __('Mail sent error for ').implode(', ', $send_error); 
     1270 
     1271                    return $msg; 
     1272               } 
     1273               catch (Exception $e) { $core->error->add($e->getMessage()); } 
     1274          } 
     1275     } 
     1276 
    11391277     /* ================================================== 
    11401278          gestion des comptes 
     
    11851323               global $core; 
    11861324               try { 
    1187           $subscriber = self::getemail($email); 
    1188             $msg = null; 
    1189                   if (!$subscriber || $subscriber->subscriber_id == null)  
    1190                     return __('Email don\'t exist !'); 
    1191             else { 
     1325                    $subscriber = self::getemail($email); 
     1326                    $msg = null; 
     1327                    if (!$subscriber || $subscriber->subscriber_id == null)  
     1328                         return __('Email don\'t exist !'); 
     1329                    else { 
    11921330                         $msg = self::sendDisable($subscriber->subscriber_id); 
    1193                     self::delete($subscriber->subscriber_id); 
    1194                return $msg; 
    1195             } 
     1331                         self::delete($subscriber->subscriber_id); 
     1332                         return $msg; 
     1333                    } 
    11961334               } catch (Exception $e) {  
    11971335                    $core->error->add($e->getMessage());  
     
    11991337          } 
    12001338     } 
    1201      
     1339 
     1340     /** 
     1341     * suspension du compte 
     1342     */ 
     1343     static function accountSuspend($email = null) 
     1344     { 
     1345          if (!pluginNewsletter::isActive()) { // test si le plugin est actif 
     1346               return __('Newsletter is disabled.'); 
     1347          } else if ($email == null) { // l'email doit être renseigné 
     1348               return __('Bad email !'); 
     1349          } else { // suspension du compte 
     1350               global $core; 
     1351               try { 
     1352                    $subscriber = self::getemail($email); 
     1353                         $msg = null; 
     1354                    if (!$subscriber || $subscriber->subscriber_id == null)  
     1355                         return __('Email don\'t exist !'); 
     1356                    else { 
     1357                         $msg = self::sendSuspend($subscriber->subscriber_id); 
     1358                         self::suspend($subscriber->subscriber_id); 
     1359                         return $msg; 
     1360                    } 
     1361               } catch (Exception $e) {  
     1362                    $core->error->add($e->getMessage());  
     1363               } 
     1364          } 
     1365     } 
     1366 
     1367     /** 
     1368     * information sur le compte 
     1369     */ 
     1370     static function accountResume($email = null) 
     1371     { 
     1372          if (!pluginNewsletter::isActive()) { // test si le plugin est actif 
     1373               return __('Newsletter is disabled.'); 
     1374          } else if ($email == null) { // l'email doit être renseigné 
     1375               return __('Bad email !'); 
     1376          } else { // information sur le compte 
     1377               global $core; 
     1378               try { 
     1379                    $subscriber = self::getemail($email); 
     1380                         $msg = null; 
     1381                    if (!$subscriber || $subscriber->subscriber_id == null)  
     1382                         return __('Email don\'t exist !'); 
     1383                    else { 
     1384                         $msg = self::sendResume($subscriber->subscriber_id); 
     1385                         //self::resume($subscriber->subscriber_id); 
     1386                         return $msg; 
     1387                    } 
     1388               } catch (Exception $e) {  
     1389                    $core->error->add($e->getMessage());  
     1390               } 
     1391          } 
     1392     } 
     1393 
    12021394     /* ================================================== 
    12031395          templates 
     
    12081400     */ 
    12091401     public static function Newsletter() 
    1210    { 
     1402     { 
    12111403          if (isset($GLOBALS['newsletter']['cmd']))  
    12121404               $cmd = (string) html::clean($GLOBALS['newsletter']['cmd']); 
    1213       else  
    1214           $cmd = 'about'; 
     1405          else  
     1406               $cmd = 'about'; 
    12151407       
    1216       if (isset($GLOBALS['newsletter']['email']))  
    1217           $email = (string) html::clean($GLOBALS['newsletter']['email']); 
    1218       else  
    1219           $email = null; 
     1408          if (isset($GLOBALS['newsletter']['email']))  
     1409               $email = (string) html::clean($GLOBALS['newsletter']['email']); 
     1410          else  
     1411               $email = null; 
    12201412       
    1221       if (isset($GLOBALS['newsletter']['code']))  
    1222           $code = (string) html::clean($GLOBALS['newsletter']['code']); 
    1223       else  
    1224           $code = null; 
    1225  
    1226       switch ($cmd) { 
     1413          if (isset($GLOBALS['newsletter']['code']))  
     1414               $code = (string) html::clean($GLOBALS['newsletter']['code']); 
     1415          else  
     1416               $code = null; 
     1417 
     1418          switch ($cmd) { 
    12271419               case 'test': 
    1228           $msg = __('Newsletter template successfully adapted.'); 
    1229             break; 
    1230  
    1231           case 'about': 
    1232           $msg = __('About Newsletter...'); 
    1233             break; 
    1234  
    1235          case 'confirm': 
    1236           if ($email == null || $code == null) 
    1237                $msg = __('Missing informations. '); 
    1238             else { 
    1239                $rs = self::getemail($email); 
    1240                if ($rs == null || $rs->regcode != $code)  
    1241                     $msg = __('Your subscription code is invalid.'); 
    1242                else if ($rs->state == 'enabled')  
    1243                     $msg = __('Account already confirmed.'); 
    1244                else { 
     1420                    $msg = __('Newsletter template successfully adapted.'); 
     1421                    break; 
     1422 
     1423               case 'about': 
     1424                    $msg = __('About Newsletter...'); 
     1425                    break; 
     1426 
     1427               case 'confirm': 
     1428                    if ($email == null || $code == null) 
     1429                         $msg = __('Missing informations. '); 
     1430                    else { 
     1431                         $rs = self::getemail($email); 
     1432                         if ($rs == null || $rs->regcode != $code)  
     1433                              $msg = __('Your subscription code is invalid.'); 
     1434                         else if ($rs->state == 'enabled')  
     1435                              $msg = __('Account already confirmed.'); 
     1436                         else { 
    12451437                              self::sendEnable($rs->subscriber_id); 
    1246                   $msg = __('Your subscription is confirmed.').'<br />'.__('You will soon receive an email.'); 
    1247                } 
    1248                } 
    1249             break; 
    1250  
    1251           case 'enable': 
    1252           if ($email == null) 
    1253                $msg = __('Missing informations. '); 
    1254             else { 
    1255                $rs = self::getemail($email); 
    1256                if ($rs == null)  
    1257                     $msg = __('Unable to find you account informations.'); 
    1258                else if ($rs->state == 'enabled')  
    1259                     $msg = __('Account already enabled.'); 
    1260                else { 
    1261                     self::sendEnable($rs->subscriber_id); 
    1262                   $msg = __('Your account is enabled.').'<br />'.__('You will soon receive an email.'); 
    1263                } 
    1264             } 
    1265                break; 
    1266  
    1267           case 'disable': 
    1268           if ($email == null) 
    1269                $msg = __('Missing informations. '); 
    1270             else { 
    1271                $rs = self::getemail($email); 
    1272                if ($rs == null)  
    1273                     $msg = __('Unable to find you account informations.'); 
    1274                else if ($rs->state == 'disabled')  
    1275                     $msg = __('Account already disabled.'); 
    1276                else { 
    1277                     self::sendDisable($rs->subscriber_id); 
    1278                   $msg = __('Your account is disabled.').'<br />'.__('You will soon receive an email.'); 
    1279                } 
    1280                } 
    1281             break; 
    1282  
    1283           case 'suspend': 
    1284           if ($email == null) 
    1285                $msg = __('Missing informations. '); 
    1286             else { 
    1287                $rs = self::getemail($email); 
    1288                if ($rs == null)  
    1289                     $msg = __('Unable to find you account informations.'); 
    1290                else if ($rs->state == 'suspended')  
    1291                     $msg = __('Account already suspended.'); 
    1292                else { 
    1293                     self::sendSuspend($rs->subscriber_id); 
    1294                   $msg = __('Your account is suspended.').'<br />'.__('You will soon receive an email.'); 
    1295                } 
    1296             } 
    1297             break; 
    1298  
    1299          case 'submit': 
    1300           $email = (string)html::clean($_POST['nl_email']); 
    1301           $option = (string)html::clean($_POST['nl_option']); 
    1302           $check = true; 
    1303             if (pluginNewsletter::getCaptcha()) { 
    1304                $captcha = (string)html::clean($_POST['nl_captcha']); 
    1305                 
    1306                require_once dirname(__FILE__).'/class.captcha.php'; 
    1307                $read = Captcha::read(); 
    1308                if ($read != $captcha)  
    1309                     $check = false; 
    1310             } 
    1311  
    1312             if (!$check)  
    1313                $msg = __('Bad captcha code.'); 
    1314             else switch ($option) { 
    1315                case 'subscribe': 
    1316                     $msg = self::accountCreate($email); 
    1317                   break; 
    1318  
    1319                case 'unsubscribe': 
    1320                     $msg = self::accountDelete($email); 
    1321                   break; 
    1322  
    1323                case 'suspend': 
    1324                     break; 
    1325  
    1326                case 'resume': 
    1327                     break; 
    1328  
    1329                default: 
    1330                     $msg = __('Error in formular.'); 
    1331                   break; 
    1332           } 
    1333             break; 
    1334  
    1335           default: 
    1336           $msg = ''; 
    1337             break; 
    1338           } 
    1339  
    1340       return $msg; 
     1438                              $msg = __('Your subscription is confirmed.').'<br />'.__('You will soon receive an email.'); 
     1439                         } 
     1440                    } 
     1441                    break; 
     1442 
     1443               case 'enable': 
     1444                    if ($email == null) 
     1445                         $msg = __('Missing informations. '); 
     1446                    else { 
     1447                         $rs = self::getemail($email); 
     1448                         if ($rs == null)  
     1449                              $msg = __('Unable to find you account informations.'); 
     1450                         else if ($rs->state == 'enabled')  
     1451                              $msg = __('Account already enabled.'); 
     1452                         else { 
     1453                              self::sendEnable($rs->subscriber_id); 
     1454                              $msg = __('Your account is enabled.').'<br />'.__('You will soon receive an email.'); 
     1455                         } 
     1456                    } 
     1457                    break; 
     1458 
     1459               case 'disable': 
     1460                    if ($email == null) 
     1461                         $msg = __('Missing informations. '); 
     1462                    else { 
     1463                         $rs = self::getemail($email); 
     1464                         if ($rs == null)  
     1465                              $msg = __('Unable to find you account informations.'); 
     1466                         else if ($rs->state == 'disabled')  
     1467                              $msg = __('Account already disabled.'); 
     1468                         else { 
     1469                              self::sendDisable($rs->subscriber_id); 
     1470                              $msg = __('Your account is disabled.').'<br />'.__('You will soon receive an email.'); 
     1471                         } 
     1472                    } 
     1473                    break; 
     1474 
     1475               case 'suspend': 
     1476                    if ($email == null) 
     1477                         $msg = __('Missing informations. '); 
     1478                    else { 
     1479                         $rs = self::getemail($email); 
     1480                         if ($rs == null)  
     1481                              $msg = __('Unable to find you account informations.'); 
     1482                         else if ($rs->state == 'suspended')  
     1483                              $msg = __('Account already suspended.'); 
     1484                         else { 
     1485                              self::sendSuspend($rs->subscriber_id); 
     1486                              $msg = __('Your account is suspended.').'<br />'.__('You will soon receive an email.'); 
     1487                         } 
     1488                    } 
     1489                    break; 
     1490 
     1491               case 'submit': 
     1492                    $email = (string)html::clean($_POST['nl_email']); 
     1493                    $option = (string)html::clean($_POST['nl_option']); 
     1494                    $check = true; 
     1495                    if (pluginNewsletter::getCaptcha()) { 
     1496                         $captcha = (string)html::clean($_POST['nl_captcha']); 
     1497                         require_once dirname(__FILE__).'/class.captcha.php'; 
     1498                         $read = Captcha::read(); 
     1499                         if ($read != $captcha)  
     1500                              $check = false; 
     1501                    } 
     1502 
     1503                    if (!$check)  
     1504                         $msg = __('Bad captcha code.'); 
     1505                    else switch ($option) { 
     1506                         case 'subscribe': 
     1507                              $msg = self::accountCreate($email); 
     1508                              break; 
     1509                          
     1510                         case 'unsubscribe': 
     1511                              $msg = self::accountDelete($email); 
     1512                              break; 
     1513 
     1514                         case 'suspend': 
     1515                              $msg = self::accountSuspend($email); 
     1516                              break; 
     1517 
     1518                         case 'resume': 
     1519                              $msg = self::accountResume($email); 
     1520                              break; 
     1521 
     1522                         default: 
     1523                              $msg = __('Error in formular.'); 
     1524                              break; 
     1525                    } 
     1526                    break; 
     1527 
     1528               default: 
     1529                    $msg = ''; 
     1530                    break; 
     1531          } 
     1532 
     1533          return $msg; 
    13411534     } 
    13421535 
  • plugins/newsletter/trunk/class.plugin.php

    r788 r793  
    110110     * nombre maximal de billet retournés 
    111111     */ 
    112     public static function getMaxPosts()  
    113     {  
    114     return (integer)self::get('maxposts');  
    115     } 
     112     public static function getMaxPosts()  
     113     {  
     114          return (integer)self::get('maxposts');  
     115     } 
    116116      
    117117    /** 
     
    134134     * envoi automatique 
    135135     */ 
    136     public static function getAutosend()  
    137     {  
    138      return (boolean)self::get('autosend');  
    139     } 
     136     public static function getAutosend()  
     137     {  
     138          return (boolean)self::get('autosend');  
     139     } 
     140      
     141     /** 
     142     * indique si on doit envoyer automatiquement 
     143     */ 
     144     public static function setAutosend($val)  
     145     {  
     146          self::setB('autosend', (boolean)$val);  
     147     } 
     148      
     149     /** 
     150     * réinitialise l'indicateur d'envoi automatique 
     151     */ 
     152     public static function clearAutosend()  
     153     {  
     154          self::setAutosend(false);  
     155     } 
     156           
     157     /** 
     158     * utilisation d'un captcha 
     159     */ 
     160     public static function getCaptcha()  
     161     {  
     162          return (boolean)self::get('captcha');  
     163     } 
     164      
     165     /** 
     166     * indique si on doit utiliser un captcha 
     167     */ 
     168     public static function setCaptcha($val)  
     169     {  
     170          self::setB('captcha', (boolean)$val);  
     171     } 
     172      
     173     /** 
     174     * réinitialise l'indicateur d'utilisation de captcha 
     175     */ 
     176     public static function clearCaptcha()  
     177     {  
     178          self::setCaptcha(false);  
     179     } 
     180 
     181     /* Ticket #69 
     182     Ajout du paramètre d'activation du post.content 
     183     Ajout de la définition de la taille maximale du post.content 
     184     //*/  
     185      
     186     /** 
     187     * Affichage du contenu du post dans la newsletter 
     188     */ 
     189     public static function getViewContentPost()  
     190     {  
     191          return (boolean)self::get('view_content_post'); 
     192     } 
     193      
     194     /** 
     195     * indique si on doit afficher le contenu du post 
     196     */ 
     197     public static function setViewContentPost($val)  
     198     {  
     199          self::setB('view_content_post', (boolean)$val); 
     200     } 
     201      
     202     /** 
     203     * réinitialise l'indicateur d'affichage du contenu du post 
     204     */ 
     205     public static function clearViewContentPost()  
     206     {  
     207          self::setViewContentPost(false); 
     208     } 
     209 
     210     /** 
     211     * retourne la taille maximale du contenu du billet 
     212     */ 
     213     public static function getSizeContentPost()  
     214     {  
     215          return (integer)self::get('size_content_post');  
     216     } 
     217      
     218     /** 
     219     * renseigne la taille maximale du contenu du billet 
     220     */ 
     221     public static function setSizeContentPost($val)  
     222     {  
     223          self::setI('size_content_post', (integer)$val);  
     224     } 
    140225      
    141226    /** 
    142      * indique si on doit envoyer automatiquement 
    143      */ 
    144      public static function setAutosend($val)  
    145      {  
    146           self::setB('autosend', (boolean)$val);  
    147      } 
    148       
    149     /** 
    150      * réinitialise l'indicateur d'envoi automatique 
    151      */ 
    152      public static function clearAutosend()  
    153      {  
    154           self::setAutosend(false);  
    155      } 
    156            
    157      /** 
    158      * utilisation d'un captcha 
    159      */ 
    160      public static function getCaptcha()  
    161      {  
    162           return (boolean)self::get('captcha');  
    163      } 
    164       
    165     /** 
    166      * indique si on doit utiliser un captcha 
    167      */ 
    168      public static function setCaptcha($val)  
    169      {  
    170           self::setB('captcha', (boolean)$val);  
    171      } 
    172       
    173     /** 
    174      * réinitialise l'indicateur d'utilisation de captcha 
    175      */ 
    176      public static function clearCaptcha()  
    177      {  
    178           self::setCaptcha(false);  
    179      } 
     227     * efface/initialise la taille maximale du contenu du billet 
     228     */ 
     229     public static function clearSizeContentPost()  
     230     {  
     231          self::setSendMode(0);  
     232     } 
     233 
     234     /*  
     235     Ajout d'un commentaire perso avec la newsletter 
     236     //*/  
     237 
     238 
    180239      
    181240     /** 
     
    193252          self::setAutosend(false); 
    194253          self::setCaptcha(false); 
     254          self::setViewContentPost(false); 
     255          self::setSizeContentPost(30); 
    195256 
    196257          self::Trigger(); 
     
    211272          self::delete('autosend'); 
    212273          self::delete('captcha'); 
     274          self::delete('view_content_post'); 
     275          self::delete('size_content_post'); 
    213276 
    214277          self::Trigger(); 
     
    665728     * lecture d'une information particulière concernant un plugin (api dotclear 2) 
    666729     */ 
    667    protected static function getInfo($info) 
    668    { 
    669           global $core; 
    670           try 
    671           { 
     730     protected static function getInfo($info) 
     731     { 
     732          global $core; 
     733          try { 
    672734               $plugins = $core->plugins; 
    673735               return $plugins->moduleInfo(self::pname(), $info); 
     736          } catch (Exception $e) {  
     737               $core->error->add($e->getMessage());  
    674738          } 
    675          catch (Exception $e) { $core->error->add($e->getMessage()); } 
    676    } 
     739     } 
    677740 
    678741     /** 
    679742     * racine des fichiers du plugin 
    680743     */ 
    681    public static function dcRoot()  
    682    {  
    683      return self::getInfo('root');  
    684    } 
     744     public static function dcRoot()  
     745     {  
     746          return self::getInfo('root');  
     747     } 
    685748 
    686749     /** 
    687750     * nom du plugin 
    688751     */ 
    689    public static function dcName()  
    690    {  
    691      return self::getInfo('name');  
    692    } 
     752     public static function dcName()  
     753     {  
     754          return self::getInfo('name');  
     755     } 
    693756 
    694757     /** 
    695758     * description du plugin 
    696759     */ 
    697    public static function dcDesc()  
    698    {  
    699      return self::getInfo('desc');  
    700    } 
     760     public static function dcDesc()  
     761     {  
     762          return self::getInfo('desc');  
     763     } 
    701764 
    702765     /** 
    703766     * auteur du plugin 
    704767     */ 
    705    public static function dcAuthor()  
    706    {  
    707      return self::getInfo('author');  
    708    } 
     768     public static function dcAuthor()  
     769     {  
     770          return self::getInfo('author');  
     771     } 
    709772 
    710773     /** 
    711774     * version du plugin 
    712775     */ 
    713    public static function dcVersion()  
    714    {  
    715      return self::getInfo('version');  
    716    } 
     776     public static function dcVersion()  
     777     {  
     778          return self::getInfo('version');  
     779     } 
    717780 
    718781     /** 
    719782     * permissions du plugin 
    720783     */ 
    721    public static function dcPermissions()  
    722    {  
    723      return self::getInfo('permissions');  
    724    } 
     784     public static function dcPermissions()  
     785     {  
     786          return self::getInfo('permissions');  
     787     } 
    725788 
    726789     /** 
    727790     * priorité du plugin 
    728791     */ 
    729    public static function dcPriority()  
    730    {  
    731      return self::getInfo('priority');  
    732    } 
     792     public static function dcPriority()  
     793     {  
     794          return self::getInfo('priority');  
     795     } 
    733796 
    734797     /** 
     
    751814          self::readUpdate(); 
    752815          if (self::hasDatas()) { 
    753           $v_current = self::dcVersion(); 
    754            $v_remote = self::Version(); 
    755  
     816               $v_current = self::dcVersion(); 
     817               $v_remote = self::Version(); 
    756818               if (self::compareVersion($v_current, $v_remote) < 0) 
    757819                    self::$newversionavailable = true; 
     
    762824     * génère le code html pour affichage dans l'admin des informations de mise à jour 
    763825     */ 
    764    public static function htmlNewVersion($check = true) 
    765    { 
     826     public static function htmlNewVersion($check = true) 
     827     { 
    766828          if (!$check) 
    767829               return ''; 
     
    770832               self::checkUpdate(); 
    771833               if (!self::isNewVersionAvailable()) 
    772                      $msg .= __('No new version available.'); 
     834                    $msg .= __('No new version available.'); 
    773835               else { 
    774           $msg .= __('New version available:').' '.self::Version().' '; 
    775  
    776                     $m = array(); 
    777             if (self::hasPost() || self::hasPackage() || self::hasArchive())  
    778                $msg .= '['; 
    779             if (self::hasPost())  
    780                $m[] = '<a href="'.self::post().'" title="'.__('Read the post.').'">'.__('post').'</a>'; 
    781             if (self::hasPackage())  
    782                $m[] = '<a href="'.self::Package().'" title="'.__('Installer.').'">'.__('pkg.gz').'</a>'; 
    783             if (self::hasArchive())  
    784                $m[] = '<a href="'.self::Archive().'" title="'.__('Archive.').'">'.__('tar.gz').'</a>'; 
    785  
    786             if (self::hasPost() || self::hasPackage() || self::hasArchive()) 
    787                          $msg .= (string) implode(" | ", $m) . ']'; 
     836                    $msg .= __('New version available:').' '.self::Version().' '; 
     837 
     838               $m = array(); 
     839               if (self::hasPost() || self::hasPackage() || self::hasArchive())  
     840                    $msg .= '['; 
     841               if (self::hasPost())  
     842                    $m[] = '<a href="'.self::post().'" title="'.__('Read the post.').'">'.__('post').'</a>'; 
     843               if (self::hasPackage())  
     844                    $m[] = '<a href="'.self::Package().'" title="'.__('Installer.').'">'.__('pkg.gz').'</a>'; 
     845               if (self::hasArchive())  
     846                    $m[] = '<a href="'.self::Archive().'" title="'.__('Archive.').'">'.__('tar.gz').'</a>'; 
     847 
     848               if (self::hasPost() || self::hasPackage() || self::hasArchive()) 
     849                    $msg .= (string) implode(" | ", $m) . ']'; 
    788850               } 
    789          return $msg; 
     851               return $msg; 
    790852          } 
    791853     } 
     
    800862     * compatible Dotclear 2.0 beta 6 ou SVN 
    801863     */ 
    802     public static function dbVersion() 
    803     { 
    804           global $core; 
    805         try    { 
    806             return (string)$core->getVersion('core'); 
    807         } catch (Exception $e) {  
    808                $core->error->add($e->getMessage());  
    809           } 
    810      } 
    811  
    812      /** 
    813      * permet de savoir si la version de Dotclear installé une version finale 
    814      */ 
    815      public static function isRelease() 
    816    { 
    817           global $core; 
    818       try 
    819       { 
    820           $version = (string)self::dbVersion(); 
    821            if (!stripos($version, 'beta'))  
    822                return true; 
    823            else  
    824                return false; 
     864     public static function dbVersion() 
     865     { 
     866          global $core; 
     867          try { 
     868               return (string)$core->getVersion('core'); 
    825869          } catch (Exception $e) {  
    826870               $core->error->add($e->getMessage());  
     
    829873 
    830874     /** 
    831      * permet de savoir si la version de Dotclear installé la beta 6 
    832      */ 
    833    public static function isBeta($sub = '6') 
    834    { 
    835           global $core; 
    836       try { 
    837           $version = (string)self::dbVersion(); 
    838                if (stripos($version, 'beta'.$sub))  
     875     * permet de savoir si la version de Dotclear installé une version finale 
     876     */ 
     877     public static function isRelease() 
     878     { 
     879          global $core; 
     880          try { 
     881               $version = (string)self::dbVersion(); 
     882               if (!stripos($version, 'beta'))  
    839883                    return true; 
    840            else  
    841                return false; 
     884               else  
     885                    return false; 
    842886          } catch (Exception $e) {  
    843887               $core->error->add($e->getMessage());  
     
    846890 
    847891     /** 
     892     * permet de savoir si la version de Dotclear installé la beta 6 
     893     */ 
     894     public static function isBeta($sub = '6') 
     895     { 
     896          global $core; 
     897          try { 
     898               $version = (string)self::dbVersion(); 
     899               if (stripos($version, 'beta'.$sub))  
     900                    return true; 
     901               else  
     902                    return false; 
     903          } catch (Exception $e) {  
     904               $core->error->add($e->getMessage());  
     905          } 
     906     } 
     907 
     908     /** 
    848909     * permet de savoir si la version de Dotclear installé est une version 'svn' 
    849910     */ 
    850    public static function isSVN()  
    851    {  
    852      return !self::isRelease() && (!self::isBeta('6') || !self::isBeta('7'));  
    853    } 
     911     public static function isSVN()  
     912     {  
     913          return !self::isRelease() && (!self::isBeta('6') || !self::isBeta('7'));  
     914     } 
    854915 
    855916} 
  • plugins/newsletter/trunk/index.php

    r777 r793  
    7272         try 
    7373         { 
    74                if (empty($_POST['feditoremail'])) $msg = __('You must input a valid email !'); 
     74               if (empty($_POST['feditoremail']))  
     75                    $msg = __('You must input a valid email !'); 
    7576               else 
    7677               { 
    7778                    // nom de l'éditeur 
    78                   if (!empty($_POST['feditorname'])) pluginNewsletter::setEditorName($_POST['feditorname']); 
    79                   else pluginNewsletter::clearEditorName(); 
     79                    if (!empty($_POST['feditorname']))  
     80                         pluginNewsletter::setEditorName($_POST['feditorname']); 
     81                    else  
     82                         pluginNewsletter::clearEditorName(); 
    8083 
    8184                    // email de l'éditeur 
    82                  pluginNewsletter::setEditorEmail($_POST['feditoremail']); 
     85                    pluginNewsletter::setEditorEmail($_POST['feditoremail']); 
    8386 
    8487                    // mode d'envoi 
    85                   if (!empty($_POST['fmode'])) pluginNewsletter::setSendMode($_POST['fmode']); 
    86                   else pluginNewsletter::clearSendMode(); 
     88                    if (!empty($_POST['fmode']))  
     89                         pluginNewsletter::setSendMode($_POST['fmode']); 
     90                    else  
     91                         pluginNewsletter::clearSendMode(); 
    8792 
    8893                    // nombre max. de billets 
    89                   if (!empty($_POST['fmaxposts'])) pluginNewsletter::setMaxPosts($_POST['fmaxposts']); 
    90                   else pluginNewsletter::clearMaxPosts(); 
     94                    if (!empty($_POST['fmaxposts']))  
     95                         pluginNewsletter::setMaxPosts($_POST['fmaxposts']); 
     96                    else  
     97                         pluginNewsletter::clearMaxPosts(); 
    9198 
    9299                    // envoi automatique 
    93                   if (!empty($_POST['fautosend'])) pluginNewsletter::setAutosend($_POST['fautosend']); 
    94                   else pluginNewsletter::setAutosend(); 
     100                    if (!empty($_POST['fautosend']))  
     101                         pluginNewsletter::setAutosend($_POST['fautosend']); 
     102                    else  
     103                         pluginNewsletter::setAutosend(); 
    95104 
    96105                    // captcha 
    97                   if (!empty($_POST['fcaptcha'])) pluginNewsletter::setCaptcha($_POST['fcaptcha']); 
    98                   else pluginNewsletter::setCaptcha(); 
    99                           
     106                    if (!empty($_POST['fcaptcha']))  
     107                         pluginNewsletter::setCaptcha($_POST['fcaptcha']); 
     108                    else  
     109                         pluginNewsletter::setCaptcha(); 
     110 
     111                    // affichage du contenu du post 
     112                    if (!empty($_POST['f_view_content_post']))  
     113                         pluginNewsletter::setViewContentPost($_POST['f_view_content_post']); 
     114                    else  
     115                         pluginNewsletter::setViewContentPost(); 
     116 
     117                    // taille maximale du contenu du post 
     118                    if (!empty($_POST['f_size_content_post']))  
     119                         pluginNewsletter::setSizeContentPost($_POST['f_size_content_post']); 
     120                    else  
     121                         pluginNewsletter::clearSizeContentPost(); 
     122 
    100123                    // notification de modification au blog et redirection 
    101124                    pluginNewsletter::Trigger(); 
     
    126149          $plugin_tab = 'tab_listblog'; 
    127150 
    128          try 
    129          { 
    130              if (!empty($_POST['femail'])) $email = $_POST['femail']; 
    131              else $email = null; 
    132  
    133                if ($email == null) $msg = __('Missing informations.'); 
    134                else 
    135                { 
    136                     if (!dcNewsletter::add($email)) $msg = __('Error adding subscriber.'); 
    137                     else $msg = __('Subscriber added.'); 
    138                } 
    139           } 
    140          catch (Exception $e) { $core->error->add($e->getMessage()); } 
     151          try { 
     152               if (!empty($_POST['femail']))  
     153                    $email = $_POST['femail']; 
     154               else  
     155                    $email = null; 
     156 
     157               if ($email == null) { 
     158                    $msg = __('Missing informations.'); 
     159               } else { 
     160                    if (!dcNewsletter::add($email))  
     161                         $msg = __('Error adding subscriber.'); 
     162                    else  
     163                         $msg = __('Subscriber added.'); 
     164               } 
     165          } catch (Exception $e) {  
     166               $core->error->add($e->getMessage());  
     167          } 
    141168     } 
    142169     break; 
     
    147174          $plugin_tab = 'tab_listblog'; 
    148175 
    149          try 
    150          { 
    151              if (!empty($_POST['id'])) $id = $_POST['id']; 
    152              else $id = null; 
    153  
    154              if (!empty($_POST['femail'])) $email = $_POST['femail']; 
    155              else $email = null; 
    156  
    157              if (!empty($_POST['fsubscribed'])) $subscribed = $_POST['fsubscribed']; 
    158              else $subscribed = null; 
    159  
    160              if (!empty($_POST['flastsent'])) $lastsent = $_POST['flastsent']; 
    161              else $lastsent = null; 
    162  
    163              if (!empty($_POST['fstate'])) $state = $_POST['fstate']; 
    164              else $state = null; 
    165  
    166                if ($email == null) 
    167                { 
    168                     if ($id == null) $msg = __('Missing informations.'); 
    169                     else $plugin_tab = 'tab_addedit'; 
    170                } 
    171                else 
    172                { 
    173                    $regcode = null; 
     176          try { 
     177               if (!empty($_POST['id']))  
     178                    $id = $_POST['id']; 
     179               else  
     180                    $id = null; 
     181 
     182               if (!empty($_POST['femail']))  
     183                    $email = $_POST['femail']; 
     184               else  
     185                    $email = null; 
     186 
     187               if (!empty($_POST['fsubscribed']))  
     188                    $subscribed = $_POST['fsubscribed']; 
     189               else  
     190                    $subscribed = null; 
     191 
     192               if (!empty($_POST['flastsent']))  
     193                    $lastsent = $_POST['flastsent']; 
     194               else  
     195                    $lastsent = null; 
     196 
     197               if (!empty($_POST['fstate']))  
     198                    $state = $_POST['fstate']; 
     199               else  
     200                    $state = null; 
     201 
     202               if ($email == null) { 
     203                    if ($id == null)  
     204                         $msg = __('Missing informations.'); 
     205                    else  
     206                         $plugin_tab = 'tab_addedit'; 
     207               } else { 
     208                    $regcode = null; 
    174209                
    175                     if (!dcNewsletter::update($id, $email, $state, $regcode, $subscribed, $lastsent)) $msg = __('Error updating subscriber.'); 
    176                     else $msg = __('Subscriber updated.'); 
    177                } 
    178           } 
    179          catch (Exception $e) { $core->error->add($e->getMessage()); } 
     210                    if (!dcNewsletter::update($id, $email, $state, $regcode, $subscribed, $lastsent))  
     211                         $msg = __('Error updating subscriber.'); 
     212                    else  
     213                         $msg = __('Subscriber updated.'); 
     214               } 
     215          } catch (Exception $e) {  
     216               $core->error->add($e->getMessage());  
     217          } 
    180218     } 
    181219     break; 
     
    186224          $plugin_tab = 'tab_listblog'; 
    187225 
    188          try 
    189          { 
    190              $msg = __('No account removed.'); 
    191          if (is_array($_POST['subscriber'])) 
    192          { 
    193                  $ids = array(); 
    194                  foreach (array_keys($_POST['subscriber']) as $id) { $ids[] = $id; } 
    195                  if (dcNewsletter::delete($ids)) $msg = __('Account(s) successfully removed.'); 
    196             }       
    197           } 
    198          catch (Exception $e) { $core->error->add($e->getMessage()); } 
     226          try { 
     227               $msg = __('No account removed.'); 
     228               if (is_array($_POST['subscriber'])) { 
     229                    $ids = array(); 
     230                    foreach (array_keys($_POST['subscriber']) as $id)  
     231                    {  
     232                         $ids[] = $id;  
     233                    } 
     234                    if (dcNewsletter::delete($ids))  
     235                         $msg = __('Account(s) successfully removed.'); 
     236               }     
     237          } catch (Exception $e) {  
     238               $core->error->add($e->getMessage());  
     239          } 
    199240     } 
    200241     break; 
     
    205246          $plugin_tab = 'tab_listblog'; 
    206247 
    207          try 
    208          { 
    209              $msg = __('No account suspended.'); 
    210          if (is_array($_POST['subscriber'])) 
    211          { 
    212                  $ids = array(); 
    213                  foreach (array_keys($_POST['subscriber']) as $id) { $ids[] = $id; } 
    214                  if (dcNewsletter::suspend($ids)) $msg = __('Account(s) successfully suspended.'); 
    215             }       
    216           } 
    217          catch (Exception $e) { $core->error->add($e->getMessage()); } 
     248          try { 
     249               $msg = __('No account suspended.'); 
     250               if (is_array($_POST['subscriber'])) { 
     251                    $ids = array(); 
     252                    foreach (array_keys($_POST['subscriber']) as $id)  
     253                    {  
     254                         $ids[] = $id;  
     255                    } 
     256                    if (dcNewsletter::suspend($ids))  
     257                         $msg = __('Account(s) successfully suspended.'); 
     258               } 
     259          } catch (Exception $e) {  
     260               $core->error->add($e->getMessage());  
     261          } 
    218262     } 
    219263     break; 
     
    224268          $plugin_tab = 'tab_listblog'; 
    225269 
    226          try 
    227          { 
    228          $msg = __('No account enabled.'); 
    229          if (is_array($_POST['subscriber'])) 
    230          { 
    231              $ids = array(); 
    232                  foreach (array_keys($_POST['subscriber']) as $id) { $ids[] = $id; } 
    233                  if (dcNewsletter::enable($ids)) $msg = __('Account(s) successfully enabled.'); 
    234              } 
    235           } 
    236          catch (Exception $e) { $core->error->add($e->getMessage()); } 
     270          try { 
     271               $msg = __('No account enabled.'); 
     272               if (is_array($_POST['subscriber'])) { 
     273                    $ids = array(); 
     274                    foreach (array_keys($_POST['subscriber']) as $id)  
     275                    {  
     276                         $ids[] = $id;  
     277                    } 
     278                    if (dcNewsletter::enable($ids))  
     279                         $msg = __('Account(s) successfully enabled.'); 
     280               } 
     281          } catch (Exception $e) {  
     282               $core->error->add($e->getMessage());  
     283          } 
    237284     } 
    238285     break; 
     
    243290          $plugin_tab = 'tab_listblog'; 
    244291 
    245          try 
    246          { 
    247          $msg = __('No account disabled.'); 
    248          if (is_array($_POST['subscriber'])) 
    249          { 
    250              $ids = array(); 
    251                  foreach (array_keys($_POST['subscriber']) as $id) { $ids[] = $id; } 
    252                  if (dcNewsletter::disable($ids)) $msg = __('Account(s) successfully disabled.'); 
    253              } 
    254           } 
    255          catch (Exception $e) { $core->error->add($e->getMessage()); } 
     292          try { 
     293               $msg = __('No account disabled.'); 
     294               if (is_array($_POST['subscriber'])) { 
     295                    $ids = array(); 
     296                    foreach (array_keys($_POST['subscriber']) as $id)  
     297                    {  
     298                         $ids[] = $id;  
     299                    } 
     300                    if (dcNewsletter::disable($ids))  
     301                         $msg = __('Account(s) successfully disabled.'); 
     302               } 
     303          } catch (Exception $e) {  
     304               $core->error->add($e->getMessage());  
     305          } 
    256306     } 
    257307     break; 
     
    262312          $plugin_tab = 'tab_listblog'; 
    263313 
    264          try 
    265          { 
    266              $ids = array(); 
    267              foreach (array_keys($_POST['subscriber']) as $id) { $ids[] = $id; } 
    268              $msg = dcNewsletter::sendNewsletter($ids); 
    269           } 
    270          catch (Exception $e) { $core->error->add($e->getMessage()); } 
     314          try { 
     315               $ids = array(); 
     316               foreach (array_keys($_POST['subscriber']) as $id)  
     317               {  
     318                    $ids[] = $id;  
     319               } 
     320               $msg = dcNewsletter::sendNewsletter($ids); 
     321          } catch (Exception $e) {  
     322               $core->error->add($e->getMessage());  
     323          } 
    271324     } 
    272325     break; 
  • plugins/newsletter/trunk/locales/fr/help/help.html

    r788 r793  
    1717    <li><strong>Code visuel de vérification</strong> : ajout d'un code visuel pour éviter les robots</li> 
    1818    <li><strong>Mode</strong> : défini le format d'envoi</li> 
    19     <li><strong>Période</strong> : défini l'intervalle de temps des billets récupérés pour la newsletter (pour le moment fixé à 1 mois)</li> 
     19    <li><strong>Affiche le contenu des billets</strong> : affiche le contenu des billets dans la newsletter</li> 
     20    <li><strong>Taille maximale du contenu des billets</strong> : définir la taille du contenu des billets dans la newsletter</li> 
    2021  </ul></dd> 
    2122  <dt>Adaptation du template de thème :</dt> 
  • plugins/newsletter/trunk/locales/fr/main.lang.php

    r790 r793  
    4343$GLOBALS['__l10n']['Automatic send'] = "Envoi automatique"; 
    4444$GLOBALS['__l10n']['Captcha'] = "Code visuel"; 
     45$GLOBALS['__l10n']['View contents posts'] = "Affiche le contenu des billets"; 
     46$GLOBALS['__l10n']['Size contents posts'] = "Taille maximale du contenu des billets"; 
    4547$GLOBALS['__l10n']['Defaults'] = "Défauts"; 
    4648$GLOBALS['__l10n']['Theme template adaptation'] = "Adaptation du template de thème"; 
     
    166168$GLOBALS['__l10n']['Newsletter account removal for'] = "Suppression d'abonnement à la lettre d'information pour"; 
    167169$GLOBALS['__l10n']['Newsletter account removal for '] = "Suppression d'abonnement à la lettre d'information pour "; 
     170$GLOBALS['__l10n']['Newsletter account resume for'] = "Information sur l'abonnement à la lettre d'information pour"; 
     171$GLOBALS['__l10n']['Newsletter account resume for '] = "Information sur l'abonnement à la lettre d'information pour "; 
    168172 
    169173$GLOBALS['__l10n']['Newsletter is disabled.'] = "Newsletter est désactivé."; 
  • plugins/newsletter/trunk/templates/newsletter.html

    r777 r793  
    1919<b><a href="posts.url">posts.title</a></b>{nl} 
    2020(posts.date, {$txtBy} posts.author){nl} 
     21posts.content{nl} 
    2122</p> 
    2223{/loop} 
  • plugins/newsletter/trunk/templates/newsletter.txt

    r777 r793  
    77{loop:posts} 
    88posts.title (posts.date, {$txtBy} posts.author) 
    9 posts.url{nl}{nl} 
     9posts.url 
     10posts.content{nl}{nl} 
    1011{/loop} 
    1112 
  • plugins/newsletter/trunk/todo.txt

    r777 r793  
     1A faire ... 
     2 
     3@paddock 
     4- la fonction resume ne donne toujours pas d'indication 
     5- Ticket #73 : le probleme de rafraichissement du code en cas d'erreur se pose aussi bien en mode widget qu'en mode page 
     6- configurer la possibilité d'ajouter un commentaire avec le mail 
     7- à la premiere installation j'ai eu un message d'erreur  (que j'ai malheureusement pas noté mais de tête il s'agissait d'une erreur de creaction de table DC 
     8 
     9@SiK_22 
     10- Ticket #66 : La possibilité de filtrer par catégorie (ou tags ou auteurs) correspond à mon besoin. 
     11- Ticket #71 : Régler la fréquence d'envois des mails (choix par l'utilisateur ?) 
     12- Ticket #70 : Le choix pour l'utilisateur entre texte & HTML (ex : ceux qui regardent leurs mails sur portables) 
     13 
     14@Gilsoub 
     15- Ticket #74 : Problème URL avec un sujet de billet qui finit par des points de suspension 
     16 
Note: See TracChangeset for help on using the changeset viewer.

Sites map