| 1 | <!--- |
|---|
| 2 | Name : stats_charts.cfm |
|---|
| 3 | Author : Raymond Camden |
|---|
| 4 | Created : August 30, 2004 |
|---|
| 5 | Last Updated : December 8, 2006 |
|---|
| 6 | History : Slight change to how I get data (rkc 12/8/06) |
|---|
| 7 | Purpose : |
|---|
| 8 | ---> |
|---|
| 9 | |
|---|
| 10 | <cfquery name="conferences" datasource="#application.galleon.settings.dsn#"> |
|---|
| 11 | select id, name |
|---|
| 12 | from #application.galleon.settings.tableprefix#conferences |
|---|
| 13 | </cfquery> |
|---|
| 14 | |
|---|
| 15 | <cfquery name="forums" datasource="#application.galleon.settings.dsn#"> |
|---|
| 16 | select id, name, conferenceidfk |
|---|
| 17 | from #application.galleon.settings.tableprefix#forums |
|---|
| 18 | </cfquery> |
|---|
| 19 | |
|---|
| 20 | <cfset threads = application.galleon.thread.getThreads()> |
|---|
| 21 | <cfset users = application.galleon.user.getUsers()> |
|---|
| 22 | |
|---|
| 23 | <cfoutput> |
|---|
| 24 | <p> |
|---|
| 25 | <table class="adminListTable" width="500"> |
|---|
| 26 | <tr class="adminListHeader"> |
|---|
| 27 | <td><b>Number of Forums Per Conference</b></td> |
|---|
| 28 | </tr> |
|---|
| 29 | <tr> |
|---|
| 30 | <td> |
|---|
| 31 | <cfchart format="flash" chartheight="400" chartwidth="400" seriesplacement="default" |
|---|
| 32 | labelformat="number" tipstyle="mouseOver" pieslicestyle="sliced"> |
|---|
| 33 | <cfchartseries type="pie"> |
|---|
| 34 | <cfloop query="conferences"> |
|---|
| 35 | <cfquery name="fcount" dbtype="query"> |
|---|
| 36 | select count(id) as total |
|---|
| 37 | from forums |
|---|
| 38 | where conferenceidfk = '#id#' |
|---|
| 39 | </cfquery> |
|---|
| 40 | <cfif fcount.total is ""> |
|---|
| 41 | <cfset total = 0> |
|---|
| 42 | <cfelse> |
|---|
| 43 | <cfset total = fcount.total> |
|---|
| 44 | </cfif> |
|---|
| 45 | <cfchartdata item="#name#" value="#total#"> |
|---|
| 46 | </cfloop> |
|---|
| 47 | </cfchartseries> |
|---|
| 48 | </cfchart> |
|---|
| 49 | </td> |
|---|
| 50 | </tr> |
|---|
| 51 | </table> |
|---|
| 52 | </p> |
|---|
| 53 | |
|---|
| 54 | <p> |
|---|
| 55 | <table class="adminListTable" width="500"> |
|---|
| 56 | <tr class="adminListHeader"> |
|---|
| 57 | <td><b>Number of Threads Per Forum</b></td> |
|---|
| 58 | </tr> |
|---|
| 59 | <tr> |
|---|
| 60 | <td> |
|---|
| 61 | <cfchart format="flash" chartheight="400" chartwidth="400" seriesplacement="default" |
|---|
| 62 | labelformat="number" tipstyle="mouseOver" pieslicestyle="sliced"> |
|---|
| 63 | <cfchartseries type="pie"> |
|---|
| 64 | <cfloop query="forums"> |
|---|
| 65 | <cfquery name="fcount" dbtype="query"> |
|---|
| 66 | select count(id) as total |
|---|
| 67 | from threads |
|---|
| 68 | where forumidfk = '#id#' |
|---|
| 69 | </cfquery> |
|---|
| 70 | <cfif fcount.total is ""> |
|---|
| 71 | <cfset total = 0> |
|---|
| 72 | <cfelse> |
|---|
| 73 | <cfset total = fcount.total> |
|---|
| 74 | </cfif> |
|---|
| 75 | <cfchartdata item="#name#" value="#total#"> |
|---|
| 76 | </cfloop> |
|---|
| 77 | </cfchartseries> |
|---|
| 78 | </cfchart> |
|---|
| 79 | </td> |
|---|
| 80 | </tr> |
|---|
| 81 | </table> |
|---|
| 82 | </p> |
|---|
| 83 | |
|---|
| 84 | <cfquery name="sortedThreads" dbtype="query"> |
|---|
| 85 | select * |
|---|
| 86 | from threads |
|---|
| 87 | order by messagecount desc |
|---|
| 88 | </cfquery> |
|---|
| 89 | |
|---|
| 90 | <p> |
|---|
| 91 | <table class="adminListTable" width="500"> |
|---|
| 92 | <tr class="adminListHeader"> |
|---|
| 93 | <td colspan="2"><b>Top 10 Threads by Message Count</b></td> |
|---|
| 94 | </tr> |
|---|
| 95 | <tr> |
|---|
| 96 | <td><b>Thread Name</b></td> |
|---|
| 97 | <td><b>Message Count</b></td> |
|---|
| 98 | </tr> |
|---|
| 99 | <cfloop query="sortedThreads" endrow="10"> |
|---|
| 100 | <tr> |
|---|
| 101 | <td>#name#</td> |
|---|
| 102 | <td>#messagecount# |
|---|
| 103 | </tr> |
|---|
| 104 | </cfloop> |
|---|
| 105 | </table> |
|---|
| 106 | </p> |
|---|
| 107 | |
|---|
| 108 | <cfquery name="sortedUsers" dbtype="query"> |
|---|
| 109 | select * |
|---|
| 110 | from users |
|---|
| 111 | order by postcount desc |
|---|
| 112 | </cfquery> |
|---|
| 113 | |
|---|
| 114 | <p> |
|---|
| 115 | <table class="adminListTable" width="500"> |
|---|
| 116 | <tr class="adminListHeader"> |
|---|
| 117 | <td colspan="2"><b>Top 10 Users by Post Count</b></td> |
|---|
| 118 | </tr> |
|---|
| 119 | <tr> |
|---|
| 120 | <td><b>User Name</b></td> |
|---|
| 121 | <td><b>Post Count</b></td> |
|---|
| 122 | </tr> |
|---|
| 123 | <cfloop query="sortedUsers" endrow="10"> |
|---|
| 124 | <tr> |
|---|
| 125 | <td>#username#</td> |
|---|
| 126 | <td>#postcount# |
|---|
| 127 | </tr> |
|---|
| 128 | </cfloop> |
|---|
| 129 | </table> |
|---|
| 130 | </p> |
|---|
| 131 | |
|---|
| 132 | </cfoutput> |
|---|
| 133 | |
|---|
| 134 | |
|---|