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

📄 pm.asp

📁 BBS论坛的开发和设计
💻 ASP
📖 第 1 页 / 共 2 页
字号:
					End if
				End if
				rs1.close
				set rs1 = nothing
			End if			
		End if
	set rs = Nothing
		
	pmtitle = replace(Trim(Request.Form("pmtitle")),"'","''")
	pmtitle = SetSafeStr(pmtitle)
		if pmtitle = "" then
			ShowMsg "<b>错误:</b>悄悄话标题不可为空!<br><br><a href=""javascript:history.back()""><<< 返回上页</a>"
			Call Bottom()
			response.end
		End if
	pmcontent = replace(Trim(Request.Form("pmcontent")),"'","''")
	pmcontent = replace(pmcontent,"<script","<script&nbsp;")
		if pmcontent = "" then
			ShowMsg "<b>错误:</b>悄悄话内容不可为空!<br><br><a href=""javascript:history.back()""><<< 返回上页</a>"
			Call Bottom()
			response.end
		End if
		if len(pmcontent) > 1200 then
			ShowMsg "<b>错误:</b>悄悄话内容不可超过1200字节!<br><br><a href=""javascript:history.back()""><<< 返回上页</a>"
			Call Bottom()
			response.end
		End if
	Conn.Execute("insert into JBB_pm(userid,folderid,touserid,tousername,fromuserid,fromusername,title,message,pmtime,receipt) values("& touserid &","& 1 &","& touserid &",'"& touser &"',"& userid &",'"& username &"','"& pmtitle &"','"& pmcontent &"','"& Now() &"',"& 0 &")")
	if trim(request.Form("save")) = "1" then
	Conn.Execute("insert into JBB_pm(userid,folderid,touserid,tousername,fromuserid,fromusername,title,message,pmtime,receipt) values("& userid &","& 0 &","& touserid &",'"& touser &"',"& userid &",'"& username &"','"& pmtitle &"','"& pmcontent &"','"& Now() &"',"& 1 &")")
	savepm = ",并同时保留一份到您的收件箱"
	End if
	ShowMsg "您给 "& touser &" 的悄悄话已经成功发送"& savepm &".<br>系统正在返回您的悄悄话列表.如果您的浏览器没有自动返回,请点击<a href=""pm.asp"">这里</a>"
	response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='5; URL=pm.asp'>")
End Sub
'============================================
Sub addpm()
	reply=trim(request.QueryString("reply"))
	pm_id=trim(request.QueryString("pm_id"))
	if reply="yes" and IsNumeric(pm_id) then
		reply = true
		set rs = server.CreateObject("adodb.recordset")
		sql = "select JBB_user.username,JBB_pm.title from JBB_user left JOIN JBB_pm On(JBB_pm.fromuserid=JBB_user.userid) where JBB_pm.pm_id="&pm_id
		rs.open sql,conn,1,1
		if Not(rs.Bof and rs.Eof) then
			touser = trim(rs("username"))
			title = "Re:"&rtrim(rs("title"))
		End if
		rs.close
		set rs = Nothing
	End if
%>
<script language="javascript">
<!--
function isok(theform)
{

if (theform.touser.value=="")

  {
    alert("请输入接收人用户名!");
    theform.touser.focus();
    return (false);
  }
  
if (theform.pmtitle.value=="")

  {
    alert("请输入悄悄话标题!");
    theform.pmtitle.focus();
    return (false);
  }
  
 if (theform.pmcontent.value=="")

  {
    alert("请输入悄悄话内容!");
    theform.pmcontent.focus();
    return (false);
  }  

return (true);
}
-->
</script>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="form1" method="post" action="?action=sendpm" onsubmit="return isok(this)">
    <tr> 
      <td colspan="2"> <table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
          <tr class="table-title"> 
            <td colspan="2"> <div align="center">
                <%
			if reply = true then
				response.Write("回复")
			else
				response.Write("发送")
			End if
			%>
                悄悄话</div></td>
          </tr>
          <tr class="table-light"> 
            <td width="28%" class="table-light"><div align="right"><font color="#FF0000">*</font>接收人:</div></td>
            <td width="72%"> <input name="touser" type="text" id="touser" value="<%=touser%>" size="30"></td>
          </tr>
          <tr class="table-light"> 
            <td class="table-light"><div align="right"><font color="#FF0000">*</font>标 题:</div></td>
            <td class="table-light"> <input name="pmtitle" type="text" id="pmtitle" value="<%=title%>" size="30"> 
            </td>
          </tr>
          <tr class="table-light"> 
            <td valign="top" class="table-light"><div align="right"><font color="#FF0000">*</font>内 容:</div></td>
            <td class="table-light"> <textarea name="pmcontent" cols="50" rows="12" id="pmcontent"></textarea> 
              <br>
              内容长度不得超过1200, 可以使用UBB代码 </td>
          </tr>
          <tr class="table-light"> 
            <td valign="top" class="table-light"><div align="right">选项:</div></td>
            <td class="table-light">保留一份到发件箱? 
              <input name="save" type="checkbox" id="save" value="1"></td>
          </tr>
        </table></td>
    </tr>
    <tr> 
      <td width="30%">&nbsp;</td>
      <td height="35">
<input type="submit" name="Submit" value=" 发 送 ">
          
        <input type="reset" name="Submit2" value="重填">
      </td>
    </tr>
  </form>
</table>
<br>
<%
End Sub
'============================================
Sub delpm()
	pm_id = replace(trim(request.Form("pm_id"))," ","")
	if pm_id = "" then pm_id = replace(trim(request.QueryString("pm_id"))," ","")
	if trim(request.Form("Submit")) = "确定删除" then
		Conn.ExeCute("delete from JBB_pm where pm_id in("& pm_id &")  and userid="&int(userid))
		ShowMsg "已经删除您所点选的悄悄话.<br>系统正在返回您的悄悄话列表.如果您的浏览器没有自动返回,请点击<a href=""pm.asp"">这里</a>"
		response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='5; URL=pm.asp'>")
	else
		if pm_id = "" then
			ShowMsg "请选择您要删除的悄悄话,点击 <a href=""javascript:history.back()"">这里返回</a> 上一页"
			Call Bottom()
			response.End()
		else
%>
<table width="378" height="46" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form name="form3" method="post" action="">
<tr> 
      <td class="table-title"><img src="<%=BBS_Skin(3)%>JBB_bullet.gif">&nbsp;<strong>确认删除</strong></td>
  </tr>
  <tr> 
    <td height="30" class="table-light">
<div align="center"><font color="#FF0000">您确定删除这些悄悄话吗?</font></div></td>
  </tr>
  <tr>
    <td height="22" class="table-light"> 
      <div align="center">
          <input name="pm_id" type="hidden" id="pm_id" value="<%=pm_id%>">
          <input name="Submit" type="submit" id="Submit" value="确定删除">
      </div></td>
  </tr>
</form>
</table>
<br>
<%
		End if
	End if
End Sub
'============================================
Sub showpm()
	pm_id = trim(request.QueryString("pm_id"))
	if Not(IsNumeric(pm_id)) or pm_id = "0" then
		Call pmlist()
		Call Bottom()
		response.End
	End if
	set rs = server.CreateObject("adodb.recordset")
	sql = "select JBB_user.userid,JBB_user.username,JBB_user.useradd,JBB_user.Cent,JBB_user.avatars,JBB_user.My_avatars,JBB_user.avatars_width,JBB_user.avatars_height,JBB_user.regtime,JBB_pm.* from JBB_user left JOIN JBB_pm on(JBB_pm.fromuserid = JBB_user.userid) where JBB_pm.pm_id="&pm_id&" and JBB_pm.userid="&int(userid)
	rs.open sql,conn,1,1
	if Not(rs.Eof and rs.Bof) then
	sendpmuserid = trim(rs("fromuserid"))
	sendpmuser = rtrim(rs("fromusername"))
%>
<table border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  <tr class="table-title"> 
    <td colspan="2"><img src="<%=BBS_Skin(3)%>JBB_bullet.gif">&nbsp;查看悄悄话 - 来自:<a href="user.asp?userid=<%=sendpmuserid%>" target="_blank"><%=sendpmuser%></a>&nbsp;[<%=trim(rs("pmtime"))%>]</td>
  </tr>
  <tr class="table-dark"> 
    <td width="150" valign="top" class="table-dark">&nbsp;&nbsp;<a href="user.asp?userid=<%=sendpmuserid%>" target="_blank"><%=sendpmuser%></a><br>
	<%
	useravatarspath = rtrim(rs("avatars"))
	if useravatarspath <> "" then
		useravatars = true
	End if
	if rs("My_avatars") then
		My_avatars = " width="& trim(rs("avatars_width")) &" height="&trim(rs("avatars_height"))
	End if
	if useravatars = true then
		response.Write("&nbsp;&nbsp;<img src="""& useravatarspath &""""& My_avatars &">")		
	else
		response.Write("&nbsp;&nbsp;<img src=""images/avatars/guestavatar.gif"">")
	End if
	response.Write("<br>&nbsp;&nbsp;注册日期:"&formatdatetime(rs("regtime"),2)&"<br>&nbsp;&nbsp;论坛积分:"&rtrim(rs("Cent"))&"<br>&nbsp;&nbsp;来自:"&rtrim(rs("useradd")))
	%>
    </td>
    <td valign="top" class="table-dark"><strong><%=trim(rs("title"))%></strong><br>
        <%=ubbcode(rs("message"))%><br>
        <br>
        <img src="<%=BBS_Skin(3)%>sign.gif"> <br>
      </h5>
      <div align="right"><a href="?action=addpm&reply=yes&pm_id=<%=trim(rs("pm_id"))%>"><img src="<%=BBS_Skin(3)%>replypm.gif" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="?action=delpm&pm_id=<%=trim(rs("pm_id"))%>"><img src="<%=BBS_Skin(3)%>deletepm.gif" border="0"></a>&nbsp;&nbsp;&nbsp;</div></td>
  </tr>
</table>
<br>
<%
		Conn.ExeCute("update JBB_pm set receipt=1 where pm_id="&pm_id)
	End if
	rs.close
	set rs = Nothing
End sub
'============================================
Call Bottom()
%>

⌨️ 快捷键说明

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