Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Forum statistics
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum statistics

 Post Reply Post Reply
Author
dimoss View Drop Down
Groupie
Groupie


Joined: 18 March 2003
Location: Greece
Status: Offline
Points: 42
Post Options Post Options   Thanks (0) Thanks(0)   Quote dimoss Quote  Post ReplyReply Direct Link To This Post Topic: Forum statistics
    Posted: 10 January 2008 at 2:46pm
Hi,

Is it possible to put also the forum statistics which shows in the default.asp page in another page of my site? If yes, how?
Thanks,

Dimos
Back to Top
StarDust View Drop Down
Senior Member
Senior Member


Joined: 14 May 2007
Location: Bangladesh
Status: Offline
Points: 310
Post Options Post Options   Thanks (0) Thanks(0)   Quote StarDust Quote  Post ReplyReply Direct Link To This Post Posted: 10 January 2008 at 3:51pm
You will have to code a module to do that.

Tell me some more and i'll try to help you out.
Back to Top
namtoday View Drop Down
Senior Member
Senior Member


Joined: 15 February 2005
Status: Offline
Points: 212
Post Options Post Options   Thanks (0) Thanks(0)   Quote namtoday Quote  Post ReplyReply Direct Link To This Post Posted: 11 January 2008 at 2:45am
What he said is quite detail, he wants a statistic module @ his own site.
The easiest way to do it, probably is you can go to default.asp page, and delete wherever webwizforum displays a forum (dont delete any SQL command).But it will probably alot slower compared with a code that speciallized in doing the job as it has to load almost the default page.
Back to Top
dimoss View Drop Down
Groupie
Groupie


Joined: 18 March 2003
Location: Greece
Status: Offline
Points: 42
Post Options Post Options   Thanks (0) Thanks(0)   Quote dimoss Quote  Post ReplyReply Direct Link To This Post Posted: 11 January 2008 at 1:28pm
Finally I found what I was looking for. I put it here for other also.
<%
Dim rsForumStatsMod
Dim adoStatsModCon
Dim strStatsModCon
Dim strSQLStatsMod
Dim strStatsModForumPath
Dim intForumStatsTotalMembers
Dim intForumStatsTotalTopics
Dim intForumStatsTotalThreads
Dim intForumStatsTotalPosts

'The path to the forum
strStatsModForumPath = "/forum/"

'Default connection
strStatsModCon =  "Provider=sqloledb;Data Source=xxx; User Id=xxx; Password=xxx; Database=xxx"

'Open connection. Makes it so access doesnt crash as much
Set adoStatsModCon = Server.CreateObject("ADODB.Connection")
adoStatsModCon.Open strStatsModCon

'Make the connection to display newest members
Set rsForumStatsMod = Server.CreateObject("ADODB.Recordset")

'Count Members
strSQLStatsMod = "SELECT Count(tblAuthor.Author_ID) AS Total_members FROM tblAuthor;"
rsForumStatsMod.Open strSQLStatsMod, adoStatsModCon
intForumStatsTotalMembers = Clng(rsForumStatsMod("Total_members"))
rsForumStatsMod.Close

'Count Topics
strSQLStatsMod = "SELECT Count(tblTopic.Topic_ID) AS Total_topics FROM tblTopic;"
rsForumStatsMod.Open strSQLStatsMod, adoStatsModCon
intForumStatsTotalTopics = Clng(rsForumStatsMod("Total_topics"))
rsForumStatsMod.Close

'Count Replies
strSQLStatsMod = "SELECT Count(tblThread.Thread_ID) AS Total_threads FROM tblThread;"
rsForumStatsMod.Open strSQLStatsMod, adoStatsModCon
intForumStatsTotalThreads = Clng(rsForumStatsMod("Total_threads") - intForumStatsTotalTopics)
rsForumStatsMod.Close

intForumStatsTotalPosts = intForumStatsTotalTopics + intForumStatsTotalThreads

Response.Write(vbCrLf & "We have " & "<b>" & intForumStatsTotalMembers & "</b>" & " members who have made " & "<b>" & intForumStatsTotalPosts & "</b>" & " posts in total" & "<br>" & "(" & intForumStatsTotalTopics & " topics and " & intForumStatsTotalThreads & " replies)." & "&nbsp;")

'Reset Server Objects
Set rsForumStatsMod = Nothing
adoStatsModCon.Close
Set adoStatsModCon = Nothing
%>

Post edited by admin as it contained the users database login username and password!



Edited by -boRg- - 11 January 2008 at 1:40pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.