Changeset 30152 in spip-zone
- Timestamp:
- Jul 24, 2009, 8:41:25 AM (12 years ago)
- Location:
- _plugins_/clevermail/2_0
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/clevermail/2_0/formulaires/clevermail.html
r30120 r30152 6 6 #ACTION_FORMULAIRE{#ENV{action}} 7 7 [(#ENV{lst_id}|oui) 8 <input type="hidden" name="lst_id" value=" #ENV{lst_id}" />8 <input type="hidden" name="lst_id" value="[(#ENV{lst_id}|table_valeur{0})]" /> 9 9 ] 10 [(#ENV{lsr_mode_force}|oui) 11 <input type="hidden" name="lsr_mode" value="[(#ENV{lsr_mode_force}|=={texte}|?{0,1})]" /> 12 ] 10 13 <ul> 11 14 [(#ENV{lst_id}|non) … … 20 23 <input type="text" class="text" name="#GET{name}" id="#GET{name}" size="50" maxlength="255" value="#ENV{#GET{name}}" /> 21 24 </li> 22 #SET{name,lsr_mode} 23 #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}} 24 #SET{obli,''} 25 <li class="editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]"> 26 <label><:clevermail:version:></label> 27 [<span class='erreur_message'>(#GET{erreurs})</span>] 28 #SET{value,0} 29 <div class="choix"> 30 <input type="radio" name="#GET{name}" id="#GET{name}#GET{value}" class="radio" value="#GET{value}"[ (#ENV{#GET{name}}|=={#GET{value}}|oui)checked="checked"] /> 31 <label for="#GET{name}#GET{value}"><:clevermail:choix_version_texte:></label> 32 </div> 33 #SET{value,1} 34 <div class="choix"> 35 <input type="radio" name="#GET{name}" id="#GET{name}#GET{value}" class="radio" value="#GET{value}"[ (#ENV{#GET{name}}|=={#GET{value}}|oui)checked="checked"] /> 36 <label for="#GET{name}#GET{value}"><:clevermail:choix_version_html:></label> 37 </div> 38 </li> 25 [(#ENV{lsr_mode_force}|non) 26 #SET{name,lsr_mode} 27 #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}} 28 #SET{obli,''} 29 <li class="editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]"> 30 <label><:clevermail:version:></label> 31 [<span class='erreur_message'>(#GET{erreurs})</span>] 32 #SET{value,0} 33 <div class="choix"> 34 <input type="radio" name="#GET{name}" id="#GET{name}#GET{value}" class="radio" value="#GET{value}"[ (#ENV{#GET{name}}|=={#GET{value}}|oui)checked="checked"] /> 35 <label for="#GET{name}#GET{value}"><:clevermail:choix_version_texte:></label> 36 </div> 37 #SET{value,1} 38 <div class="choix"> 39 <input type="radio" name="#GET{name}" id="#GET{name}#GET{value}" class="radio" value="#GET{value}"[ (#ENV{#GET{name}}|=={#GET{value}}|oui)checked="checked"] /> 40 <label for="#GET{name}#GET{value}"><:clevermail:choix_version_html:></label> 41 </div> 42 </li> 43 ] 39 44 </ul> 40 45 <p class="boutons"><span class="image_loading"></span><input type="submit" class="submit" value="<:clevermail:bouton_inscription:>" /></p> -
_plugins_/clevermail/2_0/formulaires/clevermail.php
r30117 r30152 1 1 <?php 2 function formulaires_clevermail_charger_dist($lst_id = 0 ) {2 function formulaires_clevermail_charger_dist($lst_id = 0, $lsr_mode_force = false) { 3 3 $default = array('editable' => ' ', 'lsr_mode' => 0, 'sub_email' => '', 'lst_ids' => array()); 4 if ($lsr_mode !== false && in_array($lsr_mode_force, array('texte', 'html'))) { 5 $default['lsr_mode_force'] = $lsr_mode_force; 6 } 4 7 if (intval($lst_id) != 0) { 5 if ($lst_id = sql_getfetsel("lst_id", "spip_cm_lists", "lst_id =".intval($lst_id)." AND lst_moderation!='closed'")) {8 if ($lst_id = sql_getfetsel("lst_id", "spip_cm_lists", "lst_id = ".intval($lst_id)." AND lst_moderation != 'closed'")) { 6 9 $valeurs = $default; 7 10 $valeurs['lst_id'] = array($lst_id); … … 11 14 } 12 15 } else { 13 $nbLists = sql_countsel("spip_cm_lists", "lst_moderation !='closed'");16 $nbLists = sql_countsel("spip_cm_lists", "lst_moderation != 'closed'"); 14 17 if ($nbLists == 0) { 15 18 return array('editable' => ''); 16 19 } elseif ($nbLists == 1) { 17 $lst_id = sql_getfetsel("lst_id", "spip_cm_lists", "lst_moderation !='closed'");20 $lst_id = sql_getfetsel("lst_id", "spip_cm_lists", "lst_moderation != 'closed'"); 18 21 $valeurs = $default; 19 22 $valeurs['lst_id'] = array($lst_id); … … 26 29 } 27 30 28 function formulaires_clevermail_verifier_dist($lst_id = 0 ) {31 function formulaires_clevermail_verifier_dist($lst_id = 0, $lsr_mode_force = false) { 29 32 $erreurs = array(); 30 33 if (!_request('lst_id') && !_request('lst_ids')) { … … 44 47 } 45 48 46 function formulaires_clevermail_traiter_dist($lst_id = 0 ) {49 function formulaires_clevermail_traiter_dist($lst_id = 0, $lsr_mode_force = false) { 47 50 $ok = true; 48 51 $message = ''; … … 59 62 $lists = array_map("intval", _request('lst_ids')); 60 63 } 64 if (_request('lsr_mode_force')) { 65 $lsr_mode = intval(_request('lsr_mode_force')); 66 } else { 67 $lsr_mode = intval(_request('lsr_mode')); 68 } 61 69 foreach($lists as $list) { 62 70 $lst_id = intval($list); 63 71 $listData = sql_fetsel("*", "spip_cm_lists", "lst_id=".intval($lst_id)); 64 72 if (sql_countsel("spip_cm_lists_subscribers", "lst_id=".intval($lst_id)." AND sub_id=".intval($sub_id)) == 1) { 65 if (sql_getfetsel("lsr_mode", "spip_cm_lists_subscribers", "lst_id=".intval($lst_id)." AND sub_id=".intval($sub_id)) == intval( _request('lsr_mode'))) {73 if (sql_getfetsel("lsr_mode", "spip_cm_lists_subscribers", "lst_id=".intval($lst_id)." AND sub_id=".intval($sub_id)) == intval($lsr_mode)) { 66 74 // Déjà abonné avec ce mode 67 75 $message .= (strlen($message) > 0 ? '<br />' : '')._T('clevermail:inscription_deja_abonne_meme_mode', array('lst_name' => $listData['lst_name'])); 68 76 } else { 69 77 // Déjà abonné mais changement de mode 70 sql_updateq("spip_cm_lists_subscribers", array('lsr_mode' => intval( _request('lsr_mode'))), "lst_id=".intval($lst_id)." AND sub_id=".intval($sub_id));78 sql_updateq("spip_cm_lists_subscribers", array('lsr_mode' => intval($lsr_mode)), "lst_id=".intval($lst_id)." AND sub_id=".intval($sub_id)); 71 79 $message .= (strlen($message) > 0 ? '<br />' : '')._T('clevermail:inscription_deja_abonne_autre_mode', array('lst_name' => $listData['lst_name'])); 72 80 } … … 76 84 case 'open': 77 85 $actionId = md5('subscribe#'.$lst_id.'#'.$sub_id.'#'.time()); 78 sql_insertq("spip_cm_lists_subscribers", array('lst_id' => intval($lst_id), 'sub_id' => intval($sub_id), 'lsr_mode' => intval( _request('lsr_mode')), 'lsr_id' => $actionId));86 sql_insertq("spip_cm_lists_subscribers", array('lst_id' => intval($lst_id), 'sub_id' => intval($sub_id), 'lsr_mode' => intval($lsr_mode), 'lsr_id' => $actionId)); 79 87 $message .= (strlen($message) > 0 ? '<br />' : '')._T('clevermail:inscription_validee', array('lst_name' => $listData['lst_name'])); 80 88 break; … … 83 91 $actionId = md5('subscribe#'.$lst_id.'#'.$sub_id.'#'.time()); 84 92 if (sql_countsel("spip_cm_pending", "lst_id=".intval($lst_id)." AND sub_id=".intval($sub_id)) == 0) { 85 sql_insertq("spip_cm_pending", array('lst_id' => intval($lst_id), 'sub_id' => intval($sub_id), 'pnd_action' => 'subscribe', 'pnd_mode' => intval( _request('lsr_mode')), 'pnd_action_date' => time(), 'pnd_action_id' => $actionId));93 sql_insertq("spip_cm_pending", array('lst_id' => intval($lst_id), 'sub_id' => intval($sub_id), 'pnd_action' => 'subscribe', 'pnd_mode' => intval($lsr_mode), 'pnd_action_date' => time(), 'pnd_action_id' => $actionId)); 86 94 } 87 95 // Composition du message de demande de confirmation … … 89 97 $template['@@NOM_LETTRE@@'] = $listData['lst_name']; 90 98 $template['@@DESCRIPTION@@'] = $listData['lst_comment']; 91 $template['@@FORMAT_INSCRIPTION@@'] = ( $mode == 1 ? 'HTML' : 'texte');99 $template['@@FORMAT_INSCRIPTION@@'] = (intval($lsr_mode) == 1 ? _T('choix_version_html') : _T('choix_version_texte')); 92 100 $template['@@EMAIL@@'] = _request('sub_email'); 93 101 $template['@@URL_CONFIRMATION@@'] = $GLOBALS['meta']['adresse_site'].'/spip.php?page=clevermail_do&id='.$actionId; -
_plugins_/clevermail/2_0/lang/clevermail_fr.php
r30117 r30152 22 22 'choix_version_html' => 'HTML', 23 23 'choix_version_texte' => 'Texte brut', 24 'choix_version_composite' => 'HTML et texte brut',25 24 'inscription_lettre' => 'Inscrivez-vous à notre lettre d\'information :', 26 25 'inscription_lettres' => 'Inscrivez-vous à nos lettres d\'information :', -
_plugins_/clevermail/2_0/plugin.xml
r30120 r30152 9 9 -* Gestion de {{multiples lettres}} 10 10 -* Gestion des inscriptions/désinscriptions, {{les abonnés étant distincts des utilisateurs de SPIP}} 11 -* Abonnement au choix de l'utilisateur en version {{HTML, texte brut ou multipart simultané HTML + texte brut}} (attention, Lotus Notes n'aime pas) 11 -* Possibilité de restreindre la liste des lettres proposées dans le formulaire d'abonnement 12 -* Abonnement au choix de l'utilisateur en version {{texte brut ou multipart simultané HTML + texte brut}} (attention, Lotus Notes n'aime pas) 13 -* Possibilité de forcer la version dans le formulaire d'abonnement 12 14 -* Récupération des contenus HTML et texte brut à partir de deux URL, donc {{utilisation de squelettes SPIP}} dédiés possible 13 15 -* {{Automatisation des envois}} avec une fréquence quotidienne, hebdomadaire ou mensuelle
Note: See TracChangeset
for help on using the changeset viewer.