Страница регистрацыи с добавенными картинками и проверкой пароля и логина Заходим Управление дизайном модуля-Форма регистрации пользователей-и удаляем от туда все и вставляем Этот код
Code <table border="0" cellspacing="1" cellpadding="2" width="100%" class="manTable" id="siM63"> <tr id="siM1"><td colspan="2" align="center" class="manTdError" id="siM2">$ERROR$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM42"><td class="manTd1" width="35%" id="siM43"><img src="http://forucoz.com/mpr/uname.png" border="0" alt="" />$LOGIN_SIGN$</td><td class="manTd2" id="siM44">$LOGIN_FL$
<br><div id="LoginInfo">Введите логин</div> <script> /* © Айдар aka Pain ( <A class="link" target="_blank" href="http://free-manga.net.ru/">http://free-manga.net.ru/</A> ) */ $(document).ready(function () { $('#siF20').attr('disabled', true); }); $('#siF13').change(function () { Er = false; if ($('#siF13').attr('value').length < 2){ $('#LoginInfo').html('<img align="absmiddle" src="http://src.ucoz.ru/img/icon/er.png"> <b style="color: red;">Минимальная длина логина - 2 символа</b></b>'); Er = true; } if ($('#siF13').attr('value').length > 25){ $('#LoginInfo').html('<img align="absmiddle" src="http://src.ucoz.ru/img/icon/er.png"> <b style="color: red;">Максимальная длина логина - 25 символов</b>'); Er = true; } if ($('#siF13').attr('value').match(/[^a-zA-Z0-9\-\_\@\%\{\}\[\]\(\)\u0080-\uFFFF]/)){ $('#LoginInfo').html('<img align="absmiddle" src="http://src.ucoz.ru/img/icon/er.png"> <b style="color: red;">Недопустимые символы</b>'); Er = true } if (!Er){ $('#LoginInfo').html('<img align="absmiddle" src="http://src.ucoz.ru/img/wd/3/ajaxs.gif"> <b>Подождите идет проверка...</b>'); $.get('/index/8-0-' + $('#siF13').attr('value'), function (Data) { if (Data == 'Пользователь не найден') { $('#LoginInfo').html('<img align="absmiddle" src="http://src.ucoz.ru/img/icon/ok.png"> <b style="color: green;">Логин ' + $('#siF13').attr('value') + ' свободен</b>'); $('#siF20').attr('disabled', false); } else { $('#LoginInfo').html('<img align="absmiddle" src="http://src.ucoz.ru/img/icon/er.png"> <b style="color: red;">Логин ' + $('#siF13').attr('value') + ' занят</b>'); $('#siF20').attr('disabled', true); } }) } else { $('#siF20').attr('disabled', true); } }); </script>
</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> </script></td></tr><tr></td></tr> <script type="text/javascript"> var m_strUpperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var m_strLowerCase = "abcdefghijklmnopqrstuvwxyz"; var m_strNumber = "0123456789"; var m_strCharacters = "_-"
// Check password function checkPassword(strPassword) { // Reset combination count var nScore = 0;
// Password length // -- Less than 4 characters if (strPassword.length < 5) { nScore += 10; } // -- 5 to 7 characters else if (strPassword.length > 4 && strPassword.length < 8) { nScore += 20; } // -- 8 or more else if (strPassword.length > 7) { nScore += 50; }
// Letters var nUpperCount = countContain(strPassword, m_strUpperCase); var nLowerCount = countContain(strPassword, m_strLowerCase); var nLowerUpperCount = nUpperCount + nLowerCount; // -- Letters are all lower case if (nUpperCount == 0 && nLowerCount != 0) { nScore += 20; } // -- Letters are upper case and lower case else if (nUpperCount != 0 && nLowerCount != 0) { nScore += 40; }
// Numbers var nNumberCount = countContain(strPassword, m_strNumber); // -- 1 number if (nNumberCount == 1) { nScore += 20; } // -- 3 or more numbers if (nNumberCount >= 3) { nScore += 40; }
// Characters var nCharacterCount = countContain(strPassword, m_strCharacters); // -- 1 character if (nCharacterCount == 1) { nScore += 20; } // -- More than 1 character if (nCharacterCount > 1) { nScore += 50; }
// Bonus // -- Letters and numbers if (nNumberCount != 0 && nLowerUpperCount != 0) { nScore += 4; } // -- Letters, numbers, and characters if (nNumberCount != 0 && nLowerUpperCount != 0 && nCharacterCount != 0) { nScore += 6; } // -- Mixed case letters, numbers, and characters if (nNumberCount != 0 && nUpperCount != 0 && nLowerCount != 0 && nCharacterCount != 0) { nScore += 10; }
return nScore; }
// Runs password through check and then updates GUI function runPassword(strPassword, strFieldID) { // Check password var nScore = checkPassword(strPassword);
// Get controls var ctlBar = document.getElementById(strFieldID + "_bar"); var ctlText = document.getElementById(strFieldID + "_text"); if (!ctlBar || !ctlText) return;
// Set new width ctlBar.style.width = nScore + "%";
// Color and text // -- Безупречный if (nScore >= 45) { var strText = "Отличный пароль!"; var strColor = "#0ca908"; } // -- Хороший else if (nScore >= 40) { var strText = "Хороший"; var strColor = "#00CCFF"; } // -- Довольно нормальный else if (nScore >= 35) { var strText = "Достаточно неплохо"; var strColor = "#5a74e3"; } // -- Нормальный else if (nScore >= 30) { var strText = "Нормально"; var strColor = "#FF6600"; } // -- Слабый else if (nScore >= 20) { var strText = "Слабенько"; var strColor = "#e7d61a"; } // -- Очень плохой else { var strText = "Ужас. qwerty и то лучше"; var strColor = "#e71a1a"; } ctlBar.style.backgroundColor = strColor; ctlText.innerHTML = "<span style='color: " + strColor + ";'>" + strText + "</span>"; }
// Checks a string for a list of characters function countContain(strPassword, strCheck) { // Declare variables var nCount = 0;
for (i = 0; i < strPassword.length; i++) { if (strCheck.indexOf(strPassword.charAt(i)) > -1) { nCount++; } }
return nCount; } </script> %IF($PASSWORD_FL$)% %ENDIF% %IF($PASSWORD1_FL$)% %ENDIF% <table class="manTable" id="siM63" width="100%" border="0" cellpadding="2" cellspacing="1"> <tbody> <tr id="siM45"><td class="manTd1" id="siM46">$PASSWORD_SIGN$</td><td class="manTd2" id="siM47"><input id="siF14" class="manFlPassw" name="password" size="20" style="width: 100%; font-weight: 500; font-style: normal; color: rgb(0, 0, 0);" maxlength="15" uzzonkeyup="runPassword(this.value, 'mypassword');" type="password"></td></tr> <tr id="siM48"><td class="manTd1" id="siM49">$PASSWORD1_SIGN$</td><td class="manTd2" id="siM50">$PASSWORD1_FL$</td></tr> <tr> <td width="130" height="25">Защита пароля:</td> <td><b><div id="mypassword_text" align="center">Для начала введите пароль!</div></b> <div style="width: 75%;"> <div id="mypassword_bar" style="border: 1px solid white; font-size: 1px; height: 2px; width: 0px;"></div></div></td> </tr> <tr id="siM70"><td class="manTd1" id="siM71"><img src="http://forucoz.com/mpr/group.png" border="0" alt="" />$GROUP_SIGN$</td><td class="manTd2" id="siM72">$GROUP_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM51"><td class="manTd1" id="siM52"><img src="http://forucoz.com/mpr/nameu.png" border="0" alt="" />$NAME_SIGN$</td><td class="manTd2" id="siM53">$NAME_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM54"><td class="manTd1" id="siM55"><img src="http://forucoz.com/mpr/email.png" border="0" alt="" />$EMAIL_SIGN$</td><td class="manTd2" id="siM56">$EMAIL_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM3"><td class="manTd1" id="siM4"><img src="http://forucoz.com/mpr/www.png" border="0" alt="" />$WWW_SIGN$</td><td class="manTd2" id="siM5">$WWW_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM6"><td class="manTd1" id="siM7"><img src="http://forucoz.com/mpr/icq.png" border="0" alt="" />$ICQ_SIGN$</td><td class="manTd2" id="siM8">$ICQ_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM9"><td class="manTd1" id="siM10">$AOL_SIGN$</td><td class="manTd2" id="siM11">$AOL_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM12"><td class="manTd1" id="siM13">$MSN_SIGN$</td><td class="manTd2" id="siM14">$MSN_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM15"><td class="manTd1" id="siM16">$YAHOO_SIGN$</td><td class="manTd2" id="siM17">$YAHOO_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM30"><td class="manTd1" id="siM31"><img src="http://forucoz.com/mpr/denrojd.png" border="0" alt="" />$BIRTHDAY_SIGN$</td><td class="manTd2" id="siM32">$BIRTHDAY_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM27"><td class="manTd1" id="siM28"><img src="http://forucoz.com/mpr/group.png" border="0" alt="" />$GENDER_SIGN$</td><td class="manTd2" id="siM29">$GENDER_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM18"><td class="manTd1" id="siM19"><img src="http://forucoz.com/mpr/registracia.png" border="0" alt="" />$COUNTRY_SIGN$</td><td class="manTd2" id="siM20">$COUNTRY_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM21"><td class="manTd1" id="siM22">$STATE_SIGN$</td><td class="manTd2" id="siM23">$STATE_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM24"><td class="manTd1" id="siM25"><img src="http://forucoz.com/mpr/vxod.png" border="0" alt="" />$CITY_SIGN$</td><td class="manTd2" id="siM26">$CITY_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM36"><td class="manTd1" valign="top" id="siM37">$AVATAR_SIGN$</td><td class="manTd2" id="siM38">$AVATAR_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM33"><td class="manTd1" id="siM34">$SIGNATURE_SIGN$</td><td class="manTd2" id="siM35">$SIGNATURE_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM39"><td class="manTd1" id="siM40">$SUBSCRIPTION_SIGN$</td><td class="manTd2" id="siM41">$SUBSCRIPTION_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM63"><td class="manTd1" id="siM64">$OPTIONS_SIGN$</td><td class="manTd2" id="siM65">$OPTIONS_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM60"><td class="manTd1" id="siM61">$SECURITY_CODE_SIGN$</td><td class="manTd2" id="siM62">$SECURITY_CODE_FL$</td></tr><tr><td height="10" class="manTdSep" colspan="2"><hr class="manHr" /></td></tr> <tr id="siM64"><td class="manTdBut" colspan="2" align="center" id="siM65"><input class="manFlSbm" id="siF20" type="submit" name="sbm" value="$SUBMIT_SIGN$" /></td></tr> </table>
|