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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Must Login to view page
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

James
Average Member

USA
539 Posts

Posted - 15 May 2002 :  22:19:49  Show Profile  Visit James's Homepage
Here's a simple "must be logged in" mod. This mod prevents users who are not logged on from viewing pages that you select. If they view such a page, they get a message that they must be logged in to view that page and are then re-directed back to the main forum (default.asp) after a couple seconds.

Create a file named mustlogin.asp.

The contents of this file should be:

<%
'## Must Login Page
'## This page is to notify members that they must login
'## in order to view the page that sent them here
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->

<meta http-equiv="Refresh" content="2; URL=default.asp">

<p> </p>
<h2 align="center">You must be Logged On to view this page!</h2>
<p> </p>
<p align="center"><a href="default.asp">return to forum</a></p>


<%
my_Conn.Close
set my_Conn = nothing
%>


Place the mustlogin.asp file in your forum directory.

Now in any page you want to make viewable to members only, add the following code directly below the line at the top that reads <!--#INCLUDE FILE="inc_top.asp" -->:


<%
if mlev = 0 then
response.redirect "mustlogin.asp"
end if
%>


For example, to make the members page viewable to members only, edit the file members.asp to read like (added code in green):


'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->
<%
if mlev = 0 then
response.redirect "mustlogin.asp"
end if
%>


<script language="JavaScript">
function ChangePage(i){
if (i == 1) {
document.PageNum1.submit();


-
*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*


Edited by - James on 15 May 2002 22:22:39

MDGamezz
Junior Member

USA
100 Posts

Posted - 15 May 2002 :  22:43:35  Show Profile  Send MDGamezz an AOL message  Send MDGamezz an ICQ Message
I use

<%
if strDBNTUserName = "" then
doNotLoggedInForm
end if
%>



This prevents guest from viewing forums as well.




MDGamezz
Go to Top of Page

blackinwhite
Average Member

Turkey
657 Posts

Posted - 16 May 2002 :  05:35:05  Show Profile
quote:

I use

<%
if strDBNTUserName = "" then
doNotLoggedInForm
end if
%>



This prevents guest from viewing forums as well.




MDGamezz



I also use

doNotLoggedInForm
function.

you may easily prevent someone according to criteria like mLev, whether he/she is logged in etc.

Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 17 May 2002 :  22:47:54  Show Profile  Visit James's Homepage
quote:

I use

<%
if strDBNTUserName = "" then
doNotLoggedInForm
end if
%>



This prevents guest from viewing forums as well.



I hadn't seen this before. BTW, when I do this I get a response that says:

There was a prolbem

You must be logged in to enter this forum


Notice the incorrect spelling . Where is this located (about what line number in what file)? I would like to modify it (with correct spelling of course ) to say "view this page" instead of "enter this forum" and to change the link from a Javascript back to a simple link to the forum (default.asp). Is this used by anything else in the forums (such as private forums)? Will changing it cause problems with anything?

-
*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

Anacrusis
Junior Member

USA
219 Posts

Posted - 17 May 2002 :  22:51:27  Show Profile  Visit Anacrusis's Homepage  Send Anacrusis an AOL message
It's a function in inc_functions.asp
Just open inc_functions.asp and do a search for doNotLoggedInForm

Adam Tommasi
www.inetclubhouse.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07