⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reply.asp

📁 一个虚拟主机代理系统
💻 ASP
字号:
<%'=========================================
'ScriptMate User Manager Version 2.1
'Copyright 2001 (C) ScriptMate.Com
'User Module
'This module helps a member to reply for the message  
'For any help with modification to
'this file contact support@scriptmate.com
'=========================================%>

<script language="JAVASCRIPT">

	var errfound = false;

		function ValidLength(item, len) {
		   return (item.length >= len);
		}

		function error(elem, text) {
		   if (errfound) return;
		   window.alert(text);
		   elem.select();
		   elem.focus();
		   elem.style.backgroundColor=errorcolor;
		   errfound = true;
		}
		function Validate() {
		   errfound = false;
		   d=document.reply
		   if (!ValidLength(d.messaging_toid.value,1))error(d.messaging_toid,"To should not be blank.");
		   if (!ValidLength(d.messaging_subject.value,1))error(d.messaging_subject,"Subject should not be blank.");
		   if (!ValidLength(d.messaging_message.value,1))error(d.messaging_message,"Message should not be blank.");
		   return !errfound;
		}

</script>

<%Sub Reply()

	dim todo,action,records,messaging_fromid,messaging_subject,messaging_date,messaging_message,messaging_toid,messaging_approvalstatus,messageerror,messaging_id
	
	if not Application("smumdebugmode") then on error resume next
	
	if session("id") = "" then Response.Redirect smumpage&"?action=login&url="&Request.ServerVariables("url")&"?action=inbox"

	action = request("action")
	todo = request("todo")
	messaging_id = request("messaging_id")

	if todo = "" then

		smumquery = "select * from smum_messagingtbl where messaging_id = "& messaging_id
		smumOpenrs smumquery,"smumrs",action

			if not smumrs.eof then
				
				records = true
				messaging_fromid = smumrs("messaging_fromid")
				messaging_subject = replace(smumrs("messaging_subject"),"Re: ","")
				messaging_date = smumrs("messaging_date")
				messaging_message = smumrs("messaging_message")
				
			else
				records = false
			end if
		
		smumClosers(smumrs)

		if records then
		
			smumFormAction "<form action="""&Request.ServerVariables("url")&"?action=reply"" method=post name=reply language=""JAVASCRIPT"" onsubmit=""return Validate();"">"
			smumFormHiddenField "todo","add"
			smumFormOpenTable
			smumFormHeader "Reply"
			smumFormFields "To","<input class=fieldbox type=text size=35 maxlength=50 name=""messaging_toid"" value="""&smumgetusername(messaging_fromid)&""">"
			smumFormFields "Subject","<input class=fieldbox type=text size=35 maxlength=50 name=""messaging_subject"" value=""Re: "&messaging_subject&""">"
			smumFormFields "Message","<textarea class=fieldbox rows=5 cols=35 name=messaging_message>"& vbcrlf & vbcrlf & vbcrlf & "------------------------------------"& vbcrlf &" <B> "& smumgetusername(messaging_fromid)&" wrote "& vbcrlf & "on "&formatdatetime(messaging_date,vblongdate)& vbcrlf & "at "&formatdatetime(messaging_date,vblongtime) &" </B> "& vbcrlf & "------------------------------------"& vbcrlf & messaging_message&"</textarea>"
			smumFormButtons "<input class=fieldbox type=submit value=""Send Reply"">"
			smumFormCloseTable
			smumFormClose		
		
		end if
		
	elseif todo = "add" then

		messaging_toid = smFixer(request("messaging_toid"))
		messaging_subject = smFixer(request("messaging_subject"))
		messaging_message = smFixer(request("messaging_message"))

		if IsNumeric(messaging_toid) then
			smumquery = "select members_id from smum_memberstbl where members_id ="& messaging_toid
		else
			smumquery = "select members_id from smum_memberstbl where members_username ='"& messaging_toid &"' or members_email ='"& messaging_toid &"' "
		end if

		smumOpenrs smumquery,"smumrs",action
		
			if smumrs.eof then
				messaging_toid = ""
			else
				messaging_toid = smumrs("members_id")
			end if

		smumClosers(smumrs)

		if messaging_toid <> ""  and messaging_toid <> session("id")then

			if Application("smumapprovemessages") then
				messaging_approvalstatus = smumfalse
			else
				messaging_approvalstatus = smumtrue
			end if

			smumquery = "Insert into smum_messagingtbl (messaging_fromid, messaging_toid, messaging_subject, messaging_folder, messaging_approvalstatus,messaging_displaystatus,messaging_deletestatusfrom,messaging_deletestatusto,messaging_message) values ("&session("id")&","&messaging_toid&", '"&messaging_subject&"',0,"&messaging_approvalstatus&","&smumfalse&","&smumfalse&","&smumfalse&",'"&messaging_message&"')"
			smumexecutequery smumquery,action
			
			Response.Redirect smumpage&"?action=reply&todo=sent"

		else

			if messaging_toid = "" then
				messageerror = "The to address entered by you is invalid, kindly check it and enter again. Click here to go <a href=""javascript:history.go(-1)"">back.</a>"
			elseif messaging_toid = session("id") then
				messageerror = "You cannot send a message to yourself, please check and change the to address.Click here to go <a href=""javascript:history.go(-1)"">back.</a>"
			end if

			smumFormOpenTable
			smumFormHeader "Reply"
			smumFormResponse messageerror
			smumFormCloseTable
		
		end if

	elseif todo = "sent" then

		smumFormOpenTable
		smumFormHeader "Reply"
		smumFormResponse "The Reply was sent successfully."
		smumFormCloseTable
	
	end if

End Sub%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -