<%
'***********************************************************************
'** Copyright (C) 2001 - 2004 Max Yuan All Rights Reserved
'**
'** By using this program, you are agreeing to the terms of the
'** GNU General Public License.
'**
'** 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 MaxWebPortal must remain intact
'** in the scripts and in the outputted HTML.
'** The "powered by" text/logo with a link back to 
'** http://www.maxwebportal.com in the footer of the pages MUST
'** remain visible when the pages are viewed on the internet or intranet.
'**
'** Support can be obtained from support forums at:
'** http://www.maxwebportal.com
'**
'** Email: maxwebportal@hotmail.com
'** ICQ: 148111300
'***********************************************************************
'** This Page Contains source code of Snitz Forums 2000
'***********************************************************************
'#################################################################################
'## Copyright (C) 2000  Michael Anderson and Pierre Gorissen
'## 
'## 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 sent to:
'## reinhold@bigfoot.com
'## 
'## or
'## 
'## Snitz Communications 
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
CurPageType = "forums"
CurPageInfoChk = "1"
function CurPageInfo ()
	PageName = "a Private Message"
	PageAction = "Reading<br>" 
	CurPageInfo = PageAction & PageName
end function
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->

<% if strDBNTUserName = "" Then
        Response.Redirect "fhome.asp"
        Response.End
   else
if Request.QueryString("id") <> "" or  Request.QueryString("id") <> " " then
	if IsNumeric(Request.QueryString("id")) = True then
		strRQid = Request.QueryString("id")
	else
		Response.Redirect("fhome.asp")
	end if
end if

	strSql = "UPDATE " & strTablePrefix & "PM "
	strSql = strSql & " SET " & strTablePrefix & "PM.M_READ = 1 "
	strSql = strSql & " WHERE (" & strTablePrefix & "PM.M_ID = " & strRQid & ");"

	my_conn.Execute (strSql)

	set my_Conn = Server.CreateObject("ADODB.Connection") 
	my_Conn.Open strConnString

	strSql = "SELECT "   & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME,  " & strTablePrefix & "PM.M_ID,  " & strTablePrefix & "PM.M_TO, " & strTablePrefix & "PM.M_SUBJECT, " & strTablePrefix & "PM.M_SENT, " & strTablePrefix & "PM.M_FROM, " & strTablePrefix & "PM.M_MESSAGE "
	strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS , " & strTablePrefix & "PM "
	strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_NAME = '" & strDBNTUserName & "'"
	strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "PM.M_TO "
	strSql = strSql & " AND " & strTablePrefix & "PM.M_ID =  " & strRQid
	strSql = strSql & " ORDER BY " & strTablePrefix & "PM.M_SENT DESC" 

	Set rsMessage = my_Conn.Execute(strSql)

	if rsMessage.BOF or rsMessage.EOF then
	   Response.Redirect("pm_view.asp")
	end if

	strSql ="SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_ICQ, " & strMemberTablePrefix & "MEMBERS.M_YAHOO, " & strMemberTablePrefix & "MEMBERS.M_AIM, " & strMemberTablePrefix & "MEMBERS.M_TITLE, " & strMemberTablePrefix & "MEMBERS.M_TITLE, " & strMemberTablePrefix & "MEMBERS.M_Homepage, " & strMemberTablePrefix & "MEMBERS.M_LEVEL, " & strMemberTablePrefix & "MEMBERS.M_POSTS, " & strMemberTablePrefix & "MEMBERS.M_CITY, " & strMemberTablePrefix & "MEMBERS.M_STATE, " & strMemberTablePrefix & "MEMBERS.M_COUNTRY, " & strMemberTablePrefix & "MEMBERS.M_PMRECEIVE, " & strTablePrefix & "PM.M_FROM, " & strTablePrefix & "PM.M_SUBJECT "
	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 =  " & strRQid

	Set rs = my_Conn.Execute(strSql)

%>
<script language="JavaScript">
<!-- hide from JavaScript-challenged browsers
function members2() { var MainWindow = window.open ("members2.asp", "","toolbar=no,location=no,menubar=no,scrollbars=yes,width=250,height=500,resizeable=yes,status=no");
}
// done hiding -->
</script>
<center>
<table border="0" width="99%" align="center">
  <tr>
    <td width="33%" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
    <img src="icon_folder_open.gif" height=15 width=15 border="0">&nbsp;<a href="fhome.asp">כל הפורומים</a><br>
    <img src="icon_bar.gif" height=15 width=15 border="0"><img src="icon_folder_open.gif" height=15 width=15 border="0">&nbsp;<a href="pm_view.asp">הודעות פרטיות</a><br>
    <img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_bar.gif" height=15 width=15 border="0"><img src="icon_folder_open_topic.gif" height=15 width=15 border="0">&nbsp;קריאת הודעות פרטיות<br>
    </font></td>
  </tr>
</table>
<table border=0 width=95%>
  <tr>
    <td colspan=2 align=left><A HREF="pm_view.asp"><IMG SRC="pmreceive.jpg" BORDER=0 ALT="בדיקת הודעות חדשות"></A><A HREF="privatesend.asp?method=Reply&REPLY_ID=<% =rs("MEMBER_ID")%>&id=<% =strRQid%>&R_SUBJECT=<% =ChkString(rs("M_SUBJECT"),"urlpath")%>"><IMG SRC="pmreply.jpg"  BORDER=0 ALT="השב הודעה"></A><a href="privatesend.asp?method=Forward&REPLY_ID=<% =rs("MEMBER_ID")%>&id=<% =strRQid%>&R_SUBJECT=<% =ChkString(rs("M_SUBJECT"),"urlpath")%>"><IMG SRC="pmforward.jpg" BORDER=0 ALT="העבר הודעה זו"></A><A HREF="privatedelete.asp?method=DeleteMessage&id=<%=strRQid%>"><IMG SRC="pmdelete.jpg" BORDER=0 ALT="מחק הודעה זו"></A></td>
  </tr>
</table>
<%
mwpThemeTableCustomCode = "align=""center"" width=""95%"" bgcolor="""""
mwpThemeBlock_open()
%>
  <tr>
    <td>
    <table border="0" width="100%" cellspacing="1" cellpadding="4">
  <tr>
    <td align="center" <%= mwpThemeBlock_subTitleCell %> width="<% =strTopicWidthLeft %>" <% if lcase(strTopicNoWrapLeft) = "1" then Response.Write(" nowrap") %>><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">פורום</font></b></td>
    <td align=right <%= mwpThemeBlock_subTitleCell %> width="<% =strTopicWidthRight %>" <% if lcase(strTopicNoWrapRight) = "1" then Response.Write(" nowrap") %>><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">נושא:&nbsp;&nbsp; <% =rsMessage("M_SUBJECT") %></font></b></td>
  </tr>
  <tr>
    <td bgcolor="<% =strForumFirstCellColor %>" valign="top">
      <font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
      <% if strUseExtendedProfile then %>
      	<a href="pop_profile.asp?mode=display&id=<% =rs("M_FROM") %>">
      <% else %>
      	<a href="JavaScript:openWindow3('pop_profile.asp?mode=display&id=<% =rs("M_FROM") %>')">
      <% end if %>
      
<% if rs("M_LEVEL")>=2 then %>
	<font style="filter:glow(color:<% =strHeadCellColor %>,strength:4); width:100%" color="<% =strDefaultFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b><% =ChkString(rs("M_NAME"),"display") %></b></a>
<% else %>
 	<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b><% =ChkString(rs("M_NAME"),"display") %></a></b>
<% end if %>
</font>
<%	if strShowRank = 1 or strShowRank = 3 then %>
          <br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% = ChkString(getMember_Level(rs("M_TITLE"), rs("M_LEVEL"), rs("M_POSTS")),"display") %></small></font>
<%  	end if %>
<%     	  if strShowRank = 2 or strShowRank = 3 then %>
            <br><% = getStar_Level(rs("M_LEVEL"), rs("M_POSTS")) %>
<%	  end if %>
          <br>
          <br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rs("M_COUNTRY") %></small></font>
          <br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rs("M_POSTS") %> הודעות</small></font>
    </td>
    <td bgcolor="<% =strForumFirstCellColor %>" valign="top">
      <img src="icon_posticon.gif" border="0" hspace="3"><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>">Sent&nbsp;-&nbsp;<% =ChkDate(rsMessage("M_SENT")) %>&nbsp;&nbsp;<% =ChkTime(rsMessage("M_SENT")) %></font>
      <% if strUseExtendedProfile then %>
      	&nbsp;<a href="pop_profile.asp?mode=display&id=<% =rs("MEMBER_ID") %>"><img src="icon_profile.gif" height=15 width=15 alt="הצג פרופיל" border="0" align="absmiddle" hspace="6"></a>
      <% else %>
      	&nbsp;<a href="JavaScript:openWindow3('pop_profile.asp?mode=display&id=<% =rs("MEMBER_ID") %>')"><img src="icon_profile.gif" height=15 width=15 alt="הצג פרופיל" border="0" align="absmiddle" hspace="6"></a>
      <% end if %>
      &nbsp;<a href="JavaScript:openWindow('pop_mail.asp?id=<% =rs("M_FROM") %>')"><img src="icon_email.gif" height=15 width=15 alt="שלח אימייל לשולח" border="0" align="absmiddle" hspace="6"></a>
      &nbsp;<a href="privatesend.asp?method=ReplyQuote&REPLY_ID=<% =rs("MEMBER_ID")%>&id=<% =strRQid%>&R_SUBJECT=<% =ChkString(rs("M_SUBJECT"),"urlpath")%>"><img src="icon_reply_topic.gif" height=15 width=15 alt="השב עם/בלי ציטוט" border="0" align="absmiddle" hspace="6"></a>
<%    if strHomepage = "1" then %>
<%    	if rs("M_Homepage") <> " " then %>
          &nbsp;<a href="<% =rs("M_Homepage") %>"><img src="icon_Homepage.gif" height=15 width=15 alt="צפה באתר הבית של <% =rs("M_NAME") %>" border="0" align="absmiddle" hspace="6"></a>
<%	end if %>
<%    end if %>
<%    if strICQ = "1" then %>
<%    	if rs("M_ICQ") <> " " then %>
          &nbsp;<a href="JavaScript:openWindow('pop_messengers.asp?mode=ICQ&ICQ=<% =rs("M_ICQ") %>&M_NAME=<% =ChkString(rs("M_NAME"),"urlpath") %>')"><img src="http://online.mirabilis.com/scripts/online.dll?icq=<% =rs("M_ICQ") %>&img=5" height=15 width=15 alt="שלח ל <% =rs("M_NAME") %> הודעת ICQ " border="0" align="absmiddle" hspace="6"></a>
<%	end if %>
<%    end if %>
<%    if strYAHOO = "1" then %>
<%      if rs("M_YAHOO") <> " " then %>
          &nbsp;<a href="JavaScript:openWindow('http://edit.yahoo.com/config/send_webmesg?.target=<% =rs("M_YAHOO") %>&.src=pg')"><img src="icon_yahoo.gif" height=15 width=15 alt="שלח ל <% =rs("M_NAME") %> הודעת Yahoo! " border="0" align="absmiddle" hspace="6"></a>
<%	end if %>
<%    end if %>
<%    if (strAIM = "1") then %>
<%    	if rs("M_AIM") <> " " then %>
          &nbsp;<a href="JavaScript:openWindow('pop_messengers.asp?mode=AIM&AIM=<% =rs("M_AIM") %>&M_NAME=<% =ChkString(rs("M_NAME"),"urlpath") %>')"><img src="icon_aim.gif" height=15 width=15 alt="שלח ל  <% =rs("M_NAME") %> הודעת AOL" border="0" align="absmiddle" hspace="6"></a>
<%	end if %>
<%    end if %>
      <hr noshade size=1>
      <font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% =formatStr(rsMessage("M_MESSAGE")) %></font>
    </td>
  </tr>
    </table></td>
  </tr>
<%mwpThemeBlock_close()%>
</center>
<% end if %>
<br>
<!--#INCLUDE FILE="inc_footer.asp" -->