annotate forum/Themes/Vamp/Stats.template.php @ 89:c27a792883cb website

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