lotussutol
Starting Member
41 Posts |
Posted - 12 March 2003 : 21:28:47
|
got it working... one include is for all pages that people can view <% strDBNTUserName = Request.Cookies("Snitz00User")("Name") %> <link rel="stylesheet" href="style.css" type="text/css"> <table cellpadding=2 cellspacing=0 width=95% align=center bgcolor=#F0D100 border=1 bordercolor=black> <tr> <td> <table cellpadding=0 cellspacing=0 width=100% align=center bgcolor=#F0D100> <tr> <td align=center colspan=3>Welcome to TaftHighAlumni.com a website for Taft Union High School Alumni</td> </tr> <tr> <td valign=top><img src=/forum/logo_snitz_forums_2000.gif> <td valign=top><br><!--#include file="../banner.asp" --></td> <td valign=top> <% Response.Write " <table width=""175"" border=""1"" bordercolor=""#7331BD"" cellspacing=""0"" cellpadding=""4"" align=""center"">" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td valign=""top"" align=""center"" class=""headcell""><b>Member Login</b></td>" & vbNewLine & _ " </tr>" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td class=""smalltext"" valign=""top"" align=""center"">" & vbNewLine if strDBNTUserName = "" then Response.Write " <form action=""/forum/login.asp"" method=""post"" id=""form1"" name=""form1"">" & vbNewLine & _ " <input type=""hidden"" name=""Method_Type"" value=""login"">" & vbNewLine Response.Write " <b>Username:</b><br />" & vbNewLine & _ " <input type=""text"" name=""Name"" size=""10"" maxLength=""25"" value=""""><br />" & vbNewLine & _ " <b>Password:</b><br />" & vbNewLine & _ " <input type=""password"" name=""Password"" size=""10"" maxLength=""25"" value=""""><br />" & vbNewLine Response.Write " <input class=""btn"" type=""submit"" value=""Login"" id=""submit1"" name=""submit1""><br />" & vbNewLine Response.Write " <input type=""checkbox"" name=""SavePassWord"" value=""true"" tabindex=""-1"" CHECKED><b><small> Save Password</small></b><br />" & vbNewLine 'Response.Write " Please <a href=""/forum/policy.asp"" tabindex=""-1""><acronym title=""Register to post to our forum..."">Register</acronym></a> to Post in our Forums<br>" & vbNewline 'Response.Write " <a href=""/forum/password.asp"" tabindex=""-1""><acronym title=""Choose a new password if you have forgotten your current one..."">Forgot your Password?</acronym></a>" else Response.Write " <form action=""/forum/login.asp"" method=""post"" id=""form2"" name=""form2"">" & vbNewLine & _ " <input type=""hidden"" name=""Method_Type"" value=""logout"">" & vbNewLine & _ " You are logged on as<br />" & vbNewLine Response.Write "<b>" & ChkString(strDBNTUserName, "display") & "</b><br />" & vbNewLine Response.Write "<input class=""btn"" type=""submit"" value=""Logout"" id=""submit1"" name=""submit1"" tabindex=""-1""><br />" if (mlev = 4) or (lcase(strNoCookies) = "1") then Response.Write " " & vbNewLine & _ " <a href=""/forum/admin_home.asp""" & dWStatus("Access the Forum Admin Functions...") & " tabindex=""-1"">Admin Options</a>" end if Response.Write " </form>" & vbNewLine end if Response.Write "</td></tr></table>" & vbNewLine %> </td> </tr> </table></td> </tr> </table>
and the other is for a page that you have to be logged in to see
<% strDBNTUserName = Request.Cookies("Snitz00User")("Name") %> <link rel="stylesheet" href="style.css" type="text/css"> <table cellpadding=2 cellspacing=0 width=95% align=center bgcolor=#F0D100 border=1 bordercolor=black> <tr> <td> <table cellpadding=0 cellspacing=0 width=100% align=center bgcolor=#F0D100> <tr> <td align=center colspan=3>Welcome to TaftHighAlumni.com a website for Taft Union High School Alumni</td> </tr> <tr> <td valign=top><img src=/forum/logo_snitz_forums_2000.gif> <td valign=top><br><!--#include file="../banner.asp" --></td> <td valign=top> <% Response.Write " <table width=""175"" border=""1"" bordercolor=""#7331BD"" cellspacing=""0"" cellpadding=""4"" align=""center"">" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td valign=""top"" align=""center""><b>Member Login</b></td>" & vbNewLine & _ " </tr>" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td class=""smalltext"" valign=""top"" align=""center"">" & vbNewLine if strDBNTUserName = "" then Response.Redirect( "error.asp" ) else Response.Write " <form action=""/forum/login.asp"" method=""post"" id=""form2"" name=""form2"">" & vbNewLine & _ " <input type=""hidden"" name=""Method_Type"" value=""logout"">" & vbNewLine & _ " You are logged on as<br />" & vbNewLine Response.Write "<b>" & ChkString(strDBNTUserName, "display") & "</b><br />" & vbNewLine Response.Write "<input class=""btn"" type=""submit"" value=""Logout"" id=""submit1"" name=""submit1"" tabindex=""-1""><br />" if (mlev = 4) or (lcase(strNoCookies) = "1") then Response.Write " " & vbNewLine & _ " <a href=""/forum/admin_home.asp""" & dWStatus("Access the Forum Admin Functions...") & " tabindex=""-1"">Admin Options</a>" end if Response.Write " </form>" & vbNewLine end if Response.Write "</td></tr></table>" & vbNewLine %></td> </tr> </table></td> </tr> </table>
then... i made two other include pages... the first one is for all view pages <!--#INCLUDE VIRTUAL="forum/inc_login.asp"--> <!--#INCLUDE VIRTUAL="forum/config.asp"--> <!--#INCLUDE VIRTUAL="forum/inc_sha256.asp"--> <!--#INCLUDE VIRTUAL="forum/inc_func_common.asp"--> <!--#INCLUDE VIRTUAL="forum/inc_noheader.asp"-->
the other is for secure pages <!--#INCLUDE VIRTUAL="forum/inc_loginRedirect.asp"--> <!--#INCLUDE VIRTUAL="forum/config.asp"--> <!--#INCLUDE VIRTUAL="forum/inc_sha256.asp"--> <!--#INCLUDE VIRTUAL="forum/inc_func_common.asp"--> <!--#INCLUDE VIRTUAL="forum/inc_noheader.asp"-->
Also I made a inc_noheader.asp (deleted as much as i could of the header but kept the code needed to make it work)..
<% '################################################################################# '## 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="inc_func_common.asp" --> <%
if strShowTimer = "1" then '### start of timer code Dim StopWatch(19)
sub StartTimer(x) StopWatch(x) = timer end sub
function StopTimer(x) EndTime = Timer
'Watch for the midnight wraparound... if EndTime < StopWatch(x) then EndTime = EndTime + (86400) end if
StopTimer = EndTime - StopWatch(x) end function
StartTimer 1
'### end of timer code end if
strArchiveTablePrefix = strTablePrefix & "A_" strScriptName = request.servervariables("script_name")
if Application(strCookieURL & "down") then if not Instr(strScriptName,"admin_") > 0 then Response.redirect("down.asp") end if end if
if strPageBGImageURL = "" then strTmpPageBGImageURL = "" elseif Instr(strPageBGImageURL,"/") > 0 or Instr(strPageBGImageURL,"\") > 0 then strTmpPageBGImageURL = " background=""" & strPageBGImageURL & """" else strTmpPageBGImageURL = " background=""" & strImageUrl & strPageBGImageURL & """" end if
If strDBType = "" then Response.Write "<html>" & vbNewLine & _ "<head>" & vbNewline & _ "<title>" & strForumTitle & "</title>" & vbNewline
'## START - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT Response.Write "<meta name=""copyright"" content=""This Forum code is Copyright (C) 2000-02 Michael Anderson, Pierre Gorissen, Huw Reddick and Richard Kinser, Non-Forum Related code is Copyright (C) " & strCopyright & """>" & vbNewline '## END - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT
Response.Write "</head>" & vbNewLine & _ "<body" & strTmpPageBGImageURL & " bgColor=""" & strPageBGColor & """ text=""" & strDefaultFontColor & """ link=""" & strLinkColor & """ aLink=""" & strActiveLinkColor & """ vLink=""" & strVisitedLinkColor & """>" & vbNewLine & _ "<table border=""0"" cellspacing=""0"" cellpadding=""5"" width=""50%"" height=""40%"" align=""center"">" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td bgColor=""navyblue"" align=""center""><p><font face=""Verdana, Arial, Helvetica"" size=""2"">" & _ "<b>There has been a problem...</b><br /><br />" & _ "Your <b>strDBType</b> is not set, please edit your <b>config.asp</b><br />to reflect your database type." & _ "</font></p></td>" & vbNewLine & _ " </tr>" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td align=""center""><font face=""Verdana, Arial, Helvetica"" size=""2"">" & _ "<a href=""default.asp"" target=""_top"">Click here to retry.</a></font></td>" & vbNewLine & _ " </tr>" & vbNewLine & _ "</table>" & vbNewLine & _ "</body>" & vbNewLine & _ "</html>" & vbNewLine Response.End end if
set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString
if (strAuthType = "nt") then call NTauthenticate() if (ChkAccountReg() = "1") then call NTUser() end if end if
if strGroupCategories = "1" then if Request.QueryString("Group") = "" then if Request.Cookies(strCookieURL & "GROUP") = "" Then Group = 2 else Group = Request.Cookies(strCookieURL & "GROUP") end if else Group = cLng(Request.QueryString("Group")) end if 'set default Session(strCookieURL & "GROUP_ICON") = "icon_group_categories.gif" Session(strCookieURL & "GROUP_IMAGE") = strTitleImage 'Forum_SQL - Group exists ? strSql = "SELECT GROUP_ID, GROUP_NAME, GROUP_ICON, GROUP_IMAGE " strSql = strSql & " FROM " & strTablePrefix & "GROUP_NAMES " strSql = strSql & " WHERE GROUP_ID = " & Group set rs2 = my_Conn.Execute (strSql) if rs2.EOF or rs2.BOF then Group = 2 strSql = "SELECT GROUP_ID, GROUP_NAME, GROUP_ICON, GROUP_IMAGE " strSql = strSql & " FROM " & strTablePrefix & "GROUP_NAMES " strSql = strSql & " WHERE GROUP_ID = " & Group set rs2 = my_Conn.Execute (strSql) end if Session(strCookieURL & "GROUP_NAME") = rs2("GROUP_NAME") if instr(rs2("GROUP_ICON"), ".") then Session(strCookieURL & "GROUP_ICON") = rs2("GROUP_ICON") end if if instr(rs2("GROUP_IMAGE"), ".") then Session(strCookieURL & "GROUP_IMAGE") = rs2("GROUP_IMAGE") end if rs2.Close set rs2 = nothing Response.Cookies(strCookieURL & "GROUP") = Group Response.Cookies(strCookieURL & "GROUP").Expires = dateAdd("d", intCookieDuration, strForumTimeAdjust) if Session(strCookieURL & "GROUP_IMAGE") <> "" then strTitleImage = Session(strCookieURL & "GROUP_IMAGE") end if end if
strDBNTUserName = Request.Cookies(strUniqueID & "User")("Name") strDBNTFUserName = trim(chkString(Request.Form("Name"),"SQLString")) if strDBNTFUserName = "" then strDBNTFUserName = trim(chkString(Request.Form("User"),"SQLString")) if strAuthType = "nt" then strDBNTUserName = Session(strCookieURL & "userID") strDBNTFUserName = Session(strCookieURL & "userID") end if
if strRequireReg = "1" and strDBNTUserName = "" then if not Instr(strScriptName,"policy.asp") > 0 and _ not Instr(strScriptName,"register.asp") > 0 and _ not Instr(strScriptName,"password.asp") > 0 and _ not Instr(strScriptName,"faq.asp") > 0 and _ not Instr(strScriptName,"login.asp") > 0 then scriptname = split(request.servervariables("SCRIPT_NAME"),"/") if Request.QueryString <> "" then Response.Redirect("login.asp?target=" & lcase(scriptname(ubound(scriptname))) & "?" & Request.QueryString) else Response.Redirect("login.asp?target=" & lcase(scriptname(ubound(scriptname)))) end if end if end if
select case Request.Form("Method_Type") case "login" strEncodedPassword = sha256("" & Request.Form("Password")) select case chkUser(strDBNTFUserName, strEncodedPassword,-1) case 1, 2, 3, 4 Call DoCookies(Request.Form("SavePassword")) strLoginStatus = 1 case else strLoginStatus = 0 end select case "logout" Call ClearCookies() end select
if trim(strDBNTUserName) <> "" and trim(Request.Cookies(strUniqueID & "User")("Pword")) <> "" then chkCookie = 1 mLev = cLng(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"),-1)) chkCookie = 0 else MemberID = -1 mLev = 0 end if
if mLev = 4 and strEmailVal = "1" and strRestrictReg = "1" and strEmail = "1" then '## Forum_SQL - Get membercount from DB strSql = "SELECT COUNT(MEMBER_ID) AS U_COUNT FROM " & strMemberTablePrefix & "MEMBERS_PENDING WHERE M_APPROVE = " & 0
set rs = Server.CreateObject("ADODB.Recordset") rs.open strSql, my_Conn
if not rs.EOF then User_Count = cLng(rs("U_COUNT")) else User_Count = 0 end if
rs.close set rs = nothing end if
Response.Write "<html>" & vbNewline & vbNewline & _ "<head>" & vbNewline & _ "<title>" & GetNewTitle(strScriptName) & "</title>" & vbNewline
'## START - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT Response.Write "<meta name=""copyright"" content=""This Forum code is Copyright (C) 2000-02 Michael Anderson, Pierre Gorissen, Huw Reddick and Richard Kinser, Non-Forum Related code is Copyright (C) " & strCopyright & """>" & vbNewline '## END - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT
Response.Write "<script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _ "<!-- hide from JavaScript-challenged browsers" & vbNewLine & _ "function openWindow(url) {" & vbNewLine & _ " popupWin = window.open(url,'new_page','width=400,height=400')" & vbNewLine & _ "}" & vbNewLine & _ "function openWindow2(url) {" & vbNewLine & _ " popupWin = window.open(url,'new_page','width=400,height=450')" & vbNewLine & _ "}" & vbNewLine & _ "function openWindow3(url) {" & vbNewLine & _ " popupWin = window.open(url,'new_page','width=400,height=450,scrollbars=yes')" & vbNewLine & _ "}" & vbNewLine & _ "function openWindow4(url) {" & vbNewLine & _ " popupWin = window.open(url,'new_page','width=400,height=525')" & vbNewLine & _ "}" & vbNewLine & _ "function openWindow5(url) {" & vbNewLine & _ " popupWin = window.open(url,'new_page','width=450,height=525,scrollbars=yes,toolbars=yes,menubar=yes,resizable=yes')" & vbNewLine & _ "}" & vbNewLine & _ "function openWindow6(url) {" & vbNewLine & _ " popupWin = window.open(url,'new_page','width=500,height=450,scrollbars=yes')" & vbNewLine & _ "}" & vbNewLine & _ "function openWindowHelp(url) {" & vbNewLine & _ " popupWin = window.open(url,'new_page','width=470,height=200,scrollbars=yes')" & vbNewLine & _ "}" & vbNewLine & _ "// done hiding -->" & vbNewLine & _ "</script>" & vbNewLine & _ "<style type=""text/css"">" & vbNewLine & _ "<!--" & vbNewLine & _ "a:link {color:" & strLinkColor & ";text-decoration:" & strLinkTextDecoration & "}" & vbNewLine & _ "a:visited {color:" & strVisitedLinkColor & ";text-decoration:" & strVisitedTextDecoration & "}" & vbNewLine & _ "a:hover {color:" & strHoverFontColor & ";text-decoration:" & strHoverTextDecoration & "}" & vbNewLine & _ "a:active {color:" & strActiveLinkColor & ";text-decoration:" & strActiveTextDecoration & "}" & vbNewLine & _ ".spnMessageText a:link {color:" & strForumLinkColor & ";text-decoration:" & strForumLinkTextDecoration & "}" & vbNewLine & _ ".spnMessageText a:visited {color:" & strForumVisitedLinkColor & ";text-decoration:" & strForumVisitedTextDecoration & "}" & vbNewLine & _ ".spnMessageText a:hover {color:" & strForumHoverFontColor & ";text-decoration:" & strForumHoverTextDecoration & "}" & vbNewLine & _ ".spnMessageText a:active {color:" & strForumActiveLinkColor & ";text-decoration:" & strForumActiveTextDecoration & "}" & vbNewLine & _ ".spnSearchHighlight {background-color:" & strSearchHiLiteColor & "}" & vbNewLine & _ "input.radio {background:" & strPopUpTableColor & ";color:#000000}" & vbNewLine & _ "-->" & vbNewLine & _ "</style>" & vbNewLine & _ "</head>" & vbNewLine & _ vbNewLine & _ "<body" & strTmpPageBGImageURL & " bgColor=""" & strPageBGColor & """ text=""" & strDefaultFontColor & """ link=""" & strLinkColor & """ aLink=""" & strActiveLinkColor & """ vLink=""" & strVisitedLinkColor & """>" & vbNewLine & _ "<a name=""top""></a><font face=""" & strDefaultFontFace & """>"
%>
here is the pages if you want to see them in action... site is still far from being done though... should have it done by saturday... http://www.qiksmog.com/incSafe.asp http://www.qiksmog.com/incSecure.asp
Lotus |
|
|