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)
 Forum/Site - Gatekeeper
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

blink_26
Starting Member

3 Posts

Posted - 21 November 2002 :  16:06:26  Show Profile
Lately my site has become pretty popular, and I find more and more people are linking directly to the fourm..... http:\\www.xyzsite.com\fourm

I enjoy using the forum using the forum as a community meeting place..... but I put a lot of time into the actual site. With people linking directly to the fourm, they bypass all of that and any new changes I spend my time developing.

I couldn't find anything to use, so I wrote a little script.... not sure if there's anything else floating around, but I couldn't find it.

Basicly it looks at where the person has come from..... if they haven't been to the main part of the site yet... it redirects then to the homepage.


So here it is.....


This is a file called "inc_gatekeeper.asp"
----------------------------------------------------------
<%
'**************************************************************
'Gatekeeper V1.0 11/20/02
'Written By Jeremy Mann
'**************************************************************
dim referrer,validreferrer,indexfilelocation
' ---------------- CONFIGURE FOR YOU SITE ------------------
'///////////////////DO Not Write "http:// and use lower case names" /////////////////////
dim validprefixes(3)
validprefixes(0) = "xyzsite.com" 'address of your website without www
validprefixes(1) = "www.xyzsite.com" ' www address of your website.
validprefixes(2) = "111.22.333.444" ' IP address for your website
indexfilelocation = "../index.htm" ' This is the location of the hompage file that you wish to redirect to

' //////////////////// DO NOT MODIFY ANYTHING AFTER THIS LINE ////////////////////
validprefixes(3) = "127.0.0.1" ' This is for Development on a local machine, and only works on localmachine

referrer = Request.ServerVariables("HTTP_REFERER")
Referingsite = LCase(left(referrer,InStr(8,referrer,"/")))

validreferrer = 0
For i = 0 to 3
If ("http://"& LCase(validprefixes(i)) &"/" = Referingsite) THEN
validreferrer = 1
END IF
Next

IF validreferrer = 0 THEN
Response.Redirect (indexfilelocation)
END IF
%>

Save file to the main forum directory and edit the values/IP for your site.....

Next on any page you want protected place:
<!--#INCLUDE FILE="inc_gatekeeper.asp"-->

just below
<!--#INCLUDE FILE="config.asp"-->

So it looks like this:
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_gatekeeper.asp"-->

Thats It !!!!

(If you place in config.asp it will protect the whole site but blocks forum popups such as "file uploads" , smile list popups... ect)

Edited by - blink_26 on 21 November 2002 16:45:48

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 21 November 2002 :  18:50:25  Show Profile  Visit MaD2ko0l's Homepage
ok so if i put this code in config.asp it would reject all popup pages. so all that u have to do if u want to protect the main pages all u do is add it to inc_header do not add it to inc_header_short.

usually anythign that pops up in a new window is small and is basicly useless to an user unless u r the admin.

am i right when i sY THIS??

© 1999-2010 MaD2ko0l
Go to Top of Page

jeffery
Junior Member

USA
176 Posts

Posted - 22 November 2002 :  14:20:08  Show Profile
Hey blink, when I enable this mod I cannot get into and other page on my site at all. It's seems to continuously reload my first page. Im using serverhackers portal so it's sitenews.asp. I'm using a free subdomain name and doesn't start with a www. In the section configurable I just left out my subdomain prefix - other than the www. Could this be the problem?

www.thomasforum.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.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07