📄 conn.asp
字号:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%
Response.Buffer=True
Server.ScriptTimeout = 90
Session.Timeout = 20
Dim adoCon
Set adoCon = Server.CreateObject("ADODB.Connection")
'--------------------- 设定数据库的名称和路径------------------------------------------
'数据库的虚拟路径
strDbPathAndName = Server.MapPath("admin/database/#TimesBoard.mdb")
'数据库的物理
'strDbPathAndName =( " c:\Inetpub\wwwroot\forum\admin\database\#TimesBoard.mdb")
'Access 2000
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & strDbPathAndName
'Access 2002
'strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDbPathAndName
'--------------------------------------------------------------------------------
Dim strJoindtm
Dim strlastvisit
Dim strNoOfPosts
Dim strtitle
Dim strdtm
Dim strcontent
Dim strsender
Dim strCon
Dim rsConn
Dim strSQL
Dim lngLoggedInUserID
Dim strLoggedInUsername
Dim intGroupID
Dim strWebsiteName
Dim strMainForumName
Dim strForumPath
Dim strForumEmailAddress
Dim blnIEEditor
Dim blnEmail
Dim strMailComponent
Dim strIncomingMailServer
Dim strLoggedInUserCode
Dim blnLCode
Dim blnAdmin
Dim blnModerator
Dim blnGuest
Dim blnActiveMember
Dim blnLoggedInUserEmail
Dim blnLoggedInUserSignature
Dim intTopicPerPage
Dim strTitleImage
Dim blnEmoticons
Dim strDatabaseDateFunction '
Dim blnGuestPost
Dim blnAvatar
Dim blnEmailActivation
Dim blnSendPost
Dim intNumHotViews
Dim intNumHotReplies
Dim blnPrivateMessages
Dim intNumPrivateMessages
Dim intThreadsPerPage
Dim strDbPathAndName
Dim intSpamTimeLimitSeconds
Dim intSpamTimeLimitMinutes
Dim strDateFormat
Dim strTimeOffSet
Dim intTimeOffSet
Dim blnReplyNotify
Dim blnAttachSignature
Dim blnWYsiWYGEditor
Dim intMaxPollChoices
Dim blnEmailMessenger
Dim blnActiveUsers
Dim blnForumClosed
Dim blnShowEditUser
Dim dblStartTime
Dim blnClosedForumPage
Dim blnFlashFiles
Dim strWebsiteURL
Dim blnShowMod
Dim blnAvatarUploadEnabled
Dim blnRegistrationSuspeneded
Dim blnRead
Dim blnPost
Dim blnReply
Dim blnEdit
Dim blnDelete
Dim blnPriority
Dim blnPollCreate
Dim blnVote
Dim blnAttachments
Dim blnImageUpload
Dim intMemberStatus
Const strVersion = "2.0官方正式简体中文版"
intMemberStatus = 0
lngLoggedInUserID = 0
intGroupID = 2
lngLoggedInUserID = 2
intTimeOffSet = 0
strLoggedInUsername = "访客"
blnActiveMember = True
blnLoggedInUserEmail = False
blnLoggedInUserSignature = False
blnAdmin = False
blnModerator = False
blnGuest = True
strTimeOffSet = "+"
blnWYsiWYGEditor = True
strDatabaseDateFunction = "Now()"
adoCon.connectionstring = strCon
adoCon.Open
Set rsConn = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT TOP 1 sitename, bbsname,sitepath, bbspath, mailcomponent, smtpserver, masteremail, lcode, enotify, ieedit, pagetopic, toplogo, Emoticons, Avatar, eactivate, hotview, hotreply, mailpost, privatemess, messnum, pagethread, spamsec, spammin, votechoice, mailsys, validuser, bbsclosed, disedit, Flash, dismod, upphoto, unreg From timescfg;"
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then
strWebsiteName = rsConn("sitename")
strMainForumName = rsConn("bbsname")
strWebsiteURL = rsConn("sitepath")
strForumPath = rsConn("bbspath")
strMailComponent = rsConn("mailcomponent")
strIncomingMailServer = rsConn("smtpserver")
strForumEmailAddress = rsConn("masteremail")
blnLCode = CBool(rsConn("lcode"))
blnEmail = CBool(rsConn("enotify"))
blnIEEditor = CBool(rsConn("ieedit"))
intTopicPerPage = CInt(rsConn("pagetopic"))
strTitleImage = rsConn("toplogo")
blnEmoticons = CBool(rsConn("Emoticons"))
blnAvatar = CBool(rsConn("Avatar"))
blnEmailActivation = CBool(rsConn("eactivate"))
intNumHotViews = CInt(rsConn("hotview"))
intNumHotReplies = CInt(rsConn("hotreply"))
blnSendPost = CBool(rsConn("mailpost"))
blnPrivateMessages = CBool(rsConn("privatemess"))
intNumPrivateMessages = CInt(rsConn("messnum"))
intThreadsPerPage = CInt(rsConn("pagethread"))
intSpamTimeLimitSeconds = CInt(rsConn("spamsec"))
intSpamTimeLimitMinutes = CInt(rsConn("spammin"))
intMaxPollChoices = CInt(rsConn("votechoice"))
blnEmailMessenger = CBool(rsConn("mailsys"))
blnActiveUsers = CBool(rsConn("validuser"))
If blnClosedForumPage = False Then blnForumClosed = CBool(rsConn("bbsclosed"))
blnShowEditUser = CBool(rsConn("disedit"))
blnFlashFiles = CBool(rsConn("Flash"))
blnShowMod = CBool(rsConn("dismod"))
blnAvatarUploadEnabled = CBool(rsConn("upphoto"))
blnRegistrationSuspeneded = CBool(rsConn("unreg"))
End If
rsConn.Close
If blnForumClosed Then
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect("closed.asp")
End If
dblStartTime = Timer()
If Session("dtmLastVisit") = "" AND Request.Cookies("FLVST")("LTVST") <> "" Then
Session("dtmLastVisit") = CDate(Request.Cookies("FLVST")("LTVST"))
Response.Cookies("FLVST")("LTVST") = CDbl(Now())
Response.Cookies("FLVST").Expires = DateAdd("yyyy", 1, Now())
ElseIf Session("dtmLastVisit") = "" Then
Session("dtmLastVisit") = Now()
End If
If isNumeric(Request.Cookies("FLVST")("LTVST")) Then
If CDate(Request.Cookies("FLVST")("LTVST")) < DateAdd("n", -5, Now()) Then
Response.Cookies("FLVST")("LTVST") = CDbl(Now())
Response.Cookies("FLVST").Expires = DateAdd("yyyy", 1, Now())
End If
Else
Response.Cookies("FLVST")("LTVST") = CDbl(Now())
Response.Cookies("FLVST").Expires = DateAdd("yyyy", 1, Now())
End If
strForumPath = Replace(strForumPath, "index.asp", "")
strLoggedInUserCode = Trim(Mid(Request.Cookies("Forum")("UID"), 1, 44))
If strLoggedInUserCode <> "" Then
strLoggedInUserCode = formatSQLInput(strLoggedInUserCode)
strSQL = "SELECT Username, userid, grpid, Active, Signature, useremail, dtfmt, tmset, tmhour, replynotify, attachsign, richedit, lastvst, postnum, lastvst, joindtm FROM timesuser WHERE timesuser.usercode = '" & strLoggedInUserCode & "';"
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then
strLoggedInUsername = rsConn("Username")
intGroupID = rsConn("grpid")
lngLoggedInUserID = CLng(rsConn("userid"))
blnActiveMember = CBool(rsConn("Active"))
strDateFormat = rsConn("dtfmt")
strTimeOffSet = rsConn("tmset")
intTimeOffSet = CInt(rsConn("tmhour"))
blnReplyNotify = CBool(rsConn("replynotify"))
blnAttachSignature = CBool(rsConn("attachsign"))
blnWYSIWYGEditor = CBool(rsConn("richedit"))
strNoOfPosts = rsConn("postnum")
strJoindtm = rsConn("joindtm")
strlastvisit = rsConn("lastvst")
If rsConn("useremail") <> "" Then blnLoggedInUserEmail = True
If rsConn("Signature") <> "" Then blnLoggedInUserSignature = True
If Session("ViRead") = "" Then
If isDate(rsConn("lastvst")) Then Session("dtmLastVisit") = CDate(rsConn("lastvst"))
Session("ViRead") = True
End If
If isDate(rsConn("lastvst")) Then
If CDate(rsConn("lastvst")) < DateAdd("n", -5, Now()) Then
strSQL = "UPDATE timesuser SET timesuser.lastvst = Now() WHERE timesuser.userid=" & lngLoggedInUserID & ";"
adoCon.Execute(strSQL)
End If
Else
strSQL = "UPDATE timesuser SET timesuser.lastvst=Now() WHERE timesuser.userid=" & lngLoggedInUserID & ";"
adoCon.Execute(strSQL)
End If
If blnActiveMember = False Then intGroupID = 2
blnGuest = False
End If
rsConn.Close
End If
If lngLoggedInUserID = 1 Then
intGroupID = 1
blnActiveMember = True
End If
If intGroupID = 1 Then blnAdmin = True
If blnActiveUsers Then
%>
<!--#include file="includes/onlineusers.asp" --><%
End If
%>
<!--#include file="functions/common.asp" -->
<!--#include file="functions/filters.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -