Mercurial > hg > vamp-website
comparison forum/Themes/Vamp/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 <div id="statistics" class="main_section"> | |
19 <div class="cat_bar"> | |
20 <h3 class="catbg">', $context['page_title'], '</h3> | |
21 </div> | |
22 <div class="title_bar"> | |
23 <h4 class="titlebg"> | |
24 <span class="ie6_header floatleft"> | |
25 <img src="', $settings['images_url'], '/stats_info.gif" class="icon" alt="" /> ', $txt['general_stats'], ' | |
26 </span> | |
27 </h4> | |
28 </div> | |
29 <div class="flow_hidden"> | |
30 <div id="stats_left"> | |
31 <div class="windowbg2"> | |
32 <span class="topslice"><span></span></span> | |
33 <div class="content top_row"> | |
34 <dl class="stats"> | |
35 <dt>', $txt['total_members'], ':</dt> | |
36 <dd>', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' . $context['num_members'] . '</a>' : $context['num_members'], '</dd> | |
37 <dt>', $txt['total_posts'], ':</dt> | |
38 <dd>', $context['num_posts'], '</dd> | |
39 <dt>', $txt['total_topics'], ':</dt> | |
40 <dd>', $context['num_topics'], '</dd> | |
41 <dt>', $txt['total_cats'], ':</dt> | |
42 <dd>', $context['num_categories'], '</dd> | |
43 <dt>', $txt['users_online'], ':</dt> | |
44 <dd>', $context['users_online'], '</dd> | |
45 <dt>', $txt['most_online'], ':</dt> | |
46 <dd>', $context['most_members_online']['number'], ' - ', $context['most_members_online']['date'], '</dd> | |
47 <dt>', $txt['users_online_today'], ':</dt> | |
48 <dd>', $context['online_today'], '</dd>'; | |
49 | |
50 if (!empty($modSettings['hitStats'])) | |
51 echo ' | |
52 <dt>', $txt['num_hits'], ':</dt> | |
53 <dd>', $context['num_hits'], '</dd>'; | |
54 | |
55 echo ' | |
56 </dl> | |
57 <div class="clear"></div> | |
58 </div> | |
59 <span class="botslice"><span></span></span> | |
60 </div> | |
61 </div> | |
62 <div id="stats_right"> | |
63 <div class="windowbg2"> | |
64 <span class="topslice"><span></span></span> | |
65 <div class="content top_row"> | |
66 <dl class="stats"> | |
67 <dt>', $txt['average_members'], ':</dt> | |
68 <dd>', $context['average_members'], '</dd> | |
69 <dt>', $txt['average_posts'], ':</dt> | |
70 <dd>', $context['average_posts'], '</dd> | |
71 <dt>', $txt['average_topics'], ':</dt> | |
72 <dd>', $context['average_topics'], '</dd> | |
73 <dt>', $txt['total_boards'], ':</dt> | |
74 <dd>', $context['num_boards'], '</dd> | |
75 <dt>', $txt['latest_member'], ':</dt> | |
76 <dd>', $context['common_stats']['latest_member']['link'], '</dd> | |
77 <dt>', $txt['average_online'], ':</dt> | |
78 <dd>', $context['average_online'], '</dd> | |
79 <dt>', $txt['gender_ratio'], ':</dt> | |
80 <dd>', $context['gender']['ratio'], '</dd>'; | |
81 | |
82 if (!empty($modSettings['hitStats'])) | |
83 echo ' | |
84 <dt>', $txt['average_hits'], ':</dt> | |
85 <dd>', $context['average_hits'], '</dd>'; | |
86 | |
87 echo ' | |
88 </dl> | |
89 <div class="clear"></div> | |
90 </div> | |
91 <span class="botslice"><span></span></span> | |
92 </div> | |
93 </div> | |
94 </div> | |
95 <div class="flow_hidden"> | |
96 <div id="top_posters"> | |
97 <div class="title_bar"> | |
98 <h4 class="titlebg"> | |
99 <span class="ie6_header floatleft"> | |
100 <img src="', $settings['images_url'], '/stats_posters.gif" class="icon" alt="" /> ', $txt['top_posters'], ' | |
101 </span> | |
102 </h4> | |
103 </div> | |
104 <div class="windowbg2"> | |
105 <span class="topslice"><span></span></span> | |
106 <div class="content"> | |
107 <dl class="stats">'; | |
108 | |
109 foreach ($context['top_posters'] as $poster) | |
110 { | |
111 echo ' | |
112 <dt> | |
113 ', $poster['link'], ' | |
114 </dt> | |
115 <dd class="statsbar">'; | |
116 | |
117 if (!empty($poster['post_percent'])) | |
118 echo ' | |
119 <div class="bar" style="width: ', $poster['post_percent'] + 4, 'px;"> | |
120 <div style="width: ', $poster['post_percent'], 'px;"></div> | |
121 </div>'; | |
122 | |
123 echo ' | |
124 <span class="righttext">', $poster['num_posts'], '</span> | |
125 </dd>'; | |
126 } | |
127 | |
128 echo ' | |
129 </dl> | |
130 <div class="clear"></div> | |
131 </div> | |
132 <span class="botslice"><span></span></span> | |
133 </div> | |
134 </div> | |
135 <div id="top_boards"> | |
136 <div class="title_bar"> | |
137 <h4 class="titlebg"> | |
138 <span class="ie6_header floatleft"> | |
139 <img src="', $settings['images_url'], '/stats_board.gif" class="icon" alt="" /> ', $txt['top_boards'], ' | |
140 </span> | |
141 </h4> | |
142 </div> | |
143 <div class="windowbg2"> | |
144 <span class="topslice"><span></span></span> | |
145 <div class="content"> | |
146 <dl class="stats">'; | |
147 | |
148 foreach ($context['top_boards'] as $board) | |
149 { | |
150 echo ' | |
151 <dt> | |
152 ', $board['link'], ' | |
153 </dt> | |
154 <dd class="statsbar">'; | |
155 | |
156 if (!empty($board['post_percent'])) | |
157 echo ' | |
158 <div class="bar" style="width: ', $board['post_percent'] + 4, 'px;"> | |
159 <div style="width: ', $board['post_percent'], 'px;"></div> | |
160 </div>'; | |
161 echo ' | |
162 <span class="righttext">', $board['num_posts'], '</span> | |
163 </dd>'; | |
164 } | |
165 | |
166 echo ' | |
167 </dl> | |
168 <div class="clear"></div> | |
169 </div> | |
170 <span class="botslice"><span></span></span> | |
171 </div> | |
172 </div> | |
173 </div> | |
174 <div class="flow_hidden"> | |
175 <div id="top_topics_replies"> | |
176 <div class="title_bar"> | |
177 <h4 class="titlebg"> | |
178 <span class="ie6_header floatleft"> | |
179 <img src="', $settings['images_url'], '/stats_replies.gif" class="icon" alt="" /> ', $txt['top_topics_replies'], ' | |
180 </span> | |
181 </h4> | |
182 </div> | |
183 <div class="windowbg2"> | |
184 <span class="topslice"><span></span></span> | |
185 <div class="content"> | |
186 <dl class="stats">'; | |
187 | |
188 foreach ($context['top_topics_replies'] as $topic) | |
189 { | |
190 echo ' | |
191 <dt> | |
192 ', $topic['link'], ' | |
193 </dt> | |
194 <dd class="statsbar">'; | |
195 if (!empty($topic['post_percent'])) | |
196 echo ' | |
197 <div class="bar" style="width: ', $topic['post_percent'] + 4, 'px;"> | |
198 <div style="width: ', $topic['post_percent'], 'px;"></div> | |
199 </div>'; | |
200 | |
201 echo ' | |
202 <span class="righttext">' . $topic['num_replies'] . '</span> | |
203 </dd>'; | |
204 } | |
205 echo ' | |
206 </dl> | |
207 <div class="clear"></div> | |
208 </div> | |
209 <span class="botslice"><span></span></span> | |
210 </div> | |
211 </div> | |
212 | |
213 <div id="top_topics_views"> | |
214 <div class="title_bar"> | |
215 <h4 class="titlebg"> | |
216 <span class="ie6_header floatleft"> | |
217 <img src="', $settings['images_url'], '/stats_views.gif" class="icon" alt="" /> ', $txt['top_topics_views'], ' | |
218 </span> | |
219 </h4> | |
220 </div> | |
221 <div class="windowbg2"> | |
222 <span class="topslice"><span></span></span> | |
223 <div class="content"> | |
224 <dl class="stats">'; | |
225 | |
226 foreach ($context['top_topics_views'] as $topic) | |
227 { | |
228 echo ' | |
229 <dt>', $topic['link'], '</dt> | |
230 <dd class="statsbar">'; | |
231 | |
232 if (!empty($topic['post_percent'])) | |
233 echo ' | |
234 <div class="bar" style="width: ', $topic['post_percent'] + 4, 'px;"> | |
235 <div style="width: ', $topic['post_percent'], 'px;"></div> | |
236 </div>'; | |
237 | |
238 echo ' | |
239 <span class="righttext">' . $topic['num_views'] . '</span> | |
240 </dd>'; | |
241 } | |
242 | |
243 echo ' | |
244 </dl> | |
245 <div class="clear"></div> | |
246 </div> | |
247 <span class="botslice"><span></span></span> | |
248 </div> | |
249 </div> | |
250 </div> | |
251 <div class="flow_hidden"> | |
252 <div id="top_topics_starter"> | |
253 <div class="title_bar"> | |
254 <h4 class="titlebg"> | |
255 <span class="ie6_header floatleft"> | |
256 <img src="', $settings['images_url'], '/stats_replies.gif" class="icon" alt="" /> ', $txt['top_starters'], ' | |
257 </span> | |
258 </h4> | |
259 </div> | |
260 <div class="windowbg2"> | |
261 <span class="topslice"><span></span></span> | |
262 <div class="content"> | |
263 <dl class="stats">'; | |
264 | |
265 foreach ($context['top_starters'] as $poster) | |
266 { | |
267 echo ' | |
268 <dt> | |
269 ', $poster['link'], ' | |
270 </dt> | |
271 <dd class="statsbar">'; | |
272 | |
273 if (!empty($poster['post_percent'])) | |
274 echo ' | |
275 <div class="bar" style="width: ', $poster['post_percent'] + 4, 'px;"> | |
276 <div style="width: ', $poster['post_percent'], 'px;"></div> | |
277 </div>'; | |
278 | |
279 echo ' | |
280 <span class="righttext">', $poster['num_topics'], '</span> | |
281 </dd>'; | |
282 } | |
283 | |
284 echo ' | |
285 </dl> | |
286 <div class="clear"></div> | |
287 </div> | |
288 <span class="botslice"><span></span></span> | |
289 </div> | |
290 </div> | |
291 <div id="most_online"> | |
292 <div class="title_bar"> | |
293 <h4 class="titlebg"> | |
294 <span class="ie6_header floatleft"> | |
295 <img src="', $settings['images_url'], '/stats_views.gif" class="icon" alt="" /> ', $txt['most_time_online'], ' | |
296 </span> | |
297 </h4> | |
298 </div> | |
299 <div class="windowbg2"> | |
300 <span class="topslice"><span></span></span> | |
301 <div class="content"> | |
302 <dl class="stats">'; | |
303 | |
304 foreach ($context['top_time_online'] as $poster) | |
305 { | |
306 echo ' | |
307 <dt> | |
308 ', $poster['link'], ' | |
309 </dt> | |
310 <dd class="statsbar">'; | |
311 | |
312 if (!empty($poster['time_percent'])) | |
313 echo ' | |
314 <div class="bar" style="width: ', $poster['time_percent'] + 4, 'px;"> | |
315 <div style="width: ', $poster['time_percent'], 'px;"></div> | |
316 </div>'; | |
317 | |
318 echo ' | |
319 <span>', $poster['time_online'], '</span> | |
320 </dd>'; | |
321 } | |
322 | |
323 echo ' | |
324 </dl> | |
325 <div class="clear"></div> | |
326 </div> | |
327 <span class="botslice"><span></span></span> | |
328 </div> | |
329 </div> | |
330 </div> | |
331 <br class="clear" /> | |
332 <div class="flow_hidden"> | |
333 <div class="cat_bar"> | |
334 <h3 class="catbg"> | |
335 <span class="ie6_header floatleft"> | |
336 <img src="', $settings['images_url'], '/stats_history.gif" class="icon" alt="" /> ', $txt['forum_history'], ' | |
337 </span> | |
338 </h3> | |
339 </div>'; | |
340 | |
341 if (!empty($context['yearly'])) | |
342 { | |
343 echo ' | |
344 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="table_grid" id="stats"> | |
345 <thead> | |
346 <tr class="titlebg" valign="middle" align="center"> | |
347 <th class="first_th lefttext" width="25%">', $txt['yearly_summary'], '</th> | |
348 <th width="15%">', $txt['stats_new_topics'], '</th> | |
349 <th width="15%">', $txt['stats_new_posts'], '</th> | |
350 <th width="15%">', $txt['stats_new_members'], '</th> | |
351 <th', empty($modSettings['hitStats']) ? ' class="last_th"' : '', ' width="15%">', $txt['smf_stats_14'], '</th>'; | |
352 | |
353 if (!empty($modSettings['hitStats'])) | |
354 echo ' | |
355 <th class="last_th">', $txt['page_views'], '</th>'; | |
356 | |
357 echo ' | |
358 </tr> | |
359 </thead> | |
360 <tbody>'; | |
361 | |
362 foreach ($context['yearly'] as $id => $year) | |
363 { | |
364 echo ' | |
365 <tr class="windowbg2" valign="middle" align="center" id="year_', $id, '"> | |
366 <th class="lefttext" width="25%"> | |
367 <img id="year_img_', $id, '" src="', $settings['images_url'], '/collapse.gif" alt="*" /> <a href="#year_', $id, '" id="year_link_', $id, '">', $year['year'], '</a> | |
368 </th> | |
369 <th width="15%">', $year['new_topics'], '</th> | |
370 <th width="15%">', $year['new_posts'], '</th> | |
371 <th width="15%">', $year['new_members'], '</th> | |
372 <th width="15%">', $year['most_members_online'], '</th>'; | |
373 | |
374 if (!empty($modSettings['hitStats'])) | |
375 echo ' | |
376 <th>', $year['hits'], '</th>'; | |
377 | |
378 echo ' | |
379 </tr>'; | |
380 | |
381 foreach ($year['months'] as $month) | |
382 { | |
383 echo ' | |
384 <tr class="windowbg2" valign="middle" align="center" id="tr_month_', $month['id'], '"> | |
385 <th class="stats_month"> | |
386 <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> | |
387 </th> | |
388 <th width="15%">', $month['new_topics'], '</th> | |
389 <th width="15%">', $month['new_posts'], '</th> | |
390 <th width="15%">', $month['new_members'], '</th> | |
391 <th width="15%">', $month['most_members_online'], '</th>'; | |
392 | |
393 if (!empty($modSettings['hitStats'])) | |
394 echo ' | |
395 <th>', $month['hits'], '</th>'; | |
396 | |
397 echo ' | |
398 </tr>'; | |
399 | |
400 if ($month['expanded']) | |
401 { | |
402 foreach ($month['days'] as $day) | |
403 { | |
404 echo ' | |
405 <tr class="windowbg2" valign="middle" align="center" id="tr_day_', $day['year'], '-', $day['month'], '-', $day['day'], '"> | |
406 <td class="stats_day">', $day['year'], '-', $day['month'], '-', $day['day'], '</td> | |
407 <td>', $day['new_topics'], '</td> | |
408 <td>', $day['new_posts'], '</td> | |
409 <td>', $day['new_members'], '</td> | |
410 <td>', $day['most_members_online'], '</td>'; | |
411 | |
412 if (!empty($modSettings['hitStats'])) | |
413 echo ' | |
414 <td>', $day['hits'], '</td>'; | |
415 | |
416 echo ' | |
417 </tr>'; | |
418 } | |
419 } | |
420 } | |
421 } | |
422 | |
423 echo ' | |
424 </tbody> | |
425 </table> | |
426 </div> | |
427 </div> | |
428 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/stats.js"></script> | |
429 <script type="text/javascript"><!-- // --><![CDATA[ | |
430 var oStatsCenter = new smf_StatsCenter({ | |
431 sTableId: \'stats\', | |
432 | |
433 reYearPattern: /year_(\d+)/, | |
434 sYearImageCollapsed: \'expand.gif\', | |
435 sYearImageExpanded: \'collapse.gif\', | |
436 sYearImageIdPrefix: \'year_img_\', | |
437 sYearLinkIdPrefix: \'year_link_\', | |
438 | |
439 reMonthPattern: /tr_month_(\d+)/, | |
440 sMonthImageCollapsed: \'expand.gif\', | |
441 sMonthImageExpanded: \'collapse.gif\', | |
442 sMonthImageIdPrefix: \'img_\', | |
443 sMonthLinkIdPrefix: \'m\', | |
444 | |
445 reDayPattern: /tr_day_(\d+-\d+-\d+)/, | |
446 sDayRowClassname: \'windowbg2\', | |
447 sDayRowIdPrefix: \'tr_day_\', | |
448 | |
449 aCollapsedYears: ['; | |
450 | |
451 foreach ($context['collapsed_years'] as $id => $year) | |
452 { | |
453 echo ' | |
454 \'', $year, '\'', $id != count($context['collapsed_years']) - 1 ? ',' : ''; | |
455 } | |
456 | |
457 echo ' | |
458 ], | |
459 | |
460 aDataCells: [ | |
461 \'date\', | |
462 \'new_topics\', | |
463 \'new_posts\', | |
464 \'new_members\', | |
465 \'most_members_online\'', empty($modSettings['hitStats']) ? '' : ', | |
466 \'hits\'', ' | |
467 ] | |
468 }); | |
469 // ]]></script>'; | |
470 } | |
471 } | |
472 | |
473 ?> |