Contact Admin - نوشته شده در (1448 Views)
Senior Member
leatherlips
مطلب: 1838
1838
I installed a few years ago a mod called something like Contact The Admin MOD.
It brought up a pop up form that would send an email to the admin. It is used on the policy and faq pages.
I decided to make it a regular page instead of a pop up.
My question is, what pages do I need to include in it to keep you logged in? Right now, if you are logged in and then go to that page then it does not show you as being logged in. It in fact seems to log you out.<
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
Not sure if/why it seems to log you out, but I'm willing to bet that since it started out as a pop-up its using inc_header_short.asp. Change the reference to inc_header_short.asp to inc_header.asp and change the Call WriteFooterShort to Call WriteFooter (The file may or may not have the "Call" part)<
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
Thanks AnonJr. I have already changed the header and footer. I'm not sure what you mean about the "call" part.
Here is the text of my code if that can help.
Code:
<%
'#################################################################################
'## Copyright (C) 2000-02 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 sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE file="inc_func_member.asp" -->
<%
if Request.QueryString("mode") = "DoIt" then
Err_Msg = ""
if (Request.Form("YName") = "") then
Err_Msg = Err_Msg & "<li>You must enter your name</li>"
end if
if (Request.Form("YEmail") = "") then
Err_Msg = Err_Msg & "<li>You Must give your e-mail address</li>"
else
if (EmailField(Request.Form("YEmail")) = 0) then
Err_Msg = Err_Msg & "<li>You Must enter a valid e-mail address</li>"
end if
end if
if (Request.Form("Name") = "") then
Err_Msg = Err_Msg & "<li>You must enter the recipients name</li>"
end if
if (Request.Form("Email") = "") then
Err_Msg = Err_Msg & "<li>You Must enter the recipients e-mail address</li>"
else
if (EmailField(Request.Form("Email")) = 0) then
Err_Msg = Err_Msg & "<li>You Must enter a valid e-mail address for the recipient</li>"
end if
end if
if (Request.Form("Msg") = "") then
Err_Msg = Err_Msg & "<li>You Must enter a message</li>"
end if
if lcase(strEmail) = "1" then
if (Err_Msg = "") then
strRecipientsName = Request.Form("Name")
strRecipients = Request.Form("Email")
strSubject = strForumTitle
strMessage = Request.Form("Msg") & vbNewline & vbNewline
strMessage = strMessage & "You received this from : " & Request.Form("YName") & " (" & Request.Form("YEmail") & ") "
strFromName = Request.Form("YName")
strSender = Request.Form("YEmail")
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
Response.Write(" <p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><center>Your email has been sent</center></font></b></p>" & vbNewLine)
Response.write " <p align=""center""><font size=""" & strDefaultFontSize & """ align=""center""><a href=""JavaScript:history.go(-2)"">Go Back</a></font></p><br /><br />" & vbNewLine
else
Response.Write(" <p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center>There Was A Problem</center></font></b></p>" & vbNewLine)
Response.Write " <table align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
Response.Write(" <p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)""><center>Go Back To Enter Data</center></a></font></p>" & vbNewLine)
end if
end if
else
'## Forum_SQL
strSql = "SELECT M_NAME, M_USERNAME, M_EMAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " WHERE MEMBER_ID = " & intAdminMemberID & ""

set rs = my_conn.Execute (strSql)
if (rs.EOF or rs.BOF) then
Err_Msg = Err_Msg & "<li>The Administrator's account could not be located</li>"
Response.Write(" <p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center>There Was A Problem</center></font></b></p>" & vbNewLine)
Response.Write " <table align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
set rs = nothing
Response.Write(" <p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:onClick= window.close()"">Close Window</A></font></p>" & vbNewLine)
Response.End
else
Name = Trim("" & rs("M_NAME"))
Email = Trim("" & rs("M_EMAIL"))
end if

rs.close
set rs = nothing

Response.Write " <form action=""pop_contact_admin.asp?mode=DoIt"" method=""post"" id=""Form1"" name=""Form1"">" & vbNewLine & _
" <input type=""hidden"" name=""Page"" value=""" & Request.QueryString & """>" & vbNewLine & _
" <input type=""hidden"" name=""Name"" value=""" & Name & """>" & vbNewLine & _
" <input type=""hidden"" name=""Email"" value=""" & Email & """>" & vbNewLine & _
" <table align=""center"" border=""0"" width=""95%"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _


"<tr>" & vbNewLine & _
" <td colspan=""2"" bgColor=""" & strHeadCellColor & """ align=""center"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Contact Mangione Magic</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine & _


" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your Name:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""YName"" size=""25""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your E-mail:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""YEmail"" size=""25""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""top"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Message:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><textarea name=""Msg"" cols=""50"" rows=""10""></textarea></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ colspan=""2"" align=""center""><input type=""submit"" value=""Send"" id=""Submit1"" name=""Submit1""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </form>" & vbNewLine
end if
WriteFooter
Response.End
%>
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
That's all there is to it, Leather. Some of the 3.3 and older Snitz files had Call WriteFooter, etc; rather than simply WriteFooter. Yours uses the newer routine.<
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
Nothing jumps out... Are you sure they are getting logged out? Or is it just that some information is not being displayed right?<
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
I'm not sure why, perhaps a cookie thing? But now it is working fine. Go figure. tongue<
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
Hey Leather, I rewrote your page to give you a bit more. Try this:

Code:

<%
'#################################################################################
'## Copyright (C) 2000-02 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 sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<%
if Request.QueryString("ID") <> "" and IsNumeric(Request.QueryString("ID")) = True then
intMemberID = cLng(Request.QueryString("ID"))
else
intMemberID = 0
end if
if Request.QueryString("mode") = "DoIt" then
Err_Msg = ""
if (Request.Form("YName") = "") then
Err_Msg = Err_Msg & "<li>You must enter your name</li>"
end if
if (Request.Form("YEmail") = "") then
Err_Msg = Err_Msg & "<li>You Must give your e-mail address</li>"
else
if (EmailField(Request.Form("YEmail")) = 0) then
Err_Msg = Err_Msg & "<li>You must enter a valid e-mail address.</li>"
end if
end if
if (Request.Form("Name") = "") then
Err_Msg = Err_Msg & "<li>You must enter the recipient's name.</li>"
end if
if (Request.Form("Email") = "") then
Err_Msg = Err_Msg & "<li>You Must enter the recipients e-mail address.</li>"
else
if (EmailField(Request.Form("Email")) = 0) then
Err_Msg = Err_Msg & "<li>You must enter a valid e-mail address for the recipient.</li>"
end if
end if
if (Request.Form("Msg") = "") then
Err_Msg = Err_Msg & "<li>You Must enter a message</li>"
end if
if lcase(strEmail) = "1" then
if (Err_Msg = "") then
strRecipientsName = Request.Form("Name")
strRecipients = Request.Form("Email")
strSubject = "Contact Admin"
strMessage = Request.Form("Msg") & vbNewline & vbNewline
strMessage = strMessage & "You received this from : " & Request.Form("YName") & " (" & Request.Form("YEmail") & ") "
strFromName = Request.Form("YName")
strSender = Request.Form("YEmail")
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
Response.Write(" <p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><center>Your EMail has been sent.</center></font></b></p>" & vbNewLine)
Response.write " <p align=""center""><font size=""" & strDefaultFontSize & """ align=""center""><a href=""JavaScript:history.go(-2)"">Go Back</a></font></p><br /><br />" & vbNewLine
else
Response.Write(" <p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center>There Was A Problem.</center></font></b></p>" & vbNewLine)
Response.Write " <table align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
Response.Write(" <p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)""><center>Go Back To Enter Data.</center></a></font></p>" & vbNewLine)
end if
end if
else
'## Forum_SQL
strSql = "SELECT M_NAME, M_USERNAME, M_EMAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " WHERE MEMBER_ID = " & intAdminMemberID & ""

set rs = my_conn.Execute (strSql)
if (rs.EOF or rs.BOF) then
Err_Msg = Err_Msg & " <li>The Administrator's account could not be located.</li>"
Response.Write(" <p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center>There Was a Problem.</center></font></b></p>" & vbNewLine)
Response.Write " <table align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
set rs = nothing
Response.Write(" <p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:onClick= window.close()"">Close Window</A></font></p>" & vbNewLine)
Response.End
else
Name = Trim("" & rs("M_NAME"))
Email = Trim("" & rs("M_EMAIL"))
end if

rs.close
set rs = nothing

Response.Write " <form action=""contact_admin.asp?mode=DoIt"" method=""post"" id=""Form1"" name=""Form1"">" & vbNewLine & _
" <input type=""hidden"" name=""Page"" value=""" & Request.QueryString & """>" & vbNewLine & _
" <input type=""hidden"" name=""Name"" value=""" & Name & """>" & vbNewLine & _
" <input type=""hidden"" name=""Email"" value=""" & Email & """>" & vbNewLine & _
" <table align=""center"" border=""0"" width=""95%"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2"" bgColor=""" & strHeadCellColor & """ align=""center"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Contact Mangione Magic</font></b></td>" & vbNewLine
if strAllowForumCode = 1 then
%>
<!--#INCLUDE FILE="inc_post_buttons.asp" -->
<%
end if
Response.Write " </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your Name:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""YName"" size=""25""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your E-mail:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""YEmail"" size=""25""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""top"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Message:</font></b>" & vbNewLine & _
" <br>" & vbNewLine & _
" <table border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"" nowrap><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
%>
<!--#INCLUDE FILE="inc_smilies.asp" -->
<%
end if
Response.Write " </font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><textarea name=""Msg"" cols=""50"" rows=""10""></textarea></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ colspan=""2"" align=""center""><input type=""submit"" value=""Send"" id=""Submit1"" name=""Submit1""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
end if
WriteFooter
Response.End
%>
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
Carefree. Thanks for doing the rewrite, but the forum tags do not work when sending an email. The email just shows the tags themselves. I don't really need them for this contact email form.
Thanks anyway! smile<
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
Hmmm. I did find a small issue with mine.
If you view the page source my email address is visible. Can that be changed like it is when you email a member?<
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
Sure. Remove the following code:

Code:

   '## Forum_SQL
strSql = "SELECT M_NAME, M_USERNAME, M_EMAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " WHERE MEMBER_ID = " & intAdminMemberID & ""

set rs = my_conn.Execute (strSql)
if (rs.EOF or rs.BOF) then
Err_Msg = Err_Msg & "<li>The Administrator's account could not be located</li>"
Response.Write(" <p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center>There Was A Problem</center></font></b></p>" & vbNewLine)
Response.Write " <table align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
set rs = nothing
Response.Write(" <p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:onClick= window.close()"">Close Window</A></font></p>" & vbNewLine)
Response.End
else
Name = Trim("" & rs("M_NAME"))
Email = Trim("" & rs("M_EMAIL"))
end if

rs.close
set rs = nothing

That's the part that's displaying your email.<
 
شما باید یک متن وارد کنید