From fba0211254059e3fedfb32054c118026c5f2ed3e Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Mon, 12 Dec 2011 23:40:18 -0800 Subject: Admin page now shows memberlist. Sound volume reduced to 50%. Social networks added to about. Minor adjustments. --- css/page.css | 7 +++ includes/mapoftheday.php | 2 +- includes/maps.php | 30 ++++++---- index.php | 10 +++- js/mapspecs.js | 42 ++++--------- pages/about.php | 16 ++++- pages/admin.php | 153 ++++++++++++++++++++++++----------------------- pages/leaderboard.php | 9 ++- 8 files changed, 149 insertions(+), 120 deletions(-) diff --git a/css/page.css b/css/page.css index 3421113..0237797 100644 --- a/css/page.css +++ b/css/page.css @@ -147,3 +147,10 @@ table.score th { vertical-align: text-bottom; overflow: hidden; } +#facebook { + border: none; + width: 95px; + height: 21px; + vertical-align: text-bottom; + overflow: hidden; +} diff --git a/includes/mapoftheday.php b/includes/mapoftheday.php index 62b44a4..4112f94 100644 --- a/includes/mapoftheday.php +++ b/includes/mapoftheday.php @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/includes/maps.php b/includes/maps.php index 2e80eb1..1f350ad 100644 --- a/includes/maps.php +++ b/includes/maps.php @@ -141,13 +141,25 @@ function DisplayMap($mapMatrix, $idprefix = 1, $style = 'normal', $speed = NULL) if ($example) { $output = $maptable; - $output .= ""; $output .= " -
- - +
+ +
+ +
+ +
+ +
+ $mutebutton +
+ +
+
+ 0 moves +
"; $output .= $mapdatadiv; @@ -167,23 +179,19 @@ function DisplayMap($mapMatrix, $idprefix = 1, $style = 'normal', $speed = NULL)
- -
-
0 moves
- +
".$mapdata['walls']." walls
- $maptable diff --git a/index.php b/index.php index a14249f..82bceaf 100644 --- a/index.php +++ b/index.php @@ -72,7 +72,7 @@ switch (strtolower($_GET[page])) { if ($_SESSION['isAdmin'] == true) require 'pages/memberlist.php'; else - require 'pages/memberlist.php'; + require 'pages/about.php'; break; case "logout": @@ -84,7 +84,15 @@ switch (strtolower($_GET[page])) { session_destroy(); header("Location: $mydomain"); break; + + case "users": + require 'pages/users.php'; + break; + case "challenge": + require 'pages/challenge.php'; + break; + case "home": //No break here Default: diff --git a/js/mapspecs.js b/js/mapspecs.js index 00bde30..8659b7a 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -104,12 +104,12 @@ function grid_click(obj) { function updateDsp(mapid, element, data) { if (mapdata[mapid] == undefined) return; - if (mapdata[mapid].example != true) { - if (document.getElementById(mapid+','+element) != undefined) { - handle = document.getElementById(mapid+','+element); - handle.innerHTML = data; - } + //if (mapdata[mapid].example != true) { + if (document.getElementById(mapid+','+element) != undefined) { + handle = document.getElementById(mapid+','+element); + handle.innerHTML = data; } + //} } function getmapdata(mapid) { @@ -405,25 +405,7 @@ function doanimate(x, y, p, c, mapid) { case 'g': case 'i': case 'k': - //case 'n': - // if (t == "u" || t == "n") { - //alert("teleport"); - //if (checkSound(mapid)) { - //soundManager.play('bling'); - //soundManager.play('sc'); - //soundManager.play('ufoblip'); - //soundManager.play('002'); - //soundManager.play('003'); - //soundManager.setVolume('click', 50); - //soundManager.play('click'); - //soundManager.play('charm'); - //} - //flashelement(eid, 4); - - // } else { - // break; - // } - //Targets + case 'q': //Teleport out; case 'b': case 'c': @@ -446,9 +428,8 @@ function doanimate(x, y, p, c, mapid) { //Sound effects if (c == 'r') { if (checkSound(mapid)) { + soundManager.setVolume('bling', 50); soundManager.play('bling'); - //soundManager.play('blip'); - //soundManager.play('charm'); } } @@ -484,6 +465,9 @@ function doanimate(x, y, p, c, mapid) { //if anything worth mentioning happend let them know. if (disptext != "") { if (checkSound(mapid)) { + soundManager.setVolume('charm', 50); + soundManager.setVolume('bling', 50); + soundManager.setVolume('sc', 50); soundManager.play('charm'); soundManager.play('bling'); soundManager.play('sc'); @@ -586,15 +570,13 @@ function doanimate(x, y, p, c, mapid) { //Teleport Element ID tpEid = mapid+','+x+','+y; if (checkSound(mapid)) { + soundManager.setVolume('ufoblip', 50); soundManager.play('ufoblip'); - //soundManager.play('002'); - //soundManager.play('003'); } document.getElementById(eid).style.backgroundColor='#CCCCCC'; document.getElementById(tpEid).style.backgroundColor='#CCCCCC'; - //flashelement(eid, 7); - flashelement(tpEid, 8, snake[mapid]['color']); + flashelement(tpEid, 8, snake[mapid]['color']); //The path once teleported - and an r to indicate to gray the teleport-out too. p = 'q'+tmp[2]; diff --git a/pages/about.php b/pages/about.php index 9181a87..ab46c57 100644 --- a/pages/about.php +++ b/pages/about.php @@ -2,14 +2,26 @@ htmlHeader(array()); ?> + +
- Email us: snapems@gmail.com -
+ Email us: snap@pathery.com +

Follow us on twitter: + + +

Like us on facebook: + + + +
Follow us on Google Plus: + + +

Created by:

Patrick Davison (Snap) and Rex Ounekeo diff --git a/pages/admin.php b/pages/admin.php index d825ebc..90060c2 100644 --- a/pages/admin.php +++ b/pages/admin.php @@ -10,84 +10,89 @@ include('./includes/maps.php'); include('./includes/mapoftheday.php'); include('./includes/db.inc.php'); -//$motd = MapOfTheDay(3); -//$mapID = $motd['id']; - -$pastMap = pastMap(3, 1); -$mapID = $pastMap; - -echo $mapID; - -//$mapID = '38'; -$mapcode = getMapCode($mapID); -$map = GenerateMapByCode($mapcode); - -$sql = "SELECT `moves`, `displayName`, `solution` - FROM `solutions`, `users` - WHERE `mapID` = '$mapID' AND - `userID` = users.ID - ORDER BY `moves` DESC, `dateModified` ASC - LIMIT 1"; - -$result = mysql_query($sql) or die(mysql_error()); -if (mysql_num_rows($result) > 0) { - list($bestMoves, $byName, $solution) = mysql_fetch_row($result); - echo "
Best solution for this map: $bestMoves by $byName"; - - //$map = MergeMapSolution($motd['map'], $solution); - $map = MergeMapSolution($map, $solution); - echo DisplayMap($map, $mapID); - - echo "
"; - echo "
Is Current:"; - $is = isCurrentMap(77); - echo "
$is"; - $is = isCurrentMap(20); - echo "
$is"; - $is = isCurrentMap(76); - echo "
$is"; - $is = isCurrentMap(75); - echo "
$is"; - $is = isCurrentMap(74); - echo "
$is"; - echo "
"; - -} -function isCurrentMap($mapID) { - include_once('./includes/db.inc.php'); - $sql = "SELECT `ID` FROM `mapOfTheDay` - WHERE `mapDate` = CURDATE() AND - `mapID` = '$mapID' - "; - $result = mysql_query($sql) or die(mysql_error()); - if (mysql_num_rows($result) == 0) - return false; - else - return true; +$sql = "SELECT `ID`, `displayName`, `dateJoined`, `dateLogin`, `email`, `isAdmin` FROM `users`"; +$result = mysql_query($sql); + +echo " +
+

Administrators Page

+

News:

+

Hello admins, this is our current userlist.

+
+ + + + +"; + +while (list($CUID, $CUsername, $Joined, $LastLogon, $email, $isAdmin) = mysql_fetch_row($result)) { + + //$Joined = Date("d/m/y - g:ia", $Joined); + $Joined = strtotime($Joined); + //$Joined = relative_date($Joined); + $Joined = date("Y-m-d", $Joined); + + $LastLogon = strtotime($LastLogon); + //$LastLogon = relative_date($LastLogon); + $LastLogon = date("Y-m-d", $LastLogon); + + if ($isAdmin == 1) + $isAdmin = "Yes"; + else + $isAdmin = "No"; + + + Echo " + + + + + + +"; + } +Echo " +
IDDisplay name:Joined On:Last LogonEmailAdministrator
$CUID$CUsername$Joined$LastLogon$email$isAdmin
+
+
+ + + +"; + + +//Thank you: +//http://snippets.dzone.com/posts/show/196 +function relative_date($time) { + $today = strtotime(date('M j, Y')); + $reldays = ($time - $today)/86400; + if ($reldays >= 0 && $reldays < 1) { + return 'Today'; + } else if ($reldays >= 1 && $reldays < 2) { + return 'Tomorrow'; + } else if ($reldays >= -1 && $reldays < 0) { + return 'Yesterday'; + } + if (abs($reldays) < 7) { + if ($reldays > 0) { + $reldays = floor($reldays); + return 'in ' . $reldays . ' day' . ($reldays != 1 ? 's' : ''); + } else { + $reldays = abs(floor($reldays)); + return $reldays . ' day' . ($reldays != 1 ? 's' : '') . ' ago'; + } + } + if (abs($reldays) < 182) { + return date('l, F j',$time ? $time : time()); + } else { + return date('l, F j, Y',$time ? $time : time()); + } +} -echo "
"; -echo "
"; -echo "
Solution before"; -echo "
"; -echo $solution; -echo "
"; -echo "
Solution after"; -echo "
"; -$solution = formSolution($solution); -echo $solution; -echo "
"; -echo "
"; -echo "
"; -// echo "
The map for today: -//
Once logged in your best solutions for the map(s) are saved. -//
- Soon i'll fix it so you can see those solutions, and compare them with others. -//
- New maps are generated daily, at 9:00 PM Pacific Standard. (for now...) -//
"; -// echo DisplayMap($motd['map'], $motd['id']); @@ -226,4 +231,4 @@ function createThumbnail($mapMatrix, $idprefix, $width, $height) { } htmlFooter(); -?> +?> \ No newline at end of file diff --git a/pages/leaderboard.php b/pages/leaderboard.php index d69d9fd..143188f 100644 --- a/pages/leaderboard.php +++ b/pages/leaderboard.php @@ -181,7 +181,7 @@ function displayPastMaze($mapType, $name, $daysago = 1) { echo '
'; echo "Best solution for this map: $bestMoves by $byName "; - echo DisplayMap($map, $mapID, true, 2); + echo DisplayMap($map, $mapID, 'example', 2); echo '
'; echo '
'; } @@ -272,6 +272,13 @@ function showStats(type) { showStats(0); +
+ Copyright © 2011 pathery.com +
+ + + + -- cgit v1.2.3