diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/mapeditor.php | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/pages/mapeditor.php b/pages/mapeditor.php index 3134d51..4d395c4 100644 --- a/pages/mapeditor.php +++ b/pages/mapeditor.php @@ -35,10 +35,50 @@ if ($_REQUEST['genMap']) { } + + +//Add's a new custom challenge map - returns mapid +function addNewChallengeMap($map, $tier, $subOrder, $name) { + $mapcode = GenerateMapCode($map); + + $sql = "INSERT INTO `challengeMaps` + (`code`, `ChallengeTier`, `ChallengeSuborder`, `Name`) + VALUES + ('$mapcode', $tier, $subOrder, '$name')"; + + echo $sql; + mysql_query($sql); + $mapID = mysql_insert_id(); + return $mapID; +} + +//Returns challenge ID +function addNewChallenge($mapID, $inequality, $goal, $ordering, $hint, + $restrictWallCount = 'null', $restrictWallPlacement = 'null', $restrictTeleportCount = 'null', + $restrictTeleportsUsed = 'null', $restrictStartPoint = 'null', $restrictEndPoint = 'null') { + + $sql = "INSERT INTO `challenges` ( + `mapID`, `inequality`, `goal`, `ordering`, `hint`, + `restrictWallCount`, `restrictWallPlacement`, `restrictTeleportCount`, + `restrictTeleportsUsed`, `restrictStartPoint`, `restrictEndPoint` + ) + VALUES ( + '$mapID', '$inequality', $goal, $ordering, '$hint', + '$restrictWallCount', '$restrictWallPlacement', '$restrictTeleportCount', + '$restrictTeleportsUsed', '$restrictStartPoint', '$restrictEndPoint' + )"; + + echo $sql; + mysql_query($sql); + $challengeID = mysql_insert_id(); + return $challengeID; +} + +// Start Page: + htmlHeader(array('stats', 'mapeditor'), 'Map Editor', 'Map Editor', array('dateformat')); - ?> |