";
for($j = 0; $j < count($mapMatrix[$i]); $j++)
{
$handle = "$idprefix,$i,$j";
$mapItemCode = $mapMatrix[$i][$j];
switch($mapMatrix[$i][$j])
{
case 's': $maptable .= "
| "; break;
case 'S': $maptable .= "
| "; break;
case 'X': $maptable .= "
| "; break;
case 'x': $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': case 'b': case 'c': case 'd': case 'e':
$checkpoint = strtoupper($mapMatrix[$i][$j]);
$maptable .= "
| ";
break;
case 'r': $maptable .= " | "; break; //rock
case 'R': $maptable .= " | "; break; //metalic looking rock
case 'p': $maptable .= "
| "; break; //path
case 'q': $maptable .= " | "; break; //transparent
//Technically shouldn't ever be used to display a wall...
case 'w': $maptable .= " | "; break; //wall
// default; normally 'o'.
//default: $maptable .= " | ";
default: $maptable .= "
| ";
}
}
$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['name'] = $mapMatrix[0][6];
$mapdata['example'] = $example;
$mapdata['mapid'] = $idprefix;
//TODO: del
//$path = routePath($mapMatrix);
$mapdata['code'] = GenerateMapCode($mapMatrix);
$width = (($j * 35) + 2).'px';
//$width = (($j * 23) + 2).'px';
$i -= 1;
$height = (($i * 35) + -1).'px';
//$height = (($i * 22) + 2).'px';
$jsonmap = str_replace("'", "\'", json_encode($mapdata));
//$mapdatadiv .= "";
//$mapdatadiv .= $jsonmap;
//$mapdatadiv .= '
';
//JSON Fix for search-engine cache.
$mapdatadiv = "";
$maptable = "";
$speedOption['Slow'] = 1;
$speedOption['Med'] = 2;
$speedOption['Fast'] = 3;
$speedOption['Ultra'] = 4;
if (isset($_COOKIE['pref_speed'])) {
$prefSpeed = $_COOKIE['pref_speed'];
if (!in_array($prefSpeed, $speedOption))
$prefSpeed = '2';
} else
$prefSpeed = '2';
$rOption = '';
foreach ($speedOption as $key => $value) {
$rOption .= "