module contact
modification d'un champ
Créations de Modules
thebrm Membre non connecté
Booster Fronde
-
Booster Fronde
- Voir le profil du membre thebrm
- Inscrit le : 26/06/2010
J'aimerai soit - remplasser "objet" par "numero de telephone" sur le formulaire
- ou rajouté un champ
merci d'avance
Édité par thebrm Le 24/07/2010 à 15h47
mind Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre mind
- Inscrit le : 10/01/2009
- Site internet
Dans le dossier templates
contact.tpl
Code TPL :
<script type="text/javascript"> <!-- function check_form_mail(){ if(document.getElementById('mail_email').value == "") { alert("{L_REQUIRE_MAIL}"); return false; } if(document.getElementById('mail_contents').value == "") { alert("{L_REQUIRE_TEXT}"); return false; } {L_REQUIRE_VERIF_CODE} return true; } --> </script> # IF C_ERROR_HANDLER # <span id="errorh"></span> <div class="{ERRORH_CLASS}" style="width:500px;margin:auto;padding:15px;"> <img src="../templates/{THEME}/images/{ERRORH_IMG}.png" alt="" style="float:left;padding-right:6px;" /> {L_ERRORH} <br /> </div> # ENDIF # <form action="{U_ACTION_CONTACT}" method="post" onsubmit="return check_form_mail();" class="fieldset_mini"> <fieldset> <legend>{L_CONTACT_MAIL}</legend> <p>{L_REQUIRE}</p> <dl> <dt><label for="mail_email">* {L_MAIL}</label><br /><span>{L_VALID_MAIL}</span></dt> <dd><label><input type="text" size="30" maxlength="50" id="mail_email" name="mail_email" value="{MAIL}" class="text" /></label></dd> </dl> <dl> <dt><label for="mail_objet">{L_OBJET}</label></dt> <dd><label><input type="text" size="30" name="mail_object" id="mail_object" class="text" value="{CONTACT_OBJECT}" /></label></dd> </dl> <dl> <dt><label for="mail_phone">{L_PHONE}</label></dt> <dd><label><input type="text" size="30" name="mail_phone" id="mail_phone" class="text" value="{CONTACT_PHONE}" /></label></dd> </dl> # IF C_VERIF_CODE # <dl> <dt><label for="verif_code">* {L_VERIF_CODE}</label></dt> <dd> <label> {VERIF_CODE} </label> </dd> </dl> # ENDIF # <label for="mail_contents">* {L_CONTENTS}</label> <label><textarea rows="10" cols="47" id="mail_contents" name="mail_contents">{CONTACT_CONTENTS}</textarea></label> </fieldset> <fieldset class="fieldset_submit"> <legend>{L_SUBMIT}</legend> <input type="submit" name="mail_valid" value="{L_SUBMIT}" class="submit" /> <input type="reset" value="{L_RESET}" class="reset" /> <input type="hidden" name="token" value="{TOKEN}" /> </fieldset> </form>
À la racine
contact.php
Code PHP :
<?php /*################################################## * contact.php * ------------------- * begin : July 29, 2005 * copyright : (C) 2005 Viarre Régis * email : crowkait@phpboost.com * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ require_once('../kernel/begin.php'); require_once('../contact/contact_begin.php'); require_once('../kernel/header.php'); $mail_from = retrieve(POST, 'mail_email', '', TSTRING_UNCHANGE); $mail_object = retrieve(POST, 'mail_object', '', TSTRING_UNCHANGE); $contents = retrieve(POST, 'mail_contents', '', TSTRING_UNCHANGE); $mail_phone = retrieve(POST, 'mail_phone', '', TSTRING_UNCHANGE); $mail_contents = 'Téléphone :' .$mail_phone ."n". $contents; $mail_valid = retrieve(POST, 'mail_valid', ''); $get_error = ''; import('util/captcha'); $captcha = new Captcha(); $captcha->set_difficulty($CONFIG_CONTACT['contact_difficulty_verifcode']); ###########################Envoi############################## if (!empty($mail_valid)) { //Code de vérification si activé if (!$CONFIG_CONTACT['contact_verifcode'] || $captcha->is_valid()) //Code de vérification si activé { import('io/mail'); $mail = new Mail(); if ($mail->send_from_properties($CONFIG['mail'], $mail_object, $mail_contents, $mail_from, '', 'user')) //Succès mail { $get_error = 'success'; } else //Erreur mail { $get_error = 'error'; } } else //Champs incomplet! { $get_error = 'verif'; } } elseif (!empty($_POST['mail_valid']) && ( empty($mail_email) || empty($mail_contents) )) //Champs incomplet! { $get_error = 'incomplete'; } ###########################Affichage############################## $Template->set_filenames(array( 'contact'=> 'contact/contact.tpl' )); //Gestion erreur. if ($get_error == 'incomplete') { $Errorh->handler($LANG['e_incomplete'], E_USER_NOTICE); } elseif ($get_error == 'verif') { $Errorh->handler($LANG['e_incorrect_verif_code'], E_USER_WARNING); } elseif ($get_error == 'success')//Message de succés. { $Errorh->handler($LANG['success_mail'], E_USER_SUCCESS); } elseif ($get_error == 'error')//Message de succés. { $Errorh->handler($LANG['error_mail'], E_USER_WARNING); } //Code de vérification, anti-bots. if ($captcha->is_available() && $CONFIG_CONTACT['contact_verifcode']) { $Template->assign_vars(array( 'C_VERIF_CODE' => true, 'VERIF_CODE' => $captcha->display_form(), 'L_REQUIRE_VERIF_CODE' => $captcha->js_require() )); } $Template->assign_vars(array( 'MAIL' => $User->get_attribute('user_mail'), 'CONTACT_OBJECT' => stripslashes(retrieve(POST, 'mail_object', '')), 'CONTACT_PHONE' => $mail_phone, 'CONTACT_CONTENTS' => $contents, 'L_REQUIRE_MAIL' => $LANG['require_mail'], 'L_REQUIRE_TEXT' => $LANG['require_text'] , 'L_CONTACT_MAIL' => $LANG['contact_mail'], 'L_MAIL' => $LANG['mail'], 'L_VERIF_CODE' => $LANG['verif_code'], 'L_REQUIRE' => $LANG['require'], 'L_VALID_MAIL' => $LANG['valid_mail'], 'L_OBJET' => $LANG['objet'], 'L_PHONE' => $LANG['phone'], 'L_CONTENTS' => $LANG['content'], 'L_SUBMIT' => $LANG['submit'], 'L_RESET' => $LANG['reset'], 'U_ACTION_CONTACT' => url('contact.php?token=' . $Session->get_token()) )); $Template->pparse('contact'); require_once('../kernel/footer.php'); ?>
Dans le dossier langue
contact_french.php
Code PHP :
<?php /*################################################## * contact_french.php * ------------------- * begin : July 29, 2005 * copyright : (C) 2005 Viarre Régis * email : crowkait@phpboost.com * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ #################################################### # French # #################################################### //Titre $LANG['title_contact'] = 'Contact'; //Contact $LANG['contact_mail'] = 'Envoyer un mail à l'administrateur'; $LANG['valid_mail'] = 'Valide si vous voulez une réponse !'; $LANG['success_mail'] = 'Merci, votre Mail a été envoyé avec succès à l'administrateur'; $LANG['error_mail'] = 'Désolé, votre mail n'a pas pu être envoyé'; $LANG['alert_contact_mail'] = 'Le mail que vous avez entré est invalide !'; $LANG['phone'] = 'Téléphone'; //Admin $LANG['contact_config'] = 'Configuration'; $LANG['activ_verif_code'] = 'Activer le code vérification'; ?>
dit moi si tout est ok!
infoking1 Membre non connecté
Booster Missile
-
Booster Missile
- Voir le profil du membre infoking1
- Inscrit le : 29/09/2008
- Site internet
- Groupes :
La connexion sur ton site est bloquée par mon antivirus, voir message ci dessous.
Gérez vos comptes bancaires de façon simple et efficace avec BanqueManager
Téléchargement gratuit ici
Téléchargement gratuit ici
mind Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre mind
- Inscrit le : 10/01/2009
- Site internet
Code HTML :
j'ai de la dificulté avec firefox et cette pub de freeheberg.
mais c'est nouveau se problème ! Je vais le signaler à l'hébergeur et merci
mind Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre mind
- Inscrit le : 10/01/2009
- Site internet
voici la réponse qu'il m'ont fait !

Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie