PHPascal.com

PHPAscal rouge2 (Version bleu)


Programmation web CSS HTML PHP Jquery Javascript Wordpresse RSS SQL SSH, serveur linux Outils
  PHPascal a 147 articles


Recherche


cheap nike nfl jerseysWholesale cheap nfl jerseyscheap jerseys online from chinacheap nfl jerseys free shippingwholesale nba jerseysWholesale cheap nhl jerseyscheap nhl jerseys onlinecheap nba basketball jerseys

Valid HTML 5

Programmation web / PHP / mailing list avec wisiwig

Ajouter l'option wisiwig au logiciel phpMyNewsletter

Avant de faire cette ajout assurer vous d'avoir installer correctement phpMyNewsletter et KFCEditor sur votre site.

Pour faire l'ajout il suffit de modifier 2 fichiers :


/admin/include/compose.php

Remplacer les ligne de code :
   echo  "\t\t\t".translate("COMPOSE_FORMAT")." : <input type='radio' class='radio' name='format' value='text' checked='checked' />".translate("COMPOSE_FORMAT_TEXT")."<input type='radio' class='radio' name='format' value='html' />".translate("COMPOSE_FORMAT_HTML")."&nbsp;".translate("COMPOSE_FORMAT_HTML_NOTICE")."<br />\n";
     echo "\t\t\t<textarea name='message' rows='20' cols='70'>$newsletter->header";
     echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
     echo "$newsletter->footer</textarea><br />\n";

Par :
$place_kcf_ditor = '../../FCKeditor';

            require_once ("$place_kcf_ditor/fckeditor.php");

            $objKFC = new FCKeditor('message');
            $objKFC->BasePath = "$place_kcf_ditor/";
            $objKFC->Height = 600;
            $objKFC->Width = 600;

            $objKFC->Value = $newsletter->header."<br /><br/><br/>".$newsletter->footer;

            print $objKFC->CreateHtml();



et modifier le fichier admin/include/newsletters_config.php

Remplacer le tout par ce code source :
<?php
global $place_kcf_ditor;
$place_kcf_ditor = '../../FCKeditor';


require_once ("$place_kcf_ditor/fckeditor.php");

// preparer info Texte KFCEditor

/**
 * Cree object KFCEditor
 *
 * @author Pascal
 * @since Tue Feb 02 02:02:57 GMT 2010
 * @return string
 */
function get_KFCEDitor($name,$height,$txt_transalte,$action,$value)
{
    global $place_kcf_ditor;
   
  $objKFC = new FCKeditor($name);
    $objKFC->BasePath = "$place_kcf_ditor/";
    $objKFC->Height = $height;
    $objKFC->Width = 600;
    if ($action=="create") $strValue= translate($txt_transalte);
    else $strValue =  $value;
   
    $objKFC->Value = $strValue;

    return $objKFC->CreateHtml();
 
}

$strHeader = get_KFCEDitor('header',200,'NEWSLETTER_DEFAULT_HEADER',$action,$newsletter->header);
$strFooter = get_KFCEDitor('footer',200,'NEWSLETTER_DEFAULT_FOOTER',$action,$newsletter->footer);
$strsubscription_body = get_KFCEDitor('subscription_body',200,'NEWSLETTER_SUB_DEFAULT_BODY',$action,$newsletter->subscription_body);
$strwelcome_body = get_KFCEDitor('welcome_body',200,'NEWSLETTER_WELCOME_DEFAULT_BODY',$action,$newsletter->welcome_body);
$strquit_body = get_KFCEDitor('quit_body',200,'NEWSLETTER_UNSUB_DEFAULT_BODY',$action,$newsletter->quit_body);


echo "<div align='center'><table>
  <tbody>
    <tr>
      <td><span class='field'>".translate("NEWSLETTER_NAME").": </span></td>
      <td><input type='text' name='newsletter_name' value=\"".htmlspecialchars($newsletter->name)."\" size='50' /></td>
    </tr>
    <tr>
      <td><span class='field'>".translate("NEWSLETTER_FROM_NAME").": </span></td>
      <td><input type='text' name='from_name' value=\"".($action=="create" ? htmlspecialchars($conf->admin_name) : htmlspecialchars($newsletter->from_name))."\" size='50' />  </td>
    </tr>
    <tr>
      <td><span class='field'>".translate("NEWSLETTER_FROM_ADDR").": </span></td>
      <td><input type='text' name='from' value=\"".($action=="create" ? $conf->admin_email : $newsletter->from)."\" size='50' /></td>
    </tr>
    <tr>
      <td><span class='field'>".translate("NEWSLETTER_SUBJECT").": </span></td>
      <td><input type='text' name='subject' value=\"".htmlspecialchars($newsletter->subject)."\" size='50' />  </td>
    </tr>
    <tr>
      <td valign='top'><span class='field'>".translate("NEWSLETTER_HEADER").": </span></td>
      <td>".$strHeader."</td>
    </tr>
    <tr><td colspan=2><br></td></tr>
    <tr>
      <td valign='top'><span class='field'>".translate("NEWSLETTER_FOOTER").": </span></td>
      <td>".$strFooter."</td></tr>
   
      <tr>
      <td><span class='field'>".translate("NEWSLETTER_SUB_MSG_SUBJECT").": </span></td>
      <td><input type='text' name=' subscription_subject' value=\"".($action=="create" ? htmlspecialchars(translate("NEWSLETTER_SUB_DEFAULT_SUBJECT")) : htmlspecialchars($newsletter->subscription_subject))."\" size='50' />  </td>
    </tr>
    <tr>
      <td valign='top'><span class='field'>".translate("NEWSLETTER_SUB_MSG_BODY").": </span></td>
      <td>$strsubscription_body  </td>
    </tr>
    <tr>
      <td><span class='field'>".translate("NEWSLETTER_WELCOME_MSG_SUBJECT").": </span></td>
      <td><input type='text' name=' welcome_subject' value=\"".($action=="create" ? htmlspecialchars(translate("NEWSLETTER_WELCOME_DEFAULT_SUBJECT")) : htmlspecialchars($newsletter->welcome_subject))."\" size='50' />  </td>
    </tr>
    <tr>
      <td valign='top'><span class='field'>".translate("NEWSLETTER_WELCOME_MSG_BODY").": </span></td>
<td>$strwelcome_body</td>
     
       </tr>
    <tr>
      <td><span class='field'>".translate("NEWSLETTER_UNSUB_MSG_SUBJECT").": </span></td>
      <td><input type='text' name=' quit_subject' value=\"".($action=="create" ? htmlspecialchars(translate("NEWSLETTER_UNSUB_DEFAULT_SUBJECT")) : htmlspecialchars($newsletter->quit_subject))."\" size='50' />  </td>
    </tr>
    <tr>
      <td valign='top'><span class='field'>".translate("NEWSLETTER_UNSUB_MSG_BODY").": </span></td>
      <td>  $strquit_body</td>
    </tr>
  </tbody>
</table>";

echo "<input type='submit' value=\"".translate(($action=="create" ? "NEWSLETTER_SAVE_NEW" : "NEWSLETTER_SAVE_SETTINGS"))."\" /></div>";
echo "<input type='hidden' name='page' value='newsletterconf' />";
echo "</form>";


?>

Article écrit le 1 février 2010

Autres articles sous la même catégorie


Pascal Dubreuil | © PHPascal.com 2024
Temps d'exécution : 0.0101 sec
Imprimer le 21 November 2024 - 12:25:29
par Pascal Dubreuil organisateur du Marathon roller du Canada