<% '****************************************************************' ' Food Script .asp version version 4.03062700 ' ' Copyright (C) 1997,1998,1999,2000 Beyond Engineering ' ' All Rights Reserved ' ' Resale and distribution strictly prohibited ' ' Note: Users of this script must have a purchase agreement on ' ' file with Beyond Engineering. ' ' Food Script is a trademark of Beyond Engineering ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' SETUP ' ' You will need to modify this section to fit your settings ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'SPECIFY THE DIRECTORY THAT THE TEMPLATE FILES ARE AT ' 'You will need the trailing "\" ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' TemplatePath = "E:\Inetpub\wwwroot\vspace\IPFood\" IPpath = "E:\Inetpub\wwwroot\vspace\IPSFile\" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'PAGE ASSIGNMENTS. THESE FILES MUST BE IN THE PATH INDICATED ' 'PREVIOUSLY BY 'TemplatePath' ABOVE. ' '************************* NOTE *****************************' 'IF A PAGE ASSIGNMENT IS A WEB ADDRESS STARTING WITH "HTTP:" ' 'THEN THE SCRIPT WILL PERFORM A REDIRECT INSTEAD ' 'YOU WOULD USE THIS FEATURE IF YOU WANTED TO REDIRECT NORMAL ' 'BROWSERS TO AN ASP PAGE FOR PROCESSING. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Normal_Page = "http://www.vspace.com/home.html" Generic_Page = "http://www.vspace.com/home.html" Engine1_Page = "hotel_furniture_1.html" Engine2_Page = "hotel_furniture_2.html" Engine3_Page = "hotel_furniture_3.html" Engine4_Page = "hotel_furniture_4.html" Engine5_Page = "hotel_furniture_5.html" Engine6_Page = "hotel_furniture_6.html" Engine7_Page = "hotel_furniture_7.html" Engine8_Page = "hotel_furniture_8.html" Engine9_Page = "hotel_furniture_9.html" IPFile= "ips-asp.txt" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'DETERMINE IF YOU WANT TO ACTIVATE BROWSER DETECTION OR NOT ' 'DetectBrowsers = FALSE 'Do not detect browsers (For Testing)' 'DetectBrowsers = TRUE 'Detect Browsers (When Live) ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' DetectBrowsers = FALSE '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' END SETUP ' ' You will not need to change anything beyond this point. ' '****************************************************************' '****************************************************************' ' ' ' MAIN PROGRAM - DO NOT MODIFY! ' ' ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' SET fso = CreateObject("Scripting.FileSystemObject") GoOn = TRUE IF NOT DetectBrowsers THEN '# bypass browser checking '# assign generic FoodFile just IN case FoodFile = generic_page ELSEIF LEN(TRIM(Request.ServerVariables("HTTP_REFERER"))) > 0 THEN check_engine=99 redirect() GoOn = FALSE ELSEIF LEN(TRIM(Request.ServerVariables("HTTP_VIA")&Request.ServerVariables("HTTP_REFERER"))) > 0 THEN '# this is definitely NOT a search engine robot - proxy check check_engine=99 redirect() GoOn = FALSE ELSEIF InStr(UCase(Request.ServerVariables("HTTP_CONNECTION")),"ALIVE") > 0 and NOT InStr(Request.ServerVariables("HTTP_FROM"),"@") > 0 THEN '# this is NOT search engine robot - check FOR Ultraseek spoof check_engine=99 redirect() GoOn = FALSE ELSEIF InStr(UCase(Request.ServerVariables("HTTP_PRAGMA")),"NO-CACHE") > 0 and NOT InStr(Request.ServerVariables("HTTP_FROM"),"@") > 0 THEN '# this is NOT search engine robot - check FOR Ultraseek spoof check_engine=99 redirect() GoOn = FALSE '# added to check for go translator ELSEIF InStr(UCase(Request.ServerVariables("HTTP_RANGE")),"BYTES") > 0 THEN '# this is NOT search engine robot - check FOR Ultraseek spoof check_engine=99 redirect() GoOn = FALSE '# end go translator check ELSE '# assign generic FoodFile just IN case FoodFile=generic_page END IF IF GoOn THEN IF fso.FileExists(IPpath & IPFile) THEN SET ReadIPFile = fso.OpenTextFile(IPpath & IPFile,1,0) DIM engines REDIM engines(0) count = 0 DO UNTIL ReadIPFile.AtENDOfStream engines(count) = ReadIPFile.Readline count = count + 1 REDIM Preserve engines(count) LOOP 'Add Custom IP HERE engines(count) = "google_ips:216.199.191.114" count = count + 1 REDIM Preserve engines(count) ReadIPFile.Close check_url() redirect() ELSE msg = "

Cannot open file for reading!


" Response.Write(msg) END IF END IF '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' END MAIN PROGRAM ' ' ' '****************************************************************' '****************************************************************' ' ' ' FUNCTIONS ' ' ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' SUB check_url IF LEN(Trim(Request.ServerVariables("REMOTE_ADDR"))) > 0 THEN FOR EACH member IN engines IF LEN(TRIM(member)) > 0 THEN 'DETERMINE IF IP ADDRESS IN FILE IS SPECIFIC OR A RANGE TEMP = TRIM(MID(member,InStrRev(member,":")+1)) 'GRAB THE REMOTE_ADDR RemAddr = Request.ServerVariables("REMOTE_ADDR") 'IF THERE'S A WILDCARD If InStr(Temp,"*")>0 then 'THEN GRAB THE PART BEFORE THE WILDCARD Temp = Left(Temp, InStr(Temp,"*")-1) 'AND ONLY COMPARE THE PARTIAL ADDRESS RemAddr = LEFT(RemAddr,LEN(TEMP)) End If if RemAddr = Temp Then check_engine = 1 IF InStr(member,"altavista")>0 THEN FoodFile=Engine1_Page ELSEIF InStr(member,"hotbot")>0 THEN FoodFile=Engine2_Page ELSEIF InStr(member,"infoseek")>0 THEN FoodFile=Engine3_Page ELSEIF InStr(member,"excite")>0 THEN FoodFile=Engine4_Page ELSEIF InStr(member,"lycos")>0 THEN FoodFile=Engine5_Page ELSEIF InStr(member,"nlsearch")>0 THEN FoodFile=Engine6_Page ELSEIF InStr(member,"directhit")>0 THEN FoodFile=Engine7_Page ELSEIF InStr(member,"google")>0 THEN FoodFile=Engine8_Page ELSEIF InStr(member,"fast")>0 THEN FoodFile=Engine9_Page ELSEIF InStr(member,"normal")>0 THEN FoodFile=normal_page ELSE FoodFile=generic_page END IF END IF END IF NEXT ELSE check_engine = 1 '# generic FoodFile is already assigned, but... FoodFile = generic_page END IF IF lcase(LEFT(foodfile,5))<>"http:" AND NOT (fso.FileExists(TemplatePath & FoodFile)) THEN FoodFile = normal_page END IF END SUB SUB redirect IF check_engine = 99 THEN FoodFile = normal_page END IF IF lcase(LEFT(foodfile,5))="http:" THEN Response.Write("") ELSE IF (fso.FileExists(TemplatePath & FoodFile)) THEN SET FoodFile = fso.OpenTextFile(TemplatePath & FoodFile,1,0) response.Write(FoodFile.ReadAll) FoodFile.Close ELSE msg = "
" & TemplatePath & FoodFile & " Doesn't exist." Response.Write(msg) END IF END IF END SUB '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' END FUNCTIONS ' ' ' '****************************************************************' %>