Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Something new with PM Mod...
 New Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

golfmann
Junior Member

United States
450 Posts

Posted - 01 August 2013 :  16:32:38  Show Profile  Visit golfmann's Homepage  Reply with Quote
I have attempted to have a visible review of prior pm's both sent and reveived upon viewing as is somewhat done when replying.

Here is an example showing what I mean:



Note I show pm numbers to help when they get out of sync.

My problem is threefold:
I'd LIKE to thread them so they DON'T get out of sync and I don't have to worry about filtering so the wrong person doesn't get to read another's private pm by mistake, AND... not generate errors on the original pm with no replies yet.

example of error showing up:



Due to the subject filter used, the REPLY from the original doesn't show either, because of the RE: (is what I'm guessing)

example:


Here is the code on privateread:
<%
'#################################################################################
'## Copyright (C) 2000-01 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 any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## 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 the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
'## Part of the Private Messages MOD for Snitz Forums 2000 v3.4.04 ##
'#################################################################################
%>
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<%


if strDBNTUserName = "" then
Response.Redirect "default.asp"
Response.End
else
strSql = "UPDATE " & strTablePrefix & "PM SET " & strTablePrefix & "PM.M_READ = 1 WHERE (" & strTablePrefix & "PM.M_ID = " & cLng(Request.QueryString("id")) & ");"

my_conn.Execute (strSql)

strSql = "SELECT M.MEMBER_ID, M.M_NAME, M.M_TITLE, M.M_LEVEL, M.M_POSTS, M.M_HOMEPAGE, M.M_COUNTRY, M.M_PMRECEIVE, P.M_ID, P.M_TO, P.M_SUBJECT, P.M_SENT, P.M_FROM, P.M_MESSAGE FROM " & strMemberTablePrefix & "MEMBERS M , " & strTablePrefix & "PM P WHERE M.MEMBER_ID = P.M_FROM AND P.M_TO = " & getMemberID(chkString(strDBNTUserName,"SQLString")) & " AND P.M_ID = " & cLng(Request.QueryString("id"))

Set rs = my_Conn.Execute(strSql)

if rs.BOF or rs.EOF then
rs.close
set rs = nothing
Response.Redirect("pm_view.asp")
end if

strSql = "UPDATE " & strTablePrefix & "PM SET " & strTablePrefix & "PM.M_READ = 1 WHERE (" & strTablePrefix & "PM.M_ID = " & cLng(Request.QueryString("id")) & ");"

my_conn.Execute (strSql)

strMID = rs("MEMBER_ID")
strMName = rs("M_NAME")
strPMToID = rs("M_TO")
strPMSubject = rs("M_SUBJECT")
strPMSent = rs("M_SENT")
strPMFromID = rs("M_FROM")
strPMMessage = rs("M_MESSAGE")

rs.close
set rs = nothing

Response.Write "<center>" & vbNewLine & _
"<table border=""0"" width=""100%"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
"  » <a href=""forums.asp"">All Forums</a> > <a href=""pm_view.asp"">Private Messages</a> > <b>Read Private Messages</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine

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)
pmtotal = rsPM("pmtotal")

rsPM.close
set rsPM = nothing

Response.Write " <table border=""0"" width=""90%"" cellspacing=""0"" cellpadding=""1"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""100%"">" & 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=""" & strHeaderFontSize & """>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 strDBType = "access" then
strSqL = "SELECT count(M_TO) as [pmcount] 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 pmcount 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)
pmcount = rsPM("pmcount")

rsPM.close
set rsPM = nothing


If pmcount < strPMLimit or mLev > 2 then
Response.Write "<a href=""privatesend.asp?method=Forward&id=" & cLng(Request.QueryString("id")) & """>" & getCurrentIcon(strIconpmforward,"Forward This Message","hspace=""0""") & "</a><a href=""privatesend.asp?method=Reply&id=" & cLng(Request.QueryString("id")) & """>" & getCurrentIcon(strIconpmreply,"Post a Reply","hspace=""0""") & "</a>"
end if
Response.Write "<a href=""pm_view.asp"">" & getCurrentIcon(strIconpmreceive,"Check for New Messages","hspace=""0""") & "</a>"
Response.Write "<a href=""pm_blocklist.asp?mname="&ChkString(strMName,"display")&""">" & getCurrentIcon(strIconPmblocklist,"Add "&ChkString(strMName,"display")&" to Your Blocked List","hspace=""0""") & "</a>"& _
"<a href=""JavaScript:openWindow3('privateprint.asp?id=" & cLng(Request.QueryString("id")) & "')"">"& getCurrentIcon(strIconpmprint,"Print This Message","hspace=""0""") & "</a>"& _
"<a href=""privatedelete.asp?method=DeleteMessage&id=" & cLng(Request.QueryString("id")) & """>" & getCurrentIcon(strIconpmdelete,"Delete This Message","hspace=""0""") & "</a></td>" & vbNewLine & _

" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <table border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td height=""10"">" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
Response.Write "<br>"
Response.Write "<table width=""80%"" border=""0"" cellspacing=""1"" cellpadding=""4"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""" & strTopicWidthLeft & """"
if lcase(strTopicNoWrapLeft) = "1" then
Response.Write(" nowrap")
end if
Response.Write "><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>From</font></b></td>" & vbNewLine & _
" <td align=""left"" bgcolor=""" & strHeadCellColor & """ width=""" & strTopicWidthRight & """"
if lcase(strTopicNoWrapRight) = "1" then
Response.Write(" nowrap")
end if
Response.Write "><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>Subject:  " & strPMSubject & "</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumFirstCellColor & """ valign=""top"" nowrap>" & vbNewLine
Response.Write "<p><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & ChkString(strMName,"display") & "</a></b></font><br>" & vbNewLine

Response.Write " </p><br>" & vbNewLine & _
" <p><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & "</font><br>" & vbNewLine & _
" <td bgcolor=""" & strForumFirstCellColor & """ valign=""top"">" & vbNewLine & _
" " & getCurrentIcon(strIconPosticon,"","") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Sent to: <b>" & GetMemberName(strPMToID) & "</b> - " & ChkDate(strPMSent, " : " ,true) & "  # " & cLng(Request.QueryString("id"))& "</font>" & vbNewLine
If pmcount < strPMLimit or mLev > 2 then
Response.Write "   <a href=""privatesend.asp?method=ReplyQuote&id=" & cLng(Request.QueryString("id")) & """>" & getCurrentIcon(strIconReplyTopic,"Reply with Quote","align=""center"" hspace=""6""") & "</a>" & vbNewLine
end if

Response.Write " <hr noshade size=""1"">" & vbNewLine & _
" <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & formatStr(strPMMessage) & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine & _
"</center>" & vbNewLine
end if

'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & ", " & strTablePrefix & "PM.M_MESSAGE "
strSql = strSql & ", " & strTablePrefix & "PM.M_SUBJECT "
strSql = strSql & ", " & strTablePrefix & "PM.M_SENT "
strSql = strSql & ", " & strTablePrefix & "PM.M_TO "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "PM "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "PM.M_FROM "
strSql = strSql & " AND " & strTablePrefix & "PM.M_ID = " & cLng(Request.QueryString("id")-1)
set rs = my_Conn.Execute (strSql)

if ("P.M_ID") <> cLng(Request.QueryString("PM.M_ID")-1) AND strPMSubject <> (rs("M_SUBJECT")) then
'do nothing

else

Response.Write "<center>" & vbNewLine & _
"<table bgcolor=""" & strPopUpBorderColor & """ border=""0"" width=""70%"" cellspacing=""2"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ colspan=""2"" align=""center""><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>R E P L I E D     F R O M :</font></b></td>" & vbNewLine & _

" </tr>" & vbNewLine

Response.Write " <tr>" & vbNewLine & _
" <td align=""center"" & bgcolor=""" & strForumCellColor & """ valign=top width=""" & strTopicWidthLeft & """"
if lcase(strTopicNoWrapLeft) = "1" then
Response.Write " nowrap"
end if
Response.Write "><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>From</font></b></td>" & vbNewLine & _
" <td align=""left"" bgcolor=""" & strForumCellColor & """ width=""" & strTopicWidthRight & """"
if lcase(strTopicNoWrapRight) = "1" then
Response.Write(" nowrap")
end if
Response.Write "><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>Subject:  " & chkString(rs("M_SUBJECT"),"display") & "</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top"" nowrap>" & vbNewLine
Response.Write "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & ChkString(rs("M_NAME"),"display") & "</b></font></td>" & vbNewLine
Response.Write " </p><br>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top"">" & vbNewLine & _
" " & getCurrentIcon(strIconPosticon,"","") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Sent to: <b>" & GetMemberName(strPMFromID) & "</b>  # " & cLng(Request.QueryString("id")-1) & "</font>" & vbNewLine & _
" <hr noshade size=""1"">" & vbNewLine & _
" <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & formatStr(rs("M_MESSAGE")) & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine & _
"</center>" & vbNewLinee


end if
rs.close
set rs = nothing
Response.Write "<br>" & vbNewLine
WriteFooter
Response.End
%>


If then from HELL is in red

I'm obviously showing my ignorance and am equally not a programmer.
I know just enough to get me into trouble but I AM creative...

Any of you REAL programmers that might have a couple of minutes and any ideas..... PLEASE let me know

Edited by - golfmann on 05 August 2013 14:17:58

golfmann
Junior Member

United States
450 Posts

Posted - 01 August 2013 :  16:35:09  Show Profile  Visit golfmann's Homepage
I've tried 1,000 things :(
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 01 August 2013 :  22:48:54  Show Profile
if ("P.M_ID") <> cLng(Request.QueryString("PM.M_ID")-1) AND strPMSubject <> (rs("M_SUBJECT")) then


The problem with the above line is that your selection criterion precluded it from ever occurring, thus rs("M_SUBJECT") will never exist and your line will throw an error.

Try this, I cleaned it up a bit.


<%
'###############################################################################
'##
'##	              Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-09 Michael Anderson, Pierre Gorissen,
'##	          Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 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 an 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
'##
'## 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="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<%
If strDBNTUserName = "" Then
	Response.Redirect "default.asp"
	Response.End
Else
	strSql = "UPDATE " & strTablePrefix & "PM Set " & strTablePrefix & "PM.M_READ = 1 WHERE (" & strTablePrefix & "PM.M_ID = " & cLng(Request.QueryString("id")) & ");"
	my_conn.Execute (strSql)
	strSql = "SELECT M.MEMBER_ID, M.M_NAME, M.M_TITLE, M.M_LEVEL, M.M_POSTS, M.M_HOMEPAGE, M.M_COUNTRY, M.M_PMRECEIVE, P.M_ID, P.M_TO, P.M_SUBJECT, P.M_SENT, P.M_FROM, P.M_MESSAGE FROM " & strMemberTablePrefix & "MEMBERS M , " & strTablePrefix & "PM P WHERE M.MEMBER_ID = P.M_FROM AND P.M_TO = " & getMemberID(chkString(strDBNTUserName,"SQLString")) & " AND P.M_ID = " & cLng(Request.QueryString("id"))
	Set rs = my_Conn.Execute(strSql)
	If (rs.BOF or rs.EOF) Then
		Set rs = Nothing
		Response.Redirect("pm_view.asp")
	End If
	strSql = "UPDATE " & strTablePrefix & "PM Set " & strTablePrefix & "PM.M_READ = 1 WHERE (" & strTablePrefix & "PM.M_ID = " & cLng(Request.QueryString("id")) & ");"
	my_conn.Execute (strSql)
	strMID = rs("MEMBER_ID")
	strMName = rs("M_NAME")
	strPMToID = rs("M_TO")
	strPMSubject = rs("M_SUBJECT")
	strPMSent = rs("M_SENT")
	strPMFromID = rs("M_FROM")
	strPMMessage = rs("M_MESSAGE")
	rs.Close
	Set rs = Nothing
	Response.Write	"<center>" & vbNewLine & _
		"<table border=""0"" width=""100%"" align=""center"">" & vbNewLine & _
		"	<tr>" & vbNewLine & _
		"  	  	<td width=""33%"" align=""left"" nowrap>" & vbNewLine & _
		"			<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
		"     » <a href=""forums.asp"">All Forums</a> > <a href=""pm_view.asp"">Private Messages</a> > <b>Read Private Messages</b>" & vbNewLine & _
		"			</font>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"</table>" & vbNewLine
	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
	Response.Write   "<table border=""0"" width=""90%"" cellspacing=""0"" cellpadding=""1"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
		"	<tr>" & vbNewLine & _
		" 	<td width=""100%"">" & 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=""" & strHeaderFontSize & """>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 strDBType = "access" Then
		strSqL = "SELECT count(M_TO) as [pmcount] 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 pmcount 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
		pmcount = rsPM("pmcount")
		rsPM.Close
	End If
	Set rsPM = Nothing
	If pmcount < strPMLimit or mLev > 2 Then
		Response.Write	" 					<a href=""privatesend.asp?method=Forward&id=" & cLng(Request.QueryString("id")) & """>" & getCurrentIcon(strIconpmforward,"Forward This Message","hspace=""0""") & "</a><a href=""privatesend.asp?method=Reply&id=" & cLng(Request.QueryString("id")) & """>" & getCurrentIcon(strIconpmreply,"Post a Reply","hspace=""0""") & "</a>"
	End If
	Response.Write  " 					<a href=""pm_view.asp"">" & getCurrentIcon(strIconpmreceive,"Check for New Messages","hspace=""0""") & "</a>" & vbNewLine & _
		" 					<a href=""pm_blocklist.asp?mname="&ChkString(strMName,"display")&""">" & getCurrentIcon(strIconPmblocklist,"Add "&ChkString(strMName,"display")&" to Your Blocked List","hspace=""0""") & "</a>"& _
		" 					<a href=""JavaScript:openWindow3('privateprint.asp?id=" & cLng(Request.QueryString("id")) & "')"">"& getCurrentIcon(strIconpmprint,"Print This Message","hspace=""0""") & "</a>"& _
		" 					<a href=""privatedelete.asp?method=DeleteMessage&id=" & cLng(Request.QueryString("id")) & """>" & getCurrentIcon(strIconpmdelete,"Delete This Message","hspace=""0""") & "</a>" & vbNewLine & _
		"				</td>" & vbNewLine & _
		" 			</tr>" & vbNewLine & _
		" 		</table>" & vbNewLine & _
		" 	</td>" & vbNewLine & _
		" </tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"<table border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
		" <tr>" & vbNewLine & _
		"	<td height=""10""> " & vbNewLine & _
		" 	</td>" & vbNewLine & _
		" </tr>" & vbNewLine & _
		"</table><br />" & vbNewLine & _
		"<table width=""80%"" border=""0"" cellspacing=""1"" cellpadding=""4"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
		"	<tr>" & vbNewLine & _
		"  	<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""" & strTopicWidthLeft & """"
	If lcase(strTopicNoWrapLeft) = "1" Then
		Response.Write	" nowrap"
	End If
	Response.Write	"><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>From</font></b>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"  	<td align=""left"" bgcolor=""" & strHeadCellColor & """ width=""" & strTopicWidthRight & """"
	If lcase(strTopicNoWrapRight) = "1" Then
		Response.Write	" nowrap"
	End If
	Response.Write	"><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>Subject:  " & strPMSubject & "</font></b>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"	<tr>" & vbNewLine & _
		"  	<td bgcolor=""" & strForumFirstCellColor & """ valign=""top"" nowrap>" & vbNewLine & _
		"			<p><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & ChkString(strMName,"display") & "</a></b></font><br>" & vbNewLine & _
		"  		</p><br>" & vbNewLine & _
		"  		<p><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & "</font><br>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"  	<td bgcolor=""" & strForumFirstCellColor & """ valign=""top"">" & vbNewLine & _
		"    " & getCurrentIcon(strIconPosticon,"","") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Sent to: <b>" & GetMemberName(strPMToID) & "</b> - " & ChkDate(strPMSent, " : " ,true) & "  # " & cLng(Request.QueryString("id"))& "</font>" & vbNewLine
	If pmcount < strPMLimit or mLev > 2 Then
		Response.Write	"    	<a href=""privatesend.asp?method=ReplyQuote&id=" & cLng(Request.QueryString("id")) & """>" & getCurrentIcon(strIconReplyTopic,"Reply with Quote","align=""center"" hspace=""6""") & "</a>" & vbNewLine
	End If
	Response.Write	"  		<hr noshade size=""1"">" & vbNewLine & _
		"  		<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & formatStr(strPMMessage) & "</font>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"</center>" & vbNewLine
End If
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & ", " & strTablePrefix & "PM.M_MESSAGE "
strSql = strSql & ", " & strTablePrefix & "PM.M_SUBJECT "
strSql = strSql & ", " & strTablePrefix & "PM.M_SENT "
strSql = strSql & ", " & strTablePrefix & "PM.M_TO "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "PM "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "PM.M_FROM "
strSql = strSql & " AND " & strTablePrefix & "PM.M_ID = " & cLng(Request.QueryString("id")-1) & " AND PM.M_SUBJECT = '" & strPMSubject & "'"
Set rs = my_Conn.Execute (strSql)
If not rs.EOF Then
	Response.Write	"<center>" & vbNewLine & _
		"<table bgcolor=""" & strPopUpBorderColor & """ border=""0"" width=""70%"" cellspacing=""2"" cellpadding=""4"">" & vbNewLine & _
		"	<tr>" & vbNewLine & _
		"  	<td bgcolor=""" & strHeadCellColor & """ colspan=""2"" align=""center""><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>R E P L I E D      F R O M :</font></b></td>" & vbNewLine & _
		"	</tr>" & vbNewLine
	Response.Write	"	<tr>" & vbNewLine & _
		"  	<td align=""center"" & bgcolor=""" & strForumCellColor & """ valign=top width=""" & strTopicWidthLeft & """"
	If lcase(strTopicNoWrapLeft) = "1" Then
		Response.Write	" nowrap"
	End If
	Response.Write	"><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>From</font></b>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"  	<td align=""left"" bgcolor=""" & strForumCellColor & """ width=""" & strTopicWidthRight & """"
	If lcase(strTopicNoWrapRight) = "1" Then
		Response.Write(" nowrap")
	End If
	Response.Write	"><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>Subject:  " & chkString(rs("M_SUBJECT"),"display") & "</font></b>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"	<tr>" & vbNewLine & _
		"  	<td bgcolor=""" & strForumCellColor & """ valign=""top"" nowrap>" & vbNewLine & _
		"			<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & ChkString(rs("M_NAME"),"display") & "</b>" & vbNewLine & _
		"			</font>" & vbNewLine & _
		"		</td><br />" & vbNewLine & _
		"  	<td bgcolor=""" & strForumCellColor & """ valign=""top"">" & vbNewLine & _
		"    	" & getCurrentIcon(strIconPosticon,"","") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Sent to: <b>" & GetMemberName(strPMFromID) & "</b>  # " & cLng(Request.QueryString("id")-1) & "</font>" & vbNewLine & _
		"  		<hr noshade size=""1"">" & vbNewLine & _
		"  		<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & formatStr(rs("M_MESSAGE")) & "</font>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"</center>" & vbNewLine
	rs.Close
End If
Set rs = Nothing
Response.Write	"<br />" & vbNewLine
WriteFooter
%>

Edited by - Carefree on 01 August 2013 22:57:29
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 01 August 2013 :  23:07:51  Show Profile  Visit golfmann's Homepage
I see now what you did....

THANK YOU SO VERY MUCH!!!!

I putzed around with this for weeks.... lol
I am such a dummy....

Thank you and bless you for all your help here...
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 01 August 2013 :  23:22:43  Show Profile  Visit golfmann's Homepage
But...
I'm now getting this:

Microsoft OLE DB Provider for SQL Server error '80040e14'

The column prefix 'PM' does not match with a table name or alias name used in the query.

/forum/privateread.asp, line 178

Edited by - golfmann on 01 August 2013 23:23:08
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 02 August 2013 :  21:20:43  Show Profile  Visit golfmann's Homepage
Well I got it to work by changing the PM.M_SUBJECT to M_SUBJECT and fixed the REPLIED FROM: to show right w/nbsp's...

Not sure it will filter like I need but so far so good and at least it SHOWS.
AND you taught me a few things in the process!
THANK YOU AGAIN and if you see trouble please let me know :)

strSql = strSql & " AND " & strTablePrefix & "PM.M_ID = " & cLng(Request.QueryString("id")-1) & " AND M_SUBJECT = '" & strPMSubject & "'"
Set rs = my_Conn.Execute (strSql)
If not rs.EOF Then
Response.Write "<center>" & vbNewLine & _

Edited by - golfmann on 02 August 2013 21:29:44
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 04 August 2013 :  19:25:17  Show Profile  Visit golfmann's Homepage
For those playing along at home, first my sympathies, and here is how I solved the dilemma of how to properly show the to and from's IF a member sends twice in a row without a return reply:

   If lcase(strTopicNoWrapRight) = "1" Then
Response.Write(" nowrap")
End If
Response.Write "><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>Subject: " & chkString(rs("M_SUBJECT"),"display") & "</font></b>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top"" nowrap>" & vbNewLine & _
" <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & ChkString(rs("M_NAME"),"display") & "</b><hr noshade size=""1"">" & vbNewLine & _
" </font>" & vbNewLine & _
" </td><br />" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top"">" & vbNewLine
If GetMemberName(strPMFromID) = rs("M_NAME") then
Response.Write" " & getCurrentIcon(strIconPosticon,"","") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Sent to: <b>" & GetMemberName(strPMToID) & "</b>  #: " & cLng(Request.QueryString("id")-1) & "</font>" & vbNewLine
Response.Write " <hr noshade size=""1"">" & vbNewLine & _
" <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & formatStr(rs("M_MESSAGE")) & "</font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine & _
"</center>" & vbNewLine
else
Response.Write" " & getCurrentIcon(strIconPosticon,"","") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Sent to: <b>" & GetMemberName(strPMFromID) & "</b>  # " & cLng(Request.QueryString("id")-1) & "</font>" & vbNewLine
Response.Write " <hr noshade size=""1"">" & vbNewLine & _
" <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & formatStr(rs("M_MESSAGE")) & "</font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine & _
"</center>" & vbNewLine
rs.Close
end if
End If
Set rs = Nothing
Response.Write "<br />" & vbNewLine
WriteFooter
%>


While maybe not according to "Hoyle" it works and you're on your OWN for privatesent.asp...
That is all...

Edited by - golfmann on 06 August 2013 20:40:17
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 04 August 2013 :  19:28:02  Show Profile  Visit golfmann's Homepage
PS:
This place REALLY needs the picture shrinker in the base code
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 05 August 2013 :  09:58:52  Show Profile  Visit AnonJr's Homepage
The problem isn't so much the images as it is the code block. This forum does have the non-standard [scrollcode] tag implemented so you can post large code blocks like that and not stretch the page.
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 05 August 2013 :  14:19:33  Show Profile  Visit golfmann's Homepage
I beg to differ...
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 05 August 2013 :  16:57:53  Show Profile  Visit AnonJr's Homepage
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 05 August 2013 :  18:27:31  Show Profile  Visit golfmann's Homepage
inc_header:
Response.Write"<script language=""JavaScript1.2"" src=""resizeimgs.js""></script>" & vbNewLine & _ 


JS:
document.writeln("<link rel=stylesheet type=text/css href='resizeimgs.css'>");
document.writeln("<div id=showimage style='position:absolute;visibility:hidden;border:1px solid black'></div>");


// =============================================================================
// Begin user defined variables
// =============================================================================
var resizeType = 0; // 0 = Dynamically resize to a fraction of the users desktop
// width divided by the dynamicDivisor variable below.
// (i.e. 1024/4 = 256 or 1280/4 = 320)
// 1 = Resize the image if it is wider than the fixedWidth
// variable below
var enlargeType = 0 // 0 = Opens in the same window
// 1 = Opens in a new window
var fixedWidth = 650; // Resize the image if it is wider than this many
// pixels. Only used when resizeType = 1.
var dynamicDivisor = 3; // Resize images to users screen width divided by
// this number. Only used when resizeType = 0.
var alignClose = "left"; // Values are 'left' or 'right'. Default is right.
var topSpacing = 25; // Spaces the pop-up window this number of pixels
// from the top of the window
var leftSpacing = 25; // Spaces the pop-up window this number of pixels
// from the left of the window
// =============================================================================
// End of user defined variables
// =============================================================================




// =============================================================================
// Do not modify below this line
// =============================================================================
var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all
var nsx,nsy,nstemp

function walkImages(){
re = /^img/;
if (document.images){
for (a=0;a<document.images.length;a++){
if (re.test(document.images[a].name)) resizeImage(document.images[a]);
}
}
}

function doimage(imgObj,event){
if (document.images) enlargeimg(imgObj,event);
}

//Thumbnail image viewer-
//© Dynamic Drive (www.dynamicdrive.com)

function resizeImage(thisimage) {
if (resizeType == 0) fixedWidth = parseInt(screen.width/dynamicDivisor);
if (thisimage.width > fixedWidth) {
thisimage.width = fixedWidth;
thisimage.style.cursor='pointer';
thisimage.title='Click the image to enlarge';
}
}

function enlargeimg(which,e){
if (resizeType == 0) fixedWidth = parseInt(screen.width/dynamicDivisor);
if (which.width < fixedWidth) {return false;}
if (enlargeType == 0) {
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (crossobj.style.visibility=="hidden"){
crossobj.style.left = (ns6? pageXOffset : document.body.scrollLeft) + leftSpacing
crossobj.style.top = (ns6? pageYOffset : document.body.scrollTop) + topSpacing
alignRE = /^left$/i
crossobj.innerHTML= (alignRE.test(alignClose))? '<div class=tvhead align=left id=drag> <span class=tvclosex onClick=closepreview() style=cursor:pointer> X </span> <span class=tvclose onClick=closepreview()>Close</span> </div><img src="'+which.src+'">' : '<div class=tvhead align=right id=drag> <span class=tvclose onClick=closepreview()>Close</span> <span class=tvclosex onClick=closepreview() style=cursor:pointer> X </span> </div><img src="'+which.src+'">';
crossobj.style.visibility="visible"
}
else
crossobj.style.visibility="hidden"
return false
}
else if (document.layers){
if (document.showimage.visibility=="hide"){
document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which.src+'" border=0></a>')
document.showimage.document.close()
document.showimage.left=e.x
document.showimage.top=e.y
document.showimage.visibility="show"
}
else
document.showimage.visibility="hide"
return false
}
else
return true
}
else if (enlargeType == 1) {
eval('window.open("showpic.asp?pic=' + which.src + '","","width='+which.width+'px,height='+which.height+'px,resizable=1,scrollbars=0")')
}
}


function closepreview(){
crossobj.style.visibility="hidden"
}

function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx
crossobj.style.top=tempy+e.clientY-offsety
}
return false
}

function initializedrag(e){
if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
document.onload=walkImages();


I believe I got this from Marcel about 500 years ago...
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 06 August 2013 :  09:42:05  Show Profile  Visit AnonJr's Homepage
I've seen that one and a couple others floating around. I know we try to keep it as close to stock as possible here (the [noparse] and [scrollcode] tags being the two exceptions given their utility in posting code problems) so there's no misunderstanding what you're getting when you download the code.

Having said that, this would be something worth considering. I'd rather tie it more closely to the [img] tag myself so I don't have to worry about the re-size code interfering with actual site code (or crawling every image in the site...) - but that's a subject for another topic.

Edited by - AnonJr on 06 August 2013 09:42:29
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 06 August 2013 :  10:41:18  Show Profile  Visit golfmann's Homepage
I think you are right but I have had no problems in years wih it.

Thanks for being here!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07