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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Forum Counts
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

rnhstn
Starting Member

36 Posts

Posted - 14 June 2009 :  08:07:21  Show Profile  Visit rnhstn's Homepage
Can someone provide me with a list of all of the various counts that are maintained in the Forum and there respective column name(s) in the DB?

Thanks

Etymon
Advanced Member

United States
2391 Posts

Posted - 14 June 2009 :  14:29:29  Show Profile  Visit Etymon's Homepage
Not all things that are counted in the forum are stored in the database that I can recall anyway. For instance, topic paging, forum paging, and search paging all require counting to determine the amount of pages to display, but only the amount of items allowed to be displayed per page is stored in the database such as within the variable strPageSize.

A count can be initiated through an array, a loop, or some other looping kind of code, and it can also be initiated through a SELECT statement.

If you do a text search through your files using a text editor like TextPad, then you can find all of the situations where something is counted within a SELECT statement that also uses the word COUNT by looking within the SELECT statements for SELECT COUNT. However, the forum also uses SELECT SUM, and perhaps some other SELECT configurations. You will also find counting in UPDATE statements such as is in topic.asp here: SET T_VIEW_COUNT = (T_VIEW_COUNT + 1).

If you want to see where something is counted through a loop then do a search for the + (addition) or the - (subtraction) symbols and hold on to your seat because those symbols are used for more things than counting whole numbers such as for cursor settings or to display negative numbers.

You're question is not easy to answer with a cut and dry approach, so you will have to sort through what you are looking to obtain and narrow in on those aspects of your purpose.

Edited by - Etymon on 14 June 2009 14:31:56
Go to Top of Page

rnhstn
Starting Member

36 Posts

Posted - 15 June 2009 :  07:29:31  Show Profile  Visit rnhstn's Homepage
Thanks for the explanation Etymon.
What I am wanting to count are the number of members that have accessed the Forum per month, as well as how many times each member has accessed the Forum.
Go to Top of Page

Carefree
Advanced Member

Philippines
4210 Posts

Posted - 15 June 2009 :  09:06:27  Show Profile
The first count is easy, the second will require an additional field in the members' table.

To get your first count (total per month), you could do something like this:


<%
strSql="SELECT COUNT(MEMBER_ID) AS CNT FROM " & strMemberTablePrefix & "MEMBERS WHERE M_LASTHEREDATE > '" & DateToStr(DateAdd("m",-1,strForumTimeAdjust)) & "'"
set rsVisitors=my_Conn.Execute(strSql)
if not rsVisitors.EOF then
	intMLM=rsVisitors("CNT")
	Response.Write	"The forum had " & intMLM & " visitors during the last month."
	rsVisitors.Close
else
	Response.Write	"No visitors in last month."
end if
set rsVisitors=Nothing
%>


How do you want to use the visits per member/per month information? Do you want to be able to look it up as Admin, you want to display the top 10, or what? The approach on how to write it will depend on what you need it to do.

Edited by - Carefree on 15 June 2009 09:11:25
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 15 June 2009 :  13:10:35  Show Profile  Visit AnonJr's Homepage
Are you hosting this yourself or are you using a hosting provider? I ask only because if this is more for reference than display, you may get a better picture by looking into the logfiles. Some hosts provide a service for you, if you're hosting it yourself (or you've got a host that will let you) you can use a number of analysis tools to get a look at what's going on.

As Carefree asked, what you want to do will help us answer you better.
Go to Top of Page

rnhstn
Starting Member

36 Posts

Posted - 16 June 2009 :  07:41:38  Show Profile  Visit rnhstn's Homepage
You guys are the greatest support for someone like me THANKS.

This is for me to use as the Forum Admin. I have been asked to provide information to our homeowners association about the use of the Forum. So tell me more... and also where do I put the code and execute it?

The Forum is on a hosted web site (Godaddy). So I guess I'll need to contact them and ask them about me being able to search the log files. Are the analysis tools free?

Edited by - rnhstn on 16 June 2009 10:44:28
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 16 June 2009 :  09:16:10  Show Profile  Visit AnonJr's Homepage
There are a lot of free tools floating around. I found (and am currently using) SmarterStats via http://stackoverflow.com/questions/344693/ and a few other questions over there, you might want to brows those questions for some of the other free tools as your requirements are a little different than mine.

Go to Top of Page

Carefree
Advanced Member

Philippines
4210 Posts

Posted - 16 June 2009 :  18:37:35  Show Profile
The code I provided was designed as an "include" - to be incorporated within another page. If you want it as a stand-alone file, we'll need to make a couple of changes.

Save the following as "Visitors.asp":

<%
'###############################################################################
'##
'##         Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-09 Michael Anderson, Pierre Gorissen,
'##         Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output.  The "powered by" text/logo with a
'## link back to http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
'## for more details.
'##
'## You should have received a copy of the GNU General Public License along
'## with this program; if not, write to:
'##
'##         Free Software Foundation, Inc.
'##         59 Temple Place, Suite 330
'##         Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'##         http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'##         manderson@snitz.com
'##
'###############################################################################
%>
<!--#INCLUDE FILE="inc_sha256.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
strSql="SELECT COUNT(MEMBER_ID) AS CNT FROM " & strMemberTablePrefix & "MEMBERS WHERE M_LASTHEREDATE > '" & DateToStr(DateAdd("m",-1,strForumTimeAdjust)) & "'"
set rsVisitors=my_Conn.Execute(strSql)
if not rsVisitors.EOF then
	intMLM=rsVisitors("CNT")
	Response.Write	"The forum had " & intMLM & " visitors during the last month."
	rsVisitors.Close
else
	Response.Write	"No visitors in last month."
end if
set rsVisitors=Nothing
WriteFooter
Response.End
%>
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.91 seconds. Powered By: Snitz Forums 2000 Version 3.4.07