Detecting logged in users.... - Posted (1138 Views)
Senior Member
bobby131313
Posts: 1163
1163
Has anyone ever put together a "bare minimum" file that could be included on non-forum pages just to detect if the visitor is a logged in forum member? Just enough to check mlev I suppose?
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
I use this in a real website:

Code:

<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_func_common.asp"-->


'Get the MemberID from the forum login

set my_Conn = Server.CreateObject("ADODB.Connection")

my_Conn.Open strConnString


'copying stuff from inc_header.asp...
strDBNTUserName = Request.Cookies(strUniqueID & "User")("Name")

if trim(strDBNTUserName) <> "" and trim(Request.Cookies(strUniqueID & "User")("Pword")) <> "" then
mLev = cLng(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"),-1))
else
MemberID = -1
mLev = 0
end If

my_conn.Close
Set my_conn = Nothing

You will need cookies set to forum for this to work. You may also have to add the forum path to the includes.
Posted
Senior Member
bobby131313
Posts: 1163
1163
Thanks Rui, I will give it a go this week.
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
Let me know if you have any issues.
Posted
Senior Member
bobby131313
Posts: 1163
1163
Well, months and months later I've finally gotten around to testing this and it works like a charm. Thanks Rui. smile
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
 
You Must enter a message