Mercurial > hg > vamp-website
comparison forum/Themes/core/Stats.template.php @ 76:e3e11437ecea website
Add forum code
author | Chris Cannam |
---|---|
date | Sun, 07 Jul 2013 11:25:48 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
75:72f59aa7e503 | 76:e3e11437ecea |
---|---|
1 <?php | |
2 /** | |
3 * Simple Machines Forum (SMF) | |
4 * | |
5 * @package SMF | |
6 * @author Simple Machines | |
7 * @copyright 2011 Simple Machines | |
8 * @license http://www.simplemachines.org/about/smf/license.php BSD | |
9 * | |
10 * @version 2.0 | |
11 */ | |
12 | |
13 function template_main() | |
14 { | |
15 global $context, $settings, $options, $txt, $scripturl, $modSettings; | |
16 | |
17 echo ' | |
18 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor"> | |
19 <tr class="titlebg"> | |
20 <td align="center" colspan="4">', $context['page_title'], '</td> | |
21 </tr> | |
22 <tr> | |
23 <td class="catbg" colspan="4"><strong>', $txt['general_stats'], '</strong></td> | |
24 </tr><tr> | |
25 <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_info.gif" width="20" height="20" alt="" /></td> | |
26 <td class="windowbg2" valign="top"> | |
27 <table border="0" cellpadding="1" cellspacing="0" width="100%"> | |
28 <tr> | |
29 <td nowrap="nowrap">', $txt['total_members'], ':</td> | |
30 <td align="right">', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' . $context['num_members'] . '</a>' : $context['num_members'], '</td> | |
31 </tr><tr> | |
32 <td nowrap="nowrap">', $txt['total_posts'], ':</td> | |
33 <td align="right">', $context['num_posts'], '</td> | |
34 </tr><tr> | |
35 <td nowrap="nowrap">', $txt['total_topics'], ':</td> | |
36 <td align="right">', $context['num_topics'], '</td> | |
37 </tr><tr> | |
38 <td nowrap="nowrap">', $txt['total_cats'], ':</td> | |
39 <td align="right">', $context['num_categories'], '</td> | |
40 </tr><tr> | |
41 <td nowrap="nowrap">', $txt['users_online'], ':</td> | |
42 <td align="right">', $context['users_online'], '</td> | |
43 </tr><tr> | |
44 <td nowrap="nowrap" valign="top">', $txt['most_online'], ':</td> | |
45 <td align="right">', $context['most_members_online']['number'], ' - ', $context['most_members_online']['date'], '</td> | |
46 </tr><tr> | |
47 <td nowrap="nowrap">', $txt['users_online_today'], ':</td> | |
48 <td align="right">', $context['online_today'], '</td>'; | |
49 if (!empty($modSettings['hitStats'])) | |
50 echo ' | |
51 </tr><tr> | |
52 <td nowrap="nowrap">', $txt['num_hits'], ':</td> | |
53 <td align="right">', $context['num_hits'], '</td>'; | |
54 echo ' | |
55 </tr> | |
56 </table> | |
57 </td> | |
58 <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_info.gif" width="20" height="20" alt="" /></td> | |
59 <td class="windowbg2" valign="top"> | |
60 <table border="0" cellpadding="1" cellspacing="0" width="100%"> | |
61 <tr> | |
62 <td nowrap="nowrap">', $txt['average_members'], ':</td> | |
63 <td align="right">', $context['average_members'], '</td> | |
64 </tr><tr> | |
65 <td nowrap="nowrap">', $txt['average_posts'], ':</td> | |
66 <td align="right">', $context['average_posts'], '</td> | |
67 </tr><tr> | |
68 <td nowrap="nowrap">', $txt['average_topics'], ':</td> | |
69 <td align="right">', $context['average_topics'], '</td> | |
70 </tr><tr> | |
71 <td nowrap="nowrap">', $txt['total_boards'], ':</td> | |
72 <td align="right">', $context['num_boards'], '</td> | |
73 </tr><tr> | |
74 <td nowrap="nowrap">', $txt['latest_member'], ':</td> | |
75 <td align="right">', $context['common_stats']['latest_member']['link'], '</td> | |
76 </tr><tr> | |
77 <td nowrap="nowrap">', $txt['average_online'], ':</td> | |
78 <td align="right">', $context['average_online'], '</td> | |
79 </tr><tr> | |
80 <td nowrap="nowrap">', $txt['gender_ratio'], ':</td> | |
81 <td align="right">', $context['gender']['ratio'], '</td>'; | |
82 if (!empty($modSettings['hitStats'])) | |
83 echo ' | |
84 </tr><tr> | |
85 <td nowrap="nowrap">', $txt['average_hits'], ':</td> | |
86 <td align="right">', $context['average_hits'], '</td>'; | |
87 echo ' | |
88 </tr> | |
89 </table> | |
90 </td> | |
91 </tr><tr> | |
92 <td class="catbg" colspan="2" width="50%"><strong>', $txt['top_posters'], '</strong></td> | |
93 <td class="catbg" colspan="2" width="50%"><strong>', $txt['top_boards'], '</strong></td> | |
94 </tr><tr> | |
95 <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_posters.gif" width="20" height="20" alt="" /></td> | |
96 <td class="windowbg2" width="50%" valign="top"> | |
97 <table border="0" cellpadding="1" cellspacing="0" width="100%">'; | |
98 foreach ($context['top_posters'] as $poster) | |
99 echo ' | |
100 <tr> | |
101 <td width="60%" valign="top">', $poster['link'], '</td> | |
102 <td width="20%" align="', $context['right_to_left'] ? 'right' : 'left', '" valign="top">', $poster['num_posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['post_percent'] . '" height="15" alt="" />' : ' ', '</td> | |
103 <td width="20%" align="right" valign="top">', $poster['num_posts'], '</td> | |
104 </tr>'; | |
105 echo ' | |
106 </table> | |
107 </td> | |
108 <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_board.gif" width="20" height="20" alt="" /></td> | |
109 <td class="windowbg2" width="50%" valign="top"> | |
110 <table border="0" cellpadding="1" cellspacing="0" width="100%">'; | |
111 foreach ($context['top_boards'] as $board) | |
112 echo ' | |
113 <tr> | |
114 <td width="60%" valign="top">', $board['link'], '</td> | |
115 <td width="20%" align="', $context['right_to_left'] ? 'right' : 'left', '" valign="top">', $board['num_posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $board['post_percent'] . '" height="15" alt="" />' : ' ', '</td> | |
116 <td width="20%" align="right" valign="top">', $board['num_posts'], '</td> | |
117 </tr>'; | |
118 echo ' | |
119 </table> | |
120 </td> | |
121 </tr><tr> | |
122 <td class="catbg" colspan="2" width="50%"><strong>', $txt['top_topics_replies'], '</strong></td> | |
123 <td class="catbg" colspan="2" width="50%"><strong>', $txt['top_topics_views'], '</strong></td> | |
124 </tr><tr> | |
125 <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_replies.gif" width="20" height="20" alt="" /></td> | |
126 <td class="windowbg2" width="50%" valign="top"> | |
127 <table border="0" cellpadding="1" cellspacing="0" width="100%">'; | |
128 foreach ($context['top_topics_replies'] as $topic) | |
129 echo ' | |
130 <tr> | |
131 <td width="60%" valign="top">', $topic['link'], '</td> | |
132 <td width="20%" align="', $context['right_to_left'] ? 'right' : 'left', '" valign="top">', $topic['num_replies'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $topic['post_percent'] . '" height="15" alt="" />' : ' ', '</td> | |
133 <td width="20%" align="right" valign="top">', $topic['num_replies'], '</td> | |
134 </tr>'; | |
135 echo ' | |
136 </table> | |
137 </td> | |
138 <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_views.gif" width="20" height="20" alt="" /></td> | |
139 <td class="windowbg2" width="50%" valign="top"> | |
140 <table border="0" cellpadding="1" cellspacing="0" width="100%">'; | |
141 foreach ($context['top_topics_views'] as $topic) | |
142 echo ' | |
143 <tr> | |
144 <td width="60%" valign="top">', $topic['link'], '</td> | |
145 <td width="20%" align="', $context['right_to_left'] ? 'right' : 'left', '" valign="top">', $topic['num_views'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $topic['post_percent'] . '" height="15" alt="" />' : ' ', '</td> | |
146 <td width="20%" align="right" valign="top">', $topic['num_views'], '</td> | |
147 </tr>'; | |
148 echo ' | |
149 </table> | |
150 </td> | |
151 </tr><tr> | |
152 <td class="catbg" colspan="2" width="50%"><strong>', $txt['top_starters'], '</strong></td> | |
153 <td class="catbg" colspan="2" width="50%"><strong>', $txt['most_time_online'], '</strong></td> | |
154 </tr><tr> | |
155 <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_replies.gif" width="20" height="20" alt="" /></td> | |
156 <td class="windowbg2" width="50%" valign="top"> | |
157 <table border="0" cellpadding="1" cellspacing="0" width="100%">'; | |
158 foreach ($context['top_starters'] as $poster) | |
159 echo ' | |
160 <tr> | |
161 <td width="60%" valign="top">', $poster['link'], '</td> | |
162 <td width="20%" align="', $context['right_to_left'] ? 'right' : 'left', '" valign="top">', $poster['num_topics'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['post_percent'] . '" height="15" alt="" />' : ' ', '</td> | |
163 <td width="20%" align="right" valign="top">', $poster['num_topics'], '</td> | |
164 </tr>'; | |
165 echo ' | |
166 </table> | |
167 </td> | |
168 <td class="windowbg" width="20" valign="middle" align="center" nowrap="nowrap"><img src="', $settings['images_url'], '/stats_views.gif" width="20" height="20" alt="" /></td> | |
169 <td class="windowbg2" width="50%" valign="top"> | |
170 <table border="0" cellpadding="1" cellspacing="0" width="100%">'; | |
171 foreach ($context['top_time_online'] as $poster) | |
172 echo ' | |
173 <tr> | |
174 <td width="60%" valign="top">', $poster['link'], '</td> | |
175 <td width="20%" align="', $context['right_to_left'] ? 'right' : 'left', '" valign="top">', $poster['time_online'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['time_percent'] . '" height="15" alt="" />' : ' ', '</td> | |
176 <td width="20%" align="right" valign="top" nowrap="nowrap">', $poster['time_online'], '</td> | |
177 </tr>'; | |
178 echo ' | |
179 </table> | |
180 </td> | |
181 </tr><tr> | |
182 <td class="catbg" colspan="4"><strong>', $txt['forum_history'], '</strong></td> | |
183 </tr><tr> | |
184 <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_history.gif" width="20" height="20" alt="" /></td> | |
185 <td class="windowbg2" colspan="4">'; | |
186 | |
187 if (!empty($context['yearly'])) | |
188 { | |
189 echo ' | |
190 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="tborder" style="margin-bottom: 1ex;" id="stats"> | |
191 <tr class="titlebg" valign="middle" align="center"> | |
192 <td width="25%">', $txt['yearly_summary'], '</td> | |
193 <td width="15%">', $txt['stats_new_topics'], '</td> | |
194 <td width="15%">', $txt['stats_new_posts'], '</td> | |
195 <td width="15%">', $txt['stats_new_members'], '</td> | |
196 <td width="15%">', $txt['smf_stats_14'], '</td>'; | |
197 | |
198 if (!empty($modSettings['hitStats'])) | |
199 echo ' | |
200 <td>', $txt['page_views'], '</td>'; | |
201 echo ' | |
202 </tr>'; | |
203 | |
204 foreach ($context['yearly'] as $id => $year) | |
205 { | |
206 echo ' | |
207 <tr class="windowbg2" valign="middle" id="year_', $id, '"> | |
208 <th class="lefttext" width="25%"> | |
209 <img id="year_img_', $id, '" src="', $settings['images_url'], '/collapse.gif" alt="*" /> <a href="#year_', $id, '" id="year_link_', $id, '">', $year['year'], '</a> | |
210 </th> | |
211 <th align="center" width="15%">', $year['new_topics'], '</th> | |
212 <th align="center" width="15%">', $year['new_posts'], '</th> | |
213 <th align="center" width="15%">', $year['new_members'], '</th> | |
214 <th align="center" width="15%">', $year['most_members_online'], '</th>'; | |
215 if (!empty($modSettings['hitStats'])) | |
216 echo ' | |
217 <th align="center">', $year['hits'], '</th>'; | |
218 echo ' | |
219 </tr>'; | |
220 | |
221 foreach ($year['months'] as $month) | |
222 { | |
223 echo ' | |
224 <tr class="windowbg2" valign="middle" id="tr_month_', $month['id'], '"> | |
225 <th class="lefttext" width="25%" style="padding-', ($context['right_to_left'] ? 'right' : 'left'), ': 3ex;"> | |
226 <img src="', $settings['images_url'], '/', $month['expanded'] ? 'collapse.gif' : 'expand.gif', '" alt="" id="img_', $month['id'], '" /> <a id="m', $month['id'], '" href="', $month['href'], '" onclick="return doingExpandCollapse;">', $month['month'], ' ', $month['year'], '</a> | |
227 </th> | |
228 <th align="center" width="15%">', $month['new_topics'], '</th> | |
229 <th align="center" width="15%">', $month['new_posts'], '</th> | |
230 <th align="center" width="15%">', $month['new_members'], '</th> | |
231 <th align="center" width="15%">', $month['most_members_online'], '</th>'; | |
232 if (!empty($modSettings['hitStats'])) | |
233 echo ' | |
234 <th align="center">', $month['hits'], '</th>'; | |
235 echo ' | |
236 </tr>'; | |
237 | |
238 if ($month['expanded']) | |
239 { | |
240 foreach ($month['days'] as $day) | |
241 { | |
242 echo ' | |
243 <tr class="windowbg2" valign="middle" align="left" id="tr_day_', $day['year'], '-', $day['month'], '-', $day['day'], '"> | |
244 <td class="lefttext" style="padding-', ($context['right_to_left'] ? 'right' : 'left'), ': 6ex;">', $day['year'], '-', $day['month'], '-', $day['day'], '</td> | |
245 <td align="center">', $day['new_topics'], '</td> | |
246 <td align="center">', $day['new_posts'], '</td> | |
247 <td align="center">', $day['new_members'], '</td> | |
248 <td align="center">', $day['most_members_online'], '</td>'; | |
249 if (!empty($modSettings['hitStats'])) | |
250 echo ' | |
251 <td align="center">', $day['hits'], '</td>'; | |
252 echo ' | |
253 </tr>'; | |
254 } | |
255 } | |
256 } | |
257 } | |
258 | |
259 echo ' | |
260 </table> | |
261 </td></tr> | |
262 </table> | |
263 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/stats.js"></script> | |
264 <script type="text/javascript"><!-- // --><![CDATA[ | |
265 var oStatsCenter = new smf_StatsCenter({ | |
266 sTableId: \'stats\', | |
267 | |
268 reYearPattern: /year_(\d+)/, | |
269 sYearImageCollapsed: \'expand.gif\', | |
270 sYearImageExpanded: \'collapse.gif\', | |
271 sYearImageIdPrefix: \'year_img_\', | |
272 sYearLinkIdPrefix: \'year_link_\', | |
273 | |
274 reMonthPattern: /tr_month_(\d+)/, | |
275 sMonthImageCollapsed: \'expand.gif\', | |
276 sMonthImageExpanded: \'collapse.gif\', | |
277 sMonthImageIdPrefix: \'img_\', | |
278 sMonthLinkIdPrefix: \'m\', | |
279 | |
280 reDayPattern: /tr_day_(\d+-\d+-\d+)/, | |
281 sDayRowClassname: \'windowbg2\', | |
282 sDayRowIdPrefix: \'tr_day_\', | |
283 | |
284 aCollapsedYears: ['; | |
285 | |
286 foreach ($context['collapsed_years'] as $id => $year) | |
287 { | |
288 echo ' | |
289 \'', $year, '\'', $id != count($context['collapsed_years']) - 1 ? ',' : ''; | |
290 } | |
291 | |
292 echo ' | |
293 ], | |
294 | |
295 aDataCells: [ | |
296 \'date\', | |
297 \'new_topics\', | |
298 \'new_posts\', | |
299 \'new_members\', | |
300 \'most_members_online\'', empty($modSettings['hitStats']) ? '' :', | |
301 \'hits\'', ' | |
302 ] | |
303 }); | |
304 // ]]></script>'; | |
305 } | |
306 } | |
307 | |
308 ?> |