Beispiel #1
0
             // If joining an existing team
             if ($_POST['existing_team_name'] != "" and $tournament['teamplayer'] > 1) {
                 $success = $tteam->join($_POST["existing_team_name"], $auth["userid"], $_POST["password"]);
                 // If creating a new team
             } else {
                 if ($tournament['teamplayer'] == 1) {
                     $_POST['team_name'] = "";
                 }
                 if ($_POST["set_password"] and $_POST["set_password"] != $_POST["set_password2"]) {
                     $error["set_password2"] = t('Die Passworteingaben stimmen nicht überein');
                 }
                 if ($_POST['team_name'] == "" and $tournament['teamplayer'] > 1) {
                     $error["team_name"] = t('Bitte gib einen Teamnamen ein, oder wähle ein vorhandenes Team aus');
                 }
                 if (count($error) == 0) {
                     $success = $tteam->create($_GET["tournamentid"], $auth["userid"], $_POST['team_name'], $_POST["set_password"], $_POST['team_comment'], "team_banner");
                 }
             }
             if (count($error) == 0 and $success) {
                 // Update-League-IDs
                 $tteam->UpdateLeagueIDs($auth["userid"], $_POST["wwclid"], $_POST["wwclclanid"], $_POST["nglid"], $_POST["nglclanid"], $_POST["lgzid"], $_POST["lgzclanid"]);
                 $func->confirmation(t('Du wurdest zum Turnier %1 erfolgreich hinzugefügt', $tournament["name"]), "index.php?mod=tournament2&action=details&tournamentid={$tournamentid}");
             }
             $sec->lock("t_join");
         }
         if (count($error) > 0) {
             $_GET['step']--;
         }
         break;
 }
 switch ($_GET["step"]) {
Beispiel #2
0
         $dsp->AddTextAreaPlusRow("team_comment", t('Bemerkung'), $team_comment, "", "", "", 1);
         $dsp->AddFileSelectRow("team_banner", t('Team-Logo (max. 1MB)'), "", "", 1000000, 1);
         $dsp->AddFormSubmitRow(t('Hinzufügen'));
         $dsp->AddBackButton("index.php?mod=tournament2&action=teammgr_admin", "");
     }
     break;
     // Neues Team eröffnen - In DB schreiben
 // Neues Team eröffnen - In DB schreiben
 case 42:
     if ($_POST["set_password"] and $_POST["set_password"] != $_POST["set_password2"]) {
         $func->information("Die Passworteingaben stimmen nicht überein", "index.php?mod=tournament2&action=teammgr_admin&step=41&tournamentid={$tournamentid}&userid={$userid}");
     } elseif ($_POST['team_name'] == "") {
         $func->information(t('Bitte gib einen Teamnamen ein, oder wähle ein vorhandenes Team aus'), "index.php?mod=tournament2&action=teammgr_admin&step=41&tournamentid={$tournamentid}&userid={$userid}");
     } elseif (!$sec->locked("t_admteam_create")) {
         $t = $db->qry_first("SELECT name FROM %prefix%tournament_tournaments WHERE tournamentid = %int%", $_GET["tournamentid"]);
         if ($tteam->create($_GET["tournamentid"], $_GET["userid"], $_POST["team_name"], $_POST["set_password"], $_POST["team_comment"], "team_banner")) {
             $func->confirmation(t('Der Spieler / Das Team wurden zum Turnier %1 erfolgreich angemeldet', $t["name"]), "index.php?mod=tournament2&action=teammgr_admin");
         }
         $sec->lock("t_admteam_create");
     }
     break;
 default:
     $dsp->NewContent(t('Admin-Teammanager'), t('Hier kannst du Teams löschen oder ihnen weitere Spieler zuweisen.'));
     // Neues Team anmelden
     $tourneys = $db->qry("SELECT tournamentid, name FROM %prefix%tournament_tournaments WHERE (status = 'open')  AND party_id=%int% ORDER BY name", $party->party_id);
     if ($db->num_rows($tourneys) == 0) {
         $dsp->AddDoubleRow(t('Neues Team (Spieler) anmelden<br />(Nur in Anmeldephase möglich)'), t('Es sind keine Turniere vorhanden, welche sich noch in der Anmeldephase befinden'));
     } else {
         $t_array = array("<option value=\"\">" . t('Bitte Turnier auswählen') . "</option>");
         while ($tourney = $db->fetch_array($tourneys)) {
             array_push($t_array, "<option value=\"{$tourney['tournamentid']}\">{$tourney['name']}</option>");