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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
|
<?php
ob_start("ob_gzhandler");
include_once ('./includes/maps.php');
include_once ('./includes/mapoftheday.php');
include_once ('./includes/db.inc.php');
include_once ('./includes/datas.php');
htmlHeader(
array('stats'), 'Pathery',
'Compete to create the longest path possible. New maps every day!',
array('scores', 'dateformat')
);
$noteScript = '';
if ($accepted) {
//$note = getNotified($userID);
$note = false;
if ($note !== false) {
//$note = str_replace("'", "\'", $note);
//Double your slashes double your fun (Required)
$note = addslashes($note);
$note = addslashes($note);
$noteScript = "
<script type='text/javascript'>
setTimeout(\"showNotification('".$note."');\", 1000);
if (getCookie('pref_mute') != 'true') {
setTimeout(\"soundManager.setVolume('achieve', 40);\", 1340);
setTimeout(\"soundManager.play('achieve');\", 1350);
}
</script>
";
}
}
?>
<body>
<?
//<script src="sounds/script/soundmanager.js"></script>
//<script type="text/javascript">soundManagerInit();</script>
//<script src="sounds/script/soundmanager2.js"></script>
?>
<?
$soundManager1 = '
<div>
<script src="sounds/script/soundmanager.js"></script>
<script type="text/javascript">soundManagerInit();</script>
</div>
';
$soundManager2 = "
<script src='sounds/script/soundmanager2-nodebug-jsmin.js'></script>
<script>
soundManager.setup({
url: '/sounds/swf/',
flashVersion: 9, // optional: shiny features (default = 8)
useFlashBlock: false, // optionally, enable when you're ready to dive in/**
onready: function() {
// Ready to use; soundManager.createSound() etc. can now be called.
soundManager.createSound({id: 'achieve',url: '/sounds/achieve.mp3',autoLoad: true,volume: 50});
soundManager.createSound({id: 'ufoblip', url: '/sounds/ufoblip.mp3',autoLoad: true,volume: 50});
soundManager.createSound({id: 'bling', url: '/sounds/bling.mp3',autoLoad: true,volume: 50});
soundManager.createSound({id: 'blingb', url: '/sounds/blingb.mp3',autoLoad: true,volume: 50});
soundManager.createSound({id: 'charm',url: '/sounds/charm.mp3',autoLoad: true,volume: 50});
soundManager.createSound({id: 'blip',url: '/sounds/blip.mp3',autoLoad: true,volume: 50});
soundManager.createSound({id: 'cap',url: '/sounds/cap.mp3'});
soundManager.createSound({id: 'click',url: '/sounds/click.mp3'});
soundManager.createSound({id: 'sc',url: '/sounds/transmission.mp3'});
soundManager.createSound({id: 'hologram',url: '/sounds/hologram.mp3'});
}
});
</script>
";
//echo $soundManager1;
echo $soundManager2;
?>
<script type="text/javascript">
playerWallColor = '<?PHP echo isset($wallColor) ? $wallColor : ''; ?>';
playerWallEmblem = '<?PHP echo isset($wallEmblem) ? $wallEmblem : ''; ?>';
</script>
<!-- Advertisement -->
<script type="text/javascript">
// use PHP VAR
var showAd;
if (getCookie("pref_showAd") != "yes") {
showAd = "no";
} else {
showAd = "yes";
}
function adToggle() {
var adContainer = document.getElementById("adContainer");
var adBtn = document.getElementById("adBtn");
if (showAd == "yes") {
adContainer.setAttribute("class", "adHidden");
adBtn.innerHTML = "<a href='javascript:adToggle()'>Show</a>";
showAd = "no";
} else {
adContainer.setAttribute("class", "adContainer");
adBtn.innerHTML = "<a href='javascript:adToggle()'>Hide</a>";
showAd = "yes";
}
savePref("showAd", showAd);
}
</script>
<?php
topbar($Links);
$showAd = ($_COOKIE['pref_showAd'] == "yes");
$adClass = 'adHidden';
$adShow = 'Hide';
if ($showAd) {
$adClass = 'adContainer';
$adShow = 'Show';
}
$adContent = "
<div class='adOuter'>
<div class='adBar'>
<div class='float' style='width:89%; '>Ad:</div>
<div class='float' id='adBtn' style='width:10%; text-align:right;'>
<a href='javascript:adToggle()'>$adShow</a>
</div>
</div><div class='$adClass' id='adContainer'>
<script type='text/javascript' language='javascript' src='http://www.dpbolvw.net/placeholder-6466820?target=_blank&mouseover=N'></script>
</div>
</div>
<div style='clear: both'></div>";
?>
<div class="wrapper">
<center>12/12/12 - We're introducing a new map & mechanic!
I'd like to hear what you think about it!
<br />Send me a line at the <a href="feedback">Feedback Page</a>.
<br />Wir führen eine neue Map und einen neün Mechanismus ein!
Ich wüsste gern, was du davon hältst!
Schick mir einfach eine Zeile auf der <a href="feedback">Feedback-Seite</a>.
</center>
<br />
<?
if ($accepted) {
if (!hasCompletedTutorial($userID)) {
echo "<center><a href='tutorial'>Complete the tutorial</a> to unlock a blue wall color:";
echo "<table><tr><td style='background-color:#4444ff;' class='grid_td_rocks'></td></tr></table></center><br />";
}
}
// 3 Main maps
$motd = MapOfTheDay(1);
$jmid[1] = $motd['id'];
$mapContent = displayMaze($motd, 1);
$mapNames[1] = 'Simple';
$motd = MapOfTheDay(2);
$jmid[2] = $motd['id'];
$mapContent .= displayMaze($motd, 2);
$mapNames[2] = 'Normal';
// Complex Map
$motd = MapOfTheDay(3);
$jmid[3] = $motd['id'];
$mapContent .= displayMaze($motd, 3);
$mapNames[3] = $motd['map'][0][6];
if ($mapNames[3] == '') {
$mapNames[3] = 'Complex';
}
// Additional or special maps:
$motd = MapOfTheDay(4);
$jmid[4] = $motd['id'];
$mapContent .= displayMaze($motd, 4);
$mapNames[4] = $motd['map'][0][6];
if ($mapNames[4] == '') {
$mapNames[4] = 'Special';
}
// $motd = MapOfTheDay(5);
// $jmid[5] = $motd['id'];
// $mapContent .= displayMaze($motd, 5);
// $special2 = $motd['map'][0][6];
// if ($special2 == '') {
// $special2 = 'Special';
// }
echo ' <div id="difficulties">';
foreach ($mapNames as $key => $value) {
echo " <a href='javascript:showStats($key)' id='dl-$key'>$value</a>\n";
}
echo '
</div>
<div style="clear: both"></div>';
?>
<noscript>Sorry, this game requires scripts to run. Please enable javascript and <a href='home'>Reload this site</a>
<br />This game is best viewed in <a href='http://www.google.com/chrome'>Google Chrome</a>
</noscript>
<? echo $mapContent; ?>
<?
function displayMaze($motd, $mapType) {
global $accepted, $userID;
//Gather data for map;
$mapID = $motd['id'];
$map = $motd['map'];
$width = $map[0][0];
//data for the topscores
//$topscores = topScores($motd['id'], 30);
//$topscorediv = "<div id='$mapID,dspScore'>\n$topscores\n</div>";
$topscorediv = "
<div class='scoreContainer2' style='position:relative;' id='$mapID,dspScore'>
</div>
<script>scoresShowPage($mapID, 1);</script>
";
$mysolution = '';
$mymoves = '';
if ($accepted) {
$sol = getSolution($userID, $mapID);
$mysolution = $sol['solution'];
//TODO: implement mymoves
$mymoves = $sol['moves'];
}
if (isset($_SESSION[$mapID.'sol']) && $mysolution == '') {
$mysolution = $_SESSION[$mapID.'sol'];
$mymoves = $_SESSION[$mapID.'moves'];
}
$r = "<div id=\"yms-$mapType\" class='hidden-maps'>";
$r .= " <div class='wrapper'>";
$r .= " <div style='text-align: center;'>";
$r .= " <div style='display:inline-block;margin: 0 auto;text-align: left;'>";
$r .= " <a href='javascript:requestSol(\"$mapID\");'><strong>Load your best solution</strong></a><br />";
$r .= DisplayMap($map, $mapID);
$r .= " </div></div>";
$r .= " <div style='padding-top: 20px;'>";
$r .= $topscorediv;
$r .= ' </div>';
$r .= ' </div>';
$r .= '</div>';
$mapSolDiv = "<script>
loadSol(\"$mapID:$mysolution\", \"$mymoves\");
</script>";
$r .= $mapSolDiv;
//Clear our floatingness
$r .= '<div style="clear: both"></div>';
return $r;
}
$timerem = strtotime("tomorrow") - strtotime("now");
?>
<div style='text-align: center; margin-top: 5px; position:fixed; bottom:20px; left:20px;'>
<span id="countdown">New maps</span>
</div>
<script type="text/javascript">
var countdownInt = self.setInterval(countdown, 1000);
var tomorrow = new Date();
//We're counting down to "tomorrow"
tomorrow.setTime(tomorrow.getTime() + <? echo $timerem; ?> * 1000);
var userConfirm = true;
var formatedTomorrow = tomorrow.format("ddd h:MM TT");
function countdown() {
var now = new Date();
now.setTime(now.getTime());
//Find the difference in seconds between now and tomorrow.
var timerem = tomorrow.getTime() - now.getTime();
timerem = timerem / 1000;
var totalSeconds = timerem;
if (timerem < 1)
window.clearInterval(countdownInt);
var hours = addZero(timerem/3600);
timerem = timerem%3600;
var minutes = addZero(timerem/60);
timerem = timerem%60;
var seconds = addZero(timerem);
var stamp = hours + ":" + minutes;
//if (hours < 1 && minutes < 5)
stamp = stamp + ":" + seconds
stamp = 'New maps ' + formatedTomorrow + '<br />Time remaining: ' + stamp;
document.getElementById("countdown").innerHTML = stamp;
if (totalSeconds <= 1 && userConfirm == true) {
userConfirm = confirm("It's Tomorrow Today! Go to new maps?")
if (userConfirm) {
location.reload(true);
}
}
}
function addZero(num) {
num = Math.floor(num);
var numStr = num + '';
if (numStr.length < 2)
numStr = "0" + numStr;
return numStr;
}
</script>
</div>
<script>
var jmid=new Array();
<?
echo " jmid[0] = '1';\n";
foreach ($jmid as $key => $value) {
echo "jmid[$key] = '$value';\n";
}
?>
function showStats(type) {
for (var i = 1; i < jmid.length; i++) {
var elem = document.getElementById("yms-" + i);
elem.className = elem.className.replace('shown-maps', 'hidden-maps');
elem = document.getElementById("dl-" + i);
elem.className = elem.className.replace('selected', '');
}
elem = document.getElementById("yms-" + type);
elem.className = elem.className.replace('hidden-maps', 'shown-maps');
elem = document.getElementById("dl-" + type);
if (elem.className.indexOf('selected') < 0)
elem.className += 'selected';
scoresRequestPage(jmid[type], currentPage[jmid[type]]);
}
showStats(1);
</script>
<?PHP echo $noteScript; ?>
<?php
htmlFooter();
?>
|