Repository navigation
Expand file tree
/
Copy pathcmdcount.php
More file actions
116 lines (95 loc) · 2.25 KB
/
Copy pathcmdcount.php
File metadata and controls
116 lines (95 loc) · 2.25 KB
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
<?php
require_once('common.php');
if (!isset($_GET['channel'])||!isset($_GET['command'])) die("lern2parameters");
$channel = $_GET['channel'];
$command = $_GET['command'];
if (!validateChannel($channel) || preg_match('/^[A-Z0-9\-_]$/i', $command)) die('git gud skrub');
$json_data = file_get_contents('configs/' . $channel . '.json');
$data = json_decode($json_data);
$cmdObj = (object)array("count" => "?");
foreach($data->commands as $struct) {
if ($command == $struct->key) {
$cmdObj = $struct;
break;
}
}
$ct = $cmdObj->count;
$isUpdated = false;
if (isset($_COOKIE['lastcmdct_' . $command]) && $_COOKIE['lastcmdct_' . $command] != $ct) {
$isUpdated = true;
}
$devMode = isset($_GET['dev']);
setcookie("lastcmdct_" . $command, $ct);
header('Content-type: text/html');
header('refresh: 5; url=http://coebot.tv/showvar.php?channel=coestar&var=rip-uncharted2&themes=blood+guude&label=deaths');
?>
<html>
<head>
<style>
body {
font-weight: bold;
color:#a00;
text-shadow: 2px 2px 10px black;
text-align:center;
}
#guude {
position: fixed;
left: 50%;
height: 100px;
width: 87px;
margin-left: -43px;
display: none;
}
body.is-update #guude {
display: inline;
opacity: 0;
-webkit-animation: fadetoggle 3s 1; animation: fadetoggle 3s 1;
}
#number {
font-family: Chiller, serif;
font-size: 72px;
line-height: 90%;
color:#a00;
}
body.is-update #number {
-webkit-animation: flashwhite 3s 1; animation: flashwhite 3s 1;
}
#label {
font-family: sans-serif;
font-size: 24px;
line-height: 50%;
color:#a00;
}
#label:after {
content: 'deaths';
}
@keyframes flashwhite {
0% {color: #a00;}
40% {color: #fff;}
100% {color: #a00;}
}
@-webkit-keyframes flashwhite {
0% {color: #a00;}
40% {color: #fff;}
100% {color: #a00;}
}
@keyframes fadetoggle {
0% {opacity: 0;}
40% {opacity: 1;}
100% {opacity: 0;}
}
@-webkit-keyframes fadetoggle {
0% {opacity: 0;}
40% {opacity: 1;}
100% {opacity: 0;}
}
</style>
</head>
<body<?php if($isUpdated) { echo " class=\"is-update\""; } ?>>
<img id="guude" src="/img/guude.png">
<div id="normalText">
<div id="number" class="bigtxt"> <?php echo $ct; ?></div>
<div id="label"></div>
</div>
</body>
</html>