Cette astuce sera donc visible, mais un petit merci sera apprécié pour la traduction vers la version Française. Un bouton a été ajouté afin de visualiser le mot de passe:
Dans le contenu donné , il faudra modifier le lien, le titre du forum et éventuellement l'image ici:
Code:
<h1 class="fa_login_maintitle"><a href="LIEN DE VOTRE FORUM" target="_blank"><img src="https://im0.all-up.com/static/images/sigle.png"/><span style="color:#39C;">TITRE DE VOTRE FORUM</span></a></h1>
Modules/HTML & JAVASCRIPT/Gestion des pages HTML/Création en mode avancé (HTML)
Titre * : Mettre un titre explicite Voulez-vous utiliser le haut et le bas de page de votre forum ? Cocher Oui Utiliser cette page en tant que page d'accueil ? Cocher Non
Déposez ceci:
Code:
<!-- DEVELOPED BY ANGE TUTEUR NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR ORIGIN : http://fmdesign.forumotion.com/t420-multi-step-login-form#3371 -->
<div class="fa_login_row"> <input id="fa_login_password" class="fa_login_input" type="password" name="password" placeholder="Mot de passe"/> <br /> <br /><input type="checkbox" name="visumdp" id="visumdp"> Afficher le mot de passe</input><br /> <p id="fa_error_password" class="fa_login_row" style="color:#F00;width:240px;margin:10px auto;display:none;">Vous avez spécifié un nom d'utilisateur ou un mot de passe incorrect.</p> </div>
/* if the default login link is present we can get the data from the href attribute. ( FASTER ) ** otherwise we'll need to send an AJAX request to the login page for the data ( SLOWER ) */ if (logout) { var tid = logout.href.replace(/.*?tid=(.*?)&.*/, '$1'), key = logout.href.replace(/.*?key=(.*?)$/, '$1');
<div class="fa_login_origin">Formulaire de connexion développé par Ange Tuteur. <a href="http://fmdesign.forumotion.com/t420-multi-step-login-form#3371">Obtenir le code !</a></div> </div>
/* move onto the password step pass along the user id to get the user avatar faster */ next : function(id) { var username = document.getElementById('fa_login_username');
if (username.value) { var avatar = document.getElementById('fa_avatar_real'), row, accounts, i;
fa_form_login.clearError('username'); username.value = username.value.replace(/^\s+|\s+$/g, ''); // trim extra white space
// check if the username is already stored if (!id && storage && storage.fa_accounts && window.JSON) { accounts = JSON.parse(storage.fa_accounts); for (i in accounts) { if (username.value.toLowerCase() == accounts[i].username.toLowerCase()) { id = i; break; } } }
row = id ? null : document.getElementById('account_user_' + id);
// check if account row is created to get an avatar that's already loaded if (row) avatar.src = row.getElementsByTagName('IMG')[0].src; else { $.get(id ? '/ajax/index.php?f=m&user_id=' + id : '/profile?mode=viewprofile&u=' + username.value, function(d) { var ava = id ? $('.tooltip-content img', d)[0] : $('#profile-advanced-right .module:first div img:first,.forumline td.row1.gensmall:first > img:first, .frm-set.profile-view.left dd img,dl.left-box.details:first dd img, .row1 b .gen:first img, .real_avatar img', d)[0]; avatar.src = ava ? ava.src : 'https://2img.net/i/fa/invision/pp-blank-thumb.png'; avatar.className = 'avatar_visible'; }); }
$.post('/login', $('#fa_form_login').serialize() + '&login=true', function(d) { fa_form_login.submitting = false; if (/_userdata\["session_logged_in"\] = 1/.test(d)) { var storage = window.localStorage, id = d.match(/_userdata\["user_id"\] = (\d+)/)[1];
/* store the user_id and username for next login */ if (storage && window.JSON) { var accounts = storage.fa_accounts ? JSON.parse(storage.fa_accounts) : {}, i;
for (i in accounts) accounts[i].last_active = 0;
accounts[id] = { last_active : 1, /* last active account will be marked with a 1 */ username : document.getElementById('fa_login_username').value };
/* throw a form error and display the error text */ error : function(type) { var error = document.getElementById('fa_error_' + type), wrap = document.getElementById('fa_form_wrap');
if (/none/.test(error.style.display)) { document.getElementById('fa_login_' + type).style.borderColor = '#F00';
/* delete a profile from the account list */ deleteProfile : function(id) { var storage = window.localStorage, accounts = JSON.parse(storage.fa_accounts), row = document.getElementById('account_user_' + id), i;
delete accounts[id]; for (i in accounts) { accounts[i].last_active = 1; break; } storage.fa_accounts = JSON.stringify(accounts);
row.parentNode.removeChild(row); if (!fa_form_login.accountList.firstChild) fa_form_login.accountList.innerHTML = '<div class="fa_login_row">Il n\'y a pas de comptes enregistrés.</div><div class="fa_login_row"><a href="javascript:fa_form_login.toggleAccounts();">Retour à la connexion</a></div>'; },
/* create the profile rows based onto the accounts you logged into */ createProfile : function(id, o) { var row = document.createElement('DIV'); row.id = 'account_user_' + id; row.className = 'account_list_row'; row.innerHTML = '<div class="account_list_inner"><img class="account_list_avatar" src="https://2img.net/i/fa/invision/pp-blank-thumb.png"/> <span class="account_list_username">' + o.username + '</span></div><a class="account_list_delete" title="Supprimer le compte" href="javascript:fa_form_login.deleteProfile(\'' + id + '\');">X</a>'; row.firstChild.onclick = function() { fa_form_login.toggleAccounts(); document.getElementById('fa_login_username').value = $('.account_list_username', this).text(); fa_form_login.next(this.parentNode.id.slice(13)); };
$.get('/ajax/index.php?f=m&user_id=' + id, function(d) { var ava = $('.tooltip-content img', d)[0]; if (ava) row.getElementsByTagName('IMG')[0].src = ava.src; });
fa_form_login.accountList.appendChild(row); },
/* basic setup of the account list */ initAccountList : function() { var a = document.createElement('A'), holder = document.getElementById('account_list_holder');
a.href = '#'; a.innerHTML = 'Choisir un autre compte'; a.onclick = fa_form_login.toggleAccounts;
/* toggle display of the account list */ toggleAccounts : function() { if (/accounts_hidden/.test(fa_form_login.accountList.className)) { fa_form_login.accountList.className = ''; document.getElementById('account_list_holder').firstChild.innerHTML = 'Retour à la connexion'; } else { fa_form_login.accountList.className = 'accounts_hidden'; document.getElementById('account_list_holder').firstChild.innerHTML = 'Choisir un autre compte'; }
if (!fa_form_login.accountList.firstChild) fa_form_login.accountList.innerHTML = '<div class="fa_login_row">Il n\'y a pas de comptes enregistrés.</div><div class="fa_login_row"><a href="javascript:fa_form_login.toggleAccounts();">Retour à la connexion</a></div>'; return false; } };
var container = document.getElementById('fa_form_container'), username = document.getElementById('fa_login_username'), storage = window.localStorage;
container.className = 'logged_out';
/* move forward in the form when ENTER is pressed */ username.onkeydown = function(e) { if (e.keyCode && e.keyCode == 13) { fa_form_login.next(); return false; } };
/* if the specified data is useable we'll go through the stored accounts in localStorage and form a list for switching */ if (storage && storage.fa_accounts && window.JSON) { var accounts = JSON.parse(storage.fa_accounts), i, last_active = false;
for (i in accounts) { if (accounts[i].last_active) { last_active = true; username.value = accounts[i].username; fa_form_login.next(i); }
// link change if (link_change && !regex.test(window.location.href)) { $('a[href^="/login"], a[href^="http://' + window.location.host + '/login"]').attr('href', html_page); }
// redirect to classic if login page isn't available if (!document.getElementById('fa_form_container') && regex.test(window.location.href)) { window.location.href = '/login#login_classic'; } });
// login redirection // saves redirect location so you're taken to the correct page upon login if (/\/login\?redirect/.test(window.location.href)) { my_setcookie('fa_login_form_redirect', window.location.search.replace(/.*?redirect=(.*?)(?:&|$)/, '$1')); }
// redirect if (redirect && /\/login/.test(window.location.href)) { if (/login_classic/.test(window.location.hash) || /admin=1/.test(window.location.href)) return; window.location.href = html_page; } }());
Dernière édition par Milouze14 le Lun 29 Nov 2021 - 8:07, édité 8 fois
photoclic, chattigre et Freedom Sun aiment ce message
Invité Invité
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Ven 10 Mar 2017 - 20:36
Un grand merci à toi Phil, j'adore.
Et puis, tu va pas le croire, j'ai compris du premier coup
Milouze14
Fondateur
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Sam 11 Mar 2017 - 5:30
De rien Romain, tu t'améliores avec le temps
Invité Invité
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Sam 11 Mar 2017 - 16:47
Milouze14 a écrit:
De rien Romain, tu t'améliores avec le temps
Tu vois avec l'age, j'améliore mes capacités informatiques. Bon faut dire que je suis sur le net depuis 1994 et créateur de forum depuis 2005.
Invité Invité
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Mar 24 Avr 2018 - 13:25
Merci Phil
MathisB
Milouzien
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Sam 11 Aoû 2018 - 13:03
Bonjour Merci pour ce code :) Mais avant de l'installer j'ai une petite question Dois-je laisser ceci sur la page HTML ou puis-je l'enlever?
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Sam 11 Aoû 2018 - 19:51
Hello Mathis,
Citation :
Dois-je laisser ceci sur la page HTML ou puis-je l'enlever?
Par respect envers le codeur , oui c'est préférable
-Staff du Forum Milouze14-
Ce forum n'a pas pour vocation d'apporter d'autre explication sur le tutoriel présent. Si ce dernier n'est pas assez explicite: Le forum d'entraide est prévu à cet effet.
Pour toute information merci de contacter un Membre du Staff
petitefeuille
Milouzien
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Mer 15 Aoû 2018 - 16:43
Bonjour, j'essai en ce moment de travailler ma page d'accueil en HTLM (ce n'est pas gagné ) , ce tuto va surement m'aider, merci beaucoup
chrisnvidia
Milouzien
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Dim 19 Aoû 2018 - 14:43
Merci Philippe pour cet astuce et très bien traduit
Pour une fois que sa marche du 1er coup et donc pas eu besoin de ton aide
christ77000
Milouzien
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Mar 25 Fév 2020 - 14:13
Merci
fred9545
Milouzien
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Mar 22 Sep 2020 - 20:35
phil
merci pour cette astuce
photoclic
Milouzien
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Mar 22 Sep 2020 - 21:31
Super bien fait Phil
Roza
Milouzien
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Dim 4 Oct 2020 - 16:57
Bonjour Phil !
J'ai une petite question "technique" concernant la mise en place de ces codes.
Inscrite récemment, je ne maîtrise pas encore le fonctionnement de ce forum : faut-il ouvrir un sujet spécifique dans l'entraide, ou bien puis-je la poser ici, à la suite ?
Merci d'avance pour ta réponse.
Milouze14
Fondateur
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Dim 4 Oct 2020 - 17:11
Coucou Roza,
effectivement, il n'y a pas d'entraide sur les astuces. Tu peux ouvrir un sujet sur l'entraide si tu le souhaites. N'oublies pas de lire le règlement.
Roza
Milouzien
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Dim 4 Oct 2020 - 17:36
OK !
Merci pour ta réponse rapide.
Je viens justement de lire et accepter le règlement, et dans la foulée j'ai posé une question sur un thème autre que celui-ci.
Bonne soirée.
Freedom Sun
Milouzien
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Mar 23 Mar 2021 - 19:20
Phil,
Voilà ce que ça fait quand je l'installe normalement sens modif, la moitié est bouffée quand je veux me connecter !
Milouze14
Fondateur
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Mar 23 Mar 2021 - 19:23
Merci d'ouvrir un sujet sur l'entraide Stefano, car a priori c'est propre a Modernbb. Comme mentionné plus haut les astuces en sont prévues pour recevoir des demandes. Désolé, mais sinon, c'est vite fait le bazar sur le fofo.
Allez testes cette page html:
Code:
<!-- DEVELOPED BY ANGE TUTEUR NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR ORIGIN : http://fmdesign.forumotion.com/t420-multi-step-login-form#3371 -->
<div class="fa_login_row"> <input id="fa_login_password" class="fa_login_input" type="password" name="password" placeholder="Mot de passe"/> <br /> <br /><input type="checkbox" name="visumdp" id="visumdp"> Afficher le mot de passe</input><br /> <p id="fa_error_password" class="fa_login_row" style="color:#F00;width:240px;margin:10px auto;display:none;">Vous avez spécifié un nom d'utilisateur ou un mot de passe incorrect.</p> </div>
/* if the default login link is present we can get the data from the href attribute. ( FASTER ) ** otherwise we'll need to send an AJAX request to the login page for the data ( SLOWER ) */ if (logout) { var tid = logout.href.replace(/.*?tid=(.*?)&.*/, '$1'), key = logout.href.replace(/.*?key=(.*?)$/, '$1');
<div class="fa_login_origin">Formulaire de connexion développé par Ange Tuteur. <a href="http://fmdesign.forumotion.com/t420-multi-step-login-form#3371">Obtenir le code !</a></div> </div>
/* move onto the password step pass along the user id to get the user avatar faster */ next : function(id) { var username = document.getElementById('fa_login_username');
if (username.value) { var avatar = document.getElementById('fa_avatar_real'), row, accounts, i;
fa_form_login.clearError('username'); username.value = username.value.replace(/^\s+|\s+$/g, ''); // trim extra white space
// check if the username is already stored if (!id && storage && storage.fa_accounts && window.JSON) { accounts = JSON.parse(storage.fa_accounts); for (i in accounts) { if (username.value.toLowerCase() == accounts[i].username.toLowerCase()) { id = i; break; } } }
row = id ? null : document.getElementById('account_user_' + id);
// check if account row is created to get an avatar that's already loaded if (row) avatar.src = row.getElementsByTagName('IMG')[0].src; else { $.get(id ? '/ajax/index.php?f=m&user_id=' + id : '/profile?mode=viewprofile&u=' + username.value, function(d) { var ava = id ? $('.tooltip-content img', d)[0] : $('#profile-advanced-right .module:first div img:first,.forumline td.row1.gensmall:first > img:first, .frm-set.profile-view.left dd img,dl.left-box.details:first dd img, .row1 b .gen:first img, .real_avatar img', d)[0]; avatar.src = ava ? ava.src : 'https://2img.net/i/fa/invision/pp-blank-thumb.png'; avatar.className = 'avatar_visible'; }); }
$.post('/login', $('#fa_form_login').serialize() + '&login=true', function(d) { fa_form_login.submitting = false; if (/_userdata\["session_logged_in"\] = 1/.test(d)) { var storage = window.localStorage, id = d.match(/_userdata\["user_id"\] = (\d+)/)[1];
/* store the user_id and username for next login */ if (storage && window.JSON) { var accounts = storage.fa_accounts ? JSON.parse(storage.fa_accounts) : {}, i;
for (i in accounts) accounts[i].last_active = 0;
accounts[id] = { last_active : 1, /* last active account will be marked with a 1 */ username : document.getElementById('fa_login_username').value };
/* throw a form error and display the error text */ error : function(type) { var error = document.getElementById('fa_error_' + type), wrap = document.getElementById('fa_form_wrap');
if (/none/.test(error.style.display)) { document.getElementById('fa_login_' + type).style.borderColor = '#F00';
/* delete a profile from the account list */ deleteProfile : function(id) { var storage = window.localStorage, accounts = JSON.parse(storage.fa_accounts), row = document.getElementById('account_user_' + id), i;
delete accounts[id]; for (i in accounts) { accounts[i].last_active = 1; break; } storage.fa_accounts = JSON.stringify(accounts);
row.parentNode.removeChild(row); if (!fa_form_login.accountList.firstChild) fa_form_login.accountList.innerHTML = '<div class="fa_login_row">Il n\'y a pas de comptes enregistrés.</div><div class="fa_login_row"><a href="javascript:fa_form_login.toggleAccounts();">Retour à la connexion</a></div>'; },
/* create the profile rows based onto the accounts you logged into */ createProfile : function(id, o) { var row = document.createElement('DIV'); row.id = 'account_user_' + id; row.className = 'account_list_row'; row.innerHTML = '<div class="account_list_inner"><img class="account_list_avatar" src="https://2img.net/i/fa/invision/pp-blank-thumb.png"/> <span class="account_list_username">' + o.username + '</span></div><a class="account_list_delete" title="Supprimer le compte" href="javascript:fa_form_login.deleteProfile(\'' + id + '\');">X</a>'; row.firstChild.onclick = function() { fa_form_login.toggleAccounts(); document.getElementById('fa_login_username').value = $('.account_list_username', this).text(); fa_form_login.next(this.parentNode.id.slice(13)); };
$.get('/ajax/index.php?f=m&user_id=' + id, function(d) { var ava = $('.tooltip-content img', d)[0]; if (ava) row.getElementsByTagName('IMG')[0].src = ava.src; });
fa_form_login.accountList.appendChild(row); },
/* basic setup of the account list */ initAccountList : function() { var a = document.createElement('A'), holder = document.getElementById('account_list_holder');
a.href = '#'; a.innerHTML = 'Choisir un autre compte'; a.onclick = fa_form_login.toggleAccounts;
/* toggle display of the account list */ toggleAccounts : function() { if (/accounts_hidden/.test(fa_form_login.accountList.className)) { fa_form_login.accountList.className = ''; document.getElementById('account_list_holder').firstChild.innerHTML = 'Retour à la connexion'; } else { fa_form_login.accountList.className = 'accounts_hidden'; document.getElementById('account_list_holder').firstChild.innerHTML = 'Choisir un autre compte'; }
if (!fa_form_login.accountList.firstChild) fa_form_login.accountList.innerHTML = '<div class="fa_login_row">Il n\'y a pas de comptes enregistrés.</div><div class="fa_login_row"><a href="javascript:fa_form_login.toggleAccounts();">Retour à la connexion</a></div>'; return false; } };
var container = document.getElementById('fa_form_container'), username = document.getElementById('fa_login_username'), storage = window.localStorage;
container.className = 'logged_out';
/* move forward in the form when ENTER is pressed */ username.onkeydown = function(e) { if (e.keyCode && e.keyCode == 13) { fa_form_login.next(); return false; } };
/* if the specified data is useable we'll go through the stored accounts in localStorage and form a list for switching */ if (storage && storage.fa_accounts && window.JSON) { var accounts = JSON.parse(storage.fa_accounts), i, last_active = false;
for (i in accounts) { if (accounts[i].last_active) { last_active = true; username.value = accounts[i].username; fa_form_login.next(i); }
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Mar 23 Mar 2021 - 19:37
Désolé Phil,
Je le comprend, et encore merci pour l'ajout du mot de passe dans le Bloc,
Tu es super !
Encore,
À bientôt,
Cdlt, Stefano
Milouze14
Fondateur
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Mar 23 Mar 2021 - 19:43
De rien cher ami, je vais faire un peu de ménage sur le sujet .
fred9545, phil85 et Freedom Sun aiment ce message
Milouze14
Fondateur
Sujet: Re: [TOUTES VERSIONS] Une page html connexion/deconnexion... Jeu 25 Mar 2021 - 5:55
Hello les ami(e)s, l'ajout de l'affichage du mot de passe généré un décalage au clic dans la case, j'ai donc modifié le code html . Pour celles et ceux qui ont personnalisé cette page, il faut trouver cette class: