From f8c9eb5220afaf2f9a62f9a176a45913240f4081 Mon Sep 17 00:00:00 2001 From: raylu Date: Thu, 7 Apr 2011 00:27:27 -0400 Subject: Initial import from Dropbox --- includes/datas.php | 1 + includes/db.inc.php | 11 + includes/header.php | 67 +++++ includes/mapoftheday.php | 1 + includes/maps.php | 743 +++++++++++++++++++++++++++++++++++++++++++++++ includes/openid.php | 740 ++++++++++++++++++++++++++++++++++++++++++++++ includes/pathing.php | 108 +++++++ 7 files changed, 1671 insertions(+) create mode 100644 includes/datas.php create mode 100644 includes/db.inc.php create mode 100644 includes/header.php create mode 100644 includes/mapoftheday.php create mode 100644 includes/maps.php create mode 100644 includes/openid.php create mode 100644 includes/pathing.php (limited to 'includes') diff --git a/includes/datas.php b/includes/datas.php new file mode 100644 index 0000000..0d3d0c5 --- /dev/null +++ b/includes/datas.php @@ -0,0 +1 @@ + 0) { $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; while (list($diff, $display, $moves, $userID) = mysql_fetch_row($result)) { $i++; if ($_SESSION['userID'] == $userID) $output .= ""; else $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; //$output .= "$i. $display with $moves moves. In $diff
"; $output .= ""; } $output .= "
RankNameMovesTime taken
$i$display$moves$diff
"; } return $output; } ?> \ No newline at end of file diff --git a/includes/db.inc.php b/includes/db.inc.php new file mode 100644 index 0000000..8e9bdfb --- /dev/null +++ b/includes/db.inc.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/includes/header.php b/includes/header.php new file mode 100644 index 0000000..53c1a82 --- /dev/null +++ b/includes/header.php @@ -0,0 +1,67 @@ + + + + + + + + + Snapems.com Mazegame + + + + + + +'; + + $page = $_GET[page]; + if ($page == '') + $page = 'home'; + $first = true; + foreach ($links as $key => $value) { + if ($first) + $first = false; + else + echo ' | '; + if ($page == $key) + echo "$value"; + else + echo "$value"; + } + + echo "\t
"; + if ($_SESSION['accepted'] == 1) { + echo "Logged in as $_SESSION[displayName].\n"; + echo "Logout"; + if ($_SESSION['displayName'] == 'noname') + echo "Update your name"; + } else + echo "Sign in using Google"; + + echo "\t
"; + echo ""; +} + +?> diff --git a/includes/mapoftheday.php b/includes/mapoftheday.php new file mode 100644 index 0000000..cd646cb --- /dev/null +++ b/includes/mapoftheday.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/includes/maps.php b/includes/maps.php new file mode 100644 index 0000000..acb4c6c --- /dev/null +++ b/includes/maps.php @@ -0,0 +1,743 @@ +"; + for($j = 0; $j < count($mapMatrix[$i]); $j++) + { + //== + $index++; + + $handle = "$idprefix,$i,$j"; + switch($mapMatrix[$i][$j]) + { + case 's': $maptable .= ""; break; + case 'f': $maptable .= ""; break; + + //TP1 + case 't': $maptable .= ""; break; + case 'u': $maptable .= ""; break; + //TP2 + case 'm': $maptable .= ""; break; + case 'n': $maptable .= ""; break; + //TP3 + case 'g': $maptable .= ""; break; + case 'h': $maptable .= ""; break; + //TP4 + case 'i': $maptable .= ""; break; + case 'j': $maptable .= ""; break; + //TP5 + case 'k': $maptable .= ""; break; + case 'l': $maptable .= ""; break; + + case 'a': $maptable .= ""; break; + case 'b': $maptable .= ""; break; + case 'c': $maptable .= ""; break; + case 'd': $maptable .= ""; break; + case 'e': $maptable .= ""; break; + + case 'r': $maptable .= ""; break; //rock + case 'w': $maptable .= ""; break; //wall + //default: $maptable .= "".$index.""; + default: $maptable .= ""; + //default: $maptable .= "".$mapMatrix[$i][$j].""; + } + } + $maptable .= ""; + } + //Prepare mapdata. + $mapdata['height'] = $mapMatrix[0][0]; + $mapdata['width'] = $mapMatrix[0][1]; + $mapdata['points'] = $mapMatrix[0][2]; + $mapdata['rocks'] = $mapMatrix[0][3]; + $mapdata['walls'] = $mapMatrix[0][4]; + $mapdata['teleports'] = $mapMatrix[0][5]; + $mapdata['example'] = $example; + $mapdata['mapid'] = $idprefix; + + $path = routePath($mapMatrix, ''); + $mapdata['code'] = GenerateMapCode($mapMatrix); + + $width = (($j * 35) + 2).'px'; + //$width = (($j * 23) + 2).'px'; + $i -= 1; + $height = (($i * 35)).'px'; + //$height = (($i * 22) + 2).'px'; + + $jsonmap = json_encode($mapdata); + $mapdatadiv .= "'; + + $maptable = " + $maptable +
"; + + + $prefSpeed = $_COOKIE['pref_speed']; + $speedOption['Slow'] = 1; + $speedOption['Med'] = 2; + $speedOption['Fast'] = 3; + $speedOption['Ultra'] = 4; + if (!in_array($prefSpeed, $speedOption)) + $prefSpeed = '2'; + + foreach ($speedOption as $key => $value) { + $rOption .= "