Who's reading Topic ?

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/69839?pagenum=1
05 November 2025, 00:07

Topic


Webbo
Who's reading Topic ?
20 February 2011, 07:26


Is there a mod available that shows which users are reading a topic?
I've seen it on some php forums such as:

2 User(s) are reading this topic
2 members, 0 guests, 0 anonymous users
webbo,Carefree


I've searched but can't find one

 

Replies ...


HuwR
20 February 2011, 10:05


I think that is available as part of the active users mod, but not 100% certain
Carefree
20 February 2011, 11:14


Not currently a part of Active Users, but that'd be where to start.
kyodai
20 February 2011, 11:36


Hmmm, i thought about it and the most reasonable way to make it would probably be storing each view with the member ID, a timestamp and the topicID in a seperate table. Then do a simple timestamp based query like in my "Most viewed of the past 7 days" thingies. However i think it would produce quite a bit of additional DB traffic and space. YOu'd need to purge the list by timestamp at least once a day for a very active forum unless you plan spending much space on that table.
Carefree
20 February 2011, 18:43


Way too much burden that way. I don't know if I'd even implement it, even if limited to a single call when you start reading a topic. I can see a single call upon entering a forum and displaying which members were in there, but nothing further.
AnonJr
21 February 2011, 10:57


There is a MOD out there, but it's been ages since I last stumbled across it.
If you were planning on reverse-engineering the MOD, instead of storing the data in the database, you might want to look at using something like application variables or some other similar option (can't think of exactly what, still a little fuzzy after last week's bout with the flu).
Carefree
04 March 2011, 16:02


If you still want it at topic level, here's what you do:

Prerequisite: install active users mod

"topic.asp"

Code:

Look for the following lines (appx 739-745):

Response.Write "<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td>" & vbNewLine & _
" <table width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center"" valign=""top"" width=""50%"">" & vbNewLine
Call PostingOptions()


Above them, insert the following:


strSql = "SELECT AU_LASTPAGE, AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID =" & MemberID
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
strCurrentPage = rs("AU_LASTPAGE")
strQuery = rs("AU_QUERYSTRING")
rs.Close
end if
set rs=Nothing
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '1' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
Set rs=my_Conn.Execute(strSql)
if not (rs.BOF or rs.EOF) then
rs.MoveFirst
strName = rs("M_NAME")
Response.Write "<table align=""center"" border=""1"" cellPadding=""3"" cellspacing=""0"" width=""95%"">" & vbNewLine & _
" <tr vAlign=""middle"">" & vbNewLine & _
" <td align=""left"" width=""100%"">" & vbNewLine & _
" <font face="""& strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>Users viewing this topic: "& rs("M_NAME")
Do While NOT rs.EOF
if rs("M_NAME") <> strName then
Response.Write ", " & rs("M_NAME")
end if
rs.MoveNext
Loop
Response.Write " </td></tr></table>" & vbNewLine
End if
Webbo
04 March 2011, 18:00


Excellent Craig [^]
I bet you can't get it to show the 'Guests' count as well reading the topic wink
Carefree
04 March 2011, 18:06


lol - How much? Replace the inserted lines above with these:

Code:

	strSql = "SELECT AU_LASTPAGE, AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID =" & MemberID
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
strCurrentPage = rs("AU_LASTPAGE")
strQuery = rs("AU_QUERYSTRING")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTG FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID=-1 AND AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intGuests = rs("INTG")
rs.Close
end if
set rs=Nothing
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '1' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
Set rs=my_Conn.Execute(strSql)
if not (rs.BOF or rs.EOF) then
rs.MoveFirst
strName = rs("M_NAME")
Response.Write "<table align=""center"" border=""1"" cellPadding=""3"" cellspacing=""0"" width=""95%"">" & vbNewLine & _
" <tr vAlign=""middle"">" & vbNewLine & _
" <td align=""left"" width=""100%"">" & vbNewLine & _
" <font face="""& strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>Users viewing this topic: "& rs("M_NAME")
Do While NOT rs.EOF
if rs("M_NAME") <> strName then
Response.Write ", " & rs("M_NAME")
end if
rs.MoveNext
Loop
if intGuests > 0 then
Response.Write ", " & intGuests & " guest."
elseif intGuests > 1 then
Response.Write ", " & intGuests & " guests."
end if
Response.Write " </td></tr></table>" & vbNewLine
End if
Webbo
04 March 2011, 18:08


$20 to Snitz if you can match IP Boards ....
xyz User(s) are reading this topic
x members, y guests, z anonymous users

bigsmile
Carefree
04 March 2011, 18:52


Originally posted by Webbo
$20 to Snitz if you can match IP Boards ....
xyz User(s) are reading this topic
x members, y guests, z anonymous users

bigsmile

Did you want the quantity of members or their names?
Here's with user names:
Code:

	strSql = "SELECT AU_LASTPAGE, AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID =" & MemberID
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
strCurrentPage = rs("AU_LASTPAGE")
strQuery = rs("AU_QUERYSTRING")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTA FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intViewers = rs("INTA")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTG FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID=-1 AND AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intGuests = rs("INTG")
rs.Close
end if
set rs=Nothing
strSql = "SELECT ME.MEMBER_ID, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '0' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
set rs = my_Conn.Execute(strSql)
if not rs.EOF then
rs.MoveFirst
intAnon=0
Do while not rs.EOF
intAnon=intAnon+1
rs.MoveNext
Loop
rs.Close
end if
set rs=Nothing
Response.Write "<table align=""center"" border=""1"" cellPadding=""3"" cellspacing=""0"" width=""95%"">" & vbNewLine & _
" <tr vAlign=""middle"">" & vbNewLine & _
" <td align=""left"" width=""100%"">" & vbNewLine & _
" <font face="""& strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & intViewers & " user(s) viewing this topic: "
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '1' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
Set rs=my_Conn.Execute(strSql)
if not (rs.BOF or rs.EOF) then
rs.MoveFirst
Do While NOT rs.EOF
Response.Write rs("M_NAME") & ", "
rs.MoveNext
Loop
End if
Response.Write cInt(intAnon) & " anonymous, " & intGuests & " guest(s)</td></tr></table>" & vbNewLine

Here's with just numbers:

Code:

	strSql = "SELECT AU_LASTPAGE, AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID =" & MemberID
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
strCurrentPage = rs("AU_LASTPAGE")
strQuery = rs("AU_QUERYSTRING")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTA FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intViewers = rs("INTA")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTG FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID=-1 AND AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intGuests = rs("INTG")
rs.Close
end if
set rs=Nothing
strSql = "SELECT ME.MEMBER_ID, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '0' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
set rs = my_Conn.Execute(strSql)
if not rs.EOF then
rs.MoveFirst
intAnon=0
Do while not rs.EOF
intAnon=intAnon+1
rs.MoveNext
Loop
rs.Close
end if
set rs=Nothing
Response.Write "<table align=""center"" border=""1"" cellPadding=""3"" cellspacing=""0"" width=""95%"">" & vbNewLine & _
" <tr vAlign=""middle"">" & vbNewLine & _
" <td align=""left"" width=""100%"">" & vbNewLine & _
" <font face="""& strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & intViewers & " user(s) viewing this topic: "
Response.Write cInt(intAnon) & " anonymous, " & intGuests & " guest(s)</td></tr></table>" & vbNewLine
Webbo
05 March 2011, 02:38


That's just showing off bigsmile

Donation made:

Paypal
You just made a payment of$20.00
Paid to
richard(a)forum.snitz.com
Transaction ID for this payment is: 6J247917K3235731P.

Keep up the good work [^]
Carefree
05 March 2011, 12:00


Thanks for the support, Webbo. Glad I could help.
Webbo
05 March 2011, 18:33


It's a pleasure working with you Craig [^]
Here's my play on the above (with user names)


Find the 4th instance of: if maxpages > 1 then
and above it add the following:



_____________________________________________________________________
Code:
if mlev > 0 then
strSql = "SELECT AU_LASTPAGE, AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID =" & MemberID
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
strCurrentPage = rs("AU_LASTPAGE")
strQuery = rs("AU_QUERYSTRING")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTA FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intViewers = rs("INTA")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTG FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID=-1 AND AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intGuests = rs("INTG")
rs.Close
end if
set rs=Nothing
strSql = "SELECT ME.MEMBER_ID, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '0' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
set rs = my_Conn.Execute(strSql)
if not rs.EOF then
rs.MoveFirst
intAnon=0
Do while not rs.EOF
intAnon=intAnon+1
rs.MoveNext
Loop
rs.Close
end if
set rs=Nothing
Response.Write "<table align=""center"" border=""0"" cellPadding=""1"" cellspacing=""0"" width=""95%"">" & vbNewLine & _
" <tr vAlign=""middle"">" & vbNewLine & _
" <td align=""left"" width=""100%"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""4"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """>" & vbNewLine & _
" <font face="""& strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & intViewers & "" & vbNewline
if intViewers = 1 then
Response.Write " user viewing this topic: "
else
Response.Write " users viewing this topic: "
end if
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '1' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
Set rs=my_Conn.Execute(strSql)
if not (rs.BOF or rs.EOF) then
rs.MoveFirst
Do While NOT rs.EOF
Response.Write "<a href=""pop_profile.asp?mode=display&id="&rs("MEMBER_ID") & """>" & rs("M_NAME") &"</a>, "
rs.MoveNext
Loop
end if
if cInt(intAnon) => 1 then
Response.Write " " & cInt(intAnon) & " anonymous "
end if
if intGuests = 1 then
Response.Write ", " & intGuests & " guest "
else if intGuests > 1 then
Response.Write ", " & intGuests & " guests "
end if
end if
Response.Write "</td></tr></table>" & vbNewLine & _
"</td></tr></table><br>" & vbNewLine
end if

_____________________________________________________________________

This will format the wording correctly based upon the counts and present it in a table below the options at the bottom of the topic.
Only one thing left to do to get perfection - a link to the member's profile if the member name is listed..... wink - Added, Thanks Carefree
Carefree
05 March 2011, 22:12


Here's one with profile links. I think having it report 0 for anon & guests looks ok. Better that than membername, (and nothing after).
Code:

	strSql = "SELECT AU_LASTPAGE, AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID =" & MemberID
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
strCurrentPage = rs("AU_LASTPAGE")
strQuery = rs("AU_QUERYSTRING")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTA FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intViewers = rs("INTA")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTG FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID=-1 AND AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intGuests = rs("INTG")
rs.Close
end if
set rs=Nothing
strSql = "SELECT ME.MEMBER_ID, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '0' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
set rs = my_Conn.Execute(strSql)
if not rs.EOF then
rs.MoveFirst
intAnon=0
Do while not rs.EOF
intAnon=intAnon+1
rs.MoveNext
Loop
rs.Close
end if
set rs=Nothing
if intViewers = 0 or intViewers > 1 then strViewers= "s"
Response.Write "<table align=""center"" border=""1"" cellPadding=""3"" cellspacing=""0"" width=""95%"">" & vbNewLine & _
" <tr vAlign=""middle"">" & vbNewLine & _
" <td align=""left"" width=""100%"">" & vbNewLine & _
" <font face="""& strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & intViewers & " user"&strViewers&" viewing this topic: "
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '1' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
Set rs=my_Conn.Execute(strSql)
if not (rs.BOF or rs.EOF) then
rs.MoveFirst
Do While NOT rs.EOF
Response.Write "<a href=""pop_profile.asp?mode=display&id="&rs("MEMBER_ID") & """>" & rs("M_NAME") &"</a>, "
rs.MoveNext
Loop
End if
if intGuests = 0 or intGuests>1 then strGuests="s"
Response.Write cInt(intAnon) & " anonymous, " & intGuests & " guest"& strGuests &"</td></tr></table>" & vbNewLine
Webbo
06 March 2011, 03:35


Profile links works well smile
I've amended my code above. Personally I prefer it without displaying 0 anon and 0 guests but there's two options of the same theme to chose from [^]
Do you want to package it and add it to SnitzBitz Craig ?
Webbo
06 March 2011, 04:13


smile Too much time on my hands this morning smile
I've just added an 'Opt out' link so that members can remove themselves from the Active Users (basically a link to their edit profile where they will find the option to 'show on Active Users:'



Code:
if mlev > 0 then
strSql = "SELECT AU_LASTPAGE, AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID =" & MemberID
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
strCurrentPage = rs("AU_LASTPAGE")
strQuery = rs("AU_QUERYSTRING")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTA FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intViewers = rs("INTA")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTG FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID=-1 AND AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intGuests = rs("INTG")
rs.Close
end if
set rs=Nothing
strSql = "SELECT ME.MEMBER_ID, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '0' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
set rs = my_Conn.Execute(strSql)
if not rs.EOF then
rs.MoveFirst
intAnon=0
Do while not rs.EOF
intAnon=intAnon+1
rs.MoveNext
Loop
rs.Close
end if
set rs=Nothing
Response.Write "<table align=""center"" border=""0"" cellPadding=""1"" cellspacing=""0"" width=""95%"">" & vbNewLine & _
" <tr vAlign=""middle"">" & vbNewLine & _
" <td align=""left"" width=""100%"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""4"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """>" & vbNewLine & _
" <font face="""& strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & intViewers & "" & vbNewline
if intViewers = 1 then
Response.Write " user viewing this topic: "
else
Response.Write " users viewing this topic: "
end if
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '1' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
Set rs=my_Conn.Execute(strSql)
if not (rs.BOF or rs.EOF) then
rs.MoveFirst
Do While NOT rs.EOF
Response.Write "<a href=""pop_profile.asp?mode=display&id="&rs("MEMBER_ID") & """>" & rs("M_NAME") &"</a>, "
rs.MoveNext
Loop
end if
if cInt(intAnon) => 1 then
Response.Write " " & cInt(intAnon) & " anonymous "
end if
if intGuests = 1 then
Response.Write ", " & intGuests & " guest "
else if intGuests > 1 then
Response.Write ", " & intGuests & " guests "
end if
end if
Response.Write "<td align=""right"" bgcolor=""" & strForumCellColor & """>" & vbNewLine & _
"<font face="""& strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strFooterFontSize & """>" & vbNewline
if strUseExtendedProfile then
Response.Write " <a href=""pop_profile.asp?mode=Edit""" & dWStatus("Remove name from Active Users...") & " tabindex=""-1""><acronym title=""Remove name from Active Users..."">Opt out</acronym></a>" & vbNewline
else
Response.Write " <a href=""javascript:openWindow3('pop_profile.asp?mode=Edit')""" & dWStatus("Remove name from Active Users...") & " tabindex=""-1""><acronym title=""Remove name from Active Users..."">Opt out</acronym></a>" & vbNewline
end if
Response.Write "</tr>" & vbNewline
Response.Write "</td></tr></table>" & vbNewLine & _
"</td></tr></table><br>" & vbNewLine
end if



Or using the icon_group.gif instead of a text link (personally i prefer this as looks tidier....)

Code:
if mlev > 0 then
strSql = "SELECT AU_LASTPAGE, AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID =" & MemberID
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
strCurrentPage = rs("AU_LASTPAGE")
strQuery = rs("AU_QUERYSTRING")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTA FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intViewers = rs("INTA")
rs.Close
end if
set rs=Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS INTG FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID=-1 AND AU_LASTPAGE = '" & strCurrentPage & "' AND AU_QUERYSTRING='" & strQuery & "'"
set rs=my_Conn.Execute(strSql)
if not rs.EOF then
intGuests = rs("INTG")
rs.Close
end if
set rs=Nothing
strSql = "SELECT ME.MEMBER_ID, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '0' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
set rs = my_Conn.Execute(strSql)
if not rs.EOF then
rs.MoveFirst
intAnon=0
Do while not rs.EOF
intAnon=intAnon+1
rs.MoveNext
Loop
rs.Close
end if
set rs=Nothing
Response.Write "<table align=""center"" border=""0"" cellPadding=""1"" cellspacing=""0"" width=""95%"">" & vbNewLine & _
" <tr vAlign=""middle"">" & vbNewLine & _
" <td align=""left"" width=""100%"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""4"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """>" & vbNewLine & _
" <font face="""& strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & intViewers & "" & vbNewline
if intViewers = 1 then
Response.Write " user viewing this topic: "
else
Response.Write " users viewing this topic: "
end if
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_AUHIDE, AU.AU_LASTPAGE, AU.AU_QUERYSTRING FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME WHERE ME.M_AUHIDE = '1' AND AU.MEMBER_ID = ME.MEMBER_ID AND AU.AU_LASTPAGE = '" & strCurrentPage & "' AND AU.AU_QUERYSTRING='" & strQuery & "'"
Set rs=my_Conn.Execute(strSql)
if not (rs.BOF or rs.EOF) then
rs.MoveFirst
Do While NOT rs.EOF
Response.Write "<a href=""pop_profile.asp?mode=display&id="&rs("MEMBER_ID") & """>" & rs("M_NAME") &"</a>, "
rs.MoveNext
Loop
end if
if cInt(intAnon) => 1 then
Response.Write " " & cInt(intAnon) & " anonymous "
end if
if intGuests = 1 then
Response.Write ", " & intGuests & " guest "
else if intGuests > 1 then
Response.Write ", " & intGuests & " guests "
end if
end if
Response.Write "<td align=""right"" bgcolor=""" & strForumCellColor & """>" & vbNewLine
if strUseExtendedProfile then
Response.Write " <a href=""pop_profile.asp?mode=Edit"" title=""Remove name from Active Users...""><img src=""icon_group.gif"" border=""0""></a>" & vbNewline
else
Response.Write " <a href=""javascript:openWindow3('pop_profile.asp?mode=Edit')""><title=""Remove name from Active Users...""><img src=""icon_group.gif"" border=""0""></a>" & vbNewline
end if
Response.Write "</tr>" & vbNewline
Response.Write "</td></tr></table>" & vbNewLine & _
"</td></tr></table><br>" & vbNewLine
end if
Carefree
06 March 2011, 04:57


The ability to opt out of Active Users is part of the original package. That's the only way to have "anonymous" users on Snitz.
Webbo
06 March 2011, 05:00


I know but adding the link to the members 'edit profile' will show users that they can opt out as I doubt many will know that the option is already in their profile smile
Carefree
06 March 2011, 06:54


Originally posted by Webbo Do you want to package it and add it to SnitzBitz Craig ?

Done. Get a copy here.
Carefree
06 March 2011, 06:55


Originally posted by Webbo
I know but adding the link to the members 'edit profile' will show users that they can opt out as I doubt many will know that the option is already in their profile smile

I see what you're talking about (putting it in the viewing display). OK, I'll include it. Done. SnitzBitz file is modified.
© 2000-2021 Snitz™ Communications