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

📄 compose.asp

📁 一个虚拟主机代理系统
💻 ASP
字号:
<%'=========================================
'ScriptMate User Manager Version 2.1
'Copyright 2001 (C) ScriptMate.Com
'User Module
'This module helps to compose a message to other users
'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.compose
		   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 Compose()

	dim action,todo,messaging_toid,messaging_subject,messaging_message,messaging_approvalstatus,messageerror
	
	if not Application("smumdebugmode") then on error resume next

	if session("id") = "" then Response.Redirect smumpage&"?action=login&url="&Request.ServerVariables("url")&"?action=compose"
	
	action =request("action")

	todo = request("todo")

	if todo = "" then
	
		smumFormAction "<form action="""&smumpage&"?action=compose"" method=post name=compose language=""JAVASCRIPT"" onsubmit=""return Validate();"">"
		smumFormHiddenField "todo","add"
		smumFormOpenTable
		smumFormHeader "Compose a Message"
		smumFormFields "To","<input class=fieldbox type=text size=35 maxlength=50 name=""messaging_toid"">"
		smumFormFields "Subject","<input class=fieldbox type=text size=35 maxlength=50 name=""messaging_subject"">"
		smumFormFields "Message","<textarea class=fieldbox rows=5 cols=35 name=messaging_message></textarea>"
		smumFormButtons "<input class=fieldbox type=submit value=""Send"" id=submit2 name=submit2>"
		smumFormCloseTable
		smumFormClose		

	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=compose&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 "Compose a Message"
			smumFormResponse messageerror
			smumFormCloseTable

		end if

	elseif todo = "sent" then

		smumFormOpenTable
		smumFormHeader "Compose a Message"
		smumFormResponse "The Email was sent successfully."
		smumFormCloseTable

	end if

End Sub%>

⌨️ 快捷键说明

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