Beispiel #1
0
 }
 if ($tournament['mode'] == "liga") {
     $modus = t('Liga');
 }
 if ($tournament['mode'] == "groups") {
     $modus = t('Gruppenspiele + KO');
 }
 if ($tournament['mode'] == "all") {
     $modus = t('Alle in einem');
 }
 /*	$games = $db->qry("SELECT gameid FROM %prefix%t2_games WHERE (tournamentid = %int%) AND (round=0)", $_GET['tournamentid']);
   	$team_anz = $db->num_rows($games);
   	$db->free_result($games);*/
 include_once "modules/tournament2/class_tournament.php";
 $tfunc = new tfunc();
 $team_anz = $tfunc->GetTeamAnz($_GET['tournamentid'], $tournament['mode'], $_POST['group']);
 $dsp->NewContent(t('Turnierbaum zum Turnier %1 (%2)', $tournament['name'], $modus), t('Hier siehst du grafisch dargestellt, wer gegen wen spielt und kannst Ergebnisse melden'));
 if ($team_anz == 0) {
     $func->information(t('Dieses Turnier wurde noch nicht generiert. Die Paarungen sind noch nicht bekannt.'), "index.php?mod=tournament2&action=tree&step=1");
     break;
 } elseif ($tournament['mode'] == "all") {
     $func->information(t('Ein Turnierbaum ist für diesen Spiel-Modus nicht vorgesehen. Schaue bitte unter Paarungen nach'), "index.php?mod=tournament2&action=games&step=2&tournamentid=" . $_GET['tournamentid']);
     break;
 } else {
     if ($tournament['mode'] == "liga") {
         $height = $team_anz * 20 + 30;
     } else {
         $height = $team_anz / 2 * 50 + 60;
     }
     if ($tournament["mode"] == "groups" && $_POST['group'] == '') {
         $teams = $db->qry_first("SELECT MAX(group_nr) AS max_group_nr\n      FROM %prefix%t2_games\n      WHERE (tournamentid = %int%) AND (round = 0)\n      ", $_GET['tournamentid']);
Beispiel #2
0
<?php

include_once "modules/tournament2/class_tournament.php";
$tfunc = new tfunc();
$tournamentid = $_GET["tournamentid"];
$fullscreen = $_SESSION['lansuite']['fullscreen'];
if ($_GET['group'] == '') {
    $_GET['group'] = 1;
}
$t = $db->qry_first('SELECT tournamentid, name, mode, UNIX_TIMESTAMP(starttime) AS starttime, break_duration, game_duration, max_games, status, mapcycle
  FROM %prefix%tournament_tournaments WHERE tournamentid = %int%', $tournamentid);
$team_anz = $tfunc->GetTeamAnz($tournamentid, $t["mode"], $_GET["group"]);
/*
// Calculate TeamCount
if (($t['mode'] == "groups") && ($_GET['group'] > 0)) {
	$games = $db->qry_first("SELECT COUNT(*) AS anz
  FROM %prefix%t2_games
  WHERE (tournamentid = %int%) AND (round = 0) AND (group_nr = %string%) AND (leaderid != 0)
  GROUP BY round
  ", $tournamentid, $_GET['group']);
	$team_anz = $games['anz'];
} elseif (($t['mode'] == "groups") && ($_GET['group'] == 0)) {
	$game = $db->qry("SELECT gameid
  FROM %prefix%t2_games
  WHERE (tournamentid = %int%) AND (group_nr > 0) AND (round = 0)
  GROUP BY group_nr
  ", $tournamentid);
	$team_anz = 2 * $db->num_rows($game);
	$db->free_result($game);
} elseif ($t["mode"] == "liga"){
	$games = $db->qry_first("SELECT COUNT(*) AS anz
Beispiel #3
0
<?php

include_once "modules/tournament2/class_tournament.php";
$tfunc = new tfunc();
$dsp->NewContent(t('Turnier-Zeitplan'), t('Hier siehst du, welches Turnier zu welcher Zeit stattfindet.'));
// Generate Table-head
$mintime = 9999999999;
$maxtime = 0;
$tournaments = $db->qry("SELECT *, UNIX_TIMESTAMP(starttime) AS starttime\n  FROM %prefix%tournament_tournaments\n  WHERE party_id = %int% AND (%int% > 1 OR status != 'invisible')", $party->party_id, $auth['type']);
while ($tournament = $db->fetch_array($tournaments)) {
    // Calc Min-Time
    if ($tournament["starttime"] < $mintime) {
        $mintime = $tournament["starttime"];
    }
    // Calc Max-Time
    $team_anz = $tfunc->GetTeamAnz($tournament["tournamentid"], $tournament["mode"]);
    $max_round = 1;
    for ($z = $team_anz / 2; $z >= 2; $z /= 2) {
        $max_round++;
    }
    $endtime = $tfunc->GetGameEnd($tournament, $max_round);
    if ($endtime > $maxtime) {
        $maxtime = $endtime;
    }
}
$db->free_result($tournaments);
if ($maxtime > $mintime + 60 * 60 * 24 * 4) {
    $maxtime = $mintime + 60 * 60 * 24 * 4;
}
$head .= "<td><b>" . t('Turnier') . "</b></td>";
for ($z = $mintime; $z <= $maxtime; $z += 60 * 60 * 2) {