Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Total Registered Users?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

rs1968ss
New Member

82 Posts

Posted - 12 April 2002 :  09:20:21  Show Profile  Visit rs1968ss's Homepage
I searched but could not find an answer. Is there a way to display the total number of registered users on the forum default page?

http://camaroclubkc.homeip.net/forum/default.asp

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 12 April 2002 :  09:47:22  Show Profile
Try something like this:

set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
strSql ="SELECT " & strTablePrefix & "TOTALS.U_COUNT "
strSql = strSql & " FROM " & strTablePrefix & "TOTALS "
set rs = my_Conn.execute(strSql)
TotalUsers = rs("U_COUNT")
Response.write("Currently " & " " & TotalUsers & " " & " members.")

Go to Top of Page

shahaf
Starting Member

Israel
39 Posts

Posted - 12 April 2002 :  12:57:49  Show Profile
This action shows you the ID of the last member who registered you board, which means - the count of members on your board!
<%= NewMember_Id %>
You can use the code on the kast line (<%= NewMember_Id %>) on non ASP code lines, but on ASP code lines, you shoud use this code:
response.write "There are " & NewMember_Id $ "registered users on the board"

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 April 2002 :  13:09:57  Show Profile  Send ruirib a Yahoo! Message
quote:

This action shows you the ID of the last member who registered you board, which means - the count of members on your board!
<%= NewMember_Id %>
You can use the code on the kast line (<%= NewMember_Id %>) on non ASP code lines, but on ASP code lines, you shoud use this code:
response.write "There are " & NewMember_Id $ "registered users on the board"


This may not be true. If you delete a member the void Id won't be used (at least in some Dbs) when a new member is registered again. So you may get a wrong value with this code.

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 12 April 2002 :  17:50:21  Show Profile
If you turn OFF Detailed statistics, there will be a one line statistic at the top of the default table on the right hand side. It shows the Total # of Registered Users.
Go to Top of Page

rs1968ss
New Member

82 Posts

Posted - 13 April 2002 :  10:25:40  Show Profile  Visit rs1968ss's Homepage
Thanks for the replies. I like the new registerd member info with detailed stats but the total posts and users is nice as well. Any way to combine both?

http://camaroclubkc.homeip.net/forum/default.asp
Go to Top of Page

blackinwhite
Average Member

Turkey
657 Posts

Posted - 13 April 2002 :  12:29:10  Show Profile
ok, use this

	ShowLastHere = (cint(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"))) > 0)

Response.Write "There are <b>" & Posts & "</b> Posts in <b>" & Topics & "</b> Topics in the Forum."


Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 14 April 2002 :  01:26:50  Show Profile  Visit James's Homepage
I have done this on my forum (in my sig). I'll dig into it and extract the code I used (been a while since I changed it) and post it for you.

-
*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 14 April 2002 :  01:41:09  Show Profile  Visit James's Homepage
BTW, there's already a thread on this subject located at http://forum.snitz.com/forum/topic.asp?TOPIC_ID=24462.

-
*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 17 April 2002 :  23:11:00  Show Profile  Visit James's Homepage
Finally got around to looking for it.

Changes are in the file default.asp.

Note that I have several mods installed and the line numbers may be off by a bit.

Around line 615 change the line that reads:


Dim NewMember_Name, NewMember_Id, Member_Count


to read (changes in green):


Dim NewMember_Name, NewMember_Id, Member_Count
, Total_Members


Around line 646 there's code to Get the Active member count. Below this code I added code to Get the Total member count. Added code is in green:


'## Forum_SQL - Get Active membercount from DB
strSql = "SELECT COUNT(MEMBER_ID) AS U_COUNT FROM " & strMemberTablePrefix & "MEMBERS WHERE M_POSTS > 0 AND M_STATUS=1"

Set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn

if not rs.EOF then
Member_Count = rs("U_COUNT")
else
Member_Count = 0
end if

rs.close
set rs = nothing

'## Forum_SQL - Get total membercount from DB - ADDED CODE BEGINS HERE
strSql = "SELECT " & strTablePrefix & "TOTALS.U_COUNT " &_
" FROM " & strTablePrefix & "TOTALS"

Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.open strSql, my_Conn

Total_Members = rs1("U_COUNT")


rs1.Close
set rs1 = nothing

'## END ADDED CODE for total membercount




Around line 828, I changed the lines that read :


Response.Write " <td bgcolor=""" & strForumCellColor & """ colspan=""" & sGetColspan(6,5) &_
""">" & vbNewline & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>There "
if intTopicCount = 1 then
Response.Write "is "
else
Response.Write "are "
end if
Response.Write " currently " & intTopicCount & " "
if intTopicCount = 1 then
Response.Write " topic "
else
Response.Write " topics"
end if
if ActiveTopicCount > 0 then
Response.Write " and " & ActiveTopicCount & " <a href=""active.asp"">active "
if ActiveTopicCount = 1 then
Response.Write "topic"
else
Response.Write "topics"
end if
Response.Write "</a> since you last visited."
elseif blnHiddenForums and (strLastPostDate > Session(strCookieURL & "last_here_date")) and ShowLastHere then
Response.Write " and there are <a href=""active.asp"">active topics</a> since you last visited."
elseif not(ShowLastHere) then
Response.Write "."
else
Response.Write " and no active topics since you last visited."
end if


to read:


Response.Write " <td bgcolor=""" & strForumCellColor & """ colspan=""" & sGetColspan(6,5) &_
""">" & vbNewline & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>There "
if Total_Members = 1 then
Response.Write "is "
else
Response.Write "are "
end if
Response.Write " currently " & Total_Members & " total <a href=""members.asp"">members</a> and " & intTopicCount & " "
if intTopicCount = 1 then
Response.Write " topic "
else
Response.Write " topics"
end if
if ActiveTopicCount > 0 then
Response.Write " with " & ActiveTopicCount & " <a href=""active.asp"">active "
if ActiveTopicCount = 1 then
Response.Write "topic"
else
Response.Write "topics"
end if
Response.Write "</a> since you last visited."
elseif blnHiddenForums and (strLastPostDate > Session(strCookieURL & "last_here_date")) and ShowLastHere then
Response.Write " and there are <a href=""active.asp"">active topics</a> since you last visited."
elseif not(ShowLastHere) then
Response.Write "."
else
Response.Write " and no active topics since you last visited."
end if


I think that a mod-free forum will probably be about line 790 instead of 828 for the above. The changes keep the line that shows the number of members that have posted while adding a total member count and adding a link to the members pages. Sorry it took me so long to get this together for you.

-
*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*


Edited by - James on 17 April 2002 23:17:23
Go to Top of Page

rs1968ss
New Member

82 Posts

Posted - 24 April 2002 :  22:11:21  Show Profile  Visit rs1968ss's Homepage
Thanks! I'll give it a shot.

http://camaroclubkc.homeip.net/forum/default.asp
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07