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
|
<?php
function htmlHeader($css = array(), $title = 'Pathery', $desc = '', $scripts = array()) {
global $accepted;
$resourceVer = '050513';
?>
<!DOCTYPE html>
<html xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title><? echo $title; ?></title>
<link href="css/page.css?v=050513.css" rel="stylesheet" type="text/css" />
<?
if (isset($_GET['skin']) AND $_GET['skin'] == 'true') {
echo '<link href="skin/cute/css/maps.css" rel="stylesheet" type="text/css" />';
} else {
echo "<link href='css/maps.css?v=$resourceVer.css' rel='stylesheet' type='text/css' />";
}
?>
<link rel="image_src" type="image/png" href="/images/linkdsp.png" />
<?php
foreach ($css as $c) {
echo " <link href=\"css/$c.css?v=$resourceVer.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
}
if ($desc !== '') echo " <meta name='Description' content='$desc'>";
foreach ($scripts as $s) echo "<script src='js/$s.js?v=$resourceVer.js'></script>";
?>
<script src="js/ajax.js" async="async"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="js/mapspecs.js?v=050513.js"></script>
<script src="js/globe.js?v=050513.js></script>
<script>
(function(c,a){window.mixpanel=a;var b,d,h,e;b=c.createElement("script");b.type="text/javascript";b.async=!0;b.src=("https:"===c.location.protocol?"https:":"http:")+'//cdn.mxpnl.com/libs/mixpanel-2.1.min.js';d=c.getElementsByTagName("script")[0];d.parentNode.insertBefore(b,d);a._i=[];a.init=function(b,c,f){function d(a,b){var c=b.split(".");2==c.length&&(a=a[c[0]],b=c[1]);a[b]=function(){a.push([b].concat(Array.prototype.slice.call(arguments,0)))}}var g=a;"undefined"!==typeof f?
g=a[f]=[]:f="mixpanel";g.people=g.people||[];h="disable track track_pageview track_links track_forms register register_once unregister identify name_tag set_config people.identify people.set people.increment".split(" ");for(e=0;e<h.length;e++)d(g,h[e]);a._i.push([b,c,f])};a.__SV=1.1})(document,window.mixpanel||[]);
mixpanel.init("24743c6567f831ddfcbbbd3f397e11e4");
<?php
if ($accepted) {
if ($_SESSION['displayName'] != 'noname')
echo 'mixpanel.name_tag(' . json_encode($_SESSION['displayName']) . ');';
if ($_SERVER['HTTP_HOST'] == 'www.pathery.com') {
echo 'mixpanel.identify(' . json_encode($_SESSION['userID']) . ');';
echo 'mixpanel.people.identify(' . json_encode($_SESSION['userID']) . ');';
}
}
?>
</script>
<script>
function showSignin() {
if (typeof document.getElementById('oid_hidden') !== 'undefined') {
document.getElementById('oid_hidden').id = 'oid_wrapper';
}
}
function hideSignin() {
if (typeof document.getElementById('oid_wrapper') !== 'undefined') {
document.getElementById('oid_wrapper').id = 'oid_hidden';
}
}
<? echo userDataToJS(); ?>
</script>
</head>
<?php
}
function htmlFooter() {
//Preload the path-images and add the google-analytics script
global $footerLinks;
echo "<div class='divide'></div>";
echo " <div class='footerArea' style='width:100%;clear: both'><ul id='triple'>";
foreach ($footerLinks as $key => $value) {
echo "<li><a href='$key'>$value</a></li>";
}
echo " </ul></div>";
?>
<div class="copyAndButtons">
<div id="copy">
Copyright © 2011-2013 pathery.com
</div>
<div id="socialButtons" class='buttons'>
<a href='http://www.facebook.com/Pathery' target='top' title='Facebook'><img alt='Facebook' src='images/btns/facebook.png' /></a>
<a href='http://www.reddit.com/r/Pathery' target='top' title='Reddit'><img alt='Reddit' src='images/btns/reddit.png' /></a>
<a href='https://twitter.com/Pathery' target='top' title='Twitter'><img alt='Twitter' src='images/btns/twitter.png' /></a>
<a href='https://plus.google.com/105148482605711831543' target='top' title='Google Plus'><img alt='Google Plus' src='images/btns/googleplus.png' /></a>
</div>
</div>
<br />
<div style='visibility:hidden;display:none'>
<img src='images/MedalGoldCAR.png' alt=''>
<img src='images/MedalSilverCAR.png' alt=''>
<img src='images/paths/Path1-1.png' alt=''>
<img src='images/paths/Path1-2.png' alt=''>
<img src='images/paths/Path1-3.png' alt=''>
<img src='images/paths/Path1-4.png' alt=''>
<img src='images/paths/Path2-1.png' alt=''>
<img src='images/paths/Path2-2.png' alt=''>
<img src='images/paths/Path2-3.png' alt=''>
<img src='images/paths/Path2-4.png' alt=''>
<img src='images/OverlayTileFaceted50.png' alt=''>
<img src='images/OverlayTileFaceted30.png' alt=''>
<img src='images/OverlayTileFaceted10.png' alt=''>
<img src='images/OverlayTileFaceted20.png' alt=''>
<img src='images/OverlayStart2.png' alt=''>
<img src='images/OverlayA50.png' alt=''>
<img src='images/OverlayB50.png' alt=''>
<img src='images/OverlayC50.png' alt=''>
<img src='images/TeleportOutW.png' alt=''>
<img src='images/TeleportInW.png' alt=''>
</div>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-371072-3']);
_gaq.push(['_trackPageview']);
WebFontConfig = {
google: {
families: ['Cantarell:400,700:latin']
}
};
(function() {
var proto = document.location.protocol,
s = document.getElementsByTagName('script')[0].parentNode;
var wf = document.createElement('script');
wf.src = ('https:' == proto ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
s.appendChild(wf, s);
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == proto ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
s.parentNode.appendChild(ga, s);
<?
if (isset($_SESSION['displayName'])) {
echo "mixpanel.people.set({
\$email: " . json_encode($_SESSION['email']) . ",
\$username: " . json_encode($_SESSION['displayName']) . ",
\$last_login: '" . date(DateTime::ISO8601) . "',
\$created: '" . $_SESSION['dateJoined'] . "'
});";
}
?>
})();
</script>
</body>
</html>
<?
}
function topbar($links) {
global $accepted, $wallColor, $wallEmblem, $wallOrientation, $request;
//Empty first-div contains sound manager stuff
echo '<div></div>';
//echo '<script>createSignin();</script>';
echo ' <div class="wrapper" id="oid_hidden" >
<h2>Sign in</h2>
<div id="oid_box">
<h2 style="color:#333;">Do you have an account here?</h2>
<a rel="nofollow" href="login?op=google"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>
<a rel="nofollow" href="login?op=yahoo"><img id="oid_btn" src="images/btns/signin_Yahoo.png" alt="Sign in with Yahoo" /></a>
<a id="oid_learn" href="http://openid.net/get-an-openid/what-is-openid/" target="_blank" >Learn more about OpenID</a>
<a id="oid_cancel" href="javascript:hideSignin();">X</a>
</div>
</div>';
echo '<div id="topbar"><div id="topbarContent">';
foreach ($links as $key => $value) {
if ($request == $key) {
$selected = " selected";
} else {
$selected = "";
}
echo "<a href='$key' class='nav$selected'>$value</a>";
}
echo "<div id='user'>";
if ($accepted) {
echo " <div style='float:left;'>";
echo " Logged in as <a href='cp' title='change name'>$_SESSION[displayName]</a><br>";
if ($_SESSION['displayName'] == 'noname')
echo " <a href='cp' title='change name'>Update your name</a> | ";
echo " <a href='logout'>Logout</a>";
echo " </div>";
echo "<div id='topbarBadge' style='background-color: $wallColor; background-image: url(".linkEmblem($wallEmblem, $wallOrientation).");'>
<a href='achievements'><div class='topbarBadgeInner'></div></a>
</div>";
} else {
?>
<a href='javascript:showSignin();'>Sign in</a>
<?
}
echo " </div>";
echo "</div></div><div class='topbarSpacer'></div>"; //div id='user'
}
function userDataToJS() {
global $wallColor, $wallEmblem, $wallOrientation, $accepted;
if (!$accepted) {
$r = 'var userObj = {"wallColor":false,"wallEmblem":false,"wallOrientation":false,';
$r .= '"ID":"-1","accepted":false,"hasInsaneSpeed":false};';
} else {
$userID = $_SESSION['userID'];
include_once('includes/datas.php');
$hasInsaneSpeed = hasExtrasUnlock($userID, UNLOCK_EXTRAS, MISC_UNLOCK_INSANE_SPEED);
$r = 'hasInsaneSpeed":'.$hasInsaneSpeed.'};'."\n";
$json = array('ID' => 'fat');
$json['ID'] = $userID;
$json['wallColor'] = $wallColor;
$json['wallEmblem'] = $wallEmblem;
$json['wallOrientation'] = $wallOrientation;
$json['hasInsaneSpeed'] = $hasInsaneSpeed;
$json['accepted'] = 'true';
$encoded = json_encode($json);
$r = 'var userObj = decryptJSON(\''.json_encode($json).'\');'."\n";
}
return $r;
}
?>
|