summaryrefslogtreecommitdiffstats
path: root/includes/header.php
blob: 9340c3fa666a29c2dbcb7e59a56c223157171ec7 (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
<?PHP

function htmlHeader($css) {
?>
<!DOCTYPE html>
<html xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>pathery.com</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\" />";
	}
	?>
    <script src="js/ajax.js" async="async"></script>
    <script src="js/mapspecs.js" async="async"></script>
</head>
<?
}

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;
		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';
		var s = document.getElementsByTagName('script')[0];
		s.parentNode.appendChild(ga, s);

		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.parentNode.appendChild(wf, 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='?page=$key' class='nav$selected'>$value</a>";
	}

	echo "<div id='user'>";
	if ($_SESSION['accepted'] == 1) {
		echo "Logged in as <a href='?page=cp' title='change name'>$_SESSION[displayName]</a><br>";
		if ($_SESSION['displayName'] == 'noname')
			echo "<a href='?page=cp' title='change name'>Update your name</a> | ";
		echo "<a href='?page=logout'>Logout</a>";
	} else
		echo "<a href='?page=login'>Sign in with Google</a>";
	echo "</div>";

	echo "</div>";
}

?>