⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_statistics.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="admin_common.asp" -->
<!--#include file="functions/functions_date_time_format.asp" -->
<%
'****************************************************************************************
'**  Copyright Notice    
'**
'**  Web Wiz Forums(TM)
'**  http://www.webwizforums.com
'**                            
'**  Copyright (C)2001-2008 Web Wiz(TM). All Rights Reserved.
'**  
'**  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'.
'**  
'**  IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE 
'**  THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE
'**  AND DERIVATIVE WORKS IMMEDIATELY.
'**  
'**  If you have not received a copy of the license with this work then a copy of the latest
'**  license contract can be found at:-
'**
'**  http://www.webwizguide.com/license
'**
'**  For more information about this software and for licensing information please contact
'**  'Web Wiz' at the address and website below:-
'**
'**  Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England
'**  http://www.webwizguide.com
'**
'**  Removal or modification of this copyright notice will violate the license contract.
'**
'****************************************************************************************



'*************************** SOFTWARE AND CODE MODIFICATIONS **************************** 
'**
'** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE  
'** AGREEMENT AND IS STRICTLY PROHIBITED
'**
'** If you wish to modify any part of this software a license must be purchased
'**
'****************************************************************************************




'Set the response buffer to true
Response.Buffer = True


'Dimension variables
Dim intForum		'Holds the number of fourms
Dim lngTopic		'Holds the number of topics
Dim dtmTopic		'Holds the date of the last topic
Dim lngPost		'Holds the number of posts
Dim dtmPost		'Holds the date of the last post
Dim lngPm		'Holds the number of private messages
Dim dtmPm		'Holds the date of the last private message
Dim lngPoll		'Holds the number of polls
Dim intActiveUsers	'Holds the number of active users
Dim intGroups		'Holds the number of groups
Dim lngMember		'Holds the number of members
Dim dtmMember		'Holds the date of the last members signup
Dim lngUserID		'Holds the active users ID
Dim strActUser		'Holds the active users username
Dim strForumName 	'Holds the forum name
Dim intGuestNumber	'Holds the Guest Number
Dim intActiveGuests	'Holds the number of active guests
Dim intActiveMembers	'Holds the nunber of active members
Dim strBrowserUserType	'Holds the users browser type
Dim strOS		'Holds the users OS
Dim dtmLastActive	'Holds the last active date
Dim dtmLoggedIn		'Holds the date the user logged in
Dim intArrayPass	'Loop counter
Dim strOSbrowser	'Holds the OS and browser of the user
Dim strLocation		'Holds the users location
Dim strURL		'Holds the URL to the users location
Dim blnHideActiveUser	'Holds if the user wants to be hidden
Dim strUsername		'Holds the username


'Initilise variables
intActiveMembers = 0
intActiveGuests = 0
intActiveUsers = 0
intGuestNumber = 0
intForum = 0
lngTopic = 0
lngPost = 0
lngPm = 0
intActiveUsers = 0
intGroups = 0
lngMember = 0



'Initialise the SQL variable with an SQL statement to get the configuration details from the database
strSQL = "SELECT " & strDbTable & "Configuration.* From " & strDbTable & "Configuration WHERE " & strDbTable & "Configuration.ID = 1;"

'Query the database
rsCommon.Open strSQL, adoCon


'Read in ifg active users is anbaled
If NOT rsCommon.EOF Then blnActiveUsers = CBool(rsCommon("Active_users"))

'Clean up
rsCommon.Close




'******************************************
'***	    Read in the Counts		***
'******************************************

'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT " & strDbTable & "Forum.No_of_topics, " & strDbTable & "Forum.No_of_posts FROM " & strDbTable & "Forum;"

'Query the database
rsCommon.Open strSQL, adoCon

'Get the number of topics posts and forums
Do While NOT rsCommon.EOF

 	'Count the number of forums
 	intForum = intForum + 1

 	'Count the number of topics
 	lngTopic = lngTopic + CLng(rsCommon("No_of_topics"))

 	'Count the number of posts
 	lngPost = lngPost + CLng(rsCommon("No_of_posts"))

 	'Move to the next record
 	rsCommon.MoveNext
Loop

'Clean up
rsCommon.Close



'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT Count(" & strDbTable & "Author.Author_ID) AS CountAuthor FROM " & strDbTable & "Author;"

'Query the database
rsCommon.Open strSQL, adoCon

'Read in the count
If NOT rsCommon.EOF Then lngMember = CLng(rsCommon("CountAuthor"))

'Clean up
rsCommon.Close



'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT Count(" & strDbTable & "PMMessage.PM_ID) AS CountPm FROM " & strDbTable & "PMMessage;"

'Query the database
rsCommon.Open strSQL, adoCon

'Read in the count
If NOT rsCommon.EOF Then lngPm = CLng(rsCommon("CountPm"))

'Clean up
rsCommon.Close


'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT Count(" & strDbTable & "Poll.Poll_ID) AS CountPoll FROM " & strDbTable & "Poll;"

'Query the database
rsCommon.Open strSQL, adoCon

'Read in the count
If NOT rsCommon.EOF Then lngPoll = CLng(rsCommon("CountPoll"))

'Clean up
rsCommon.Close



'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT Count(" & strDbTable & "Group.Group_ID) AS CountGroup FROM " & strDbTable & "Group;"

'Query the database
rsCommon.Open strSQL, adoCon

'Read in the count
If NOT rsCommon.EOF Then intGroups = CLng(rsCommon("CountGroup"))

'Clean up
rsCommon.Close



'******************************************
'***	    	Read in Dates		***
'******************************************

'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT" & strDBTop1 & " " & strDbTable & "Thread.Message_date " & _
"FROM " & strDbTable & "Thread, " & strDbTable & "Topic " & _
"WHERE " & strDbTable & "Thread.Thread_ID = " & strDbTable & "Topic.Start_Thread_ID " & _
"ORDER BY " & strDbTable & "Thread.Message_date DESC" & strDBLimit1 & ";"

'Query the database
rsCommon.Open strSQL, adoCon

'Read in the count
If NOT rsCommon.EOF Then dtmTopic = CDate(rsCommon("Message_date"))

'Clean up
rsCommon.Close



'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT" & strDBTop1 & " " & strDbTable & "Thread.Message_date FROM " & strDbTable & "Thread ORDER BY " & strDbTable & "Thread.Message_date DESC" & strDBLimit1 & ";"

'Query the database
rsCommon.Open strSQL, adoCon

'Read in the count
If NOT rsCommon.EOF Then dtmPost = CDate(rsCommon("Message_date"))

'Clean up
rsCommon.Close



'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT" & strDBTop1 & " " & strDbTable & "Author.Join_date FROM " & strDbTable & "Author ORDER BY " & strDbTable & "Author.Join_date DESC" & strDBLimit1 & ";"

'Query the database
rsCommon.Open strSQL, adoCon

'Read in the count

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -