summaryrefslogtreecommitdiffstats
path: root/pages/home.php
blob: 044fc5fbf81b4ebc95d769c99f597707ab131c63 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?PHP
htmlHeader(array('stats'));
?>

<body>
<?php
include('./includes/maps.php');
include('./includes/mapoftheday.php');

include('./includes/datas.php');

//Get the current day as int.
$numday = date('w');
$numday = intval($numday);
switch ($numday) {
	case 0:
		$mapstyle = 'Thirty';
		break;
	case 1:
		$mapstyle = 'Simple';
		break;
	case 2:
		$mapstyle = "ABC's";
		break;
	case 3:
		$mapstyle = 'Teleport Madness';
		break;
	case 4:
		$mapstyle = 'Rocky Maze';
		break;
	case 5:	//Friday
		$mapstyle = 'Side to Side';
		break;
	case 6:	//Saturday
		$mapstyle = "Seeing Double";
		break;
}

$easy = '<a href="?page=home&amp;maptype=easy">Simple</a>';
$normal = '<a href="?page=home&amp;maptype=normal">Normal</a>';
$hard = '<a href="?page=home&amp;maptype=hard">Complex</a>';

$today = date('l') . "'s";
$special = "<a href=\"?page=home&amp;maptype=day\">$today $mapstyle</a>";

switch ($_GET['maptype']) {
	case "easy":
	case "1":
	default:
		$maptype = 1;
		$easy = '<a href="?page=home&amp;maptype=easy" class="selected">Simple</a>';
		break;
	case "normal":
	case "2":
		$maptype = 2;
		$normal = '<a href="?page=home&amp;maptype=normal" class="selected">Normal</a>';
		break;
	case "hard":
	case "3":
		$maptype = 3;
		$hard = '<a href="?page=home&amp;maptype=hard" class="selected">Complex</a>';
		break;
	case "day":
	case "4":
		$maptype = 4;
		$special = "<a href=\"?page=home&amp;maptype=day\" class=\"selected\">$today $mapstyle</a>";
		break;
}

//$motd = getMapOfTheDay();
$motd = MapOfTheDay($maptype);

topbar($Links);

$mapID = $motd['id'];
$map = $motd['map'];
$userID = $_SESSION['userID'];
//$mergesolution = mergeMapSolution($map, $mysolution);
$topscores = topScores($motd['id'], 30);
$topscorediv = "<div id='$mapID,dspScore'>\n$topscores\n</div>";
$mergesolution = $map;

?>

<div class="wrapper">
	<?
	echo "<div id='difficulties'>";
	echo "$easy";
	echo "$normal";
	echo "$hard";
	echo "$special";
	echo "</div>";

	echo DisplayMap($mergesolution, $mapID);

	$mysolution = getSolution($userID, $mapID);
	$solutiondiv .= "<div id='mapsol' style='visibility:hidden;display:none'>";
	$solutiondiv .=  $mapID.":".$mysolution;
	$solutiondiv .=  '</div>';

	echo $solutiondiv;

	echo $topscorediv;
?>

	<div id="fb">
	</div>
</div>

<div id="copy">
	<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com/pages/Pathery/176985129018434&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;font&amp;colorscheme=dark&amp;height=21"></iframe>
	Copyright &copy; 2011 pathery.com
</div>

<script src="sounds/script/soundmanager.js" async="async"></script>
<script type="text/javascript">soundManagerInit();</script>

<?php
htmlFooter();
?>