| 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <!--- |
|---|
| 3 | Name : gen_stats.cfm |
|---|
| 4 | Author : Raymond Camden |
|---|
| 5 | Created : August 28, 2005 |
|---|
| 6 | Last Updated : December 8, 2006 |
|---|
| 7 | History : Added a few (rkc 11/6/06) |
|---|
| 8 | : Changed how I got data to make it quicker (rkc 12/8/06) |
|---|
| 9 | Purpose : general stats used both on home page and stats |
|---|
| 10 | ---> |
|---|
| 11 | |
|---|
| 12 | <cfquery name="cstats" datasource="#application.galleon.settings.dsn#"> |
|---|
| 13 | select count(id) as conferencecount |
|---|
| 14 | from #application.galleon.settings.tableprefix#conferences |
|---|
| 15 | </cfquery> |
|---|
| 16 | |
|---|
| 17 | <cfquery name="fstats" datasource="#application.galleon.settings.dsn#"> |
|---|
| 18 | select count(id) as forumcount |
|---|
| 19 | from #application.galleon.settings.tableprefix#forums |
|---|
| 20 | </cfquery> |
|---|
| 21 | |
|---|
| 22 | <cfquery name="tstats" datasource="#application.galleon.settings.dsn#"> |
|---|
| 23 | select count(id) as threadcount |
|---|
| 24 | from #application.galleon.settings.tableprefix#threads |
|---|
| 25 | </cfquery> |
|---|
| 26 | |
|---|
| 27 | <cfquery name="ustats" datasource="#application.galleon.settings.dsn#"> |
|---|
| 28 | select count(id) as usercount |
|---|
| 29 | from #application.galleon.settings.tableprefix#users |
|---|
| 30 | </cfquery> |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | <cfquery name="mstats" datasource="#application.galleon.settings.dsn#"> |
|---|
| 34 | select count(id) as messagecount, min(posted) as earliestpost, |
|---|
| 35 | max(posted) as lastpost |
|---|
| 36 | from #application.galleon.settings.tableprefix#messages |
|---|
| 37 | </cfquery> |
|---|
| 38 | |
|---|
| 39 | <cfoutput> |
|---|
| 40 | <p> |
|---|
| 41 | <table class="adminListTable" width="500"> |
|---|
| 42 | <tr class="adminListHeader"> |
|---|
| 43 | <td colspan="2"><b>General Stats</b></td> |
|---|
| 44 | </tr> |
|---|
| 45 | <tr> |
|---|
| 46 | <td><b>Number of Conferences:</b></td> |
|---|
| 47 | <td>#cstats.conferenceCount#</td> |
|---|
| 48 | </tr> |
|---|
| 49 | <tr> |
|---|
| 50 | <td><b>Number of Forums:</b></td> |
|---|
| 51 | <td>#fstats.forumCount#</td> |
|---|
| 52 | </tr> |
|---|
| 53 | <tr> |
|---|
| 54 | <td><b>Number of Threads:</b></td> |
|---|
| 55 | <td>#tstats.threadCount#</td> |
|---|
| 56 | </tr> |
|---|
| 57 | <tr> |
|---|
| 58 | <td><b>Number of Messages:</b></td> |
|---|
| 59 | <td>#mstats.messageCount#</td> |
|---|
| 60 | </tr> |
|---|
| 61 | <tr> |
|---|
| 62 | <td><b>First Post:</b></td> |
|---|
| 63 | <td>#dateFormat(mstats.earliestPost, "m/d/yy")# #timeFormat(mstats.earliestPost, "h:mm tt")# </td> |
|---|
| 64 | </tr> |
|---|
| 65 | <tr> |
|---|
| 66 | <td><b>Last Post:</b></td> |
|---|
| 67 | <td>#dateFormat(mstats.lastPost, "m/d/yy")# #timeFormat(mstats.lastPost, "h:mm tt")# </td> |
|---|
| 68 | </tr> |
|---|
| 69 | <tr> |
|---|
| 70 | <td><b>Number of Users:</b></td> |
|---|
| 71 | <td>#ustats.userCount#</td> |
|---|
| 72 | </tr> |
|---|
| 73 | |
|---|
| 74 | </table> |
|---|
| 75 | </p> |
|---|
| 76 | </cfoutput> |
|---|
| 77 | |
|---|
| 78 | <cfsetting enablecfoutputonly=false> |
|---|