コード例 #1
0
ファイル: tribe.html.php プロジェクト: norter/Game
function tribe_getContentNoTribe($caveID, &$details)
{
    global $template;
    $messageText = array(-10 => array('type' => 'error', 'message' => _('Die Stammeszugehörigkeit hat sich erst vor kurzem geändert. Warten Sie, bis die Stammeszugehörigkeit geändert werden darf.')), -9 => array('type' => 'error', 'message' => _('Du kannst keinen Stamm gründen während du in einem Stamm bist.')), -8 => array('type' => 'error', 'message' => _('Nicht zulässiges Stammeskürzel oder Passwort.')), -7 => array('type' => 'error', 'message' => _('Der Stamm hat schon die maximale Anzahl an Mitgliedern.')), -6 => array('type' => 'error', 'message' => _('Der Stamm befindet sich gerade im Krieg und darf daher im Moment keine neuen Mitglieder aufnehmen.')), -5 => array('type' => 'error', 'message' => _('Der Stamm konnte nicht angelegt werden.')), -4 => array('type' => 'error', 'message' => _('Es gibt schon einen Stamm mit diesem Kürzel.')), -3 => array('type' => 'error', 'message' => _('Du konntest dem Stamm nicht beitreten. Vermutlich bist du schon bei einem anderen Stamm Mitglied.')), -2 => array('type' => 'error', 'message' => _('Dieser Stammesname ist nicht erlaubt!')), -1 => array('type' => 'error', 'message' => _('Stammeskürzel und Passwort stimmen nicht überein.')), 1 => array('type' => 'success', 'message' => _('Du bist dem Stamm beigetreten.')), 2 => array('type' => 'success', 'message' => _('Der Stamm wurde erfolgreich angelegt.')));
    if (!empty($_SESSION['player']->tribe)) {
        tribe_getContent($caveID, $details);
        return;
    }
    // open template
    $template->setFile('tribe.tmpl');
    $template->setShowRresource(false);
    // process form data
    $messageID = 0;
    $tribeAction = Request::getVar('action', 0);
    switch ($tribeAction) {
        case TRIBE_ACTION_JOIN:
            if (tribe_validatePassword(Request::getVar('password', '')) && tribe_validateTag(Request::getVar('tag', ''))) {
                $messageID = tribe_processJoin($_SESSION['player']->playerID, Request::getVar('tag', ''), Request::getVar('password', ''));
                if ($messageID == 1) {
                    $auth = new auth();
                    $auth->setPermission('tribe', 0, $_SESSION['player']->playerID);
                    page_refreshUserData();
                    $template->addVar('status_msg', $messageText[$messageID]);
                    tribe_getContent($caveID, $details);
                    return;
                }
            } else {
                $messageID = -8;
            }
            break;
        case TRIBE_ACTION_CREATE:
            if (tribe_validatePassword(Request::getVar('password', '')) && tribe_validateTag(Request::getVar('tag', ''))) {
                $messageID = tribe_processCreate($_SESSION['player']->playerID, Request::getVar('tag', ''), Request::getVar('password', ''), Request::getVar('restore_rank', 'no') == 'yes');
            } else {
                $messageID = -8;
            }
            if ($messageID == 2) {
                $auth = new auth();
                $auth->setPermission('tribe', 0, $_SESSION['player']->playerID);
                page_refreshUserData();
                $template->addVar('status_msg', $messageText[$messageID]);
                tribe_getContent($caveID, $details);
                return;
            }
            break;
    }
    /****************************************************************************************************
     *
     * Übergabe ans Template
     *
     ****************************************************************************************************/
    if ($messageID && isset($messageText[$messageID])) {
        $template->addVar('status_msg', $messageText[$messageID]);
    }
    $template->addVars(array('tribe_action_create' => TRIBE_ACTION_CREATE, 'tribe_action_join' => TRIBE_ACTION_JOIN));
}
コード例 #2
0
ファイル: main.php プロジェクト: agatho/uaenhanced
     break;
 case USER_PROFILE:
     tmpl_set($template, 'pagetitle', 'Benutzerprofil');
     $content = profile_getContent($params->SESSION->user['playerID']);
     break;
 case DELETE_ACCOUNT:
     tmpl_set($template, 'pagetitle', 'Account löschen');
     $content = profile_deleteAccount($params->SESSION->user['playerID'], $params->POST);
     break;
 case PLAYER_DETAIL:
     tmpl_set($template, 'pagetitle', 'Spielerbeschreibung');
     $content = player_getContent($caveID, $params->POST->detailID);
     break;
 case TRIBE_DETAIL:
     tmpl_set($template, 'pagetitle', 'Clanbeschreibung');
     $content = tribe_getContent($caveID, $params->POST->tribe);
     break;
 case TRIBE_PLAYER_LIST:
     tmpl_set($template, 'pagetitle', 'Clanmitglieder...');
     $content = tribePlayerList_getContent($caveID, $params->POST->tag);
     break;
 case LOGOUT:
     $query = "UPDATE Player SET last_logout = UNIX_TIMESTAMP() " . "WHERE playerID = " . (int) $params->SESSION->user['playerID'];
     $db->query($query);
     session_destroy();
     Header("Location:\tlogout.php");
     break;
     /////////////////////////////////////////////////////////////////////////////
     /////////////////////////////////////////////////////////////////////////////
     /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
コード例 #3
0
ファイル: main.php プロジェクト: microlefes/Game
     weather_getReport();
     break;
 case USER_PROFILE:
     profile_main();
     break;
 case DELETE_ACCOUNT:
     profile_deleteAccount($_SESSION['player']->playerID);
     break;
 case PLAYER_DETAIL:
     $playerID = Request::getVar('detailID', 0);
     player_getContent($caveID, $playerID);
     $requestKeys = array('detailID');
     break;
 case TRIBE_DETAIL:
     $tribe = Request::getVar('tribe', 0);
     tribe_getContent($caveID, $tribe);
     $requestKeys = array('tribe');
     break;
 case MERCHANT:
     merchant_getMechantDetail($_SESSION['player']->playerID, $caveID, $ownCaves[$caveID]);
     break;
 case BUG_TRACKER:
     bugtracker_getDetail();
     break;
 case LOGOUT:
     page_finish('logout');
     exit;
     break;
     /////////////////////////////////////////////////////////////////////////////
     /////////////////////////////////////////////////////////////////////////////
     /////////////////////////////////////////////////////////////////////////////