summaryrefslogtreecommitdiffstats
path: root/includes/header.php
blob: 1e24e8ccee26e7292cae5dae0560f5d14dc6f188 (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
<?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']);

    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

		var fo = document.createElement('link');
		fo.rel = 'stylesheet';
		fo.type = 'text/css';
		fo.href = "http://fonts.googleapis.com/css?family=Cantarell:400,700";
		var l = document.getElementsByTagName('link')[0]; l.parentNode.appendChild(fo);
		document.getElementsByTagName('body')[0].style.fontFamily = 'cantarell, helvetica, sans-serif';
    })();
	</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>";
}

?>