ASP類型網(wǎng)站結(jié)合動(dòng)網(wǎng)論壇會(huì)員的方法第2/3頁(yè)
更新時(shí)間:2007年11月03日 16:02:21 作者:
2.CheckUserLogin.asp code:
<!--#Include File="bbs/inc/Dv_ClsMain.asp"-->
<%
Function CheckUserLogin()
Dim Dvbbs,UserSession
Const MsxmlVersion=".3.0"
Set Dvbbs = New Cls_Forum
Set UserSession=Server.CreateObject("msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
If UserSession.loadxml(Session(Dvbbs.CacheName & "UserID")&"") Then
If UserSession.documentElement.selectSingleNode("userinfo/@userid").text<>"0" Then
'在論壇登錄成功
CheckUserLogin = True
'下邊是用戶一些信息的獲取方法,可自行將其保存于Cookies或Session中便于使用:
'用戶ID : UserSession.documentElement.selectSingleNode("userinfo/@userid").text
'用戶名 : UserSession.documentElement.selectSingleNode("userinfo/@username").text
'生日 : UserSession.documentElement.selectSingleNode("userinfo/@userbirthday").text
'電子郵箱 : UserSession.documentElement.selectSingleNode("userinfo/@useremail").text
'性別 : UserSession.documentElement.selectSingleNode("userinfo/@usersex").text '0為女,1為男
'注冊(cè)時(shí)間 : UserSession.documentElement.selectSingleNode("userinfo/@joindate").text
'最后登錄 : UserSession.documentElement.selectSingleNode("userinfo/@lastlogin").text
'登錄次數(shù) : UserSession.documentElement.selectSingleNode("userinfo/@userlogins").text
'金錢 : UserSession.documentElement.selectSingleNode("userinfo/@userwealth").text
'積分 : UserSession.documentElement.selectSingleNode("userinfo/@userep").text
'魅力 : UserSession.documentElement.selectSingleNode("userinfo/@usercp").text
'最后登錄IP : UserSession.documentElement.selectSingleNode("userinfo/@userlastip").text
'瀏覽器類型 : UserSession.documentElement.selectSingleNode("agent/@browser").text
'瀏覽器版本 : UserSession.documentElement.selectSingleNode("agent/@version").text
'操作系統(tǒng) : UserSession.documentElement.selectSingleNode("agent/@platform").text
'來(lái)訪IP : UserSession.documentElement.selectSingleNode("agent/@ip").text
'舉例應(yīng)用:
Response.Cookies("username") = UserSession.documentElement.selectSingleNode("userinfo/@username").text
Response.Cookies("joindate") = UserSession.documentElement.selectSingleNode("userinfo/@joindate").text
If UserSession.documentElement.selectSingleNode("userinfo/@usersex").text="0" Then
Response.Cookies("sex") = "靚妹"
Else
Response.Cookies("sex") = "酷哥"
End if
Response.Cookies("lastlogin") = UserSession.documentElement.selectSingleNode("userinfo/@lastlogin").text
Response.Cookies("userlogins") = UserSession.documentElement.selectSingleNode("userinfo/@userlogins").text
Response.Cookies("browser") = UserSession.documentElement.selectSingleNode("agent/@browser").text
Response.Cookies("version") = UserSession.documentElement.selectSingleNode("agent/@version").text
Response.Cookies("platform") = UserSession.documentElement.selectSingleNode("agent/@platform").text
Else
'訪問(wèn)過(guò)論壇尚未登錄,為來(lái)賓狀態(tài)
CheckUserLogin = False
End if
Else
'未訪問(wèn)過(guò)論壇
CheckUserLogin = False
End if
Set UserSession = nothing
Set Dvbbs = nothing
End Function
%>
3.bbs/login.asp新增紅色部分,使在站點(diǎn)首頁(yè)登錄成功后仍能返回首頁(yè):
Dim comeurlname
If instr(lcase(request("comeurl")),"reg.asp")>0 or instr(lcase(request("comeurl")),"login.asp")>0 or trim(request("comeurl"))="" Then
comeurlname=""
comeurl="index.asp"
Else
comeurl=request("comeurl")
comeurlname="<li><a href="&request("comeurl")&">"&request("comeurl")&"</a></li>"
End If
If request("back")="1" Then
Response.Redirect("../index.asp")
End If
Dim TempStr
TempStr = template.html(2)
'If Dvbbs.Forum_ChanSetting(0)=1 And Dvbbs.Forum_ChanSetting(10)=1 And Dvbbs.Forum_ChanSetting(12)=1 Then
' TempStr = Replace(TempStr,"{$ray_logininfo}",template.html(3))
'Else
' TempStr = Replace(TempStr,"{$ray_logininfo}","")
'End If
'-----------------------------------------------------------------
'系統(tǒng)整合
'-----------------------------------------------------------------
If DvApi_Enable Then
Response.Write DvApi_SaveCookie
Response.Flush
End If
'-----------------------------------------------------------------
TempStr = Replace(TempStr,"{$ray_logininfo}","")
TempStr = Replace(TempStr,"{$comeurl}",comeurl)
TempStr = Replace(TempStr,"{$comeurlinfo}",comeurlname)
TempStr = Replace(TempStr,"{$forumname}",Dvbbs.Forum_Info(0))
Response.Write TempStr
TempStr=""
End Function
相關(guān)文章
ASP 相關(guān)文章或者相關(guān)產(chǎn)品
以下僅提供相關(guān)思路和關(guān)鍵代碼,并且只提供一種最簡(jiǎn)單的算法實(shí)現(xiàn),稍復(fù)雜的本文不做介紹。2009-05-05ASP 信息提示函數(shù)并作返回或者轉(zhuǎn)向
這篇文章主要介紹了ASP 信息提示函數(shù)并作返回或者轉(zhuǎn)向,需要的朋友可以參考下2016-12-12asp中向文本框輸出數(shù)據(jù)原樣式的函數(shù)
asp中向文本框輸出數(shù)據(jù)原樣式的函數(shù)...2007-03-03asp提示Server 對(duì)象 錯(cuò)誤 ASP 0178 : 80070005
今天幫客戶配置好服務(wù)器以后測(cè)試程序發(fā)現(xiàn)asp程序提示Server 對(duì)象 錯(cuò)誤 ASP 0178 : 80070005,經(jīng)測(cè)試是因?yàn)闄?quán)限問(wèn)題。2011-11-11利用ASP從遠(yuǎn)程服務(wù)器上接收XML數(shù)據(jù)的方法
利用ASP從遠(yuǎn)程服務(wù)器上接收XML數(shù)據(jù)的方法...2007-01-01