%
'Connection String:Choose (Remove the ' from the connect string to choose.)
'When Database and scripts in same folder.
ConStr="DRIVER={Microsoft Access Driver (*.mdb)};UID=admin;DBQ=" & server.MapPath(".") & "\forum.mdb"
'Secure /DB Folder in www.ASPwebServer.com hosting. Forum in root. ie. www.yoursite.com
'ConStr="DRIVER={Microsoft Access Driver (*.mdb)};UID=admin;DBQ=" & server.MapPath("../") & "\db\forum.mdb"
'Secure /DB Folder in www.ASPwebServer.com hosting
'with your forum on subfolder, ie. www.yoursite.com/discuss
'ConStr="DRIVER={Microsoft Access Driver (*.mdb)};UID=admin;DBQ=" & server.MapPath("../../") & "\db\forum.mdb"
'When you are hosting on Brinkster.com : change YourSite with your sitename.
'oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\YourSite\db\forum.mdb"))
session("constr")=ConStr
meta=""
''''''''''''''''''''''''''''''''''''''''''''''''''
Set rsc = Server.CreateObject("ADODB.Recordset")
Set con = Server.CreateObject("ADODB.Connection")
strSQL = "SELECT * From config;"
Con.Open ConStr
rsc.Open strSQL, Con,1,2
If NOT rsc.EOF Then
siteEmail=rsc("siteEmail")
sitename=rsc("sitename")
siteurl=rsc("siteurl")
homeurl=rsc("homeurl")
PageSize=int(rsc("PageSize"))
pagebackcol=rsc("pagebackcol")
heading=rsc("heading")
footer=rsc("footer")
banner=rsc("banner")
emailcomponent=rsc("emailcomponent")
catOnStart=rsc("catOnStart")
tableBorder=rsc("tableBorder")
tableWidth=rsc("tableWidth")
tableCellspacing=rsc("tableCellspacing")
tableBordercolor=rsc("tableBordercolor")
tableBgcolor=rsc("tableBgcolor")
menutableBgcolor=rsc("menutableBgcolor")
tableCellpadding=rsc("tableCellpadding")
tableBordercolordark=rsc("tableBordercolordark")
cellbg=rsc("cellbg")
Else
response.redirect "error.asp?message=Unable to find Forum configuration Settings in the Database.."
End If
rsc.close
con.close
Set rsc = Nothing
Set con = Nothing
''''''''''''''''''''''''''''''''''''''''''''''''''
Sub searchbox()%>
<%=heading%>
<%
End sub
If not session("discussionlogin") Then ' try to find cookie
On Error Resume Next
Set oRs2 = Server.CreateObject("ADODB.Recordset")
Set db2 = Server.CreateObject("ADODB.connection")
db2.Open ConStr
mySQL = "Select * from users where uniqueid ='" & Request.Cookies(siteurl)("uid") & "';"
oRs2.Open mySQL , db2, 1,2
If not oRs2.Eof Then login ors2("email"),ors2("password"),"true"
ors2.close
db2.close
Set db2 = nothing
Set oRs2 = Nothing
Else
If siteurl<>session("siteurl") then
session("discussionlogin")=false
session.Abandon
Response.Cookies(siteurl)("uid") = "Logged Out"
Response.Redirect "./"
End If
End If
Function login(email,password,remember)
Set oRs = Server.CreateObject("ADODB.Recordset")
Set db = Server.CreateObject("ADODB.connection")
db.Open ConStr
mySQL = "Select * from users where email ='" & email & "' AND password = '" & password & "';"
oRs.Open mySQL , db, 1,2
If not ors.Eof then
If ors("blocked") Then response.redirect "error.asp?message=" & "You account has been blocked. Please contact the " & sitename & " Admin for more information."
session("discussionlogin") = true
session("username") = ors("name")
session("useremail") = ors("email")
if ors("admin") then
session("userisadmin") = true
end if
ors("lastlogin") = now()
randomize
ors("uniqueid") = cstr(int((100000000 - 1000 + 1) * Rnd + lowerbound))
ors.update
If remember then
Response.Cookies(siteurl)("uid") = ors("uniqueid")
Response.Cookies(siteurl).Expires = Now() + 365
End if
session("siteurl")=siteurl
login = ""
Else
login = "Invalid Login. "
End if
ors.close
db.close
Set db = nothing
Set oRs = Nothing
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' FUNCTION : TO SEND EMAIL USING THE CDONTS COMPONENT.
'
' NAME : SendMail
'
' INPUT : toEmail - Receivers Email.
' subject - Subject of the mail.
' body - Body of mail.
' fromEmail - Senders email addreess.
'
' OUTPUT : 0 Length String, if successful. Otherwise the error message.
'
' ASSUMPTION : CDONTS is installed.
' Copyright www.aspwebserver.com
Function SendMail(toEmail, subject, body, fromEmail)
On Error resume next
Dim smtp
Set smtp = CreateObject("CDONTS.NewMail")
smtp.Send fromEmail, toEmail, subject, body, 1
Set smtp = Nothing ' not allowed to reuse it for another message
If Err.number > 0 then
Set smtp = " ERROR : " &Err.number & " - > " & Err.description
else
SendMail = ""
End If
End Function
Sub loginform()%>