[BETA] phpBB3 Football MOD Version 0.9.3

In diesem Forum können Mod-Autoren ihre Mods vorstellen, die sich noch im Entwicklungsstatus befinden. Der Einbau in Foren im produktiven Betrieb wird nicht empfohlen.
Forumsregeln
phpBB 3.0 hat das Ende seiner Lebenszeit überschritten
phpBB 3.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 3.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf die neuste phpBB-Version, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Benutzeravatar
football
Mitglied
Beiträge: 862
Registriert: 03.05.2009 10:37
Kontaktdaten:

Re: [BETA] phpBB3 Football MOD Version 0.9.3

Beitrag von football »

Bei Hacki1971 lag es vermutlich an einer Einstellung in Suhosin (Schutzengel):
suhosin.post.max_value_length 65000 65000

Die 1. Bundesliga wird beim Einfügen per Post serialisiert in der Länge 226000 Bytes übergeben, daher blockt Suhosin dies.

Nachdem Suhosin ausgeschaltet wurde, klappt das Update.
Kein Support per PN oder E-Mail. Support-Anfragen beantworte ich nur über diese Community.
Benutzeravatar
Draketornado
Mitglied
Beiträge: 21
Registriert: 19.10.2010 17:34

Re: [BETA] phpBB3 Football MOD Version 0.9.3

Beitrag von Draketornado »

Hallo Leute

Ich habe ein sehr merkwürdiges Problem. Installiert war bei mir die Football Mod 0.9.1, da lief auch alles immer einwandfrei.
Jetzt habe ich nach und nach die Update.xml durchgearbeitet bis ich die 0.9.3 komplett inklusiver beider Fixes drauf hatte.
Alles scheint einwandfrei zu klappen, bis auf die Tatsache, dass erstellte Teams für eine Liga nicht mehr in der Liste auftauchen.

Die von meiner letzten Saison sind noch da gelistet, ich kann sogar Änderungen an den Teams machen (z.B. anderes Wappen) was auch abgespeichert wird. Allerdings, wenn ich aus der Liste ein Team lösche, dann ein anderes hinzufüge, ist auch dieses nicht sichtbar! Es wurde abgespeichert, man kann es auch im Tipspiel selbst sehen, doch wieder sieht man in der Liste im ACP unter Temas verwalten, dieses neue Team nicht (ja, ich wähle auch die richtige Saison aus)

Sogar neu erstellte Teamsp für eine neue Saison / neue Liga, werden ganz normal in der Datenbank abgespeichert, doch wie gesagt, kann man sie im Adminmenu unter Teams Verwalten nicht sehen, da diese Liste leer ist. Versucht man nun dieser Liga nochmal das gleiche Team hinzuzufügen, gibts auch die Fehlermeldung, dass das Team bereits in der Liste ist.

Wie soll ich denn die Wappen ändern können, wenn ich nicht mal die Mannschaften sehe?

Hoffe es kann mir jemand hier helfen!

Ach ja....sogar ein komplettes deinstallieren des Mods, und Neuinstallation auf 0.9.3 führt zum exact gleichen Ergebnis!

Gruss


Draketornado
Trexis5
Mitglied
Beiträge: 69
Registriert: 15.12.2010 11:43
Kontaktdaten:

Re: [BETA] phpBB3 Football MOD Version 0.9.3

Beitrag von Trexis5 »

Hi,
hat das vielleicht mit den anderen Team ID's zu tun?
Benutzeravatar
Draketornado
Mitglied
Beiträge: 21
Registriert: 19.10.2010 17:34

Re: [BETA] phpBB3 Football MOD Version 0.9.3

Beitrag von Draketornado »

Also ich habe jetzt mal folgendes getestet:

Die Datei includes/acp/acp_football_teams.php ersetzt durch die gleiche Datei der Version 0.9.1
Jetzt kann ich komischerweise die Teams wieder in der Liste sehen.

Die beiden Dateien haben nicht wirklich grosse Differenzen, kann es sein dass dort vielleicht noch ein kleiner Fehler drinnen ist?

Die aktuellste Version dieser Datei die ich benutzte war diese:

Version 0.9.3

Code: Alles auswählen

<?php
/**
* 
* @package acp
* @version $Id: acp_football_teams.php 14 2011-03-15 18:03:24Z football $ 
* @copyright (c) 2010 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* @package acp
*/
class acp_football_teams
{
	var $u_action;

	function main($id, $mode)
	{
		global $config, $db, $user, $auth, $template, $cache;
		global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;

		$this->tpl_name = 'acp_football_teams';
		$this->page_title = 'ACP_FOOTBALL_TEAMS_MANAGE';

		$form_key = 'acp_football_teams';
		add_form_key($form_key);

		include($phpbb_root_path . 'football/includes/functions.' . $phpEx);
		include($phpbb_root_path . 'includes/functions_user.' . $phpEx);

		// Check and set some common vars
		$action		= (isset($_POST['add'])) ? 'add' : request_var('action', '');
		$edit		= request_var('edit', 0);
		$season		= request_var('s', 0);
		$league		= request_var('l', 0);
		$team		= request_var('t', 0);
		$update		= (isset($_POST['update'])) ? true : false;
		if ($action == 'add' AND $team > 0 AND !$edit)
		{
			$action = 'add_old';
		}
		if ($action == 'add' AND $team == 0 AND !$edit)
		{
			$team = nextfree_teamid();
		}
		// Clear some vars
		$team_row = array();
		$error = array();

		// Grab current season
		if (!$season)
		{
			$season = curr_season();
		}

		// Grab basic data for select season
		if ($season)
		{
			$sql = 'SELECT *
				FROM ' . FOOTB_SEASONS . '
				ORDER BY season DESC';
			$result = $db->sql_query($sql);

			$season_options = '';
			while ($row = $db->sql_fetchrow($result))
			{
				$selected = ($season && $row['season'] == $season) ? ' selected="selected"' : '';
				$season_options .= '<option value="' . $row['season'] . '"' . $selected . '>' . $row['season_name_short'] . '</option>';
				if ($selected <> '')
				{
					$season_name = $row['season_name_short'];
				}
			}
			$db->sql_freeresult($result);
		}
		else
		{
			trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
		}

		// Grab current league
		if (!$league)
		{
			$league = first_league($season, false);
		}

		// Grab basic data for select league
		if ($league)
		{
			$sql = 'SELECT *
				FROM ' . FOOTB_LEAGUES . "
				WHERE season = $season
				ORDER BY league ASC";
			$result = $db->sql_query($sql);

			$league_options = '';
			while ($row = $db->sql_fetchrow($result))
			{
				$selected = ($league && $row['league'] == $league) ? ' selected="selected"' : '';
				$league_options .= '<option value="' . $row['league'] . '"' . $selected . '>' . $row['league_name'] . '</option>';
				if ($selected <> '')
				{
					$league_matchdays 	= $row['matchdays'];
					$league_name 		= $row['league_name'];
					$league_type 		= $row['league_type'];
					$ko_league 			= ($row['league_type'] == LEAGUE_KO) ? true : false;
				}
			}
			$db->sql_freeresult($result);
		}
		else
		{
			trigger_error(sprintf($user->lang['NO_LEAGUE'], $season) . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING);
		}

		// Grab all teams for selection
		$sql = 'SELECT 
				DISTINCT team_id, 
				team_name
			FROM ' . FOOTB_TEAMS . '
			ORDER BY team_name ASC';
		$result = $db->sql_query($sql);
		$team_options = '<option value="0" selected="selected">' . sprintf($user->lang['NEW_TEAM']) . '</option>';
		while ($row = $db->sql_fetchrow($result))
		{
			$selected = '';
			$team_options .= '<option value="' . $row['team_id'] . '"' . $selected . '>' . $row['team_name'] . '</option>';
		}
		$db->sql_freeresult($result);

		// Grab basic data for team, if team is set and exists
		if ($team)
		{
			$sql = 'SELECT *
				FROM ' . FOOTB_TEAMS . "
				WHERE season = $season 
					AND league = $league 
					AND team_id = $team";
			$result = $db->sql_query($sql);
			$team_row = $db->sql_fetchrow($result);
			$db->sql_freeresult($result);
		}
		if ($action == 'add' or $action == 'edit' )
		{
			// Grab all Teamsymbol for selection
			$teamsymbol_options = '<option value="blank.gif">blank.gif</option>';
			$folder = $phpbb_root_path . 'football/images/flags/';
			$directory  = opendir($folder);
			while($file = readdir($directory))    
			{
				if (substr_count($file ,".gif") == 1) 
				{
					$selected = (strtoupper($file) == strtoupper($team_row['team_symbol'])) ? ' selected="selected"' : '';
					$teamsymbol_options .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>';
				}
			}
			closedir($directory);		
		}
		
		// Which page?
		switch ($action)
		{
			case 'delete':
				if (!$season)
				{
					trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
				}

				if (!$league)
				{
					trigger_error($user->lang['NO_LEAGUE'] . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING);
				}

				if (!$team)
				{
					trigger_error($user->lang['NO_TEAM'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
				}

				if (confirm_box(true))
				{
					$error = '';

					if (!$auth->acl_get('a_football_delete'))
					{
						trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
					}
					if ($user->data['user_type'] != USER_FOUNDER && $config['football_founder_delete'])
					{
						trigger_error($user->lang['TEAMS_NO_DELETE'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
					}

					// Delete team
					$sql = 'DELETE FROM ' . FOOTB_TEAMS . "
							WHERE season = $season AND league = $league AND team_id = $team";
					$db->sql_query($sql);

					// Delete bets
					$sql = 'DELETE FROM ' . FOOTB_BETS . "
							WHERE  season = $season 
								AND league = $league 
								AND match_no IN 
								(SELECT 
									DISTINCT match_no 
								FROM " . FOOTB_MATCHES . "
								WHERE season = $season 
									AND league = $league 
									AND (team_id_home = $team OR team_id_home = $team))";
					$db->sql_query($sql);

					// Delete matches
					$sql = 'DELETE FROM ' . FOOTB_MATCHES . "
							WHERE season = $season AND league = $league AND (team_id_home = $team OR team_id_home = $team)";
					$db->sql_query($sql);

					trigger_error($user->lang['TEAM_DELETED'] . adm_back_link($this->u_action . "&s=$season&l=$league"));
				}
				else
				{
					confirm_box(false, sprintf($user->lang['TEAM_CONFIRM_DELETE'], $team_row['team_name'], $season, $league), build_hidden_fields(array(
						's'			=> $season,
						'l'			=> $league,
						't'			=> $team,
						'mode'		=> $mode,
						'action'	=> $action))
					);
				}
			break;

			case 'add_old':
				if (!check_form_key($form_key))
				{
					trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
				}
				
				$sql = 'SELECT *
					FROM ' . FOOTB_TEAMS . "
					WHERE team_id = $team";
				$result = $db->sql_query($sql);
				$oldteam_row = $db->sql_fetchrow($result);
				$db->sql_freeresult($result);

				$matchday_options = '';
				if ($ko_league)
				{
					// Grab all matchdays for selection
					$sql = 'SELECT 
							DISTINCT matchday, 
							matchday_name
						FROM ' . FOOTB_MATCHDAYS . "
						WHERE season = $season 
							AND league = $league 
						ORDER BY  matchday ASC";
					$result = $db->sql_query($sql);
					$matchdays = 0;
					while ($row = $db->sql_fetchrow($result))
					{
						$selected = ($row['matchday'] == 1) ? ' selected="selected"' : '';
						$day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']);
						$matchday_options .= '<option value="' . $row['matchday'] . '"' . $selected . '>' . $day_name . '</option>';
						$matchdays++;
					}
					$db->sql_freeresult($result);
					if (!$matchdays)
					{
						trigger_error($user->lang['NO_MATCHDAYS'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
					}
				}

				// Grab all teamsymbol for selection
				$teamsymbol_options = '<option value="blank.gif">blank.gif</option>';
				$folder = $phpbb_root_path . 'football/images/flags/';
				$directory  = opendir($folder);
				while($file = readdir($directory))    
				{
					if (substr_count($file ,".gif") == 1) 
					{
						$selected = (strtoupper($file) == strtoupper($oldteam_row['team_symbol'])) ? ' selected="selected"' : '';
						$teamsymbol_options .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>';
					}
				}
				closedir($directory);		
				
				$u_back = $this->u_action . "&s=$season&l=$league";

				$template->assign_vars(array(
					'S_EDIT'				=> true,
					'S_ADD_TEAM'			=> true,
					'S_ERROR'				=> false,
					'S_KO_LEAGUE'			=> $ko_league,
					'ERROR_MSG'				=> (sizeof($error)) ? implode('<br />', $error) : '',
					'SEASON'				=> $season,
					'SEASON_NAME'			=> $season_name,
					'LEAGUE'				=> $league,
					'LEAGUE_NAME'			=> $league_name,
					'TEAM'					=> $team,
					'TEAM_NAME'				=> $oldteam_row['team_name'],
					'TEAM_SHORT'			=> $oldteam_row['team_name_short'],
					'TEAM_SYMBOL'			=> $oldteam_row['team_symbol'],
					'TEAM_SYMBOL_OPTIONS'	=> $teamsymbol_options,
					'TEAM_IMAGE'			=> ($oldteam_row['team_symbol']) ? $phpbb_root_path . 'football/images/flags/' . $oldteam_row['team_symbol'] : $phpbb_root_path . 'football/images/flags/blank.gif',
					'TEAM_GROUP'			=> '',
					'TEAM_MATCHDAY_OPTIONS'	=> $matchday_options,
					'PHPBB_ROOT_PATH'		=> $phpbb_root_path,
					'U_BACK'				=> $u_back,
					'U_ACTION'				=> "{$this->u_action}&action=add&s=$season&l=$league",
					)
				);
				return;
			break;
			case 'add':
				if ($team > 0 AND $team <= 65535)
				{
					if ($team_row)
					{
						if ($edit)
						{
							$error[] =  $user->lang['TEAM_TAKEN'];
						}
						else
						{
							trigger_error($user->lang['TEAM_TAKEN'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
						}
					}
					$team_row['team_name'] 			= utf8_normalize_nfc(request_var('team_name', '', true));
					$team_row['team_name_short'] 	= utf8_normalize_nfc(request_var('team_short', '', true));
					$team_row['team_symbol'] 		= utf8_normalize_nfc(request_var('team_symbol', '', true));
					$team_row['group_id'] 			= utf8_normalize_nfc(request_var('team_group', '', true));
					$team_row['matchday'] 			= utf8_normalize_nfc(request_var('team_round', '', true));
				}
				else 
				{
					trigger_error($user->lang['TEAM_NUMBER'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
				}
				// No break for edit the new  team
			case 'edit':

				$data = array();

				if (!sizeof($error))
				{
					if ($action == 'edit' && !$team)
					{
						trigger_error($user->lang['NO_TEAM'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
					}

					// Did we submit?
					if ($update)
					{
						if (!check_form_key($form_key))
						{
							trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
						}
						
						$team_row['team_name'] 			= utf8_normalize_nfc(request_var('team_name', '', true));
						$team_row['team_name_short'] 	= utf8_normalize_nfc(request_var('team_short', '', true));
						$team_row['team_symbol'] 		= utf8_normalize_nfc(request_var('team_symbol', '', true));
						$team_row['group_id'] 			= utf8_normalize_nfc(request_var('team_group', '', true));
						$team_row['matchday'] 			= utf8_normalize_nfc(request_var('team_round', '', true));

						// Check teamname
						if (strlen($team_row['team_name']) > 2)
						{
							// Check double entry for team 
							$sql = 'SELECT 
									DISTINCT team_id
								FROM ' . FOOTB_TEAMS . "
								WHERE team_name = '" . $team_row['team_name'] . "'";
							$result = $db->sql_query($sql);
							$name_rows = $db->sql_fetchrowset($result);
							$db->sql_freeresult($result);
							if (sizeof($name_rows) > 1)
							{
								$error[] =  $user->lang['TEAM_NAME_DOUBLE'];
							}
							elseif (sizeof($name_rows) == 1)
							{
								if ($name_rows[0]['team_id'] <> $team)
								{
									$error[] =  $user->lang['TEAM_NAME_DOUBLE'];
								}
							}
						}
						
						// Check teamname short
						if (strlen($team_row['team_name_short']) > 1)
						{
							// Check double entry for team 
							$sql = 'SELECT 
									DISTINCT team_id
								FROM ' . FOOTB_TEAMS . "
								WHERE team_name_short = '" . $team_row['team_name_short'] . "'";
							$result = $db->sql_query($sql);
							$short_rows = $db->sql_fetchrowset($result);
							$db->sql_freeresult($result);
							if (sizeof($short_rows) > 1)
							{
								$error[] =  $user->lang['TEAM_SHORT_DOUBLE'];
							}
							elseif (sizeof($short_rows) == 1)
							{
								if ($short_rows[0]['team_id'] <> $team)
								{
									$error[] =  $user->lang['TEAM_SHORT_DOUBLE'];
								}
							}
						}
						
						if (!sizeof($error))
						{
							$sql_ary = array(
								'season'			=> (int) $season,
								'league'			=> (int) $league,
								'team_id'			=> (int) $team,
								'team_name'			=> $team_row['team_name'],
								'team_name_short'	=> $team_row['team_name_short'],
								'team_symbol'		=> strlen($team_row['team_symbol']) ? $team_row['team_symbol'] : 'blank.gif',
								'group_id'			=> strlen($team_row['group_id']) ? $team_row['group_id'] : '',
								'matchday'			=> strlen($team_row['matchday']) ? $team_row['matchday'] : 0,
							);

							if ($ko_league)
							{
								$data['team_group']	= $team_row['group_id'];
							}
							else
							{
								$data['team_group']	= '';
							}
							$data['team']	= $team;
							$data['team_name']	= $team_row['team_name'];
							$data['team_short']	= $team_row['team_name_short'];

							$var_ary = array(
								'team'		=> array('num', false, 1, 9999),
								'team_name'	=> array('string', false, 3, 30),
								'team_short'	=> array('string', false, 1, 10),
								'team_group'	=> array(
									array('string', true, 1, 1),
									array('match', true, '#^[A-Z]#')),
							);
							if (!($error_vals = validate_data($data, $var_ary)))
							{
								if ($action == 'add')
								{
									$sql = 'INSERT INTO ' . FOOTB_TEAMS . ' ' . $db->sql_build_array('INSERT', $sql_ary);
									$db->sql_query($sql);
								}
								else
								{
									$sql = 'UPDATE ' . FOOTB_TEAMS . '
										SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
										WHERE season = $season AND league = $league AND team_id = $team";
									$db->sql_query($sql);
								}
								$message = ($action == 'edit') ? 'TEAM_UPDATED' : 'TEAM_CREATED';
								trigger_error($user->lang[$message] . adm_back_link($this->u_action . "&s=$season&l=$league"));
							}
							else
							{
								foreach ($error_vals as $error_val)
								{
										$error_msg[] = $user->lang[$error_val];
								}
								$message = ($action == 'edit') ? 'TEAM_UPDATE_FAILED' : 'TEAM_CREATE_FAILED';
								$error[] =  $user->lang[$message];
								$error = array_merge($error, $error_msg);
							}
						}
					}
				}

				$matchday_options = '';
				if ($ko_league)
				{
					// Grab all matchdays for selection
					$sql = 'SELECT 
							DISTINCT matchday, 
							matchday_name
						FROM ' . FOOTB_MATCHDAYS . "
						WHERE season = $season 
							AND league = $league 
						ORDER BY  matchday ASC";
					$result = $db->sql_query($sql);
					$matchdays = 0;
					while ($row = $db->sql_fetchrow($result))
					{
						$selected = ($team_row['matchday'] && $row['matchday'] == $team_row['matchday']) ? ' selected="selected"' : '';
						$matchday_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']);
						$matchday_options .= '<option value="' . $row['matchday'] . '"' . $selected . '>' . $matchday_name . '</option>';
						$matchdays++;
					}
					$db->sql_freeresult($result);
					if (!$matchdays)
					{
						trigger_error($user->lang['NO_MATCHDAYS'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
					}
				}

				$u_back = $this->u_action . "&s=$season&l=$league";

				$template->assign_vars(array(
					'S_EDIT'				=> true,
					'S_ADD_TEAM'			=> ($action == 'add') ? true : false,
					'S_ERROR'				=> (sizeof($error)) ? true : false,
					'S_KO_LEAGUE'			=> $ko_league,
					'ERROR_MSG'				=> (sizeof($error)) ? implode('<br />', $error) : '',
					'SEASON'				=> $season,
					'SEASON_NAME'			=> $season_name,
					'LEAGUE'				=> $league,
					'LEAGUE_NAME'			=> $league_name,
					'TEAM'					=> $team,
					'TEAM_NAME'				=> $team_row['team_name'],
					'TEAM_SHORT'			=> $team_row['team_name_short'],
					'TEAM_SYMBOL'			=> $team_row['team_symbol'],
					'TEAM_SYMBOL_OPTIONS'	=> $teamsymbol_options,
					'TEAM_IMAGE'			=> ($team_row['team_symbol']) ? $phpbb_root_path . 'football/images/flags/' . $team_row['team_symbol'] : $phpbb_root_path . 'football/images/flags/blank.gif',
					'TEAM_GROUP'			=> $team_row['group_id'],
					'TEAM_ROUND'			=> $team_row['matchday'],
					'TEAM_MATCHDAY_OPTIONS'	=> $matchday_options,
					'PHPBB_ROOT_PATH'		=> $phpbb_root_path,
					'U_BACK'				=> $u_back,
					'U_ACTION'				=> "{$this->u_action}&action=$action&s=$season&l=$league",
					)
				);

				return;
			break;
		}
		$u_footb_parm = "s=$season&l=$league&";

		$template->assign_vars(array(
			'U_ACTION'			=> $this->u_action,
			'U_FOOTBALL' 		=> append_sid($phpbb_root_path . "football.$phpEx", $u_footb_parm . 'side=bets'),
			'S_SEASON'			=> $season,
			'S_LEAGUE'			=> $league,
			'S_KO_LEAGUE'		=> $ko_league,
			'S_SEASON_OPTIONS'	=> $season_options,
			'S_LEAGUE_OPTIONS'	=> $league_options,
			'S_TEAM_OPTIONS'	=> $team_options,
			'S_TEAM_ADD'		=> true,
			) 
		);
		
		// Get us all the teams
		$sql = 'SELECT t.*,
				SUM(IF(m.team_id_home = t.team_id, 1 , 0)) AS matches_home,
				SUM(IF(m.team_id_guest = t.team_id, 1 , 0)) AS matches_away
			FROM ' . FOOTB_TEAMS . ' AS t 
			JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = $season AND m.league = $league AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) 
			WHERE t.season = $season 
				AND t.league = $league
			GROUP BY t.team_id
			ORDER BY team_id ASC";
		$result = $db->sql_query($sql);
		$rows_teams = $db->sql_fetchrowset($result);
		$db->sql_freeresult($result);

		// Check if the user is allowed to delete a team.
		if ($user->data['user_type'] != USER_FOUNDER && $config['football_founder_delete'])
		{
			$allow_delete = false;
		}
		else
		{
			$allow_delete = true;
		}

		$row_number = 0;
		$matches = 0;
		foreach ($rows_teams as $row_team)
		{
			$row_number++;
			$row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
			$matches += ($row_team['matches_home'] + $row_team['matches_away']) / 2;
			$template->assign_block_vars('teams', array(
				'ROW_CLASS'		=> $row_class,
				'TEAM'			=> $row_team['team_id'],
				'TEAM_IMAGE'	=> ($row_team['team_symbol']) ? $phpbb_root_path . 'football/images/flags/' . $row_team['team_symbol'] : $phpbb_root_path . 'football/images/flags/blank.gif',
				'TEAM_NAME'		=> $row_team['team_name'],
				'TEAM_SHORT'	=> $row_team['team_name_short'],
				'TEAM_MATCHES'	=> $row_team['matches_home'] + $row_team['matches_away'],
				'TEAM_HOME'		=> $row_team['matches_home'],
				'TEAM_GROUP'	=> $row_team['group_id'],
				'TEAM_ROUND'	=> $row_team['matchday'],
				'U_EDIT'		=> "{$this->u_action}&action=edit&s=" . $season . "&l=" .$league . "&t=" .$row_team['team_id'],
				'U_DELETE'		=> ($allow_delete) ? "{$this->u_action}&action=delete&s=" . $season . "&l=" . $league . "&t=" . $row_team['team_id'] : '',
				)
			);
		}
		$template->assign_vars(array(
			'S_TEAMS'			=> ($row_number) ? '(' . $row_number . ')' : '',
			'S_MATCHES'			=> ($row_number) ? $matches : '',
			) 
		);
	}
}
?>
Und mit dieser Version funktioniert es bei mir:

Version 0.9.1:

Code: Alles auswählen

<?php
/**
*
* @package acp
* @version $Id: acp_football_teams.php 1 2010-05-17 22:09:43Z football $ 
* @copyright (c) 2010 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* @package acp
*/
class acp_football_teams
{
	var $u_action;

	function main($id, $mode)
	{
		global $config, $db, $user, $auth, $template, $cache;
		global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;

		$this->tpl_name = 'acp_football_teams';
		$this->page_title = 'ACP_FOOTBALL_TEAMS_MANAGE';

		$form_key = 'acp_football_teams';
		add_form_key($form_key);

		include($phpbb_root_path . 'football/includes/functions.' . $phpEx);
		include($phpbb_root_path . 'includes/functions_user.' . $phpEx);

		// Check and set some common vars
		$action		= (isset($_POST['add'])) ? 'add' : request_var('action', '');
		$edit		= request_var('edit', 0);
		$season		= request_var('s', 0);
		$league		= request_var('l', 0);
		$team		= request_var('t', 0);
		$update		= (isset($_POST['update'])) ? true : false;
		if ($action == 'add' AND $team > 0 AND !$edit)
		{
			$action = 'add_old';
		}
		if ($action == 'add' AND $team == 0 AND !$edit)
		{
			$team = nextfree_teamid();
		}
		// Clear some vars
		$team_row = array();
		$error = array();

		// Grab current season
		if (!$season)
		{
			$season = curr_season();
		}

		// Grab basic data for select season
		if ($season)
		{
			$sql = 'SELECT *
				FROM ' . FOOTB_SEASONS . '
				ORDER BY season DESC';
			$result = $db->sql_query($sql);

			$season_options = '';
			while ($row = $db->sql_fetchrow($result))
			{
				$selected = ($season && $row['season'] == $season) ? ' selected="selected"' : '';
				$season_options .= '<option value="' . $row['season'] . '"' . $selected . '>' . $row['season_name_short'] . '</option>';
				if ($selected <> '')
				{
					$season_name = $row['season_name_short'];
				}
			}
			$db->sql_freeresult($result);
		}
		else
		{
			trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
		}

		// Grab current league
		if (!$league)
		{
			$league = first_league($season, false);
		}

		// Grab basic data for select league
		if ($league)
		{
			$sql = 'SELECT *
				FROM ' . FOOTB_LEAGUES . "
				WHERE season = $season
				ORDER BY league ASC";
			$result = $db->sql_query($sql);

			$league_options = '';
			while ($row = $db->sql_fetchrow($result))
			{
				$selected = ($league && $row['league'] == $league) ? ' selected="selected"' : '';
				$league_options .= '<option value="' . $row['league'] . '"' . $selected . '>' . $row['league_name'] . '</option>';
				if ($selected <> '')
				{
					$league_matchdays 	= $row['matchdays'];
					$league_name 		= $row['league_name'];
					$league_type 		= $row['league_type'];
					$ko_league 			= ($row['league_type'] == LEAGUE_KO) ? true : false;
				}
			}
			$db->sql_freeresult($result);
		}
		else
		{
			trigger_error(sprintf($user->lang['NO_LEAGUE'], $season) . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING);
		}

		// Grab all teams for selection
		$sql = 'SELECT 
				DISTINCT team_id, 
				team_name
			FROM ' . FOOTB_TEAMS . '
			ORDER BY team_name ASC';
		$result = $db->sql_query($sql);
		$team_options = '<option value="0" selected="selected">' . sprintf($user->lang['NEW_TEAM']) . '</option>';
		while ($row = $db->sql_fetchrow($result))
		{
			$selected = '';
			$team_options .= '<option value="' . $row['team_id'] . '"' . $selected . '>' . $row['team_name'] . '</option>';
		}
		$db->sql_freeresult($result);

		// Grab basic data for team, if team is set and exists
		if ($team)
		{
			$sql = 'SELECT *
				FROM ' . FOOTB_TEAMS . "
				WHERE season = $season 
					AND league = $league 
					AND team_id = $team";
			$result = $db->sql_query($sql);
			$team_row = $db->sql_fetchrow($result);
			$db->sql_freeresult($result);
		}
		if ($action == 'add' or $action == 'edit' )
		{
			// Grab all Teamsymbol for selection
			$teamsymbol_options = '<option value="blank.gif">blank.gif</option>';
			$folder = $phpbb_root_path . 'football/images/flags/';
			$directory  = opendir($folder);
			while($file = readdir($directory))    
			{
				if (substr_count($file ,".gif") == 1) 
				{
					$selected = (strtoupper($file) == strtoupper($team_row['team_symbol'])) ? ' selected="selected"' : '';
					$teamsymbol_options .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>';
				}
			}
			closedir($directory);		
		}
		
		// Which page?
		switch ($action)
		{
			case 'delete':
				if (!$season)
				{
					trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
				}

				if (!$league)
				{
					trigger_error($user->lang['NO_LEAGUE'] . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING);
				}

				if (!$team)
				{
					trigger_error($user->lang['NO_TEAM'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
				}

				if (confirm_box(true))
				{
					$error = '';

					if (!$auth->acl_get('a_football_delete'))
					{
						trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
					}
					if ($user->data['user_type'] != USER_FOUNDER && $config['football_founder_delete'])
					{
						trigger_error($user->lang['TEAMS_NO_DELETE'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
					}

					// Delete team
					$sql = 'DELETE FROM ' . FOOTB_TEAMS . "
							WHERE season = $season AND league = $league AND team_id = $team";
					$db->sql_query($sql);

					// Delete bets
					$sql = 'DELETE FROM ' . FOOTB_BETS . "
							WHERE  season = $season 
								AND league = $league 
								AND match_no IN 
								(SELECT 
									DISTINCT match_no 
								FROM " . FOOTB_MATCHES . "
								WHERE season = $season 
									AND league = $league 
									AND (team_id_home = $team OR team_id_home = $team))";
					$db->sql_query($sql);

					// Delete matches
					$sql = 'DELETE FROM ' . FOOTB_MATCHES . "
							WHERE season = $season AND league = $league AND (team_id_home = $team OR team_id_home = $team)";
					$db->sql_query($sql);

					trigger_error($user->lang['TEAM_DELETED'] . adm_back_link($this->u_action . "&s=$season&l=$league"));
				}
				else
				{
					confirm_box(false, sprintf($user->lang['TEAM_CONFIRM_DELETE'], $team_row['team_name'], $season, $league), build_hidden_fields(array(
						's'			=> $season,
						'l'			=> $league,
						't'			=> $team,
						'mode'		=> $mode,
						'action'	=> $action))
					);
				}
			break;

			case 'add_old':
				if (!check_form_key($form_key))
				{
					trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
				}
				
				$sql = 'SELECT *
					FROM ' . FOOTB_TEAMS . "
					WHERE team_id = $team";
				$result = $db->sql_query($sql);
				$oldteam_row = $db->sql_fetchrow($result);
				$db->sql_freeresult($result);

				$matchday_options = '';
				if ($ko_league)
				{
					// Grab all matchdays for selection
					$sql = 'SELECT 
							DISTINCT matchday, 
							matchday_name
						FROM ' . FOOTB_MATCHDAYS . "
						WHERE season = $season 
							AND league = $league 
						ORDER BY  matchday ASC";
					$result = $db->sql_query($sql);
					$matchdays = 0;
					while ($row = $db->sql_fetchrow($result))
					{
						$selected = ($row['matchday'] == 1) ? ' selected="selected"' : '';
						$day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']);
						$matchday_options .= '<option value="' . $row['matchday'] . '"' . $selected . '>' . $day_name . '</option>';
						$matchdays++;
					}
					$db->sql_freeresult($result);
					if (!$matchdays)
					{
						trigger_error($user->lang['NO_MATCHDAYS'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
					}
				}

				// Grab all teamsymbol for selection
				$teamsymbol_options = '<option value="blank.gif">blank.gif</option>';
				$folder = $phpbb_root_path . 'football/images/flags/';
				$directory  = opendir($folder);
				while($file = readdir($directory))    
				{
					if (substr_count($file ,".gif") == 1) 
					{
						$selected = (strtoupper($file) == strtoupper($oldteam_row['team_symbol'])) ? ' selected="selected"' : '';
						$teamsymbol_options .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>';
					}
				}
				closedir($directory);		
				
				$u_back = $this->u_action . "&s=$season&l=$league";

				$template->assign_vars(array(
					'S_EDIT'				=> true,
					'S_ADD_TEAM'			=> true,
					'S_ERROR'				=> false,
					'S_KO_LEAGUE'			=> $ko_league,
					'ERROR_MSG'				=> (sizeof($error)) ? implode('<br />', $error) : '',
					'SEASON'				=> $season,
					'SEASON_NAME'			=> $season_name,
					'LEAGUE'				=> $league,
					'LEAGUE_NAME'			=> $league_name,
					'TEAM'					=> $team,
					'TEAM_NAME'				=> $oldteam_row['team_name'],
					'TEAM_SHORT'			=> $oldteam_row['team_name_short'],
					'TEAM_SYMBOL'			=> $oldteam_row['team_symbol'],
					'TEAM_SYMBOL_OPTIONS'	=> $teamsymbol_options,
					'TEAM_IMAGE'			=> ($oldteam_row['team_symbol']) ? $phpbb_root_path . 'football/images/flags/' . $oldteam_row['team_symbol'] : '',
					'TEAM_GROUP'			=> '',
					'TEAM_MATCHDAY_OPTIONS'	=> $matchday_options,
					'PHPBB_ROOT_PATH'		=> $phpbb_root_path,
					'U_BACK'				=> $u_back,
					'U_ACTION'				=> "{$this->u_action}&action=add&s=$season&l=$league",
					)
				);
				return;
			break;
			case 'add':
				if ($team > 0 AND $team <= 65535)
				{
					if ($team_row)
					{
						if ($edit)
						{
							$error[] =  $user->lang['TEAM_TAKEN'];
						}
						else
						{
							trigger_error($user->lang['TEAM_TAKEN'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
						}
					}
					$team_row['team_name'] 			= utf8_normalize_nfc(request_var('team_name', '', true));
					$team_row['team_name_short'] 	= utf8_normalize_nfc(request_var('team_short', '', true));
					$team_row['team_symbol'] 		= utf8_normalize_nfc(request_var('team_symbol', '', true));
					$team_row['group_id'] 			= utf8_normalize_nfc(request_var('team_group', '', true));
					$team_row['matchday'] 			= utf8_normalize_nfc(request_var('team_round', '', true));
				}
				else 
				{
					trigger_error($user->lang['TEAM_NUMBER'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
				}
				// No break for edit the new  team
			case 'edit':

				$data = array();

				if (!sizeof($error))
				{
					if ($action == 'edit' && !$team)
					{
						trigger_error($user->lang['NO_TEAM'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
					}

					// Did we submit?
					if ($update)
					{
						if (!check_form_key($form_key))
						{
							trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
						}
						
						$team_row['team_name'] 			= utf8_normalize_nfc(request_var('team_name', '', true));
						$team_row['team_name_short'] 	= utf8_normalize_nfc(request_var('team_short', '', true));
						$team_row['team_symbol'] 		= utf8_normalize_nfc(request_var('team_symbol', '', true));
						$team_row['group_id'] 			= utf8_normalize_nfc(request_var('team_group', '', true));
						$team_row['matchday'] 			= utf8_normalize_nfc(request_var('team_round', '', true));

						// Check teamname
						if (strlen($team_row['team_name']) > 2)
						{
							// Check double entry for team 
							$sql = 'SELECT 
									DISTINCT team_id
								FROM ' . FOOTB_TEAMS . "
								WHERE team_name = '" . $team_row['team_name'] . "'";
							$result = $db->sql_query($sql);
							$name_rows = $db->sql_fetchrowset($result);
							$db->sql_freeresult($result);
							if (sizeof($name_rows) > 1)
							{
								$error[] =  $user->lang['TEAM_NAME_DOUBLE'];
							}
							elseif (sizeof($name_rows) == 1)
							{
								if ($name_rows[0]['team_id'] <> $team)
								{
									$error[] =  $user->lang['TEAM_NAME_DOUBLE'];
								}
							}
						}
						
						// Check teamname short
						if (strlen($team_row['team_name_short']) > 1)
						{
							// Check double entry for team 
							$sql = 'SELECT 
									DISTINCT team_id
								FROM ' . FOOTB_TEAMS . "
								WHERE team_name_short = '" . $team_row['team_name_short'] . "'";
							$result = $db->sql_query($sql);
							$short_rows = $db->sql_fetchrowset($result);
							$db->sql_freeresult($result);
							if (sizeof($short_rows) > 1)
							{
								$error[] =  $user->lang['TEAM_SHORT_DOUBLE'];
							}
							elseif (sizeof($short_rows) == 1)
							{
								if ($short_rows[0]['team_id'] <> $team)
								{
									$error[] =  $user->lang['TEAM_SHORT_DOUBLE'];
								}
							}
						}
						
						if (!sizeof($error))
						{
							$sql_ary = array(
								'season'			=> (int) $season,
								'league'			=> (int) $league,
								'team_id'			=> (int) $team,
								'team_name'			=> $team_row['team_name'],
								'team_name_short'	=> $team_row['team_name_short'],
								'team_symbol'		=> strlen($team_row['team_symbol']) ? $team_row['team_symbol'] : 'blank.gif',
								'group_id'			=> strlen($team_row['group_id']) ? $team_row['group_id'] : '',
								'matchday'			=> strlen($team_row['matchday']) ? $team_row['matchday'] : 0,
							);

							if ($ko_league)
							{
								$data['team_group']	= $team_row['group_id'];
							}
							else
							{
								$data['team_group']	= '';
							}
							$data['team']	= $team;
							$data['team_name']	= $team_row['team_name'];
							$data['team_short']	= $team_row['team_name_short'];

							$var_ary = array(
								'team'		=> array('num', false, 1, 999),
								'team_name'	=> array('string', false, 3, 30),
								'team_short'	=> array('string', false, 1, 10),
								'team_group'	=> array(
									array('string', true, 1, 1),
									array('match', true, '#^[A-Z]#')),
							);
							if (!($error_vals = validate_data($data, $var_ary)))
							{
								if ($action == 'add')
								{
									$sql = 'INSERT INTO ' . FOOTB_TEAMS . ' ' . $db->sql_build_array('INSERT', $sql_ary);
									$db->sql_query($sql);
								}
								else
								{
									$sql = 'UPDATE ' . FOOTB_TEAMS . '
										SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
										WHERE season = $season AND league = $league AND team_id = $team";
									$db->sql_query($sql);
								}
								$message = ($action == 'edit') ? 'TEAM_UPDATED' : 'TEAM_CREATED';
								trigger_error($user->lang[$message] . adm_back_link($this->u_action . "&s=$season&l=$league"));
							}
							else
							{
								foreach ($error_vals as $error_val)
								{
										$error_msg[] = $user->lang[$error_val];
								}
								$message = ($action == 'edit') ? 'TEAM_UPDATE_FAILED' : 'TEAM_CREATE_FAILED';
								$error[] =  $user->lang[$message];
								$error = array_merge($error, $error_msg);
							}
						}
					}
				}

				$matchday_options = '';
				if ($ko_league)
				{
					// Grab all matchdays for selection
					$sql = 'SELECT 
							DISTINCT matchday, 
							matchday_name
						FROM ' . FOOTB_MATCHDAYS . "
						WHERE season = $season 
							AND league = $league 
						ORDER BY  matchday ASC";
					$result = $db->sql_query($sql);
					$matchdays = 0;
					while ($row = $db->sql_fetchrow($result))
					{
						$selected = ($team_row['matchday'] && $row['matchday'] == $team_row['matchday']) ? ' selected="selected"' : '';
						$matchday_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']);
						$matchday_options .= '<option value="' . $row['matchday'] . '"' . $selected . '>' . $matchday_name . '</option>';
						$matchdays++;
					}
					$db->sql_freeresult($result);
					if (!$matchdays)
					{
						trigger_error($user->lang['NO_MATCHDAYS'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING);
					}
				}

				$u_back = $this->u_action . "&s=$season&l=$league";

				$template->assign_vars(array(
					'S_EDIT'				=> true,
					'S_ADD_TEAM'			=> ($action == 'add') ? true : false,
					'S_ERROR'				=> (sizeof($error)) ? true : false,
					'S_KO_LEAGUE'			=> $ko_league,
					'ERROR_MSG'				=> (sizeof($error)) ? implode('<br />', $error) : '',
					'SEASON'				=> $season,
					'SEASON_NAME'			=> $season_name,
					'LEAGUE'				=> $league,
					'LEAGUE_NAME'			=> $league_name,
					'TEAM'					=> $team,
					'TEAM_NAME'				=> $team_row['team_name'],
					'TEAM_SHORT'			=> $team_row['team_name_short'],
					'TEAM_SYMBOL'			=> $team_row['team_symbol'],
					'TEAM_SYMBOL_OPTIONS'	=> $teamsymbol_options,
					'TEAM_IMAGE'			=> ($team_row['team_symbol']) ? $phpbb_root_path . 'football/images/flags/' . $team_row['team_symbol']: '',
					'TEAM_GROUP'			=> $team_row['group_id'],
					'TEAM_ROUND'			=> $team_row['matchday'],
					'TEAM_MATCHDAY_OPTIONS'	=> $matchday_options,
					'PHPBB_ROOT_PATH'		=> $phpbb_root_path,
					'U_BACK'				=> $u_back,
					'U_ACTION'				=> "{$this->u_action}&action=$action&s=$season&l=$league",
					)
				);

				return;
			break;
		}
		$u_footb_parm = "s=$season&l=$league&";

		$template->assign_vars(array(
			'U_ACTION'			=> $this->u_action,
			'U_FOOTBALL' 		=> append_sid($phpbb_root_path . "football.$phpEx", $u_footb_parm . 'side=bets'),
			'S_SEASON'			=> $season,
			'S_LEAGUE'			=> $league,
			'S_KO_LEAGUE'		=> $ko_league,
			'S_SEASON_OPTIONS'	=> $season_options,
			'S_LEAGUE_OPTIONS'	=> $league_options,
			'S_TEAM_OPTIONS'	=> $team_options,
			'S_TEAM_ADD'		=> true,
			) 
		);
		
		// Get us all the teams
		$sql = 'SELECT *
			FROM ' . FOOTB_TEAMS . " 
			WHERE season = $season 
				AND league = $league
			ORDER BY team_id ASC";
		$result = $db->sql_query($sql);
		$rows_teams = $db->sql_fetchrowset($result);
		$db->sql_freeresult($result);

		// Check if the user is allowed to delete a team.
		if ($user->data['user_type'] != USER_FOUNDER && $config['football_founder_delete'])
		{
			$allow_delete = false;
		}
		else
		{
			$allow_delete = true;
		}

		$row_number = 0;
		foreach ($rows_teams as $row_team)
		{
			$row_number++;
			$row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
			$template->assign_block_vars('teams', array(
				'ROW_CLASS'		=> $row_class,
				'TEAM'			=> $row_team['team_id'],
				'TEAM_NAME'		=> $row_team['team_name'],
				'TEAM_SHORT'	=> $row_team['team_name_short'],
				'TEAM_IMAGE'	=> ($row_team['team_symbol']) ? $phpbb_root_path . 'football/images/flags/' . $row_team['team_symbol']: '',
				'TEAM_GROUP'	=> $row_team['group_id'],
				'TEAM_ROUND'	=> $row_team['matchday'],
				'U_EDIT'		=> "{$this->u_action}&action=edit&s=" . $season . "&l=" .$league . "&t=" .$row_team['team_id'],
				'U_DELETE'		=> ($allow_delete) ? "{$this->u_action}&action=delete&s=" . $season . "&l=" . $league . "&t=" . $row_team['team_id'] : '',
				)
			);
		}
	}
}
?>

Ich werde mal selbst ein wenig experimentieren, ich denke der Fehler dürfte in dieser Gegend zu finden sein:

Code: Alles auswählen

		// Get us all the teams
		$sql = 'SELECT t.*,
				SUM(IF(m.team_id_home = t.team_id, 1 , 0)) AS matches_home,
				SUM(IF(m.team_id_guest = t.team_id, 1 , 0)) AS matches_away
			FROM ' . FOOTB_TEAMS . ' AS t 
			JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = $season AND m.league = $league AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) 
			WHERE t.season = $season 
				AND t.league = $league
			GROUP BY t.team_id
			ORDER BY team_id ASC";
		$result = $db->sql_query($sql);
		$rows_teams = $db->sql_fetchrowset($result);
		$db->sql_freeresult($result);

Vielleicht liege ich aber auch falsch, und irgendwo anders happert es .....

Danke


Gruss


Draketornado
tekknodevil
Mitglied
Beiträge: 142
Registriert: 08.12.2009 20:45
Wohnort: Dresden
Kontaktdaten:

Re: [BETA] phpBB3 Football MOD Version 0.9.3

Beitrag von tekknodevil »

Draketornado hat geschrieben:
Sogar neu erstellte Teamsp für eine neue Saison / neue Liga, werden ganz normal in der Datenbank abgespeichert, doch wie gesagt, kann man sie im Adminmenu unter Teams Verwalten nicht sehen, da diese Liste leer ist. Versucht man nun dieser Liga nochmal das gleiche Team hinzuzufügen, gibts auch die Fehlermeldung, dass das Team bereits in der Liste ist.

Wie soll ich denn die Wappen ändern können, wenn ich nicht mal die Mannschaften sehe?

Hoffe es kann mir jemand hier helfen!
Frage. Die Ligen welche Du neu angelegt hast, sind von den Spieltagen schon terminiert? Was ich damit meine, bei Spieltag 1 stehen zum Beispiel schon die Begegnungen fest, also z.b. Dortmund gegen Bayern? Wenn dies nicht der Fall ist, kannst Du die Teams unter Teams verwalten noch nicht sehen. Diese tauchen da erst auf, wenn die Begegnungen eingetragen sind. Die kannst Du ganz einfach testen, in dem Du bei einem Spieltag mal ne Begegnung einträgst.
Benutzeravatar
football
Mitglied
Beiträge: 862
Registriert: 03.05.2009 10:37
Kontaktdaten:

Re: [BETA] phpBB3 Football MOD Version 0.9.3

Beitrag von football »

tekknodevil hat geschrieben:Frage. Die Ligen welche Du neu angelegt hast, sind von den Spieltagen schon terminiert? Was ich damit meine, bei Spieltag 1 stehen zum Beispiel schon die Begegnungen fest, also z.b. Dortmund gegen Bayern? Wenn dies nicht der Fall ist, kannst Du die Teams unter Teams verwalten noch nicht sehen. Diese tauchen da erst auf, wenn die Begegnungen eingetragen sind. Die kannst Du ganz einfach testen, in dem Du bei einem Spieltag mal ne Begegnung einträgst.
Hallo, der Fehler ist mir zwischenzeitlich auch schon aufgefallen. In Version 0.9.1 hatte ich noch nicht die Anzahl der Spiele der einzelnen Teams angezeigt und daher noch nicht mit der matches_Tabelle gejoint.
In /includes/acp/acp_football_teams.php

Code: Alles auswählen

			JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = $season AND m.league = $league AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) 
durch

Code: Alles auswählen

			LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = $season AND m.league = $league AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) 
ersetzen, also ein LEFT JOIN und alle Teams werden unabhängig vom Stand des Spielplans angezeigt.

Und wo ich gerade mal dabei bin:
In football/block/delivery.php:

Code: Alles auswählen

		'U_BET_LINK'	=> append_sid("football.$phpEx", 'm=' . $row['season'] . '&l=' . $row['league'] . '&m=' . $row['matchday'] . '&side=bet'),
durch

Code: Alles auswählen

		'U_BET_LINK'	=> append_sid("football.$phpEx", 's=' . $row['season'] . '&l=' . $row['league'] . '&m=' . $row['matchday'] . '&side=bet'),
ersetzen, dann klappt der Link auch saisonübergreifend und nicht nur innerhalb der aktuellen Saison.
Kein Support per PN oder E-Mail. Support-Anfragen beantworte ich nur über diese Community.
tekknodevil
Mitglied
Beiträge: 142
Registriert: 08.12.2009 20:45
Wohnort: Dresden
Kontaktdaten:

Re: [BETA] phpBB3 Football MOD Version 0.9.3

Beitrag von tekknodevil »

football hat geschrieben:
tekknodevil hat geschrieben:Frage. Die Ligen welche Du neu angelegt hast, sind von den Spieltagen schon terminiert? Was ich damit meine, bei Spieltag 1 stehen zum Beispiel schon die Begegnungen fest, also z.b. Dortmund gegen Bayern? Wenn dies nicht der Fall ist, kannst Du die Teams unter Teams verwalten noch nicht sehen. Diese tauchen da erst auf, wenn die Begegnungen eingetragen sind. Die kannst Du ganz einfach testen, in dem Du bei einem Spieltag mal ne Begegnung einträgst.
Hallo, der Fehler ist mir zwischenzeitlich auch schon aufgefallen. In Version 0.9.1 hatte ich noch nicht die Anzahl der Spiele der einzelnen Teams angezeigt und daher noch nicht mit der matches_Tabelle gejoint.
In /includes/acp/acp_football_teams.php

Code: Alles auswählen

			JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = $season AND m.league = $league AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) 
durch

Code: Alles auswählen

			LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = $season AND m.league = $league AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) 
ersetzen, also ein LEFT JOIN und alle Teams werden unabhängig vom Stand des Spielplans angezeigt.

Und wo ich gerade mal dabei bin:
In football/block/delivery.php:

Code: Alles auswählen

		'U_BET_LINK'	=> append_sid("football.$phpEx", 'm=' . $row['season'] . '&l=' . $row['league'] . '&m=' . $row['matchday'] . '&side=bet'),
durch

Code: Alles auswählen

		'U_BET_LINK'	=> append_sid("football.$phpEx", 's=' . $row['season'] . '&l=' . $row['league'] . '&m=' . $row['matchday'] . '&side=bet'),
ersetzen, dann klappt der Link auch saisonübergreifend und nicht nur innerhalb der aktuellen Saison.
Fetten Dank. Jetzt klappert es.
Benutzeravatar
Hegse
Mitglied
Beiträge: 262
Registriert: 05.06.2006 12:49
Wohnort: Liemke
Kontaktdaten:

Re: [BETA] phpBB3 Football MOD Version 0.9.3

Beitrag von Hegse »

Nabend.

Ich komme mit der Spielplan Aktualisierung nicht weiter.
Liga Daten aktualisieren funktioniert mit beiden Quellen (http://football.bplaced.net/football/xm ... season.php oder die gespeicherte League im localhost Verzeichnis) ohne Probleme. Die Änderungen werden mir vom Spielplan auch passend angezeigt. Klicke ich jetzt auf Ligadaten aktualisieren lädt der Browser kurz und springt dann wieder auf die Seite zum Spielplan aktualisieren ohne irgendwelche Änderungen an der Datenbank durchgeführt zu haben. Keine Bestätigung oder Fehlermeldung. Schaue ich jetzt auf der Tippseite nach finde ich bei den Begegnungen die Standard Partien Auslosung - Auslosung.
Football Mod Version ist mit den letzten Änderungen auf den aktuellsten Stand.
Mache ich jetzt irgendwo was falsch?
Benutzeravatar
football
Mitglied
Beiträge: 862
Registriert: 03.05.2009 10:37
Kontaktdaten:

Re: [BETA] phpBB3 Football MOD Version 0.9.3

Beitrag von football »

Ich habe die Funktion gerade unter Xampp mit dem Spielplan der 1.BL (Auslosung) getestet.
Beim Abglich zeigt er den ersten Spieltermin sowie die Heim- und gastmannschaften in den 306 Paarungen an.
Die Optionshaken habe ich unverändert gelassen und auf "Ligadaten aktualisieren" geklickt.
Anschließend kam die Meldung mit den Änderungen und die Spielpaarungen standen im Spielplan.
Bei mir hat es also soweit geklappt.

Nutzt du vielleicht auch Suhosin? (Unter PHP-Info im Adminbereich nachschauen)
Vielleicht gibt es ja PHP-Seitig bei dir auch andere Einschränkungen die einen solchen "Massenupdate" nicht zulassen.

Hast du dies schon einmal mit einer lokalen Kopie unter Xampp bei dir probiert?
Den vorhandenen Spielplan hast du mit der Uodate-Funktion neu angelegt?
Dann lösch doch die Liga und Spiel sie noch einmal neu ein.
Wenn bei dir schon jemand getippt hat, solltest du die Liga-Daten über phpmyadmin in den einzelnen tabellen löschen, natürlich nicht die footb_bets.
Wenn noch niemand getippt hat , kannst du die Liga ja auch im Adminbereich löschen und nach dem erneuten Einspielen dann nur dieder die Tipper hinterlegen.

Oh, habe gerade gesehen, dass in deiner footb_leagues Tabelle ein Feld file_id existiert.
Im Mod gibt es dieses Feld nicht und daher kann die Tabelle nicht aktualisiert werden.
Dadurch klappt dann vermutlich das ganze update nicht mehr.

Wozu benötigst du das Feld file_id?
Wenn du es in phpmyadmin löschst, sollte das Update funktionieren.
Kein Support per PN oder E-Mail. Support-Anfragen beantworte ich nur über diese Community.
Benutzeravatar
Hegse
Mitglied
Beiträge: 262
Registriert: 05.06.2006 12:49
Wohnort: Liemke
Kontaktdaten:

Re: [BETA] phpBB3 Football MOD Version 0.9.3

Beitrag von Hegse »

Wie das Feld file_id in die Datenbank kommt kann ich ehrlich gesagt gar nicht sagen.. :-?

So, nachdem ich das Feld gelöscht hatte habe ich die Aktualisierung noch einmal gestartet mit den selben Ergebnissen wie vorher.
Was nun funktioniert hat war das komplette löschen der angelegten Ligen mit anschließendem Spielplan aktualisieren als neue Liga. Habe nun die ersten 3 Ligen + DFB Pokal ohne Probleme über die Spielplan Aktualisierung neu angelegt. Mal schauen was passiert wenn nun die ersten Änderung durch die Terminierung der einzelnen Spiele feststehen.

Soweit erstmal besten Dank für deine Problemlösungen!
Antworten

Zurück zu „[3.0.x] Mods in Entwicklung“