Detecting logged in users.... - نوشته شده در (1139 Views)
Senior Member
bobby131313
مطلب: 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?
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 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.
نوشته شده در
Senior Member
bobby131313
مطلب: 1163
1163
Thanks Rui, I will give it a go this week.
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
Let me know if you have any issues.
نوشته شده در
Senior Member
bobby131313
مطلب: 1163
1163
Well, months and months later I've finally gotten around to testing this and it works like a charm. Thanks Rui. smile
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
 
شما باید یک متن وارد کنید