Beispiel #1
0
error_reporting(E_ALL);
session_start();
set_time_limit(0);
require_once './../../constants.php';
// Konstanten
require_once FUNC_PATH . 'autoload.php';
// Autoloader für Klassen
require_once FUNC_PATH . 'buildSiteUrl.php';
// Autoloader für Klassen
require_once WORLD . 'config.php';
// Konfiguration
World_Base::$DB = new DatabaseInterface($config['mySql']['host'], $config['mySql']['user'], $config['mySql']['pass'], $config['mySql']['db']);
$mapList = World_Map::getMapList();
// Formularverarbeitung
foreach ($mapList as $mapData) {
    $map = new World_Map($mapData['id']);
    if ($map->getId() !== 0) {
        echo $map->getDisplayName() . ' ';
        $editor = new World_Map_Editor($mapData['id']);
        // LayerCode parsen
        $editor->parseLayerCode();
        // PkmnCode parsen
        $editor->parsePkmnCode();
        if ($editor->saveData()) {
            echo "OK<br />";
        } else {
            echo "Fehler<br />";
        }
        ob_flush();
    }
}
Beispiel #2
0
// MapId ermitteln
if (isset($_POST['selectMap'])) {
    // Karte auswählen
    $mapId = intval($_POST['mapList']);
} else {
    if (isset($_GET['mapId'])) {
        $mapId = intval($_GET['mapId']);
    } else {
        $mapId = false;
    }
}
// Formularverarbeitung
if (isset($_POST['saveMap'])) {
    $map = new World_Map($mapId);
    if ($map->getId() !== 0) {
        $editor = new World_Map_Editor($mapId);
        // Mapdaten
        $editor->setDisplayName($_POST['mapName']);
        $editor->setAreaName($_POST['mapAreaName']);
        $editor->setImage($_POST['mapImageName']);
        $editor->setLayerCode($_POST['mapLayerCode']);
        $editor->setPkmnCode($_POST['mapPkmnCode']);
        // Attribute
        $flags = 0;
        if (isset($_POST['mapAttributeIndoor'])) {
            $flags = $flags | World_Map::FLAG_INDOOR;
        }
        if (isset($_POST['mapAttributeStoragePc'])) {
            $flags = $flags | World_Map::FLAG_STORAGE_PC;
        }
        if (isset($_POST['mapAttributeTrade'])) {