From c69cb2733718a76027f3a0d5715ea5961f063431 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 12 Mar 2013 18:36:44 -0700 Subject: .pit sound added to soundmanager. Also see $mydomain --- globe.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/globe.php b/globe.php index 2e75a9a..7353e74 100644 --- a/globe.php +++ b/globe.php @@ -7,8 +7,9 @@ if (!session_id()) //Database login: //include_once 'sqlEmbedded.php'; -//TODO: CONFIRM THIS DOMAIN BEFORE TRANSFER +//!! CONFIRM THIS DOMAIN BEFORE TRANSFER //$mydomain = "http://www.mazetd.4xg.net/"; +//$mydomain = "http://www.blue.4xg.net/ $mydomain = "http://www.pathery.com/"; function LogError($error) { @@ -49,6 +50,8 @@ soundManager.setup({ soundManager.createSound({id: 'click',url: '/sounds/click.mp3'}); soundManager.createSound({id: 'sc',url: '/sounds/transmission.mp3'}); soundManager.createSound({id: 'hologram',url: '/sounds/hologram.mp3'}); + soundManager.createSound({id: 'pit',url: '/sounds/pit.mp3'}); + soundManager.createSound({id: 'select',url: '/sounds/select.mp3'}); } }); -- cgit v1.2.3 From 247e7df7abf9fdd9b4bad6653cb8c17a9ea9e6e4 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 12 Mar 2013 20:10:28 -0700 Subject: Login issue fix. --- pages/login.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/login.php b/pages/login.php index f3510c0..f8a5ba7 100644 --- a/pages/login.php +++ b/pages/login.php @@ -52,7 +52,7 @@ try { $claimedid = $openid->__get('identity'); //I know just where to put this stuff! - require './includes/sqlEmbedded.php'; + include_once('./includes/sqlEmbedded.php'); //Unless I already have this information... //* Modify this to WHERE `email` //$sql = "SELECT `ID`, `isAdmin`, `openID`, `displayName` FROM `users` WHERE `email` = '$email'"; -- cgit v1.2.3 From 7d04d4f7e177365e711200e72d8211f474f7265e Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 12 Mar 2013 20:10:53 -0700 Subject: Couple htaccess deny-from-all to hide files. --- changelog/.htaccess | 1 + includes/.htaccess | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelog/.htaccess create mode 100644 includes/.htaccess diff --git a/changelog/.htaccess b/changelog/.htaccess new file mode 100644 index 0000000..3418e55 --- /dev/null +++ b/changelog/.htaccess @@ -0,0 +1 @@ +deny from all \ No newline at end of file diff --git a/includes/.htaccess b/includes/.htaccess new file mode 100644 index 0000000..3418e55 --- /dev/null +++ b/includes/.htaccess @@ -0,0 +1 @@ +deny from all \ No newline at end of file -- cgit v1.2.3 From 96803882ec2a7677f9e92f1707636b589edca461 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 12 Mar 2013 22:46:55 -0700 Subject: Scoreboard dynamic map width. --- css/stats.css | 2 +- js/mapspecs.js | 9 ++------- pages/scores.php | 5 +---- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/css/stats.css b/css/stats.css index 28d190a..bfb9571 100644 --- a/css/stats.css +++ b/css/stats.css @@ -97,7 +97,7 @@ .scoreCol { min-height:500px; - min-width:277px; + min-width:325px; float:left; } .mapCol { diff --git a/js/mapspecs.js b/js/mapspecs.js index 688c9dc..dbb1c60 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -852,17 +852,12 @@ function mapAsHTML(map, targetWidth, mapEditor) { //console.log("MapObj", map); mapdata[map.ID] = map; + //Map bigger than target width? if (!targetWidth || (map.width * 35) <= targetWidth) { + //Use standard size. targetWidth = (map.width * 35); } - else - { - //Need to take into account padding of .grid_outer - var fakeGridDom = $('
'); - var gridOuterPadding = parseInt(fakeGridDom.css('padding-left')) + parseInt(fakeGridDom.css('padding-right')); - targetWidth -= gridOuterPadding; - } var scale = map.width / targetWidth; //alert(scale); diff --git a/pages/scores.php b/pages/scores.php index 3f252ec..fc86b4f 100644 --- a/pages/scores.php +++ b/pages/scores.php @@ -118,10 +118,7 @@ function displayMapScores(mapID) { scoresShowPage(pointerPage, mapID); - //Create a fake DOM element to determine the margin-left of the map, to get the target width - var fakeMapDom = $('
'); - var mapMargin = parseInt(fakeMapDom.css('margin-left')); - var targetWidth = $('.mapNavCon').width() - $('#scoreDisplay').width() - mapMargin; + targetWidth = parseInt($('.wrapper').css("width")) - parseInt($('.scoreCol').css("width")); displayMap(mapID, "mapDisplay", targetWidth); } -- cgit v1.2.3 From a444a1d8117c17f221899524a0d14df6dd65aaec Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 12 Mar 2013 22:58:30 -0700 Subject: BUGFIX: "Tomorrow today" not executing --- pages/home.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/home.php b/pages/home.php index 8c88d49..4a3c8a6 100644 --- a/pages/home.php +++ b/pages/home.php @@ -308,7 +308,7 @@ $timeUntilNewWeeklyMap = strtotime(getNextWeeklyMapDateTime()) - strtotime("now" document.getElementById("countdown").innerHTML = newMapStr; //TODO: It would not be very hard to dynamically load the new map w/o refresh. - if (timerem <= 1 && userConfirm == true) { + if (timerem <= 1000 && userConfirm == true) { userConfirm = confirm("It's Tomorrow Today! Go to new maps?") if (userConfirm) { location.reload(true); -- cgit v1.2.3 From 1c9f62a731637f1d373485473f064626d311d705 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 12 Mar 2013 23:15:31 -0700 Subject: I'm lazy, and I'm not sure there's a point to this command! --- pages/admin.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pages/admin.php b/pages/admin.php index c0a142f..86317a3 100644 --- a/pages/admin.php +++ b/pages/admin.php @@ -16,8 +16,14 @@ include_once('./includes/chats.php'); if ($_GET['applyall'] == 'true') { echo "Apply-All command heard. Executing..."; + //TODO: Horrible hackery shall follow... + $res = mysqli_query($mysqli, "SELECT count(*) as count FROM `users`"); + $row = mysqli_fetch_assoc($res); + $memberCount = $row['count']; + $x = 0; - while ($x <= 200) { + // +40 because there's missing userID's... Don't judge me...- I'm going to fix it. + while ($x <= $memberCount + 40) { $x++; $i = 0; while ($i <= 4) { -- cgit v1.2.3 From 32cce4bee8a242f7a2e6d6a9e1c9e77b4af87728 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Wed, 13 Mar 2013 02:26:09 -0700 Subject: Achievement back-end for Insane Speed - and any other 'Extra' unlocks like it. --- includes/constants.php | 28 +++++++++++++++ includes/datas.php | 92 ++++++++++++++++++++++++++++++++++---------------- pages/achievements.php | 80 +++++++++++++++++++++---------------------- 3 files changed, 129 insertions(+), 71 deletions(-) diff --git a/includes/constants.php b/includes/constants.php index a6826b1..7b32819 100644 --- a/includes/constants.php +++ b/includes/constants.php @@ -75,4 +75,32 @@ $mapNamesByType = array(1 => 'Simple', 2 => 'Normal', 3 => 'Complex', 4 => 'Spec * Make sure the first one is always 0... */ $tierChallengeRequirements = array(0, 5, 10, 15, 20, 25, 30); + + + +/** + * Unlock Types + */ +define('UNLOCK_WALL_COLOR', 1); +define('UNLOCK_WALL_EMBLEM', 2); +define('UNLOCK_DISPLAY_COLOR', 3); +define('UNLOCK_WALL_ROTATION', 4); +define('UNLOCK_EXTRAS', 8); +// MISC SUBTYPES: + +define('MISC_UNLOCK_INSANE_SPEED', 1); + +/** + * Achievement Types + */ +define('ACHIEVEMENT_MOVES_CAREER', 1); +define('ACHIEVEMENT_MAZE_CAREER', 2); +define('ACHIEVEMENT_MAZE_MASTERY', 3); +define('ACHIEVEMENT_CHAMPION_POINTS', 4); +define('ACHIEVEMENT_PERFECT_DAY', 5); + +define('ACHIEVEMENT_TUTORIAL', 32); + + + ?> diff --git a/includes/datas.php b/includes/datas.php index 74487fd..7e64732 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -19,7 +19,7 @@ function getNotified($userID) { FROM `achievements` WHERE `notified` = false AND userID = '$userID' - LIMIT 25"; + LIMIT 5"; $resultA = mysql_query($sql); if (mysql_num_rows($resultA) <= 0) @@ -54,20 +54,7 @@ function getNotified($userID) { if (mysql_num_rows($result) >= 1) { $unlocked = "You've unlocked: "; while (list($uType, $uName, $uValue) = mysql_fetch_row($result)) { - switch ($uType) { - case 1: - $unlocked .= "$uName Wall Color!"; - $unlocked .= "
"; - break; - case 2: - $unlocked .= "$uName Emblem!"; - $unlocked .= "
"; - $unlocked .= "
"; - break; - case 3: - $unlocked .= "
$uName Username color!
"; - break; - } + $unlocked .= displayUnlock($uType, $uValue, $uName); } } // ---------- Prepare response @@ -110,6 +97,32 @@ function getNotified($userID) { // ---------- Done! } +function displayUnlock($uType, $uValue, $uName) { + switch ($uType) { + case UNLOCK_WALL_COLOR: + $r .= "$uName Wall Color!"; + $r .= "
"; + break; + + case UNLOCK_WALL_EMBLEM: + $r .= "$uName Emblem!"; + $r .= "
"; + //$r .= "
"; + $r .= "
"; + break; + + case UNLOCK_DISPLAY_COLOR: + $r .= "
$uName Username color!"; + break; + + case UNLOCK_EXTRAS: + $r .= "Extras: $uName"; + break; + } + return $r; +} + + //Returns true when an achievement is applied. // Usage example: applyCareerAchievement($userID); // TODO: DEPRECIATED @@ -531,13 +544,25 @@ function getAchievementCurrency($userID, $aType) { $sql = "SELECT championPoints FROM `users` WHERE `ID` = '$userID'"; + break; + case 5: + $sql = "SELECT count(*) + FROM solutions + INNER JOIN mapOfTheDay ON solutions.mapID = mapOfTheDay.mapID + WHERE mapOfTheDay.mapType + IN ( 1, 2, 3, 4 ) + AND solutions.userID = '$userID' + GROUP BY solutions.userID, mapOfTheDay.mapDate + HAVING COUNT( isTiedForHighScore ) = 4"; + $result = mysql_query($sql) OR die("SQL query failed; $sql"); + return mysql_num_rows($result); break; } - if ($sql == '') - return false; + if ($sql == '') return false; $result = mysql_query($sql) OR die("SQL query failed; $sql"); - if (mysql_num_rows($result) == 1) + if (mysql_num_rows($result) == 1) { list($r) = mysql_fetch_row($result); + } return $r; } @@ -552,22 +577,20 @@ function getAchievementLevel($userID, $aType) { ORDER BY `level` DESC LIMIT 1"; $result = mysql_query($sql); - if (mysql_num_rows($result) == 1) + if (mysql_num_rows($result) == 1) { list($r) = mysql_fetch_row($result); + } return $r; } function getAchievementsArray($type) { - if ($type == 1) - return getCareerPathArray(); - if ($type == 2) - return getCareerMazesArray(); - if ($type == 3) - return getMazeMasteryArray(); - if ($type == 4) - return getChampionPointsArray(); + if ($type == ACHIEVEMENT_MOVES_CAREER) return getCareerPathArray(); + if ($type == ACHIEVEMENT_MAZE_CAREER) return getCareerMazesArray(); + if ($type == ACHIEVEMENT_MAZE_MASTERY) return getMazeMasteryArray(); + if ($type == ACHIEVEMENT_CHAMPION_POINTS) return getChampionPointsArray(); + if ($type == ACHIEVEMENT_PERFECT_DAY) return getPerfectDayArray(); //Tutorial - if ($type == 32) { + if ($type == ACHIEVEMENT_TUTORIAL) { $r[1] = array(1, 1, '#4444ff', 'Blue'); return $r; } @@ -655,11 +678,22 @@ function getChampionPointsArray() { $r[7] = array(8000, 2, 'CrossXLDonut_B_I.png', 'Inverted Dark Large Intersection', 0); $r[8] = array(16000, 2, 'DiamondLarge_B.png', 'Dark Large Diamond', 0); $r[9] = array(32000, 1, '#22ff22', 'Neon Lime', 1); - //$r[7] = array(75, 2, 'CircleSmall_W_I.png', 'Inverted Bright Small Circle', 0); return $r; } +//TYPE 5 +function getPerfectDayArray() { + //$cp[0] = array(requiredpoints, type, 'value', 'name'); + $r[1] = array(1, UNLOCK_EXTRAS, MISC_UNLOCK_INSANE_SPEED, 'Insane Speed'); + //These numbers temporarly unreasonable + $r[2] = array(9275, UNLOCK_WALL_EMBLEM, 'CircleSmall_W_I.png', 'Inverted Bright Small Circle', 0); + $r[3] = array(10000, UNLOCK_WALL_EMBLEM, 'DiamondLarge_W_I.png', 'Inverted Light Large Diamond', 0); + + return $r; +} + + //Select Members function getMembers($pageNumber = 1, $pageDivide = 50, $order = 'DESC', $orderBy = 'dateJoined') { diff --git a/pages/achievements.php b/pages/achievements.php index 249077c..a5e56ed 100644 --- a/pages/achievements.php +++ b/pages/achievements.php @@ -20,8 +20,9 @@ else // $userID = 3; $viewer = true; -if ($userID == $_SESSION['userID']) +if ($userID == $_SESSION['userID']) { $viewer = false; +} if ($_GET['apply'] == 'true') { applyCareerMazesAchievements($userID); @@ -69,9 +70,9 @@ echo ""; $debug = false; -if ($_GET['debuglevels'] == 'yes') +if ($_GET['debuglevels'] == 'yes') { $debug = true; - +} if ($_GET['showemblems'] == 'all') { @@ -147,10 +148,11 @@ return("#".substr("000000".dechex($n),-6)); //Self-healing code for unlocks. if (!$viewer) { - applyAchievements($userID, 1); - applyAchievements($userID, 2); - applyAchievements($userID, 3); - applyAchievements($userID, 4); + applyAchievements($userID, ACHIEVEMENT_MOVES_CAREER); + applyAchievements($userID, ACHIEVEMENT_MAZE_CAREER); + applyAchievements($userID, ACHIEVEMENT_MAZE_MASTERY); + applyAchievements($userID, ACHIEVEMENT_CHAMPION_POINTS); + applyAchievements($userID, ACHIEVEMENT_PERFECT_DAY); } ?> @@ -307,8 +309,9 @@ order by maxLevel.type"; $result = mysql_query($sql); if ($result) { - while ($row = mysql_fetch_assoc($result)) + while ($row = mysql_fetch_assoc($result)) { $achievements[$row['type']] = $row; + } } @@ -358,35 +361,41 @@ echo "
$UDisplay"; -function displayUnlockItem($uType, $item) { +function unlockItemAsTD($uType, $item) { $aLevel = $item['aLevel']; $aCompleted = $item['dateUnlocked']; - $aTypeNames[1] = "Path Career Level $aLevel"; - $aTypeNames[2] = "Mazes Career Level $aLevel"; - $aTypeNames[3] = "Maze Mastery Level $aLevel"; - $aTypeNames[4] = "Champion Level $aLevel"; - $aTypeNames[32] = 'Completing Tutorial'; + $aTypeNames[ACHIEVEMENT_MOVES_CAREER] = "Path Career Level $aLevel"; + $aTypeNames[ACHIEVEMENT_MAZE_CAREER] = "Mazes Career Level $aLevel"; + $aTypeNames[ACHIEVEMENT_MAZE_MASTERY] = "Maze Mastery Level $aLevel"; + $aTypeNames[ACHIEVEMENT_CHAMPION_POINTS] = "Champion Level $aLevel"; + $aTypeNames[ACHIEVEMENT_PERFECT_DAY] = "Perfect Days $aLevel"; + $aTypeNames[ACHIEVEMENT_TUTORIAL] = 'Completing Tutorial'; $by = $aTypeNames[$item['aType']]; $on = relative_date(strtotime($aCompleted)); $unlockTitle = "$item[name]. From $by $on"; - if ($item['aType'] == -1) + if ($item['aType'] == -1) { $unlockTitle = "$item[name]"; + } $border = 'border: 1px solid #000; border-width: 2px 0px 2px 0px;'; $border = 'border: 1px solid #000;'; $class = 'grid_td_walls'; + //$r .= displayUnlock($uType, $item[value], $unlockTitle); + //return $r; + switch ($uType) { - case 1: + case 1: if ($GLOBALS['wallColor'] == $item[value]) { $class = 'grid_td_active'; $border = 'border: 1px solid #26b;'; } $r .= ""; break; - case 2: + + case 2: if ($GLOBALS['wallEmblem'] == $item[value]) { $class = 'grid_td_active'; $border = 'border: 1px solid #26b;'; @@ -394,13 +403,18 @@ function displayUnlockItem($uType, $item) { $r .= "
"; break; - case 3: + + case 3: if ($GLOBALS['nameColor'] == $item[value]) $border = 'border: 1px solid #26b;'; $r .= ""; $r .= " $item[name] "; $r .= ""; break; + + case UNLOCK_EXTRAS: + $r .= "$item[name]"; + break; } return $r; } @@ -408,11 +422,12 @@ function displayUnlockItem($uType, $item) { if (isset($unlocks)) { echo "

Unlocks

"; - + //Define some names $uTypeNames[1] = "Wall Colors"; $uTypeNames[2] = "Emblems"; $uTypeNames[3] = "Username Colors"; + $uTypeNames[UNLOCK_EXTRAS] = "Extras"; $uSubtypeNames[1][0] = "Darker"; $uSubtypeNames[1][1] = "Brighter"; @@ -426,7 +441,7 @@ if (isset($unlocks)) { echo "

$uTypeNames[$uType] unlocked:

"; foreach ($unlock as $item) { - $subtype[$item['subtype']][] = displayUnlockItem($uType, $item); + $subtype[$item['subtype']][] = unlockItemAsTD($uType, $item); if ((sizeof($subtype[$item['subtype']]) + 1) % 14 == 0) $subtype[$item['subtype']][] = ''; } @@ -487,13 +502,14 @@ foreach($achievements as $aType => $a) { $aTypeNames[1] = "Path Career Level $aLevel!"; $aTypeNames[2] = "Mazes Career Level $aLevel!"; $aTypeNames[3] = "Maze Mastery Level $aLevel!"; - $aTypeNames[4] = "Champion Level $aLevel!"; + $aTypeNames[ACHIEVEMENT_CHAMPION_POINTS] = "Champion Level $aLevel!"; + $aTypeNames[ACHIEVEMENT_PERFECT_DAY] = "Perfect Day level $aLevel!"; $aTypeNames[32] = 'Tutorial Complete!'; $aTypeCurrency[1] = "total moves mazed"; $aTypeCurrency[2] = "mazes played"; $aTypeCurrency[3] = "mazes with (tied) top score"; - $aTypeCurrency[4] = "champion points"; + $aTypeCurrency[ACHIEVEMENT_CHAMPION_POINTS] = "champion points"; $name = $aTypeNames[$aType]; $currency = $aTypeCurrency[$aType]; @@ -543,26 +559,6 @@ foreach($achievements as $aType => $a) { } -function displayUnlock($uType, $uValue, $uName) { - switch ($uType) { - case 1: - $r .= "$uName Wall Color!"; - $r .= "
"; - break; - case 2: - $r .= "$uName Emblem!"; - $r .= "
"; - //$r .= "
"; - $r .= "
"; - break; - case 3: - $r .= "
$uName Username color!"; - break; - } - return $r; -} - - ?> -- cgit v1.2.3 From d26206b8dfb2f6c9775c0a7f111e0d4caed53fe7 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Wed, 13 Mar 2013 02:57:50 -0700 Subject: Insane speed achievement front end. --- includes/datas.php | 17 ++++++++++++++++- includes/header.php | 15 ++++++++++++--- js/mapspecs.js | 2 +- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/includes/datas.php b/includes/datas.php index 7e64732..83399c7 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -684,8 +684,9 @@ function getChampionPointsArray() { //TYPE 5 function getPerfectDayArray() { + //($required, $unlockType, $unlockValue, $unlockName, $unlockSubtype) //$cp[0] = array(requiredpoints, type, 'value', 'name'); - $r[1] = array(1, UNLOCK_EXTRAS, MISC_UNLOCK_INSANE_SPEED, 'Insane Speed'); + $r[1] = array(1, UNLOCK_EXTRAS, '5', 'Insane Speed', MISC_UNLOCK_INSANE_SPEED); //These numbers temporarly unreasonable $r[2] = array(9275, UNLOCK_WALL_EMBLEM, 'CircleSmall_W_I.png', 'Inverted Bright Small Circle', 0); $r[3] = array(10000, UNLOCK_WALL_EMBLEM, 'DiamondLarge_W_I.png', 'Inverted Light Large Diamond', 0); @@ -941,6 +942,20 @@ function hasCompletedTutorial($userID) { return (mysql_num_rows($result) >= 1); } +function hasExtrasUnlock($userID, $unlockType, $unlockSubtype) { + $userID = mysql_escape_string($userID); + $unlockType = mysql_escape_string($unlockType); + $unlockSubtype = mysql_escape_string($unlockSubtype); + + $sql = "SELECT `value` FROM `unlocks` + WHERE `userID` = '$userID' + AND `type` = '$unlockType' + AND `subtype` = '$unlockSubtype' + LIMIT 1"; + $result = mysql_query($sql); + return (mysql_num_rows($result) >= 1); +} + /** * Returns a MySQL resultset for all challenges for the given mapID * @param $mapIdUnsanitized The mapID to load. Assumed to be unsanitized. diff --git a/includes/header.php b/includes/header.php index cf427e4..5f0f679 100644 --- a/includes/header.php +++ b/includes/header.php @@ -203,11 +203,20 @@ function userDataToJS() { global $wallColor, $wallEmblem, $accepted; if (!$accepted) { $r = 'var userObj = {"wallColor":false,"wallEmblem":false,'; - $r .= '"ID":"-1","accepted":false};'; + $r .= '"ID":"-1","accepted":false,"hasInsaneSpeed":false};'; } else { $userID = $_SESSION['userID']; - $r = 'var userObj = {"wallColor":"'.$wallColor.'","wallEmblem":"'.$wallEmblem.'",'; - $r .= '"ID":"'.$userID.'","accepted":true};'; + $hasInsaneSpeed = hasExtrasUnlock($userID, UNLOCK_EXTRAS, MISC_UNLOCK_INSANE_SPEED); + $r .= 'hasInsaneSpeed":'.$hasInsaneSpeed.'};'."\n"; + $json = array('ID' => 'fat'); + $json['ID'] = $userID; + $json['wallColor'] = $wallColor; + $json['wallEmblem'] = $wallEmblem; + $json['hasInsaneSpeed'] = $hasInsaneSpeed; + $json['accepted'] = 'true'; + + $encoded = json_encode($json); + $r = 'var userObj = decryptJSON(\''.json_encode($json).'\');'."\n"; } return $r; } diff --git a/js/mapspecs.js b/js/mapspecs.js index dbb1c60..5a124b1 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -1013,7 +1013,7 @@ function getSpeedOptions(mapID) { listObj[2] = 'Med'; listObj[3] = 'Fast'; listObj[4] = 'Ultra'; - listObj[5] = 'Insane'; + if (userObj.hasInsaneSpeed) listObj[5] = 'Insane'; var r = ''; r += " $item[name] "; + $r .= ""; + break; case UNLOCK_EXTRAS: $r .= "$item[name]"; @@ -424,16 +464,17 @@ if (isset($unlocks)) { echo "

Unlocks

"; //Define some names - $uTypeNames[1] = "Wall Colors"; - $uTypeNames[2] = "Emblems"; - $uTypeNames[3] = "Username Colors"; + $uTypeNames[UNLOCK_WALL_COLOR] = "Wall Colors"; + $uTypeNames[UNLOCK_WALL_EMBLEM] = "Emblems"; + $uTypeNames[UNLOCK_DISPLAY_COLOR] = "Username Colors"; + $uTypeNames[UNLOCK_WALL_ORIENTATION] = "Emblem Rotations"; $uTypeNames[UNLOCK_EXTRAS] = "Extras"; - $uSubtypeNames[1][0] = "Darker"; - $uSubtypeNames[1][1] = "Brighter"; + $uSubtypeNames[UNLOCK_WALL_COLOR][0] = "Darker"; + $uSubtypeNames[UNLOCK_WALL_COLOR][1] = "Brighter"; - $uSubtypeNames[2][0] = "Simple"; - $uSubtypeNames[2][1] = "Complicated"; + $uSubtypeNames[UNLOCK_WALL_EMBLEM][0] = "Simple"; + $uSubtypeNames[UNLOCK_WALL_EMBLEM][1] = "Complicated"; //For every unlock type that the user has. foreach ($unlocks as $uType => $unlock) { @@ -463,6 +504,7 @@ echo "
"; if (!$viewer) { + //TODO add wall orientation echo "
@@ -470,6 +512,8 @@ if (!$viewer) { + + diff --git a/pages/chat.php b/pages/chat.php index 5be6689..68a0abf 100644 --- a/pages/chat.php +++ b/pages/chat.php @@ -101,7 +101,7 @@ function getChatDone(data) { p = ''; p = p+ "
"; p = p+ " ["+timestamp+"]"; - p = p+ "
"; + p = p+ "
"; p = p+ "
"; p = p+ "
"; p = p+ "
"; -- cgit v1.2.3 From cd3e53bbcd676e343f434ef67f0a8db969503187 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 19 Mar 2013 00:59:37 -0700 Subject: minor UI tweak to sign-in. --- css/page.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/page.css b/css/page.css index d396766..97f3882 100644 --- a/css/page.css +++ b/css/page.css @@ -149,7 +149,7 @@ a img {border: none;} /* IE specific: remove outline around image links */ #oid_box { width:500px; height:300px; - background-color:#ccc; + background-color:#999; padding: 5px 15px 5px 15px; box-shadow: 0 0 4px #888; border-radius: 10px; -- cgit v1.2.3 From bc57b007dfa5e6e723946143671a9db68a82f348 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 19 Mar 2013 00:59:53 -0700 Subject: UI Framework for processing tasks. --- index.php | 8 ++++ pages/process.php | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 pages/process.php diff --git a/index.php b/index.php index ed7a836..9e47971 100644 --- a/index.php +++ b/index.php @@ -230,6 +230,14 @@ switch ($request) { require 'pages/about.php'; } break; + + case "process": + if ($_SESSION['isAdmin'] == true) { + require 'pages/process.php'; + } else { + require 'pages/about.php'; + } + break; case "massemail": if ($_SESSION['isAdmin'] == true) { diff --git a/pages/process.php b/pages/process.php new file mode 100644 index 0000000..21604de --- /dev/null +++ b/pages/process.php @@ -0,0 +1,135 @@ += 100) $_SESSION['dotask'] = false; + + if ($_SESSION['dotask'] !== true) { + $json['percentComplete'] = $_SESSION['tmp']; + $json['taskName'] = $taskName; + $json['completed'] = true; + echo json_encode($json); + exit; + } + + $_SESSION['tmp'] = $_SESSION['tmp'] + 25; + + + $json['percentComplete'] = $_SESSION['tmp']; + $json['taskName'] = $taskName; + $json['completed'] = 'false'; + echo json_encode($json); + exit; +} + +if ($_REQUEST['command'] == 'recalculateStats') { + //Already working on a task? + if ($_SESSION['dotask'] == true) { + $json['error'] = 'Task in progress!'; + echo json_encode($json); + exit; + } + + $_SESSION['tmp'] = 0; + $_SESSION['dotask'] = true; + $json['percentComplete'] = $_SESSION['tmp']; + $json['taskName'] = 'FAKE_Recalculation of stats'; + echo json_encode($json); + exit; +} + +htmlHeader(array('stats', 'achievements'), 'Process Tasks', + 'Process Tasks', + array()); + + +?> + + + + + +
+ +

Task Processor

+
+ +
+ Load Map: +
+ Recalculate all statistics: +
+ Processing: "Loading..." +
+
+
+
+ +
+ + +
+
+ + \ No newline at end of file -- cgit v1.2.3