summaryrefslogtreecommitdiffstats
path: root/includes/header.php
blob: a1dbfa4ae478681666b9a43cea45d3a0ce847e3c (plain)
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
<?php

function htmlHeader($css = array(), $title = 'Pathery', $desc = '') {
	?>
<!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" rel="stylesheet" type="text/css" />
	<link href="css/maps.css" rel="stylesheet" type="text/css" />
<?php
	foreach ($css as $c) {
		echo "	<link href=\"css/$c.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
	}
	if ($desc !== '') 
		echo "	<meta name='Description' content='$desc'>";
?>
	<script src="js/ajax.js" async="async"></script>
	<script src="js/mapspecs.js"></script>

    <script>
	(function(d,c){var a,b,g,e;a=d.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===d.location.protocol?"https:":"http:")+'//api.mixpanel.com/site_media/js/api/mixpanel.2.js';b=d.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";g="disable track track_pageview track_links track_forms register register_once unregister identify name_tag set_config".split(" ");
	for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]);
	mixpanel.init("24743c6567f831ddfcbbbd3f397e11e4");
<?php
	if ($_SESSION['accepted'] == 1) {
		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']) . ');';
	}
?>
    </script>
</head>
	<?php
}

function htmlFooter() {
	?>
    <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);
    })();
	</script>

</body>
</html>
<?
}

function topbar($links) {
	echo '<div id="topbar">';

	$page = $_GET[page];
	if ($page == '')
		$page = 'home';
	foreach ($links as $key => $value) {
		if ($page == $key)
			$selected = " selected";
		else
			$selected = "";
		echo "<a href='$domain$key' class='nav$selected'>$value</a>";
	}

	echo "<div id='user'>";
	if ($_SESSION['accepted'] == 1) {
		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>";
	} else
		echo "<a href='login'>Sign in with Google</a>";
	echo "</div>";

	echo "</div>";
}

?>