예제 #1
0
function player_getContent($caveID, $playerID)
{
    global $db, $no_resource_flag, $config, $params;
    $no_resource_flag = 1;
    if (!($r = $db->query("SELECT * FROM Player WHERE playerID = '{$playerID}'"))) {
        page_dberror();
    }
    if (!($row = $r->nextRow(MYSQL_ASSOC))) {
        page_dberror();
    }
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'playerDetail.ihtml');
    if ($row['avatar']) {
        // FIXME: should be configurable
        tmpl_set($template, 'DETAILS/AVATAR_IMG/avatar', $row['avatar']);
        tmpl_set($template, 'DETAILS/AVATAR_IMG/width', 120);
        tmpl_set($template, 'DETAILS/AVATAR_IMG/height', 120);
    }
    if (!empty($row['awards'])) {
        $tmp = explode('|', $row['awards']);
        $awards = array();
        foreach ($tmp as $tag) {
            $awards[] = array('tag' => $tag, 'award_modus' => AWARD_DETAIL);
        }
        $row['award'] = $awards;
    }
    unset($row['awards']);
    foreach ($row as $k => $v) {
        if (!$v) {
            $row[$k] = _('k.A.');
        }
    }
    $row['mail_modus'] = NEW_MESSAGE;
    $row['mail_receiver'] = urlencode($row['name']);
    $row['caveID'] = $caveID;
    $timediff = getUgaAggaTimeDiff(time_fromDatetime($row['created']), time());
    $row['age'] = 18 + $timediff['year'];
    tmpl_set($template, 'DETAILS', $row);
    // ADDED by chris--- for rank_history
    $row['playerID'] = $playerID;
    // show player's caves
    $caves = getCaves($playerID);
    if ($caves) {
        tmpl_set($template, '/DETAILS/CAVES', $caves);
    }
    //show bodycount
    // Keinen Bodycount fuers erste.... Nebrot
    //$body_count = $row['body_count'];
    //tmpl_set($template, '/DETAILS/BODYCOUNT/body_count', $body_count);
    // show player's history
    $history = Player::getHistory($db, $playerID);
    if (sizeof($history)) {
        tmpl_set($template, '/DETAILS/HISTORY/ENTRY', $history);
    } else {
        tmpl_set($template, '/DETAILS/HISTORY/NOENTRIES/iterate', '');
    }
    return tmpl_parse($template);
}
예제 #2
0
파일: main.php 프로젝트: agatho/uaenhanced
/* ***** INCLUDE NECESSARY FILES ******************************************* */
if (is_array($config->require_files['ALL'])) {
    foreach ($config->require_files['ALL'] as $k => $file) {
        require_once "include/" . $file;
    }
}
if (is_array($config->require_files[$modus])) {
    foreach ($config->require_files[$modus] as $k => $file) {
        require_once "include/" . $file;
    }
}
/*************************** DB Security Check *******************************/
// get the caveID out of the Session var 'caveID', which is ONLY set in the ugastart.php
$caveID = $params->SESSION->caveID;
// alle Höhlen holen
$meineHoehlen = getCaves($params->SESSION->user['playerID']);
// keine Höhlen mehr?
if ($meineHoehlen === 0 || sizeof($meineHoehlen) == 0) {
    $no_resource_flag = TRUE;
    if (!in_array($modus, $config->noCaveModusInclude)) {
        $modus = NO_CAVE_LEFT;
    }
} else {
    // caveID nicht übergeben, nimm die mit der kleinsten ID
    if ($caveID == NULL) {
        $caveID = current($meineHoehlen);
        $caveID = $caveID['caveID'];
    }
    // diese caveID gehört mir nicht
    if (!array_key_exists($caveID, $meineHoehlen)) {
        $no_resource_flag = TRUE;
예제 #3
0
파일: hero.inc.php 프로젝트: norter/Game
function hero_immolateResources($value_array, $caveID, &$ownCaves)
{
    global $db;
    if (!sizeof($value_array)) {
        return array('messageID' => -13, 'value' => 0);
    }
    // immolation allowed only in actual cave
    if (!$ownCaves[$caveID]['hero']) {
        return array('messageID' => -24, 'value' => 0);
    }
    $points = 0;
    foreach ($value_array as $resourceID => $value) {
        if ($value) {
            if (array_key_exists($resourceID, $GLOBALS['resourceTypeList'])) {
                $resource = $GLOBALS['resourceTypeList'][$resourceID];
                $playerID = $_SESSION['player']->playerID;
                // take resource from cave
                $sql = $db->prepare("UPDATE " . CAVE_TABLE . "\n                             SET " . $resource->dbFieldName . " = " . $resource->dbFieldName . " - :value\n                             WHERE caveID = :caveID\n                             AND " . $resource->dbFieldName . " >= :value");
                $sql->bindValue('value', $value, PDO::PARAM_INT);
                $sql->bindValue('caveID', $caveID, PDO::PARAM_INT);
                if (!$sql->execute() || $sql->rowCount() == 0) {
                    continue;
                }
                // add experience points
                $sql = $db->prepare("UPDATE " . HERO_TABLE . "\n                             SET exp = exp + :expValue\n                             WHERE playerID = :playerID");
                $sql->bindValue('expValue', $value * $resource->takeoverValue, PDO::PARAM_INT);
                $sql->bindValue('playerID', $playerID, PDO::PARAM_INT);
                if (!$sql->execute() || $sql->rowCount() == 0) {
                    // return resource to cave
                    $sql_setback = $db->prepare("UPDATE " . CAVE_TABLE . "\n                                       SET " . $resource->dbFieldName . " = " . $resource->dbFieldName . " + :value\n                                       WHERE caveID = :caveID");
                    $sql_setback->bindValue('value', $value, PDO::PARAM_INT);
                    $sql_setback->bindValue('caveID', $caveID, PDO::PARAM_INT);
                    $sql_setback->execute();
                    continue;
                }
                $ownCaves = getCaves($playerID);
                $points += $value * $resource->takeoverValue;
            }
        }
    }
    return array('messageID' => 8, 'value' => $points);
}
예제 #4
0
function getCaveReport($meineHoehlen, $caveID, $targetCaveID)
{
    global $params, $config, $terrainList;
    $cave = getCaveByID($targetCaveID);
    $caveDetails = array();
    $playerDetails = array();
    if ($cave['playerID'] != 0) {
        $caveDetails = getCaves($cave['playerID']);
        $playerDetails = getPlayerByID($cave['playerID']);
    }
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'mapdetail.ihtml');
    if ($cave['protected']) {
        tmpl_set($template, 'PROPERTY', _('Anfängerschutz aktiv'));
    }
    if (!$cave['secureCave'] && $cave['playerID']) {
        tmpl_iterate($template, 'PROPERTY');
        tmpl_set($template, 'PROPERTY', _('übernehmbar'));
    }
    $region = getRegionByID($cave['regionID']);
    tmpl_set($template, array('cavename' => $cave['name'], 'xcoord' => $cave['xCoord'], 'ycoord' => $cave['yCoord'], 'terrain' => $terrainList[$cave['terrain']]['name'], 'region' => $region['name'], 'movementlink' => sprintf("?modus=unit_movement&targetXCoord=%d&targetYCoord=%d&targetCaveName=%s", $cave['xCoord'], $cave['yCoord'], unhtmlentities($cave['name'])), 'backlink' => sprintf("?modus=map&xCoord=%d&yCoord=%d", $cave['xCoord'], $cave['yCoord'])));
    if ($cave['playerID'] != 0) {
        tmpl_set($template, '/OCCUPIED', array('playerLink' => "?modus=player_detail&detailID=" . $playerDetails['playerID'], 'caveOwner' => $playerDetails['name']));
        if ($playerDetails['tribe']) {
            tmpl_set($template, '/OCCUPIED/TRIBE', array('tribeLink' => "?modus=tribe_detail&tribe=" . urlencode(unhtmlentities($playerDetails['tribe'])), 'ownersTribe' => $playerDetails['tribe']));
        }
        if ($cave['artefacts'] != 0 && ($playerDetails['tribe'] != GOD_ALLY || $params->SESSION->player->tribe == GOD_ALLY)) {
            tmpl_set($template, '/OCCUPIED/ARTEFACT/artefactLink', "?modus=artefact_list&caveID={$caveID}");
        }
        $caves = array();
        foreach ($caveDetails as $key => $value) {
            $temp = array('caveName' => $value['name'], 'xCoord' => $value['xCoord'], 'ycoord' => $value['yCoord'], 'terrain' => $terrainList[$value['terrain']]['name'], 'caveSize' => floor($value[CAVE_SIZE_DB_FIELD] / 50) + 1, 'movementLink' => "?modus=unit_movement&targetXCoord=" . $value['xCoord'] . "&targetYCoord=" . $value['yCoord'] . "&targetCaveName=" . unhtmlentities($value['name']));
            if ($value['artefacts'] != 0 && ($playerDetails['tribe'] != GOD_ALLY || $params->SESSION->player->tribe == GOD_ALLY)) {
                $temp['ARTEFACT'] = array('artefactLink' => "?modus=artefact_list&caveID={$caveID}");
            }
            if ($value['protected'] && $value['playerID']) {
                $temp['PROPERTY'] = array('text' => _('Anfängerschutz aktiv'));
            } else {
                if (!$value['secureCave']) {
                    $temp['PROPERTY'] = array('text' => _('übernehmbar'));
                }
            }
            $caves[] = $temp;
        }
        tmpl_set($template, '/OCCUPIED/CAVES', $caves);
    } else {
        if (sizeof($meineHoehlen) < $params->SESSION->player->takeover_max_caves && $cave['takeoverable'] == 1) {
            tmpl_set($template, 'TAKEOVERABLE', array('modus' => TAKEOVER, 'caveID' => $caveID, 'targetXCoord' => $cave['xCoord'], 'targetYCoord' => $cave['yCoord']));
        }
    }
    return tmpl_parse($template);
}
예제 #5
0
파일: main.php 프로젝트: agatho/uaenhanced
page_start();
// session expired?
if (page_sessionExpired($params)) {
    page_error403("Sie waren für " . (int) (SESSION_MAX_LIFETIME / 60) . " Minuten oder mehr inaktiv. Letzte Aktion um " . date("H:i:s", $params->SESSION->lastAction . " Uhr."));
} else {
    $_SESSION['lastAction'] = time();
}
// session valid?
if (!page_sessionValidate($params, $config)) {
    page_error403(__FILE__ . ":" . __LINE__ . ": Session ist ungültig.");
}
// get modus
$modus = page_getModus($params, $config);
// get caves
$caveID = $params->SESSION->caveID;
$meineHoehlen = getCaves($params->SESSION->player->playerID);
// no caves left
if (!$meineHoehlen) {
    if (!in_array($modus, $config->noCaveModusInclude)) {
        $modus = NO_CAVE_LEFT;
    }
} else {
    // caveID is not sent
    if ($caveID == NULL) {
        $temp = current($meineHoehlen);
        $caveID = $temp['caveID'];
        $_SESSION['caveID'] = $caveID;
        $params->SESSION->caveID = $caveID;
    }
    // my cave?
    if (!array_key_exists($caveID, $meineHoehlen)) {
예제 #6
0
function getCaveReport($meineHoehlen, $caveID, $targetCaveID, $playerID)
{
    global $params, $config, $terrainList;
    $cave = getCaveByID($targetCaveID);
    $caveDetails = array();
    $playerDetails = array();
    // ADDED by chris--- for Quests
    // ----------------------------------------------------------
    global $db;
    // checking if this cave is a quest cave and if its visible to the player (than he knows the quest)
    // if he does not know the quest the cave is invisible
    if (isCaveQuestCave($targetCaveID, $db) && isCaveInvisibleToPlayer($targetCaveID, $playerID, $db)) {
        $cave['playerID'] = 0;
    }
    // ----------------------------------------------------------
    if ($cave['playerID'] != 0) {
        $caveDetails = getCaves($cave['playerID']);
        $playerDetails = getPlayerFromID($cave['playerID']);
        // ADDED by chris--- for farmschutz
        if (FARMSCHUTZ_ACTIVE == 1) {
            $farmschutz = getFarmschutz($cave['playerID']);
        } else {
            $farmschutz = "";
        }
    }
    $template = @tmpl_open('./templates/' . $config->template_paths[$params->SESSION->user['template']] . '/mapdetail.ihtml');
    if ($cave['protected']) {
        tmpl_set($template, 'PROPERTY', 'Anf&auml;ngerschutz aktiv');
    }
    if (!$cave['secureCave'] && $cave['playerID']) {
        tmpl_iterate($template, 'PROPERTY');
        tmpl_set($template, 'PROPERTY', '&uuml;bernehmbar!');
    }
    // ADDED by chris--- for Quests --------------------------------------------------------------------------------
    if ($cave['quest_cave'] && !isCaveInvisibleToPlayer($cave['caveID'], $playerID, $db) && $cave['invisible_name'] != "") {
        $cave['name'] = $cave['invisible_name'];
    }
    // -------------------------------------------------------------------------------------------------------
    $addCaveLink = "?modus=" . CAVE_BOOK_ADD . "&amp;id=" . $targetCaveID;
    // ADDED by chris--- for cavebook
    tmpl_set($template, '/', array('cavename' => $cave['name'], 'xcoord' => $cave['xCoord'], 'ycoord' => $cave['yCoord'], 'terrain' => $terrainList[$cave['terrain']]['name'], 'movementlink' => "?modus=" . MOVEMENT . "&targetXCoord=" . $cave['xCoord'] . "&targetYCoord=" . $cave['yCoord'] . "&targetCaveName=" . unhtmlentities($cave['name']), 'backlink' => "?modus=" . MAP . "&xCoord=" . $cave['xCoord'] . "&yCoord=" . $cave['yCoord']));
    if ($cave['playerID'] != 0) {
        tmpl_set($template, '/OCCUPIED', array('playerLink' => "?modus=" . PLAYER_DETAIL . "&detailID=" . $playerDetails['playerID'], 'caveOwner' => $playerDetails['name'], 'farmschutz' => $farmschutz, 'adressbook_add_modus' => MESSAGE_BOOK_ADD, 'addCaveLink' => $addCaveLink));
        if ($playerDetails['tribe']) {
            tmpl_set($template, '/OCCUPIED/TRIBE', array('tribeLink' => "?modus=" . TRIBE_DETAIL . "&tribe=" . urlencode(unhtmlentities($playerDetails['tribe'])), 'ownersTribe' => $playerDetails['tribe']));
        }
        if ($cave['artefacts'] != 0 && ($playerDetails['tribe'] != GOD_ALLY || $params->SESSION->user['tribe'] == GOD_ALLY)) {
            tmpl_set($template, '/OCCUPIED/ARTEFACT/artefactLink', "?modus=" . ARTEFACT_LIST . "&caveID={$caveID}");
        }
        $caves = array();
        foreach ($caveDetails as $key => $value) {
            if (!(isCaveQuestCave($value['caveID'], $db) && isCaveInvisibleToPlayer($value['caveID'], $playerID, $db))) {
                $temp = array('caveName' => $value['name'], 'xCoord' => $value['xCoord'], 'ycoord' => $value['yCoord'], 'terrain' => $terrainList[$value['terrain']]['name'], 'caveSize' => floor($value[CAVE_SIZE_DB_FIELD] / 50) + 1, 'movementLink' => "?modus=" . MOVEMENT . "&targetXCoord=" . $value['xCoord'] . "&targetYCoord=" . $value['yCoord'] . "&targetCaveName=" . unhtmlentities($value['name']));
                if ($value['artefacts'] != 0 && ($playerDetails['tribe'] != GOD_ALLY || $params->SESSION->user['tribe'] == GOD_ALLY)) {
                    $temp['ARTEFACT'] = array('artefactLink' => "?modus=" . ARTEFACT_LIST . "&caveID={$caveID}");
                }
                if ($value['protected'] && $value['playerID']) {
                    $temp['PROPERTY'] = array('text' => 'Schutz');
                } else {
                    if (!$value['secureCave']) {
                        $temp['PROPERTY'] = array('text' => '&uuml;bernehmbar');
                    }
                }
                $caves[] = $temp;
            }
        }
        tmpl_set($template, '/OCCUPIED/CAVES', $caves);
    } else {
        if (sizeof($meineHoehlen) < $params->SESSION->user['takeover_max_caves'] && $cave['takeoverable'] == 1) {
            tmpl_set($template, 'TAKEOVERABLE', array('modus' => TAKEOVER, 'caveID' => $caveID, 'targetXCoord' => $cave['xCoord'], 'targetYCoord' => $cave['yCoord']));
        }
    }
    return tmpl_parse($template);
}
예제 #7
0
파일: basic.lib.php 프로젝트: norter/Game
function export_getSingleMovement($movementID)
{
    global $db;
    $sql = $db->prepare("SELECT * FROM " . EVENT_MOVEMENT_TABLE . " WHERE event_movementID = :movementID");
    $sql->bindValue('movementID', $movementID, PDO::PARAM_INT);
    if ($sql->execute()) {
        $move = $sql->fetch(PDO::FETCH_ASSOC);
    } else {
        return array();
    }
    $sql->closeCursor();
    if (!sizeof($move) || empty($move)) {
        return array();
    }
    // check if it's own movement
    $meineHoehlen = getCaves($_SESSION['player']->playerID);
    $move['isOwnMovement'] = in_array($move['caveID'], array_keys($meineHoehlen));
    return $move;
}
예제 #8
0
function artefact_getDetail($caveID, &$myCaves)
{
    global $template;
    $messageText = array(-5 => array('type' => 'error', 'message' => _('Dieses Artefakt kann nicht noch einmal eingeweiht werden.')), -4 => array('type' => 'error', 'message' => _('Fehler: Artefakt konnte nicht auf ARTEFACT_INITIATING gestellt werden.')), -3 => array('type' => 'error', 'message' => _('Sie weihen bereits ein anderes Artefakt ein.')), -2 => array('type' => 'error', 'message' => _('Es fehlen die notwendigen Voraussetzungen.')), -1 => array('type' => 'error', 'message' => _('Fehler: Ritual nicht gefunden.')), 0 => array('type' => 'notice', 'message' => _('Über dieses Artefakt weiß man nichts!')), 1 => array('type' => 'success', 'message' => _('Die Einweihung des Artefakts wurde gestartet!')));
    // open template
    $template->setFile('artefactDetail.tmpl');
    $show_artefact = TRUE;
    $artefactID = Request::getVar('artefactID', 0);
    $artefact = artefact_getArtefactByID($artefactID);
    if (empty($artefact)) {
        $messageID = 0;
    } else {
        $description_initiated = $artefact['description_initiated'];
        unset($artefact['description_initiated']);
        // Gott oder nicht?
        if ($_SESSION['player']->tribe != GOD_ALLY) {
            // gibts nicht oder nicht in einer Höhle
            if (!$artefact['caveID']) {
                $show_artefact = FALSE;
            } else {
                $cave = getCaveByID($artefact['caveID']);
                // leere Höhle
                if (!$cave['playerID']) {
                    $show_artefact = FALSE;
                } else {
                    $owner = getPlayerByID($cave['playerID']);
                    // Besitzer ist ein Gott
                    if ($owner['tribe'] == GOD_ALLY) {
                        $show_artefact = FALSE;
                    }
                }
            }
        }
        $showRitual = 0;
        $showStatus = 0;
        $template->addVars(array('show_artefact' => $show_artefact));
        if ($show_artefact) {
            $artefact['img'] = $artefact['uninitiationImg'];
            // Bild vom uninitalisierten Artefakt per default anzeigen!
            // eigene Höhle ...
            if (isset($myCaves[$artefact['caveID']])) {
                $showStatus = 1;
                // Ritual ausführen?
                if (Request::isPost('initiate')) {
                    $messageID = artefact_beginInitiation($artefact);
                    // reload
                    $myCaves = getCaves($_SESSION['player']->playerID);
                    // wenn noch uneingeweiht und in der "richtigen" Höhle, ritual zeigen
                } else {
                    if ($artefact['caveID'] == $caveID && $artefact['initiated'] == ARTEFACT_UNINITIATED) {
                        // Check, ob bereits eingeweiht wird.
                        if (sizeof(artefact_getArtefactInitiationsForCave($caveID)) == 0) {
                            $showRitual = 1;
                            // Hol das Einweihungsritual
                            $ritual = artefact_getRitualByID($artefact['initiationID']);
                            // Hol die Kosten und beurteile ob genug da ist
                            $merged_game_rules = array_merge($GLOBALS['resourceTypeList'], $GLOBALS['buildingTypeList'], $GLOBALS['unitTypeList'], $GLOBALS['scienceTypeList'], $GLOBALS['defenseSystemTypeList']);
                            $cost = array();
                            foreach ($merged_game_rules as $val) {
                                if (isset($ritual[$val->dbFieldName])) {
                                    if ($ritual[$val->dbFieldName]) {
                                        $object_context = ceil($ritual[$val->dbFieldName]) > floor($myCaves[$artefact['caveID']][$val->dbFieldName]) ? 'less-' : 'enough ';
                                        array_push($cost, array('object' => $val->name, 'amount' => $ritual[$val->dbFieldName], 'class' => $object_context));
                                    }
                                }
                            }
                            $artefact['initiation'] = array('cost' => $cost, 'name' => $ritual['name'], 'description' => $ritual['description'], 'duration' => time_formatDuration($ritual['duration']), 'initiate' => 1);
                        } else {
                            $showRitual = -1;
                        }
                    } elseif ($artefact['caveID'] == $caveID && $artefact['initiated'] == ARTEFACT_INITIATING) {
                        // Arte wird gerade eingeweiht
                        $showRitual = -1;
                    }
                }
                // "geheime" Beschreibung nur zeigen, wenn eingeweiht
                if ($artefact['initiated'] == ARTEFACT_INITIATED) {
                    $artefact['description_initiated'] = $description_initiated;
                    // Besitzer des Artefaktes und initalisiert? Richtiges Artefakt Bild anzeigen
                    if (isset($myCaves[$artefact['caveID']])) {
                        $artefact['img'] = $artefact['initiationImg'];
                    }
                }
            }
            $template->addVars(array('artefact' => $artefact));
            $template->addVars(array('showRitual' => $showRitual));
            $template->addVars(array('showStatus' => $showStatus));
        } else {
            // über dieses Artefakt weiß man nichts!
            $messageID = 0;
        }
    }
    $template->addVar('status_msg', isset($messageID) ? $messageText[$messageID] : '');
}
예제 #9
0
function artefact_getDetail($caveID, &$myCaves, $artefactID)
{
    global $params, $config, $resourceTypeList, $buildingTypeList, $unitTypeList, $scienceTypeList, $defenseSystemTypeList;
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'artefactdetail.ihtml');
    $show_artefact = TRUE;
    $artefact = artefact_getArtefactByID($artefactID);
    $description_initiated = $artefact['description_initiated'];
    unset($artefact['description_initiated']);
    // Gott oder nicht?
    if ($params->SESSION->player->tribe != GOD_ALLY) {
        // gibts nicht oder nicht in einer Höhle
        if (!$artefact['caveID']) {
            $show_artefact = FALSE;
        } else {
            $cave = getCaveByID($artefact['caveID']);
            // leere Höhle
            if (!$cave['playerID']) {
                $show_artefact = FALSE;
            } else {
                $owner = getPlayerByID($cave['playerID']);
                // Besitzer ist ein Gott
                if ($owner['tribe'] == GOD_ALLY) {
                    $show_artefact = FALSE;
                }
            }
        }
    }
    if ($show_artefact) {
        // eigene Höhle ...
        if (array_key_exists($artefact['caveID'], $myCaves)) {
            // Ritual ausführen?
            if (isset($params->POST->initiate)) {
                $message = artefact_beginInitiation($artefact);
                tmpl_set($template, 'message', $message);
                // reload
                $myCaves = getCaves($params->SESSION->player->playerID);
            } else {
                if ($artefact['caveID'] == $caveID && $artefact['initiated'] == ARTEFACT_UNINITIATED) {
                    // Check, ob bereits eingeweiht wird.
                    if (sizeof(artefact_getArtefactInitiationsForCave($caveID)) == 0) {
                        // Hol das Einweihungsritual
                        $ritual = artefact_getRitualByID($artefact['initiationID']);
                        // Hol die Kosten und beurteile ob genug da ist
                        $merged_game_rules = array_merge($resourceTypeList, $buildingTypeList, $unitTypeList, $scienceTypeList, $defenseSystemTypeList);
                        $cost = array();
                        foreach ($merged_game_rules as $val) {
                            if ($ritual[$val->dbFieldName]) {
                                $object_context = ceil($ritual[$val->dbFieldName]) > floor($myCaves[$artefact['caveID']][$val->dbFieldName]) ? 'LESS' : 'ENOUGH';
                                array_push($cost, array('object' => $val->name, $object_context . '/amount' => $ritual[$val->dbFieldName]));
                            }
                        }
                        $artefact['INITIATION'] = array('COST' => $cost, 'name' => $ritual['name'], 'description' => $ritual['description'], 'duration' => time_formatDuration($ritual['duration']), 'HIDDEN' => array(array('name' => "artefactID", 'value' => $artefact['artefactID']), array('name' => "modus", 'value' => ARTEFACT_DETAIL), array('name' => "initiate", 'value' => 1)));
                    } else {
                        tmpl_iterate($template, 'ARTEFACT/NO_INITIATION');
                    }
                }
            }
            // "geheime" Beschreibung nur zeigen, wenn eingeweiht
            if ($artefact['initiated'] == ARTEFACT_INITIATED) {
                $artefact['description_initiated'] = $description_initiated;
            }
        }
        tmpl_set($template, 'ARTEFACT', $artefact);
    } else {
        tmpl_set($template, 'message', _('Über dieses Artefakt weiss man nichts.'));
    }
    return tmpl_parse($template);
}
예제 #10
0
function getCaveReport($caveID, $ownCaves, $targetCaveID, $method)
{
    global $template;
    if (!$targetCaveID) {
        $template->throwError('Es wurde keine Höhle ausgewählt.');
        return;
    }
    if ($method == 'ajax') {
        $shortVersion = true;
        $template->setFile('mapDetailAjax.tmpl');
    } else {
        $shortVersion = false;
        $template->setFile('mapDetail.tmpl');
    }
    $cave = getCaveByID($targetCaveID);
    $caveDetails = array();
    $playerDetails = null;
    $showArtePossible = false;
    if ($cave['playerID'] != 0) {
        $caveDetails = getCaves($cave['playerID']);
        $playerDetails = Player::getPlayer($cave['playerID']);
        $showArtePossible = $playerDetails->tribe != GOD_ALLY ? true : false;
    }
    $cave['terrain_name'] = $GLOBALS['terrainList'][$cave['terrain']]['name'];
    $cave['terrain_img'] = $GLOBALS['terrainList'][$cave['terrain']]['img'];
    if ($GLOBALS['terrainList'][$cave['terrain']]['tribeRegion']) {
        $cave['terrain_description'] = $GLOBALS['terrainList'][$cave['terrain']]['description'];
        $cave['terrain_tribe_cave'] = $GLOBALS['terrainList'][$cave['terrain']]['tribeRegion'];
        $attackerTribe = Tribe::getByID($cave['lastAttackingTribeID']);
        $cave['tribe_cave_tag'] = $attackerTribe['tag'];
    }
    $region = getRegionByID($cave['regionID']);
    // Wenn die Höhle ein Artefakt enthält und man berechtigt ist -> anzeigen
    if ($cave['hasArtefact'] && ($showArtePossible || $_SESSION['player']->tribe == GOD_ALLY)) {
        $cave['hasArtefact'] = true;
    } else {
        $cave['hasArtefact'] = false;
    }
    if ($cave['hasPet'] && ($showArtePossible || $_SESSION['player']->tribe == GOD_ALLY)) {
        $cave['hasPet'] = true;
    } else {
        $cave['hasArtefact'] = false;
    }
    $template->addVar('cave_details', $cave);
    if ($cave['playerID'] != 0) {
        $template->addVar('player_details', $playerDetails);
        /****************************************************************************************************
        *
        * Alle Höhlen des Spielers ausgeben
        *
        ****************************************************************************************************/
        $caves = array();
        foreach ($caveDetails as $key => $value) {
            $temp = array('caveName' => $value['name'], 'xCoord' => $value['xCoord'], 'yCoord' => $value['yCoord'], 'terrain' => $GLOBALS['terrainList'][$value['terrain']]['name'], 'caveSize' => floor($value[CAVE_SIZE_DB_FIELD] / 50) + 1, 'secureCave' => $value['secureCave']);
            if ($value['hasArtefact'] && ($playerDetails->tribe != GOD_ALLY || $_SESSION['player']->tribe == GOD_ALLY)) {
                $temp['artefact'] = true;
            }
            if ($value['hasPet'] && ($playerDetails->tribe != GOD_ALLY || $_SESSION['player']->tribe == GOD_ALLY)) {
                $temp['pet'] = true;
            }
            $caves[] = $temp;
        }
        $template->addVar('player_caves', $caves);
    } else {
        if (sizeof($ownCaves) < $_SESSION['player']->takeover_max_caves) {
            if ($cave['starting_position'] == 0 && $cave['takeoverable'] == 0 && $cave['takeover_level'] > 0) {
                $template->addVar('maybe_takeoverable', true);
            } else {
                if ($cave['takeoverable'] == 1) {
                    $template->addVar('takeoverable', true);
                }
            }
        }
    }
}
예제 #11
0
/** This function sets the changed data specified by the user.
 */
function profile_processUpdate($playerID, $data, $password, $cave_prio, $db_game, $db_login)
{
    // list of fields, that should be inserted into the player record
    $fields = array("sex", "origin", "age", "icq", "avatar", "description", "template", "show_unqualified", "show_ticker", "show_returns", "urlaub", "gfxpath", "email2");
    // ADDED by chris--- for ticker: show_ticker
    // ADDED by chris--- for returns: show_returns
    // ADDED by chris--- for urlaub: urlaub
    // ADDED by chris--- for urlaubmodus -----------------------------------
    if ($data['urlaub'] == 1) {
        // check ob Clan im Krieg
        $sql = "SELECT tribe FROM Player WHERE playerID = " . $playerID;
        if (!($result = $db_game->query($sql))) {
            return 8;
        }
        if (!$result->isEmpty()) {
            // Spieler hat nen clan
            $game = $result->nextRow();
            $tribe = $game['tribe'];
            $sql = "SELECT relationType FROM relation WHERE tribe = '" . $tribe . "'";
            if (!($result = $db_game->query($sql))) {
                return 8;
            }
            if (!$result->isEmpty()) {
                // Clan hat Beziehungen
                $war = FALSE;
                while ($game = $result->nextRow()) {
                    if ($game['relationType'] == 2) {
                        $war = TRUE;
                    }
                }
                // end while
                if ($war) {
                    return 6;
                }
            }
            // end if beziehung
        }
        // end if clan
        // check ob Spieler kürzlich im Urlaub
        // Username holen
        $sql = "SELECT Name FROM Player WHERE playerID = " . $playerID . " LIMIT 0,1";
        if (!($result = $db_game->query($sql))) {
            return 8;
        }
        if ($result->isEmpty()) {
            return 8;
        }
        $game = $result->nextRow();
        $sql = "SELECT urlaub_begin, urlaub_end FROM Login WHERE user = '******'Name'] . "'";
        if (!($result = $db_login->query($sql))) {
            return 8;
        }
        if ($result->isEmpty()) {
            return 8;
        }
        $login = $result->nextRow();
        $urlaub_begin = $login['urlaub_begin'];
        $urlaub_end = $login['urlaub_end'];
        $jetzt = time();
        $diff = $urlaub_end - $urlaub_begin;
        $sperre = $jetzt + $diff;
        if ($jetzt < $sperre) {
            return 7;
        } else {
            // Alles ok, aktiviere Urlaubsmodus
            // Alle Siedlungen des Spieler auf urlaub = 1 setzen, protection_end auf jetzt+1monat, evt. secure_cave ändern? Falls ja muß der vorige Zustand gespeichert werden
            $sql = "UPDATE Cave SET secureCave_was = secureCave WHERE playerID = " . $playerID;
            if (!$db_game->query($sql)) {
                return 8;
            }
            $endtime = date("YmdHis", time() + 31 * 24 * 60 * 60);
            $sql = "UPDATE Cave SET urlaub = 1, protection_end = " . $endtime . ", secureCave = 1 WHERE playerID = " . $playerID;
            if (!$db_game->query($sql)) {
                return 8;
            }
            // Player Tabelle updaten
            $sql = "UPDATE Player SET urlaub = 1 WHERE playerID = " . $playerID;
            if (!$db_game->query($sql)) {
                return 8;
            }
            // Username holen
            $sql = "SELECT Name FROM Player WHERE playerID = " . $playerID . " LIMIT 0,1";
            if (!($result = $db_game->query($sql))) {
                return 8;
            }
            if ($result->isEmpty()) {
                return 8;
            }
            $game = $result->nextRow();
            // Login Tabelle updaten
            $sql = "UPDATE Login SET urlaub = 1, urlaub_begin = " . time() . ", urlaub_end = 0 WHERE user = '******'Name'] . "'";
            if (!$db_login->query($sql)) {
                return 8;
            }
        }
    }
    // END urlaubsmodus ----------------------------------------------
    // first update data
    $data['description'] = nl2br($data['description']);
    if ($set = db_makeSetStatementSecure($data, $fields)) {
        $query = "UPDATE Player SET {$set} WHERE playerID = '{$playerID}'";
        if (!$db_game->query($query)) {
            return 2;
        }
    }
    // now update the password, if it is set
    if (strlen($password['password1'])) {
        // typo?
        if (strcmp($password['password1'], $password['password2']) != 0) {
            return 1;
        }
        // password too short?
        if (strlen($password['password1']) <= 4) {
            return 3;
        }
        // set password
        $query = "UPDATE Login SET password = '******'password1']}' " . "WHERE LoginID = '{$playerID}'";
        if (!$db_login->query($query)) {
            return 4;
        }
    }
    // ADDED by chris--- for cave sorting
    // Processing the cave priorities
    $meineHoehlen = getCaves($playerID);
    if (sizeof($meineHoehlen) > 1) {
        // We should check the values here
        foreach ($cave_prio as $key => $value) {
            if ($value > 10 || $value < 0) {
                return 5;
            }
            // Wrong value
            // if we have 2 or more of the same values here
            // it doesnt matter cause it doesnt affect the game
            // the priority is undefined then
        }
        // Updating the table
        foreach ($cave_prio as $key => $value) {
            $query = "UPDATE cave SET priority = " . $value . " WHERE caveID = " . $key . " AND playerID = " . $playerID;
            if (!$db_game->query($query)) {
                return 2;
            }
            // Database error
        }
    }
    // end if
    return 0;
}
예제 #12
0
function player_getContent($caveID, $playerID)
{
    global $db, $template;
    // open template
    $template->setFile('playerDetail.tmpl');
    $template->setShowResource(false);
    // workaround, if no playerID is submitted! TODO
    if ($playerID == 0) {
        $playerID = $_SESSION['player']->playerID;
    }
    $playerDetails = Player::getPlayer($playerID, true);
    if (!$playerDetails) {
        $template->throwError('Da wollte irgendwie was nicht aus der Datenbank ausgelesen werden :(');
        return;
    }
    if ($playerDetails['avatar']) {
        $playerDetails['avatar'] = @unserialize($playerDetails['avatar']);
        $template->addVars(array('player_avatar' => $playerDetails['avatar']['path'], 'player_avatar_width' => $playerDetails['avatar']['width'], 'player_avatar_height' => $playerDetails['avatar']['height']));
    }
    if (!empty($playerDetails['awards'])) {
        $tmp = explode('|', $playerDetails['awards']);
        $awards = array();
        foreach ($tmp as $tag) {
            $awards[] = $tag;
        }
        $playerDetails['award'] = $awards;
    }
    unset($playerDetails['awards']);
    foreach ($playerDetails as $k => $v) {
        if (!$v) {
            $playerDetails[$k] = _('k.A.');
        }
    }
    $playerDetails['mail_receiver'] = urlencode($playerDetails['name']);
    $playerDetails['caveID'] = $caveID;
    $playerTribe = $playerDetails['tribe'];
    $timediff = getUgaAggaTimeDiff(time_fromDatetime($playerDetails['created']), time());
    $playerDetails['age'] = 18 + $timediff['year'];
    // init messages class
    $parser = new parser();
    $playerDetails['description'] = $parser->p($playerDetails['description']);
    // show player's caves
    $caves = getCaves($playerID);
    if ($caves) {
        $template->addVar('player_caves', $caves);
    }
    // show player's history
    $history = Player::getHistory($playerID);
    if (sizeof($history)) {
        $template->addVar('player_history', $history);
    }
    //get player rank
    $sql = $db->prepare("SELECT rank FROM " . RANKING_TABLE . " WHERE playerID = :playerID");
    $sql->bindValue('playerID', $playerID, pDo::PARAM_INT);
    if (!$sql->execute()) {
        page_dberror();
    }
    if ($row = $sql->fetch()) {
        $playerDetails['rank'] = $row['rank'];
    } else {
        $playerDetails['rank'] = '';
    }
    $template->addVars(array('player_details' => $playerDetails));
}
예제 #13
0
파일: menu.php 프로젝트: agatho/uaenhanced
 function initSelector()
 {
     global $params;
     // get caveID
     $caveID = $params->SESSION->caveID;
     // get player's caves
     $caves = getCaves($params->SESSION->player->playerID);
     // prepare cave selector
     $this->selector = array();
     foreach ($caves as $key => $cave) {
         $this->selector[] = array('value' => $key, 'selected' => $caveID == $key ? "selected" : "", 'SELECTION' => array('iterate' => ''), 'text' => lib_shorten_html($cave['name'], 17));
     }
 }
예제 #14
0
파일: main.php 프로젝트: microlefes/Game
    page_finish('inaktiv');
} else {
    $_SESSION['lastAction'] = time();
}
// session valid?
if (!page_sessionValidate()) {
    page_finish('wrongSessionID');
}
// refresh user data
page_refreshUserData();
// load template
$template = new Template();
// get modus
$modus = page_getModus();
// get caves
$ownCaves = getCaves($_SESSION['player']->playerID);
// no caves left
if (!$ownCaves) {
    if (!in_array($modus, Config::$noCaveModusInclude)) {
        $modus = NO_CAVE_LEFT;
    }
} else {
    $caveID = Request::getVar('caveID', 0);
    // Keine neue Höhle ausgewählt.
    if ($caveID == 0) {
        // Bereits eine Höhle mal ausgewählt?
        if (isset($_SESSION['caveID']) && isset($ownCaves[$_SESSION['caveID']])) {
            $caveID = $_SESSION['caveID'];
            // erste Höhle nehmen
        } else {
            $temp = current($ownCaves);
예제 #15
0
파일: map.html.php 프로젝트: norter/Game
function getCaveReport($caveID, $ownCaves, $targetCaveID, $method)
{
    global $template;
    if (!$targetCaveID) {
        $template->throwError('Es wurde keine Höhle ausgewählt.');
        return;
    }
    if ($method == 'ajax') {
        $shortVersion = true;
        $template->setFile('mapDetailAjax.tmpl');
    } else {
        $shortVersion = false;
        $template->setFile('mapDetail.tmpl');
    }
    $cave = getCaveByID($targetCaveID);
    $caveDetails = array();
    $playerDetails = array();
    $showArtePossible = false;
    if ($cave['playerID'] != 0) {
        $caveDetails = getCaves($cave['playerID']);
        $playerDetails = getPlayerByID($cave['playerID']);
        $showArtePossible = $playerDetails['tribe'] != GOD_ALLY ? true : false;
    }
    $cave['terrain_name'] = $GLOBALS['terrainList'][$cave['terrain']]['name'];
    $cave['terrain_img'] = $GLOBALS['terrainList'][$cave['terrain']]['img'];
    $region = getRegionByID($cave['regionID']);
    if ($cave['artefacts'] != 0 && ($showArtePossible || $_SESSION['player']->tribe == GOD_ALLY)) {
        $cave['artefact'] = true;
    }
    $template->addVar('cave_details', $cave);
    if ($cave['playerID'] != 0) {
        $template->addVar('player_details', $playerDetails);
        /****************************************************************************************************
        *
        * Alle Höhlen des Spielers ausgeben
        *
        ****************************************************************************************************/
        $caves = array();
        foreach ($caveDetails as $key => $value) {
            $temp = array('caveName' => $value['name'], 'xCoord' => $value['xCoord'], 'yCoord' => $value['yCoord'], 'terrain' => $GLOBALS['terrainList'][$value['terrain']]['name'], 'caveSize' => floor($value[CAVE_SIZE_DB_FIELD] / 50) + 1, 'secureCave' => $value['secureCave']);
            if ($value['artefacts'] != 0 && ($playerDetails['tribe'] != GOD_ALLY || $_SESSION['player']->tribe == GOD_ALLY)) {
                $temp['artefact'] = true;
            }
            $caves[] = $temp;
        }
        $template->addVar('player_caves', $caves);
    } else {
        if (sizeof($ownCaves) < $_SESSION['player']->takeover_max_caves && $cave['takeoverable'] == 1) {
            $template->addVar('takeoverable', true);
        }
    }
}
예제 #16
0
function profile_getContent($playerID)
{
    global $config, $params, $db, $no_resource_flag;
    $no_resource_flag = 1;
    // try to connect to login db
    if (!($db_login = new DB($config->DB_LOGIN_HOST, $config->DB_LOGIN_USER, $config->DB_LOGIN_PWD, $config->DB_LOGIN_NAME))) {
        page_dberror();
    }
    // messages
    $messageText = array(0 => "Die Daten wurden erfolgreich aktualisiert.", 1 => "Das Pa&szlig;wort stimmt nicht mit der Wiederholung &uuml;berein.", 2 => "Die Daten konnten gar nicht oder zumindest nicht vollst&auml;ndig " . "aktualisiert werden.", 3 => "Das Passwort muss mindestens 4 Zeichen lang sein!", 5 => "Die Priorit&auml;t mu&szlig; zwischen 0 und 10 liegen!", 6 => "Dein Clan ist im Krieg und du kannst darum den Urlaubsmodus nicht aktivieren!", 7 => "Du warst erst k&uuml;rzlich im Urlaub und mu&szlig;t mindestens die gleiche Zeitspanne warten!", 8 => "Fehler beim Aktivieren des Urlaubsmodus", 10 => "Dieser Clanname ist nicht erlaubt!");
    // proccess form data
    if ($params->POST->data || $params->POST->password) {
        // insert necessary fields
        $messageID = profile_processUpdate($playerID, $params->POST->data, $params->POST->password, $params->POST->cave_prio, $db, $db_login);
    }
    // get the user data
    if (!($playerData = profile_getPlayerData($playerID, $db, $db_login))) {
        page_dberror();
    }
    $template = @tmpl_open("./templates/" . $config->template_paths[$params->SESSION->user['template']] . "/profile.ihtml");
    // Show a special message
    if (isset($messageID)) {
        tmpl_set($template, '/MESSAGE/message', $messageText[$messageID]);
        page_refreshUserData();
    }
    // show the profile's data
    tmpl_set($template, 'modus_name', 'modus');
    tmpl_set($template, 'modus_value', USER_PROFILE);
    ////////////// user data //////////////////////
    tmpl_set($template, 'DATA_GROUP/heading', 'Benutzerdaten');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INFO/name', 'Name');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INFO/value', $playerData['game']['name']);
    tmpl_iterate($template, 'DATA_GROUP/ENTRY_INFO');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INFO/name', 'Email');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INFO/value', $playerData['game']['email']);
    tmpl_iterate($template, 'DATA_GROUP/ENTRY_INFO');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/name', 'Email 2');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataentry', 'email2');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/value', $playerData['game']['email2']);
    tmpl_iterate($template, 'DATA_GROUP/ENTRY_INPUT');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/name', 'Geschlecht (m/w)');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataentry', 'sex');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/value', $playerData['game']['sex']);
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/size', '1');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/maxlength', '1');
    tmpl_iterate($template, 'DATA_GROUP/ENTRY_INPUT');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/name', 'Herkunft');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataentry', 'origin');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/value', $playerData['game']['origin']);
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/size', '30');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/maxlength', '30');
    tmpl_iterate($template, 'DATA_GROUP/ENTRY_INPUT');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/name', 'Alter');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataentry', 'age');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/value', $playerData['game']['age']);
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/size', '2');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/maxlength', '2');
    tmpl_iterate($template, 'DATA_GROUP/ENTRY_INPUT');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/name', 'ICQ#');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataentry', 'icq');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/value', $playerData['game']['icq']);
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/size', '15');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/maxlength', '15');
    tmpl_iterate($template, 'DATA_GROUP/ENTRY_INPUT');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/name', 'Avatar URL (max ' . AVATAR_X . 'x' . AVATAR_Y . ')');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataentry', 'avatar');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/value', $playerData['game']['avatar']);
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/size', '30');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/maxlength', '90');
    tmpl_set($template, 'DATA_GROUP/ENTRY_MEMO/name', 'Beschreibung');
    tmpl_set($template, 'DATA_GROUP/ENTRY_MEMO/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_MEMO/dataentry', 'description');
    tmpl_set($template, 'DATA_GROUP/ENTRY_MEMO/value', $playerData['game']['description']);
    tmpl_set($template, 'DATA_GROUP/ENTRY_MEMO/cols', '25');
    tmpl_set($template, 'DATA_GROUP/ENTRY_MEMO/rows', '8');
    // ADDED by chris--- for cave sorting
    ////////////// cave sorting //////////////////////
    $meineHoehlen = getCaves($playerID);
    // only show this if there is more than one cave
    if (sizeof($meineHoehlen) > 1) {
        tmpl_iterate($template, 'DATA_GROUP');
        tmpl_set($template, 'DATA_GROUP/heading', 'Siedlungspriorit&auml;t (1=hoch, 10=niedrig)');
        $i = 0;
        $select = array();
        foreach ($meineHoehlen as $key => $value) {
            tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/name', lib_shorten_html($value['name'], 17));
            tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataarray', 'cave_prio');
            tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataentry', $key);
            tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/value', $meineHoehlen[$key][priority]);
            tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/size', '2');
            tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/maxlength', '2');
            if ($i + 1 < sizeof($meineHoehlen)) {
                tmpl_iterate($template, 'DATA_GROUP/ENTRY_INPUT');
            }
            $i++;
        }
    }
    // end if
    // ---------------------------------------------------------------------------------------------
    ////////////// template //////////////////////
    /* DISABLED
    
      tmpl_iterate($template, 'DATA_GROUP');
    
      tmpl_set($template, 'DATA_GROUP/heading', 'Template ausw&auml;hlen');
    
      tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/name',      'W&auml;hlen Sie ein Template (erneutes einloggen erforderlich!):');
      tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/dataarray', 'data');
      tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/dataentry', 'template');
      
      $selector = array();
      foreach ($config->template_paths as $key => $value){
        if ($key == $params->SESSION->user['template'])
          array_push($selector, array('value' => $key, 'selected' => "selected", 'text' => $value));
        else
          array_push($selector, array('value' => $key, 'text' => $value));
      }
      tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/SELECTOR', $selector);
    */
    ////////////// show_unqualified //////////////////////
    tmpl_iterate($template, 'DATA_GROUP');
    tmpl_set($template, 'DATA_GROUP/heading', "Erweiterte Ansicht");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/name', "Sollen auch Einheiten, Erweiterungen etc. angezeigt werden, die noch nicht gebaut werden k&ouml;nnen:");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/dataentry', 'show_unqualified');
    $selector = array();
    $selector[0] = array('value' => 0, 'selected' => $params->SESSION->user['show_unqualified'] == 0 ? "selected" : "", 'text' => "nein");
    $selector[1] = array('value' => 1, 'selected' => $params->SESSION->user['show_unqualified'] == 1 ? "selected" : "", 'text' => "ja");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/SELECTOR', $selector);
    // ADDED by chris--- for urlaubsmod:
    ////////////// urlaub //////////////////////
    tmpl_iterate($template, 'DATA_GROUP');
    tmpl_set($template, 'DATA_GROUP/heading', "Urlaubsmodus");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/name', "Soll der Urlaubsmodus eingeschaltet werden:<br>ACHTUNG: Lest vorher die Hilfe unten genau durch!");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/dataentry', 'urlaub');
    $selector = array();
    $selector[0] = array('value' => 0, 'selected' => $params->SESSION->user['urlaub'] == 0 ? "selected" : "", 'text' => "nein");
    $selector[1] = array('value' => 1, 'selected' => $params->SESSION->user['urlaub'] == 1 ? "selected" : "", 'text' => "ja");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/SELECTOR', $selector);
    // ADDED by chris--- for ticker:
    ////////////// show_ticker //////////////////////
    tmpl_iterate($template, 'DATA_GROUP');
    tmpl_set($template, 'DATA_GROUP/heading', "Nachrichten Ticker");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/name', "Soll der Nachrichten Ticker angezeigt werden:");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/dataentry', 'show_ticker');
    $selector = array();
    $selector[0] = array('value' => 0, 'selected' => $params->SESSION->user['show_ticker'] == 0 ? "selected" : "", 'text' => "nein");
    $selector[1] = array('value' => 1, 'selected' => $params->SESSION->user['show_ticker'] == 1 ? "selected" : "", 'text' => "ja");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/SELECTOR', $selector);
    // ADDED by chris--- for returns:
    ////////////// show_returns //////////////////////
    tmpl_iterate($template, 'DATA_GROUP');
    tmpl_set($template, 'DATA_GROUP/heading', "R&uuml;ckkehrbewegungen");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/name', "Sollen R&uuml;ckkehrbewegungen im Terminkalender angezeigt werden:");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/dataentry', 'show_returns');
    $selector = array();
    $selector[0] = array('value' => 0, 'selected' => $params->SESSION->user['show_returns'] == 0 ? "selected" : "", 'text' => "nein");
    $selector[1] = array('value' => 1, 'selected' => $params->SESSION->user['show_returns'] == 1 ? "selected" : "", 'text' => "ja");
    tmpl_set($template, 'DATA_GROUP/ENTRY_SELECTION/SELECTOR', $selector);
    ////////////// gfxpath //////////////////////
    tmpl_iterate($template, 'DATA_GROUP');
    tmpl_set($template, 'DATA_GROUP/heading', "Grafikpack");
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/name', 'Pfad zum Grafikpack (default:' . DEFAULT_GFX_PATH . '):');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataarray', 'data');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/dataentry', 'gfxpath');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/value', $playerData['game']['gfxpath']);
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/size', '30');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT/maxlength', '200');
    ////////////// password //////////////////////
    tmpl_iterate($template, 'DATA_GROUP');
    tmpl_set($template, 'DATA_GROUP/heading', 'Passwort &Auml;nderung');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT_PWD/name', 'Neues Passwort');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT_PWD/dataarray', 'password');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT_PWD/dataentry', 'password1');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT_PWD/size', '15');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT_PWD/maxlength', '15');
    tmpl_iterate($template, 'DATA_GROUP/ENTRY_INPUT_PWD');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT_PWD/name', 'Neues Passwort Wiederholung');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT_PWD/dataarray', 'password');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT_PWD/dataentry', 'password2');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT_PWD/size', '15');
    tmpl_set($template, 'DATA_GROUP/ENTRY_INPUT_PWD/maxlength', '15');
    ////////////// delete account ////////////////////
    tmpl_set($template, 'DELETE/modus_name', 'modus');
    tmpl_set($template, 'DELETE/modus', DELETE_ACCOUNT);
    tmpl_set($template, 'DELETE/heading', 'Account L&ouml;schen');
    tmpl_set($template, 'DELETE/text', 'Ich habe keine Lust mehr!');
    return tmpl_parse($template);
}