Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Who's reading Topic ?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Webbo Posted - 20 February 2011 : 07:26:07
Is there a mod available that shows which users are reading a topic?

I've seen it on some php forums such as:

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



I've searched but can't find one
15   L A T E S T    R E P L I E S    (Newest First)
Carefree Posted - 06 March 2011 : 06:55:46
quote:
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



I see what you're talking about (putting it in the viewing display). OK, I'll include it. Done. SnitzBitz file is modified.
Carefree Posted - 06 March 2011 : 06:54:13
quote:
Originally posted by Webbo
Do you want to package it and add it to SnitzBitz Craig ?



Done. Get a copy here.
Webbo Posted - 06 March 2011 : 05:00:54
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
Carefree Posted - 06 March 2011 : 04:57:19
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 Posted - 06 March 2011 : 04:13:24
Too much time on my hands this morning

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:'



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....)

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
Webbo Posted - 06 March 2011 : 03:35:58
Profile links works well

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 ?

Carefree Posted - 05 March 2011 : 22:12:33
Here's one with profile links. I think having it report 0 for anon & guests looks ok. Better that than membername, (and nothing after).


	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 Posted - 05 March 2011 : 18:33:53
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:



_____________________________________________________________________


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..... - Added, Thanks Carefree
Carefree Posted - 05 March 2011 : 12:00:29
Thanks for the support, Webbo. Glad I could help.
Webbo Posted - 05 March 2011 : 02:38:37
That's just showing off


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 Posted - 04 March 2011 : 18:52:00
quote:
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





Did you want the quantity of members or their names?

Here's with user names:

	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:


	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 Posted - 04 March 2011 : 18:08:58
$20 to Snitz if you can match IP Boards ....

xyz User(s) are reading this topic
x members, y guests, z anonymous users

Carefree Posted - 04 March 2011 : 18:06:40
lol - How much? Replace the inserted lines above with these:


	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 Posted - 04 March 2011 : 18:00:34
Excellent Craig

I bet you can't get it to show the 'Guests' count as well reading the topic
Carefree Posted - 04 March 2011 : 16:02:11
If you still want it at topic level, here's what you do:

Prerequisite: install active users mod

"topic.asp"


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


Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07