📄 register.asp
字号:
'Reset server Object
rsCommon.Close
Call closeDatabase()
Response.Redirect("default.asp" & strQsSID1)
End If
'Read in the new user's profile from the recordset
strUsername = rsCommon("Username")
strRealName = rsCommon("Real_name")
strGender = rsCommon("Gender")
If NOT isNull(rsCommon("Author_email")) Then strEmail = formatInput(rsCommon("Author_email"))
If blnWebWizNewsPad Then blnNewsletter = CBool(rsCommon("Newsletter"))
blnShowEmail = CBool(rsCommon("Show_email"))
If NOT isNull(rsCommon("Homepage")) Then strHomepage = formatInput(rsCommon("Homepage"))
If NOT isNull(rsCommon("Location")) Then strLocation = rsCommon("Location")
strSignature = rsCommon("Signature")
strAvatar = rsCommon("Avatar")
strMemberTitle = rsCommon("Avatar_title")
strDateFormat = rsCommon("Date_format")
strTimeOffSet = rsCommon("Time_offset")
intTimeOffSet = CInt(rsCommon("Time_offset_hours"))
blnReplyNotify = CBool(rsCommon("Reply_notify"))
blnAttachSignature = CBool(rsCommon("Attach_signature"))
blnWYSIWYGEditor = CBool(rsCommon("Rich_editor"))
If NOT isNull(rsCommon("ICQ")) Then strICQNum = formatInput(rsCommon("ICQ"))
If NOT isNull(rsCommon("AIM")) Then strAIMAddress = formatInput(rsCommon("AIM"))
If NOT isNull(rsCommon("MSN")) Then strMSNAddress = formatInput(rsCommon("MSN"))
If NOT isNull(rsCommon("Yahoo")) Then strYahooAddress = formatInput(rsCommon("Yahoo"))
If NOT isNull(rsCommon("Skype")) Then strSkypeName = formatInput(rsCommon("Skype"))
strOccupation = rsCommon("Occupation")
strInterests = rsCommon("Interests")
dtmDateOfBirth = rsCommon("DOB")
blnPMNotify = CBool(rsCommon("PM_notify"))
'If we are in admin mode then read on extra user details
If blnAdminMode Then
intUsersGroupID = CInt(rsCommon("Group_ID"))
blnUserActive = CBool(rsCommon("Active"))
lngPosts = CLng(rsCommon("No_of_posts"))
blnSuspended = CBool(rsCommon("Banned"))
strAdminNotes = rsCommon("Info")
End If
'Reset Server Objects
rsCommon.Close
'If the user has enterd a date format then place in array
If NOT strDateFormat = "" Then saryDateTimeData(0,0) = strDateFormat
'If admin mode is on and the user is only a moderator and the edited account is an admin account then the modertor can not edit the account
If blnAdminMode AND blnModerator AND intUsersGroupID = 1 Then
'clean up before redirecting
Call closeDatabase()
'redirect to insufficient permissions page
Response.Redirect("insufficient_permission.asp?FID=" & intForumID & strQsSID3)
End If
'Split the date of biith into the various parts
If isDate(dtmDateOfBirth) Then
intDOBYear = Year(dtmDateOfBirth)
intDOBMonth = Month(dtmDateOfBirth)
intDOBDay = Day(dtmDateOfBirth)
End If
End If
'******************************************
'*** De-code signature ***
'******************************************
'Covert the signature back to forum codes
If strSignature <> "" Then strSignature = EditPostConvertion(strSignature)
'Create a form ID
strFormID = LCase(hexValue(10))
'Place formID into app session
Call saveSessionItem("formID", strFormID)
'Set bread crumb trail
If strMode = "update" Then
strBreadCrumbTrail = strBreadCrumbTrail & strNavSpacer & strTxtEditProfile
Else
strBreadCrumbTrail = strBreadCrumbTrail & strNavSpacer & strTxtRegisterNewUser
End If
%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<meta name="generator" content="Web Wiz Forums" />
<title><% If strMode = "update" Then Response.Write(strTxtEditProfile) Else Response.Write(strTxtRegisterNewUser) %></title>
<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* *******************************************************" & _
vbCrLf & "Software: Web Wiz Forums(TM) ver. " & strVersion & "" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Copyright: (C)2001-2008 Web Wiz(TM). All rights reserved" & _
vbCrLf & "******************************************************* */" & _
vbCrLf & "//-->" & vbCrLf & vbCrLf)
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<!-- Check the from is filled in correctly before submitting -->
<script language="JavaScript">
//Function to check form is filled in correctly before submitting
function CheckForm () {
//Initialise variables
var errorMsg = "";
var errorMsgLong = "";
var formArea = document.getElementById('frmRegister');
<%
'If this is new reg then make sure the user eneters a username and password
If strMode ="new" Then
%>
//Check for a username
if (formArea.name.value.length < 2){
errorMsg += "\n\t<% = strTxtErrorUsernameChar %>";
}
//Check for a password
if (formArea.password1.value.length <= 3){
errorMsg += "\n\t<% = strTxtErrorPasswordChar %>";
}
<%
'If this is an update only check the password length if the user is enetring a new password
ElseIf (intUpdatePartNumber = 0 OR intUpdatePartNumber = 1) AND blnWindowsAuthentication = False AND (blnMemberAPI = False OR blnMemberAPIDisableAccountControl = False) Then
%>
//Check for a password
if ((formArea.password1.value.length <= 3) && (formArea.password1.value.length > 0)){
errorMsg += "\n\t<% = strTxtErrorPasswordChar %>";
}<%
End If
'If this is not showing the reg part or all the form then don't run the password and email check js
If (intUpdatePartNumber = 0 OR intUpdatePartNumber = 1) AND blnWindowsAuthentication = False AND (blnMemberAPI = False OR blnMemberAPIDisableAccountControl = False) Then
%>
//Check both passwords are the same
if ((formArea.password1.value) != (formArea.password2.value)){
errorMsg += "\n\t<% = strTxtErrorPasswordNoMatch %>";
formArea.password1.value = ""
formArea.password2.value = ""
}
//If an e-mail is entered check that the e-mail address is valid
if (<%
'If e-mail activation is on check that the e-mail address entered is correct
If blnEmailActivation = True Then
Response.Write("formArea.email.value == """" || ")
Else
Response.Write("formArea.email.value.length >0 && ")
End If
%>(formArea.email.value.indexOf("@",0) == -1||formArea.email.value.indexOf(".",0) == -1)) {
errorMsg +="\n\t<% = strTxtErrorValidEmail %>";
<%
'If e-mail activation is not on display a long error message to the user if they enter an incorrect e-mail addres
If NOT blnEmailActivation = True Then Response.Write(" errorMsgLong += ""\n- " & strTxtErrorValidEmailLong & """; ")
%>
}
//Check to make sure the user is not trying to show their email if they have not entered one
if (formArea.email.value == "" && formArea.emailShow[0].checked == true){
errorMsgLong += "\n- <% = strTxtErrorNoEmailToShow %>";
formArea.emailShow[1].checked = true
formArea.email.focus();
}
<%
End If
'If this is new reg then make sure the user eneters a username and password
If strMode ="new" AND blnCAPTCHAsecurityImages Then
%>
//Check for a security code
if (formArea.securityCode.value == ''){
errorMsg += "\n\t<% = strTxtErrorSecurityCode %>";
}<%
End If
'If long reg form is not on then don't need to check the lengh of the signature
If ((blnLongRegForm AND strMode = "new") OR (strMode <> "new")) AND (intUpdatePartNumber = 0 OR intUpdatePartNumber = 2) Then
%>
//Check that the signature is not above 200 chracters
if (formArea.signature.value.length > 200){
errorMsg += "\n\t<% = strTxtErrorSignatureToLong %>";
errorMsgLong += "\n- <% = strTxtYouHave %> " + document.frmRegister.signature.value.length + " <% = strTxtCharactersInYourSignatureToLong %>";
}
<%
End If
%>
//If there is aproblem with the form then display an error
if ((errorMsg != "") || (errorMsgLong != "")){
msg = "<% = strTxtErrorDisplayLine %>\n\n";
msg += "<% = strTxtErrorDisplayLine1 %>\n";
msg += "<% = strTxtErrorDisplayLine2 %>\n";
msg += "<% = strTxtErrorDisplayLine %>\n\n";
msg += "<% = strTxtErrorDisplayLine3 %>\n";
errorMsg += alert(msg + errorMsg + "\n" + errorMsgLong);
return false;
}
formArea.formID.value='<% = strFormID %>';
//Reset the submition action
formArea.action = 'register.asp?FID=<% = Server.HTMLEncode(intForumID) %><% = strQsSID2 %>'
formArea.target = '_self';
return true;
}
//Function to count characters in textarea
function characterCounter(charNoBox, textFeild) {
document.getElementById(charNoBox).value = document.getElementById(textFeild).value.length;
}
//Function to open preview post window
function OpenPreviewWindow(targetPage){
var formArea = document.getElementById('frmRegister');
now = new Date
//Open the window first
winOpener('','preview',1,1,680,400)
//Now submit form to the new window
formArea.action = targetPage + '?ID=' + now.getTime() + '<% = strQsSID2 %>';
formArea.target = 'preview';
formArea.submit();
}
</script>
<link href="<% = strCSSfile %>default_style.css" rel="stylesheet" type="text/css" />
<!-- #include file="includes/header.asp" -->
<!-- #include file="includes/status_bar_header_inc.asp" -->
<table class="basicTable" cellspacing="0" cellpadding="3" align="center">
<tr>
<td align="left"><h1><% If strMode = "update" Then Response.Write(strTxtEditProfile) Else Response.Write(strTxtRegisterNewUser) %></h1></td>
</tr>
</table>
<br /><%
'If this is an update and email notify is on show link to email subcriptions
If strMode = "update" AND lngUserProfileID <> 2 Then
%>
<table class="basicTable" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="tabTable">
<a href="member_control_panel.asp<% If blnAdminMode Then Response.Write("?PF=" & lngUserProfileID & "&M=A" & strQsSID2) Else Response.Write(strQsSID1) %>" title="<% = strTxtControlPanel %>" class="tabButton"> <img src="<% = strImagePath %>member_control_panel.<% = strForumImageType %>" border="0" alt="<% = strTxtControlPanel %>" /> <% = strTxtControlPanel %></a>
<a href="register.asp<% If blnAdminMode Then Response.Write("?PF=" & lngUserProfileID & "&M=A" & strQsSID2) Else Response.Write(strQsSID1) %>" title="<% = strTxtProfile2 %>" class="tabButtonActive"> <img src="<% = strImagePath %>profile.<% = strForumImageType %>" border="0" alt="<% = strTxtProfile2 %>" /> <% = strTxtProfile2 %></a><%
If blnEmail Then
%>
<a href="email_notify_subscriptions.asp<% If blnAdminMode Then Response.Write("?PF=" & lngUserProfileID & "&M=A" & strQsSID2) Else Response.Write(strQsSID1) %>" title="<% = strTxtSubscriptions %>" class="tabButton"> <img src="<% = strImagePath %>subscriptions.<% = strForumImageType %>" border="0" alt="<% = strTxtSubscriptions %>" /> <% = strTxtSubscriptions %></a><%
End If
'Only disply other links if not in admin mode
If blnAdminMode = False AND blnActiveMember AND blnPrivateMessages Then
%>
<a href="pm_buddy_list.asp<% = strQsSID1 %>" title="<% = strTxtBuddyList %>" class="tabButton"> <img src="<% = strImagePath %>buddy_list.<% = strForumImageType %>" border="0" alt="<% = strTxtBuddyList %>" /> <% = strTxtBuddyList %></a><%
End If
'If the user is user is using a banned IP redirect to an error page
If blnAttachments OR blnImageUpload Then
%>
<a href="file_manager.asp<% If blnAdminMode Then Response.Write("?PF=" & lngUserProfileID & "&M=A" & strQsSID2) Else Response.Write(strQsSID1) %>" title="<% = strTxtFileManager %>" class="tabButton"> <img src="<% = strImagePath %>file_manager.<% = strForumImageType %>"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -