Grid/Turnierbaum ist nicht komplett zu sehen....

weezle

Grünschnabel
Hallo an die liebe PHP-Gemeinschaft....

erstmal einen dicken dank, an eure vielen Postings hier,
die mir schon oft weitergeholfen haben.Es macht Spass sich mit
etwas zu beschäftigen, wo man eine nette Community antrifft, die einem
gerne weiterhilt!

Nun zu meinem Problem:

Ich habe mir ein Script runtergeladen - PHPmyTourney - ein Turnierscript
mit Turnierbaum. Das Script läuft im ganzen, leider lässt sich der Turnierbaum
ab einer Anzahl von 16 Teilnehmern nicht komplett auf meiner Seite anzeigen!

Beispiel:
8 Teilnehmer
16 Teilnehmer


Das Zweite Problem ist, das wenn nicht genügend Personen angemeldet sind,
keine Freilose mehr in den weiteren Runden verteilt werden.
Wie ihr auch beim 16 Teilnehmer Turnierbaum sehen könnt...
Könnte aber auch sein, das ich sobald ich den Turnierbaum komplett sehe,
diese manuell im Adminbereich richtig konfigurieren kann....daher ein weniger
grosses Problem für mich.

Vielen Dank im voraus, für jede Hilfe...denn der Gedanke zählt ;)
MfG
weezle

Das Turnierbaum Script (Download) :
Code:
<html>
<body bgcolor=567B98>
<?php
/***********************************************************
* This file was created by Jérôme Poulin under the phpmytourney
* project.  
* You can modify and redistribute this file as long as this
* copyright notice stays in the file.
*
* If you want to do major upgrades on my script, please contact
* me and we could work together.
* 
* Jérôme Poulin
* Student University of Sherbrooke
* poulinjerome@hotmail.com <== dont use for support !
* http:/phpmytourney.sourceforge.net/ <== use sourceforce forum for support
* 
*  phpMyTourney <C> 2001-2002
************************************************************/
 
	include('config.inc');
	echo($grid_body_string);
?>
<head>
<SCRIPT LANGUAGE = "JavaScript"
        TYPE="text/javascript">
function rien(){}
</SCRIPT>
</head>
<LINK REL="stylesheet" TYPE="text/css" HREF="/styles.css">
<?php
if(!isset($tourney_id)) echo("ERROR : page not properly called");
else{
	
	include($functions_file);
	$status = get_status($tourney_id);	
	if($status < 7) print_error("<font color=black size=6><i><center>Turnierbaum wurde noch nicht generiert !</font color=black size=6></i><br> <font color=black size=6><i>Melden sich sich bei der Cup-Leitung,
falls sie eventuell Fragen haben.<br><br><br> <size=3>Ansprechpartner:  weezle</size=3></center></font color=black size=6></i>");
	else{
//*********************************************************
//	Parameters passed to scripts (prolly the number or players)
//*********************************************************
$nb_players = get_nb_tourney($tourney_id);
$round = get_nb_round($nb_players);
$round++;	//there is 1 more column then the number of rounds...
//*********************************************************
//	Sets the Starting line for each round.
//*********************************************************
$r1=1;
for($i=2;$i<=$round;$i++){
	$curround = "r" . $i;
	$previousround = "r" . ($i-1);
	$$curround = $$previousround *2;
}
//*********************************************************
//	Sets the add number for each round.
//*********************************************************
$add1=2;
for($i=2;$i<=$round;$i++){
	$curadd = "add" . $i;
	$previousround = "add" . ($i-1);
	$$curadd = $$previousround *2;
}
//*********************************************************
//	This Parts inits all the flags to False (0)
//*********************************************************
for($i=1;$i<=$round;$i++){
	$flagvar = "flag" . $i;
	$$flagvar = 0;
}
//*********************************************************
//	This parts inits the cpt to 0 for each round
//*********************************************************
for($i=1;$i<=$round;$i++){
	$cptvar = "cpt" . $i;
	$$cptvar = 1;
}
//*********************************************************
//	This parts inits array containing players information
//*********************************************************
for($i=1;$i<=$round;$i++){
	$arrayvar = "player" . $i;
	$$arrayvar = get_players_array($i);
}

//*********************************************************
//	This parts prints the Standing GRid!
//*********************************************************
echo("<table>");
for($row=1;$row<($nb_players*2);$row++){
	$oth_flag = 0;
	echo("<tr>");
	//Find which colums a name has to be printed...
	for($col=1;$col<=$round;$col++){	
		$curround = "r" . $col;
		$curadd = "add" . $col;
		if ($row == $$curround){
			$flagvar = "flag" . $col;
			if ($$flagvar) $oth_flag = 1;
			if ($col != $round) $$flagvar = neg($$flagvar);	
			$name_col = $col;
			$$curround += $$curadd;
			$arrayvar = "player" . $col;
			$cptvar = "cpt" . $col;
			$name = ${$arrayvar}[$$cptvar];
			${$cptvar}++;
		}
	}
	for($col=1;$col<=$round;$col++){
		$flagvar = "flag" . $col;
		if($col == $name_col) 
			if($col != $round) print_td_name($name,1);
			else print_td_name($name,0);
		else print_td_vide($$flagvar);
	}

	echo("</tr>");
}	
	echo("</table>");
	do_not_remove_please();

	}
}
//*********************************************************
//	These Function Print the columns...
//*********************************************************
function print_td_name($name,$flag){
	echo("<td bgcolor=\"#977E53\" width=\"100\">-". $name . "</td>");
	if ($flag) print_td_bar_color();
	else print_td_bar_vide();
}
function print_td_vide($flag){
	echo("<td width=\"100\"> </td>");
	if ($flag) print_td_bar_color();
	else print_td_bar_vide();
}
function print_td_bar_color(){
	echo("<td width=\"8\" bgcolor=\"#C4A879\"> </td>");
}
function print_td_bar_vide(){
	echo("<td width=\"8\"> </td>");
}
//*********************************************************
//	This function return the opposition of current flag var
//*********************************************************
function neg($flag){
	if ($flag) return 0;
	else return 1;
}
function get_players_array($round){
	global $tourney_id;
	$tou_type = get_tourney_type($tourney_id);
	$get_name_fct = "get_" . $tou_type . "_name";
	$sql = "SELECT id,r". $round ." FROM " . $GLOBALS['dbtable_header'] . "data_" . $tourney_id . "
		WHERE r" . $round . " > 0
		ORDER BY r" . $round;
	$array = get_mysql_rows($sql,"no");
	$nb_array = count($array);
	for($i=0;$i<$nb_array;$i++){
		if($array[$i][0] >= 0)
			if ($array[$i][0] == 0) $name = "-={ Freilos }=-";
			else{
				if($tou_type == "team"){
					$name = $get_name_fct(get_players_team($array[$i][0]));
					$members_list = get_team_list_java($array[$i][0]);
				}
				else {			
					$name = $get_name_fct($array[$i][0]); 
					$members_list = "Keine Members ~ Single Cup";
				}
				$name = "<A HREF =\"javascript:rien()\"
							ONCLICK = \"alert('$members_list')\"
							onMouseOver = \"window.status = '';return true\">" . $name . "</a>";
				$comment = get_comment_tourney($array[$i][0],$round);
				if ($comment){
					$comment = "<A HREF =\"javascript:rien()\"
							ONCLICK = \"alert('$comment')\"
							onMouseOver = \"window.status = '';return true\"><img src=\"http://www.bleischter-suffkoepp.de/Bilder/comment.jpg\" border=\"0\"></a>";

				$name .= " " . $comment;
				}
			}
	$array_1dim[$array[$i][1]] = $name;
	}
	return $array_1dim;
	
}
function get_comment_tourney($id,$round){
	global $tourney_id;
	$sql = "SELECT commment from  " . $GLOBALS['dbtable_header'] . "data_" . $tourney_id . "
		WHERE 	id='$id' 
		and 	curround ='$round'";
	return get_mysql_value($sql);
}
function get_team_list_java($id){
	global $tourney_id;
if($id <= 0) return "Kein gültiges Team";
else{	
	$sql = "SELECT pid from  " . $GLOBALS['dbtable_header'] . "team_members_" . $tourney_id . " where id = '$id' order by nb";
	$allies = get_mysql_rows($sql);
	$members_list = "Leader:\\n" . get_player_name($id);
	$nb = get_nb_per_team($tourney_id);
	for($i=1;$i<$nb;$i++)
		if($allies[$i][0] > 0)
			$members_list .= "\\nMember:\\n" . get_player_name($allies[$i][0]);
	return $members_list;
}
}
?>
</body>
</html>
 
Zuletzt bearbeitet von einem Moderator:

Neue Beiträge

Zurück