# Parse error: parse error, unexpected $end in



## merti (13. März 2004)

Hallo,

Hab ein PHP-Code geschrieben aber das funktioniert nicht so ganz. Ich bekommen immer  diesen Fehler:

Parse error: parse error, unexpected $end in D:\sbx\guestbook\create_entry.php on line 64</b>.

Bitte um Hilfe ich weis nicht mehr weiter.

Danke im Vorraus,


----------



## Chino (13. März 2004)

> _Original geschrieben von merti _
> *Hab ein PHP-Code geschrieben aber das funktioniert nicht so ganz. Ich bekommen immer  diesen Fehler:
> 
> Parse error: parse error, unexpected $end in D:\sbx\guestbook\create_entry.php on line 64</b>.*


 Tu Dir und uns einen Gefallen und poste die relevante Zeile. Aber bitte auch mit einigen (wenigen) vorigen Zeilen, da der Fehler eigentlich immer einige Zeilen vorher zu finden ist.


----------



## merti (13. März 2004)

Also das schaut dann so aus:


```
<?

 include ("dbconnect.php");
 
  function create_entry($name,$ort,$email,$url,$kommentar)
{  
  	$name = cleanup_text($name);
  	$ort = cleanup_text($ort); 
  	$email = cleanup_text($email);
  	$url = cleanup_text($url);
  	$kommentar = cleanup_text($kommentar);
  	
  	
  	$errmsg = "";
  	
  	if (empty($name))
  	{
  		$errmsg .= "<li>you have to put in a name, at least\n";  			
  	}
  	
  	if (empty($email) || !eregi("^[A-Za-z0-9\_-]+@[A-Za-z0-9\_-] +.[A-Za-z0-9\_-]+.*", $email))
  	{
  		$errmsg .= "<li>$email ist keine gültige Adresse!\n";
  	}
  	else
  	{
  	$query = "select * from guestbook where email = '$email'";
  	$result = safe_query($query);
  	if (mysql_num_rows($result) > 0)
  	{
  		$errmsg .= "<li>$email has already signed this guestbook.\n";
  	}
}
	if (!empty($url) && !eregi("^http://[A-Za-z0-9\%\?\_\:\~\/\.-]+$",$url))
	{
		$errmsg .= "<li>$url hat falsches Format für eine Url.\n";
	}
	
	if (empty($errmsg))
	{
		$query = "insert into guestbook"
		." (name,ort,email,url,kommentar) values "
		." ('$name','$ort','$email','$url','$kommentar')";
		safe_query($query);
		
		print "<h2>Thanks, $name</h2>\n";
	}
	else
	{
		print <<<EOQ
	<p>
	<font color=red>
	<b>
	<ul>
	$errmsg
	</ul>
	Bitte erneut die daten eingeben.
	</p>
	EOQ;
	}
		return $errmsg;
	}
		
?>
```


----------



## gecko (13. März 2004)

ich kann nicht zählen


----------



## merti (13. März 2004)

weis du was ich da falsch gemacht hab


----------



## gecko (13. März 2004)

wenn du mir sagst in welcher zeile der fehler ist ja....


----------



## merti (13. März 2004)

Das ist ja mein problem, weis selber nämlich auch nicht.


----------



## gecko (13. März 2004)

Wie ? Parse error: parse error, unexpected $end in D:\sbx\guestbook\create_entry.php on line 64

Dann markier doch mal bitte diese Zeile...  Sonst kann ich nur raten


----------



## merti (13. März 2004)

on line 64 is die letzte Zeile, das ist das komische daran. Das ist dann praktisch ---> das Ende PHP zeichen ---> " ?>"


----------



## gecko (13. März 2004)

Dann fehlt meistens eine Klammer, aber dein letzter print Befehl ist auch im ... 

print *"*<<<EOQ
<p>
<font color=red>
<b>
<ul>
$errmsg
</ul>
Bitte erneut die daten eingeben.
</p>
EOQ*"*;


----------



## merti (13. März 2004)

funktioniert danke ....


----------



## gecko (13. März 2004)

Ich würd dir raten dir mal einen Editor mit Syntax Highlighting zuzulegen, dann kommst du selber und schneller auf solche Fehler.


----------



## Dominik Haubrich (1. Februar 2007)

Ich weiss, das Problem ist schon ziemlich alt, aber ich hatte gerade den selben Fehler in einem PHP-Skript (Parse error: parse error, unexpected $end in ...) und bin über Google auf diesen Thread aufmerksam geworden 

Bei mir lag der Fehler daran, dass in der PHP-Konfiguration des Servers der verkürzte öffnende *<?* -Tag nicht zugelassen ist, sondern nur der normale *<?php*-Tag akzeptiert wird. Wenn ein Skript nun die verkürzten *<?*-Tags enthält, führt dies unweigerlich zu diesem Parse-Error. Also falls jemand zukünftig das gleiche Problem haben sollte, setzt mal den Hebel an dieser Stelle an


----------



## Dr Dau (1. Februar 2007)

Hallo!



Dominik Haubrich hat gesagt.:


> .....und bin über Google auf diesen Thread aufmerksam geworden.....


Ja ja, immer diese doofen Suchmaschinen. 


Dominik Haubrich hat gesagt.:


> Also falls jemand zukünftig das gleiche Problem haben sollte, setzt mal den Hebel an dieser Stelle an


Um den Hebel mal etwas abzusägen , das Zauberwort heisst short_open_tag.
Dort steht auch warum man short_open_tag u.U. deaktiviert haben sollte.

Gruss Dr Dau


----------



## MalcolmX1 (18. Mai 2007)

Habe das selbe Problem und als totaler php Neuling steig ich absolut noch nicht dahinter, ich hoffe ihr könnt mir helfen:


```
<?php

include 'dbconnect.php';

   $ergebnis = mysql_query("SELECT * FROM Zitate");
while($daten = mysql_fetch_assoc($ergebnis)) {
    echo "<p>Autor: ".$daten["Autor"];
    echo "<br />Zitat: ".$daten["Zitat"];
    echo "</p>"; 
?>
```



> Parse error: syntax error, unexpected $end in /mnt/cr1/08/369/00000016/htdocs/Homepage/zitate/index.php on line 20



Zeile 20 ist die letzte Zeile im Dokument.


----------



## TchiboMann (18. Mai 2007)

PHP Code bitte immer in[php ][/ php] - Tags!


```
<?php

include 'dbconnect.php';

   $ergebnis = mysql_query("SELECT * FROM Zitate");
while($daten = mysql_fetch_assoc($ergebnis)) {
    echo "<p>Autor: ".$daten["Autor"];
    echo "<br />Zitat: ".$daten["Zitat"];
    echo "</p>";
} // schliessende Klammer vergessen! 
?>
```


----------



## MalcolmX1 (18. Mai 2007)

Vielen dank jetzt funktioniert es


----------



## Rayvez (2. Mai 2008)

Sers,hab auch so einen Fehler:



> Parse error: syntax error, unexpected $end in /users/rayvez/www/emaster/eingabe.php on line 60




```
if (mysql_num_rows($result)) {
      echo "<fieldset>
<legend>Suche ergab:</legend>Die englische Übersetzung für ".$ger." ist ".$row['Englisch'];
   } else{
      echo "<fieldset>
<legend>Suche ergab:</legend>Keinen Eintrag gefunden!<br />Tragen Sie es selbst ein!

<a href='einfügen.php'>Hier...</a></fieldset>";
    } 
if (empty($ger)) {echo "<fieldset><legend>Problem:</legend>
Sie haben keinen Suchbegriff eingegeben!</fieldset>" ;}

?>


</body>
</html>
```

Zeile 60 is ganz unten
	
	
	



```
</html>
```


----------



## kalle123456 (2. Mai 2008)

```
if (mysql_num_rows($result)){
    echo "<fieldset>
          <legend>Suche ergab:</legend>
		  Die englische Übersetzung für ".$ger." ist ".$row['Englisch'];
}else{
   echo "<fieldset>
         <legend>Suche ergab:</legend>
		 Keinen Eintrag gefunden!<br />Tragen Sie es selbst ein!
         <a href='einfügen.php'>Hier...</a></fieldset>";
}
if(empty($ger)){
   echo "<fieldset><legend>Problem:</legend>
         Sie haben keinen Suchbegriff eingegeben!</fieldset>" ;
}
?>


</body>
</html>
```

Einfach mal den Code richtig einrücken und siehe da der Fehler liegt in den Codeteil den du nicht gepostest hast.

Gruss


----------



## killer (28. August 2009)

Hab versucht nen Tippspiel für die neue Europaleague zu erstellen...beim aufrufen kommt folgender fehler:

Parse error: syntax error, unexpected $end in /usr/export/www/vhosts/funnetwork/hosting/wfe/phpBB2/includes/functions_el.php on line 860

Hier die funktions_el.php (zeile 860 ist die letzte Zeile!)...ich komm einfach nicht weiter und find den fehler nicht...

```
<?php
/***************************************************************************
 *                              functions_el.php
 *                            -------------------
 *   for MOD              : Euro League
 *   version              : 1.0
 *   begin                : Sunday, Aug 23, 2009
 *   copyright            : (C) 2009 killer
 *   email                : see HP
 *   Bearbeitung	  : wrestlingfire.cwsurf.de
 *   based on             : WM WebTipp (C) AceVentura
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
 
 if ( !defined('IN_PHPBB') )
{
   die("Hacking attempt");
} 

 // Get all config data
 function get_el_config() {

        global $db;

      //
	// Get config data
	//
	$sql = "SELECT * FROM " . EL_CONFIG_TABLE;
        if(!$result = $db->sql_query($sql))
        {
	        message_die(GENERAL_ERROR, "Could not query config information in el configuration", "", __LINE__, __FILE__, $sql);
        }
        else
        {
	    while( $row = $db->sql_fetchrow($result) )
	    {
		$config_name = $row['config_name'];
		$config_value = $row['config_value'];

		$new[$config_name] = $config_value;

	    }
        }
	$db->sql_freeresult($result);

	return $new;
 }

 // Get el teams data
 function get_el_teams($team_id = 0) {

        global $db;

      //
	// Get teams data
	//
	if( $team_id == 0 )
	{
        $sql = "SELECT *
		FROM  " . EL_TEAMS_TABLE . "
                ORDER BY team_id ASC";
        }
        else {
        $sql = "SELECT *
		FROM  " . EL_TEAMS_TABLE . "
                WHERE team_id = $team_id";
        }

	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get teams data', '', __LINE__, __FILE__, $sql);
	}

	$el_teams = array();
	while ( $row = $db->sql_fetchrow($result) )
	{

		$el_teams[$row['team_id']] = $row;
	}
	$db->sql_freeresult($result);

	return $el_teams;

 }
 
 // Get el users data
 function get_el_users() {

        global $db;

      //
	// Get users data
	//
        $sql = "SELECT t.*, sum(tipp_points) AS user_points, count(tipp_points) as user_total_tipps
      FROM  " . EL_TIPPS_TABLE . " t, " . USERS_TABLE . " u
      WHERE tipp_user = user_id
      GROUP BY tipp_user
                ORDER BY user_points DESC, username";

	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get user tipps data', '', __LINE__, __FILE__, $sql);
	}

	$el_users = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
	//	$el_users[][$row['tipp_user']] = $row;
	   $el_users[] = $row;
	}
	$db->sql_freeresult($result);

	return $el_users;

 }
 
 // Get all users data
 function get_all_the_users() {

        global $db;

      //
	// Get users data
	//
        $sql = "SELECT user_id, username
		FROM  " . USERS_TABLE;

	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get users data', '', __LINE__, __FILE__, $sql);
	}

	$users = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
		$users[$row['user_id']] = $row['username'];
	}
	$db->sql_freeresult($result);

	return $users;

 }
 
 // Get el teams data order by groups
 function get_el_teamids_by_groups() {

        global $db;

      //
	// Get teams data
	//
        $sql = "SELECT *
		FROM  " . EL_TEAMS_TABLE . "
                ORDER BY team_id ASC";

	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get teams data', '', __LINE__, __FILE__, $sql);
	}

	$el_teams = array();
	while ( $row = $db->sql_fetchrow($result) )
	{

		$el_teams[$row['team_group']][] = $row['team_id'];
	}
	$db->sql_freeresult($result);

	return $el_teams;

 }
 
 // Get el tipps data
 function get_el_tipps($calculate = 0, $user_id = 0) {

        global $db;

      //
	// Get tipps data
	//
	if ( $user_id == 0 ) {
	$sql = "SELECT *
		FROM  " . EL_TIPPS_TABLE . "
                ORDER BY tipp_id ASC";
        }
        else {
        $sql = "SELECT *
		FROM  " . EL_TIPPS_TABLE . "
		WHERE tipp_user = $user_id 

                ORDER BY tipp_id ASC";

        }
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get tipps data', '', __LINE__, __FILE__, $sql);
	}

	$el_tipps = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
		if ( $calculate == 0 ) {
		   $el_tipps[$row['tipp_user']][$row['tipp_game']] = $row;
		}
		else {
                   $el_tipps[$row['tipp_game']][] = $row;
                }
	}
	$db->sql_freeresult($result);

	return $el_tipps;
 }

 // Get el games data
 function get_el_games($team_home = 0, $team_away = 0, $by_row = 0) {

        global $db;

        // Get all teams
        $teamsdata = get_el_teams();

      //
	// Get games data
	//
	if ( $team_home == 0 ) {
	$sql = "SELECT *
		FROM  " . EL_GAMES_TABLE . "
		    WHERE game_id < 97
                ORDER BY game_id ASC";
        }
        else {
        $sql = "SELECT *
		FROM  " . EL_GAMES_TABLE . "
                WHERE (game_home = $team_home AND game_away = $team_away) OR (game_home = $team_away AND game_away = $team_home)";
        }
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get games data', '', __LINE__, __FILE__, $sql);
	}

	$gamesdata = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
		if ( $team_home == 0 && $by_row == 0)
		{
			if ($row['game_id'] < 13) {$group = 'A';}
			else if ($row['game_id'] < 25) {$group = 'B';}
			else if ($row['game_id'] < 37) {$group = 'C';}
			else if ($row['game_id'] < 49) {$group = 'D';}
			else if ($row['game_id'] < 61) {$group = 'E';}
			else if ($row['game_id'] < 73) {$group = 'F';}
			else if ($row['game_id'] < 85) {$group = 'G';}
			else if ($row['game_id'] < 97) {$group = 'H';}
			else if ($row['game_id'] < 109) {$group = 'I';}
			else if ($row['game_id'] < 121) {$group = 'J';}
			else if ($row['game_id'] < 133) {$group = 'K';}
			else if ($row['game_id'] < 145) {$group = 'L';}
			$row['game_group'] = $group;
			$gamesdata[$row['game_group']][] = $row;
		}
		else
		{
			$gamesdata[] = $row;
		}

	}
	$db->sql_freeresult($result);
	
	ksort($gamesdata);

	return $gamesdata;

 }

 // Get el finals data
 function get_el_finalgames() {

        global $db, $lang;

        // Get all teams
        $resultsdata = get_el_results();

      //
	// Get games data
	//
	$sql = "SELECT *
		FROM  " . EL_GAMES_TABLE . "
		    WHERE game_id > 96
                ORDER BY game_id ASC";

	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get finals data', '', __LINE__, __FILE__, $sql);
	}

	$gamesdata = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
		if ( $row['game_id'] < 161 ) {
                     $pseudo_group = $lang['l_el_sechzentelfinale'];
					 
					 if ( $row['game_id'] < 193 ) {
                     $pseudo_group = $lang['l_el_achtelfinale'];
		}
		else if ( $row['game_id'] < 201 ) {
                     $pseudo_group = $lang['l_el_viertelfinale'];
		}
		else if ( $row['game_id'] < 205 ) {
                     $pseudo_group = $lang['l_el_halbfinale'];
		}
		else {
                     $pseudo_group = $lang['l_el_finale'];
		}
                $row['game_group'] = $pseudo_group;
		$gamesdata[$pseudo_group][] = $row;
	}
	$db->sql_freeresult($result);

	return $gamesdata;

 }

 // Get el results data
 function get_el_results($game_id = 0, $by_row = 0) {

        global $db;

      //
	// Get results data
	//
	if ( $game_id == 0 ) {
	$sql = "SELECT *
		FROM  " . EL_RESULTS_TABLE . "
                ORDER BY result_game ASC";
        }
        else {
        $sql = "SELECT *
		FROM  " . EL_RESULTS_TABLE . "
                WHERE result_game = $game_id";
        }

        if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get results data', '', __LINE__, __FILE__, $sql);
	}

	$resultsdata = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
		if ( $game_id == 0 && $by_row == 0) {
		        $resultsdata[$row['result_game']] = $row;
		}
		else {
		$resultsdata[] = $row;
                }
	}
	$db->sql_freeresult($result);

	return $resultsdata;

 }
 
 // Get teams order by teamname as row
 function get_el_teams_as_row() {

        global $db;

      //
	// Get teams data
	//
	$sql = "SELECT *
		FROM  " . EL_TEAMS_TABLE . "
                ORDER BY team_name";

        if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get teams data', '', __LINE__, __FILE__, $sql);
	}

	$resultsdata = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
		$resultsdata[] = $row;
	}
	$db->sql_freeresult($result);

	return $resultsdata;

 }


 // Saves a users EL tipp
 function save_el_tipp($user_id, $tipped_winner) {

        global $db, $lang;
        
        $first_game      = get_first_game();
        $first_game_time = $first_game[0]['game_time'];
        $current_time = time();

        if ( $current_time < $first_game_time ) {
         //
	   // Delete old el tipp
	   //
	   $sql = "DELETE FROM " . EL_TIPPS_TABLE . " WHERE tipp_user = $user_id AND tipp_game = 126";
           if( !($result = $db->sql_query($sql)) )
	   {
		message_die(GENERAL_ERROR, 'Could not delete el tip', '', __LINE__, __FILE__, $sql);
	   }
	   //
	   // Insert el tipp
	   //
	   if ( $tipped_winner != 0 ) {
	   $sql = "INSERT INTO " . EL_TIPPS_TABLE . " (tipp_user,tipp_game,tipp_home) VALUES ($user_id,126,$tipped_winner)";
           if( !($result = $db->sql_query($sql)) )
	   {
		message_die(GENERAL_ERROR, 'Could not insert el tip', '', __LINE__, __FILE__, $sql);
	   }
	   }
	}

 }

 // Get first games data
 function get_first_game() {

        global $db;

      //
	// Get games data
	//
	$sql = "SELECT *
		FROM  " . EL_GAMES_TABLE . "
                ORDER BY game_time ASC LIMIT 1";

        if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get games data', '', __LINE__, __FILE__, $sql);
	}

	$resultsdata = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
		$resultsdata[] = $row;
	}
	$db->sql_freeresult($result);

	return $resultsdata;

 }
 
 // Clear results table
 function clear_result($game_id) {

        global $db;

      //
	// Clear results data
	//

	$sql = "DELETE FROM " . EL_RESULTS_TABLE . "
                WHERE result_game = " . $game_id;

	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not reset result data', '', __LINE__, __FILE__, $sql);
	}


 }
 
 // Clear tipps table for a user
 function clear_tipps($user_id, $finals = 0) {

        global $db;

        $current_time = time();

      //
	// Clear usertipps data
	//
        if ( $finals == 0 ) {
	   $sql = "DELETE FROM " . EL_TIPPS_TABLE . "
                   WHERE tipp_user = $user_id AND tipp_game < 145 AND tipp_time > $current_time";
        }
        else {
           $sql = "DELETE FROM " . EL_TIPPS_TABLE . "
                   WHERE tipp_user = $user_id AND tipp_game > 144 AND tipp_game <> 206 AND tipp_time > $current_time";
        }
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not reset usertipps data', '', __LINE__, __FILE__, $sql);
	}
 }

 // Save el results data
 function save_result($game_id, $home_val, $away_val, $winner = 0, $loser = 0) {

        global $db;

      //
	// Update results data
	//
	if ( $winner == 0 ) {
	$sql = "INSERT INTO " . EL_RESULTS_TABLE . " (result_game,result_home,result_away)
		VALUES ($game_id,$home_val,$away_val)";
	}
        else {
        $sql = "INSERT INTO " . EL_RESULTS_TABLE . " (result_game,result_home,result_away,final_winner,final_loser)
		VALUES ($game_id,$home_val,$away_val,$winner,$loser)";
        }
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not update results data', '', __LINE__, __FILE__, $sql);
	}


 }

 // Save teams points and goals
 function save_points($teampoints, $teamgoals, $teamgotgoals) {

        global $db;
        
        $teams_data = get_el_teams();

        for ( $h = 0; $h < count($teams_data); $h++ ) {
      //
	// Update teams data
	//
        if ( isset($teampoints[$teams_data[$h]['team_id']]) ) {
	   $sql = "UPDATE " . EL_TEAMS_TABLE . "
		SET team_points = " . $teampoints[$teams_data[$h]['team_id']] . ", team_goals = " . $teamgoals[$teams_data[$h]['team_id']] . ", team_gotgoals = " . $teamgotgoals[$teams_data[$h]['team_id']] . "
                WHERE team_id = " . $teams_data[$h]['team_id'];
	   if( !($result = $db->sql_query($sql)) )
	   {
		message_die(GENERAL_ERROR, 'Could not update teams data', '', __LINE__, __FILE__, $sql);
	   }
        }
	}

 }

 // Save user tipps data
 function save_tipp($game_id, $user_id, $home_val, $away_val, $tipp_time) {

        global $db;

      //
	// Update tipps data
	//
	$sql = "INSERT INTO " . EL_TIPPS_TABLE . " (tipp_game,tipp_time,tipp_user,tipp_home,tipp_away)
		VALUES ($game_id,$tipp_time,$user_id,$home_val,$away_val)";
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not update tipps data', '', __LINE__, __FILE__, $sql);
	}
 }


 // Sorts a grouparray for the standings
 function sort_standings($teams, $teams_data, $results_data, $games_data) {
                                 	
        $sorted_teams = array();

        for ( $z = 0; $z < count($teams); $z++ ) {

             $sorted_teams = insert_team($sorted_teams, $teams[$z], $teams_data, $games_data, $results_data);

        }

        return $sorted_teams;
 }

 // Inserts a team (needed for sort_standings())
 function insert_team($standings_array, $team_id, $teams_data, $games_data, $results_data) {

        $new_standings_array = array();

        for ( $k = 0; $k < count($standings_array); $k++ ) {

             $team_id_old     = $standings_array[$k];
             $team_id_new     = $team_id;
             $team_data_old   = $teams_data[$team_id_old];
             $team_data_new   = $teams_data[$team_id_new];
             $team_points_old = $team_data_old['team_points'];
             $team_points_new = $team_data_new['team_points'];

             if ( $team_points_old < $team_points_new ) {
                  $team_id = $team_id_old;
                  $standings_array[$k] = $team_id_new;

             }
             else if ( $team_points_old == $team_points_new ) {
                  $new_standings_array = find_winner_on_deuce($team_id_new, $team_id_old, $games_data, $results_data, $teams_data);
                  $team_id = $new_standings_array[1];
                  $standings_array[$k] = $new_standings_array[0];
             }

        }
        $standings_array[] = $team_id;

        return $standings_array;
 }
 
 // Filters games array
 function get_el_spec_game($team_home, $team_away, $games_data) {
          for ( $t = 0; $t < 97; $t++ ) {
             if ( ($games_data[$t]['game_home'] == $team_home && $games_data[$t]['game_away'] == $team_away) || ($games_data[$t]['game_home'] == $team_away && $games_data[$t]['game_away'] == $team_home) ) {
                 return $games_data[$t];
             }
          }
          return array();
 }

 // Sorts a grouparray for the standings
 function find_winner_on_deuce($team_id_new, $team_id_old, $games_data, $results_data, $teams_data) {

        $game_data    = get_el_spec_game($team_id_new, $team_id_old, $games_data);
        $game_results = $results_data[$game_data['game_id']];


        $team_in_order = array();

        if ( $game_results['result_home'] > $game_results['result_away']  ) {

                $team_in_order[] = $game_data['game_home'];
                $team_in_order[] = $game_data['game_away'];

        }
        else if ( $game_results['result_home'] < $game_results['result_away']  ) {

                $team_in_order[] = $game_data['game_away'];
                $team_in_order[] = $game_data['game_home'];

        }
        else {

                $teamdata_home = $teams_data[$game_data['game_home']];
                $teamdata_away = $teams_data[$game_data['game_away']];

             if ( ($teamdata_home['team_goals']-$teamdata_home['team_gotgoals']) > ($teamdata_away['team_goals']-$teamdata_away['team_gotgoals'])  ) {

                $team_in_order[] = $game_data['game_home'];
                $team_in_order[] = $game_data['game_away'];

             }
             else if ( ($teamdata_home['team_goals']-$teamdata_home['team_gotgoals']) < ($teamdata_away['team_goals']-$teamdata_away['team_gotgoals'])  ) {

                $team_in_order[] = $game_data['game_away'];
                $team_in_order[] = $game_data['game_home'];

             }
             else {

             if ( $teamdata_home['team_goals'] > $teamdata_away['team_goals']  ) {

                $team_in_order[] = $game_data['game_home'];
                $team_in_order[] = $game_data['game_away'];

             }
             else if ( $teamdata_home['team_goals'] < $teamdata_away['team_goals']  ) {

                $team_in_order[] = $game_data['game_away'];
                $team_in_order[] = $game_data['game_home'];

             }
             else {
                // When this code is reached, the UEFA has to define winners by a random selection. I just use defaults in here.
                // Correct gorup winners in ACP.
                $team_in_order[] = $team_id_old;
                $team_in_order[] = $team_id_new;
             }
             }
        }

        return $team_in_order;
 }
 
 // Get el auth status
 function get_el_auth() {

  global $db, $el_config, $userdata;

      $access_group = $el_config['restrict_to'];
      $sql = "SELECT g.group_id FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
      WHERE g.group_id = ug.group_id
      AND ug.user_id = " . $userdata['user_id'] . "
      AND ug.user_pending <> " . TRUE . "
      AND g.group_single_user <> " . TRUE . "
      AND g.group_id = $access_group";
      if ( !$result = $db->sql_query($sql) )
      {
         message_die(GENERAL_ERROR, 'Could not get el auth data', '', __LINE__, __FILE__, $sql);
      }
      $check_el_auth = $db->sql_numrows($result);
      $db->sql_freeresult($result);
      if ( $check_el_auth != 0 )
      {
   	return TRUE;
      }
      return FALSE;
}

// Calculate user points
 function calculate_user_points($user_id = 0) {

  global $db, $el_config;
  
  // Reset all tippoints
  if ( $user_id == 0 ) {
  $sql = "UPDATE " . EL_TIPPS_TABLE . " SET tipp_points = 0";
  } 
  else {
  $sql = "UPDATE " . EL_TIPPS_TABLE . " SET tipp_points = 0 WHERE tipp_user = $user_id";
  }
  if( !($result = $db->sql_query($sql)) )
  {
        message_die(GENERAL_ERROR, 'Could not update tipps data', '', __LINE__, __FILE__, $sql);
  }

  $el_results = get_el_results(0,1);
  $el_tipps   = get_el_tipps(1, $user_id);


  for ( $i = 0; $i < count($el_results); $i++ ) {
       $current_game_id = $el_results[$i]['result_game'];
       $result_home     = $el_results[$i]['result_home'];
       $result_away     = $el_results[$i]['result_away'];

       for ( $u = 0; $u < count($el_tipps[$current_game_id]); $u++ ) {

            $tipp_home   = $el_tipps[$current_game_id][$u]['tipp_home'];
            $tipp_away   = $el_tipps[$current_game_id][$u]['tipp_away'];
            $tipp_points = $el_tipps[$current_game_id][$u]['tipp_points'];
            $tipp_new_points = 0;
            

           if ( $current_game_id != 126 ) {
            if ( $tipp_home == $result_home && $tipp_away == $result_away ) {
                      $tipp_new_points = $el_config['points_match'];
            }
            else if ( $tipp_home - $tipp_away == $result_home - $result_away ) {
                      $tipp_new_points = $el_config['points_tordiff'];
            }
            else if ( ($tipp_home > $tipp_away && $result_home > $result_away) || ($tipp_home < $tipp_away && $result_home < $result_away) ) {
                      $tipp_new_points = $el_config['points_tendency'];
            }
           }
           else {
             if ( $tipp_home == $result_home ) {
                      $tipp_new_points = $el_config['points_winner'];
             }
           }


            if ( $tipp_new_points != $tipp_points ) {
                      $sql = "UPDATE " . EL_TIPPS_TABLE . "
                               SET tipp_points = $tipp_new_points
                               WHERE tipp_id = " . $el_tipps[$current_game_id][$u]['tipp_id'];
	              if( !($result = $db->sql_query($sql)) )
	              {
		          message_die(GENERAL_ERROR, 'Could not update tipps data', '', __LINE__, __FILE__, $sql);
	              }
            }


       }

  }

 }

 // get users el winner tipp
 function get_el_winner($user_id)
 {
   global $db;
   
   $sql = "SELECT * FROM " . EL_TIPPS_TABLE . " WHERE tipp_game = 206 AND tipp_user = " . $user_id;
	              if( !($result = $db->sql_query($sql)) )
	              {
		          message_die(GENERAL_ERROR, 'Could not get tipps data', '', __LINE__, __FILE__, $sql);
	              }
   $winnerdata = 0;
	while ( $row = $db->sql_fetchrow($result) )
	{
		$winnerdata = $row['tipp_home'];
	}
	$db->sql_freeresult($result);
	
	return $winnerdata;

 }
 
 function get_el_champion_tipps()
 {
   global $db;

   $sql = "SELECT * FROM " . EL_TIPPS_TABLE . " WHERE tipp_game = 126";
	              if( !($result = $db->sql_query($sql)) )
	              {
		          message_die(GENERAL_ERROR, 'Could not get tipps data', '', __LINE__, __FILE__, $sql);
	              }
   $championsdata = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
		$championsdata[$row['tipp_user']] = $row['tipp_home'];
	}
	$db->sql_freeresult($result);
	
	return $championsdata;

 }

// Get el gametimes by id
 function get_el_gametimes() {

        global $db;

      //
	// Get games data
	//
	$sql = "SELECT game_id, game_time
		FROM  " . EL_GAMES_TABLE;

	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get games data', '', __LINE__, __FILE__, $sql);
	}

	$gamesdata = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
                $gamesdata[$row['game_id']] = $row['game_time'];
	}
	$db->sql_freeresult($result);


	while ( $row = $db->sql_fetchrow($result) )
	{
                $gamesdata[$row['game_id']] = $row['game_time'];
	}
	$db->sql_freeresult($result);


	return $gamesdata;

 }

?>
```


----------



## Parantatatam (28. August 2009)

Es wäre in Zukunft praktisch, wenn du den Code in die UBB-Tags [ PHP ] [ /PHP ] packst und außerdem nur den Teil postest, der interessant ist.


----------



## kuddeldaddeldu (28. August 2009)

Hi,

setze bitte den PHP-Code in die dafür vorgesehenen Tags und mach Einrückungen. In dieser Form wird sich das wohl niemand anschauen wollen...

LG


----------



## kuddeldaddeldu (28. August 2009)

einfach nur crack hat gesagt.:


> Es wäre in Zukunft praktisch, wenn du den Code in die UBB-Tags [ PHP ] [ /PHP ] packst *und außerdem nur den Teil postest, der interessant ist.*



was bei einem "unexpected $end" leider das gesamte Script ist... 

LG


----------



## ZodiacXP (28. August 2009)

Wenn du deinen Code ordentlich formatierst (z.B. http://www.decodephp.com/codecleaner/) dann wirst du sehen das mehrere geschweifte Klammern nicht geschlossen wurden.


----------



## killer (28. August 2009)

Hab den code cleaner benutzt...nun sagt er mir das in Zeile 779 nen fehler ist...aber da ist nur ne klammer und die schließt eine andere Klammer...

Hier nochmal der Code als php^^


```
<?php
	/***************************************************************************
* functions_el.php
* -------------------
* for MOD : Euro League
* version : 1.0
* begin : Sunday, Aug 23, 2009
* copyright : (C) 2009 killer
* email : see HP
* Bearbeitung : wrestlingfire.cwsurf.de
* based on : WM WebTipp (C) AceVentura
*
***************************************************************************/	/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
	
	if ( !defined('IN_PHPBB') ){
		die("Hacking attempt");
	}

	// Get all config data
	function get_el_config() {
		global $db;
		//
		// Get config data
		//
		$sql = "SELECT * FROM " . EL_CONFIG_TABLE;
		
		if(!$result = $db->sql_query($sql)){
			message_die(GENERAL_ERROR, "Could not query config information in el configuration", "", __LINE__, __FILE__, $sql);
		} else{
			while( $row = $db->sql_fetchrow($result) ){
				$config_name = $row['config_name'];
				$config_value = $row['config_value'];
				$new[$config_name] = $config_value;
			}

		}

		$db->sql_freeresult($result);
		return $new;
	}

	// Get el teams data
	function get_el_teams($team_id = 0) {
		global $db;
		//
		// Get teams data
		//
		
		if( $team_id == 0 ){
			$sql = "SELECT *
FROM " . EL_TEAMS_TABLE . "
ORDER BY team_id ASC";
		} else {
			$sql = "SELECT *
FROM " . EL_TEAMS_TABLE . "
WHERE team_id = $team_id";
		}

		
		if( !($result = $db->sql_query($sql)) ){
			message_die(GENERAL_ERROR, 'Could not get teams data', '', __LINE__, __FILE__, $sql);
		}

		$el_teams = array();
		while ( $row = $db->sql_fetchrow($result) ){
			$el_teams[$row['team_id']] = $row;
		}

		$db->sql_freeresult($result);
		return $el_teams;
	}

	// Get el users data
	function get_el_users() {
		global $db;
		//
		// Get users data
		//
		$sql = "SELECT t.*, sum(tipp_points) AS user_points, count(tipp_points) as user_total_tipps
FROM " . EL_TIPPS_TABLE . " t, " . USERS_TABLE . " u
WHERE tipp_user = user_id
GROUP BY tipp_user
ORDER BY user_points DESC, username";
		
		if( !($result = $db->sql_query($sql)) ){
			message_die(GENERAL_ERROR, 'Could not get user tipps data', '', __LINE__, __FILE__, $sql);
		}

		$el_users = array();
		while ( $row = $db->sql_fetchrow($result) ){
			// $el_users[][$row['tipp_user']] = $row;
			$el_users[] = $row;
		}

		$db->sql_freeresult($result);
		return $el_users;
	}

	// Get all users data
	function get_all_the_users() {
		global $db;
		//
		// Get users data
		//
		$sql = "SELECT user_id, username
FROM " . USERS_TABLE;
		
		if( !($result = $db->sql_query($sql)) ){
			message_die(GENERAL_ERROR, 'Could not get users data', '', __LINE__, __FILE__, $sql);
		}

		$users = array();
		while ( $row = $db->sql_fetchrow($result) ){
			$users[$row['user_id']] = $row['username'];
		}

		$db->sql_freeresult($result);
		return $users;
	}

	// Get el teams data order by groups
	function get_el_teamids_by_groups() {
		global $db;
		//
		// Get teams data
		//
		$sql = "SELECT *
FROM " . EL_TEAMS_TABLE . "
ORDER BY team_id ASC";
		
		if( !($result = $db->sql_query($sql)) ){
			message_die(GENERAL_ERROR, 'Could not get teams data', '', __LINE__, __FILE__, $sql);
		}

		$el_teams = array();
		while ( $row = $db->sql_fetchrow($result) ){
			$el_teams[$row['team_group']][] = $row['team_id'];
		}

		$db->sql_freeresult($result);
		return $el_teams;
	}

	// Get el tipps data
	function get_el_tipps($calculate = 0, $user_id = 0) {
		global $db;
		//
		// Get tipps data
		//
		
		if ( $user_id == 0 ) {
			$sql = "SELECT *
FROM " . EL_TIPPS_TABLE . "
ORDER BY tipp_id ASC";
		} else {
			$sql = "SELECT *
FROM " . EL_TIPPS_TABLE . "
WHERE tipp_user = $user_id
ORDER BY tipp_id ASC";
		}

		
		if( !($result = $db->sql_query($sql)) ){
			message_die(GENERAL_ERROR, 'Could not get tipps data', '', __LINE__, __FILE__, $sql);
		}

		$el_tipps = array();
		while ( $row = $db->sql_fetchrow($result) ){
			
			if ( $calculate == 0 ) {
				$el_tipps[$row['tipp_user']][$row['tipp_game']] = $row;
			} else {
				$el_tipps[$row['tipp_game']][] = $row;
			}

		}

		$db->sql_freeresult($result);
		return $el_tipps;
	}

	// Get el games data
	function get_el_games($team_home = 0, $team_away = 0, $by_row = 0) {
		global $db;
		// Get all teams
		$teamsdata = get_el_teams();
		//
		// Get games data
		//
		
		if ( $team_home == 0 ) {
			$sql = "SELECT *
FROM " . EL_GAMES_TABLE . "
WHERE game_id < 97
ORDER BY game_id ASC";
		} else {
			$sql = "SELECT *
FROM " . EL_GAMES_TABLE . "
WHERE (game_home = $team_home AND game_away = $team_away) OR (game_home = $team_away AND game_away = $team_home)";
		}

		
		if( !($result = $db->sql_query($sql)) ){
			message_die(GENERAL_ERROR, 'Could not get games data', '', __LINE__, __FILE__, $sql);
		}

		$gamesdata = array();
		while ( $row = $db->sql_fetchrow($result) ){
			
			if ( $team_home == 0 && $by_row == 0){
				
				if ($row['game_id'] < 13) {
					$group = 'A';
				} else
				if ($row['game_id'] < 25) {
					$group = 'B';
				} else
				if ($row['game_id'] < 37) {
					$group = 'C';
				} else
				if ($row['game_id'] < 49) {
					$group = 'D';
				} else
				if ($row['game_id'] < 61) {
					$group = 'E';
				} else
				if ($row['game_id'] < 73) {
					$group = 'F';
				} else
				if ($row['game_id'] < 85) {
					$group = 'G';
				} else
				if ($row['game_id'] < 97) {
					$group = 'H';
				} else
				if ($row['game_id'] < 109) {
					$group = 'I';
				} else
				if ($row['game_id'] < 121) {
					$group = 'J';
				} else
				if ($row['game_id'] < 133) {
					$group = 'K';
				} else
				if ($row['game_id'] < 145) {
					$group = 'L';
				}

				$row['game_group'] = $group;
				$gamesdata[$row['game_group']][] = $row;
			} else{
				$gamesdata[] = $row;
			}

		}

		$db->sql_freeresult($result);
		ksort($gamesdata);
		return $gamesdata;
	}

	// Get el finals data
	function get_el_finalgames() {
		global $db, $lang;
		// Get all teams
		$resultsdata = get_el_results();
		//
		// Get games data
		//
		$sql = "SELECT *
FROM " . EL_GAMES_TABLE . "
WHERE game_id > 96
ORDER BY game_id ASC";
		
		if( !($result = $db->sql_query($sql)) ){
			message_die(GENERAL_ERROR, 'Could not get finals data', '', __LINE__, __FILE__, $sql);
		}

		$gamesdata = array();
		while ( $row = $db->sql_fetchrow($result) ){
			
			if ( $row['game_id'] < 161 ) {
				$pseudo_group = $lang['l_el_sechzentelfinale'];
				
				if ( $row['game_id'] < 193 ) {
					$pseudo_group = $lang['l_el_achtelfinale'];
				} else
				if ( $row['game_id'] < 201 ) {
					$pseudo_group = $lang['l_el_viertelfinale'];
				} else
				if ( $row['game_id'] < 205 ) {
					$pseudo_group = $lang['l_el_halbfinale'];
				} else {
					$pseudo_group = $lang['l_el_finale'];
				}

				$row['game_group'] = $pseudo_group;
				$gamesdata[$pseudo_group][] = $row;
			}

			$db->sql_freeresult($result);
			return $gamesdata;
		}

		// Get el results data
		function get_el_results($game_id = 0, $by_row = 0) {
			global $db;
			//
			// Get results data
			//
			
			if ( $game_id == 0 ) {
				$sql = "SELECT *
FROM " . EL_RESULTS_TABLE . "
ORDER BY result_game ASC";
			} else {
				$sql = "SELECT *
FROM " . EL_RESULTS_TABLE . "
WHERE result_game = $game_id";
			}

			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not get results data', '', __LINE__, __FILE__, $sql);
			}

			$resultsdata = array();
			while ( $row = $db->sql_fetchrow($result) ){
				
				if ( $game_id == 0 && $by_row == 0) {
					$resultsdata[$row['result_game']] = $row;
				} else {
					$resultsdata[] = $row;
				}

			}

			$db->sql_freeresult($result);
			return $resultsdata;
		}

		// Get teams order by teamname as row
		function get_el_teams_as_row() {
			global $db;
			//
			// Get teams data
			//
			$sql = "SELECT *
FROM " . EL_TEAMS_TABLE . "
ORDER BY team_name";
			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not get teams data', '', __LINE__, __FILE__, $sql);
			}

			$resultsdata = array();
			while ( $row = $db->sql_fetchrow($result) ){
				$resultsdata[] = $row;
			}

			$db->sql_freeresult($result);
			return $resultsdata;
		}

		// Saves a users EL tipp
		function save_el_tipp($user_id, $tipped_winner) {
			global $db, $lang;
			$first_game = get_first_game();
			$first_game_time = $first_game[0]['game_time'];
			$current_time = time();
			
			if ( $current_time < $first_game_time ) {
				//
				// Delete old el tipp
				//
				$sql = "DELETE FROM " . EL_TIPPS_TABLE . " WHERE tipp_user = $user_id AND tipp_game = 126";
				
				if( !($result = $db->sql_query($sql)) ){
					message_die(GENERAL_ERROR, 'Could not delete el tip', '', __LINE__, __FILE__, $sql);
				}

				//
				// Insert el tipp
				//
				
				if ( $tipped_winner != 0 ) {
					$sql = "INSERT INTO " . EL_TIPPS_TABLE . " (tipp_user,tipp_game,tipp_home) VALUES ($user_id,126,$tipped_winner)";
					
					if( !($result = $db->sql_query($sql)) ){
						message_die(GENERAL_ERROR, 'Could not insert el tip', '', __LINE__, __FILE__, $sql);
					}

				}

			}

		}

		// Get first games data
		function get_first_game() {
			global $db;
			//
			// Get games data
			//
			$sql = "SELECT *
FROM " . EL_GAMES_TABLE . "
ORDER BY game_time ASC LIMIT 1";
			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not get games data', '', __LINE__, __FILE__, $sql);
			}

			$resultsdata = array();
			while ( $row = $db->sql_fetchrow($result) ){
				$resultsdata[] = $row;
			}

			$db->sql_freeresult($result);
			return $resultsdata;
		}

		// Clear results table
		function clear_result($game_id) {
			global $db;
			//
			// Clear results data
			//
			$sql = "DELETE FROM " . EL_RESULTS_TABLE . "
WHERE result_game = " . $game_id;
			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not reset result data', '', __LINE__, __FILE__, $sql);
			}

		}

		// Clear tipps table for a user
		function clear_tipps($user_id, $finals = 0) {
			global $db;
			$current_time = time();
			//
			// Clear usertipps data
			//
			
			if ( $finals == 0 ) {
				$sql = "DELETE FROM " . EL_TIPPS_TABLE . "
WHERE tipp_user = $user_id AND tipp_game < 145 AND tipp_time > $current_time";
			} else {
				$sql = "DELETE FROM " . EL_TIPPS_TABLE . "
WHERE tipp_user = $user_id AND tipp_game > 144 AND tipp_game <> 206 AND tipp_time > $current_time";
			}

			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not reset usertipps data', '', __LINE__, __FILE__, $sql);
			}

		}

		// Save el results data
		function save_result($game_id, $home_val, $away_val, $winner = 0, $loser = 0) {
			global $db;
			//
			// Update results data
			//
			
			if ( $winner == 0 ) {
				$sql = "INSERT INTO " . EL_RESULTS_TABLE . " (result_game,result_home,result_away)
VALUES ($game_id,$home_val,$away_val)";
			} else {
				$sql = "INSERT INTO " . EL_RESULTS_TABLE . " (result_game,result_home,result_away,final_winner,final_loser)
VALUES ($game_id,$home_val,$away_val,$winner,$loser)";
			}

			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not update results data', '', __LINE__, __FILE__, $sql);
			}

		}

		// Save teams points and goals
		function save_points($teampoints, $teamgoals, $teamgotgoals) {
			global $db;
			$teams_data = get_el_teams();
			for ( $h = 0; $h < count($teams_data); $h++ ) {
				//
				// Update teams data
				//
				
				if ( isset($teampoints[$teams_data[$h]['team_id']]) ) {
					$sql = "UPDATE " . EL_TEAMS_TABLE . "
SET team_points = " . $teampoints[$teams_data[$h]['team_id']] . ", team_goals = " . $teamgoals[$teams_data[$h]['team_id']] . ", team_gotgoals = " . $teamgotgoals[$teams_data[$h]['team_id']] . "
WHERE team_id = " . $teams_data[$h]['team_id'];
					
					if( !($result = $db->sql_query($sql)) ){
						message_die(GENERAL_ERROR, 'Could not update teams data', '', __LINE__, __FILE__, $sql);
					}

				}

			}

		}

		// Save user tipps data
		function save_tipp($game_id, $user_id, $home_val, $away_val, $tipp_time) {
			global $db;
			//
			// Update tipps data
			//
			$sql = "INSERT INTO " . EL_TIPPS_TABLE . " (tipp_game,tipp_time,tipp_user,tipp_home,tipp_away)
VALUES ($game_id,$tipp_time,$user_id,$home_val,$away_val)";
			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not update tipps data', '', __LINE__, __FILE__, $sql);
			}

		}

		// Sorts a grouparray for the standings
		function sort_standings($teams, $teams_data, $results_data, $games_data) {
			$sorted_teams = array();
			for ( $z = 0; $z < count($teams); $z++ ) {
				$sorted_teams = insert_team($sorted_teams, $teams[$z], $teams_data, $games_data, $results_data);
			}

			return $sorted_teams;
		}

		// Inserts a team (needed for sort_standings())
		function insert_team($standings_array, $team_id, $teams_data, $games_data, $results_data) {
			$new_standings_array = array();
			for ( $k = 0; $k < count($standings_array); $k++ ) {
				$team_id_old = $standings_array[$k];
				$team_id_new = $team_id;
				$team_data_old = $teams_data[$team_id_old];
				$team_data_new = $teams_data[$team_id_new];
				$team_points_old = $team_data_old['team_points'];
				$team_points_new = $team_data_new['team_points'];
				
				if ( $team_points_old < $team_points_new ) {
					$team_id = $team_id_old;
					$standings_array[$k] = $team_id_new;
				} else
				if ( $team_points_old == $team_points_new ) {
					$new_standings_array = find_winner_on_deuce($team_id_new, $team_id_old, $games_data, $results_data, $teams_data);
					$team_id = $new_standings_array[1];
					$standings_array[$k] = $new_standings_array[0];
				}

			}

			$standings_array[] = $team_id;
			return $standings_array;
		}

		// Filters games array
		function get_el_spec_game($team_home, $team_away, $games_data) {
			for ( $t = 0; $t < 97; $t++ ) {
				
				if ( ($games_data[$t]['game_home'] == $team_home && $games_data[$t]['game_away'] == $team_away) || ($games_data[$t]['game_home'] == $team_away && $games_data[$t]['game_away'] == $team_home) ) {
					return $games_data[$t];
				}

			}

			return array();
		}

		// Sorts a grouparray for the standings
		function find_winner_on_deuce($team_id_new, $team_id_old, $games_data, $results_data, $teams_data) {
			$game_data = get_el_spec_game($team_id_new, $team_id_old, $games_data);
			$game_results = $results_data[$game_data['game_id']];
			$team_in_order = array();
			
			if ( $game_results['result_home'] > $game_results['result_away'] ) {
				$team_in_order[] = $game_data['game_home'];
				$team_in_order[] = $game_data['game_away'];
			} else
			if ( $game_results['result_home'] < $game_results['result_away'] ) {
				$team_in_order[] = $game_data['game_away'];
				$team_in_order[] = $game_data['game_home'];
			} else {
				$teamdata_home = $teams_data[$game_data['game_home']];
				$teamdata_away = $teams_data[$game_data['game_away']];
				
				if ( ($teamdata_home['team_goals']-$teamdata_home['team_gotgoals']) > ($teamdata_away['team_goals']-$teamdata_away['team_gotgoals']) ) {
					$team_in_order[] = $game_data['game_home'];
					$team_in_order[] = $game_data['game_away'];
				} else
				if ( ($teamdata_home['team_goals']-$teamdata_home['team_gotgoals']) < ($teamdata_away['team_goals']-$teamdata_away['team_gotgoals']) ) {
					$team_in_order[] = $game_data['game_away'];
					$team_in_order[] = $game_data['game_home'];
				} else {
					
					if ( $teamdata_home['team_goals'] > $teamdata_away['team_goals'] ) {
						$team_in_order[] = $game_data['game_home'];
						$team_in_order[] = $game_data['game_away'];
					} else
					if ( $teamdata_home['team_goals'] < $teamdata_away['team_goals'] ) {
						$team_in_order[] = $game_data['game_away'];
						$team_in_order[] = $game_data['game_home'];
					} else {
						// When this code is reached, the UEFA has to define winners by a random selection. I just use defaults in here.
						// Correct gorup winners in ACP.
						$team_in_order[] = $team_id_old;
						$team_in_order[] = $team_id_new;
					}

				}

			}

			return $team_in_order;
		}

		// Get el auth status
		function get_el_auth() {
			global $db, $el_config, $userdata;
			$access_group = $el_config['restrict_to'];
			$sql = "SELECT g.group_id FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
WHERE g.group_id = ug.group_id
AND ug.user_id = " . $userdata['user_id'] . "
AND ug.user_pending <> " . TRUE . "
AND g.group_single_user <> " . TRUE . "
AND g.group_id = $access_group";
			
			if ( !$result = $db->sql_query($sql) ){
				message_die(GENERAL_ERROR, 'Could not get el auth data', '', __LINE__, __FILE__, $sql);
			}

			$check_el_auth = $db->sql_numrows($result);
			$db->sql_freeresult($result);
			
			if ( $check_el_auth != 0 ){
				return TRUE;
			}

			return FALSE;
		}

		// Calculate user points
		function calculate_user_points($user_id = 0) {
			global $db, $el_config;
			// Reset all tippoints
			
			if ( $user_id == 0 ) {
				$sql = "UPDATE " . EL_TIPPS_TABLE . " SET tipp_points = 0";
			} else {
				$sql = "UPDATE " . EL_TIPPS_TABLE . " SET tipp_points = 0 WHERE tipp_user = $user_id";
			}

			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not update tipps data', '', __LINE__, __FILE__, $sql);
			}

			$el_results = get_el_results(0,1);
			$el_tipps = get_el_tipps(1, $user_id);
			for ( $i = 0; $i < count($el_results); $i++ ) {
				$current_game_id = $el_results[$i]['result_game'];
				$result_home = $el_results[$i]['result_home'];
				$result_away = $el_results[$i]['result_away'];
				for ( $u = 0; $u < count($el_tipps[$current_game_id]); $u++ ) {
					$tipp_home = $el_tipps[$current_game_id][$u]['tipp_home'];
					$tipp_away = $el_tipps[$current_game_id][$u]['tipp_away'];
					$tipp_points = $el_tipps[$current_game_id][$u]['tipp_points'];
					$tipp_new_points = 0;
					
					if ( $current_game_id != 126 ) {
						
						if ( $tipp_home == $result_home && $tipp_away == $result_away ) {
							$tipp_new_points = $el_config['points_match'];
						} else
						if ( $tipp_home - $tipp_away == $result_home - $result_away ) {
							$tipp_new_points = $el_config['points_tordiff'];
						} else
						if ( ($tipp_home > $tipp_away && $result_home > $result_away) || ($tipp_home < $tipp_away && $result_home < $result_away) ) {
							$tipp_new_points = $el_config['points_tendency'];
						}

					} else {
						
						if ( $tipp_home == $result_home ) {
							$tipp_new_points = $el_config['points_winner'];
						}

					}

					
					if ( $tipp_new_points != $tipp_points ) {
						$sql = "UPDATE " . EL_TIPPS_TABLE . "
SET tipp_points = $tipp_new_points
WHERE tipp_id = " . $el_tipps[$current_game_id][$u]['tipp_id'];
						
						if( !($result = $db->sql_query($sql)) ){
							message_die(GENERAL_ERROR, 'Could not update tipps data', '', __LINE__, __FILE__, $sql);
						}

					}

				}

ZEILE 797    }

		}

		// get users el winner tipp
		function get_el_winner($user_id){
			global $db;
			$sql = "SELECT * FROM " . EL_TIPPS_TABLE . " WHERE tipp_game = 206 AND tipp_user = " . $user_id;
			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not get tipps data', '', __LINE__, __FILE__, $sql);
			}

			$winnerdata = 0;
			while ( $row = $db->sql_fetchrow($result) ){
				$winnerdata = $row['tipp_home'];
			}

			$db->sql_freeresult($result);
			return $winnerdata;
		}

		
		function get_el_champion_tipps(){
			global $db;
			$sql = "SELECT * FROM " . EL_TIPPS_TABLE . " WHERE tipp_game = 126";
			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not get tipps data', '', __LINE__, __FILE__, $sql);
			}

			$championsdata = array();
			while ( $row = $db->sql_fetchrow($result) ){
				$championsdata[$row['tipp_user']] = $row['tipp_home'];
			}

			$db->sql_freeresult($result);
			return $championsdata;
		}

		// Get el gametimes by id
		function get_el_gametimes() {
			global $db;
			//
			// Get games data
			//
			$sql = "SELECT game_id, game_time
FROM " . EL_GAMES_TABLE;
			
			if( !($result = $db->sql_query($sql)) ){
				message_die(GENERAL_ERROR, 'Could not get games data', '', __LINE__, __FILE__, $sql);
			}

			$gamesdata = array();
			while ( $row = $db->sql_fetchrow($result) ){
				$gamesdata[$row['game_id']] = $row['game_time'];
			}

			$db->sql_freeresult($result);
			while ( $row = $db->sql_fetchrow($result) ){
				$gamesdata[$row['game_id']] = $row['game_time'];
			}

			$db->sql_freeresult($result);
			return $gamesdata;
		}

		?>
```


----------



## Parantatatam (28. August 2009)

Bei so großen Codeschnipseln ist vielleicht [ highlight="PHP" ] [ /highlight ] besser als die PHP-Tags, denn ich denke mal, dass nicht jeder jetzt darauf Lust hat sich Zeile 779 zu suchen.


----------



## Flex (28. August 2009)

```
<?php
    /***************************************************************************
* functions_el.php
* -------------------
* for MOD : Euro League
* version : 1.0
* begin : Sunday, Aug 23, 2009
* copyright : (C) 2009 killer
* email : see HP
* Bearbeitung : wrestlingfire.cwsurf.de
* based on : WM WebTipp (C) AceVentura
*
***************************************************************************/    /***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
    
    if ( !defined('IN_PHPBB') ){
        die("Hacking attempt");
    }

    // Get all config data
    function get_el_config() {
        global $db;
        //
        // Get config data
        //
        $sql = "SELECT * FROM " . EL_CONFIG_TABLE;
        
        if(!$result = $db->sql_query($sql)){
            message_die(GENERAL_ERROR, "Could not query config information in el configuration", "", __LINE__, __FILE__, $sql);
        } else{
            while( $row = $db->sql_fetchrow($result) ){
                $config_name = $row['config_name'];
                $config_value = $row['config_value'];
                $new[$config_name] = $config_value;
            }

        }

        $db->sql_freeresult($result);
        return $new;
    }

    // Get el teams data
    function get_el_teams($team_id = 0) {
        global $db;
        //
        // Get teams data
        //
        
        if( $team_id == 0 ){
            $sql = "SELECT *
FROM " . EL_TEAMS_TABLE . "
ORDER BY team_id ASC";
        } else {
            $sql = "SELECT *
FROM " . EL_TEAMS_TABLE . "
WHERE team_id = $team_id";
        }

        
        if( !($result = $db->sql_query($sql)) ){
            message_die(GENERAL_ERROR, 'Could not get teams data', '', __LINE__, __FILE__, $sql);
        }

        $el_teams = array();
        while ( $row = $db->sql_fetchrow($result) ){
            $el_teams[$row['team_id']] = $row;
        }

        $db->sql_freeresult($result);
        return $el_teams;
    }

    // Get el users data
    function get_el_users() {
        global $db;
        //
        // Get users data
        //
        $sql = "SELECT t.*, sum(tipp_points) AS user_points, count(tipp_points) as user_total_tipps
FROM " . EL_TIPPS_TABLE . " t, " . USERS_TABLE . " u
WHERE tipp_user = user_id
GROUP BY tipp_user
ORDER BY user_points DESC, username";
        
        if( !($result = $db->sql_query($sql)) ){
            message_die(GENERAL_ERROR, 'Could not get user tipps data', '', __LINE__, __FILE__, $sql);
        }

        $el_users = array();
        while ( $row = $db->sql_fetchrow($result) ){
            // $el_users[][$row['tipp_user']] = $row;
            $el_users[] = $row;
        }

        $db->sql_freeresult($result);
        return $el_users;
    }

    // Get all users data
    function get_all_the_users() {
        global $db;
        //
        // Get users data
        //
        $sql = "SELECT user_id, username
FROM " . USERS_TABLE;
        
        if( !($result = $db->sql_query($sql)) ){
            message_die(GENERAL_ERROR, 'Could not get users data', '', __LINE__, __FILE__, $sql);
        }

        $users = array();
        while ( $row = $db->sql_fetchrow($result) ){
            $users[$row['user_id']] = $row['username'];
        }

        $db->sql_freeresult($result);
        return $users;
    }

    // Get el teams data order by groups
    function get_el_teamids_by_groups() {
        global $db;
        //
        // Get teams data
        //
        $sql = "SELECT *
FROM " . EL_TEAMS_TABLE . "
ORDER BY team_id ASC";
        
        if( !($result = $db->sql_query($sql)) ){
            message_die(GENERAL_ERROR, 'Could not get teams data', '', __LINE__, __FILE__, $sql);
        }

        $el_teams = array();
        while ( $row = $db->sql_fetchrow($result) ){
            $el_teams[$row['team_group']][] = $row['team_id'];
        }

        $db->sql_freeresult($result);
        return $el_teams;
    }

    // Get el tipps data
    function get_el_tipps($calculate = 0, $user_id = 0) {
        global $db;
        //
        // Get tipps data
        //
        
        if ( $user_id == 0 ) {
            $sql = "SELECT *
FROM " . EL_TIPPS_TABLE . "
ORDER BY tipp_id ASC";
        } else {
            $sql = "SELECT *
FROM " . EL_TIPPS_TABLE . "
WHERE tipp_user = $user_id
ORDER BY tipp_id ASC";
        }

        
        if( !($result = $db->sql_query($sql)) ){
            message_die(GENERAL_ERROR, 'Could not get tipps data', '', __LINE__, __FILE__, $sql);
        }

        $el_tipps = array();
        while ( $row = $db->sql_fetchrow($result) ){
            
            if ( $calculate == 0 ) {
                $el_tipps[$row['tipp_user']][$row['tipp_game']] = $row;
            } else {
                $el_tipps[$row['tipp_game']][] = $row;
            }

        }

        $db->sql_freeresult($result);
        return $el_tipps;
    }

    // Get el games data
    function get_el_games($team_home = 0, $team_away = 0, $by_row = 0) {
        global $db;
        // Get all teams
        $teamsdata = get_el_teams();
        //
        // Get games data
        //
        
        if ( $team_home == 0 ) {
            $sql = "SELECT *
FROM " . EL_GAMES_TABLE . "
WHERE game_id < 97
ORDER BY game_id ASC";
        } else {
            $sql = "SELECT *
FROM " . EL_GAMES_TABLE . "
WHERE (game_home = $team_home AND game_away = $team_away) OR (game_home = $team_away AND game_away = $team_home)";
        }

        
        if( !($result = $db->sql_query($sql)) ){
            message_die(GENERAL_ERROR, 'Could not get games data', '', __LINE__, __FILE__, $sql);
        }

        $gamesdata = array();
        while ( $row = $db->sql_fetchrow($result) ){
            
            if ( $team_home == 0 && $by_row == 0){
                
                if ($row['game_id'] < 13) {
                    $group = 'A';
                } else
                if ($row['game_id'] < 25) {
                    $group = 'B';
                } else
                if ($row['game_id'] < 37) {
                    $group = 'C';
                } else
                if ($row['game_id'] < 49) {
                    $group = 'D';
                } else
                if ($row['game_id'] < 61) {
                    $group = 'E';
                } else
                if ($row['game_id'] < 73) {
                    $group = 'F';
                } else
                if ($row['game_id'] < 85) {
                    $group = 'G';
                } else
                if ($row['game_id'] < 97) {
                    $group = 'H';
                } else
                if ($row['game_id'] < 109) {
                    $group = 'I';
                } else
                if ($row['game_id'] < 121) {
                    $group = 'J';
                } else
                if ($row['game_id'] < 133) {
                    $group = 'K';
                } else
                if ($row['game_id'] < 145) {
                    $group = 'L';
                }

                $row['game_group'] = $group;
                $gamesdata[$row['game_group']][] = $row;
            } else{
                $gamesdata[] = $row;
            }

        }

        $db->sql_freeresult($result);
        ksort($gamesdata);
        return $gamesdata;
    }

    // Get el finals data
    function get_el_finalgames() {
        global $db, $lang;
        // Get all teams
        $resultsdata = get_el_results();
        //
        // Get games data
        //
        $sql = "SELECT *
FROM " . EL_GAMES_TABLE . "
WHERE game_id > 96
ORDER BY game_id ASC";
        
        if( !($result = $db->sql_query($sql)) ){
            message_die(GENERAL_ERROR, 'Could not get finals data', '', __LINE__, __FILE__, $sql);
        }

        $gamesdata = array();
        while ( $row = $db->sql_fetchrow($result) ){
            
            if ( $row['game_id'] < 161 ) {
                $pseudo_group = $lang['l_el_sechzentelfinale'];
                
                if ( $row['game_id'] < 193 ) {
                    $pseudo_group = $lang['l_el_achtelfinale'];
                } else
                if ( $row['game_id'] < 201 ) {
                    $pseudo_group = $lang['l_el_viertelfinale'];
                } else
                if ( $row['game_id'] < 205 ) {
                    $pseudo_group = $lang['l_el_halbfinale'];
                } else {
                    $pseudo_group = $lang['l_el_finale'];
                }

                $row['game_group'] = $pseudo_group;
                $gamesdata[$pseudo_group][] = $row;
            }

            $db->sql_freeresult($result);
            return $gamesdata;
        }

        // Get el results data
        function get_el_results($game_id = 0, $by_row = 0) {
            global $db;
            //
            // Get results data
            //
            
            if ( $game_id == 0 ) {
                $sql = "SELECT *
FROM " . EL_RESULTS_TABLE . "
ORDER BY result_game ASC";
            } else {
                $sql = "SELECT *
FROM " . EL_RESULTS_TABLE . "
WHERE result_game = $game_id";
            }

            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not get results data', '', __LINE__, __FILE__, $sql);
            }

            $resultsdata = array();
            while ( $row = $db->sql_fetchrow($result) ){
                
                if ( $game_id == 0 && $by_row == 0) {
                    $resultsdata[$row['result_game']] = $row;
                } else {
                    $resultsdata[] = $row;
                }

            }

            $db->sql_freeresult($result);
            return $resultsdata;
        }

        // Get teams order by teamname as row
        function get_el_teams_as_row() {
            global $db;
            //
            // Get teams data
            //
            $sql = "SELECT *
FROM " . EL_TEAMS_TABLE . "
ORDER BY team_name";
            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not get teams data', '', __LINE__, __FILE__, $sql);
            }

            $resultsdata = array();
            while ( $row = $db->sql_fetchrow($result) ){
                $resultsdata[] = $row;
            }

            $db->sql_freeresult($result);
            return $resultsdata;
        }

        // Saves a users EL tipp
        function save_el_tipp($user_id, $tipped_winner) {
            global $db, $lang;
            $first_game = get_first_game();
            $first_game_time = $first_game[0]['game_time'];
            $current_time = time();
            
            if ( $current_time < $first_game_time ) {
                //
                // Delete old el tipp
                //
                $sql = "DELETE FROM " . EL_TIPPS_TABLE . " WHERE tipp_user = $user_id AND tipp_game = 126";
                
                if( !($result = $db->sql_query($sql)) ){
                    message_die(GENERAL_ERROR, 'Could not delete el tip', '', __LINE__, __FILE__, $sql);
                }

                //
                // Insert el tipp
                //
                
                if ( $tipped_winner != 0 ) {
                    $sql = "INSERT INTO " . EL_TIPPS_TABLE . " (tipp_user,tipp_game,tipp_home) VALUES ($user_id,126,$tipped_winner)";
                    
                    if( !($result = $db->sql_query($sql)) ){
                        message_die(GENERAL_ERROR, 'Could not insert el tip', '', __LINE__, __FILE__, $sql);
                    }

                }

            }

        }

        // Get first games data
        function get_first_game() {
            global $db;
            //
            // Get games data
            //
            $sql = "SELECT *
FROM " . EL_GAMES_TABLE . "
ORDER BY game_time ASC LIMIT 1";
            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not get games data', '', __LINE__, __FILE__, $sql);
            }

            $resultsdata = array();
            while ( $row = $db->sql_fetchrow($result) ){
                $resultsdata[] = $row;
            }

            $db->sql_freeresult($result);
            return $resultsdata;
        }

        // Clear results table
        function clear_result($game_id) {
            global $db;
            //
            // Clear results data
            //
            $sql = "DELETE FROM " . EL_RESULTS_TABLE . "
WHERE result_game = " . $game_id;
            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not reset result data', '', __LINE__, __FILE__, $sql);
            }

        }

        // Clear tipps table for a user
        function clear_tipps($user_id, $finals = 0) {
            global $db;
            $current_time = time();
            //
            // Clear usertipps data
            //
            
            if ( $finals == 0 ) {
                $sql = "DELETE FROM " . EL_TIPPS_TABLE . "
WHERE tipp_user = $user_id AND tipp_game < 145 AND tipp_time > $current_time";
            } else {
                $sql = "DELETE FROM " . EL_TIPPS_TABLE . "
WHERE tipp_user = $user_id AND tipp_game > 144 AND tipp_game <> 206 AND tipp_time > $current_time";
            }

            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not reset usertipps data', '', __LINE__, __FILE__, $sql);
            }

        }

        // Save el results data
        function save_result($game_id, $home_val, $away_val, $winner = 0, $loser = 0) {
            global $db;
            //
            // Update results data
            //
            
            if ( $winner == 0 ) {
                $sql = "INSERT INTO " . EL_RESULTS_TABLE . " (result_game,result_home,result_away)
VALUES ($game_id,$home_val,$away_val)";
            } else {
                $sql = "INSERT INTO " . EL_RESULTS_TABLE . " (result_game,result_home,result_away,final_winner,final_loser)
VALUES ($game_id,$home_val,$away_val,$winner,$loser)";
            }

            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not update results data', '', __LINE__, __FILE__, $sql);
            }

        }

        // Save teams points and goals
        function save_points($teampoints, $teamgoals, $teamgotgoals) {
            global $db;
            $teams_data = get_el_teams();
            for ( $h = 0; $h < count($teams_data); $h++ ) {
                //
                // Update teams data
                //
                
                if ( isset($teampoints[$teams_data[$h]['team_id']]) ) {
                    $sql = "UPDATE " . EL_TEAMS_TABLE . "
SET team_points = " . $teampoints[$teams_data[$h]['team_id']] . ", team_goals = " . $teamgoals[$teams_data[$h]['team_id']] . ", team_gotgoals = " . $teamgotgoals[$teams_data[$h]['team_id']] . "
WHERE team_id = " . $teams_data[$h]['team_id'];
                    
                    if( !($result = $db->sql_query($sql)) ){
                        message_die(GENERAL_ERROR, 'Could not update teams data', '', __LINE__, __FILE__, $sql);
                    }

                }

            }

        }

        // Save user tipps data
        function save_tipp($game_id, $user_id, $home_val, $away_val, $tipp_time) {
            global $db;
            //
            // Update tipps data
            //
            $sql = "INSERT INTO " . EL_TIPPS_TABLE . " (tipp_game,tipp_time,tipp_user,tipp_home,tipp_away)
VALUES ($game_id,$tipp_time,$user_id,$home_val,$away_val)";
            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not update tipps data', '', __LINE__, __FILE__, $sql);
            }

        }

        // Sorts a grouparray for the standings
        function sort_standings($teams, $teams_data, $results_data, $games_data) {
            $sorted_teams = array();
            for ( $z = 0; $z < count($teams); $z++ ) {
                $sorted_teams = insert_team($sorted_teams, $teams[$z], $teams_data, $games_data, $results_data);
            }

            return $sorted_teams;
        }

        // Inserts a team (needed for sort_standings())
        function insert_team($standings_array, $team_id, $teams_data, $games_data, $results_data) {
            $new_standings_array = array();
            for ( $k = 0; $k < count($standings_array); $k++ ) {
                $team_id_old = $standings_array[$k];
                $team_id_new = $team_id;
                $team_data_old = $teams_data[$team_id_old];
                $team_data_new = $teams_data[$team_id_new];
                $team_points_old = $team_data_old['team_points'];
                $team_points_new = $team_data_new['team_points'];
                
                if ( $team_points_old < $team_points_new ) {
                    $team_id = $team_id_old;
                    $standings_array[$k] = $team_id_new;
                } else
                if ( $team_points_old == $team_points_new ) {
                    $new_standings_array = find_winner_on_deuce($team_id_new, $team_id_old, $games_data, $results_data, $teams_data);
                    $team_id = $new_standings_array[1];
                    $standings_array[$k] = $new_standings_array[0];
                }

            }

            $standings_array[] = $team_id;
            return $standings_array;
        }

        // Filters games array
        function get_el_spec_game($team_home, $team_away, $games_data) {
            for ( $t = 0; $t < 97; $t++ ) {
                
                if ( ($games_data[$t]['game_home'] == $team_home && $games_data[$t]['game_away'] == $team_away) || ($games_data[$t]['game_home'] == $team_away && $games_data[$t]['game_away'] == $team_home) ) {
                    return $games_data[$t];
                }

            }

            return array();
        }

        // Sorts a grouparray for the standings
        function find_winner_on_deuce($team_id_new, $team_id_old, $games_data, $results_data, $teams_data) {
            $game_data = get_el_spec_game($team_id_new, $team_id_old, $games_data);
            $game_results = $results_data[$game_data['game_id']];
            $team_in_order = array();
            
            if ( $game_results['result_home'] > $game_results['result_away'] ) {
                $team_in_order[] = $game_data['game_home'];
                $team_in_order[] = $game_data['game_away'];
            } else
            if ( $game_results['result_home'] < $game_results['result_away'] ) {
                $team_in_order[] = $game_data['game_away'];
                $team_in_order[] = $game_data['game_home'];
            } else {
                $teamdata_home = $teams_data[$game_data['game_home']];
                $teamdata_away = $teams_data[$game_data['game_away']];
                
                if ( ($teamdata_home['team_goals']-$teamdata_home['team_gotgoals']) > ($teamdata_away['team_goals']-$teamdata_away['team_gotgoals']) ) {
                    $team_in_order[] = $game_data['game_home'];
                    $team_in_order[] = $game_data['game_away'];
                } else
                if ( ($teamdata_home['team_goals']-$teamdata_home['team_gotgoals']) < ($teamdata_away['team_goals']-$teamdata_away['team_gotgoals']) ) {
                    $team_in_order[] = $game_data['game_away'];
                    $team_in_order[] = $game_data['game_home'];
                } else {
                    
                    if ( $teamdata_home['team_goals'] > $teamdata_away['team_goals'] ) {
                        $team_in_order[] = $game_data['game_home'];
                        $team_in_order[] = $game_data['game_away'];
                    } else
                    if ( $teamdata_home['team_goals'] < $teamdata_away['team_goals'] ) {
                        $team_in_order[] = $game_data['game_away'];
                        $team_in_order[] = $game_data['game_home'];
                    } else {
                        // When this code is reached, the UEFA has to define winners by a random selection. I just use defaults in here.
                        // Correct gorup winners in ACP.
                        $team_in_order[] = $team_id_old;
                        $team_in_order[] = $team_id_new;
                    }

                }

            }

            return $team_in_order;
        }

        // Get el auth status
        function get_el_auth() {
            global $db, $el_config, $userdata;
            $access_group = $el_config['restrict_to'];
            $sql = "SELECT g.group_id FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
WHERE g.group_id = ug.group_id
AND ug.user_id = " . $userdata['user_id'] . "
AND ug.user_pending <> " . TRUE . "
AND g.group_single_user <> " . TRUE . "
AND g.group_id = $access_group";
            
            if ( !$result = $db->sql_query($sql) ){
                message_die(GENERAL_ERROR, 'Could not get el auth data', '', __LINE__, __FILE__, $sql);
            }

            $check_el_auth = $db->sql_numrows($result);
            $db->sql_freeresult($result);
            
            if ( $check_el_auth != 0 ){
                return TRUE;
            }

            return FALSE;
        }

        // Calculate user points
        function calculate_user_points($user_id = 0) {
            global $db, $el_config;
            // Reset all tippoints
            
            if ( $user_id == 0 ) {
                $sql = "UPDATE " . EL_TIPPS_TABLE . " SET tipp_points = 0";
            } else {
                $sql = "UPDATE " . EL_TIPPS_TABLE . " SET tipp_points = 0 WHERE tipp_user = $user_id";
            }

            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not update tipps data', '', __LINE__, __FILE__, $sql);
            }

            $el_results = get_el_results(0,1);
            $el_tipps = get_el_tipps(1, $user_id);
            for ( $i = 0; $i < count($el_results); $i++ ) {
                $current_game_id = $el_results[$i]['result_game'];
                $result_home = $el_results[$i]['result_home'];
                $result_away = $el_results[$i]['result_away'];
                for ( $u = 0; $u < count($el_tipps[$current_game_id]); $u++ ) {
                    $tipp_home = $el_tipps[$current_game_id][$u]['tipp_home'];
                    $tipp_away = $el_tipps[$current_game_id][$u]['tipp_away'];
                    $tipp_points = $el_tipps[$current_game_id][$u]['tipp_points'];
                    $tipp_new_points = 0;
                    
                    if ( $current_game_id != 126 ) {
                        
                        if ( $tipp_home == $result_home && $tipp_away == $result_away ) {
                            $tipp_new_points = $el_config['points_match'];
                        } else
                        if ( $tipp_home - $tipp_away == $result_home - $result_away ) {
                            $tipp_new_points = $el_config['points_tordiff'];
                        } else
                        if ( ($tipp_home > $tipp_away && $result_home > $result_away) || ($tipp_home < $tipp_away && $result_home < $result_away) ) {
                            $tipp_new_points = $el_config['points_tendency'];
                        }

                    } else {
                        
                        if ( $tipp_home == $result_home ) {
                            $tipp_new_points = $el_config['points_winner'];
                        }

                    }

                    
                    if ( $tipp_new_points != $tipp_points ) {
                        $sql = "UPDATE " . EL_TIPPS_TABLE . "
SET tipp_points = $tipp_new_points
WHERE tipp_id = " . $el_tipps[$current_game_id][$u]['tipp_id'];
                        
                        if( !($result = $db->sql_query($sql)) ){
                            message_die(GENERAL_ERROR, 'Could not update tipps data', '', __LINE__, __FILE__, $sql);
                        }

                    }

                }
		}
    }

        }

        // get users el winner tipp
        function get_el_winner($user_id){
            global $db;
            $sql = "SELECT * FROM " . EL_TIPPS_TABLE . " WHERE tipp_game = 206 AND tipp_user = " . $user_id;
            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not get tipps data', '', __LINE__, __FILE__, $sql);
            }

            $winnerdata = 0;
            while ( $row = $db->sql_fetchrow($result) ){
                $winnerdata = $row['tipp_home'];
            }

            $db->sql_freeresult($result);
            return $winnerdata;
        }

        
        function get_el_champion_tipps(){
            global $db;
            $sql = "SELECT * FROM " . EL_TIPPS_TABLE . " WHERE tipp_game = 126";
            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not get tipps data', '', __LINE__, __FILE__, $sql);
            }

            $championsdata = array();
            while ( $row = $db->sql_fetchrow($result) ){
                $championsdata[$row['tipp_user']] = $row['tipp_home'];
            }

            $db->sql_freeresult($result);
            return $championsdata;
        }

        // Get el gametimes by id
        function get_el_gametimes() {
            global $db;
            //
            // Get games data
            //
            $sql = "SELECT game_id, game_time
FROM " . EL_GAMES_TABLE;
            
            if( !($result = $db->sql_query($sql)) ){
                message_die(GENERAL_ERROR, 'Could not get games data', '', __LINE__, __FILE__, $sql);
            }

            $gamesdata = array();
            while ( $row = $db->sql_fetchrow($result) ){
                $gamesdata[$row['game_id']] = $row['game_time'];
            }

            $db->sql_freeresult($result);
            while ( $row = $db->sql_fetchrow($result) ){
                $gamesdata[$row['game_id']] = $row['game_time'];
            }

            $db->sql_freeresult($result);
            return $gamesdata;
        }

        ?>
```

Die Funktion calculate_user_points() besaß eine geschweifte Klammer zu wenig.


----------



## killer (28. August 2009)

Super...jetzt klappt es...dankeschön


----------



## ZodiacXP (28. August 2009)

ZodiacXP hat gesagt.:


> Wenn du deinen Code ordentlich formatierst (z.B. http://www.decodephp.com/codecleaner/) [...]





killer hat gesagt.:


> Hab den code cleaner benutzt [...]





ZodiacXP hat gesagt.:


> dann wirst du sehen das mehrere geschweifte Klammern nicht geschlossen wurden.





killer hat gesagt.:


> aber da ist nur ne klammer und die schließt eine andere Klammer...



Und täglich schüttelt man hier wieder mit dem Kopf. Jedes mal ein Stückchen mehr. Hätt' ich eine Propellermütze könnt ich fliegen.


----------



## pg_dezign (27. Februar 2010)

*Hallo Ihr Lieben* 

Ersteinmal ein grosses Lob an dieses Forum Es hat mir schon bei vielen Problemen weitergeholfen. Da ich hier neu im Forum bin, möchte ich mich ersteinmal vorstellen: Ich bin 24 Jahre alt und beschäftige mich in meiner Freizeit viel mit Grafik-und Webdesign. Zur Zeit arbeite ich an einen kleinen Onlineshop und möchte in diesen auch ein Gästebuch einbauen. Und da ist auch schon das Problem: Ich bekomme beim Aufruf eine Fehlermeldung:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\xampp\gaestebuch\gaestebuch.php on line 117   
ist die letzte Zeile und ich blicke da einfach nicht mehr durch


```
<?php
    error_reporting(E_ALL);

    // Wenn das Formular abgeschickt wurde
    if(isset($_POST['submit']) AND $_POST['submit'] == 'Eintragen'){
         if(fehler){
             // Abbruch
         }
         else {
             // Eintrag speichern
         }
    }
    // Wenn die Seite 'per Link' aufgerufen wird
    else {
         $sql = "DELETE FROM
                           Gaestebuch_IP
                 WHERE
                           Datum < DATE_SUB(NOW(), INTERVAL 1 MINUTE)
                ";
         mysql_query($sql) OR die ("<pre>\n".$sql."</pre>\n".mysql_error());

         $sql = "SELECT
                           IP
                  FROM
                           Gaestebuch_IP
                  WHERE
                           IP = '".$_SERVER['REMOTE_ADDR']."'
                  LIMIT
                           1
                 ";
         $result = mysql_query($sql) OR die ("<pre>\n".$sql."</pre>\n".mysql_error());

         if(mysql_num_rows($result)) {
                  echo "<p class=\"content\">\n".
                       "Sie haben gerade einen Eintrag hinterlassen. Bitte haben Sie eine Minute Geduld.\n".
                       "</p>\n";
         }
         else {
             // Formular zum Eintragen zeigen
         }
         // bisherige Einträge anzeigen
    }
?>

//Speichern in der Datenbank

<?php
    $sql = "SELECT
                   Email,
                   Homepage,
                   Name,
                   Datum,
                   Nachricht,
                   Editierung
            FROM
                   Gaestebuch
            ORDER BY
                   Datum DESC
           ";
    $result = mysql_query($sql) OR die ("<pre>\n".$sql."</pre>\n".mysql_error());
    while($row = mysql_fetch_assoc($result)) {
        echo "<table>\n";
        echo " <tr>\n";
        echo "  <td>\n";
        echo "   <table>\n";
        echo "    <tr>\n";
        echo "     <td>\n";
        if (trim($row['Email'])== "")
            echo "&nbsp;";
        else
            echo "&raquo;&nbsp;<a href=\"mailto:".htmlentities($row['Email'], ENT_QUOTES)."\">Email</a>";
        echo "     </td>\n";
        echo "    </tr>\n";
        echo "    <tr>\n";
        echo "     <td>\n";
        if (trim($row['Homepage'])== "")
            echo "&nbsp;";
        else {
            if (strtolower(substr($row['Homepage'], 0, 7)) =='http://')
                echo "&raquo;&nbsp;<a href=\"".htmlentities($row['Homepage'], ENT_QUOTES)."\" target=\"_blank\">Homepage</a>";
            else
                echo "&raquo;&nbsp;<a href=\"http://".htmlentities($row['Homepage'], ENT_QUOTES)."\" target=\"_blank\">Homepage</a>";
        }
        echo "     </td>\n";
        echo "    </tr>\n";
        echo "   </table>\n";
        echo "  </td>\n";
        echo "  <td>\n";
        echo "   <table>\n";
        echo "    <tr>\n";
        echo "     <td>\n";
        echo htmlentities($row['Name'], ENT_QUOTES);
        echo "     </td>\n";
        echo "    </tr>\n";
        echo "    <tr>\n";
        echo "     <td>\n";
        echo date('d.m.Y H:i \U\h\r', strtotime($row['Datum']))."\n";
        echo "     </td>\n";
        echo "    </tr>\n";
        echo "   </table>\n";
        echo "  </td>\n";
        echo " </tr>\n";
        echo " <tr>\n";
        echo "  <td>\n";
        echo nl2br(htmlentities($row['Nachricht'], ENT_QUOTES))."\n";
        if($row['Editierung']){
            echo "<br>\n<br>\n";
            echo "<span style=\"font-size:10px\">".nl2br(htmlentities($row['Editierung']))."</span>\n";
        }
        echo "  </td>\n";
        echo " </tr>\n";
        echo "</table>\n";
?>
```

Ich hoffe ihr könnt mir helfen

Vielen Dank schonmal im Voraus


----------



## Kai008 (27. Februar 2010)

Die While wird nicht geschlossen.


----------



## Sven Mintel (27. Februar 2010)

Moin,

und willkommen  an Board 

was der Fehler ist, hat Kai ja schon gesagt:


```
while($row = mysql_fetch_assoc($result)) {
```

...der markierten Klammer fehlt das schliessende Pendant....ganz am Ende direkt vor dem schliessenden PHP-Tag wäre ein guter Platz.

Gute Editoren können dir bei solcher Fehlersuche helfen, bspw. über Funktionen wie Hervorheben von Klammerpaaren(geschwisterlose Klammern werden dort gesondert markiert)

http://www.pspad.com/de/ wäre bspw. ein solcher Editor....der noch vieles mehr draufhat


----------



## pg_dezign (27. Februar 2010)

Hy,

Ganz grossen Dank für eure Hilfe, es funktioniert    

LG


----------



## ProCoder2025 (29. Oktober 2010)

Hallo, ich habe mir mal gedacht ich lasse den Thread nochmal aufblühen, auch ich habe, wie glaube fast alle Fragestellenden, über Google hier her gefunden. Google-Optimierung kann sich also sehen lassen ^^. Ich habe auch den Fehler *Parse error: syntax error, unexpected $end in...* Ich glaube es wird nur ein ganz sinnloser Fehler sein, aber ich finde ihn einfach nicht. Habe schon verschiedene Hilfsmittel, die hier angeboten wurden, ausprobiert, doch ohne Erfolg.
Vllt. könnt ihr einen PHP-Anfänger helfen ;-)

Der Fehler liegt in der letzten Zeile.


```
<?php
	session_start();
	
	if(isset($_SESSION["login"])) {
		include("db.php");
		include("einstellung_function.php");
		refresh($_SESSION["login"]);
		$geburtstag = $_POST["tag"];
		$geburtstag .= ".";
		$geburtstag .= $_POST["monat"];
		$geburtstag .= ".";
		$geburtstag .= $_POST["jahr"];
		$email = $_REQUEST["email"];
		$vorname = $_REQUEST["name"];
		$nachname = $_REQUEST["nachname"];
		$wohnort = $_REQUEST["wohnort"];
		$bundesland = $_REQUEST["bundesland"];
		$flirtname = $_REQUEST["flirtname"];
		$id = $_SESSION["login"];
		
		if(isset($_REQUEST["submit"])) {
			$update = mysql_query("UPDATE benutzerdaten Set email ='".mysql_escape_string($email)."', vorname ='".mysql_escape_string($vorname)."', nachname ='".mysql_escape_string($nachname)."', wohnort ='".mysql_escape_string($wohnort)."', geburtstag ='".mysql_escape_string($geburtstag)."', bundesland ='".mysql_escape_string($bundesland)."', flirtname ='".mysql_escape_string($flirtname)."' WHERE id = '".mysql_escape_string($id)."'");
			
			if(!empty($_REQUEST["passwort1"]) && $_REQUEST["passwort1"] == $_REQUEST["passwort2"]) {
				$update = mysql_query("UPDATE benutzerdaten Set passwort = '".mysql_escape_string .md5($_REQUEST["passwort1"])."' WHERE id = '".$_SESSION["login"]."'");
				$abfrage = "SELECT email, vorname, name, wohnort, geburtstag, bundesland, land, flirtname, geschlecht, FROM benutzerdaten WHERE id = '".$_SESSION["login"]."' LIMIT 0,1";
				$ergebnis = mysql_query($abfrage);
				while($row = mysql_fetch_object($ergebnis)){
					?>
```

Viele Grüße wünscht ProCoder2025


----------



## Parantatatam (29. Oktober 2010)

Der Fehler dürfte hier liegen:

```
$update = mysql_query("UPDATE benutzerdaten Set passwort = '".mysql_escape_string .md5($_REQUEST["passwort1"])."' WHERE id = '".$_SESSION["login"]."'");
```
Das sollte vermutlich so aussehen:

```
$update = mysql_query("UPDATE benutzerdaten Set passwort = '".mysql_escape_string(md5($_REQUEST["passwort1"]))."' WHERE id = '".$_SESSION["login"]."'");
```
Außerdem solltest du *$_REQUEST* gegen *$_POST* oder *$_GET* tauschen und von *mysql_escape_string()* auf *mysql_real_escape_string()* wechseln. Sicherheit sollte auch bei dir groß geschrieben werden.


----------



## ProCoder2025 (29. Oktober 2010)

Vielen dank für die schnelle Antwort. Gut zu wissen, das ich noch paar große Sicherheitslücken drin hatte, besten dank. Habe den Code jetzt nochmal umgeschrieben aber der Fehler ist immer noch da. Wieder letzte Zeile.
Ich finde ihn einfach nicht. Tomaten auf den Augen ^^.


```
<?php
session_start();
	if(isset($_SESSION["login"])) { 
		include("db.php");
		include("einstellung_function.php");
		refresh($_SESSION["login"]); 
		
$geburtstag = $_POST["tag"];
$geburtstag .= ".";
$geburtstag .= $_POST["monat"];
$geburtstag .= ".";
$geburtstag .= $_POST["jahr"];
$email = $_POST["email"];
$vorname = $_POST["name"];
$nachname = $_POST["nachname"];
$wohnort = $_POST["wohnort"];
$bundesland = $_POST["bundesland"];
$flirtname = $_POST["flirtname"];
$id = $_SESSION["login"];


		if(isset($_POST["submit"])) {
			$update = mysql_query("UPDATE benutzerdaten Set email ='".mysql_real_escape_string($email)."', vorname ='".mysql_real_escape_string($vorname)."', nachname ='".mysql_real_escape_string($nachname)."', wohnort ='".mysql_real_escape_string($wohnort)."', geburtstag ='".mysql_real_escape_string($geburtstag)."', bundesland ='".mysql_real_escape_string($bundesland)."', flirtname ='".mysql_real_escape_string($flirtname)."' WHERE id = '".mysql_real_escape_string($id)."'");

if(!empty($_POST["passwort1"]) && $_POST["passwort1"] == $_POST["passwort2"]) { 
				$update = mysql_query("UPDATE benutzerdaten Set passwort = '".mysql_real_escape_string(md5($_POST["passwort1"]))."' WHERE id = '".$_SESSION["login"]."'");

		$abfrage = "SELECT email, vorname, name, wohnort, geburtstag, bundesland, land, flirtname, geschlecht, FROM benutzerdaten WHERE id = '".$_SESSION["login"]."' LIMIT 0,1";
		$ergebnis = mysql_query($abfrage);
		while($row = mysql_fetch_object($ergebnis))
		{ 
	
	?>
```

Viele Grüße aus dem schönen Dresden


----------



## guest4711 (29. Oktober 2010)

Es ist recht simpel, du hast da 4x 
	
	
	



```
{
```
, aber 0x  
	
	
	



```
}
```

geöffnete Klammern müssen vor dem Ende des Skriptes wieder geschlossen werden. Du tust das nicht, deswegen kommt ein "unerwartetes Ende des Skriptes"


----------



## ren_hoeck (24. Juni 2011)

Hallo PHP Cracks, 
dieses Jahr bin ich derjenige, der über Google auf diesen threat gestoßen ist. Auch ich bekomme vom Browser folgende Fehlermeldung und hoffe auf eure Hilfe:

Parse error: syntax error, unexpected $end in /homepages/37/d277832359/htdocs/../index.php on line 66

also Fehler in der letzten Zeile von folgendem Code:

<?php  get_header(); ?>
<?php
	$wp_query->query_vars["cat"] = ‘?;
	$wp_query->query_vars["showposts"] = 0;
	$wp_query->get_posts();

	if (have_posts()) :
	?>
<div class="art-content-layout">
    <div class="art-content-layout-row">
<?php  include (TEMPLATEPATH . '/sidebar1.php'); ?><div class="art-layout-cell art-content">
<?php  if (have_posts()) : ?>
<?php 
	while (have_posts()) :
	the_post();
	?>
<div class="art-post">
    <div class="art-post-body">
<div class="art-post-inner art-article">
<h2 class="art-postheader">
<a href="<?php  the_permalink()  ?>" rel="bookmark" title="<?php  printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
<?php  the_title(); ?>
</a>
</h2>
<div class="art-postcontent">
    <!-- article-content -->
          <?php  if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry &raquo;', 'kubrick')); ?>
          <?php  if (is_page() or is_single()) wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    <!-- /article-content -->
</div>
<div class="cleared"></div>
</div>
		<div class="cleared"></div>
    </div>
</div>
<?php  endwhile; ?>
<?php
 $prev_link = get_previous_posts_link(__('Newer Entries &raquo;', 'kubrick'));$next_link = get_next_posts_link(__('&laquo; Older Entries', 'kubrick')); ?>
<?php  if ($prev_link || $next_link): ?>
<div class="art-post">
    <div class="art-post-body">
<div class="art-post-inner art-article">
<div class="art-postcontent">
    <!-- article-content -->
<div class="navigation">
	<div class="alignleft"><?php  echo $next_link; ?></div>
	<div class="alignright"><?php  echo $prev_link; ?></div>
</div>
    <!-- /article-content -->
</div>
<div class="cleared"></div>
</div>
		<div class="cleared"></div>
    </div>
</div>
<?php  endif; ?>
<?php  else : ?>
<h2 class="center"><?php  _e('Not Found', 'kubrick'); ?></h2>
<p class="center"><?php  _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?></p>
<?php  if(function_exists('get_search_form')) get_search_form(); ?>
<?php  endif; ?>
</div>
    </div>
</div>
<div class="cleared"></div>
<?php  get_footer(); ?>


Eigentlich hat WordPress diese Datei erstellt. Könnt ihr den Fehler finden? Die Klammern hab ich alle schon überprüft..


----------



## saftmeister (24. Juni 2011)

Das ist ja Leichenschändung, die hier betrieben wird. Kann den Thread nicht mal jemand locken?

Um deine Frage zu beantworten: Da fehlt ein "endif;". Da ich den Code so schlecht einordnen kann, was da eigentlich getrieben wird, würde ich vorschlagen, du löschst mal die markierte Zeile raus (die ist nämlich doppelt):


```
<?php get_header(); ?>
<?php
$wp_query->query_vars["cat"] = '';
$wp_query->query_vars["showposts"] = 0;
$wp_query->get_posts();

// if (have_posts()) : // Lösch mich******
?>
```

Das nächste mal bitte nen neuen Thread auf machen. Bist du dir im Klaren darüber, das hier x-tausend Leute jetzt eine Benachrichtigungsmail bekommen haben, dass es eine neue Antwort in dem Thread gibt?


----------



## ren_hoeck (24. Juni 2011)

Also für mich ist du ein Held! Ich seh da nur Hieroglyphen. Besten Dank! Das war tatsächlich der Fehler.

Bei allen anderen benachrichtigten entschuldige ich mich vielmals für die Belästigung! Kommt nicht wieder vor wenn der threat geschlossen wird. Den Haken bei "erledigt" kann man hier getrost setzen.

Vielen Dank nochmals für die prompte Antwort. Es war mir eine Freude


----------

