code:
<!--#Include File="bbs/inc/Dv_ClsMain.asp"-->
<%
Function CheckUserLogin()
Dim Dvbbs,UserSession
Const MsxmlVersion=".3.0"
Set Dvbbs = New Cls_Forum
Set UserSession=(""& MsxmlVersion)
If (Session( & "UserID")&"") Then
If ("userinfo/@userid").text<>"0" Then
'Login successfully in the forum
CheckUserLogin = True
'The following is a way to obtain some information from users, which can be saved in cookies or sessions for easy use:
'User ID : ("userinfo/@userid").text
'Username : ("userinfo/@username").text
'Birthday : ("userinfo/@userbirthday").text
'Email : ("userinfo/@useremail").text
'Gender : ("userinfo/@usersex").text '0 is female, 1 is male
'Register time ("userinfo/@joindate").text
'Last login ("userinfo/@lastlogin").text
'Logins': ("userinfo/@userlogins").text
'Money : ("userinfo/@userwealth").text
'Points : ("userinfo/@userep").text
'Character : ("userinfo/@usercp").text
'Last login IP: ("userinfo/@userlastip").text
'Browser type: ("agent/@browser").text
'Browser version : ("agent/@version").text
'Operating system : ("agent/@platform").text
'Visiting IP : ("agent/@ip").text
'Example application:
("username") = ("userinfo/@username").text
("joindate") = ("userinfo/@joindate").text
If ("userinfo/@usersex").text="0" Then
("sex") = "Beautiful Girl"
Else
("sex") = "Cool Brother"
End if
("lastlogin") = ("userinfo/@lastlogin").text
("userlogins") = ("userinfo/@userlogins").text
("browser") = ("agent/@browser").text
("version") = ("agent/@version").text
("platform") = ("agent/@platform").text
Else
'I have visited the forum and have not been logged in yet, so I am the guest status
CheckUserLogin = False
End if
Else
'Not visited the forum
CheckUserLogin = False
End if
Set UserSession = nothing
Set Dvbbs = nothing
End Function
%>
/Added a red part so that you can still return to the homepage after logging in successfully on the homepage of the site:
Dim comeurlname
If instr(lcase(request("comeurl")),"")>0 or instr(lcase(request("comeurl")),"")>0 or trim(request("comeurl"))="" Then
comeurlname=""
comeurl=""
Else
comeurl=request("comeurl")
comeurlname="<li><a href="&request("comeurl")&">"&request("comeurl")&"</a></li>"
End If
If request("back")="1" Then
("../")
End If
Dim TempStr
TempStr = (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}",(3))
'Else
' TempStr = Replace(TempStr,"{$ray_logininfo}","")
'End If
'-----------------------------------------------------------------
'System integration
'-----------------------------------------------------------------
If DvApi_Enable Then
DvApi_SaveCookie
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))
TempStr
TempStr=""
End Function
Previous page123Next pageRead the full text