-
Notifications
You must be signed in to change notification settings - Fork 0
/
files.tar
169 lines (129 loc) · 12.5 KB
/
files.tar
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
lib/ 40777 0 0 0 12376767451 4665 5 lib/page/ 40777 0 0 0 12376776172 5601 5 lib/page/HitboxPage.class.php 100777 0 0 1502 12377176614 11542 0 <?php
namespace wcf\page;
use wcf\system\user\collapsible\content\UserCollapsibleContentHandler;
use wcf\system\WCF;
/**
* Integrates a hitbox group.
*
* @author Chrisblue
* @copyright 2014 gamecaster.de
* @license CC Attribution 4.0 International <http://creativecommons.org/licenses/by/4.0/legalcode>
* @package com.gamecaster.wcf.hitboxpage
*/
class HitboxPage extends AbstractPage {
public $activeMenuItem = 'wcf.page.hitbox';
public $templateName = 'hitbox';
public function assignVariables() {
parent::assignVariables();
WCF::getTPL()->assign(array(
'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'com.gamecaster.wcf.HitboxSide'),
'sidebarName' => 'com.gamecaster.wcf.HitboxSide',
'allowSpidersToIndexThisPage' => true
));
}
} lib/system/ 40777 0 0 0 12376774175 6212 5 lib/system/cronjob/ 40777 0 0 0 12376767504 7644 5 lib/system/cronjob/HitboxCronjob.class.php 100777 0 0 11535 12377176556 14362 0 <?php namespace wcf\system\cronjob;
use wcf\system\WCF;
use wcf\data\cronjob\Cronjob;
use wcf\system\cronjob\AbstractCronjob;
/**
* @author Chrisblue
* @copyright 2014 Game Caster
* @license CC Attribution 4.0 International <http://creativecommons.org/licenses/by/4.0/legalcode>
* @package com.gamecaster.wcf.hitboxpage
*/
class HitboxCronjob extends AbstractCronjob {
public function execute(Cronjob $cronjob) {
parent::execute($cronjob);
$path = WCF_DIR."templates/";
$write = '<nav class="tabMenu"><ul id="chatchange">';
$user = json_decode(file_get_contents('http://api.hitbox.tv/team/'.HITBOX_TEAM,true));
foreach($user->members as $member)
{
$live = json_decode(file_get_contents('http://api.hitbox.tv/media/live/'.$member->user_name), true);
$write .= "<li ";
if ($live['livestream'][0]['media_is_live'] == 1) {$write .= "class='hitboxactive'"; }
$write .= ">";
$write .= "<a href='index.php/streams/#".$member->user_name."' data-toggle='tab'><img width='60' height='60' class='framed' src='http://edge.vie.hitbox.tv".$member->user_logo."'/> ".$member->user_name." ";
if ($live['livestream'][0]['media_is_live'] == 0) {
$write .= '<span class="badge badgeUpdate">Offline</span>';
}else{
$write .= '<span class="badge">Online</span>';
}
$write .= "</a></li>";
}
$write .= "</ul></nav>";
foreach($user->members as $member)
{
$live = json_decode(file_get_contents('http://api.hitbox.tv/media/live/'.$member->user_name), true);
$follow = json_decode(file_get_contents('http://api.hitbox.tv/followers/user/'.$member->user_name), true);
$write .= "<div class='container containerPadding marginTop tabMenuContent ";
if ($live['livestream'][0]['media_is_live'] == 1) { $write .= "active"; }
$write .= "' id='".$member->user_name."'>";
if ($live['livestream'][0]['media_is_live'] == 1) {
$write .= "<section><iframe style='width:100%' height='640' src='http://hitbox.tv/#!/embed/".$member->user_name."?autoplay=false' frameborder='0' allowfullscreen></iframe></section>";
//$write .= "<div class='well well-sm'>Zuschauer: ".$live['livestream'][0]['media_views']."</div>";
}else{
$write .= "<a class='framed' href='http://www.hitbox.tv/".$member->user_name."'><img style='margin:1em;float:left;' src='http://edge.vie.hitbox.tv".$member->user_logo."'/></a>";
$write .= "<header class='boxHeadline'><h1>".$member->user_name.WCF::getLanguage()->get('wcf.page.hitbox.isoffline')."</h1></header>";
$write .= "<p>".WCF::getLanguage()->get('wcf.page.hitbox.offlinemessagea').$member->user_name.WCF::getLanguage()->get('wcf.page.hitbox.offlinemessageb')."</p>";
$write .= "<p><br /><a href='http://www.hitbox.tv/".$member->user_name."'><button>".$member->user_name.WCF::getLanguage()->get('wcf.page.hitbox.channel')."</button></a></p>";
$write .= "<div style='clear:both'></div>";
if(HITBOX_SHOW_DESC) {$write .= "<p>".$live['livestream'][0]['media_description']."</p>"; }
$write .= "<div class='boxHeadline'><h1>".WCF::getLanguage()->get('wcf.page.hitbox.follower')." <span class='badge'>".$live['livestream'][0]['channel']['followers']."</span></h1></div>";
$i = 0;
if(HITBOX_SHOW_FOLLOWER) {
$write .= "<div class='container marginTop'><ol class='containerList doubleColumned userList'>";
while($i < $live['livestream'][0]['channel']['followers']) {
$write .= "<li><div class='box48'>";
$write .= "<a class='framed' href='http://www.hitbox.tv/".$follow['followers'][$i]['user_name']."'><img class='media-object' src='http://edge.vie.hitbox.tv".$follow['followers'][$i]['user_logo_small']."' alt='...'></a>";
$write .= "<div class='details userInformation'><div class='containerHeadline'><h3>".$follow['followers'][$i]['user_name']."</h3></div></div>";
$write .= "</div></li>";
$i++;
}
$write .= "</ol></div>"; }
}
$write .= "</div>";
}
file_put_contents($path.'hitbox_out.tpl',$write);
// Hitbox Check
$write = '';
$user = json_decode(file_get_contents('http://api.hitbox.tv/team/'.HITBOX_TEAM,true));
foreach($user->members as $member)
{
$live = json_decode(file_get_contents('http://api.hitbox.tv/media/live/'.$member->user_name), true);
if ($live['livestream'][0]['media_is_live'] == 1) {
$write .= "<div class='container containerPadding marginTop htmlContent'>";
$write .= "<div class='framed'><img width='100' src='http://edge.vie.hitbox.tv".$member->user_logo."' style='float:left;margin-right:1em' /></div>";
$write .= "<header class='boxHeadline'><h1>".$member->user_name.WCF::getLanguage()->get('wcf.page.hitbox.islive').$live['livestream'][0]['media_status']."</h1></header>";
$write .= "<a class='button buttonPrimary' href='".WCF_DIR."page/hitbox/#".$member->user_name."'><span class='icon icon16 icon-play'></span> ".WCF::getLanguage()->get('wcf.page.hitbox.letssee')."</a>";
$write .= "<div style='clear:both'></div></div>";
if (HITBOX_SHOW_AUDIO){ $write .= "<audio style='display:none' src='".HITBOX_AUDIO."' autoplay></audio>";}
}}
file_put_contents($path.'hitbox_check.tpl',$write);
}
} lib/system/dashboard/ 40777 0 0 0 12376774201 10127 5 lib/system/dashboard/box/ 40777 0 0 0 12376776147 10732 5 lib/system/dashboard/box/HitboxDashboardBox.class.php 100777 0 0 1300 12377176563 16354 0 <?php
namespace wcf\system\dashboard\box;
use wcf\data\dashboard\box\DashboardBox;
use wcf\page\IPage;
use wcf\system\event\EventHandler;
use wcf\system\WCF;
/**
* Hitbox dashboard box.
*
* @author Chrisblue
* @copyright 2014 Game Caster
* @license CC Attribution 4.0 International <http://creativecommons.org/licenses/by/4.0/legalcode>
* @package com.gamecaster.wcf.hitbox
* @subpackage system.dashboard.box
* @category Community Framework
*/
class HitboxDashboardBox extends AbstractContentDashboardBox {
/**
* displayed online status
* @var \wcf\system\cache\builder\UserStatsCacheBuilder
*/
protected function render() {
return WCF::getTPL()->fetch('hitbox_check');
}
}