1. IMPORTANT : Nouvelles mesures de sécurité - 2. Règles pour obtenir de l'aide dans les forums de support - 3. Restrictions des droits pour le groupe "Support suspendu"
Il est obligatoire de respecter les Règles de MyBB.fr : Version abrégée ou Version complète pour obtenir du support sur nos forums.
Les membres ayant un site/forum contrevenant aux règles de MyBB.support seront placés dans le groupe "Support suspendu" et ne bénéficieront plus du support du staff. Nous recommandons aux autres membres d'agir de même. Il ne s'agit pas d'un bannissement, le membre retrouvera son statut "normal" dès que sa situation sera conforme aux règles.
Nouveau : un Wiki en français : plus de détails . Avant de soumettre votre problème, consultez-le, ainsi que la FAQ , sans oublier le moteur de recherche interne.
Note de ce sujet :
Moyenne : 0 (0 vote(s))
1
2
3
4
5
Date de naissance obligatoire Mots-clés » date, naissance, obligatoire
22-09-2010, 14:29,
haytoch
Membre trop actif
Messages : 891
Sujets : 20
Inscription : Mar 2010
RE: Date de naissance obligatoire
Salut ,
Pour que la date de naissance soit remplier encours d'inscription il vous faut quelque modifications car il n'y a aucun mode pour ce truc ; et voila les modification après avoir tester dans le localhost est ca marche :
1***Dans le Fichier "Member.php":
Chercher :
Code PHP :
$user [ 'birthday' ] = array( "day" => $mybb -> input [ 'bday1' ], "month" => $mybb -> input [ 'bday2' ], "year" => $mybb -> input [ 'bday3' ] );
Ajouter Aprés ceci :
Code PHP :
$bdaysel = '' ; for( $i = 1 ; $i <= 31 ; $i ++) { if( $user [ 'birthday' ][ 0 ] == $i ) { $bdaydaysel .= "<option value=\" $i \" selected=\"selected\"> $i </option>\n" ; } else { $bdaydaysel .= "<option value=\" $i \"> $i </option>\n" ; } }
Puis souvgarder.
2***Dans le fichier "inc/datahandlers/user.php":
Chercher:
Code PHP :
$birthday [ 'day' ] = intval ( $birthday [ 'day' ]); $birthday [ 'month' ] = intval ( $birthday [ 'month' ]); $birthday [ 'year' ] = intval ( $birthday [ 'year' ]);
Ajouter Après Ceci :
Code PHP :
if(! $birthday [ 'day' ] || ! $birthday [ 'month' ] || ! $birthday [ 'year' ]) { $this -> set_error ( "invalid_birthday" ); return false ; }
Puis Souvgarder ;
3***APC==>Temlates==>Member_Template==>"member_register"
Effacer Le Continue et Remplacer par ceci :
Code PHP :
< html > < head > < title >{ $mybb -> settings [ 'bbname' ]} - { $lang -> registration }</ title > { $headerinclude } </ head > < body > { $header } < br /> < form action = "member.php" method = "post" > { $regerrors } < table border = "0" cellspacing = " { $theme [ 'borderwidth' ]} " cellpadding = " { $theme [ 'tablespace' ]} " class= "tborder" > < tr > < td class= "thead" colspan = "2" >< strong >{ $lang -> registration }</ strong ></ td > </ tr > < tr > < td width = "50%" class= "trow1" valign = "top" > < fieldset class= "trow2" > < legend >< strong >{ $lang -> account_details }</ strong ></ legend > < table cellspacing = "0" cellpadding = " { $theme [ 'tablespace' ]} " > < tr > < td colspan = "2" >< span class= "smalltext" >{ $lang -> username }</ span ></ td > </ tr > < tr > < td colspan = "2" >< input type = "text" class= "textbox" name = "username" size = "40" value = " { $username } " /></ td > </ tr > { $passboxes } < tr > < td >< span class= "smalltext" >{ $lang -> email }</ span ></ td > < td >< span class= "smalltext" >{ $lang -> confirm_email }</ span ></ td > </ tr > < tr > < td >< input type = "text" class= "textbox" name = "email" size = "20" maxlength = "50" value = " { $email } " /></ td > < td >< input type = "text" class= "textbox" name = "email2" size = "20" maxlength = "50" value = " { $email2 } " /></ td > </ tr > < tr > < td colspan = "3" >< span class= "smalltext" >{ $lang -> birthday }</ span ></ td > </ tr > < tr > < td > < select name = "bday1" > < option value = "" selected >& nbsp ;</ option > { $bdaysel } </ select > </ td > < td > < select name = "bday2" > < option value = "" >& nbsp ;</ option > < option value = "1" { $bdaymonthsel [ '1' ]}>{ $lang -> month_1 }</ option > < option value = "2" { $bdaymonthsel [ '2' ]}>{ $lang -> month_2 }</ option > < option value = "3" { $bdaymonthsel [ '3' ]}>{ $lang -> month_3 }</ option > < option value = "4" { $bdaymonthsel [ '4' ]}>{ $lang -> month_4 }</ option > < option value = "5" { $bdaymonthsel [ '5' ]}>{ $lang -> month_5 }</ option > < option value = "6" { $bdaymonthsel [ '6' ]}>{ $lang -> month_6 }</ option > < option value = "7" { $bdaymonthsel [ '7' ]}>{ $lang -> month_7 }</ option > < option value = "8" { $bdaymonthsel [ '8' ]}>{ $lang -> month_8 }</ option > < option value = "9" { $bdaymonthsel [ '9' ]}>{ $lang -> month_9 }</ option > < option value = "10" { $bdaymonthsel [ '10' ]}>{ $lang -> month_10 }</ option > < option value = "11" { $bdaymonthsel [ '11' ]}>{ $lang -> month_11 }</ option > < option value = "12" { $bdaymonthsel [ '12' ]}>{ $lang -> month_12 }</ option > </ select > </ td > < td > < input type = "text" class= "textbox" size = "4" maxlength = "4" name = "bday3" value = " { $bday [ '2' ]} " /> </ td > </ tr > </ table > </ fieldset > { $requiredfields } { $referrer } { $regimage } </ td > < td width = "50%" class= "trow1" valign = "top" > < fieldset class= "trow2" > < legend >< strong >{ $lang -> account_prefs }</ strong ></ legend > < table cellspacing = "0" cellpadding = " { $theme [ 'tablespace' ]} " > < tr > < td valign = "top" width = "1" >< input type = "checkbox" class= "checkbox" name = "allownotices" id = "allownotices" value = "yes" { $allownoticescheck } /></ td > < td valign = "top" >< span class= "smalltext" >< label for= "allownotices" >{ $lang -> allow_notices }</ label ></ span ></ td > </ tr > < tr > < td valign = "top" width = "1" >< input type = "checkbox" class= "checkbox" name = "hideemail" id = "hideemail" value = "yes" { $hideemailcheck } /></ td > < td valign = "top" >< span class= "smalltext" >< label for= "hideemail" >{ $lang -> hide_email }</ label ></ span ></ td > </ tr > < tr > < td valign = "top" width = "1" >< input type = "checkbox" class= "checkbox" name = "emailnotify" id = "emailnotify" value = "yes" { $emailnotifycheck } /></ td > < td valign = "top" >< span class= "smalltext" >< label for= "emailnotify" >{ $lang -> email_notify }</ label ></ span ></ td > </ tr > < tr > < td valign = "top" width = "1" >< input type = "checkbox" class= "checkbox" name = "receivepms" id = "receivepms" value = "yes" { $receivepmscheck } /></ td > < td valign = "top" >< span class= "smalltext" >< label for= "receivepms" >{ $lang -> receive_pms }</ label ></ span ></ td > </ tr > < tr > < td valign = "top" width = "1" >< input type = "checkbox" class= "checkbox" name = "pmpopup" id = "pmpopup" value = "yes" { $pmpopupcheck } /></ td > < td valign = "top" >< span class= "smalltext" >< label for= "pmpopup" >{ $lang -> pm_popup }</ label ></ span ></ td > </ tr > < tr > < td valign = "top" width = "1" >< input type = "checkbox" class= "checkbox" name = "emailpmnotify" id = "emailpmnotify" value = "yes" { $emailpmnotifycheck } /></ td > < td valign = "top" >< span class= "smalltext" >< label for= "emailpmnotify" >{ $lang -> email_notify_newpm }</ label ></ span ></ td > </ tr > < tr > < td valign = "top" width = "1" >< input type = "checkbox" class= "checkbox" name = "invisible" id = "invisible" value = "yes" { $invisiblecheck } /></ td > < td valign = "top" >< span class= "smalltext" >< label for= "invisible" >{ $lang -> invisible_mode }</ label ></ span ></ td > </ tr > </ table > </ fieldset > < br /> < fieldset class= "trow2" > < legend >< strong >{ $lang -> time_offset }</ strong ></ legend > < table cellspacing = "0" cellpadding = " { $theme [ 'tablespace' ]} " > < tr > < td colspan = "2" >< span class= "smalltext" >{ $lang -> time_offset_desc }</ span ></ td > </ tr > < tr > < td >{ $tzselect }</ td > </ tr > < tr > < td valign = "top" colspan = "2" >< input type = "checkbox" class= "checkbox" name = "enabledst" id = "enabledst" value = "yes" { $enabledstcheck } /> < span class= "smalltext" >< label for= "enabledst" >{ $lang -> enable_dst }</ label ></ span ></ td > </ tr > </ table > </ fieldset > < br /> < fieldset class= "trow2" > < legend >< strong >{ $lang -> lang_select }</ strong ></ legend > < table cellspacing = "0" cellpadding = " { $theme [ 'tablespace' ]} " > < tr > < td colspan = "2" >< span class= "smalltext" >{ $lang -> lang_select_desc }</ span ></ td > </ tr > < tr > < td >< select name = "language" >< option value = "" >{ $lang -> lang_select_default }</ option >< option value = "" >-----------</ option >{ $langoptions }</ select ></ td > </ tr > </ table > </ fieldset > </ td > </ tr > </ table > < br /> < div align = "center" > < input type = "hidden" name = "action" value = "do_register" /> < input type = "submit" class= "button" name = "regsubmit" value = " { $lang -> submit_registration } " /> </ div > </ form > { $footer } </ body > </ html >
Et bonne chance
Amicalement Haytoch
Pièces jointes
member_register template.txt (Taille : 5.57 Ko / Téléchargements : 1)
Messages dans ce sujet
RE: Date de naissance obligatoire - haytoch - 22-09-2010, 14:29
Utilisateur(s) parcourant ce sujet : 1 visiteur(s)