diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/achievements.php | 171 | ||||
-rw-r--r-- | pages/admin.php | 8 | ||||
-rw-r--r-- | pages/chat.php | 2 | ||||
-rw-r--r-- | pages/home.php | 2 | ||||
-rw-r--r-- | pages/login.php | 2 | ||||
-rw-r--r-- | pages/process.php | 135 | ||||
-rw-r--r-- | pages/scores.php | 5 |
7 files changed, 251 insertions, 74 deletions
diff --git a/pages/achievements.php b/pages/achievements.php index 249077c..fb20f2b 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);
@@ -54,8 +55,6 @@ foreach ($ac3 as $c3) { echo "</tr><tr>";
foreach ($ac1 as $c1) {
foreach ($ac2 as $c2) {
-
-
$c = "#$c1$c2$c3";
if ($_GET['showcolor'] == 'all') {
//echo "<td onclick='changeWallColor(\"#$c1$c2$c3\")' title='#$c1$c2$c3' style='background-color:#$c3$c1$c2;' class='grid_td_rocks'></td>";
@@ -69,9 +68,9 @@ echo "</tr></table>"; $debug = false;
-if ($_GET['debuglevels'] == 'yes')
+if ($_GET['debuglevels'] == 'yes') {
$debug = true;
-
+}
if ($_GET['showemblems'] == 'all') {
@@ -147,10 +146,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);
}
?>
@@ -175,7 +175,8 @@ function emblemclick(obj, emblem, unlockID) { if (viewer)
return;
var hbadge = document.getElementById('badge');
- hbadge.style.backgroundImage="url(images/marks/"+emblem+")";
+ var orientation = document.getElementById('selectOrientation').value;
+ hbadge.style.backgroundImage="url("+linkEmblem(emblem, orientation)+")"
document.getElementById('selectEmblem').value = emblem;
document.getElementById('selectEmblemID').value = unlockID;
}
@@ -188,6 +189,17 @@ function namecolorclick(obj, color, unlockID) { document.getElementById('selectNameColor').value = color;
document.getElementById('selectNameColorID').value = unlockID;
}
+function wallOrientationClick(obj, orientation, unlockID) {
+ if (viewer) return;
+ var emblem = document.getElementById('selectEmblem').value;
+ var hbadge = document.getElementById('badge');
+ hbadge.style.backgroundImage="url("+linkEmblem(emblem, orientation)+")";
+
+// hbadge.style.backgroundImage="url("+linkEmblem(emblem, +")";
+ document.getElementById('selectOrientation').value = orientation;
+ document.getElementById('selectOrientationID').value = unlockID;
+}
+
</script>
<?
@@ -199,6 +211,7 @@ function namecolorclick(obj, color, unlockID) { $unlocks[1][0] = array('id' => 0, 'subtype' => 0, 'name' => 'Default Charcoal', 'value' => '#666666', 'aType' => -1);
$unlocks[2][0] = array('id' => 0, 'subtype' => 0, 'name' => 'Default Blank', 'value' => 'blank.png', 'aType' => -1);
$unlocks[3][0] = array('id' => 0, 'subtype' => 0, 'name' => 'Default', 'value' => '#cccccc', 'aType' => -1);
+$unlocks[4][0] = array('id' => 0, 'subtype' => 0, 'name' => 'Default: (0*)', 'value' => '0', 'aType' => -1);
$sql = "SELECT
unlocks.id,
unlocks.type,
@@ -219,6 +232,9 @@ if ($result) { $unlocks[$row['type']][$row['id']] = $row;
}
+//Destroy some defaults to make them not show up.
+if (count($unlocks[3]) == 1) unset($unlocks[3]);
+if (count($unlocks[4]) == 1) unset($unlocks[4]);
//print_R($_POST);
@@ -235,12 +251,14 @@ if (isset($_POST['doupdate']) AND !$viewer) { $unlockIDNC = $_POST['selectNameColorID'];
$unlockNameColor = $unlocks[3][$unlockIDNC]['value'];
- if ($unlockIDC == 0)
- $unlockColor = '#666666';
- if ($unlockIDE == 0)
- $unlockEmblem = 'blank.png';
- if ($unlockIDNC == 0)
- $unlockNameColor = '#cccccc';
+ $orientationUnlockID = $_POST['selectOrientationID'];
+ $orientationNewValue = $unlocks[UNLOCK_WALL_ORIENTATION][$orientationUnlockID]['value'];
+
+ //Default values
+ if ($unlockIDC == 0) $unlockColor = '#666666';
+ if ($unlockIDE == 0) $unlockEmblem = 'blank.png';
+ if ($unlockIDNC == 0) $unlockNameColor = '#cccccc';
+ if ($orientationUnlockID == 0) $orientationNewValue = '0';
if ($unlockColor == $_POST['selectColor']) {
$sql = "UPDATE `users`
@@ -269,7 +287,6 @@ if (isset($_POST['doupdate']) AND !$viewer) { $data['post'] = print_r($_POST, true);
EmailError($data);
}
-
}
if ($unlockNameColor == $_POST['selectNameColor']) {
$sql = "UPDATE `users`
@@ -285,6 +302,20 @@ if (isset($_POST['doupdate']) AND !$viewer) { EmailError($data);
}
}
+ if ($orientationNewValue == $_POST['selectOrientation']) {
+ $sql = "UPDATE `users`
+ SET `wallOrientation` = '$orientationNewValue'
+ WHERE `ID` = '$userID'";
+ $result = mysql_query($sql);
+ if (!$result) {
+ echo "Error updating wall Orientation";
+ $data = array();
+ $data['error'] = "Error when updating wall orientation";
+ $data['session'] = print_r($_SESSION, true);
+ $data['post'] = print_r($_POST, true);
+ EmailError($data);
+ }
+ }
}
$achievements = array();
@@ -307,8 +338,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;
+ }
}
@@ -322,7 +354,8 @@ SELECT users.totalMazes AS totalSolutions,
users.wallColor,
users.displayColor,
- users.wallEmblem
+ users.wallEmblem,
+ users.wallOrientation
FROM `users`
LEFT JOIN `solutions`
ON users.ID = solutions.userID
@@ -338,7 +371,7 @@ if (!$result OR mysql_num_rows($result) <= 0) { htmlFooter();
exit;
}
-list($UDisplay, $UAdmin, $UTotalMoves, $UTotalSolutions, $wallColor, $nameColor, $wallEmblem) = mysql_fetch_row($result);
+list($UDisplay, $UAdmin, $UTotalMoves, $UTotalSolutions, $wallColor, $nameColor, $wallEmblem, $wallOrientation) = mysql_fetch_row($result);
if ($wallEmblem == '')
$wallEmblem = 'blank.png';
@@ -350,43 +383,50 @@ $uStats[1] = $UTotalMoves; $uStats[2] = $UTotalSolutions;
echo "<div class='wrapper' style='padding-left:30px; width:800px;'>";
-if ($viewer)
- echo "<center><h3>Viewing</h3></center>";
+if ($viewer) echo "<center><h3>Viewing</h3></center>";
+
+$badgeURL = linkEmblem($wallEmblem, $wallOrientation);
echo "
<h1 id='badgeheader' style='margin-left:10px;color:$nameColor;'>
-<div id='badge' style='margin-right:10px; background:$wallColor url(../images/marks/$wallEmblem);float:left;background-size:100%;' class='badge'>
+<div id='badge' style='margin-right:10px; background:$wallColor url($badgeURL);float:left;background-size:100%;' class='badge'>
<div style='width:100%; height:100%; background-color:transparent; background-size:100%;' class='grid_td_rocks grid_inner'></div>
</div>$UDisplay</h1>";
-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 UNLOCK_WALL_COLOR:
if ($GLOBALS['wallColor'] == $item[value]) {
$class = 'grid_td_active';
$border = 'border: 1px solid #26b;';
}
$r .= "<td class='grid_td $class' id='color_$item[id]' title='$unlockTitle' onClick='colorclick(this,\"$item[value]\", \"$item[id]\")' style='padding: 0px;background-color:$item[value];$border'></td>";
break;
- case 2:
+
+ case UNLOCK_WALL_EMBLEM:
if ($GLOBALS['wallEmblem'] == $item[value]) {
$class = 'grid_td_active';
$border = 'border: 1px solid #26b;';
@@ -394,13 +434,27 @@ function displayUnlockItem($uType, $item) { $r .= "<td class='grid_td_walls' title='$unlockTitle' id='' onClick='emblemclick(this,\"$item[value]\", \"$item[id]\")' style='background: #999 url(../images/marks/$item[value]);$border' >
<div class='grid_inner $class grid_td_walls'></div></td>";
break;
- case 3:
+
+ case UNLOCK_DISPLAY_COLOR:
if ($GLOBALS['nameColor'] == $item[value])
$border = 'border: 1px solid #26b;';
$r .= "<td class='name_color_select'><span title='$unlockTitle' onClick='namecolorclick(this,\"$item[value]\", \"$item[id]\")' style='color:$item[value]; margin-right:15px;$border'>";
$r .= " $item[name] ";
$r .= "</span></td>";
break;
+
+ case UNLOCK_WALL_ORIENTATION:
+ $checked = '';
+ if (intval($GLOBALS['wallOrientation']) == intval($item[value])) $checked = 'checked';
+ //$r .= "<td class='name_color_select'>";
+ $r .= "<td class='name_color_select'>";
+ $r .= "<input onClick='wallOrientationClick(this,\"$item[value]\", \"$item[id]\")' type='radio' name='wallOrientation' value='male' $checked>$item[name] ";
+ $r .= "</td>";
+ break;
+
+ case UNLOCK_EXTRAS:
+ $r .= "<td style='border: 1px solid gray;' class='name_color_select' title='$unlockTitle'>$item[name]</td>";
+ break;
}
return $r;
}
@@ -408,17 +462,19 @@ function displayUnlockItem($uType, $item) { if (isset($unlocks)) {
echo "<h2>Unlocks</h2>";
-
+
//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) {
@@ -426,7 +482,7 @@ if (isset($unlocks)) { echo "<h3>$uTypeNames[$uType] unlocked:</h3>";
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']][] = '</tr></table><table><tr>';
}
@@ -448,6 +504,7 @@ echo "<br />"; if (!$viewer) {
+ //TODO add wall orientation
echo "
<form action='achievements' method='post' name='updateBadge'>
<input id='doupdate' type='hidden' name='doupdate' value='true' />
@@ -455,6 +512,8 @@ if (!$viewer) { <input id='selectColorID' type='hidden' name='selectColorID' value='' />
<input id='selectEmblem' type='hidden' name='selectEmblem' value='$wallEmblem' />
<input id='selectEmblemID' type='hidden' name='selectEmblemID' value='' />
+ <input id='selectOrientation' type='hidden' name='selectOrientation' value='$wallOrientation' />
+ <input id='selectOrientationID' type='hidden' name='selectOrientationID' value='' />
<input id='selectNameColor' type='hidden' name='selectNameColor' value='$nameColor' />
<input id='selectNameColorID' type='hidden' name='selectNameColorID' value='' />
<input type='submit' value='Save Changes' />
@@ -476,8 +535,7 @@ foreach($achievements as $aType => $a) { $aCompleted = $a['dateCompleted'];
$aCompleted = relative_date(strtotime($aCompleted));
- if (!isset($uStats[$aType]))
- $uStats[$aType] = getAchievementCurrency($userID, $aType);
+ if (!isset($uStats[$aType])) $uStats[$aType] = getAchievementCurrency($userID, $aType);
$uStats[$aType] = str_replace(",", "", $uStats[$aType]);
@@ -487,13 +545,14 @@ foreach($achievements as $aType => $a) { $aTypeNames[1] = "<img src='../images/Achievement_PathCareer.png' style='width:36px;height:36px;vertical-align:middle'>Path Career Level $aLevel!";
$aTypeNames[2] = "<img src='../images/Achievement_MazeCareer.png' style='width:36px;height:36px;vertical-align:middle'>Mazes Career Level $aLevel!";
$aTypeNames[3] = "<img src='../images/MedalSilverCAR.png' style='width:36px;height:36px;vertical-align:middle'>Maze Mastery Level $aLevel!";
- $aTypeNames[4] = "<img src='../images/championpoints.png' style='width:36px;height:36px;vertical-align:middle'>Champion Level $aLevel!";
+ $aTypeNames[ACHIEVEMENT_CHAMPION_POINTS] = "<img src='../images/championpoints.png' style='width:36px;height:36px;vertical-align:middle'>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 +602,6 @@ foreach($achievements as $aType => $a) { }
-function displayUnlock($uType, $uValue, $uName) {
- switch ($uType) {
- case 1:
- $r .= "$uName Wall Color!";
- $r .= "<table><tr><td onclick='changeWallColor(\"$uValue\")' style='background-color:$uValue;' class='grid_td_rocks'></td></tr></table>";
- break;
- case 2:
- $r .= "$uName Emblem!";
- $r .= "<div class='emblemDisplay' title='' style='background: #999 url(../images/marks/$uValue);' >";
- //$r .= "<div class='grid_inner grid_td_gray'></div></div>";
- $r .= "<div class='emblemDisplayInner' style='width:35px; height:35px;'></div></div>";
- break;
- case 3:
- $r .= "<br /><span style='color:$uValue;font-weight:bold;font-size:110%;background-color:#222;'>$uName Username color!</span>";
- break;
- }
- return $r;
-}
-
-
?>
</div>
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) {
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+ " <div class='chatColumn1'>";
p = p+ " <span class='chatTimestamp' title='"+timestampDetails+"'>["+timestamp+"]</span>";
- p = p+ " <div class='grid_td chatBadge' style='float:left; width:35px; height:35px; background:"+chat.wallColor+" url(images/marks/"+chat.wallEmblem+");'>";
+ p = p+ " <div class='grid_td chatBadge' style='float:left; width:35px; height:35px; background:"+chat.wallColor+" url("+linkEmblem(chat.wallEmblem, chat.wallOrientation)+");'>";
p = p+ " <div style='background-color:transparent;' class='grid_td_inner grid_td_rocks'>";
p = p+ " </div>";
p = p+ " </div>";
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);
diff --git a/pages/login.php b/pages/login.php index bcd3b39..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!
- include_once('./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'";
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 @@ +<?php +//include_once('./includes/maps.php'); +//include_once('./includes/mapclass.php'); + +//Self-ajax. +if ($_REQUEST['command'] == 'updateTask') { + $taskName = 'FAKE RECALCULATION'; + $progress = $_SESSION['tmp']; + + if ($progress >= 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()); + + +?> + +<body> +<?php +topbar($Links); + +?> +<script> +//setTimeout("start();", 500); +function start() { +} + +var requestComplete = true; +processTimer(); +function processTimer() { + setTimeout("processTimer()", 3000); + if (requestComplete == false) return; + getTaskUpdate('updateTask'); +} + +function recalculate() { + if (!confirm('Are you sure?')) return; + getTaskUpdate('recalculateStats'); +} + +function getTaskUpdate(command) { + //var URLString = 'process?initiate=true&x'+JSON.stringify(testMap); + requestComplete = false; + var URLString = 'process?command='+command; + $.ajax({ + type: "GET", + url: URLString, + cache: true, + data: '', + fail: function() { alert("error"); }, + complete: function(data) { + if (data.responseText.length <= 1) { + console.log('null response'); + requestComplete = true; + return; + } + json = decryptJSON(data.responseText); + if (json.error) { + alert('ERROR: "' + json.error + '".') + requestComplete = true; + return; + } + $('#taskProgressDisp').width(json.percentComplete+'%'); + $('#taskProgressName').html(json.taskName); + // if (json.completed == true) { + // alert("TASK COMPLETE!"); + // } + requestComplete = true; + } + }); +} + + +</script> + +<div class='wrapper'> + +<h3>Task Processor</h3> + <div class='wrapper'> + <form> + <fieldset> + <legend>Load Map:</legend> + <div class='plusMinus'> + Recalculate all statistics: <input type="button" value="Recalculate!" class="forminput" onclick='recalculate()'/> + </div> + Processing: "<span id='taskProgressName'>Loading...</span>" + <div class='progressBar' style='width:600px'> + <div id='taskProgressDisp' style='width:0%;'> + </div> + </div> + + </fieldset> + + </form> + </div> +</div> + +<?php +htmlFooter(); +?>
\ No newline at end of file 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 = $('<div class="mapCol"></div>');
- 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);
}
|