forked from BinarMorker/TimeWastedOnDestiny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
237 lines (230 loc) · 13 KB
/
index.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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="How much time have you wasted on Destiny?">
<meta property="og:title" content="Time Wasted on Destiny" />
<meta property="og:description" content="How much time have you wasted on Destiny?" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://wastedondestiny.com" />
<meta property="og:image" content="http://wastedondestiny.com/img/background.jpg" />
<link rel="icon" href="favicon.ico">
<title>Time wasted on Destiny</title>
<!-- CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="http://bootswatch.com/cosmo/bootstrap.min.css">
<link rel="stylesheet" href="/css/bootstrap-switch.min.css">
<link rel="stylesheet" href="/css/stylesheet.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container vert-middle">
<div class="panel panel-default text-center">
<div class="panel-body">
<h1>Time Wasted on Destiny</h1>
<h2 style="visibility: hidden; height: 0;"><small>Find out just how much time you have wasted on this game by choosing your console and entering your username below.</small></h2>
<form role="form" id="search">
<div class="input-group">
<span class="input-group-btn">
<input id="console" type="checkbox" name="console" data-on-text='<img width="20" height="20" src="/img/xbox-icon.svg" />' data-on-color="success" data-off-text='<img width="20" height="20" src="/img/playstation-icon.svg" />' data-off-color="primary" data-size="large">
</span>
<input id="username" type="text" class="form-control" name="username" placeholder="Username">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Go!</button>
</span>
</div>
</form>
</div>
</div>
<div id="error"></div>
<div class="row hide" id="fields">
<div class="col-md-4">
<div class="panel panel-fixed panel-primary text-center">
<div class="panel-heading">
<h3 class="panel-title"><img width="20" height="20" src="/img/playstation-icon.svg" /> Playstation</h3>
</div>
<div class="panel-body">
<div class="icon">
<a id="psn_links" tabindex="0" role="button" data-toggle="popover" data-trigger="focus" title="External links" data-content="">
<img id="psn_icon" />
</a>
<h5 id="psn_rank"></h5>
</div>
<h4 class="display-name" id="psn_name"></h4>
<span class="played-time" rel="tooltip" id="psn_time"></span>
<span class="wasted-time" rel="tooltip" id="psn_wasted"></span>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-fixed panel-info text-center">
<div class="panel-heading">
<h3 class="panel-title"><img width="20" height="20" src="/img/destiny-icon.svg" /> Total time spent</h3>
</div>
<div class="panel-body">
<h4 class="display-name" id="display_name"></h4>
<span class="played-time" rel="tooltip" id="total_time"></span>
<span class="wasted-time" rel="tooltip" id="total_wasted"></span>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-fixed panel-success text-center">
<div class="panel-heading">
<h3 class="panel-title"><img width="20" height="20" src="/img/xbox-icon.svg" /> Xbox</h3>
</div>
<div class="panel-body">
<div class="icon">
<a id="xbl_links" tabindex="0" role="button" data-toggle="popover" data-trigger="focus" title="External links" data-content="">
<img id="xbl_icon" />
</a>
<h5 id="xbl_rank"></h5>
</div>
<h4 class="display-name" id="xbl_name"></h4>
<span class="played-time" rel="tooltip" id="xbl_time"></span>
<span class="wasted-time" rel="tooltip" id="xbl_wasted"></span>
</div>
</div>
</div>
</div>
<div id="a-d-v-e-r-t">
<div class="row pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links" id="adsense">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-body">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6332373031553935"
data-ad-slot="7124654099"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-body">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6332373031553935"
data-ad-slot="7124654099"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title"><img width="20" height="20" src="/img/trophy-icon.svg" /> Leaderboard</h3>
</div>
<table class="table table-condensed table-striped">
<thead>
<tr>
<th class="text-center">Rank</th>
<th class="text-center">Username</th>
<th class="text-center">Time</th>
</tr>
</thead>
<tbody>
<?php
$request = file_get_contents("http://" . $_SERVER['HTTP_HOST'] . "/request.php?leaderboard");
$response = json_decode($request);
$count = 1;
foreach ($response->Response->leaderboard as $row) {
if ($row->membershipType == 1) {
$image = "xbox";
} else {
$image = "playstation";
}
?>
<tr>
<td><?=$count?></td>
<td><img width="20" height="20" src="/img/<?=$image?>-icon-black.svg" /> <a href="/<?=$image?>/<?=strtolower($row->displayName)?>"><?=$row->displayName?></a></td>
<td rel="tooltip" class="leaderboard-hours"><?=$row->timePlayed?></td>
</tr>
<?php
$count++;
}
?>
<tr>
<td colspan="3"><span class="lead">Total players: <?=$response->Response->totalPlayers?></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title"><img width="20" height="20" src="/img/question-icon.svg" /> FAQ</h3>
</div>
<div class="panel-body text-left">
<blockquote>
<p class="disclaimer"><strong>Do I have to add deleted time to the total time?</strong><br/>The total time includes time spent on deleted characters.</p>
<p class="disclaimer"><strong>This is only about half my time on another website!</strong><br/>The time displayed does not include idle time spent in the Tower, Reef, or waiting in orbit.</p>
<p class="disclaimer"><strong>My username does not work!!!</strong><br/>If your username does not work, please <a href="https://github.com/BinarMorker/TimeWastedOnDestiny/issues">submit a bug</a>.</p>
<p class="disclaimer"><strong>Am I ranked against every player in the world?</strong><br/>No, you are only ranked against every player whose name has been entered on this website.</p>
</blockquote>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<span>Made with <span class="glyphicon glyphicon-heart"></span> by <a href="https://www.facebook.com/BinarMorker">François Allard (BinarMorker)</a></span>
<br/>
<span><a href="https://github.com/BinarMorker/TimeWastedOnDestiny/issues">Submit a bug</a> | <a href="https://github.com/BinarMorker/TimeWastedOnDestiny">Get the source code</a></span>
<br/>
<span class="text-muted">You can also use my simple API located <a href="/request.php?help">here</a>.</span>
</div>
</div>
</div>
<!-- JavaScript -->
<script>var damnAdBlock = false;</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="/js/bootstrap-switch.min.js"></script>
<script src="/js/damnadblock.js"></script>
<script src="/js/main.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-52347626-4', 'auto');
ga('send', 'pageview');
</script>
<script>
damnAdBlock = new BlockAdBlock({
checkOnLoad: true,
resetOnEnd: true
});
function adBlockDetected() {
$("#a-d-v-e-r-t").html('<div class="panel panel-danger"><div class="panel-body"><blockquote><span class="lead">Our website uses ads to pay for hosting and traffic. If you like this website, <br/>please consider disabling your ad blocker or <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5YLYAY74SZP6W">donate</a>. Thanks!</span></blockquote></div></div>');
}
if(typeof damnAdBlock === 'undefined') {
adBlockDetected();
} else {
damnAdBlock.check(true);
damnAdBlock.onDetected(adBlockDetected);
}
</script>
</body>
</html>