<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<%
'*********************************************************** *****************************
'PM Groups Mod by Fernan http://uz.webhop.info
'*********************************************************** *****************************
'Set the buffer to true
Response.Buffer = True
'Make sure this page is not cached
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "private"
'Declare variables
Dim strMode 'Holds the mode of the page
Dim strPostPage 'Holds the page the form is posted to
Dim lngMessageID 'Holds the pm id
Dim strTopicSubject 'Holds the subject
Dim strBuddyName 'Holds the to username
Dim dtmReplyPMDate 'Holds the reply pm date
Dim strMessage 'Holds the post message
Dim intForumID 'Holds the forum number
Dim SQL
Dim intRecordLoopScan
'Set the mode of the page
strMode = "PM"
lngMessageID = 0
'If the user is user is using a banned IP redirect to an error page
If bannedIP() Then
'Clean up
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'Redirect
Response.Redirect("insufficient_permission.asp?M=IP")
End If
'If Priavte messages are not on then send them away
If blnPrivateMessages = False Then
'Clean up
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'Redirect
Response.Redirect("default.asp")
End If
'If the user is not allowed then send them away
If Not blnAdmin Then
'Clean up
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'Redirect
Response.Redirect("insufficient_permission.asp")
End If
%>
<html>
<head>
<script language="JavaScript">
function CheckForm () {
var errorMsg = "";
if (document.frmPMs.pmSubject.value==""){
errorMsg += "\n\tYou must enter a subject.";
}
if (document.frmPMs.pmBody.value==""){
errorMsg += "\n\tYou must enter a message body.";
}
if (errorMsg != ""){
msg = "___________________________________________________________ ____\n\n";
msg += "The form has not been submitted because there are problem(s) with the form.\n";
msg += "Please correct the problem(s) and re-submit the form.\n";
msg += "___________________________________________________________ ____\n\n";
msg += "The following field(s) need to be corrected: -\n";
errorMsg += alert(msg + errorMsg + "\n\n");
return false;
}
return true;
}
</script>
</head>
<title>PM Groups Mod by Fernan</title>
<%
'*********************************************************** **********************************
%>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="50%" id="AutoNumber1" height="95" align = "center">
<tr>
<td width="100%" height="95" valign="top">
<form method="post" name="frmPMs" action="send_pms.asp" onSubmit="return CheckForm();">
<br>
<p style="margin-left: 10; margin-right: 10">
Group to PM:
<select size="1" name="pmGID">
<%
SQL = "SELECT tblGroup.Group_ID, tblGroup.Name FROM tblGroup Where Not tblGroup.Name = 'Guest'"
rsCommon.CursorType = 1
rsCommon.Open SQL, adoCon
For intRecordLoopScan = 1 to rsCommon.RecordCount
If Not rsCommon.EOF Then
%>
<option value="<% = rsCommon("Group_ID") %>"><% = rsCommon("name") %></option>"
<%
End If
rsCommon.MoveNext
Next
%>
<option value="All">All</option>
</select><br><br>
Subject: <input type="text" name="pmSubject" size="30" maxlength="41"><br>
<br>
<textarea rows="13" name="pmBody" cols="54"></textarea><br><br>
<center><input type="Submit" value="Send" name="Submit"> <input type="reset" value="Reset" name="Reset"></center>
</form>
</p>
</td>
</tr>
</table>
<%
'Reset server variables
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
%><br />
<div align="center">
</div>
</html>