Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 27 January 2016 : 00:39:34
|
I am populating the SendTo field of "privatesend.asp" using a hyperlink from a drop-down list of members; however, I would like it to APPEND the value separated with a comma if the field already contains data.
"privatesend.asp"
<%
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-15 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain
'## intact in the scripts and in the HTML output. The "powered by"
'## text/logo with a link back to http://forum.snitz.com in the
'## footer of the pages MUST remain visible when the pages are
'## viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to Free Software Foundation, Inc.
'## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'## manderson@snitz.com
'##
'#################################################################################
'## Part of the Private Messages MOD for Snitz Forums 2000 v3.4.04 ##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="includes/inc_header.asp" -->
<!--#INCLUDE FILE="includes/inc_func_member.asp" -->
<!--#INCLUDE FILE="includes/inc_func_posting.asp" -->
<!--#INCLUDE FILE="includes/inc_func_secure.asp" -->
<!--#INCLUDE FILE="includes/inc_sha256.asp"-->
<%
' ## Google Spell Below
If intMod58 = "1" Then
%>
<!--#INCLUDE FILE="googiespell/inc_googie.asp" -->
<%
End If
' ## Google Spell Above
Call ModCheck(intMod109)
strRqMethod = Request.QueryString("method")
strCkPassWord = Request.Cookies(strUniqueID & "User")("Pword")
strPMID = CLng(Request.QueryString("id"))
If strDBNTUserName = "" Then
Response.Redirect "default.asp"
Response.End
End If
If strDBType = "access" Then
strSqL = "SELECT count(M_TO) as [pmtotal] FROM " & strTablePrefix & "PM P," & strMemberTablePrefix & "MEMBERS M WHERE M.M_NAME = '" & strDBNTUserName & "' AND M.MEMBER_ID = P.M_TO"
Else
strSqL = "SELECT count(M_TO) as pmtotal FROM " & strTablePrefix & "PM P," & strMemberTablePrefix & "MEMBERS M WHERE M.M_NAME = '" & strDBNTUserName & "' AND M.MEMBER_ID = P.M_TO"
End If
Set rsPM = my_Conn.Execute(strSql)
If Not rsPM.EOF Then
pmtotal = rsPM("pmtotal")
rsPM.Close
End If
Set rsPM = Nothing
If (pmtotal = strPMLimit Or pmtotal > strPMLimit) And mLev < 3 Then
Response.Write "<center><font face=""" & strDefaultFontFace & """ color=""" & StrHiLiteFontColor & """ size=""" & strDefaultFontSize & """>You have reached your private message limit of " & strPMLimit & ".<br />To send further private messages you must clean your Inbox.</font></center><br /><br />"
Response.Write "<center><font face=""" & strDefaultFontFace & """ color=""" & StrDefaultFontColor & """ size=""" & strDefaultFontSize & """><a href=""pm_view.asp"">Return To Your Inbox</a></font></center>"
Else
%>
<script language="JavaScript">
<!--
function OpenPreview()
{
var curCookie = "strMessagePreview=" + escape(document.PostTopic.Message.value);
document.cookie = curCookie;
popupWin = window.open('pop_preview.asp', 'preview_page', 'scrollbars=yes,width=750,height=450')
}
function openWindowHelp(url) {
popupWin = window.open(url,'new_page','width=430,height=200')
}
//-->
</script>
<%
If strRqMethod = "" Then strRqMethod = "Topic"
If strRqMethod = "Reply" Or strRqMethod = "ReplyQuote" Or strRqMethod = "Forward" Then
strSql = "SELECT * FROM " & strTablePrefix & "PM WHERE " & strTablePrefix & "PM.M_ID = " & strPMID
Set rs = my_Conn.Execute (strSql)
If Not rs.EOF Then
If MemberID <> rs("M_TO") Then
rs.Close
Set rs = Nothing
Response.Redirect("default.asp")
Response.End
End If
If strRqMethod = "ReplyQuote" Then
TxtMsg = "quote: " & vbCrLf
TxtMsg = TxtMsg & rs("M_MESSAGE") & vbCrLf
TxtMsg = TxtMsg & "
"
End If
If strRqMethod = "Forward" Then
TxtMsg = "----- Forwarded Message -----" & vbCrLf
TxtMsg = TxtMsg & rs("M_MESSAGE") & vbCrLf
TxtMsg = TxtMsg & "-----------------------------"
End If
rs.Close
End If
Set rs = Nothing
End If
Response.Write " <script language=""JavaScript"" type=""text/javascript"" src=""inc_code.js""></script>" & vbNewLine & _
" <script language=""JavaScript"" type=""text/javascript"" src=""js/selectbox.js""></script>" & vbNewLine & _
" <table border=""0"" width=""100%"" align=""center"" bgColor=""" & strPageBGColor & """>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""pm_view.asp"">Private Messages</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " Send Private Message<br /></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <table border=""0"" width=""800px;"" align=""center"" cellspacing=""0"" cellpadding=""1"" bgcolor=""" & strPageBGColor & """>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""100%"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" bgcolor=""" & strPopUpTableColor & """ cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""50%"" align=""center"">" & vbNewLine
If pmtotal = strPMLimit or pmtotal > strPMLimit Then
Response.Write "<center><b><font face=""" & strDefaultFontFace & """ color=""" & StrHiLiteFontColor & """ size=""" & strFooterFontSize & """>You have reached your private message limit of " & strPMLimit & ".<br />To send further private messages you must clean your Inbox.</font></center>"
Else
Response.Write "<center><b><font face=""" & strDefaultFontFace & """ color=""" & strDefaultFontColor & """ size=""" & strFooterFontSize & """>You currently have " & pmtotal & " saved private messages.<br />Your Inbox limit is " & strPMLimit & ".<br />Please delete your messages once you have read them.</font></center>"
End If
Response.Write " </td>" & vbNewLine & _
" <td width=""50%"" align=""right"">" & vbNewLine
If Request.Cookies(strCookieURL & "paging")("OUTBOX") = "double" and Request.QueryString("view") <> "outbox" then Response.Write "<a href=""pm_view.asp?view=outbox"">" & getCurrentIcon(strIconPmoutbox,"Outbox","hspace=""0""") & "</a>"
If Request.Cookies(strCookieURL & "paging")("OUTBOX") = "double" and Request.QueryString("view") = "outbox" then Response.Write "<a href=""pm_view.asp"">" & getCurrentIcon(strIconPminbox,"Inbox","hspace=""0""") & "</a>"
If pmtotal < strPMLimit Or mLev > 2 Then
Response.Write "<a href=""privatesend.asp?method=Topic"">" & getCurrentIcon(strIconPmnewBig,"Write a New Message","hspace=""0""") & "</a>"
End If
Response.Write "<a href=""pm_view.asp"">" & getCurrentIcon(strIconPmreceive,"Check for New Messages","hspace=""0""") & "</a><a href=""members.asp"" target=""_blank"">" & getCurrentIcon(strIconPmmemberlist,"Browse the Memberlist","hspace=""0""") & "</a><a href=""pm_options.asp"">" & getCurrentIcon(strIconPmprivpref,"Set Your Private Message Preferences","hspace=""0""") & "</a><a href=""pm_blocklist.asp"">" & getCurrentIcon(strIconPmblocklist,"View Your Blocked List","hspace=""0""") & "</a>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <table border=""0"" align=""center"" bgcolor=""" & strPageBGColor & """>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td style=""line-height:50%;""> </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <form id=""f1"" action=""privatesend_info.asp"" method=""post"" name=""PostTopic"" onSubmit=""return validate();"">" & vbNewLine & _
" <input name=""Method_Type"" type=""hidden"" value=""" & strRqMethod & """ />" & vbNewLine & _
" <input name=""id"" type=""hidden"" value=""" & cLng(Request.QueryString("id")) & """ />" & vbNewLine & _
" <input name=""Refer"" type=""hidden"" value=""" & Request.ServerVariables("HTTP_REFERER") & """ />" & vbNewLine & _
" <input name=""UserName"" type=""hidden"" Value=""" & strDBNTUserName & """ />" & vbNewLine & _
" <input name=""Password"" type=""hidden"" value=""" & strCkPassWord & """ />" & vbNewLine & _
" <table border=""0"" width=""800px;"" cellspacing=""0"" cellpadding=""0"" bgcolor=""" & strPageBGColor & """ align=center>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
" <table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine
If strRqMethod = "Topic" Or strRqMethod = "Forward" Then
%>
<script language="JavaScript">
<!-- hide from JavaScript-challenged browsers
function pmmembers() { var MainWindow = window.open ("pm_pop_members.asp", "","toolbar=no,location=no,menubar=no,scrollbars=yes,width=250,height=500,top=100,left=100,resizeable=yes,status=no");
}
// done hiding -->
</script>
<%
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Send to:</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input id=""m1"" maxLength=""50"" name=""sendto"" value=""" & Request.Querystring("mname") & """ size=""50"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>"
For i = 65 to 90
strLink = "pop_members.asp?M_NAME="& Chr(i)
Response.Write "<a title=""Members starting with letter " & Chr(i) & """ style=""text-decoration:none;"" href=""Javascript:openWindow3('" & strLink & "')"">" & Chr(i) & "</a> "
Next
If strRqMethod <> "Forward" Then Response.Write "<br />(Separate member names with commas for multiple recipients.)"
If (mLev > 0) And strRqMethod <> "Forward" Then Response.Write "<br /><input type=""checkbox"" name=""allmods"" value=""true"" /><b>ALERT MODERATORS</b> (Send Message to all Moderators)<br />" '# All Moderators PM Modification
If (mLev > 3) And strRqMethod <> "Forward" Then Response.Write "<input type=""checkbox"" name=""allmem"" value=""true"" />Send Message to all Members<br />" '# All Member PM Modification
Response.Write " </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
End If
If strAllowForumCode = 1 Then
%>
<!--#INCLUDE FILE="includes/inc_post_buttons.asp" -->
<%
' ## Crash's Callouts Below
If intMod29 = "1" Then
%>
<!--#INCLUDE FILE="includes/inc_callouts_functions.asp" -->
<%
End If
' ## Crash's Callouts Above
End If
If strRqMethod = "Topic" Then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Subject:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input maxLength=""50"" name=""Subject"" value=""" & Trim(ChkString(TxtSub,"display")) & """ size=""50""></td>" & _
" </tr>" & vbNewLine
End If
Response.Write " <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Message:</b><br /></font>" & vbNewLine & _
" <table border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"" nowrap>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
If strAllowHTML = "1" Then
Response.Write " * HTML is ON<br />" & vbNewLine
Else
Response.Write " * HTML is OFF<br />" & vbNewLine
End If
If strAllowForumCode = "1" Then
Response.Write " * <a href=""JavaScript:openWindow3('pop_forum_code.asp')"">Forum Code</a> is ON<br />" & vbNewLine
Else
Response.Write " * Forum Code is OFF<br />" & vbNewLine
End If
If strIcons = "1" And strShowSmiliesTable = "1" Then
If strRqMethod = "Edit" Or strRqMethod = "EditTopic" Or _
strRqMethod = "Reply" Or strRqMethod = "ReplyQuote" Or _
strRqMethod = "Topic" Or strRqMethod = "TopicQuote" Or _
strRqMethod = "Forward" Then
%>
<!--#INCLUDE FILE="includes/inc_smilies.asp" -->
<%
End If
End If
Response.Write " </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""" & strPopUpTableColor & """><textarea "
' ## Google Spell Below
If intMod58 = "1" Then
Response.Write "id=""Message"" class=""textarea"""
End If
' ## Google Spell Above
Response.Write " style=""width:98%; align:center;"" cols=""45"" name=""Message"" rows=""12"" wrap=""VIRTUAL"" onselect=""storeCaret(this);"" onclick=""storeCaret(this);"" onkeyup=""storeCaret(this);"" onchange=""storeCaret(this);"">" & Trim(CleanCode(TxtMsg)) & "</textarea></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPageBGColor & """ align=""center"" style=""line-height:50%;""><br />"
If intMod152 = "1" Then
Response.Write " <input style=""color:" & strHeadFontColor & "; font-weight:bold; font-family:" & strDefaultFontFace & "; padding:3px 6px 3px 6px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; background-image:url(" & strImageURL & strHeadCellImage & "); background-size:100% 100%;"" type=""Submit"" class=""button2"" name=""submit"" value=""Send"" /> " & vbNewLine & _
" <input style=""color:" & strHeadFontColor & "; font-weight:bold; font-family:" & strDefaultFontFace & "; padding:3px 6px 3px 6px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; background-image:url(" & strImageURL & strHeadCellImage & "); background-size:100% 100%;"" type=""Button"" class=""button2"" name=""Preview"" value=""Preview"" onclick=""OpenPreview()"" /> " & vbNewLine & _
" <input style=""color:" & strHeadFontColor & "; font-weight:bold; font-family:" & strDefaultFontFace & "; padding:3px 6px 3px 6px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; background-image:url(" & strImageURL & strHeadCellImage & "); background-size:100% 100%;"" type=""Reset"" class=""button2"" name=""reset"" value=""Reset"" />" & vbNewLine
ElseIf intMod67 = "1" Then
Response.Write " <input style=""color:" & strHeadFontColor & "; font-weight:bold; font-family:" & strDefaultFontFace & "; padding:3px 6px 3px 6px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; background:linear-gradient("&strHColor&",white,"&strHColor&","&strHColor&","&strHColor&");"" type=""Submit"" class=""button2"" name=""submit"" value=""Send"" /> " & vbNewLine & _
" <input style=""color:" & strHeadFontColor & "; font-weight:bold; font-family:" & strDefaultFontFace & "; padding:3px 6px 3px 6px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; background:linear-gradient("&strHColor&",white,"&strHColor&","&strHColor&","&strHColor&");"" type=""Button"" class=""button2"" name=""Preview"" value=""Preview"" onclick=""OpenPreview()"" /> " & vbNewLine & _
" <input style=""color:" & strHeadFontColor & "; font-weight:bold; font-family:" & strDefaultFontFace & "; padding:3px 6px 3px 6px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; background:linear-gradient("&strHColor&",white,"&strHColor&","&strHColor&","&strHColor&");"" type=""Reset"" class=""button2"" name=""reset"" value=""Reset"" />" & vbNewLine
Else
Response.Write " <input style=""color:" & strHeadFontColor & "; font-weight:bold; font-family:" & strDefaultFontFace & "; padding:3px 6px 3px 6px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; background:"&strHColor&";"" type=""Submit"" class=""button2"" name=""submit"" value=""Send"" /> " & vbNewLine & _
" <input style=""color:" & strHeadFontColor & "; font-weight:bold; font-family:" & strDefaultFontFace & "; padding:3px 6px 3px 6px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; background:"&strHColor&";"" type=""Button"" class=""button2"" name=""Preview"" value=""Preview"" onclick=""OpenPreview()"" /> " & vbNewLine & _
" <input style=""color:" & strHeadFontColor & "; font-weight:bold; font-family:" & strDefaultFontFace & "; padding:3px 6px 3px 6px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; background:"&strHColor&";"" type=""Reset"" class=""button2"" name=""reset"" value=""Reset"" />" & vbNewLine
End If
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </form><script type=""text/javascript""> var googie1 = new GoogieSpell(""googiespell/"", ""./googiespell/googie.asp?lang=""); googie1.decorateTextarea(""Message"");</script>" & vbNewLine
If strRqMethod = "Reply" Or trRqMethod = "Forward" Or strRqMethod = "ReplyQuote" Then
Response.Write " <center>" & vbNewLine & _
" <table bgcolor=""" & strPopUpBorderColor & """ border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ colspan=""2"" align=""center""><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>M E S S A G E R E V I E W</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strTablePrefix & "PM.M_MESSAGE, " & strTablePrefix & "PM.M_SUBJECT FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "PM WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "PM.M_FROM AND " & strTablePrefix & "PM.M_ID = " & strPMID
Set rs = my_Conn.Execute (strSql)
If Not rs.EOF Then
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumFirstCellColor & """ valign=top width=""" & strTopicWidthLeft & """"
If LCase(strTopicNoWrapLeft) = "1" Then
Response.Write " nowrap"
End If
Response.Write "><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & ChkString(rs("M_NAME"),"display") & "</b></font></td>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top"" width=""" & strTopicWidthRight & """"
If LCase(strTopicNoWrapRight) = "1" Then
Response.Write " nowrap"
End If
Response.Write "><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Subject: " & chkString(rs("M_SUBJECT"),"display") & "</b><hr size=""" & strFooterFontSize & """>" & formatStr(rs("M_MESSAGE")) & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
rs.Close
End If
Set rs = Nothing
End If
End If
Response.Write "<br />" & vbNewLine
WriteFooter
%>
"pop_members.asp"
|
Edited by - Carefree on 27 January 2016 01:47:37 |
|