-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGDT_TBS_TopBar.php
69 lines (55 loc) · 1.74 KB
/
GDT_TBS_TopBar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
namespace GDO\TBS;
use GDO\Core\GDT;
use GDO\Statistics\GDO_Statistic;
use GDO\UI\GDT_Image;
use GDO\User\GDO_User;
use GDO\OnlineUsers\GDT_OnlineUsers;
/**
* Render the TOP bar.
* Image.
* Page counter.
* User counter.
* Online counter.
* Chall counter.
*
* @author gizmore
* @version 6.10.3
* @since 6.10.0
*/
final class GDT_TBS_TopBar extends GDT
{
public function renderCell()
{
$mo = Module_TBS::instance();
$html = "<div id=\"tbs_top_bar\">\n";
$countViews = GDO_Statistic::totalHits();
$countChalls = GDO_TBS_Challenge::getChallengeCount();
$countUsers = GDO_User::getMemberCount();
$countOnline = GDT_OnlineUsers::getOnlineUsers();
$views = t('tbs_top_views');
$challs = t('tbs_top_challs');
$users = t('tbs_top_users');
$online = t('tbs_top_online');
$img = GDT_Image::make()->src($mo->wwwPath('img/header_2.jpeg'));
$img->addClass('fl');
$html .= $img->renderCell();
$html .= "<div id=\"tbs_top_counts\">\n";
$html .= "<table>\n";
$html .= "<tbody>\n";
$html .= "<tr>\n";
$html .= "<th>{$views}: </th><td>{$countViews}</td>\n";
$html .= "<th>{$challs}: </th><td>{$countChalls}</td>\n";
$html .= "</tr>\n";
$html .= "<tr>\n";
$html .= "<th>{$users}: </th><td>{$countUsers}</td>\n";
$html .= "<th>{$online}: </th><td>{$countOnline}</td>\n";
$html .= "</tr>\n";
$html .= "</tbody>";
$html .= "</table>";
$html .= "</div>";
$html .= "<div style=\"clear: both;\"></div>\n";
$html .= "</div>";
return $html;
}
}