commit 18fa848f6fc98fe6a263b5ecc7655cdf0716b951 Author: football Date: Wed May 4 22:33:42 2016 +0200 Version 0.9.5 diff --git a/Readme - Update from MOD.txt b/Readme - Update from MOD.txt new file mode 100644 index 0000000..bdb9a49 --- /dev/null +++ b/Readme - Update from MOD.txt @@ -0,0 +1,6 @@ +Follow the phpBB instruction to the convert from 3.0 to 3.1. +Don't remove football MOD permissions, custom profile fields and football tables in database. +Please remove recursive the "football MOD Version 0.9.3" ACP Modules in ACP-SYSTEM-MODUL MANAGEMENT. + +Unzip Football Prediction League extension in folder ext/ +Activate the Football Prediction League extension in ACP. diff --git a/acp/all_bets_info.php b/acp/all_bets_info.php new file mode 100644 index 0000000..c606e27 --- /dev/null +++ b/acp/all_bets_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\all_bets_module', + 'title' => 'ACP_FOOTBALL_ALL_BETS_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_ALL_BETS_VIEW', 'auth' => 'acl_a_football_editbets', 'cat' => array('ACP_FOOTBALL_ALL_BETS')), + ), + ); + } +} diff --git a/acp/all_bets_module.php b/acp/all_bets_module.php new file mode 100644 index 0000000..59d0273 --- /dev/null +++ b/acp/all_bets_module.php @@ -0,0 +1,600 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_all_bets'); + + $this->root_path = $phpbb_root_path . 'ext/football/football/'; + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + + if(!function_exists('season_info')) + { + include($this->root_path . 'includes/functions.' . $this->php_ext); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->root_path . 'includes/constants.' . $this->php_ext); + } + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $this->tpl_name = 'acp_football_all_bets'; + $this->page_title = 'ACP_FOOTBALL_ALL_BETS_VIEW'; + + $form_key = 'acp_football_all_bets'; + add_form_key($form_key); + + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + + // Check and set some common vars + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $matchday = $this->request->variable('m', 0); + $start = $this->request->variable('start', 0); + + // 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 .= ''; + 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 = current_league($season); + } + + $league_info = league_info($season, $league); + // 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 .= ''; + if ($selected <> '') + { + $league_matchdays = $row['matchdays']; + $matches_matchday = $row['matches_on_matchday']; + $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 . "&m=$season"), E_USER_WARNING); + } + + // Grab basic data for select matchday + if (!$matchday) + { + $matchday = curr_matchday($season, $league); + } + $sql = 'SELECT * + FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + + $matchday_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($matchday && $row['matchday'] == $matchday) ? ' selected="selected"' : ''; + $day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']); + $matchday_options .= ''; + if ($selected <> '') + { + $matchday_name = $day_name; + if ($matches_matchday) + { + $matches_on_matchday = $matches_matchday; + } + else + { + $matches_on_matchday = $row['matches']; + } + } + } + $db->sql_freeresult($result); + if ($matchday_options == '') + { + trigger_error(sprintf($user->lang['NO_MATCHDAY'], $league_name, $season) . adm_back_link($this->u_action . "&m=$season&l=$league"), E_USER_WARNING); + } + + $matches_on_matchday = false; + + $sql = 'SELECT + COUNT(DISTINCT user_id) AS num_users + FROM ' . FOOTB_BETS . " + WHERE season = $season + AND league = $league"; + $result = $db->sql_query($sql); + $total_users = (int) $db->sql_fetchfield('num_users'); + $db->sql_freeresult($result); + + $sql = "SELECT + m.match_no, + m.status, + m.formula_home, + m.formula_guest, + t1.team_name_short AS hname, + t2.team_name_short AS gname, + t1.team_id AS hid, + t2.team_id AS gid, + m.goals_home, + m.goals_guest, + SUM(IF(b.goals_home + 0 > b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS home, + SUM(IF(b.goals_home = b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS draw, + SUM(IF(b.goals_home + 0 < b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS guest + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . ' AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) + LEFT JOIN ' . FOOTB_BETS . " AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + GROUP BY m.match_no + ORDER BY m.match_datetime ASC, m.match_no ASC + "; + + $result = $db->sql_query($sql); + $matches = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $count_matches = sizeof($matches); + if ($count_matches > 11) + { + $split_after = 8; + $splits = ceil($count_matches / 8); + } + else + { + $split_after = $count_matches; + $splits = 1; + } + $db->sql_freeresult($result); + + // Make sure $start is set to the last page if it exceeds the amount + if ($start < 0 || $start >= $total_users) + { + $start = ($start < 0) ? 0 : floor(($total_users - 1) / $this->config['football_users_per_page']) * $this->config['football_users_per_page']; + } + else + { + $start = floor($start / $this->config['football_users_per_page']) * $this->config['football_users_per_page']; + } + + $sql_start = $start * $count_matches; + $sql_limit = $this->config['football_users_per_page'] * $count_matches; + + // handle pagination. + $base_url = $this->u_action . "&s=$season&l=$league&m=$matchday"; + $pagination = $phpbb_container->get('pagination'); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start); + + if ($count_matches > 0) + { + $matches_on_matchday = true; + + $sql = "SELECT + u.user_id, + u.username, + m.status, + b.goals_home AS bet_home, + b.goals_guest AS bet_guest, + " . select_points() . " + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_BETS . ' AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id=b.user_id) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + ORDER BY LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC"; + $result = $db->sql_query_limit($sql, $sql_limit, $sql_start); + $user_bets = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $bet_index = 0; + $split_index = 0; + foreach ($user_bets AS $user_bet) + { + if ($bet_index == $count_matches) + { + $bet_index = 0; + $split_index = 0; + } + if (!($bet_index % $split_after)) + { + $split_index++; + } + $sum_total[$user_bet['username']] = 0; + $bet_line[$split_index][] = $user_bet; + $bet_index++; + } + } + $match_index = 0; + $last_match_index = 0; + $split_index = 0; + $matchday_sum_total = 0; + $colorstyle_total = ' color_finally'; + foreach ($matches AS $match) + { + if (!($match_index % $split_after)) + { + if ($match_index > 0) + { + $total = 0; + $count_user = 0; + $bet_index = 0; + $last_match_index = 0; + foreach ($bet_line[$split_index] AS $user_bet) + { + if ($bet_index == 0) + { + $count_user++; + $row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($user_bet['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('match_panel.user_row', array( + 'ROW_CLASS' => $row_class, + 'USER_NAME' => $user_bet['username'], + ) + ); + $total = 0; + } + $bet_index++; + $total += $user_bet['points']; + if ($user_bet['status'] < 3) + { + $colorstyle_total = ' color_provisionally'; + } + $bet_home = $user_bet['bet_home']; + $bet_guest = $user_bet['bet_guest']; + + $colorstyle_bet = color_style($user_bet['status']); + $template->assign_block_vars('match_panel.user_row.bet', array( + 'BET' => $bet_home. ':'. $bet_guest, + 'COLOR_STYLE' => $colorstyle_bet, + 'POINTS' => ($user_bet['points'] == '') ? ' ' : $user_bet['points'], + ) + ); + + if ($bet_index == $split_after) + { + $sum_total[$user_bet['username']] += $total; + $matchday_sum_total += $total; + $bet_index = 0; + } + } + + $template->assign_block_vars('match_panel.tendency_footer', array( + 'S_TOTAL' => false, + ) + ); + foreach ($matches_tendency AS $match_tendency) + { + $template->assign_block_vars('match_panel.tendency_footer.tendency', array( + 'TENDENCY' => $match_tendency[0], + 'MATCH_ENTRY' => $match_tendency[1], + ) + ); + } + } + $matches_tendency = array(); + $split_index++; + if ($split_index == $splits) + { + $display_total = true; + } + else + { + $display_total = false; + } + $template->assign_block_vars('match_panel', array( + 'S_TOTAL' => $display_total, + ) + ); + } + if (0 == $match['hid']) + { + $home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']); + $home_in_array = explode("#",$home_info); + $homename = $home_in_array[3]; + } + else + { + $homename = $match['hname']; + } + if (0 == $match['gid']) + { + $guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']); + $guest_in_array = explode("#",$guest_info); + $guestname = $guest_in_array[3]; + } + else + { + $guestname = $match['gname']; + } + $colorstyle_match = color_style($match['status']); + $template->assign_block_vars('match_panel.match', array( + 'HOME_NAME' => $homename, + 'GUEST_NAME' => $guestname, + 'RESULT' => $match['goals_home']. ':'.$match['goals_guest'], + 'COLOR_STYLE' => $colorstyle_match, + ) + ); + + $matches_tendency[] = array($match['home'] . '-' . $match['draw'] . '-' . $match['guest'], $homename . '-' . $guestname); + $match_index++; + $last_match_index++; + } + if ($count_matches > 0) + { + $total = 0; + $count_user = 0; + $bet_index = 0; + foreach ($bet_line[$split_index] AS $user_bet) + { + if ($bet_index == 0) + { + $count_user++; + $row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($user_bet['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('match_panel.user_row', array( + 'ROW_CLASS' => $row_class, + 'USER_NAME' => $user_bet['username'], + ) + ); + $total = 0; + } + $bet_index++; + $total += $user_bet['points']; + if ($user_bet['status'] < 3) + { + $colorstyle_total = ' color_provisionally'; + } + $bet_home = $user_bet['bet_home']; + $bet_guest = $user_bet['bet_guest']; + + $colorstyle_bet = color_style($user_bet['status']); + $template->assign_block_vars('match_panel.user_row.bet', array( + 'BET' => $bet_home. ':'. $bet_guest, + 'COLOR_STYLE' => $colorstyle_bet, + 'POINTS' => ($user_bet['points'] == '') ? ' ' : $user_bet['points'], + ) + ); + + if ($bet_index == $last_match_index) + { + $sum_total[$user_bet['username']] += $total; + $matchday_sum_total += $total; + $template->assign_block_vars('match_panel.user_row.points', array( + 'COLOR_STYLE' => $colorstyle_total, + 'POINTS_TOTAL' => $sum_total[$user_bet['username']], + ) + ); + $bet_index = 0; + } + } + + $template->assign_block_vars('match_panel.tendency_footer', array( + 'S_TOTAL' => true, + 'COLOR_STYLE' => $colorstyle_total, //currently ignored + 'SUMTOTAL' => $matchday_sum_total, + ) + ); + foreach ($matches_tendency AS $match_tendency) + { + $template->assign_block_vars('match_panel.tendency_footer.tendency', array( + 'TENDENCY' => $match_tendency[0], + 'MATCH_ENTRY' => $match_tendency[1], + ) + ); + } + } + + //extra bets + // Calculate extra bets of matchday + $sql_start = $start; + $sql_limit = $this->config['football_users_per_page']; + $sql = "SELECT e.*, + t1.team_name AS result_team + FROM " . FOOTB_EXTRA . ' AS e + LEFT JOIN ' . FOOTB_TEAMS . " AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result) + WHERE e.season = $season + AND e.league = $league + AND e.matchday = $matchday + ORDER BY e.extra_no ASC"; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $extra_no = $row['extra_no']; + switch($row['question_type']) + { + case '1': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '2': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '3': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '4': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '5': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']); + } + break; + default : + { + $display_type = 2; + $eval_title = ''; + } + break; + } + $extra_colorstyle = color_style($row['extra_status']); + + $template->assign_block_vars('extra_panel', array( + 'QUESTION' => $row['question'], + 'RESULT' => ($display_type == 1) ? $row['result_team'] : $row['result'], + 'POINTS' => $row['extra_points'], + 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), + 'EVALUATION_TITLE' => $eval_title, + 'COLOR_STYLE' => $extra_colorstyle, + ) + ); + + // Get all extra bets of matchday + $bet_number = 0; + $sql = "SELECT u.user_id, + u.username, + e.*, + eb.bet, + eb.bet_points, + t2.team_name AS bet_team + FROM " . FOOTB_BETS . ' AS b + LEFT JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id) + LEFT JOIN ' . FOOTB_EXTRA . " AS e ON (e.season = b.season AND e.league = b.league AND e.matchday = $matchday AND e.extra_no = $extra_no) + LEFT JOIN " . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = b.season AND eb.league = b.league AND eb.extra_no = $extra_no AND eb.user_id = b.user_id) + LEFT JOIN " . FOOTB_TEAMS . " AS t2 ON (t2.season = b.season AND t2.league = b.league AND t2.team_id = eb.bet) + WHERE b.season = $season + AND b.league = $league + AND b.match_no = 1 + GROUP by b.user_id + ORDER BY LOWER(u.username) ASC"; + $result_bet = $db->sql_query_limit($sql, $sql_limit, $sql_start); + + while ($user_row = $db->sql_fetchrow($result_bet)) + { + $bet_number++ ; + $row_class = (!($bet_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($user_row['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + + $bet = ($user_row['bet'] == '') ? ' ' : $user_row['bet']; + $bet_team = ($user_row['bet_team'] == NULL) ? ' ' : $user_row['bet_team']; + + + $template->assign_block_vars('extra_panel.user_row', array( + 'ROW_CLASS' => $row_class, + 'USER_NAME' => $user_row['username'], + 'BET' => ($display_type == 1) ? $bet_team : $bet, + 'BET_POINTS' => $user_row['bet_points'], + 'COLOR_STYLE' => $extra_colorstyle, + ) + ); + } + } + + $legend = delivery($season, $league, $matchday); + + $template->assign_vars(array( + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'S_SEASON' => $season, + 'S_LEAGUE' => $league, + 'S_MATCHDAY' => $matchday, + 'S_SEASON_OPTIONS' => $season_options, + 'S_LEAGUE_OPTIONS' => $league_options, + 'S_MATCHDAY_OPTIONS' => $matchday_options, + 'S_DISPLAY_ALL_BETS' => true, + 'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday, + 'S_SPALTEN' => ($count_matches * 2)+2, + 'S_VERSION_NO' => $this->config['football_version'], + 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users), + 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), + ) + ); + } +} +?> \ No newline at end of file diff --git a/acp/bank_info.php b/acp/bank_info.php new file mode 100644 index 0000000..ad26a4e --- /dev/null +++ b/acp/bank_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\bank_module', + 'title' => 'ACP_FOOTBALL_BANK_MANAGEMENT', + 'version' => '0.9.2', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_BANK_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_BANK')), + ), + ); + } +} diff --git a/acp/bank_module.php b/acp/bank_module.php new file mode 100644 index 0000000..520d56c --- /dev/null +++ b/acp/bank_module.php @@ -0,0 +1,673 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_bank'); + + $this->root_path = $phpbb_root_path . 'ext/football/football/'; + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + + if(!function_exists('season_info')) + { + include($this->root_path . 'includes/functions.' . $this->php_ext); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->root_path . 'includes/constants.' . $this->php_ext); + } + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + if (!$this->config['football_bank']) + { + trigger_error($user->lang['FOOTBALL_BANK_OFF'], E_USER_WARNING); + } + + if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) + { + $user->add_lang_ext('dmzx/ultimatepoints', 'common'); + // Get an instance of the ultimatepoints functions_points + $functions_points = $phpbb_container->get('dmzx.ultimatepoints.core.functions.points'); + } + else + { + // Get an instance of the football functions_points + $functions_points = $phpbb_container->get('football.football.core.functions.points'); + } + + $this->tpl_name = 'acp_football_bank'; + $this->page_title = 'ACP_FOOTBALL_BANK_MANAGE'; + + $form_key = 'acp_football_bank'; + add_form_key($form_key); + + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + + // Check and set some common vars + $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addmembers'])) ? 'addmembers' : $this->request->variable('action', '')); + $edit = $this->request->variable('edit', 0); + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $matchday = $this->request->variable('m', 0); + $type = $this->request->variable('t', 0); + $start = $this->request->variable('start', 0); + + // Clear some vars + $league_info = array(); + $error = array(); + + // Grab current season + if (!$season) + { + $season = curr_season(); + } + // Grab basic data for 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 .= ''; + if ($selected <> '') + { + $season_name = $row['season_name']; + } + } + $db->sql_freeresult($result); + } + else + { + trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING); + } + + // Grab basic data for league, if league is set and exists + if ($league) + { + $league_info = league_info($season, $league); + } + + // Which page? + switch ($action) + { + case 'bet': + case 'deposit': + case 'delete_wins': + case 'pay': + switch ($action) + { + case 'bet': + $type = POINTS_BET; + $default_matchday = 1; + $select_win = 'l.bet_points - SUM(IF(p.points_type = ' . POINTS_BET . ', p.points, 0.00)) AS win'; + $points_var = 'BET'; + break; + case 'deposit': + $type = POINTS_DEPOSITED; + $default_matchday = 1; + $select_win = 'IF(SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . ' ), p.points, p.points * -1.0)) > 0, + SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . ' ), p.points, p.points * -1.0)), 0.00) AS win'; + $points_var = 'DEPOSIT'; + break; + case 'delete_wins': + $default_matchday = 0; + $points_var = 'DELETE_WIN'; + break; + case 'pay': + $type = POINTS_PAID; + $default_matchday = 1; + $select_win = 'IF(SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . ' ), p.points * -1.0, p.points)) > 0, + SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . ' ), p.points * -1.0, p.points)), 0.00) AS win'; + $points_var = 'PAY'; + break; + } + + $mark_ary = $this->request->variable('markleague', array(0)); + $cash = $this->request->variable('cash', false); + + if (sizeof($mark_ary) == 0) + { + trigger_error($user->lang['NO_LEAGUES_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + if (confirm_box(true)) + { + $count_updates = 0; + for ($i = 0; $i < sizeof($mark_ary); $i++) + { + $league = $mark_ary[$i]; + if ($action == 'delete_wins') + { + rollback_points(POINTS_MATCHDAY, $season, $league, 0, $cash); + rollback_points(POINTS_SEASON, $season, $league, 0, $cash); + rollback_points(POINTS_MOST_HITS, $season, $league, 0, $cash); + rollback_points(POINTS_MOST_HITS_AWAY, $season, $league, 0, $cash); + $sql = 'DELETE FROM ' . FOOTB_POINTS . " + WHERE season = $season + AND league = $league + AND points_type IN (" . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . ')'; + $result = $db->sql_query($sql); + $count_updates += $db->sql_affectedrows(); + } + else + { + $sql = "SELECT b.user_id, + $select_win + FROM " . FOOTB_BETS . ' AS b + JOIN ' . FOOTB_LEAGUES . " AS l ON (l.season = $season AND l.league = $league ) + LEFT JOIN " . FOOTB_POINTS . " AS p ON (p.season = $season AND p.league = $league AND p.user_id = b.user_id) + WHERE b.season = $season + AND b.league = $league + AND b.match_no = 1 + GROUP BY b.season, b.league, b.user_id + HAVING win > 0"; + $result = $db->sql_query($sql); + $points_ary = $db->sql_fetchrowset($result); + if (!$default_matchday) + { + $matchday = (curr_matchday($season, $league) > 0) ? curr_matchday($season, $league) : 1; + } + else + { + $matchday = $default_matchday; + } + if (sizeof($points_ary) > 0) + { + $count_updates += sizeof($points_ary); + set_footb_points($type, $season, $league, $matchday, $points_ary, $cash); + } + } + } + $back_link = $this->u_action . '&s=' . $season; + trigger_error(sprintf($user->lang['LEAGUE_' . $points_var . ($count_updates == 1 ? '' : 'S')], $count_updates) .adm_back_link($back_link)); + } + else + { + confirm_box(false, sprintf($user->lang['CONFIRM_LEAGUE_' . $points_var]), build_hidden_fields(array( + 'markleague'=> $mark_ary, + 'cash' => $cash, + 's' => $season, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + case 'book': + switch ($type) + { + case POINTS_BET: + $points_var = 'BET'; + break; + case POINTS_DEPOSITED: + $points_var = 'DEPOSIT'; + break; + case POINTS_PAID: + $points_var = 'PAY'; + break; + } + + $mark_ary = $this->request->variable('mark', array(0)); + + if (sizeof($mark_ary) == 0) + { + trigger_error($user->lang['NO_MEMBERS_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $cash = $this->request->variable('cash', false); + $newvalue_ary = $this->request->variable('newvalue', array(0.00)); + if (sizeof($newvalue_ary) == 0) + { + for ($i = 0; $i < sizeof($mark_ary); $i++) + { + $newvalue_ary[] = 1.00 * str_replace (",", ".", $this->request->variable('newvalue' . $mark_ary[$i], '0.00')); + } + } + if (confirm_box(true)) + { + for ($i = 0; $i < sizeof($mark_ary); $i++) + { + if ($newvalue_ary[$i] <> 0) + { + $points_ary[] = array('user_id' => $mark_ary[$i], 'win' => $newvalue_ary[$i]); + } + } + $back_link = $this->u_action . '&action=list&s=' . $season . '&l=' . $league . '&t=' . $type . '&start=' . $start; + if (sizeof($points_ary) > 0) + { + set_footb_points($type, $season, $league, $matchday, $points_ary, $cash); + } + trigger_error(sprintf($user->lang['LEAGUE_' . $points_var . (sizeof($points_ary) == 1 ? '' : 'S')], sizeof($points_ary)) . adm_back_link($back_link)); + + } + else + { + confirm_box(false, sprintf($user->lang['CONFIRM_' . $points_var]), build_hidden_fields(array( + 'mark' => $mark_ary, + 'start' => $start, + 'cash' => $cash, + 'newvalue' => $newvalue_ary, + 's' => $season, + 'l' => $league, + 'm' => $matchday, + 't' => $type, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + case 'cancel': + switch ($type) + { + case POINTS_BET: + $points_var .= 'CANCEL_BET'; + break; + case POINTS_DEPOSITED: + $points_var .= 'CANCEL_DEPOSIT'; + break; + case POINTS_PAID: + $points_var .= 'CANCEL_PAY'; + break; + } + + $mark_ary = $this->request->variable('mark', array(0.00)); + + if (sizeof($mark_ary) == 0) + { + trigger_error($user->lang['NO_MEMBERS_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $cash = $this->request->variable('cash', false); + if (confirm_box(true)) + { + $count_updates = 0; + for ($i = 0; $i < sizeof($mark_ary); $i++) + { + $curr_user = $mark_ary[$i]; + if ($cash) + { + $sql = 'SELECT * + FROM ' . FOOTB_POINTS . " AS p + WHERE season = $season + AND league = $league + AND user_id = $curr_user + AND points_type = $type + AND cash = 1"; + + $result = $db->sql_query($sql); + while( $row = $db->sql_fetchrow($result)) + { + if ($type == POINTS_BET OR $type == POINTS_PAID) + { + $functions_points->add_points($curr_user, round($row['points'],2)); + } + if ($type == POINTS_DEPOSITED) + { + $functions_points->substract_points($curr_user, round($row['points'],2)); + } + } + $db->sql_freeresult($result); + + } + $sql = 'DELETE FROM ' . FOOTB_POINTS . " + WHERE season = $season + AND league = $league + AND user_id = $curr_user + AND points_type = $type"; + $result = $db->sql_query($sql); + $count_updates += $db->sql_affectedrows(); + } + $back_link = $this->u_action . '&action=list&s=' . $season . '&l=' . $league . '&t=' . $type . '&start=' . $start; + trigger_error(sprintf($user->lang['LEAGUE_' . $points_var . ($count_updates == 1 ? '' : 'S')], $count_updates) . adm_back_link($back_link)); + } + else + { + confirm_box(false, sprintf($user->lang['CONFIRM_' . $points_var]), build_hidden_fields(array( + 'mark' => $mark_ary, + 'start' => $start, + 'cash' => $cash, + 's' => $season, + 'l' => $league, + 't' => $type, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + case 'carryover': + + if ($type <> POINTS_PAID) + { + trigger_error($user->lang['NO_VALID_CALL'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $points_var .= 'CARRYOVER_PAY'; + $bet_points = $league_info['bet_points']; + $league_info_next = league_info($season + 1, $league); + if (sizeof($league_info_next) > 0) + { + $bet_points = $league_info_next['bet_points']; + } + + $mark_ary = $this->request->variable('mark', array(0)); + + if (sizeof($mark_ary) == 0) + { + trigger_error($user->lang['NO_MEMBERS_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $newvalue_ary = $this->request->variable('newvalue', array(0.00)); + if (sizeof($newvalue_ary) == 0) + { + for ($i = 0; $i < sizeof($mark_ary); $i++) + { + $newvalue_ary[] = 1.00 * str_replace (",", ".", $this->request->variable('newvalue' . $mark_ary[$i], '0.00')); + } + } + if (confirm_box(true)) + { + $count_updates = 0; + for ($i = 0; $i < sizeof($mark_ary); $i++) + { + $curr_user = $mark_ary[$i]; + $carryover = ($newvalue_ary[$i] >= $bet_points) ? $bet_points : $newvalue_ary[$i]; + if ($carryover > 0) + { + // Payout old season + $points_comment = sprintf($user->lang['CARRYOVER_NEW_SEASON']); + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'matchday' => (int) $matchday, + 'points_type' => POINTS_PAID, + 'user_id' => (int) $curr_user, + 'points' => round($carryover,2), + 'points_comment'=> $points_comment, + 'cash' => 1, + ); + $sql = 'INSERT INTO ' . FOOTB_POINTS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + + // Deposit new season + $points_comment = sprintf($user->lang['CARRYOVER_OLD_SEASON']); + $sql_ary = array( + 'season' => (int) $season + 1, + 'league' => (int) $league, + 'matchday' => 1, + 'points_type' => POINTS_DEPOSITED, + 'user_id' => (int) $curr_user, + 'points' => round($carryover,2), + 'points_comment'=> $points_comment, + 'cash' => 1, + ); + $sql = 'INSERT INTO ' . FOOTB_POINTS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + $count_updates++; + } + } + $back_link = $this->u_action . '&action=list&s=' . $season . '&l=' . $league . '&t=' . $type . '&start=' . $start; + trigger_error(sprintf($user->lang['LEAGUE_' . $points_var . ($count_updates == 1 ? '' : 'S')], $count_updates) . adm_back_link($back_link)); + } + else + { + confirm_box(false, sprintf($user->lang['CONFIRM_' . $points_var]), build_hidden_fields(array( + 'mark' => $mark_ary, + 'start' => $start, + 'newvalue' => $newvalue_ary, + 's' => $season, + 'l' => $league, + 'm' => $matchday, + 't' => $type, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + case 'list': + + if (!$league) + { + trigger_error($user->lang['NO_LEAGUE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $bet_points = $league_info['bet_points']; + + + switch ($type) + { + case POINTS_BET: + $page_type = sprintf($user->lang['DEBIT_BET']); + $page_type_explain = sprintf($user->lang['DEBIT_BET_EXPLAIN']); + $this->page_title = 'BET_POINTS'; + $target = sprintf($user->lang['BET_POINTS']); + $actual = sprintf($user->lang['BOOKED']); + $sum_target = "$bet_points AS target,"; + $sum_actual = 'SUM(IF(p.points_type = ' . POINTS_BET . ', p.points, 0.00)) AS actual,'; + $new_value = $bet_points . ' - SUM(IF(p.points_type = ' . POINTS_BET . ', p.points, 0.00)) AS new_value'; + $options = array('book' => 'BET', 'cancel' => 'CANCEL_BET'); + break; + case POINTS_DEPOSITED: + $page_type = sprintf($user->lang['BET_DEPOSIT']); + $page_type_explain = sprintf($user->lang['BET_DEPOSIT_EXPLAIN']); + $this->page_title = 'DEPOSITED'; + $target = sprintf($user->lang['BET_POINTS']); + $actual = sprintf($user->lang['DEPOSITED']); + $sum_target = "$bet_points AS target,"; + $sum_actual = 'SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', p.points, 0.00)) AS actual,'; + $new_value = 'IF(SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . ' ), p.points, p.points * -1.0)) > 0, + SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . ' ), p.points, p.points * -1.0)), 0.00) AS new_value'; + $options = array('book' => 'DEPOSITED', 'cancel' => 'CANCEL_DEPOSITED'); + break; + case POINTS_PAID: + $page_type = sprintf($user->lang['PAY_WINS']); + $page_type_explain = sprintf($user->lang['PAY_WINS_EXPLAIN']); + $this->page_title = 'PAID'; + $target = sprintf($user->lang['WINS']); + $actual = sprintf($user->lang['PAID']); + $sum_target = 'SUM(IF(p.points_type IN (' . + POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . + '), p.points, 0.00)) AS target,'; + $sum_actual = 'SUM(IF(p.points_type = ' . POINTS_PAID . ', p.points, 0.00)) AS actual,'; + $new_value = 'IF(SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . ' ), p.points * -1.0, p.points)) > 0, + SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . ' ), p.points * -1.0, p.points)), 0.00) AS new_value'; + $options = array('book' => 'PAID', 'cancel' => 'CANCEL_PAID', 'carryover' => 'CARRYOVER_PAID'); + break; + } + + // Total number of league members + $sql = 'SELECT + COUNT(DISTINCT user_id) AS total_members + FROM ' . FOOTB_BETS . " + WHERE season = $season + AND league = $league"; + $result = $db->sql_query($sql); + $total_members = (int) $db->sql_fetchfield('total_members'); + $db->sql_freeresult($result); + + $s_action_options = ''; + + foreach ($options as $option => $lang) + { + $s_action_options .= ''; + } + $curr_matchday = (curr_matchday($season, $league) > 0) ? curr_matchday($season, $league) : 1; + $matchday = ($type == 1) ? 1 : $curr_matchday; + + $base_url = $this->u_action . "&action=$action&s=$season&l=$league&m=$matchday&t=$type"; + $pagination = $phpbb_container->get('pagination'); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_members, $this->config['football_users_per_page'], $start); + + $template->assign_vars(array( + 'S_LIST' => true, + 'S_SEASON' => $season, + 'S_LEAGUE' => $league, + 'S_MATCHDAY' => $matchday, + 'S_START' => $start, + 'S_SELECT_MATCHDAY' => ($type == POINTS_BET) ? false : true, + 'S_TYPE' => $type, + 'S_ACTION_OPTIONS' => $s_action_options, + 'S_CASH_POINTS' => ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) ? true : false, + 'S_VERSION_NO' => $this->config['football_version'], + 'TOTAL_MEMBERS' => ($total_members == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_members), + 'PAGE_NUMBER' => $pagination->on_page($total_members, $this->config['football_users_per_page'], $start), + 'LEAGUE_NAME' => $league_info['league_name']. ' ' . $season_name, + 'PAGE_TYPE' => $page_type, + 'PAGE_TYPE_EXPLAIN' => $page_type_explain, + 'BET_POINTS' => $bet_points, + 'POINTS' => $this->config['points_name'], + 'TARGET' => $target, + 'ACTUAL' => $actual, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bank', 's' => $season, 'l' => $league)), + 'U_ACTION' => $this->u_action . "&s=$season&l=$league", + 'U_BACK' => $this->u_action. "&s=$season&l=$league", + ) + ); + + $user_points = ''; + if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $this->config['points_enable']) + { + $user_points = 'u.user_points,'; + } + else + { + $user_points = "0,00 AS user_points,"; + } + + // Grab the members + $sql = "SELECT + b.user_id, + u.username, + $user_points + $sum_target + $sum_actual + $new_value + FROM " . FOOTB_BETS . ' AS b + JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id) + LEFT JOIN ' . FOOTB_POINTS . " AS p ON (p.season = $season AND p.league = $league AND p.user_id = b.user_id) + WHERE b.season = $season + AND b.league = $league + AND b.match_no = 1 + GROUP BY b.user_id + ORDER BY u.username ASC"; + $result = $db->sql_query_limit($sql, $this->config['football_users_per_page'], $start); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('member', array( + 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"), + 'U_USER_BANK' => $helper->route('football_main_controller',array('side' => 'bank', 's' => $season, 'l' => $league, 'u' => $row['user_id'])), + 'USERNAME' => $row['username'], + 'POINTS' => $functions_points->number_format_points($row['user_points']), + 'TARGET' => $functions_points->number_format_points($row['target']), + 'ACTUAL' => $functions_points->number_format_points($row['actual']), + 'NEW_VALUE' => $functions_points->number_format_points($row['new_value']), + 'USER_ID' => $row['user_id'], + ) + ); + } + $db->sql_freeresult($result); + + return; + break; + } + + $options = array('bet' => 'BET', 'deposit' => 'DEPOSITED', 'delete_wins' => 'DELETE_WINS', 'pay' => 'PAID'); + $s_action_options = ''; + + foreach ($options as $option => $lang) + { + $s_action_options .= ''; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bank', 's' => $season)), + 'U_DLOAD_BANK_OPEN' => $helper->route('football_football_download',array('downside' => 'dload_bank_open', 's' => $season)), + 'S_SEASON' => $season, + 'S_LIST_DEPOSITED' => ($this->config['football_ult_points'] == UP_POINTS) ? false : true, + 'S_LIST_PAID' => ($this->config['football_ult_points'] == UP_POINTS) ? false : true, + 'S_SEASON_OPTIONS' => $season_options, + 'S_LEAGUE_ACTION_OPTIONS' => $s_action_options, + 'S_CASH_POINTS' => ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) ? true : false, + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + + // Get us all the league banks + $sql = 'SELECT + l.league, + l.league_name, + SUM(IF(p.points_type = ' . POINTS_BET . ', p.points, 0.00)) AS bet_points, + SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', p.points, 0.00)) AS deposited, + SUM(IF(p.points_type IN (' . + POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . + '), p.points, 0.00)) AS wins, + SUM(IF(p.points_type = ' . POINTS_PAID . ', p.points, 0.00)) AS paid + FROM ' . FOOTB_LEAGUES . ' AS l + LEFT JOIN ' . FOOTB_POINTS . " AS p ON (p.season = $season AND p.league = l.league) + WHERE l.season = $season + GROUP BY l.league + ORDER BY league ASC"; + $result = $db->sql_query($sql); + $rows_leagues = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + $row_number = 0; + foreach ($rows_leagues as $row_league) + { + $template->assign_block_vars('leagues', array( + 'LEAGUE' => $row_league['league'], + 'LEAGUE_NAME' => $row_league['league_name'], + 'BET_POINTS' => $functions_points->number_format_points($row_league['bet_points']), + 'DEPOSITED' => $functions_points->number_format_points($row_league['deposited']), + 'WINS' => $functions_points->number_format_points($row_league['wins']), + 'PAID' => $functions_points->number_format_points($row_league['paid']), + 'U_LIST_BET_POINTS' => "{$this->u_action}&action=list&s=" . $season . "&l=" .$row_league['league'] . "&t=1", + 'U_LIST_DEPOSITED' => "{$this->u_action}&action=list&s=" . $season . "&l=" .$row_league['league'] . "&t=2", + 'U_LIST_WINS' => "{$this->u_action}&action=list&s=" . $season . "&l=" .$row_league['league'] . "&t=3", + 'U_LIST_PAID' => "{$this->u_action}&action=list&s=" . $season . "&l=" .$row_league['league'] . "&t=7", + 'U_DLOAD_BANK' => $helper->route('football_football_download', array('downside' => 'dload_bank', 's' => $season, 'l' => $row_league['league'])), + ) + ); + } + } +} + +?> \ No newline at end of file diff --git a/acp/bets_info.php b/acp/bets_info.php new file mode 100644 index 0000000..b04da6c --- /dev/null +++ b/acp/bets_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\bets_module', + 'title' => 'ACP_FOOTBALL_BETS_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_BETS_MANAGE', 'auth' => 'acl_a_football_editbets', 'cat' => array('ACP_FOOTBALL_BETS')), + ), + ); + } +} diff --git a/acp/bets_module.php b/acp/bets_module.php new file mode 100644 index 0000000..164b3e4 --- /dev/null +++ b/acp/bets_module.php @@ -0,0 +1,753 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_bets'); + + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $this->ext_football_path = $phpbb_root_path . 'ext/football/football/'; + if(!function_exists('season_info')) + { + include($this->ext_football_path . 'includes/functions.' . $phpEx); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->ext_football_path . 'includes/constants.' . $phpEx); + } + + + if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) + { + //$this->user->add_lang_ext('football/football', 'modules/points'); + // Get an instance of the ultimatepoints functions_points + $functions_points = $phpbb_container->get('dmzx.ultimatepoints.core.functions.points'); + } + + $this->tpl_name = 'acp_football_bets'; + $this->page_title = 'ACP_FOOTBALL_BETS_MANAGE'; + + $form_key = 'acp_football_bets'; + add_form_key($form_key); + + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + + // Check and set some common vars + $action = (isset($_POST['bet'])) ? 'bet' : $this->request->variable('action', ''); + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $matchday = $this->request->variable('m', 0); + $user_id = $this->request->variable('u', 0); + + // Clear some vars + $success = array(); + + // Grab current season + $curr_season = curr_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 .= ''; + 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 = current_league($season); + } + + // 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 .= ''; + if ($selected <> '') + { + $league_matchdays = $row['matchdays']; + $matches_matchday = $row['matches_on_matchday']; + $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 basic data for select matchday + if (!$matchday) + { + $matchday = curr_matchday($season, $league); + } + $sql = 'SELECT * + FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + + $matchday_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($matchday && $row['matchday'] == $matchday) ? ' selected="selected"' : ''; + $day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']); + $matchday_options .= ''; + if ($selected <> '') + { + $matchday_name = $day_name; + if ($matches_matchday) + { + $matches_on_matchday = $matches_matchday; + } + else + { + $matches_on_matchday = $row['matches']; + } + } + } + $db->sql_freeresult($result); + if ($matchday_options == '') + { + trigger_error(sprintf($user->lang['NO_MATCHDAY'], $league_name, $season) . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING); + } + + // Grab basic data for select user + if (!$user_id) + { + if (user_is_member($user->data['user_id'], $season, $league)) + { + $user_id = $user->data['user_id']; + } + } + $user_options = ''; + $sql = 'SELECT + DISTINCT u.user_id, + u.username + FROM ' . FOOTB_BETS . ' AS w + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = w.user_id) + WHERE season = $season + AND league = $league + ORDER BY LOWER(u.username) ASC"; + + $result = $db->sql_query($sql); + while( $row = $db->sql_fetchrow($result)) + { + if (!$user_id) + { + $selected = ' selected="selected"'; + $user_id = $row['user_id']; + + } + else + { + $selected = ($user_id && $row['user_id'] == $user_id) ? ' selected="selected"' : ''; + } + $user_options .= ''; + if ($selected <> '') + { + $user_name = $row['username']; + } + } + $db->sql_freeresult($result); + + switch($action) + { + case 'bet': + { + if ($season < $curr_season) + { + trigger_error("Diese Saison kann nicht mehr gespeichert werden!", E_USER_WARNING); + } + $sqlopen = 'SELECT * + FROM ' . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND matchday = $matchday"; + $resultopen = $db->sql_query($sqlopen); + $count_matches = 0; + $count_updates = 0; + while( $row = $db->sql_fetchrow($resultopen)) + { + $match_no = $row['match_no']; + $goalsh = $this->request->variable('goalsh' . $match_no, 'nv'); + $goalsg = $this->request->variable('goalsg' . $match_no, 'nv'); + if ($goalsh != 'nv' AND $goalsg != 'nv') + { + if(($goalsh != '') AND ($goalsg != '')) + { + if(is_numeric($goalsh) AND is_numeric($goalsg) AND $goalsh >= 0 AND $goalsg >= 0) + { + if (0 == $count_matches) + { + $sameh = $goalsh; + $sameg = $goalsg; + $same = 1; + } + else + { + if ($goalsh != $sameh OR $goalsg != $sameg) + $same = 0; + } + $sql = 'SELECT * + FROM ' . FOOTB_BETS . " + WHERE season = $season + AND league = $league + AND match_no = $match_no + AND user_id = $user_id"; + $result = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + if(!$row2) + { + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'match_no' => (int) $match_no, + 'user_id' => (int) $user_id, + 'goals_home' => (int) $goalsh, + 'goals_guest' => (int) $goalsg, + 'bet_time' => time(), + ); + $sql = 'INSERT INTO ' . FOOTB_BETS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + $count_updates++; + } + else + { + if($row2['goals_home'] != $goalsh OR $row2['goals_guest'] != $goalsg) + { + $sql_ary = array( + 'goals_home' => (int) $goalsh, + 'goals_guest' => (int) $goalsg, + 'bet_time' => time(), + ); + $sql = 'UPDATE ' . FOOTB_BETS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season + AND league = $league + AND match_no = $match_no + AND user_id = $user_id"; + $db->sql_query($sql); + $count_updates++; + } + } + $count_matches++; + $lastmatch_no = $match_no; + } + } + else + { + // Goals unset + $sql_ary = array( + 'goals_home' => '', + 'goals_guest' => '', + 'bet_time' => time(), + ); + $sql = 'UPDATE ' . FOOTB_BETS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season + AND league = $league + AND match_no = $match_no + AND user_id = $user_id"; + $db->sql_query($sql); + } + } + } + if ($count_updates > 0) + { + if ($same AND ($count_matches > 6) AND $this->config['football_same_allowed'] == 0) + { + $sql_ary = array( + 'goals_home' => (int) $goalsh + 1, + 'bet_time' => time(), + ); + $sql = 'UPDATE ' . FOOTB_BETS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season + AND league = $league + AND match_no = $lastmatch_no + AND user_id = $user_id"; + $db->sql_query($sql); + $success[] = sprintf($user->lang['SAMESAVED'], $count_updates); + } + else + { + if ($count_updates == 1) + { + $success[] = sprintf($user->lang['BETSAVED']); + } + else + { + $success[] = sprintf($user->lang['BETSSAVED'], $count_updates); + } + } + } + else + { + $success[] = sprintf($user->lang['NO_BETS_SAVED']); + } + $db->sql_freeresult($resultopen); + + // extra bets + $sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND matchday = $matchday"; + $resultextra = $db->sql_query($sql); + $count_extra_updates = 0; + while( $row = $db->sql_fetchrow($resultextra)) + { + $extra_no = $row['extra_no']; + $extra_bet = $this->request->variable('extra' . $extra_no, 'nv'); + if ($extra_bet != 'nv') + { + if ($row['question_type'] == 5 && !is_numeric($extra_bet)) + { + $extra_bet = ''; + } + if ($extra_bet != '') + { + $sql = 'SELECT * FROM ' . FOOTB_EXTRA_BETS . " WHERE season = $season AND league = $league AND extra_no = $extra_no and user_id = $user_id"; + $result = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + if(!$row2) + { + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'extra_no' => (int) $extra_no, + 'user_id' => (int) $user_id, + 'bet' => $extra_bet, + 'bet_points' => 0, + ); + $sql = 'INSERT INTO ' . FOOTB_EXTRA_BETS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + else + { + $sql_ary = array( + 'bet' => $extra_bet, + ); + $sql = 'UPDATE ' . FOOTB_EXTRA_BETS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND extra_no = $extra_no AND user_id = $user_id"; + $db->sql_query($sql); + } + $count_extra_updates++; + } + else + { + // extra bet unset + $sql_ary = array( + 'bet' => '', + ); + $sql = 'UPDATE ' . FOOTB_EXTRA_BETS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND extra_no = $extra_no AND user_id = $user_id"; + $db->sql_query($sql); + } + } + } + if ($count_extra_updates) + { + $success[] = sprintf($user->lang['EXTRA_BET' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates); + } + $league_info = league_info($season, $league); + $cash = $this->request->variable('cash', false); + save_ranking_matchday($season, $league, $matchday, $cash); + } + break; + } + + $data_group = false; + $matchnumber = 0; + $lang_dates = $user->lang['datetime']; + + // Calculate matches and bets of matchday + $sql = "SELECT + s.league, + s.match_no, + s.matchday, + s.status, + s.group_id, + s.formula_home, + s.formula_guest, + v1.team_symbol AS logo_home, + v2.team_symbol AS logo_guest, + v1.team_id AS hid, + v2.team_id AS gid, + v1.team_name AS hname, + v2.team_name AS gname, + w.bet_time, + w.goals_home AS bet_home, + w.goals_guest AS bet_guest, + s.goals_home, + s.goals_guest, + CONCAT( + CASE DATE_FORMAT(s.match_datetime,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(s.match_datetime,' %d.%m. %H:%i') + ) AS match_time + FROM " . FOOTB_MATCHES . ' AS s + INNER JOIN ' . FOOTB_BETS . " AS w ON (w.season = s.season AND w.league = s.league AND w.match_no = s.match_no AND w.user_id = $user_id) + LEFT JOIN " . FOOTB_TEAMS . ' AS v1 ON (v1.season = s.season AND v1.league = s.league AND v1.team_id = s.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS v2 ON (v2.season = s.season AND v2.league = s.league AND v2.team_id = s.team_id_guest) + WHERE s.season = $season + AND s.league = $league + AND s.matchday = $matchday + GROUP BY s.match_no + ORDER BY s.match_datetime ASC, s.match_no ASC"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $matchnumber++ ; + $class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $display_link = true; + + if (0 == $row['hid']) + { + $display_link = false; + $home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']); + $home_in_array = explode("#",$home_info); + $homelogo = $home_in_array[0]; + $homeid = $home_in_array[1]; + $homename = $home_in_array[2]; + } + else + { + $homelogo = $row['logo_home']; + $homeid = $row['hid']; + $homename = $row['hname']; + } + + if (0 == $row['gid']) + { + $display_link = false; + $guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']); + $guest_in_array = explode("#",$guest_info); + $guestlogo = $guest_in_array[0]; + $guestid = $guest_in_array[1]; + $guestname = $guest_in_array[2]; + } + else + { + $guestlogo = $row['logo_guest']; + $guestid = $row['gid']; + $guestname = $row['gname']; + } + + if ($homelogo <> '') + { + $logoH = "ext_football_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ; + } + else + { + $logoH = "ext_football_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; + } + + if ($guestlogo <> '') + { + $logoG = "ext_football_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ; + } + else + { + $logoG = "ext_football_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; + } + + if ($row['status'] == -1) + { + $delivertag = "*"; + } + else + { + if ($row['status'] == -2) + { + $delivertag = "**"; + } + else + { + $delivertag = ''; + } + } + + if ($row['group_id'] == '') + { + $group_id = ' '; + } + else + { + $data_group = true; + $group_id = $row['group_id']; + } + + $template->assign_block_vars('bet_edit', array( + 'ROW_CLASS' => $class, + 'LEAGUE_ID' => $row['league'], + 'MATCH_NUMBER' => $row['match_no'], + 'MATCHDAY' => $row['matchday'], + 'STATUS' => $row['status'], + 'MATCH_TIME' => $row['match_time'], + 'GROUP' => $group_id, + 'HOME_ID' => $homeid, + 'GUEST_ID' => $guestid, + 'LOGO_HOME' => $logoH, + 'LOGO_GUEST' => $logoG, + 'HOME_NAME' => $homename, + 'GUEST_NAME' => $guestname, + 'BET_HOME' => $row['bet_home'], + 'BET_GUEST' => $row['bet_guest'], + 'DELIVERTAG' => $delivertag, + 'GOALS_HOME' => ($row['goals_home'] == '') ? ' ' : $row['goals_home'], + 'GOALS_GUEST' => ($row['goals_guest'] == '') ? ' ' : $row['goals_guest'], + 'BET_TIME' => ($row['bet_time'] == 0) ? '' : $user->format_date($row['bet_time']), + 'DISPLAY_LINK' => $display_link, + ) + ); + } + + // Calculate extra bets of matchday + // Start select team + $sql = 'SELECT + team_id AS option_value, + team_name AS option_name + FROM ' . FOOTB_TEAMS . " + WHERE season = $season + AND league = $league + ORDER BY team_name ASC"; + $result = $db->sql_query($sql); + $option_rows = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + $sql = "SELECT e.*, + eb.bet, + eb.bet_points, + t1.team_name AS result_team, + t2.team_name AS bet_team + FROM " . FOOTB_EXTRA . ' AS e + LEFT JOIN ' . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = e.season AND eb.league = e.league AND eb.extra_no = e.extra_no AND eb.user_id = $user_id) + LEFT JOIN " . FOOTB_TEAMS . ' AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = e.season AND t2.league = e.league AND t2.team_id = eb.bet) + WHERE e.season = $season + AND e.league = $league + AND e.matchday = $matchday + ORDER BY e.extra_no ASC"; + $result = $db->sql_query($sql); + + $extra_bet = false; + $extra_edit = false; + $extra_results = false; + $extranumber = 0; + + while ($row = $db->sql_fetchrow($result)) + { + $extra_bet = true; + $extranumber++ ; + $row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + + switch($row['question_type']) + { + case '1': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '2': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '3': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '4': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '5': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']); + } + break; + default : + { + $display_type = 2; + $eval_title = ''; + } + break; + } + + // edit extra bets + $extra_edit = true; + $bet_extra = ($row['bet_team'] == NULL) ? '' : $row['bet_team']; + + switch($row['question_type']) + { + case '3': + case '4': + { + $option_arr = array(); + for ($i = 65; $i <= 72; $i++) + { + if (strstr($row['question'], chr($i) . ':')) + { + $option_arr[] = array( + 'option_value' => chr($i), + 'option_name' => chr($i), + ); + } + } + if ( sizeof($option_arr) > 1 ) + { + $display_type = 1; + $option_rows = $option_arr; + $bet_extra = $row['bet']; + } + } + break; + } + + $template->assign_block_vars('extra_edit', array( + 'ROW_CLASS' => $row_class, + 'EXTRA_NO' => $row['extra_no'], + 'QUESTION' => $row['question'], + 'EXTRA_POINTS' => $row['extra_points'], + 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), + 'EVALUATION_TITLE' => $eval_title, + 'BET' => ($display_type == 1) ? $bet_extra : $row['bet'], + 'S_DISPLAY_TYPE' => $display_type, + ) + ); + + if ($display_type == 1) + { + $selected = ($row['bet'] == '') ? ' selected="selected"' : ''; + + $template->assign_block_vars('extra_edit.extra_option', array( + 'OPTION_VALUE' => '', + 'OPTION_NAME' => sprintf($user->lang['SELECT']), + 'S_SELECTED' => $selected)); + + foreach ($option_rows as $option_row) + { + $selected = ($row['bet'] && $option_row['option_value'] == $row['bet']) ? ' selected="selected"' : ''; + $template->assign_block_vars('extra_edit.extra_option', array( + 'OPTION_VALUE' => $option_row['option_value'], + 'OPTION_NAME' => $option_row['option_name'], + 'S_SELECTED' => $selected)); + } + } + } + $db->sql_freeresult($result); + + $legend = delivery($season, $league, $matchday); + + $template->assign_vars(array( + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'S_LEGEND' => $legend, + 'S_SUCCESS' => (sizeof($success)) ? true : false, + 'SUCCESS_MSG' => (sizeof($success)) ? implode('
', $success) : '', + 'S_CASH_POINTS' => ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) ? true : false, + 'S_SEASON' => $season, + 'S_LEAGUE' => $league, + 'S_MATCHDAY' => $matchday, + 'S_USER' => $user_id, + 'S_SEASON_OPTIONS' => $season_options, + 'S_LEAGUE_OPTIONS' => $league_options, + 'S_MATCHDAY_OPTIONS' => $matchday_options, + 'S_USER_OPTIONS' => $user_options, + 'S_USERS' => ($user_options == '') ? false : true, + 'S_EXTRA_BET' => $extra_bet, + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + } +} +?> \ No newline at end of file diff --git a/acp/extra_info.php b/acp/extra_info.php new file mode 100644 index 0000000..2be5d55 --- /dev/null +++ b/acp/extra_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\extra_module', + 'title' => 'ACP_FOOTBALL_EXTRA_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_EXTRA_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_EXTRA')), + ), + ); + } +} diff --git a/acp/extra_module.php b/acp/extra_module.php new file mode 100644 index 0000000..627d6b2 --- /dev/null +++ b/acp/extra_module.php @@ -0,0 +1,463 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_extra'); + + $this->root_path = $phpbb_root_path . 'ext/football/football/'; + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + + if(!function_exists('season_info')) + { + include($this->root_path . 'includes/functions.' . $this->php_ext); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->root_path . 'includes/constants.' . $this->php_ext); + } + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $this->tpl_name = 'acp_football_extra'; + $this->page_title = 'ACP_FOOTBALL_EXTRA_MANAGE'; + + $form_key = 'acp_football_extra'; + add_form_key($form_key); + + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + + // Check and set some common vars + $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['remove'])) ? 'remove' : $this->request->variable('action', '')); + $edit = $this->request->variable('edit', 0); + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $matchday = $this->request->variable('matchday', 0); + $matchday_eval = $this->request->variable('matchday_eval', 0); + $extra_no = $this->request->variable('e', 0); + $update = (isset($_POST['update'])) ? true : false; + + // Clear some vars + $extra_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 .= ''; + 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 .= ''; + 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 basic data for extra bets, if extra bet is set and exists + if ($extra_no) + { + $sql = 'SELECT * + FROM ' . FOOTB_EXTRA . " + WHERE season = $season + AND league = $league + AND extra_no = $extra_no"; + $result = $db->sql_query($sql); + $extra_row = $db->sql_fetchrow($result); + $existing_extra = sizeof($extra_row); + $db->sql_freeresult($result); + } + + $db->sql_freeresult($result); + + // 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 (!$extra_no) + { + trigger_error($user->lang['NO_EXTRA'] . 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 && $this->config['football_founder_delete']) + { + trigger_error($user->lang['EXTRA_NO_DELETE'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING); + } + + // Delete extra + $sql = 'DELETE FROM ' . FOOTB_EXTRA . " + WHERE season = $season AND league = $league AND extra_no = $extra_no"; + $db->sql_query($sql); + + // Delete extra bets + $sql = 'DELETE FROM ' . FOOTB_EXTRA_BETS . " + WHERE season = $season + AND league = $league + AND extra_no = $extra_no"; + $db->sql_query($sql); + + trigger_error($user->lang['EXTRA_DELETED'] . adm_back_link($this->u_action . "&s=$season&l=$league")); + } + else + { + confirm_box(false, sprintf($user->lang['EXTRA_CONFIRM_DELETE'], $extra_row['question'], $league, $season), build_hidden_fields(array( + 's' => $season, + 'l' => $league, + 'e' => $extra_no, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + + case 'add': + $sql = "SELECT + max(extra_no) AS max_extra_no + FROM " . FOOTB_EXTRA . " + WHERE season = $season + AND league = $league"; + $result = $db->sql_query($sql); + $row_extra = $db->sql_fetchrow($result); + $existing_extra = sizeof($row_extra); + $db->sql_freeresult($result); + $extra_no = ($existing_extra) ? $row_extra['max_extra_no'] + 1 : 1; + $extra_row['extra_no'] = $extra_no; + $extra_row['question_type'] = $this->request->variable('question_type', 3); + $extra_row['question'] = utf8_normalize_nfc($this->request->variable('question', '', true)); + $extra_row['matchday'] = $this->request->variable('matchday', 0); + $extra_row['matchday_eval'] = $this->request->variable('matchday_eval', 0); + $extra_row['result'] = utf8_normalize_nfc($this->request->variable('result', '')); + $extra_row['extra_points'] = $this->request->variable('extra_points', 0); + $extra_row['extra_status'] = $this->request->variable('extra_status', 0); + // No break for edit add + case 'edit': + $error_msg = array(); + + if (!sizeof($error)) + { + if ($action == 'edit' && !$extra_no) + { + trigger_error($user->lang['NO_EXTRA'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING); + } + + $matchday = $extra_row['matchday']; + $matchday_eval = $extra_row['matchday_eval']; + + $sql = 'SELECT * + FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + + $matchday_options = ''; + $matchday_eval_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + if ($row['status'] == 0 or $action == 'edit') + { + $selected_matchday = ($matchday && $row['matchday'] == $matchday) ? ' selected="selected"' : ''; + $selected_eval = ($matchday_eval && $row['matchday'] == $matchday_eval) ? ' selected="selected"' : ''; + $day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']); + $matchday_options .= ''; + $matchday_eval_options .= ''; + } + } + + $question_type_options = ''; + for($i = 1; $i<= 5; $i++) + { + $selected = ($i == $extra_row['question_type']) ? ' selected="selected"' : ''; + $question_type_options .= ''; + } + + $extra_status_options = ''; + for($i = 0; $i<= 3; $i++) + { + $selected = ($i == $extra_row['extra_status']) ? ' selected="selected"' : ''; + $extra_status_options .= ''; + } + + + // Did we submit? + if ($update) + { + $data = array(); + 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); + } + $extra_row['extra_no'] = $extra_no; + $extra_row['question_type'] = $this->request->variable('question_type', $extra_row['question_type']); + $extra_row['question'] = $this->request->variable('question', $extra_row['question'], true); + $extra_row['matchday'] = $this->request->variable('matchday', $extra_row['matchday']); + $extra_row['matchday_eval'] = $this->request->variable('matchday_eval', $extra_row['matchday_eval']); + $extra_row['extra_points'] = $this->request->variable('extra_points', $extra_row['extra_points']); + $extra_row['extra_status'] = $this->request->variable('extra_status', $extra_row['extra_status']); + + $data['extra_points'] = (int) $extra_row['extra_points']; + $data['matchday'] = (int) $extra_row['matchday']; + $data['matchday_eval'] = (int) $extra_row['matchday_eval']; + + if ($data['matchday_eval'] < $data['matchday']) + { + $error[] = $user->lang['EVAL_BEFORE_DELIVERY']; + } + + + if (!sizeof($error)) + { + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'extra_no' => (int) $extra_no, + 'question_type' => (int) $extra_row['question_type'], + 'question' => strlen($extra_row['question']) ? $extra_row['question'] : '', + 'matchday' => (int) $extra_row['matchday'], + 'matchday_eval' => (int) $extra_row['matchday_eval'], + 'result' => $extra_row['result'], + 'extra_points' => (int) $extra_row['extra_points'], + 'extra_status' => (int) $extra_row['extra_status'], + ); + + $var_ary = array( + 'extra_points' => array('num', false, 0, 99), + 'matchday' => array('num', false, 1), + 'matchday_eval' => array('num', false, 1), + ); + if (!($error_vals = validate_data($data, $var_ary))) + { + if ($action == 'add') + { + $sql = 'INSERT INTO ' . FOOTB_EXTRA . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + else + { + $sql = 'UPDATE ' . FOOTB_EXTRA . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND extra_no = $extra_no"; + $db->sql_query($sql); + } + trigger_error($user->lang['EXTRA_UPDATED'] . adm_back_link($this->u_action . "&s=$season&l=$league")); + } + else + { + foreach ($error_vals as $error_val) + { + $error_msg[] = $user->lang[$error_val]; + } + $error[] = $user->lang['EXTRA_UPDATE_FAILED']; + $error = array_merge($error, $error_msg); + } + } + } + } + + $u_back = $this->u_action . "&s=$season&l=$league"; + + $template->assign_vars(array( + 'S_EDIT' => true, + 'S_ADD_EXTRA' => ($action == 'add') ? true : false, + 'S_ERROR' => (sizeof($error)) ? true : false, + 'S_EDIT_EXTRAS' => ($existing_extra) ? false : true, + 'S_QUESTION_TYPE_OPTIONS' => $question_type_options, + 'S_MATCHDAY_OPTIONS' => $matchday_options, + 'S_MATCHDAY_EVAL_OPTIONS' => $matchday_eval_options, + 'S_EXTRA_STATUS_OPTIONS' => $extra_status_options, + 'S_VERSION_NO' => $this->config['football_version'], + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + 'SEASON' => $season, + 'SEASON_NAME' => $season_name, + 'LEAGUE' => $league, + 'LEAGUE_NAME' => $league_name, + 'EXTRA_NO' => $extra_no, + 'QUESTION_TYPE' => $extra_row['question_type'], + 'QUESTION' => $extra_row['question'], + 'MATCHDAY' => $extra_row['matchday'], + 'MATCHDAY_EVAL' => $extra_row['matchday_eval'], + 'MATCHDAY_OPTION' => $extra_row['matchday'], + 'MATCHDAY_EVAL' => $extra_row['matchday_eval'], + 'RESULT' => $extra_row['result'], + 'EXTRA_POINTS' => $extra_row['extra_points'], + 'EXTRA_STATUS' => $extra_row['extra_status'], + 'U_BACK' => $u_back, + 'U_ACTION' => "{$this->u_action}&action=$action&s=$season&l=$league", + ) + ); + return; + break; + } + + // Check open matchday in league + $sql = 'SELECT * + FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + AND status <= 0"; + $result = $db->sql_query($sql); + $open_matchdays = sizeof($db->sql_fetchrowset($result)); + $db->sql_freeresult($result); + + // Get us all the extra + $sql = "SELECT e.*, + m1.matchday_name AS matchday_name, + m2.matchday_name AS matchday_eval_name + FROM " . FOOTB_EXTRA . ' AS e + LEFT JOIN ' . FOOTB_MATCHDAYS . ' AS m1 ON (m1.season = e.season AND m1.league = e.league AND m1.matchday = e.matchday) + LEFT JOIN ' . FOOTB_MATCHDAYS . " AS m2 ON (m2.season = e.season AND m2.league = e.league AND m2.matchday = e.matchday_eval) + WHERE e.season = $season + AND e.league = $league + ORDER BY e.extra_no ASC"; + $result = $db->sql_query($sql); + $rows_extra = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), + 'S_SEASON' => $season, + 'S_LEAGUE' => $league, + 'S_SEASON_OPTIONS' => $season_options, + 'S_LEAGUE_OPTIONS' => $league_options, + 'S_EXTRA_ADD' => ($open_matchdays) ? true : false, + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + + // Check if the user is allowed to delete a extra. + if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) + { + $allow_delete = false; + } + else + { + $allow_delete = true; + } + + $row_number = 0; + foreach ($rows_extra as $row_extra) + { + $row_number++; + $row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('extras', array( + 'ROW_CLASS' => $row_class, + 'EXTRA_NO' => $row_extra['extra_no'], + 'QUESTION_TYPE' => $row_extra['question_type'], + 'QUESTION' => $row_extra['question'], + 'MATCHDAY' => (strlen($row_extra['matchday_name']) > 0) ? $row_extra['matchday_name'] : $row_extra['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']), + 'MATCHDAY_EVAL' => (strlen($row_extra['matchday_name']) > 0) ? $row_extra['matchday_eval_name'] : $row_extra['matchday_eval'] . '. ' . sprintf($user->lang['MATCHDAY']), + 'EXTRA_POINTS' => $row_extra['extra_points'], + 'EXTRA_STATUS' => $row_extra['extra_status'], + 'U_EDIT' => "{$this->u_action}&action=edit&s=" . $season . "&l=" .$league . "&e=" .$row_extra['extra_no'], + 'U_DELETE' => ($allow_delete) ? "{$this->u_action}&action=delete&s=" . $season . "&l=" . $league . "&e=" . $row_extra['extra_no'] : '', + ) + ); + } + } +} +?> \ No newline at end of file diff --git a/acp/football_info.php b/acp/football_info.php new file mode 100644 index 0000000..cdf4b54 --- /dev/null +++ b/acp/football_info.php @@ -0,0 +1,28 @@ + '\football\football\acp\football_module', + 'title' => 'ACP_FOOTBALL_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'settings' => array('title' => 'ACP_FOOTBALL_SETTINGS', 'auth' => 'acl_a_football_config', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')), + 'features' => array('title' => 'ACP_FOOTBALL_FEATURES', 'auth' => 'acl_a_football_config', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')), + 'menu' => array('title' => 'ACP_FOOTBALL_MENU', 'auth' => 'acl_a_football_config', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')), + 'userguide' => array('title' => 'ACP_FOOTBALL_USERGUIDE','auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')), + ), + ); + } +} diff --git a/acp/football_module.php b/acp/football_module.php new file mode 100644 index 0000000..3179038 --- /dev/null +++ b/acp/football_module.php @@ -0,0 +1,426 @@ +add_lang_ext('football/football', 'help_football'); + $user->add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_football'); + + $this->root_path = $phpbb_root_path . 'ext/football/football/'; + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + $this->phpbb_container = $phpbb_container; + $this->version_check = $this->phpbb_container->get('football.football.version.check'); + + if(!function_exists('season_info')) + { + include($this->root_path . 'includes/functions.' . $this->php_ext); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->root_path . 'includes/constants.' . $this->php_ext); + } + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $phpbb_log; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $user->add_lang('acp/board'); + + $action = $this->request->variable('action', ''); + $submit = (isset($_POST['submit'])) ? true : false; + + $form_key = 'acp_football'; + add_form_key($form_key); + + switch ($mode) + { + case 'userguide': + $this->page_title = 'ACP_FOOTBALL_USERGUIDE'; + $this->tpl_name = 'acp_football_userguide'; + + $template->assign_vars(array( + 'S_IN_FOOTBALL_USERGUIDE' => true, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet')), + 'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'], + 'ICON_BACK_TO_TOP' => '' . $user->lang['BACK_TO_TOP'] . '', + 'S_VERSION_NO' => $this->config['football_version'], + )); + + // Pull the array data from the lang pack + foreach ($user->help as $help_ary) + { + if ($help_ary[0] == '--') + { + $template->assign_block_vars('userguide_block', array( + 'BLOCK_TITLE' => $help_ary[1]) + ); + + continue; + } + + $template->assign_block_vars('userguide_block.userguide_row', array( + 'USERGUIDE_QUESTION' => $help_ary[0], + 'USERGUIDE_ANSWER' => $help_ary[1]) + ); + } + return; + break; + case 'settings': + $display_vars = array( + 'title' => 'ACP_FOOTBALL_SETTINGS', + 'vars' => array( + 'legend1' => 'ACP_FOOTBALL_SETTINGS', + 'football_name' => array('lang' => 'FOOTBALL_NAME', 'validate' => 'string', 'type' => 'text:25:25', 'explain' => true), + 'football_disable' => array('lang' => 'DISABLE_FOOTBALL', 'validate' => 'bool', 'type' => 'custom', 'method' => 'football_disable', 'explain' => true), + 'football_disable_msg' => false, + 'football_fullscreen' => array('lang' => 'FOOTBALL_FULLSCREEN','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_header_enable' => array('lang' => 'FOOTBALL_HEADER_ENABLE','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_guest_view' => array('lang' => 'GUEST_VIEW', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_user_view' => array('lang' => 'USER_VIEW', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_host_timezone' => array('lang' => 'HOST_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'phpbb_timezone_select', 'params' => array($template, $user, '{CONFIG_VALUE}', true), 'explain' => true), + 'football_info_display' => array('lang' => 'FOOTBALL_INFO', 'validate' => 'bool', 'type' => 'custom', 'method' => 'football_info', 'explain' => true), + 'football_info' => false, + 'football_win_name' => array('lang' => 'WIN_NAME', 'validate' => 'string', 'type' => 'text:6:6', 'explain' => true), + 'football_code' => array('lang' => 'FOOTBALL_CODE', 'validate' => 'string', 'type' => 'text:25:25', 'explain' => true), + 'football_style' => array('lang' => 'FOOTBALL_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false), + 'football_override_style' => array('lang' => 'FOOTBALL_OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_update_source' => array('lang' => 'FOOTBALL_UPDATE_SOURCE', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => true), + 'football_update_code' => array('lang' => 'FOOTBALL_UPDATE_CODE', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true), + + 'legend2' => 'GENERAL_SETTINGS', + 'football_left_column_width' => array('lang' => 'LEFT_COLUMN', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'football_right_column_width' => array('lang' => 'RIGHT_COLUMN', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'football_display_ranks' => array('lang' => 'DISPLAY_RANKS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'football_users_per_page' => array('lang' => 'USERS_PAGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + + 'legend3' => 'ACP_SUBMIT_CHANGES', + ) + ); + // show the extension version check on Settings page + $this->version_check->check(); + break; + + case 'features': + $display_vars = array( + 'title' => 'ACP_FOOTBALL_FEATURES', + 'vars' => array( + 'legend1' => 'ACP_FOOTBALL_FEATURES', + 'football_founder_delete' => array('lang' => 'FOUNDER_DELETE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_results_at_time' => array('lang' => 'RESULTS_AT_TIME', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_win_hits02' => array('lang' => 'WIN_HITS02', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_same_allowed' => array('lang' => 'SAME_ALLOWED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_season_start' => array('lang' => 'FOOTBALL_SEASON_START', 'validate' => 'int', 'type' => 'select', 'method' => 'season_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true), + 'football_view_current' => array('lang' => 'VIEW_CURRENT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_view_bets' => array('lang' => 'VIEW_BETS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_view_tendencies' => array('lang' => 'VIEW_TENDENCIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_bank' => array('lang' => 'BANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_ult_points' => array('lang' => 'ULT_POINTS', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_up_method', 'explain' => true), + 'football_ult_points_factor'=> array('lang' => 'ULT_POINTS_FACTOR', 'validate' => 'dec:3:2','type' => 'text:4:10', 'explain' => true), + 'football_remember_enable' => array('lang' => 'FOOTBALL_REMEMBER_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_remember_next_run'=> array('lang' => 'FOOTBALL_REMEMBER_NEXT_RUN','validate' => 'int', 'type' => 'custom', 'method' => 'next_run', 'explain' => true), + + 'legend2' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + case 'menu': + $display_vars = array( + 'title' => 'ACP_FOOTBALL_MENU', + 'vars' => array( + 'legend1' => 'ACP_FOOTBALL_MENU', + 'football_breadcrumb' => array('lang' => 'FOOTBALL_BREADCRUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_side' => array('lang' => 'FOOTBALL_SIDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_menu' => array('lang' => 'FOOTBALL_MENU', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'football_menu_link1' => array('lang' => 'MENU_LINK1', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => true), + 'football_menu_desc1' => array('lang' => 'MENU_DESC1', 'validate' => 'string', 'type' => 'text:20:20', 'explain' => true), + 'football_menu_link2' => array('lang' => 'MENU_LINK2', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => false), + 'football_menu_desc2' => array('lang' => 'MENU_DESC2', 'validate' => 'string', 'type' => 'text:20:20', 'explain' => false), + 'football_menu_link3' => array('lang' => 'MENU_LINK3', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => false), + 'football_menu_desc3' => array('lang' => 'MENU_DESC3', 'validate' => 'string', 'type' => 'text:20:20', 'explain' => false), + ) + ); + break; + + default: + trigger_error('NO_MODE', E_USER_ERROR); + break; + } + + if (isset($display_vars['lang'])) + { + $user->add_lang($display_vars['lang']); + } + + $this->new_config = $this->config; + $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc($this->request->variable('config', array('' => ''), true)) : $this->new_config; + $error = array(); + + // We validate the complete config if whished + validate_config_vars($display_vars['vars'], $cfg_array, $error); + + if ($submit && !check_form_key($form_key)) + { + $error[] = $user->lang['FORM_INVALID']; + } + // Do not write values if there is an error + if (sizeof($error)) + { + $submit = false; + } + + // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... + foreach ($display_vars['vars'] as $this->config_name => $null) + { + if (!isset($cfg_array[$this->config_name]) || strpos($this->config_name, 'legend') !== false) + { + continue; + } + $this->new_config[$this->config_name] = $this->config_value = $cfg_array[$this->config_name]; + + if ($submit) + { + if ($this->config_name == 'football_ult_points' && $this->config_value) + { + $this->config->set('football_bank', 1); + } + if ($this->config_name == 'football_remember_enable') + { + $day = $this->request->variable('next_run_day', 0); + $month = $this->request->variable('next_run_month', 0); + $year = $this->request->variable('next_run_year', 0); + $hour = $this->request->variable('next_run_hour', 0); + $minute = $this->request->variable('next_run_minute', 0); + + $next_run = mktime($hour, $minute, 0, $month, $day, $year); + $this->config->set('football_remember_next_run', $next_run); + } + $this->config->set($this->config_name, $this->config_value); + } + } + + if ($submit) + { + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FOOTBALL_' . strtoupper($mode)); + + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); + } + + $this->tpl_name = 'acp_football'; + $this->page_title = $display_vars['title']; + + $template->assign_vars(array( + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet')), + 'L_TITLE' => $user->lang[$display_vars['title']], + 'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'], + 'S_ERROR' => (sizeof($error)) ? true : false, + 'ERROR_MSG' => implode('
', $error), + 'U_ACTION' => $this->u_action, + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + + // Output relevant page + foreach ($display_vars['vars'] as $this->config_key => $vars) + { + if (!is_array($vars) && strpos($this->config_key, 'legend') === false) + { + continue; + } + + if (strpos($this->config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars, + ) + ); + + continue; + } + + $type = explode(':', $vars['type']); + + $l_explain = ''; + if ($vars['explain'] && isset($vars['lang_explain'])) + { + $l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain']; + } + else if ($vars['explain']) + { + $l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : ''; + } + + $content = build_cfg_template($type, $this->config_key, $this->new_config, $this->config_key, $vars); + + if (empty($content)) + { + continue; + } + + $template->assign_block_vars('options', array( + 'KEY' => $this->config_key, + 'TITLE' => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'], + 'S_EXPLAIN' => $vars['explain'], + 'TITLE_EXPLAIN' => $l_explain, + 'CONTENT' => $content, + ) + ); + + unset($display_vars['vars'][$this->config_key]); + } + } + + /** + * Football disable option and message + */ + function football_disable($value, $key) + { + global $user; + + $radio_ary = array(1 => 'YES', 0 => 'NO'); + + return h_radio('config[football_disable]', $radio_ary, $value) . '
'; + } + + /** + * Football info option and message + */ + function football_info($value, $key) + { + global $user; + + $radio_ary = array(1 => 'YES', 0 => 'NO'); + + return h_radio('config[football_info_display]', $radio_ary, $value) . '
'; + } + + /** + * Select ultimate points method + */ + function select_up_method($value, $key = '') + { + global $user, $config; + + $radio_ary = array(UP_NONE => 'UP_NONE', UP_WINS => 'UP_WINS', UP_POINTS => 'UP_POINTS'); + + return h_radio('config[football_ult_points]', $radio_ary, $value, $key); + } + + + function season_select($default = 0) + { + global $user, $db; + + $sql = 'SELECT DISTINCT s.season, s.season_name_short FROM ' . FOOTB_SEASONS . ' AS s + INNER JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season) + INNER JOIN ' . FOOTB_MATCHDAYS . ' AS md ON (md.season = s.season AND md.league = l.league) + WHERE 1 + ORDER BY s.season DESC'; + $result = $db->sql_query($sql); + + $selected = (0 == $default) ? ' selected="selected"' : ''; + $season_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($row['season'] == $default) ? ' selected="selected"' : ''; + $season_options .= ''; + } + $db->sql_freeresult($result); + + return $season_options; + } + + /** + * Adjust Cronjob EMail remember next un + */ + function next_run($value, $key = '') + { + global $user, $db; + $next_run = getdate($this->config['football_remember_next_run']); + + // Days + $day_options = ''; + + // Months + $month_options = ''; + + // Years + $year_options = ''; + + // Hours + $hour_options = ''; + + // Minutes + $minute_options = ''; + + + return $user->lang['DAY'] . ': ' . $day_options . ' ' . $user->lang['MONTH'] . ': ' . $month_options . ' ' . $user->lang['YEAR'] . ': ' . + $year_options . ' ' . $user->lang['HOURS'] . ': ' . $hour_options . ' ' . $user->lang['MINUTES'] . ': ' . $minute_options; + + } +} + +?> \ No newline at end of file diff --git a/acp/ko_info.php b/acp/ko_info.php new file mode 100644 index 0000000..4b31bfd --- /dev/null +++ b/acp/ko_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\ko_module', + 'title' => 'ACP_FOOTBALL_KO_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_KO_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_KO')), + ), + ); + } +} diff --git a/acp/ko_module.php b/acp/ko_module.php new file mode 100644 index 0000000..a761a73 --- /dev/null +++ b/acp/ko_module.php @@ -0,0 +1,257 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_ko'); + + $this->root_path = $phpbb_root_path . 'ext/football/football/'; + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + + if(!function_exists('season_info')) + { + include($this->root_path . 'includes/functions.' . $this->php_ext); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->root_path . 'includes/constants.' . $this->php_ext); + } + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $this->tpl_name = 'acp_football_ko'; + $this->page_title = 'ACP_FOOTBALL_KO_MANAGE'; + + $form_key = 'acp_football_ko'; + add_form_key($form_key); + + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + + // Check and set some common vars + $action = (isset($_POST['update'])) ? 'update' : $this->request->variable('action', ''); + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $matchday_from = $this->request->variable('matchday_from', 0); + $matchday_to = $this->request->variable('matchday_to', 0); + $matchday_new = $this->request->variable('matchday_new', 0); + $check_rank = $this->request->variable('check_rank', 0); + $rank = $this->request->variable('rank', 2); + $move_rank = $this->request->variable('move_rank', 3); + $move_league = $this->request->variable('move_league', 0); + $move_matchday = $this->request->variable('move_matchday', 8); + + // Clear some vars + $error = array(); + $success = array(); + + $curr_season = curr_season(); + // Grab current season + if (!$season) + { + $season = $curr_season; + } + + // Grab basic data for select season + if ($season) + { + $sql = 'SELECT + DISTINCT s.* + FROM ' . FOOTB_SEASONS . ' AS s + LEFT JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season) + WHERE l.league_type = 2 + ORDER BY s.season DESC'; + $result = $db->sql_query($sql); + + $season_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($season && $row['season'] == $season) ? ' selected="selected"' : ''; + $season_options .= ''; + 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 basic data for select league + $sql = 'SELECT * + FROM ' . FOOTB_LEAGUES . ' + WHERE season = ' . $season . ' + AND league_type = ' . LEAGUE_KO . ' + ORDER BY league ASC'; + $result = $db->sql_query($sql); + + $league_options = ''; + if ($move_league == 0) + { + $league_move_options = ''; + } + else + { + $league_move_options = ''; + } + while ($row = $db->sql_fetchrow($result)) + { + // Grab current league + if (!$league) + { + $league = $row['league']; + } + $selected = ($league && $row['league'] == $league) ? ' selected="selected"' : ''; + $league_options .= ''; + if ($selected <> '') + { + $league_matchdays = $row['matchdays']; + $matches_matchday = $row['matches_on_matchday']; + $league_name = $row['league_name']; + } + else + { + $selected_move = ($move_league && $row['league'] == $move_league) ? ' selected="selected"' : ''; + $league_move_options .= ''; + } + } + $db->sql_freeresult($result); + + if (!$league) + { + trigger_error(sprintf($user->lang['NO_LEAGUE'], $season) . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING); + } + + // Grab basic data for select matchday + if (!$matchday_from) + { + $matchday_from = curr_matchday($season, $league); + if ($matchday_from > 1) + { + $matchday_from = $matchday_from - 1; + } + } + if (!$matchday_to) + { + $matchday_to = $matchday_from; + } + if (!$matchday_new) + { + $matchday_new = $matchday_to + 1; + } + + $sql = 'SELECT * + FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + + $matchday_from_options = ''; + $matchday_to_options = ''; + $matchday_new_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected_from = ($matchday_from && $row['matchday'] == $matchday_from) ? ' selected="selected"' : ''; + $selected_to = ($matchday_to && $row['matchday'] == $matchday_to) ? ' selected="selected"' : ''; + $selected_new = ($matchday_new && $row['matchday'] == $matchday_new) ? ' selected="selected"' : ''; + $day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']); + $matchday_from_options .= ''; + $matchday_to_options .= ''; + $matchday_new_options .= ''; + } + $db->sql_freeresult($result); + if ($matchday_from_options == '') + { + trigger_error(sprintf($user->lang['NO_MATCHDAY'], $league_name, $season) . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING); + } + + // Which page? + switch ($action) + { + case 'update': + { + if ($matchday_from > $matchday_to) + { + $error[] = sprintf($user->lang['ERROR_FROM_TO']); + } + if ($matchday_new <= $matchday_to) + { + $error[] = sprintf($user->lang['ERROR_TARGET']); + } + if (!sizeof($error)) + { + if (1 == $check_rank) + { + $success = ko_group_next_round($season, $league, $matchday_from, $matchday_to, $matchday_new, $rank, $move_rank, $move_league, $move_matchday); + } + else + { + $success = ko_next_round($season, $league, $matchday_from, $matchday_to, $matchday_new); + } + trigger_error($success . adm_back_link($this->u_action)); + } + } + break; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), + 'S_ERROR' => (sizeof($error)) ? true : false, + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + 'S_SUCCESS' => (sizeof($success)) ? true : false, + 'SUCCESS_MSG' => (sizeof($success)) ? implode('
', $success) : '', + 'S_SEASON_OPTIONS' => $season_options, + 'S_LEAGUE_OPTIONS' => $league_options, + 'S_SEASON' => $season, + 'S_LEAGUE' => $league, + 'S_MATCHDAY_FROM_OPTIONS'=> $matchday_from_options, + 'S_MATCHDAY_TO_OPTIONS' => $matchday_to_options, + 'S_MATCHDAY_NEW_OPTIONS'=> $matchday_new_options, + 'S_CHECK_RANK' => $check_rank, + 'S_RANK' => $rank, + 'S_MOVE_RANK' => $move_rank, + 'S_MOVE_LEAGUE_OPTIONS' => $league_move_options, + 'S_MOVE_MATCHDAY' => $move_matchday, + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + } +} +?> \ No newline at end of file diff --git a/acp/leagues_info.php b/acp/leagues_info.php new file mode 100644 index 0000000..5e4ff18 --- /dev/null +++ b/acp/leagues_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\leagues_module', + 'title' => 'ACP_FOOTBALL_LEAGUES_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_LEAGUES_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_LEAGUES')), + ), + ); + } +} diff --git a/acp/leagues_module.php b/acp/leagues_module.php new file mode 100644 index 0000000..7485d95 --- /dev/null +++ b/acp/leagues_module.php @@ -0,0 +1,736 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_leagues'); + + $this->root_path = $phpbb_root_path . 'ext/football/football/'; + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + + if(!function_exists('season_info')) + { + include($this->root_path . 'includes/functions.' . $this->php_ext); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->root_path . 'includes/constants.' . $this->php_ext); + } + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $this->tpl_name = 'acp_football_leagues'; + $this->page_title = 'ACP_FOOTBALL_LEAGUES_MANAGE'; + + $form_key = 'acp_football_leagues'; + add_form_key($form_key); + + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + // Check and set some common vars + $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addmembers'])) ? 'addmembers' : $this->request->variable('action', '')); + $edit = $this->request->variable('edit', 0); + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $group_id = $this->request->variable('g', 0); + $start = $this->request->variable('start', 0); + $update = (isset($_POST['update'])) ? true : false; + + // Clear some vars + $league_info = array(); + $error = array(); + + // Grab current season + if (!$season) + { + $season = curr_season(); + } + // Grab basic data for 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 .= ''; + if ($selected <> '') + { + $season_name = $row['season_name']; + } + } + $db->sql_freeresult($result); + } + else + { + trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING); + } + + // Grab basic data for league, if league is set and exists + if ($league) + { + $league_info = league_info($season, $league); + } + + // Which page? + switch ($action) + { + case 'addmembers': + if (!$league) + { + trigger_error($user->lang['NO_LEAGUE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $usernames = $this->request->variable('usernames', '', true); + if ($usernames) + { + $username_ary = array_unique(explode("\n", $usernames)); + + // Add user/s to league + // We need both username and user_id info + $user_id_ary = false; + $result = user_get_id_name($user_id_ary, $username_ary); + + if (!sizeof($user_id_ary) || $result !== false) + { + trigger_error($user->lang['NO_MEMBERS_SELECTED'] . adm_back_link($this->u_action . "&action=list&s=$season&l=$league"), E_USER_WARNING); + } + } + else + { + if ($group_id) + { + $sql = 'SELECT u.user_id, u.username + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug + WHERE ug.group_id = ' . $group_id . ' + AND ug.user_pending = 0 + AND u.user_id = ug.user_id + AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') + ORDER BY u.user_id'; + } + else + { + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') + ORDER BY user_id'; + } + $result = $db->sql_query($sql); + if (!($row = $db->sql_fetchrow($result))) + { + $db->sql_freeresult($result); + trigger_error($user->lang['NO_MEMBERS_SELECTED'] . adm_back_link($this->u_action . "&action=list&s=$season&l=$league"), E_USER_WARNING); + } + + do + { + $username_ary[$row['user_id']] = $row['username']; + $user_id_ary[] = $row['user_id']; + } + while ($row = $db->sql_fetchrow($result)); + $db->sql_freeresult($result); + } + + + if ($league_info['league_type'] == LEAGUE_KO) + { + // Check matchdays + $sql = 'SELECT + COUNT(matchday) AS matchdays + FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league"; + $result = $db->sql_query($sql); + $matchdays = (int) $db->sql_fetchfield('matchdays'); + $db->sql_freeresult($result); + if ($matchdays < $league_info['matchdays']) + { + trigger_error($user->lang['NO_MATCHDAYS_KO'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + foreach ($user_id_ary as $user_id) + { + // Test user is member + $sql = 'SELECT + COUNT(user_id) AS total_bets + FROM ' . FOOTB_BETS . " + WHERE season = $season + AND league = $league + AND user_id = $user_id"; + $result = $db->sql_query($sql); + $total_bets = (int) $db->sql_fetchfield('total_bets'); + $db->sql_freeresult($result); + + if ($total_bets > 0) + { + $error[] = $user->lang['MEMBER_EXISTS']; + } + else + { + $count_updates = join_league($season, $league, $user_id); + } + } + + $back_link = $this->u_action . '&action=list&s=' . $season . '&l=' . $league; + trigger_error($user->lang['LEAGUE_USERS_ADD'] . adm_back_link($back_link)); + break; + case 'deletemembers': + if (!$league) + { + trigger_error($user->lang['NO_LEAGUE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $mark_ary = $this->request->variable('mark', array(0)); + if (sizeof($mark_ary) == 0) + { + trigger_error($user->lang['NO_MEMBERS_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (confirm_box(true)) + { + if (!$auth->acl_get('a_football_delete')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING); + } + if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) + { + trigger_error($user->lang['SEASONS_NO_DELETE'] . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING); + } + // Delete bets + $sql = 'DELETE FROM ' . FOOTB_BETS . " + WHERE season = $season + AND league = $league + AND " . $db->sql_in_set('user_id', $mark_ary); + $db->sql_query($sql); + // Delete ranks + $sql = 'DELETE FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND " . $db->sql_in_set('user_id', $mark_ary); + $db->sql_query($sql); + // Delete bank statements + $sql = 'DELETE FROM ' . FOOTB_POINTS . " + WHERE season = $season + AND league = $league + AND " . $db->sql_in_set('user_id', $mark_ary); + $db->sql_query($sql); + + $back_link = $this->u_action . '&action=list&s=' . $season . '&l=' . $league; + trigger_error($user->lang['LEAGUE_USERS_REMOVE'] . adm_back_link($back_link)); + } + else + { + confirm_box(false, sprintf($user->lang['MEMBER_CONFIRM_DELETE'], $league_info['league_name'], $season), build_hidden_fields(array( + 'mark' => $mark_ary, + 's' => $season, + 'l' => $league, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + case 'list': + + if (!$league) + { + trigger_error($user->lang['NO_LEAGUE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $this->page_title = 'LEAGUE_MEMBERS'; + + // Total number of league members + $sql = 'SELECT + COUNT(DISTINCT user_id) AS total_members + FROM ' . FOOTB_BETS . " + WHERE season = $season + AND league = $league"; + $result = $db->sql_query($sql); + $total_members = (int) $db->sql_fetchfield('total_members'); + $db->sql_freeresult($result); + + $s_action_options = ''; + $options = array('deletemembers' => 'DELETE'); + + foreach ($options as $option => $lang) + { + $s_action_options .= ''; + } + + // Exclude bots and guests... + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name IN ('BOTS', 'GUESTS')"; + $result = $db->sql_query($sql); + + $exclude = array(); + while ($row = $db->sql_fetchrow($result)) + { + $exclude[] = $row['group_id']; + } + $db->sql_freeresult($result); + $select_list = ''; + $select_list .= group_select_options($group_id, $exclude); + $base_url = $this->u_action . "&action=list&s=$season&l=$league"; + $pagination = $phpbb_container->get('pagination'); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_members, $this->config['football_users_per_page'], $start); + + $template->assign_vars(array( + 'S_LIST' => true, + 'S_ACTION_OPTIONS' => $s_action_options, + 'TOTAL_MEMBERS' => ($total_members == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_members), + 'PAGE_NUMBER' => $pagination->on_page($total_members, $this->config['football_users_per_page'], $start), + 'LEAGUE_NAME' => $league_info['league_name']. ' ' . $season_name, + 'U_ACTION' => $this->u_action . "&s=$season&l=$league", + 'U_BACK' => $this->u_action. "&s=$season&l=$league", + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames'), + 'U_DEFAULT_ALL' => "{$this->u_action}&action=addmembers&s=$season&l=$league&g=0", + 'S_GROUP_OPTIONS' => $select_list, + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + + // Grab the members + $sql = 'SELECT + DISTINCT u.user_id, + u.username, + u.username_clean, + u.user_regdate + FROM ' . FOOTB_BETS . ' b, ' . USERS_TABLE . " u + WHERE b.season = $season AND b.league = $league + AND u.user_id = b.user_id + ORDER BY u.username_clean"; + $result = $db->sql_query_limit($sql, $this->config['football_users_per_page'], $start); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('member', array( + 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"), + 'USERNAME' => $row['username'], + 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', + 'USER_ID' => $row['user_id'], + ) + ); + } + $db->sql_freeresult($result); + + return; + break; + case 'delete': + if (!$league) + { + trigger_error($user->lang['NO_LEAGUE'] . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING); + } + + if (confirm_box(true)) + { + $error = ''; + + if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) + { + trigger_error($user->lang['LEAGUES_NO_DELETE'] . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING); + } + + // Delete league + $sql = 'DELETE FROM ' . FOOTB_LEAGUES . " + WHERE season = $season + AND league = $league"; + $db->sql_query($sql); + + // Delete matchdays + $sql = 'DELETE FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league"; + $db->sql_query($sql); + + // Delete matches + $sql = 'DELETE FROM ' . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league"; + $db->sql_query($sql); + + // Delete teams + $sql = 'DELETE FROM ' . FOOTB_TEAMS . " + WHERE season = $season + AND league = $league"; + $db->sql_query($sql); + + // Delete ranks + $sql = 'DELETE FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league"; + $db->sql_query($sql); + + // Delete bets + $sql = 'DELETE FROM ' . FOOTB_BETS . " + WHERE season = $season + AND league = $league"; + $db->sql_query($sql); + + trigger_error($user->lang['LEAGUE_DELETED'] . adm_back_link($this->u_action . "&s=$season")); + } + else + { + confirm_box(false, sprintf($user->lang['LEAGUE_CONFIRM_DELETE'], $league_info['league_name'], $season), build_hidden_fields(array( + 's' => $season, + 'l' => $league, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + + case 'add': + if ($league > 0 AND $league <= 99) + { + if ($league_info) + { + if ($edit) + { + $error[] = $user->lang['LEAGUE_TAKEN']; + } + else + { + trigger_error($user->lang['LEAGUE_TAKEN'] . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING); + } + } + $league_info['league_name'] = utf8_normalize_nfc($this->request->variable('league_name', '', true)); + $league_info['league_name_short'] = utf8_normalize_nfc($this->request->variable('league_short', '', true)); + $league_info['league_type'] = $this->request->variable('league_type', 1, true); + $league_info['bet_ko_type'] = $this->request->variable('bet_ko_type', 1, true); + $league_info['matchdays'] = $this->request->variable('league_matchdays', 34, true); + $league_info['matches_on_matchday'] = $this->request->variable('league_matches', 9, true); + $league_info['bet_points'] = round($this->request->variable('bet_points', 0), 2); + $league_info['win_result'] = $this->request->variable('league_win_hits', 0, true); + $league_info['win_result_02'] = $this->request->variable('league_win_hits_away', 0, true); + $league_info['win_matchday'] = $this->request->variable('league_win_matchdays', 0, true); + $league_info['win_season'] = $this->request->variable('league_win_season', 0, true); + $league_info['points_mode'] = $this->request->variable('league_points_mode', 1, true); + $league_info['points_result'] = $this->request->variable('league_points_hit', 0, true); + $league_info['points_tendency'] = $this->request->variable('league_points_tendency', 0, true); + $league_info['points_diff'] = $this->request->variable('league_points_diff', 0, true); + $league_info['points_last'] = $this->request->variable('league_points_last', 1, true); + $league_info['join_by_user'] = $this->request->variable('league_join_by_user', 0, true); + $league_info['join_in_season'] = $this->request->variable('league_join_in_season', 0, true); + $league_info['bet_in_time'] = $this->request->variable('league_bet_in_time', 0, true); + $league_info['rules_post_id'] = $this->request->variable('league_rules_post_id', 0, true); + } + else + { + trigger_error($user->lang['LEAGUE_NUMBER'] . adm_back_link($this->u_action . "&s=$season"), E_USER_WARNING); + } + // No break for edit add + case 'edit': + + $data = array(); + + if (!sizeof($error)) + { + if ($action == 'edit' && !$league) + { + trigger_error($user->lang['NO_LEAGUE'] . adm_back_link($this->u_action . "&s=$season"), 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"), E_USER_WARNING); + } + + $league_info['league_name'] = utf8_normalize_nfc($this->request->variable('league_name', '', true)); + $league_info['league_name_short'] = utf8_normalize_nfc($this->request->variable('league_short', '', true)); + $league_info['league_type'] = $this->request->variable('league_type', $league_info['league_type'], true); + $league_info['bet_ko_type'] = $this->request->variable('bet_ko_type', $league_info['bet_ko_type'], true); + $league_info['matchdays'] = $this->request->variable('league_matchdays', $league_info['matchdays'], true); + $league_info['matches_on_matchday'] = $this->request->variable('league_matches', $league_info['matches_on_matchday'], true); + $league_info['bet_points'] = round($this->request->variable('bet_points', $league_info['bet_points']),2); + $league_info['win_result'] = $this->request->variable('league_win_hits', $league_info['win_result'], true); + $league_info['win_result_02'] = $this->request->variable('league_win_hits_away', $league_info['win_result_02'], true); + $league_info['win_matchday'] = $this->request->variable('league_win_matchdays', $league_info['win_matchday'], true); + $league_info['win_season'] = $this->request->variable('league_win_season', $league_info['win_season'], true); + $league_info['points_mode'] = $this->request->variable('league_points_mode', $league_info['points_mode'], true); + $league_info['points_result'] = $this->request->variable('league_points_hit', $league_info['points_result'], true); + $league_info['points_tendency'] = $this->request->variable('league_points_tendency', $league_info['points_tendency'], true); + $league_info['points_diff'] = $this->request->variable('league_points_diff', $league_info['points_diff'], true); + $league_info['points_last'] = $this->request->variable('league_points_last', $league_info['points_last'], true); + $league_info['join_by_user'] = $this->request->variable('league_join_by_user', $league_info['join_by_user'], true); + $league_info['join_in_season'] = $this->request->variable('league_join_in_season', $league_info['join_in_season'], true); + $league_info['bet_in_time'] = $this->request->variable('league_bet_in_time', $league_info['bet_in_time'], true); + $league_info['rules_post_id'] = $this->request->variable('league_rules_post_id', $league_info['rules_post_id'], true); + + if (!$league_info['rules_post_id'] and $league_info['join_by_user'] == 1) + { + $error[] = $user->lang['CHECK_RULES_POST_ID']; + } + + if (!is_numeric($league_info['win_result']) or $league_info['win_result'] < 0) + { + $error[] = $user->lang['CHECK_HIT_WINS']; + } + + if (!is_numeric($league_info['win_result_02']) or $league_info['win_result_02'] < 0) + { + $error[] = $user->lang['CHECK_HITS02_WINS']; + } + + $matchday_wins = explode(';',$league_info['win_matchday']); + foreach ($matchday_wins as $matchday_win) + { + if (!is_numeric($matchday_win) or $matchday_win < 0) + { + $error[] = $user->lang['CHECK_MATCHDAY_WINS']; + break; + } + } + + $season_wins = explode(';',$league_info['win_season']); + foreach ($season_wins as $season_win) + { + if (!is_numeric($season_win) or $season_win < 0) + { + $error[] = $user->lang['CHECK_SEASON_WINS']; + break; + } + } + + if (!sizeof($error)) + { + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'league_name' => $league_info['league_name'], + 'league_name_short' => $league_info['league_name_short'], + 'league_type' => $league_info['league_type'], + 'bet_ko_type' => $league_info['bet_ko_type'], + 'matchdays' => $league_info['matchdays'], + 'matches_on_matchday' => ($league_info['league_type'] == LEAGUE_KO) ? 0 : $league_info['matches_on_matchday'], + 'win_result' => $league_info['win_result'], + 'win_result_02' => $league_info['win_result_02'], + 'win_matchday' => $league_info['win_matchday'], + 'win_season' => $league_info['win_season'], + 'points_mode' => $league_info['points_mode'], + 'points_result' => (is_numeric($league_info['points_result'])) ? $league_info['points_result'] : 0, + 'points_tendency' => (is_numeric($league_info['points_tendency'])) ? $league_info['points_tendency'] : 0, + 'points_diff' => (is_numeric($league_info['points_diff'])) ? $league_info['points_diff'] : 0, + 'points_last' => $league_info['points_last'], + 'join_by_user' => $league_info['join_by_user'], + 'join_in_season' => $league_info['join_in_season'], + 'bet_in_time' => $league_info['bet_in_time'], + 'rules_post_id' => (is_numeric($league_info['rules_post_id'])) ? $league_info['rules_post_id'] : 0, + 'bet_points' => $league_info['bet_points'], + ); + + $data['league'] = $league; + $data['league_name'] = $league_info['league_name']; + $data['league_short'] = $league_info['league_name_short']; + $data['league_matchdays'] = $league_info['matchdays']; + $data['league_matches'] = ($league_info['league_type'] == LEAGUE_KO) ? 0 : $league_info['matches_on_matchday']; + + $var_ary = array( + 'league' => array('num', false, 1, 99), + 'league_name' => array('string', false, 2, 20), + 'league_short' => array('string', false, 1, 3), + 'league_matchdays' => array('num', false, 0, 99), + 'league_matches' => array('num', false, 0, 99), + ); + if (!($error_vals = validate_data($data, $var_ary))) + { + if ($action == 'add') + { + $sql = 'INSERT INTO ' . FOOTB_LEAGUES . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + else + { + $sql = 'UPDATE ' . FOOTB_LEAGUES . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season + AND league = $league"; + $db->sql_query($sql); + } + if ($league_info['bet_in_time']) + { + set_bet_in_time_delivery($season, $league); + } + $message = ($action == 'edit') ? 'LEAGUE_UPDATED' : 'LEAGUE_CREATED'; + trigger_error($user->lang[$message] . adm_back_link($this->u_action . "&s=$season")); + } + else + { + foreach ($error_vals as $error_val) + { + $error_msg[] = $user->lang[$error_val]; + } + $message = ($action == 'edit') ? 'LEAGUE_UPDATE_FAILED' : 'LEAGUE_CREATE_FAILED'; + $error[] = $user->lang[$message]; + $error = array_merge($error, $error_msg); + } + } + } + } + $type_champ = ($league_info['league_type'] == LEAGUE_CHAMP) ? ' checked="checked"' : ''; + $type_ko = ($league_info['league_type'] == LEAGUE_KO) ? ' checked="checked"' : ''; + $bet_ko_90 = ($league_info['bet_ko_type'] == BET_KO_90) ? ' checked="checked"' : ''; + $bet_ko_extratime = ($league_info['bet_ko_type'] == BET_KO_EXTRATIME) ? ' checked="checked"' : ''; + $bet_ko_penalty = ($league_info['bet_ko_type'] == BET_KO_PENALTY) ? ' checked="checked"' : ''; + $mode_options = ''; + for($i = 1; $i <= 6; $i++) + { + $selected = ($i == $league_info['points_mode']) ? ' selected="selected"' : ''; + $mode_options .= ''; + } + + // check if matches created + $existing_matches_on_league = count_existing_matches($season, $league, 0); + + $u_back = $this->u_action . "&s=$season"; + + $template->assign_vars(array( + 'S_EDIT' => true, + 'S_ADD_LEAGUE' => ($action == 'add') ? true : false, + 'S_ERROR' => (sizeof($error)) ? true : false, + 'S_EDIT_MATCHES' => ($existing_matches_on_league) ? false : true, + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + 'SEASON' => $season, + 'BET_IN_TIME_YES' => ($league_info['bet_in_time'] == 1) ? ' checked="checked"' : '', + 'BET_IN_TIME_NO' => ($league_info['bet_in_time'] == 0) ? ' checked="checked"' : '', + 'BET_TYPE_KO_90' => BET_KO_90, + 'BET_TYPE_KO_EXTRATIME' => BET_KO_EXTRATIME, + 'BET_TYPE_KO_PENALTY' => BET_KO_PENALTY, + 'BET_KO_90' => $bet_ko_90, + 'BET_KO_EXTRATIME' => $bet_ko_extratime, + 'BET_KO_PENALTY' => $bet_ko_penalty, + 'JOIN_BY_USER_YES' => ($league_info['join_by_user'] == 1) ? ' checked="checked"' : '', + 'JOIN_BY_USER_NO' => ($league_info['join_by_user'] == 0) ? ' checked="checked"' : '', + 'JOIN_IN_SEASON_YES' => ($league_info['join_in_season'] == 1) ? ' checked="checked"' : '', + 'JOIN_IN_SEASON_NO' => ($league_info['join_in_season'] == 0) ? ' checked="checked"' : '', + 'LEAGUE' => $league, + 'LEAGUE_NAME' => $league_info['league_name'], + 'LEAGUE_SHORT' => $league_info['league_name_short'], + 'LEAGUE_TYPE_CHAMP' => LEAGUE_CHAMP, + 'LEAGUE_TYPE_KO' => LEAGUE_KO, + 'LEAGUE_CHAMP' => $type_champ, + 'LEAGUE_KO' => $type_ko, + 'LEAGUE_MATCHDAYS' => $league_info['matchdays'], + 'LEAGUE_MATCHES' => $league_info['matches_on_matchday'], + 'LEAGUE_POINTS_MODE_OPTIONS' => $mode_options, + 'LEAGUE_POINTS_HIT' => $league_info['points_result'], + 'LEAGUE_POINTS_TENDENCY'=> $league_info['points_tendency'], + 'LEAGUE_POINTS_DIFF' => $league_info['points_diff'], + 'LEAGUE_RULES_POST_ID' => $league_info['rules_post_id'], + 'BET_POINTS' => $league_info['bet_points'], + 'LEAGUE_WIN_HITS' => $league_info['win_result'], + 'LEAGUE_WIN_HITS_AWAY' => $league_info['win_result_02'], + 'LEAGUE_WIN_MATCHDAYS' => $league_info['win_matchday'], + 'LEAGUE_WIN_SEASON' => $league_info['win_season'], + 'POINTS_LAST_YES' => ($league_info['points_last'] == 1) ? ' checked="checked"' : '', + 'POINTS_LAST_NO' => ($league_info['points_last'] == 0) ? ' checked="checked"' : '', + 'U_BACK' => $u_back, + 'U_ACTION' => "{$this->u_action}&action=$action&s=$season", + ) + ); + return; + break; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season)), + 'S_SEASON' => $season, + 'S_SEASON_OPTIONS' => $season_options, + 'S_LEAGUE_ADD' => true, + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + + // Get us all the leagues + $sql = 'SELECT + l.season, + l.league, + l.league_name, + l.league_name_short, + COUNT(DISTINCT b.user_id) AS members + FROM ' . FOOTB_LEAGUES . ' AS l + LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = l.season AND b.league = l.league) + WHERE l.season = $season + GROUP BY league + ORDER BY league ASC"; + $result = $db->sql_query($sql); + $rows_leagues = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + // Check if the user is allowed to delete a league. + if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) + { + $allow_delete = false; + } + else + { + $allow_delete = true; + } + + $row_number = 0; + foreach ($rows_leagues as $row_league) + { + // check if matches created + $existing_matches_on_league = count_existing_matches($row_league['season'], $row_league['league'], 0); + + $row_number++; + $row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('leagues', array( + 'ROW_CLASS' => $row_class, + 'SEASON' => $row_league['season'], + 'LEAGUE' => $row_league['league'], + 'LEAGUE_NAME' => $row_league['league_name'], + 'LEAGUE_SHORT' => $row_league['league_name_short'], + 'MEMBERS' => $row_league['members'], + 'S_MEMBER' => ($existing_matches_on_league) ? true : false, + 'U_LIST' => "{$this->u_action}&action=list&s=" . $season . "&l=" .$row_league['league'], + 'U_EDIT' => "{$this->u_action}&action=edit&s=" . $season . "&l=" .$row_league['league'], + 'U_DELETE' => ($allow_delete) ? "{$this->u_action}&action=delete&s=" . $season . "&l=" . $row_league['league'] : '', + ) + ); + } + } +} +?> \ No newline at end of file diff --git a/acp/matchdays_info.php b/acp/matchdays_info.php new file mode 100644 index 0000000..2cb70db --- /dev/null +++ b/acp/matchdays_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\matchdays_module', + 'title' => 'ACP_FOOTBALL_MATCHDAYS_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_MATCHDAYS_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_MATCHDAYS')), + ), + ); + } +} diff --git a/acp/matchdays_module.php b/acp/matchdays_module.php new file mode 100644 index 0000000..bcae002 --- /dev/null +++ b/acp/matchdays_module.php @@ -0,0 +1,1134 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_matchdays'); + + $this->root_path = $phpbb_root_path . 'ext/football/football/'; + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + + if(!function_exists('season_info')) + { + include($this->root_path . 'includes/functions.' . $this->php_ext); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->root_path . 'includes/constants.' . $this->php_ext); + } + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $this->tpl_name = 'acp_football_matchdays'; + $this->page_title = 'ACP_FOOTBALL_MATCHDAYS_MANAGE'; + + $form_key = 'acp_football_matchdays'; + add_form_key($form_key); + + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + + // Check and set some common vars + $action = (isset($_POST['add'])) ? 'add' : ''; + $action = (isset($_POST['remove'])) ? 'remove' : $action; + $action = (isset($_POST['change_delivery'])) ? 'change_delivery' : $action; + $action = (isset($_POST['show_delivery'])) ? 'show_delivery' : $action; + $action = (isset($_POST['update_delivery'])) ? 'update_delivery' : $action; + $action = (empty($action)) ? $this->request->variable('action', '') : $action; + + $edit = $this->request->variable('edit', 0); + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $matchday = $this->request->variable('m', 0); + $update = (isset($_POST['update'])) ? true : false; + $backward_days = $this->request->variable('backward_days', 0); + $backward_hours = $this->request->variable('backward_hours', 0); + $backward_minutes = $this->request->variable('backward_minutes', 0); + + // Clear some vars + $matchday_row = array(); + $error = array(); + $show_delivery_select = true; + $show_delivery = false; + + // 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 .= ''; + 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 .= ''; + if ($selected <> '') + { + $league_matchdays = $row['matchdays']; + $league_name = $row['league_name']; + $league_type = $row['league_type']; + $edit_delivery = !$row['bet_in_time']; + $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 basic data for matchday, if matchday is set and exists + if ($matchday) + { + $sql = 'SELECT * + FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + AND matchday = $matchday"; + $result = $db->sql_query($sql); + $matchday_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + // Which page? + switch ($action) + { + case 'update_delivery': + $show_delivery_select = false; + $count_updates = 0; + $sql = "SELECT + matchday + FROM " . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + $rows_matchdays = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + foreach ($rows_matchdays as $row_matchday) + { + $sql_ary = array(); + $matchday = $row_matchday['matchday']; + if ($this->request->variable('delivery_' . $matchday . '_1', false)) + { + $sql_ary['delivery_date'] = $this->request->variable('new_delivery_' . $matchday . '_1', ''); + } + if ($this->request->variable('delivery_' . $matchday . '_2', '')) + { + $sql_ary['delivery_date_2'] = $this->request->variable('new_delivery_' . $matchday . '_2', ''); + } + if ($this->request->variable('delivery_' . $matchday . '_3', '')) + { + $sql_ary['delivery_date_3'] = $this->request->variable('new_delivery_' . $matchday . '_3', ''); + } + if ( sizeof($sql_ary) ) + { + $count_updates = $count_updates + sizeof($sql_ary); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season + AND league = $league + AND matchday = $matchday"; + $db->sql_query($sql); + } + } + if ($count_updates) + { + trigger_error(sprintf($user->lang['UPDATE_DELIVER' . (($count_updates == 1) ? '' : 'IES')], $count_updates) . adm_back_link($this->u_action . "&s=$season&l=$league")); + } + else + { + trigger_error($user->lang['NO_DELIVERIES_UPDATED'] . adm_back_link($this->u_action . "&s=$season&l=$league")); + } + break; + case 'show_delivery': + $show_delivery_select = false; + $show_delivery = true; + $lang_dates = $user->lang['datetime']; + $sql = "(SELECT md.matchday, + 1 AS number, + md.delivery_date, + CASE DATE_FORMAT(md.delivery_date,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' + END AS delivery_date_day, + DATE_FORMAT(DATE_SUB(agg.min_delivery_date, INTERVAL '" . $backward_days . ' ' . $backward_hours . ':' . sprintf('%02d', $backward_minutes) . "' DAY_MINUTE),'%Y-%m-%d %H:%i:%s') AS new_delivery_date, + CASE DATE_FORMAT(DATE_SUB(agg.min_delivery_date, INTERVAL '" . $backward_days . ' ' . $backward_hours . ':' . sprintf('%02d', $backward_minutes) . "' DAY_MINUTE), '%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' + END AS new_delivery_day + FROM " . FOOTB_MATCHDAYS . " AS md + INNER JOIN (SELECT season, league, matchday, min(match_datetime) AS min_delivery_date + FROM " . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND status = 0 + GROUP BY season, league, matchday) AS agg + WHERE md.season = agg.season + AND md.league = agg.league + AND md.matchday = agg.matchday) + UNION + (SELECT md2.matchday, + 2 AS number, + md2.delivery_date_2 AS delivery_date, + CASE DATE_FORMAT(md2.delivery_date_2,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' + END AS delivery_date_day, + DATE_FORMAT(DATE_SUB(agg2.min_delivery_date_2, INTERVAL '" . $backward_days . ' ' . $backward_hours . ':' . sprintf('%02d', $backward_minutes) . "' DAY_MINUTE),'%Y-%m-%d %H:%i:%s') AS new_delivery_date, + CASE DATE_FORMAT(DATE_SUB(agg2.min_delivery_date_2, INTERVAL '" . $backward_days . ' ' . $backward_hours . ':' . sprintf('%02d', $backward_minutes) . "' DAY_MINUTE), '%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' + END AS new_delivery_day + FROM " . FOOTB_MATCHDAYS . " AS md2 + INNER JOIN (SELECT season, league, matchday, min(match_datetime) AS min_delivery_date_2 + FROM " . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND status = -1 + GROUP BY season, league, matchday) AS agg2 + WHERE md2.season = agg2.season + AND md2.league = agg2.league + AND md2.matchday = agg2.matchday) + UNION + (SELECT md3.matchday, + 3 AS number, + md3.delivery_date_3 AS delivery_date, + CASE DATE_FORMAT(md3.delivery_date_3,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' + END AS delivery_date_day, + DATE_FORMAT(DATE_SUB(agg3.min_delivery_date_3, INTERVAL '" . $backward_days . ' ' . $backward_hours . ':' . sprintf('%02d', $backward_minutes) . "' DAY_MINUTE),'%Y-%m-%d %H:%i:%s') AS new_delivery_date, + CASE DATE_FORMAT(DATE_SUB(agg3.min_delivery_date_3, INTERVAL '" . $backward_days . ' ' . $backward_hours . ':' . sprintf('%02d', $backward_minutes) . "' DAY_MINUTE), '%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' + END AS new_delivery_day + FROM " . FOOTB_MATCHDAYS . " AS md3 + INNER JOIN (SELECT season, league, matchday, min(match_datetime) AS min_delivery_date_3 + FROM " . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND status = -2 + GROUP BY season, league, matchday) AS agg3 + WHERE md3.season = agg3.season + AND md3.league = agg3.league + AND md3.matchday = agg3.matchday) + ORDER BY matchday ASC, number ASC"; + $result = $db->sql_query($sql); + $rows_matchdays = $db->sql_fetchrowset($result); + $row_number = 0; + foreach ($rows_matchdays as $row_matchday) + { + $row_number++; + $row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('delivery', array( + 'ROW_CLASS' => $row_class, + 'MATCHDAY' => $row_matchday['matchday'], + 'NUMBER' => $row_matchday['number'], + 'DELIVERY_ERROR' => ($row_matchday['delivery_date'] > $row_matchday['new_delivery_date']) ? true : false, + 'DELIVERY_DATE_DAY' => $row_matchday['delivery_date_day'], + 'DELIVERY_DATE' => $row_matchday['delivery_date'], + 'NEW_DELIVERY_DAY' => $row_matchday['new_delivery_day'], + 'NEW_DELIVERY' => $row_matchday['new_delivery_date'], + ) + ); + } + case 'change_delivery': + $edit_delivery = false; + $change_delivery = true; + $backwards_days_options = ''; + for ($i = 0; $i < 7; $i++) + { + $selected = ($i == $backward_days) ? ' selected="selected"' : ''; + $backwards_days_options .= ""; + } + $backwards_hours_options = ''; + for ($i = 0; $i < 24; $i++) + { + $selected = ($i == $backward_hours) ? ' selected="selected"' : ''; + $backwards_hours_options .= ""; + } + $backwards_minutes_options = ''; + for ($i = 0; $i < 60; $i = $i + 5) + { + $selected = ($i == $backward_minutes) ? ' selected="selected"' : ''; + $backwards_minutes_options .= ""; + } + + $u_back = $this->u_action . "&s=$season&l=$league"; + + $template->assign_vars(array( + 'S_EDIT' => false, + 'S_CHANGE_DELIVERY' => true, + 'S_SHOW_DELIVERY_SELECT' => $show_delivery_select, + 'S_SHOW_DELIVERY' => $show_delivery, + 'S_BACKWARD_DAYS_OPTIONS' => $backwards_days_options, + 'S_BACKWARD_HOURS_OPTIONS' => $backwards_hours_options, + 'S_BACKWARD_MINUTES_OPTIONS' => $backwards_minutes_options, + 'S_VERSION_NO' => $this->config['football_version'], + 'SEASON' => $season, + 'SEASON_NAME' => $season_name, + 'LEAGUE' => $league, + 'LEAGUE_NAME' => $league_name, + 'U_BACK' => $u_back, + 'U_ACTION' => "{$this->u_action}&action=$action&s=$season&l=$league", + ) + ); + return; + break; + 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 (!$matchday) + { + trigger_error($user->lang['NO_MATCHDAY'] . 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 && $this->config['football_founder_delete']) + { + trigger_error($user->lang['MATCHDAYS_NO_DELETE'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING); + } + + // Delete matchday + $sql = 'DELETE FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season AND league = $league AND matchday = $matchday"; + $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 matchday = $matchday)"; + $db->sql_query($sql); + + // Delete matches + $sql = 'DELETE FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND matchday = $matchday"; + $db->sql_query($sql); + + trigger_error($user->lang['MATCHDAY_DELETED'] . adm_back_link($this->u_action . "&s=$season&l=$league")); + } + else + { + confirm_box(false, sprintf($user->lang['MATCHDAY_CONFIRM_DELETE'], $matchday, $season), build_hidden_fields(array( + 's' => $season, + 'l' => $league, + 'm' => $matchday, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + case 'remove': + 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 (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 && $this->config['football_founder_delete']) + { + trigger_error($user->lang['MATCHDAYS_NO_DELETE'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING); + } + + // Delete matchday + $sql = 'DELETE FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season AND league = $league AND matchday > $league_matchdays"; + $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 matchday > $league_matchdays)"; + $db->sql_query($sql); + + // Delete matches + $sql = 'DELETE FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND matchday > $league_matchdays"; + $db->sql_query($sql); + + trigger_error($user->lang['MATCHDAYS_REMOVED'] . adm_back_link($this->u_action . "&s=$season&l=$league")); + } + else + { + confirm_box(false, sprintf($user->lang['MATCHDAY_CONFIRM_REMOVE'], $season), build_hidden_fields(array( + 's' => $season, + 'l' => $league, + 'm' => $matchday, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + + case 'add': + $sql = "SELECT + matchday + FROM " . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + $rows_matchdays = $db->sql_fetchrowset($result); + $existing_matchdays = sizeof($rows_matchdays); + $db->sql_freeresult($result); + if ($existing_matchdays < $league_matchdays) + { + $last_matchday = 0; + $count_updates = 0; + if ($existing_matchdays > 0) + { + foreach ($rows_matchdays as $row_exist) + { + if ($last_matchday + 1 < $row_exist['matchday']) + { + for ( $i = $last_matchday + 1; $i < $row_exist['matchday']; $i++ ) + { + $count_updates++; + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'matchday' => (int) $i, + 'status' => 0, + 'delivery_date' => '', + 'delivery_date_2' => '', + 'delivery_date_3' => '', + 'matchday_name' => '', + 'matches' => 0, + ); + $sql = 'INSERT INTO ' . FOOTB_MATCHDAYS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + } + $last_matchday = $row_exist['matchday']; + } + for ( $i = $last_matchday + 1; $i <= $league_matchdays; $i++ ) + { + $count_updates++; + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'matchday' => (int) $i, + 'status' => 0, + 'delivery_date' => '', + 'delivery_date_2' => '', + 'delivery_date_3' => '', + 'matchday_name' => '', + 'matches' => 0, + ); + + $sql = 'INSERT INTO ' . FOOTB_MATCHDAYS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + } + else + { + for ( $i = 1; $i <= $league_matchdays; $i++ ) + { + $count_updates++; + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'matchday' => (int) $i, + 'status' => 0, + 'delivery_date' => '', + 'delivery_date_2' => '', + 'delivery_date_3' => '', + 'matchday_name' => '', + 'matches' => 0, + ); + + $sql = 'INSERT INTO ' . FOOTB_MATCHDAYS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + } + $message = ($count_updates > 1) ? 'MATCHDAYS_CREATED' : 'MATCHDAY_CREATED'; + trigger_error(sprintf($user->lang[$message],$count_updates) . adm_back_link($this->u_action . "&s=$season&l=$league")); + } + else + { + trigger_error($user->lang['NO_MORE_MATCHDAYS'] . adm_back_link($this->u_action . "&s=$season&l=$league")); + } + // No break for edit add + case 'edit': + $data = array(); + $error_msg = array(); + + if (!sizeof($error)) + { + if ($action == 'edit' && !$matchday) + { + trigger_error($user->lang['NO_MATCHDAY'] . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING); + } + $data = array( + 'dday1_day' => 0, + 'dday1_month' => 0, + 'dday1_year' => 0, + 'dday1_hour' => 0, + 'dday1_min' => 0, + 'dday2_day' => 0, + 'dday2_month' => 0, + 'dday2_year' => 0, + 'dday2_hour' => 0, + 'dday2_min' => 0, + 'dday3_day' => 0, + 'dday3_month' => 0, + 'dday3_year' => 0, + 'dday3_hour' => 0, + 'dday3_min' => 0, + ); + if ($matchday_row['delivery_date']) + { + list($data['dday1_date'], $data['dday1_time']) = explode(' ', $matchday_row['delivery_date']); + list($data['dday1_year'], $data['dday1_month'], $data['dday1_day']) = explode('-', $data['dday1_date']); + list($data['dday1_hour'], $data['dday1_min'], $data['dday1_sec']) = explode(':', $data['dday1_time']); + } + + $data['dday1_day'] = $this->request->variable('dday1_day', $data['dday1_day']); + $data['dday1_month'] = $this->request->variable('dday1_month', $data['dday1_month']); + $data['dday1_year'] = $this->request->variable('dday1_year', $data['dday1_year']); + $data['dday1_hour'] = $this->request->variable('dday1_hour', $data['dday1_hour']); + $data['dday1_min'] = $this->request->variable('dday1_min', $data['dday1_min']); + $data['dday1_sec'] = '00'; + $data['dday1_date'] = sprintf('%02d-%02d-%04d', $data['dday1_day'], $data['dday1_month'], $data['dday1_year']); + $data['dday1_time'] = sprintf('%02d:%02d:%02d', $data['dday1_hour'], $data['dday1_min'], $data['dday1_sec']); + $matchday_row['delivery_date'] = sprintf('%04d-%02d-%02d', $data['dday1_year'], $data['dday1_month'], $data['dday1_day']) . ' ' . $data['dday1_time']; + + if ($matchday_row['delivery_date_2']) + { + list($data['dday2_date'], $data['dday2_time']) = explode(' ', $matchday_row['delivery_date_2']); + list($data['dday2_year'], $data['dday2_month'], $data['dday2_day']) = explode('-', $data['dday2_date']); + list($data['dday2_hour'], $data['dday2_min'], $data['dday2_sec']) = explode(':', $data['dday2_time']); + } + + $data['dday2_day'] = $this->request->variable('dday2_day', $data['dday2_day']); + $data['dday2_month'] = $this->request->variable('dday2_month', $data['dday2_month']); + $data['dday2_year'] = $this->request->variable('dday2_year', $data['dday2_year']); + $data['dday2_hour'] = $this->request->variable('dday2_hour', $data['dday2_hour']); + $data['dday2_min'] = $this->request->variable('dday2_min', $data['dday2_min']); + $data['dday2_sec'] = '00'; + if (!$data['dday2_day'] and !$data['dday2_month'] and !$data['dday2_year']) + { + $matchday_row['delivery_date_2'] = ''; + $data['dday2_date'] = '01-01-1980'; + } + else + { + $data['dday2_date'] = sprintf('%02d-%02d-%04d', $data['dday2_day'], $data['dday2_month'], $data['dday2_year']); + $data['dday2_time'] = sprintf('%02d:%02d:%02d', $data['dday2_hour'], $data['dday2_min'], $data['dday2_sec']); + $matchday_row['delivery_date_2'] = sprintf('%04d-%02d-%02d', $data['dday2_year'], $data['dday2_month'], $data['dday2_day']) . + ' ' . $data['dday2_time']; + + } + + if ($matchday_row['delivery_date_3']) + { + list($data['dday3_date'], $data['dday3_time']) = explode(' ', $matchday_row['delivery_date_3']); + list($data['dday3_year'], $data['dday3_month'], $data['dday3_day']) = explode('-', $data['dday3_date']); + list($data['dday3_hour'], $data['dday3_min'], $data['dday3_sec']) = explode(':', $data['dday3_time']); + } + + $data['dday3_day'] = $this->request->variable('dday3_day', $data['dday3_day']); + $data['dday3_month'] = $this->request->variable('dday3_month', $data['dday3_month']); + $data['dday3_year'] = $this->request->variable('dday3_year', $data['dday3_year']); + $data['dday3_hour'] = $this->request->variable('dday3_hour', $data['dday3_hour']); + $data['dday3_min'] = $this->request->variable('dday3_min', $data['dday3_min']); + $data['dday3_sec'] = '00'; + if (!$data['dday3_day'] and !$data['dday3_month'] and !$data['dday3_year']) + { + $matchday_row['delivery_date_3'] = ''; + $data['dday3_date'] = '01-01-1980'; + } + else + { + $data['dday3_date'] = sprintf('%02d-%02d-%04d', $data['dday3_day'], $data['dday3_month'], $data['dday3_year']); + $data['dday3_time'] = sprintf('%02d:%02d:%02d', $data['dday3_hour'], $data['dday3_min'], $data['dday3_sec']); + $matchday_row['delivery_date_3'] = sprintf('%04d-%02d-%02d', $data['dday3_year'], $data['dday3_month'], $data['dday3_day']) . + ' ' . $data['dday3_time']; + } + + // 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); + } + + $matchday_row['matchday_name'] = utf8_normalize_nfc($this->request->variable('matchday_name', '', true)); + $matchday_row['status'] = utf8_normalize_nfc($this->request->variable('matchday_status', '', true)); + $matchday_row['matches'] = utf8_normalize_nfc($this->request->variable('matchday_matches', $matchday_row['matches'], true)); + + if ($data['dday1_day'] <> '--' and $data['dday1_month'] <> '--' and $data['dday1_year'] <> '--') + { + $delivery_timestamp = mktime($data['dday1_hour'], $data['dday1_min'], 0, $data['dday1_month'], $data['dday1_day'], $data['dday1_year']); + $local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600); + if ($delivery_timestamp > $local_board_time AND $matchday_row['status'] == 0) + { + // check if delivery is before all open matches + $sql = "SELECT + match_no + FROM " . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND matchday = $matchday + AND status = 0 + AND match_datetime < FROM_UNIXTIME('$delivery_timestamp')"; + $result = $db->sql_query($sql); + $open_matches = ''; + while ($rows_open = $db->sql_fetchrow($result)) + { + $open_matches .= ($open_matches == '') ? $rows_open['match_no'] : ', ' . $rows_open['match_no']; + } + $db->sql_freeresult($result); + if ($open_matches <> '') + { + $error[] = (strpos($open_matches, ',')) ? sprintf($user->lang['OPEN_MATCHES'], $open_matches) : + sprintf($user->lang['OPEN_MATCH'], $open_matches); + } + } + + if ($delivery_timestamp > $local_board_time AND ($matchday_row['status'] == 1 OR $matchday_row['status'] == 2)) + { + $sql_ary = array( + 'status' => 0, + ); + // set all matches after delivery on status 0 + $sql = 'UPDATE ' . FOOTB_MATCHES . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season + AND league = $league + AND matchday = $matchday + AND status IN (1, 2) + AND match_datetime >= FROM_UNIXTIME('$delivery_timestamp')"; + $db->sql_query($sql); + // check on open matches + $sql = "SELECT + match_no + FROM " . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND matchday = $matchday + AND status = 0"; + $result = $db->sql_query($sql); + if ($rows_open = $db->sql_fetchrow($result)) + { + // reopen matchday + $matchday_row['status'] = 0; + } + } + } + else + { + $error[] = $user->lang['NO_DELIVERY']; + } + + if ($data['dday2_day'] <> '--' and $data['dday2_month'] <> '--' and $data['dday2_year'] <> '--') + { + $delivery2_timestamp = mktime($data['dday2_hour'], $data['dday2_min'], 0, $data['dday2_month'], $data['dday2_day'], $data['dday2_year']); + if ($delivery2_timestamp < $delivery_timestamp) + { + $error[] = $user->lang['TOO_SMALL_DELIVERY2']; + } + } + else + { + $delivery2_timestamp = 0; + } + + if ($data['dday3_day'] <> '--' and $data['dday3_month'] <> '--' and $data['dday3_year'] <> '--') + { + if ($delivery2_timestamp == 0) + { + $error[] = $user->lang['NO_DELIVERY2']; + } + $delivery3_timestamp = mktime($data['dday3_hour'], $data['dday3_min'], 0, $data['dday3_month'], $data['dday3_day'], $data['dday3_year']); + if ($delivery3_timestamp < $delivery2_timestamp) + { + $error[] = $user->lang['TOO_SMALL_DELIVERY3']; + } + } + + if ($ko_league) + { + $data['matches'] = $matchday_row['matches']; + } + else + { + $data['matches'] = ''; + } + if (!sizeof($error)) + { + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'matchday' => (int) $matchday, + 'status' => $matchday_row['status'], + 'delivery_date' => $matchday_row['delivery_date'], + 'delivery_date_2' => strlen($matchday_row['delivery_date_2']) ? $matchday_row['delivery_date_2'] : '', + 'delivery_date_3' => strlen($matchday_row['delivery_date_3']) ? $matchday_row['delivery_date_3'] : '', + 'matchday_name' => strlen($matchday_row['matchday_name']) ? $matchday_row['matchday_name'] : '', + 'matches' => strlen($matchday_row['matches']) ? $matchday_row['matches'] : 0, + ); + + $var_ary = array( + 'dday1_date' => array('date', false), + 'dday2_date' => array('date', false), + 'dday3_date' => array('date', false), + 'matches' => array('num', true, 1,99), + ); + if (!($error_vals = validate_data($data, $var_ary))) + { + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday"; + $db->sql_query($sql); + trigger_error($user->lang['MATCHDAY_UPDATED'] . adm_back_link($this->u_action . "&s=$season&l=$league")); + } + else + { + foreach ($error_vals as $error_val) + { + $error_msg[] = $user->lang[$error_val]; + } + $error[] = $user->lang['MATCHDAY_UPDATE_FAILED']; + $error = array_merge($error, $error_msg); + } + } + } + } + + $s_delivery1_day_options = ''; + for ($i = 1; $i < 32; $i++) + { + $selected = ($i == $data['dday1_day']) ? ' selected="selected"' : ''; + $s_delivery1_day_options .= ""; + } + + $s_delivery1_month_options = ''; + for ($i = 1; $i < 13; $i++) + { + $selected = ($i == $data['dday1_month']) ? ' selected="selected"' : ''; + $s_delivery1_month_options .= ""; + } + $s_delivery1_year_options = ''; + + $s_delivery1_year_options = ''; + for ($i = $season - 1 ; $i <= $season; $i++) + { + $selected = ($i == $data['dday1_year']) ? ' selected="selected"' : ''; + $s_delivery1_year_options .= ""; + } + + $s_delivery1_hour_options = ''; + if (!$data['dday1_hour']) + { + $data['dday1_hour'] = 0; + } + for ($i = 0; $i < 24; $i++) + { + $selected = ($i == $data['dday1_hour']) ? ' selected="selected"' : ''; + $s_delivery1_hour_options .= ""; + } + + $s_delivery1_min_options = ''; + if (!$data['dday1_min']) + { + $data['dday1_min'] = 0; + } + for ($i = 0; $i < 12; $i++) + { + $selected = (($i * 5) == $data['dday1_min']) ? ' selected="selected"' : ''; + $s_delivery1_min_options .= ""; + } + + $s_delivery2_day_options = ''; + for ($i = 1; $i < 32; $i++) + { + $selected = ($i == $data['dday2_day']) ? ' selected="selected"' : ''; + $s_delivery2_day_options .= ""; + } + + $s_delivery2_month_options = ''; + for ($i = 1; $i < 13; $i++) + { + $selected = ($i == $data['dday2_month']) ? ' selected="selected"' : ''; + $s_delivery2_month_options .= ""; + } + $s_delivery2_year_options = ''; + + $s_delivery2_year_options = ''; + for ($i = $season - 1 ; $i <= $season; $i++) + { + $selected = ($i == $data['dday2_year']) ? ' selected="selected"' : ''; + $s_delivery2_year_options .= ""; + } + + $s_delivery2_hour_options = ''; + if (!$data['dday2_hour']) + { + $data['dday2_hour'] = 0; + } + for ($i = 0; $i < 24; $i++) + { + $selected = ($i == $data['dday2_hour']) ? ' selected="selected"' : ''; + $s_delivery2_hour_options .= ""; + } + + $s_delivery2_min_options = ''; + if (!$data['dday2_min']) + { + $data['dday2_min'] = 0; + } + for ($i = 0; $i < 12; $i++) + { + $selected = (($i * 5) == $data['dday2_min']) ? ' selected="selected"' : ''; + $s_delivery2_min_options .= ""; + } + + $s_delivery3_day_options = ''; + for ($i = 1; $i < 32; $i++) + { + $selected = ($i == $data['dday3_day']) ? ' selected="selected"' : ''; + $s_delivery3_day_options .= ""; + } + + $s_delivery3_month_options = ''; + for ($i = 1; $i < 13; $i++) + { + $selected = ($i == $data['dday3_month']) ? ' selected="selected"' : ''; + $s_delivery3_month_options .= ""; + } + $s_delivery3_year_options = ''; + + $s_delivery3_year_options = ''; + for ($i = $season - 1 ; $i <= $season; $i++) + { + $selected = ($i == $data['dday3_year']) ? ' selected="selected"' : ''; + $s_delivery3_year_options .= ""; + } + + $s_delivery3_hour_options = ''; + if (!$data['dday3_hour']) + { + $data['dday3_hour'] = 0; + } + for ($i = 0; $i < 24; $i++) + { + $selected = ($i == $data['dday3_hour']) ? ' selected="selected"' : ''; + $s_delivery3_hour_options .= ""; + } + + $s_delivery3_min_options = ''; + if (!$data['dday3_min']) + { + $data['dday3_min'] = 0; + } + for ($i = 0; $i < 12; $i++) + { + $selected = (($i * 5) == $data['dday3_min']) ? ' selected="selected"' : ''; + $s_delivery3_min_options .= ""; + } + + + $status_options = ''; + for ( $i = 0; $i < 4; $i++ ) + { + $selected = ($matchday_row['status'] == $i) ? ' selected="selected"' : ''; + $status_options .= ''; + } + + // check if matches created + $existing_matches_on_matchday = count_existing_matches($season, $league, $matchday); + + $u_back = $this->u_action . "&s=$season&l=$league"; + + $template->assign_vars(array( + 'S_EDIT' => true, + 'S_ADD_MATCHDAY' => ($action == 'add') ? true : false, + 'S_ERROR' => (sizeof($error)) ? true : false, + 'S_KO_LEAGUE' => $ko_league, + 'S_EDIT_DELIVERY' => $edit_delivery, + 'S_UPDATE_DELIVERY' => false, + 'S_EDIT_MATCHES' => ($existing_matches_on_matchday) ? false : true, + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + 'SEASON' => $season, + 'SEASON_NAME' => $season_name, + 'LEAGUE' => $league, + 'LEAGUE_NAME' => $league_name, + 'MATCHDAY' => $matchday, + 'MATCHDAY_NAME' => $matchday_row['matchday_name'], + 'MATCHDAY_STATUS' => $matchday_row['status'], + 'MATCHDAY_MATCHES' => $matchday_row['matches'], + 'MATCHDAY_DEL1' => $matchday_row['delivery_date'], + 'MATCHDAY_DEL2' => $matchday_row['delivery_date_2'], + 'MATCHDAY_DEL3' => $matchday_row['delivery_date_3'], + 'S_DELIVERY1_DAY_OPTIONS' => $s_delivery1_day_options, + 'S_DELIVERY1_MONTH_OPTIONS' => $s_delivery1_month_options, + 'S_DELIVERY1_YEAR_OPTIONS' => $s_delivery1_year_options, + 'S_DELIVERY1_HOUR_OPTIONS' => $s_delivery1_hour_options, + 'S_DELIVERY1_MIN_OPTIONS' => $s_delivery1_min_options, + 'S_DELIVERY2_DAY_OPTIONS' => $s_delivery2_day_options, + 'S_DELIVERY2_MONTH_OPTIONS' => $s_delivery2_month_options, + 'S_DELIVERY2_YEAR_OPTIONS' => $s_delivery2_year_options, + 'S_DELIVERY2_HOUR_OPTIONS' => $s_delivery2_hour_options, + 'S_DELIVERY2_MIN_OPTIONS' => $s_delivery2_min_options, + 'S_DELIVERY3_DAY_OPTIONS' => $s_delivery3_day_options, + 'S_DELIVERY3_MONTH_OPTIONS' => $s_delivery3_month_options, + 'S_DELIVERY3_YEAR_OPTIONS' => $s_delivery3_year_options, + 'S_DELIVERY3_HOUR_OPTIONS' => $s_delivery3_hour_options, + 'S_DELIVERY3_MIN_OPTIONS' => $s_delivery3_min_options, + 'S_VERSION_NO' => $this->config['football_version'], + 'U_BACK' => $u_back, + 'U_ACTION' => "{$this->u_action}&action=$action&s=$season&l=$league", + ) + ); + + return; + break; + } + + // Get us all the matchdays + $lang_dates = $user->lang['datetime']; + $sql = "SELECT *, + CONCAT( + CASE DATE_FORMAT(delivery_date,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(delivery_date,' %d.%m.%y %H:%i') + ) AS match_time, + CONCAT( + CASE DATE_FORMAT(delivery_date_2,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(delivery_date_2,' %d.%m.%y %H:%i') + ) AS match_time_2, + CONCAT( + CASE DATE_FORMAT(delivery_date_3,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(delivery_date_3,' %d.%m.%y %H:%i') + ) AS match_time_3, + DATE_FORMAT(delivery_date, '%dd') AS deliveryday, + DATE_FORMAT(delivery_date, ' %d.%m.%Y um %H:%i ') AS delivery + FROM " . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + $rows_matchdays = $db->sql_fetchrowset($result); + $existing_matchdays = sizeof($rows_matchdays); + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), + 'S_SEASON' => $season, + 'S_LEAGUE' => $league, + 'S_SEASON_OPTIONS' => $season_options, + 'S_LEAGUE_OPTIONS' => $league_options, + 'S_MATCHDAY_ADD' => ($league_matchdays > $existing_matchdays) ? true : false, + 'S_MATCHDAYS_REMOVE'=> ($league_matchdays < $existing_matchdays) ? true : false, + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + + // Check if the user is allowed to delete a matchday. + if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) + { + $allow_delete = false; + } + else + { + $allow_delete = true; + } + + $row_number = 0; + foreach ($rows_matchdays as $row_matchday) + { + $row_number++; + $row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('matchdays', array( + 'ROW_CLASS' => $row_class, + 'MATCHDAY' => $row_matchday['matchday'], + 'MATCHDAY_NAME' => $row_matchday['matchday_name'], + 'MATCHDAY_STATUS' => $row_matchday['status'], + 'MATCHDAY_DELIVERY' => $row_matchday['match_time'], + 'MATCHDAY_DELIVERY_2' => $row_matchday['match_time_2'], + 'MATCHDAY_DELIVERY_3' => $row_matchday['match_time_3'], + 'U_EDIT' => "{$this->u_action}&action=edit&s=" . $season . "&l=" .$league . "&m=" .$row_matchday['matchday'], + 'U_DELETE' => ($allow_delete) ? "{$this->u_action}&action=delete&s=" . $season . "&l=" . $league . "&m=" . $row_matchday['matchday'] : '', + ) + ); + } + } +} +?> \ No newline at end of file diff --git a/acp/matches_info.php b/acp/matches_info.php new file mode 100644 index 0000000..4707081 --- /dev/null +++ b/acp/matches_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\matches_module', + 'title' => 'ACP_FOOTBALL_MATCHES_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_MATCHES_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_MATCHES')), + ), + ); + } +} diff --git a/acp/matches_module.php b/acp/matches_module.php new file mode 100644 index 0000000..7420566 --- /dev/null +++ b/acp/matches_module.php @@ -0,0 +1,767 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_matches'); + + $this->root_path = $phpbb_root_path . 'ext/football/football/'; + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + + if(!function_exists('season_info')) + { + include($this->root_path . 'includes/functions.' . $this->php_ext); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->root_path . 'includes/constants.' . $this->php_ext); + } + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $this->tpl_name = 'acp_football_matches'; + $this->page_title = 'ACP_FOOTBALL_MATCHES_MANAGE'; + + $form_key = 'acp_football_matches'; + add_form_key($form_key); + + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + + // Check and set some common vars + $action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', ''); + $edit = $this->request->variable('edit', 0); + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $matchday = $this->request->variable('m', 0); + $match_number = $this->request->variable('g', 0); + $update = (isset($_POST['update'])) ? true : false; + + // Clear some vars + $match_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 .= ''; + 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 = current_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 .= ''; + if ($selected <> '') + { + $league_info = $row; + $league_matchdays = $row['matchdays']; + $matches_matchday = $row['matches_on_matchday']; + $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 basic data for select matchday + if (!$matchday) + { + $matchday = curr_matchday($season, $league); + } + $sql = 'SELECT *, + UNIX_TIMESTAMP(delivery_date) AS unix_delivery_date + FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + + $delivery2 = ''; + $delivery3 = ''; + $matchday_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($matchday && $row['matchday'] == $matchday) ? ' selected="selected"' : ''; + $day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']); + $matchday_options .= ''; + if ($selected <> '') + { + $unix_delivery_date = $row['unix_delivery_date']; + $delivery2 = $row['delivery_date_2']; + $delivery3 = $row['delivery_date_3']; + $matchday_name = $day_name; + if ($matches_matchday) + { + $matches_on_matchday = $matches_matchday; + } + else + { + $matches_on_matchday = $row['matches']; + } + } + } + $db->sql_freeresult($result); + if ($matchday_options == '') + { + trigger_error(sprintf($user->lang['NO_MATCHDAY'], $league_name, $season) . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING); + } + + // Grab basic data for match, if match is set and exists + if ($match_number) + { + $sql = 'SELECT * + FROM ' . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND match_no = $match_number"; + $result = $db->sql_query($sql); + $match_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + // 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 (!$matchday) + { + trigger_error($user->lang['NO_MATCHDAY'] . 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&m=$matchday"), E_USER_WARNING); + } + if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) + { + trigger_error($user->lang['MATCHES_NO_DELETE'] . adm_back_link($this->u_action . "&s=$season&l=$league&m=$matchday"), E_USER_WARNING); + } + + // Delete match + $sql = 'DELETE FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND match_no = $match_number"; + $db->sql_query($sql); + + // Delete bets + $sql = 'DELETE FROM ' . FOOTB_BETS . " + WHERE season = $season AND league = $league AND match_no = $match_number"; + $db->sql_query($sql); + + trigger_error($user->lang['MATCH_DELETED'] . adm_back_link($this->u_action . "&s=$season&l=$league&m=$matchday")); + } + else + { + confirm_box(false, sprintf($user->lang['MATCH_CONFIRM_DELETE'], $match_row['match_no'], $league_name, $season), build_hidden_fields(array( + 's' => $season, + 'l' => $league, + 'm' => $matchday, + 'g' => $match_number, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + + case 'add': + $sql = "SELECT DISTINCT user_id + FROM " . FOOTB_BETS . " + WHERE season = $season + AND league = $league"; + $result = $db->sql_query($sql); + $rows_users = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $sql = "SELECT + matchday, + matches AS matches_matchday, + delivery_date + FROM " . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + $rows_matchdays = $db->sql_fetchrowset($result); + $existing_matchdays = sizeof($rows_matchdays); + $db->sql_freeresult($result); + if ($existing_matchdays < $league_matchdays) + { + trigger_error($user->lang['MATCHDAY_MISSED'] . adm_back_link($this->u_action . "&s=$season&l=$league&m=$matchday")); + } + else + { + $current_match = 0; + $count_updates = 0; + $sql_betary = array(); + foreach ($rows_matchdays as $current_matchday) + { + if ($matches_matchday) + { + $matches_on_matchday = $matches_matchday; + } + else + { + $matches_on_matchday = $current_matchday['matches_matchday']; + } + for ( $i = 1; $i <= $matches_on_matchday; $i++ ) + { + $current_match++; + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'match_no' => (int) $current_match, + 'team_id_home' => 0, + 'team_id_guest' => 0, + 'goals_home' => '', + 'goals_guest' => '', + 'matchday' => $current_matchday['matchday'], + 'status' => 0, + 'odd_1' => 0, + 'odd_x' => 0, + 'odd_2' => 0, + 'rating' => 0, + 'match_datetime' => $current_matchday['delivery_date'], + 'group_id' => '', + 'formula_home' => '', + 'formula_guest' => '', + 'ko_match' => 0, + 'goals_overtime_home' => '', + 'goals_overtime_guest' => '', + ); + $sql = 'INSERT IGNORE INTO ' . FOOTB_MATCHES . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + if ($db->sql_affectedrows()) + { + $count_updates++; + foreach ($rows_users as $current_user) + { + $sql_betary[] = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'match_no' => (int) $current_match, + 'user_id' => $current_user['user_id'], + 'goals_home' => '', + 'goals_guest' => '', + 'bet_time' => 0, + ); + } + } + } + } + if (sizeof($sql_betary)) + { + $db->sql_multi_insert(FOOTB_BETS, $sql_betary); + } + $message = ($count_updates > 1) ? 'MATCHES_CREATED' : 'MATCH_CREATED'; + trigger_error(sprintf($user->lang[$message],$count_updates) . adm_back_link($this->u_action . "&s=$season&l=$league&m=$matchday")); + } + break; + case 'edit': + $data = array(); + $error_msg = array(); + + if (!sizeof($error)) + { + if ($action == 'edit' && !$match_number) + { + trigger_error($user->lang['NO_MATCH'] . adm_back_link($this->u_action . "&s=$season&l=$league&m=$matchday"), E_USER_WARNING); + } + + $data = array( + 'mday_day' => 0, + 'mday_month' => 0, + 'mday_year' => 0, + 'mday_hour' => 0, + 'mday_min' => 0, + ); + if ($match_row['match_datetime']) + { + list($data['mday_date'], $data['mday_time']) = explode(' ', $match_row['match_datetime']); + list($data['mday_year'], $data['mday_month'], $data['mday_day']) = explode('-', $data['mday_date']); + list($data['mday_hour'], $data['mday_min'], $data['mday_sec']) = explode(':', $data['mday_time']); + } + + $data['mday_day'] = $this->request->variable('mday_day', $data['mday_day']); + $data['mday_month'] = $this->request->variable('mday_month', $data['mday_month']); + $data['mday_year'] = $this->request->variable('mday_year', $data['mday_year']); + $data['mday_hour'] = $this->request->variable('mday_hour', $data['mday_hour']); + $data['mday_min'] = $this->request->variable('mday_min', $data['mday_min']); + $data['mday_sec'] = '00'; + $data['mday_date'] = sprintf('%02d-%02d-%04d', $data['mday_day'], $data['mday_month'], $data['mday_year']); + $data['mday_time'] = sprintf('%02d:%02d:%02d', $data['mday_hour'], $data['mday_min'], $data['mday_sec']); + $match_row['match_datetime'] = sprintf('%04d-%02d-%02d', $data['mday_year'], $data['mday_month'], $data['mday_day']) . ' ' . $data['mday_time']; + + // 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&m=$matchday"), E_USER_WARNING); + } + + $match_row['status'] = utf8_normalize_nfc($this->request->variable('match_status', '', true)); + $match_row['odd_1'] = round($this->request->variable('odd_1', $match_row['odd_1']),2); + $match_row['odd_x'] = round($this->request->variable('odd_x', $match_row['odd_x']),2); + $match_row['odd_2'] = round($this->request->variable('odd_2', $match_row['odd_2']),2); + $match_row['rating'] = round($this->request->variable('rating', $match_row['rating']),2); + $match_row['team_id_home'] = utf8_normalize_nfc($this->request->variable('team_home', '', true)); + $match_row['team_id_guest'] = utf8_normalize_nfc($this->request->variable('team_guest', '', true)); + $match_row['formula_home'] = utf8_normalize_nfc($this->request->variable('formula_home', '', true)); + $match_row['formula_guest'] = utf8_normalize_nfc($this->request->variable('formula_guest', '', true)); + $match_row['ko_match'] = $this->request->variable('match_ko', false); + $match_row['group_id'] = ($this->request->variable('group_match', false)) ? utf8_normalize_nfc($this->request->variable('match_group', '', true)) : ''; + + if ($match_row['team_id_home'] <> '') + { + $team_arr = explode(';', $match_row['team_id_home']); + $match_row['team_id_home'] = $team_arr[1]; + } + if ($match_row['team_id_guest'] <> '') + { + $team_arr = explode(';', $match_row['team_id_guest']); + $match_row['team_id_guest'] = $team_arr[1]; + } + + if ($data['mday_day'] <> '--' and $data['mday_month'] <> '--' and $data['mday_year'] <> '--') + { + $match_timestamp = mktime($data['mday_hour'], $data['mday_min'], 0, $data['mday_month'], $data['mday_day'], $data['mday_year']); + $local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600); + if ($match_timestamp > $local_board_time AND $match_row['status'] < 3 AND $league_info['bet_in_time'] == 1) + { + // Bet in time and match moved to future + $match_row['status'] = 0; + } + + if ($match_timestamp <= $local_board_time AND $match_row['status'] == 0 AND $league_info['bet_in_time'] == 1) + { + // Bet in time and match moved to past + $match_row['status'] = 1; + } + + if ($match_timestamp < $unix_delivery_date AND $match_row['status'] == 0 AND !$league_info['bet_in_time']) + { + // No bet in time and match moved before delivery + $error[] = $user->lang['MATCH_BEFORE_DELIVERY']; + } + } + else + { + $error[] = $user->lang['NO_MATCH_BEGIN']; + } + + if (!sizeof($error)) + { + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'match_no' => (int) $match_number, + 'team_id_home' => (is_numeric($match_row['team_id_home'])) ? $match_row['team_id_home'] : 0, + 'team_id_guest' => (is_numeric($match_row['team_id_guest'])) ? $match_row['team_id_guest'] : 0, + 'goals_home' => (is_numeric($match_row['goals_home'])) ? $match_row['goals_home'] : '', + 'goals_guest' => (is_numeric($match_row['goals_guest'])) ? $match_row['goals_guest'] : '', + 'matchday' => $match_row['matchday'], + 'status' => (is_numeric($match_row['status'])) ? $match_row['status'] : 0, + 'odd_1' => (is_numeric($match_row['odd_1'])) ? $match_row['odd_1'] : 0, + 'odd_x' => (is_numeric($match_row['odd_x'])) ? $match_row['odd_x'] : 0, + 'odd_2' => (is_numeric($match_row['odd_2'])) ? $match_row['odd_2'] : 0, + 'rating' => (is_numeric($match_row['rating'])) ? $match_row['rating'] : 0, + 'match_datetime' => $match_row['match_datetime'], + 'group_id' => strlen($match_row['group_id']) ? $match_row['group_id'] : '', + 'formula_home' => strlen($match_row['formula_home']) ? $match_row['formula_home'] : '', + 'formula_guest' => strlen($match_row['formula_guest']) ? $match_row['formula_guest'] : '', + 'ko_match' => $match_row['ko_match'] ? $match_row['ko_match'] : 0, + 'goals_overtime_home' => (is_numeric($match_row['goals_overtime_home'])) ? $match_row['goals_overtime_home'] : '', + 'goals_overtime_guest' => (is_numeric($match_row['goals_overtime_guest'])) ? $match_row['goals_overtime_guest'] : '', + ); + + + $var_ary = array( + 'mday_date' => array('date', false), + ); + if (!($error_vals = validate_data($data, $var_ary))) + { + $sql = 'UPDATE ' . FOOTB_MATCHES . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND match_no = $match_number"; + $db->sql_query($sql); + + if ($match_timestamp > $local_board_time AND $match_row['status'] == 0 AND $league_info['bet_in_time'] == 1) + { + // Bet in time and match (re)open so reopen matchday and set first delivery + $sql_ary = array( + 'status' => 0, + 'delivery_date' => first_delivery($season, $league, $matchday), + ); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday"; + $db->sql_query($sql); + } + + if ($match_timestamp <= $local_board_time AND $match_row['status'] <= 1 AND $league_info['bet_in_time'] == 1) + { + // Bet in time and match is closed so reopen matchday and set first delivery + $first_delivery = first_delivery($season, $league, $matchday); + if ($first_delivery <> '') + { + // Matchday has open matches, so set matchday status = 0 and first delivery + $sql_ary = array( + 'status' => 0, + 'delivery_date' => first_delivery($season, $league, $matchday), + ); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday"; + $db->sql_query($sql); + } + else + { + // Matchday has no open match, so set matchday status = 1 + $sql_ary = array( + 'status' => 1, + ); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday"; + $db->sql_query($sql); + } + } + trigger_error($user->lang['MATCH_UPDATED'] . adm_back_link($this->u_action . "&s=$season&l=$league&m=$matchday")); + } + else + { + foreach ($error_vals as $error_val) + { + $error_msg[] = $user->lang[$error_val]; + } + $error[] = $user->lang['MATCH_UPDATE_FAILED']; + $error = array_merge($error, $error_msg); + } + } + } + } + + $s_matchday_day_options = ''; + for ($i = 1; $i < 32; $i++) + { + $selected = ($i == $data['mday_day']) ? ' selected="selected"' : ''; + $s_matchday_day_options .= ""; + } + + $s_matchday_month_options = ''; + for ($i = 1; $i < 13; $i++) + { + $selected = ($i == $data['mday_month']) ? ' selected="selected"' : ''; + $s_matchday_month_options .= ""; + } + $s_matchday_year_options = ''; + + $s_matchday_year_options = ''; + for ($i = $season - 1 ; $i <= $season; $i++) + { + $selected = ($i == $data['mday_year']) ? ' selected="selected"' : ''; + $s_matchday_year_options .= ""; + } + + $s_matchday_hour_options = ''; + if (!$data['mday_hour']) + { + $data['mday_hour'] = 0; + } + for ($i = 0; $i < 24; $i++) + { + $selected = ($i == $data['mday_hour']) ? ' selected="selected"' : ''; + $s_matchday_hour_options .= ""; + } + + $s_matchday_min_options = ''; + if (!$data['mday_min']) + { + $data['mday_min'] = 0; + } + for ($i = 0; $i < 12; $i++) + { + $selected = (($i * 5) == $data['mday_min']) ? ' selected="selected"' : ''; + $s_matchday_min_options .= ""; + } + + // Selection status + $edit_status = false; + if ($match_row['status'] < 1) + { + $edit_status = true; + $selected_status = ($match_row['status'] == 0) ? ' selected="selected"' : ''; + $status_options = ''; + if ($delivery2 != '') + { + $selected_status = ($match_row['status'] == -1) ? ' selected="selected"' : ''; + $status_options .= ''; + if ($delivery3 != '') + { + $selected_status = ($match_row['status'] == -2) ? ' selected="selected"' : ''; + $status_options .= ''; + } + } + } + else + { + $status_options = ''; + } + // Grab for teams for selection + if ($ko_league) + { + $where_round = " AND matchday >= $matchday"; + } + else + { + $where_round = ""; + } + $sql = 'SELECT * + FROM ' . FOOTB_TEAMS . " + WHERE season = $season + AND league = $league + $where_round + ORDER BY team_name ASC"; + $result = $db->sql_query($sql); + $team_guest_options = ''; + $team_home_options = ''; + $match_group = ''; + while ($row = $db->sql_fetchrow($result)) + { + $guest_id = (empty($match_row['team_id_guest'])) ? 0 : $match_row['team_id_guest']; + $selected_guest = ($guest_id && $row['team_id'] == $guest_id) ? ' selected="selected"' : ''; + if ($row['team_id'] == $guest_id) + { + $match_group = $row['group_id']; + } + $team_guest_options .= ''; + $home_id = (empty($match_row['team_id_home'])) ? 0 : $match_row['team_id_home']; + $selected_home = ($home_id && $row['team_id'] == $home_id) ? ' selected="selected"' : ''; + $team_home_options .= ''; + } + + $u_back = $this->u_action . "&s=$season&l=$league&m=$matchday"; + + $template->assign_vars(array( + 'S_EDIT' => true, + 'S_ADD_MATCH' => ($action == 'add') ? true : false, + 'S_ERROR' => (sizeof($error)) ? true : false, + 'S_KO_LEAGUE' => $ko_league, + 'S_EDIT_STATUS' => $edit_status, + 'S_VERSION_NO' => $this->config['football_version'], + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + 'SEASON' => $season, + 'SEASON_NAME' => $season_name, + 'LEAGUE' => $league, + 'LEAGUE_NAME' => $league_name, + 'MATCHDAY' => $matchday, + 'MATCHDAY_NAME' => $matchday_name, + 'MATCH_NUMBER' => $match_number, + 'MATCH_STATUS' => $match_row['status'], + 'STATUS_OPTIONS' => $status_options, + 'S_GROUP_CHECKED' => (strlen($match_row['group_id']) > 0) ? true : false, + 'MATCH_GROUP' => $match_group, + 'S_KO_CHECKED' => $match_row['ko_match'], + 'FORMULA_HOME' => $match_row['formula_home'], + 'FORMULA_GUEST' => $match_row['formula_guest'], + 'FORMULA_HOME' => $match_row['formula_home'], + 'TEAM_GUEST_OPTIONS' => $team_guest_options, + 'TEAM_HOME_OPTIONS' => $team_home_options, + 'S_MATCHDAY_DAY_OPTIONS' => $s_matchday_day_options, + 'S_MATCHDAY_MONTH_OPTIONS' => $s_matchday_month_options, + 'S_MATCHDAY_YEAR_OPTIONS' => $s_matchday_year_options, + 'S_MATCHDAY_HOUR_OPTIONS' => $s_matchday_hour_options, + 'S_MATCHDAY_MIN_OPTIONS' => $s_matchday_min_options, + 'MATCH_BEGIN_D' => substr($match_row['match_datetime'],8,2), + 'MATCH_BEGIN_M' => substr($match_row['match_datetime'],5,2), + 'MATCH_BEGIN_Y' => substr($match_row['match_datetime'],0,4), + 'MATCH_BEGIN_H' => substr($match_row['match_datetime'],11,2), + 'MATCH_BEGIN_MIN' => substr($match_row['match_datetime'],14,2), + 'ODD_1' => $match_row['odd_1'], + 'ODD_x' => $match_row['odd_x'], + 'ODD_2' => $match_row['odd_2'], + 'RATING' => $match_row['rating'], + 'U_BACK' => $u_back, + 'U_ACTION' => "{$this->u_action}&action=$action&s=$season&l=$league&m=$matchday", + ) + ); + + return; + break; + } + + // Get us all the matches + $lang_dates = $user->lang['datetime']; + $sql = "SELECT + m.match_no, + m.status, + m.group_id, + m.ko_match, + m.formula_home, + m.formula_guest, + m.team_id_home AS home_id, + m.team_id_guest AS guest_id, + th.team_name AS home_name, + tg.team_name AS guest_name, + CONCAT( + CASE DATE_FORMAT(m.match_datetime,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(m.match_datetime,' %d.%m.%y %H:%i') + ) AS match_begin + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS th ON (th.season = m.season AND th.league = m.league AND th.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS tg ON (tg.season = m.season AND tg.league = m.league AND tg.team_id = m.team_id_guest) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + ORDER BY m.match_datetime ASC, m.match_no ASC"; + $result = $db->sql_query($sql); + $rows_matches = $db->sql_fetchrowset($result); + $existing_matches = sizeof($rows_matches); + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'S_SEASON' => $season, + 'S_LEAGUE' => $league, + 'S_KO_LEAGUE' => $ko_league, + 'S_MATCHDAY' => $matchday, + 'S_SEASON_OPTIONS' => $season_options, + 'S_LEAGUE_OPTIONS' => $league_options, + 'S_MATCHDAY_OPTIONS'=> $matchday_options, + 'S_MATCH_ADD' => ($matches_on_matchday == $existing_matches) ? false:true, + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + + // Check if the user is allowed to delete a match. + if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) + { + $allow_delete = false; + } + else + { + $allow_delete = true; + } + + $row_number = 0; + foreach ($rows_matches as $row_match) + { + $row_number++; + $row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('match', array( + 'ROW_CLASS' => $row_class, + 'MATCH_NUMBER' => $row_match['match_no'], + 'MATCH_STATUS' => $row_match['status'], + 'MATCH_GROUP' => $row_match['group_id'], + 'MATCH_KO' => ($row_match['ko_match']) ? 'KO' : '', + 'MATCH_BEGIN' => $row_match['match_begin'], + 'MATCH_HOME' => ($row_match['home_name'] == '') ? $row_match['formula_home'] : $row_match['home_name'], + 'MATCH_GUEST' => ($row_match['guest_name'] == '') ? $row_match['formula_guest'] : $row_match['guest_name'], + 'U_EDIT' => "{$this->u_action}&action=edit&s=" . $season . "&l=" .$league . "&m=" .$matchday . "&g=" .$row_match['match_no'], + 'U_DELETE' => ($allow_delete) ? "{$this->u_action}&action=delete&s=" . $season . "&l=" . $league . "&m=" . $matchday . "&g=" . $row_match['match_no'] : '', + ) + ); + } + } +} + +?> \ No newline at end of file diff --git a/acp/results_info.php b/acp/results_info.php new file mode 100644 index 0000000..a8b0bbf --- /dev/null +++ b/acp/results_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\results_module', + 'title' => 'ACP_FOOTBALL_RESULTS_MANAGEMENT', + 'version' => '1.0.0', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_RESULTS_MANAGE', 'auth' => 'acl_a_football_results', 'cat' => array('ACP_FOOTBALL_RESULTS')), + ), + ); + } +} diff --git a/acp/results_module.php b/acp/results_module.php new file mode 100644 index 0000000..0783528 --- /dev/null +++ b/acp/results_module.php @@ -0,0 +1,819 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_results'); + + $this->root_path = $phpbb_root_path . 'ext/football/football/'; + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + + if(!function_exists('season_info')) + { + include($this->root_path . 'includes/functions.' . $this->php_ext); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->root_path . 'includes/constants.' . $this->php_ext); + } + } + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) { + // Get an instance of the ultimatepoints functions_points + $functions_points = $phpbb_container->get('dmzx.ultimatepoints.core.functions.points'); + } + + $this->tpl_name = 'acp_football_results'; + $this->page_title = 'ACP_FOOTBALL_RESULTS_MANAGE'; + + $form_key = 'acp_football_results'; + add_form_key($form_key); + + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + + // Check and set some common vars + $action = (isset($_POST['edit'])) ? 'edit' : $this->request->variable('action', ''); + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $matchday = $this->request->variable('m', 0); + $update = (isset($_POST['update'])) ? true : false; + + // Close matchday + close_open_matchdays(); + + // Clear some vars + $success = array(); + + $curr_season = curr_season(); + // 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 .= ''; + 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) + { + $sql = 'SELECT * + FROM ' . FOOTB_MATCHES . " + WHERE season = $season + AND status in (0,1,2,4,5) + ORDER BY match_datetime ASC"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $league = $row['league']; + $matchday = $row['matchday']; + } + else + { + $league = first_league($season); + } + $db->sql_freeresult($result); + } + + // 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 .= ''; + if ($selected <> '') + { + $league_info = $row; + } + } + $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 basic data for select matchday + if (!$matchday) + { + $matchday = curr_matchday($season, $league); + } + $sql = 'SELECT * + FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + + $matchday_options = ''; + $worldfootball = false; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($matchday && $row['matchday'] == $matchday) ? ' selected="selected"' : ''; + $day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']); + $matchday_options .= ''; + if ($selected <> '') + { + $matchday_name = $day_name; + if ($league_info['matches_on_matchday']) + { + $matches_on_matchday = $league_info['matches_on_matchday']; + $worldfootball = ($row['status'] > 0) ? true : false; } + else + { + $matches_on_matchday = $row['matches']; + } + } + } + $db->sql_freeresult($result); + if ($matchday_options == '') + { + trigger_error(sprintf($user->lang['NO_MATCHDAY'], $league_info['league_name'], $season) . adm_back_link($this->u_action . "&s=$season&l=$league"), E_USER_WARNING); + } + $local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600); + + // Which page? + switch ($action) + { + case 'edit': + if ($season < $curr_season) + { + trigger_error("Diese Saison kann nicht mehr gespeichert werden!", E_USER_WARNING); + } + $sql = "SELECT * , + IF( match_datetime > FROM_UNIXTIME('$local_board_time'), 1, 0) As open_match + FROM " . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND matchday = $matchday"; + $result = $db->sql_query($sql); + $rows_matches = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $matches_on_matchday = sizeof($rows_matches); + $count_delete = 0; + $count_no_valuation = 0; + $count_results = 0; + foreach ($rows_matches as $row_match) + { + $match_num = $row_match['match_no']; + $status = $row_match['status']; + $select = $this->request->variable('select_' . $match_num, false); + $no_valuation = $this->request->variable('no_valuation_' . $match_num, false); + $open_match = $row_match['open_match']; + + if ($select or $no_valuation or (!$no_valuation and $status > 3)) + { + $goals_home = $this->request->variable('goals_home_' . $match_num, ''); + $goals_guest = $this->request->variable('goals_guest_' . $match_num, ''); + $overtime_home = $this->request->variable('overtime_home_' . $match_num, ''); + $overtime_guest = $this->request->variable('overtime_guest_' . $match_num, ''); + $delete = $this->request->variable('delete_' . $match_num, false); + + if ($delete) + { + $goals_home = ''; + $goals_guest = ''; + $overtime_home = ''; + $overtime_guest = ''; + } + if ($no_valuation) + { + $status = 4; + $count_no_valuation++; + } + else if ($status > 3) + { + $status = 3; + } + if(is_numeric($goals_home) && is_numeric($goals_guest) && $goals_home >= 0 && $goals_guest >= 0) + { + if ($status <= 3) + $status = 3; + else + { + $status = 6; + } + $sql_ary = array( + 'goals_home' => $goals_home, + 'goals_guest' => $goals_guest, + 'status' => $status, + 'goals_overtime_home' => (!is_numeric($overtime_home) OR !is_numeric($overtime_guest)) ? '' : $overtime_home, + 'goals_overtime_guest' => (!is_numeric($overtime_home) OR !is_numeric($overtime_guest)) ? '' : $overtime_guest, + ); + $sql = 'UPDATE ' . FOOTB_MATCHES . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND match_no = $match_num"; + $db->sql_query($sql); + $count_results++; + } + else + { + if ($status <= 3) + { + if (($league_info['bet_in_time'] == 1) and $open_match) + { + $status = 0; + $sql_ary = array('status' => $status); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday AND delivery_date_2 = ''"; + $db->sql_query($sql); + $success[] = sprintf($user->lang['SET_STATUS_TO'], $status) ; + } + else + { + $status = 1; + } + } + else + { + $status = 4; + } + $sql_ary = array( + 'goals_home' => '', + 'goals_guest' => '', + 'status' => $status, + 'goals_overtime_home' => '', + 'goals_overtime_guest' => '', + ); + $sql = 'UPDATE ' . FOOTB_MATCHES . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND match_no = $match_num"; + $db->sql_query($sql); + $count_delete++; + } + } + } + if ($count_results) + { + $success[] = sprintf($user->lang['RESULT' . (($count_results == 1) ? '' : 'S') . '_SAVED'],$count_results) ; + } + if ($count_delete) + { + $success[] = sprintf($user->lang['RESULT' . (($count_delete == 1) ? '' : 'S') . '_DELETED'],$count_delete) ; + } + if ($count_no_valuation) + { + $success[] = sprintf($user->lang['RESULT' . (($count_delete == 1) ? '' : 'S') . '_NO_VALUATION'],$count_no_valuation) ; + } + + // extra bets + $sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND matchday_eval = $matchday AND extra_status > 0"; + $resultextra = $db->sql_query($sql); + $count_extra_updates = 0; + $count_extra_delete = 0; + $count_extra_bets = 0; + while( $row = $db->sql_fetchrow($resultextra)) + { + $count_extra_bets++; + $extra_no = $row['extra_no']; + $extra_results = $this->request->variable('extra' . $extra_no, array('nv')); + $extra_result = ''; + if (sizeof($extra_results) > 0) + { + foreach ($extra_results as $extra_selected_value) + { + $extra_result = ($extra_result == '') ? $extra_selected_value : $extra_result . ';' . $extra_selected_value; + } + } + else + { + $extra_result = $this->request->variable('extra' . $extra_no, 'nv'); + } + if ($extra_result != 'nv' && $this->request->variable('select' . $extra_no, false)) + { + if ($row['question_type'] == 5 && !is_numeric($extra_result)) + { + $extra_result = ''; + } + if ($extra_result != '') + { + $sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND extra_no = $extra_no"; + $result = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + if($row2) + { + $sql_ary = array( + 'result' => $extra_result, + 'extra_status' => 3, + ); + $sql = 'UPDATE ' . FOOTB_EXTRA . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND extra_no = $extra_no"; + $db->sql_query($sql); + $count_extra_updates++; + } + } + else + { + // extra result unset + $sql_ary = array( + 'result' => '', + 'extra_status' => 1, + ); + $sql = 'UPDATE ' . FOOTB_EXTRA . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND extra_no = $extra_no"; + $db->sql_query($sql); + $count_extra_delete++; + } + } + } + if ($count_extra_updates) + { + $success[] = sprintf($user->lang['EXTRA_RESULT' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates); + } + if ($count_extra_delete) + { + $success[] = sprintf($user->lang['EXTRA_RESULT' . (($count_extra_delete == 1) ? '' : 'S') . '_DELETED'], $count_extra_delete); + } + calculate_extra_points($season, $league, $matchday, true); + + $sql = 'Select + MIN(status) AS min_status, + MAX(status) AS max_status + FROM + ((SELECT + matchday_eval AS matchday, + extra_status AS status + FROM ' . FOOTB_EXTRA . " + WHERE season = $season + AND league = $league + AND matchday_eval = $matchday) + UNION + (SELECT + matchday, + status + FROM " . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND matchday = $matchday )) AS ebm + GROUP BY matchday"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + if($row['min_status'] > 0) + { + if ($row['max_status'] < 3) + { + $new_status = $row['max_status']; + } + else + { + if ($row['min_status'] > 2) + { + $new_status = 3; + } + else + { + $new_status = 2; + } + } + $sql_ary = array('status' => $new_status); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday AND delivery_date_2 = ''"; + $db->sql_query($sql); + $success[] = sprintf($user->lang['SET_STATUS_TO'], $new_status) ; + } + $db->sql_freeresult($result); + + $cash = $this->request->variable('cash', false); + save_ranking_matchday($season, $league, $matchday, $cash); + + // Patch delevirey + if ($league_info['bet_in_time'] == 1) + { + set_bet_in_time_delivery($season, $league); + } + break; + } + // Check KO matchday + $sql = 'SELECT + SUM(ko_match) AS ko_matchday + FROM ' . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND matchday = $matchday + GROUP BY matchday"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $ko_matchday = $row['ko_matchday']; + $db->sql_freeresult($result); + + + // Get us all the matches + $lang_dates = $user->lang['datetime']; + $sql = "SELECT + m.match_no, + m.status, + m.team_id_home AS home_id, + m.team_id_guest AS guest_id, + m.formula_home, + m.formula_guest, + m.goals_home, + m.goals_guest, + m.goals_overtime_home, + m.goals_overtime_guest, + m.ko_match, + th.team_name AS home_name, + tg.team_name AS guest_name, + UNIX_TIMESTAMP(m.match_datetime) AS unix_match_begin, + CONCAT( + CASE DATE_FORMAT(m.match_datetime,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(m.match_datetime,' %d.%m.%y %H:%i') + ) AS match_begin + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS th ON (th.season = m.season AND th.league = m.league AND th.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS tg ON (tg.season = m.season AND tg.league = m.league AND tg.team_id = m.team_id_guest) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + ORDER BY unix_match_begin ASC, m.match_no ASC"; + $result = $db->sql_query($sql); + $rows_matches = $db->sql_fetchrowset($result); + $existing_matches = sizeof($rows_matches); + $db->sql_freeresult($result); + $legend = delivery($season, $league, $matchday); + + $row_number = 0; + foreach ($rows_matches as $row_match) + { + $row_number++; + if ($this->config['football_results_at_time']) + { + $edit = (($row_match['unix_match_begin'] + 6300 < time()) && $row_match['status'] > 0) ? true :false; + } + else + { + $edit = ($row_match['status'] > 0) ? true :false; + } + if (0 == $row_match['home_id']) + { + $home_info = get_team($season, $league, $row_match['match_no'], 'team_id_home', $row_match['formula_home']); + $home_in_array = explode("#",$home_info); + $homename = $home_in_array[2]; + } + else + { + $homename = $row_match['home_name']; + } + if (0 == $row_match['guest_id']) + { + $guest_info = get_team($season, $league, $row_match['match_no'], 'team_id_guest', $row_match['formula_guest']); + $guest_in_array = explode("#",$guest_info); + $guestname = $guest_in_array[2]; + } + else + { + $guestname = $row_match['guest_name']; + } + + $row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('match', array( + 'ROW_CLASS' => $row_class, + 'EDIT' => $edit, + 'SELECT_CHECKED' => ($row_match['status'] > 0 AND $row_match['status'] < 3) ? ' selected="selected"' : '', + 'BEGIN' => $row_match['match_begin'], + 'NUMBER' => $row_match['match_no'], + 'STATUS' => $row_match['status'], + 'STATUS_COLOR' => color_match($row_match['status'], $row_match['status']), + 'HOME_NAME' => $homename, + 'GUEST_NAME' => $guestname, + 'GOALS_HOME' => $row_match['goals_home'], + 'GOALS_GUEST' => $row_match['goals_guest'], + 'OVERTIME_HOME' => $row_match['goals_overtime_home'], + 'OVERTIME_GUEST' => $row_match['goals_overtime_guest'], + 'NO_VALUATION_CHECKED' => ($row_match['status'] > 3) ? ' selected="selected"' : '', + 'KO_MATCH' => $row_match['ko_match'], + ) + ); + } + if ($worldfootball AND $season >= $curr_season) + { + $template->assign_block_vars('worldfootball', array( + ) + + ); + } + + // Calculate extra bets of matchday + // Start select team + $sql = 'SELECT + team_id AS option_value, + team_name AS option_name + FROM ' . FOOTB_TEAMS . " + WHERE season = $season + AND league = $league + ORDER BY team_name ASC"; + $result = $db->sql_query($sql); + $option_rows = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + $sql = "SELECT e.*, + t1.team_name AS result_team + FROM " . FOOTB_EXTRA . ' AS e + LEFT JOIN ' . FOOTB_TEAMS . " AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result) + WHERE e.season = $season + AND e.league = $league + AND e.matchday_eval = $matchday + ORDER BY e.extra_no ASC"; + $result = $db->sql_query($sql); + + $extra_results = false; + $extranumber = 0; + while ($row = $db->sql_fetchrow($result)) + { + $extra_results = true; + $extranumber++ ; + $row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + + switch($row['question_type']) + { + case '1': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '2': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '3': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '4': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '5': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']); + } + break; + default : + { + $display_type = 2; + $eval_title = ''; + } + break; + } + + if ($row['extra_status'] > 0) + { + $edit_mode = true; + $result_extra = ($row['result_team'] == NULL) ? '' : $row['result_team']; + + $multiple = ''; + switch($row['question_type']) + { + case '2': + { + $multiple = ' multiple="multiple" size="3" '; + } + break; + case '4': + { + $option_arr = array(); + for ($i = 65; $i <= 72; $i++) + { + if (strstr($row['question'], chr($i) . ':')) + { + $option_arr[] = array( + 'option_value' => chr($i), + 'option_name' => chr($i), + ); + } + } + if ( sizeof($option_arr) > 1 ) + { + $display_type = 1; + $option_rows = $option_arr; + $result_extra = $row['result']; + $multiple = ' multiple="multiple" size="3" '; + } + } + break; + case '3': + { + $option_arr = array(); + for ($i = 65; $i <= 72; $i++) + { + if (strstr($row['question'], chr($i) . ':')) + { + $option_arr[] = array( + 'option_value' => chr($i), + 'option_name' => chr($i), + ); + } + } + if ( sizeof($option_arr) > 1 ) + { + $display_type = 1; + $option_rows = $option_arr; + $result_extra = $row['result']; + } + } + break; + } + + $template->assign_block_vars('extra_result', array( + 'ROW_CLASS' => $row_class, + 'EXTRA_NO' => $row['extra_no'], + 'S_EDIT_EXTRA' => true, + 'QUESTION' => $row['question'], + 'EXTRA_POINTS' => $row['extra_points'], + 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), + 'EVALUATION_TITLE' => $eval_title, + 'RESULT' => ($display_type == 1) ? $result_extra : $row['result'], + 'S_DISPLAY_TYPE' => $display_type, + 'S_MULTIPLE' => $multiple, + 'S_MULTIPLE_ARR' => ($multiple == '') ? '' : '[]', + 'STATUS' => $row['extra_status'], + 'STATUS_COLOR' => color_match($row['extra_status'], $row['extra_status']), + ) + ); + + if ($display_type == 1) + { + $selected = ($row['result'] == '') ? ' selected="selected"' : ''; + + $template->assign_block_vars('extra_result.extra_option', array( + 'OPTION_VALUE' => '', + 'OPTION_NAME' => sprintf($user->lang['SELECT']), + 'S_SELECTED' => $selected)); + + foreach ($option_rows as $option_row) + { + if (strstr($row['result'], ';')) + { + $selected = ''; + $result_arr = explode(';', $row['result']); + foreach($result_arr AS $result_value) + { + if ($result_value <> '') + { + if ($option_row['option_value'] == $result_value) + { + $selected = ' selected="selected"'; + } + } + } + } + else + { + $selected = ($option_row['option_value'] == $row['result']) ? ' selected="selected"' : ''; + } + $template->assign_block_vars('extra_result.extra_option', array( + 'OPTION_VALUE' => $option_row['option_value'], + 'OPTION_NAME' => $option_row['option_name'], + 'S_SELECTED' => $selected)); + } + } + } + else + { + $extra_colorstyle = color_style($row['extra_status']); + $extra_result = ($row['result'] == '') ? ' ' : $row['result']; + $result_extra = ($row['result_team'] == NULL) ? ' ' : $row['result_team']; + + $template->assign_block_vars('extra_result', array( + 'ROW_CLASS' => $row_class, + 'S_EDIT_EXTRA' => false, + 'QUESTION' => $row['question'], + 'EXTRA_POINTS' => $row['extra_points'], + 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), + 'RESULT' => ($display_type == 1) ? $result_extra : $extra_result, + 'COLOR_STYLE' => $extra_colorstyle, + ) + ); + } + } + + switch ($league_info['bet_ko_type']) + { + case BET_KO_90: + $result_explain = sprintf($user->lang['MIN90']); + $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); + break; + case BET_KO_EXTRATIME: + $result_explain = sprintf($user->lang['EXTRATIME_SHORT']); + $label_finalresult = sprintf($user->lang['PENALTY']); + break; + case BET_KO_PENALTY: + $result_explain = sprintf($user->lang['PENALTY']); + $ko_matchday = false; + break; + default: + $result_explain = sprintf($user->lang['MIN90']); + $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); + break; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'S_LEGEND' => $legend, + 'S_SUCCESS' => (sizeof($success)) ? true : false, + 'SUCCESS_MSG' => (sizeof($success)) ? implode('
', $success) : '', + 'RESULT_EXPLAIN' => $result_explain, + 'LABEL_FINALRESULT' => (isset($label_finalresult)) ? $label_finalresult : sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']), + 'S_CASH_POINTS' => ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) ? true : false, + 'S_CASH' => ($season >= $curr_season) ? true : false, + 'S_SEASON' => $season, + 'S_LEAGUE' => $league, + 'S_MATCHDAY' => $matchday, + 'S_SEASON_OPTIONS' => $season_options, + 'S_LEAGUE_OPTIONS' => $league_options, + 'S_KO_MATCHDAY' => $ko_matchday, + 'S_MATCHDAY_OPTIONS'=> $matchday_options, + 'S_EXTRA_RESULTS' => $extra_results, + 'S_TIME' => sprintf($user->lang['TIME']) . ': ' . date("d.m.Y H:i", $local_board_time), + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + } +} + +?> \ No newline at end of file diff --git a/acp/seasons_info.php b/acp/seasons_info.php new file mode 100644 index 0000000..b3d3967 --- /dev/null +++ b/acp/seasons_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\seasons_module', + 'title' => 'ACP_FOOTBALL_SEASONS_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_SEASONS_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_SEASONS')), + ), + ); + } +} diff --git a/acp/seasons_module.php b/acp/seasons_module.php new file mode 100644 index 0000000..1859313 --- /dev/null +++ b/acp/seasons_module.php @@ -0,0 +1,396 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_seasons'); + + $this->root_path = $phpbb_root_path . 'ext/football/football/'; + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + + if(!function_exists('season_info')) + { + include($this->root_path . 'includes/functions.' . $this->php_ext); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->root_path . 'includes/constants.' . $this->php_ext); + } + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $this->tpl_name = 'acp_football_seasons'; + $this->page_title = 'ACP_FOOTBALL_SEASONS_MANAGE'; + + $form_key = 'acp_football_seasons'; + add_form_key($form_key); + + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + // Check and set some common vars + $action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', ''); + $season = $this->request->variable('s', 0); + $edit = $this->request->variable('edit', 0); + $update = (isset($_POST['update'])) ? true : false; + + // Clear some vars + $season_row = array(); + $error = array(); + + // Grab basic data for season, if season is set and exists + if ($season) + { + $sql = 'SELECT * + FROM ' . FOOTB_SEASONS . " + WHERE season = $season"; + $result = $db->sql_query($sql); + $season_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + // Which page? + switch ($action) + { + case 'delete': + if (!$season) + { + trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), 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), E_USER_WARNING); + } + if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) + { + trigger_error($user->lang['SEASONS_NO_DELETE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + // Delete season + $sql = 'DELETE FROM ' . FOOTB_SEASONS . " + WHERE season = $season"; + $db->sql_query($sql); + + // Delete leagues + $sql = 'DELETE FROM ' . FOOTB_LEAGUES . " + WHERE season = $season"; + $db->sql_query($sql); + + // Delete matchdays + $sql = 'DELETE FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season"; + $db->sql_query($sql); + + // Delete matches + $sql = 'DELETE FROM ' . FOOTB_MATCHES . " + WHERE season = $season"; + $db->sql_query($sql); + + // Delete teams + $sql = 'DELETE FROM ' . FOOTB_TEAMS . " + WHERE season = $season"; + $db->sql_query($sql); + + // Delete ranks + $sql = 'DELETE FROM ' . FOOTB_RANKS . " + WHERE season = $season"; + $db->sql_query($sql); + + // Delete bets + $sql = 'DELETE FROM ' . FOOTB_BETS . " + WHERE season = $season"; + $db->sql_query($sql); + + trigger_error($user->lang['SEASON_DELETED'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, sprintf($user->lang['SEASON_CONFIRM_DELETE'], $season), build_hidden_fields(array( + 's' => $season, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + + case 'add': + if ($season >= 1963 AND $season <= 2099) + { + if ($season_row) + { + if ($edit) + { + $error[] = $user->lang['SEASON_TAKEN']; + } + else + { + trigger_error($user->lang['SEASON_TAKEN'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + $season_row['season_name'] = utf8_normalize_nfc($this->request->variable('season_name', '', true)); + if ($season_row['season_name'] <> '') + { + $sql = 'SELECT + season_name + FROM ' . FOOTB_SEASONS . " + WHERE season_name = '" . $season_row['season_name'] . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $error[] = $user->lang['SEASON_NAME_TAKEN']; + } + } + else + { + $intseason = ((int) $season) - 1; + $season_row['season_name'] = $user->lang['SEASON'] . ' ' . $intseason . '/' . $season; + } + + $season_row['season_name_short'] = utf8_normalize_nfc($this->request->variable('season_short', '', true)); + if ($season_row['season_name_short'] <> '') + { + $sql = 'SELECT + season_name_short + FROM ' . FOOTB_SEASONS . " + WHERE season_name_short = '" . $season_row['season_name_short'] . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $error[] = $user->lang['SEASON_SHORT_TAKEN']; + } + } + else + { + $intseason = ((int) $season) - 1; + $season_row['season_name_short'] = $intseason . '/' . $season; + } + } + else + { + trigger_error($user->lang['SEASON_NUMBER'] . adm_back_link($this->u_action), E_USER_WARNING); + } + // No break for edit add + case 'edit': + $data = array(); + + if (!sizeof($error)) + { + if ($action == 'edit' && !$season) + { + trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), 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), E_USER_WARNING); + return; + } + + $season_row['season_name'] = utf8_normalize_nfc($this->request->variable('season_name', '', true)); + if ($season_row['season_name'] <> '') + { + $sql = 'SELECT + season + FROM ' . FOOTB_SEASONS . " + WHERE season_name = '" . $season_row['season_name'] . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + if ($row['season'] <> $season) + { + $error[] = $user->lang['SEASON_NAME_TAKEN']; + } + } + } + else + { + $error[] = $user->lang['SEASON_NAME_EMPTY']; + } + + $season_row['season_name_short'] = utf8_normalize_nfc($this->request->variable('season_short', '', true)); + if ($season_row['season_name_short'] <> '') + { + $sql = 'SELECT + season + FROM ' . FOOTB_SEASONS . " + WHERE season_name_short = '" . $season_row['season_name_short'] . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + if ($row['season'] <> $season) + { + $error[] = $user->lang['SEASON_SHORT_TAKEN']; + } + } + } + else + { + $error[] = $user->lang['SEASON_SHORT_EMPTY']; + } + if (!sizeof($error)) + { + $sql_ary = array( + 'season' => (int) $season, + 'season_name' => $season_row['season_name'], + 'season_name_short' => $season_row['season_name_short'], + ); + + $data['season'] = $season; + $data['season_name'] = $this->request->variable('season_name', ''); + $data['season_short'] = $this->request->variable('season_short', ''); + + $var_ary = array( + 'season' => array('num', false, 1963, 2099), + 'season_name' => array('string', false, 4, 20), + 'season_short' => array('string', false, 2, 10), + ); + if (!($error_vals = validate_data($data, $var_ary))) + { + if ($action == 'add') + { + $sql = 'INSERT INTO ' . FOOTB_SEASONS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + else + { + $sql = 'UPDATE ' . FOOTB_SEASONS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season"; + $db->sql_query($sql); + } + $message = ($action == 'edit') ? 'SEASON_UPDATED' : 'SEASON_CREATED'; + trigger_error($user->lang[$message] . adm_back_link($this->u_action)); + } + else + { + foreach ($error_vals as $error_val) + { + $error_msg[] = $user->lang[$error_val]; + } + $message = ($action == 'edit') ? 'SEASON_UPDATE_FAILED' : 'SEASON_CREATE_FAILED'; + $error[] = $user->lang[$message]; + $error = array_merge($error, $error_msg); + } + } + } + } + + $u_back = $this->u_action; + + $template->assign_vars(array( + 'S_EDIT' => true, + 'S_ADD_SEASON' => ($action == 'add') ? true : false, + 'S_ERROR' => (sizeof($error)) ? true : false, + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + 'SEASON' => $season, + 'SEASON_NAME' => $season_row['season_name'], + 'SEASON_SHORT' => $season_row['season_name_short'], + 'U_BACK' => $u_back, + 'U_ACTION' => "{$this->u_action}&action=$action&s=$season", + ) + ); + return; + break; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet')), + 'S_SEASON_ADD' => true, + ) + ); + + // Get us all the seasons + $sql = 'SELECT + s.season, + s.season_name, + s.season_name_short, + COUNT(l.league) AS leagues + FROM ' . FOOTB_SEASONS . ' s + LEFT JOIN ' . FOOTB_LEAGUES . ' l on l.season = s.season + GROUP BY season + ORDER BY season DESC'; + $result = $db->sql_query($sql); + $rows_seasons = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + // Check if the user is allowed to delete a season. + if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) + { + $allow_delete = false; + } + else + { + $allow_delete = true; + } + + $row_number = 0; + foreach ($rows_seasons as $row_season) + { + $row_number++; + $row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('seasons', array( + 'ROW_CLASS' => $row_class, + 'SEASON' => $row_season['season'], + 'SEASON_NAME' => $row_season['season_name'], + 'SEASON_SHORT' => $row_season['season_name_short'], + 'LEAGUES' => $row_season['leagues'], + 'U_EDIT' => "{$this->u_action}&action=edit&s=" .$row_season['season'], + 'U_DELETE' => ($allow_delete) ? "{$this->u_action}&action=delete&s=" . $row_season['season'] : '', + ) + ); + } + } +} + +?> \ No newline at end of file diff --git a/acp/teams_info.php b/acp/teams_info.php new file mode 100644 index 0000000..8768e0c --- /dev/null +++ b/acp/teams_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\teams_module', + 'title' => 'ACP_FOOTBALL_TEAMS_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_TEAMS_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_TEAMS')), + ), + ); + } +} diff --git a/acp/teams_module.php b/acp/teams_module.php new file mode 100644 index 0000000..48febe8 --- /dev/null +++ b/acp/teams_module.php @@ -0,0 +1,659 @@ +add_lang_ext('football/football', 'football'); + $user->add_lang_ext('football/football', 'info_acp_teams'); + + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $this->ext_football_path = $phpbb_root_path . 'ext/football/football/'; + if(!function_exists('season_info')) + { + include($this->ext_football_path . 'includes/functions.' . $phpEx); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->ext_football_path . 'includes/constants.' . $phpEx); + } + + $this->tpl_name = 'acp_football_teams'; + $this->page_title = 'ACP_FOOTBALL_TEAMS_MANAGE'; + + $form_key = 'acp_football_teams'; + add_form_key($form_key); + + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + + // Check and set some common vars + $action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', ''); + $edit = $this->request->variable('edit', 0); + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $team = $this->request->variable('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 .= ''; + 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 .= ''; + 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 = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ''; + $team_options .= ''; + } + $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 = ''; + $folder = $this->ext_football_path . 'images/flags/'; + $directory = opendir($folder); + $files = array(); + while($file = readdir($directory)) + { + if( !(bool) preg_match('/.+\.(?:jpe?g|gif|png)$/i', $file) ) + { + continue; + } + $files[] = $file; + } + sort($files); + + foreach( $files as $file ) + { + $selected = (strtoupper($file) == strtoupper($team_row['team_symbol'])) ? ' selected="selected"' : ''; + $teamsymbol_options .= ''; + } + 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 && $this->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 .= ''; + $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 = ''; + $folder = $this->ext_football_path . 'images/flags/'; + $directory = opendir($folder); + $files = array(); + while($file = readdir($directory)) + { + if( !(bool) preg_match('/.+\.(?:jpe?g|gif|png)$/i', $file) ) + { + continue; + } + $files[] = $file; + } + sort($files); + + foreach( $files as $file ) + { + $selected = (strtoupper($file) == strtoupper($oldteam_row['team_symbol'])) ? ' selected="selected"' : ''; + $teamsymbol_options .= ''; + } + 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, + 'S_VERSION_NO' => $this->config['football_version'], + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $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']) ? $this->ext_football_path . '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($this->request->variable('team_name', '', true)); + $team_row['team_name_short'] = utf8_normalize_nfc($this->request->variable('team_short', '', true)); + $team_row['team_symbol'] = utf8_normalize_nfc($this->request->variable('team_symbol', '', true)); + $team_row['group_id'] = utf8_normalize_nfc($this->request->variable('team_group', '', true)); + $team_row['matchday'] = utf8_normalize_nfc($this->request->variable('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($this->request->variable('team_name', '', true)); + $team_row['team_name_short'] = utf8_normalize_nfc($this->request->variable('team_short', '', true)); + $team_row['team_symbol'] = utf8_normalize_nfc($this->request->variable('team_symbol', '', true)); + $team_row['group_id'] = utf8_normalize_nfc($this->request->variable('team_group', '', true)); + $team_row['matchday'] = utf8_normalize_nfc($this->request->variable('team_round', '', true)); + + $where_team_id = ''; + if ($team >= 6000 AND $team <= 6999) + { + $where_team_id = ' AND team_id < 7000 AND team_id > 7999'; + } + else + { + if ($team >= 7000 AND $team <= 7999) + { + $where_team_id = ' AND team_id < 6000 AND team_id > 6999'; + } + } + // 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'] . "'" . $where_team_id; + $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'] . "'" . $where_team_id; + $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 .= ''; + $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, + 'S_VERSION_NO' => $this->config['football_version'], + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $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']) ? $this->ext_football_path . '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; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), + '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 + 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)) + 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 && $this->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']) ? $this->ext_football_path . 'images/flags/' . $row_team['team_symbol'] : $this->ext_football_path . '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'] : '', + 'S_VERSION_NO' => $this->config['football_version'], + ) + ); + } + $template->assign_vars(array( + 'S_TEAMS' => ($row_number) ? '(' . $row_number . ')' : '', + 'S_MATCHES' => ($row_number) ? $matches : '', + ) + ); + } +} +?> \ No newline at end of file diff --git a/acp/update_info.php b/acp/update_info.php new file mode 100644 index 0000000..c517250 --- /dev/null +++ b/acp/update_info.php @@ -0,0 +1,25 @@ + '\football\football\acp\update_module', + 'title' => 'ACP_FOOTBALL_UPDATE_MANAGEMENT', + 'version' => '0.9.4', + 'modes' => array( + 'manage' => array('title' => 'ACP_FOOTBALL_UPDATE_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_UPDATE')), + ), + ); + } +} diff --git a/acp/update_module.php b/acp/update_module.php new file mode 100644 index 0000000..55169b1 --- /dev/null +++ b/acp/update_module.php @@ -0,0 +1,1462 @@ + 0, + 'team_id_guest' => 0, + 'match_datetime' => 0, + 'group_id' => 0, + 'formula_home' => 0, + 'formula_guest' => 0, + 'ko_match' => 0 + ); + public $u_action; + public $ext_football_path; + + protected $db, $user, $template, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + protected $root_path, $request, $php_ext, $log; + + + public function __construct() + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $user->add_lang_ext('football/football', 'info_acp_update'); + + $this->db = $db; + $this->user = $user; + $this->template = $template; + $this->config = $config; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $phpbb_admin_path; + $this->php_ext = $phpEx; + if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) { + // Get an instance of the ultimatepoints functions_points + $functions_points = $phpbb_container->get('dmzx.ultimatepoints.core.functions.points'); + } + } + + public function key_compare_func($key1, $key2) + { + if ($key1 == $key2) + return 0; + else if ($key1 > $key2) + return 1; + else + return -1; + } + + public function sort_teams($value_a, $value_b) + { + if ($value_a['team_id'] > $value_b['team_id']) + { + return 1; + } + else + { + if ($value_a['team_id'] == $value_b['team_id']) + { + return 0; + } + else + { + return -1; + } + } + } + + function main($id, $mode) + { + global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points, $phpbb_log; + global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx, $cache; + $provider = new \phpbb\controller\ provider(); + $symphony_request = new \phpbb\ symfony_request($request); + $filesystem = new \phpbb\ filesystem(); + $helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); + + $this->ext_football_path = $phpbb_root_path . 'ext/football/football/'; + if(!function_exists('season_info')) + { + include($this->ext_football_path . 'includes/functions.' . $phpEx); + } + if (!defined('FOOTB_SEASONS')) + { + include($this->ext_football_path . 'includes/constants.' . $phpEx); + } + + $this->tpl_name = 'acp_football_update'; + $this->page_title = 'ACP_FOOTBALL_UPDATE_MANAGE'; + + $form_key = 'acp_football_update'; + add_form_key($form_key); + + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + + // Check and set some common vars + $action = (isset($_POST['load_xml_season'])) ? 'load_xml_season' : ''; + $action = (isset($_POST['team_mapping'])) ? 'team_mapping' : $action; + $action = (isset($_POST['map_teams'])) ? 'map_teams' : $action; + $action = (isset($_POST['load_xml_league'])) ? 'load_xml_league' : $action; + $action = (isset($_POST['choose'])) ? 'choose' : $action; + $action = (isset($_POST['list'])) ? 'list' : $action; + $action = (isset($_POST['insert'])) ? 'insert' : $action; + $action = (isset($_POST['update'])) ? 'update' : $action; + $action = (empty($action)) ? $this->request->variable('action', '') : $action; + $xml_season_url = $this->request->variable('xml_season_url', ''); + $xml_league_url = $this->request->variable('xml_league_url', ''); + $xseason = $this->request->variable('xs', 0); + $xleague = $this->request->variable('xl', 0); + $xcode = $this->request->variable('xcode', ''); + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $league_name = $this->request->variable('league_name', ''); + $new_league = $this->request->variable('new_league', 0); + $insert_season = $this->request->variable('insert_season', false); + $insert_league = $this->request->variable('insert_league', false); + $list = $this->request->variable('list', false); + $this->xml_ary = unserialize(urldecode($this->request->variable('xml_ary', ''))); + $display_team_mapping = false; + // Clear some vars + $error = array(); + $success = array(); + $missing_team_ids_ary = array(); + $curr_season = curr_season(); + $choose_league = false; + $xseason_options = ''; + $xleague_options = ''; + $season_options = ''; + $league_options = ''; + + // Grab current season + $season = ($season) ? $season : $curr_season; + + // Which action? + switch ($action) + { + case 'load_xml_season': + case 'choose': + if (!$xml_season_url or strtoupper($xml_season_url) == 'LOCALHOST') + { + $xml_season_url = 'localhost'; + // Search files on localhost + $files = glob($phpbb_root_path . "/store/league*.xml"); + if ($files) + { + $first_season = ($xseason) ? false : true; + $first_league = ($xleague) ? false : true; + foreach (glob($phpbb_root_path . "/store/league*.xml") AS $filename) + { + if ($xml = @simplexml_load_file($filename)) + { + if ($first_season) + { + $selected = ' selected="selected"'; + $xseason = $xml->footb_seasons->season; + $first_season = false; + } + else + { + $selected = ($xseason && $xml->footb_seasons->season == $xseason) ? ' selected="selected"' : ''; + } + $xseason_options .= ''; + if ($selected <> '') + { + $xseason_name = $xml->footb_seasons->season_name_short; + if ($first_league) + { + $selected = ' selected="selected"'; + $first_league = false; + } + else + { + $selected = ($xleague && $xml->footb_leagues->league == $xleague) ? ' selected="selected"' : ''; + } + $xleague_options .= ''; + if ($selected <> '') + { + $league_name = $xml->footb_leagues->league_name; + } + } + } + else + { + trigger_error(sprintf($user->lang['ERROR_LOAD_LEAGUE_XML'], strstr($filename, "\\")) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + } + else + { + trigger_error(sprintf($user->lang['NO_XML_LEAGUE']) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + if (!($xml_str = $cache->get('football_xml_season'))) + { + if ($xml_str = @file_get_contents($xml_season_url)) + { + if (strpos($xml_str, 'put('football_xml_season', $xml_str, 300); + } + else + { + trigger_error(sprintf($user->lang['ERROR_READ_SEASON_XML']) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + trigger_error(sprintf($user->lang['ERROR_OPEN_SEASON_XML']) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + if($xml_season = new \SimpleXMLElement($xml_str)) + { + $first_league = ($xleague) ? false : true; + $xcode = $xml_season->code; + foreach($xml_season->season AS $tag_season) + { + $xseason = ($xseason) ? $xseason : $tag_season->season_id; + $selected = ($xseason && $tag_season->season_id == $xseason) ? ' selected="selected"' : ''; + $xseason_options .= ''; + if ($selected <> '') + { + foreach($tag_season->league AS $tag_league) + { + $selected = ($xleague && $tag_league->league_id == $xleague) ? ' selected="selected"' : ''; + if ($first_league) + { + $selected = ' selected="selected"'; + $xleague = $tag_league->league_id; + $first_league = false; + } + $xleague_options .= ''; + if ($selected <> '') + { + $league_name = $tag_league->league_name; + } + } + } + } + } + else + { + trigger_error($user->lang['NO_XML_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + } + // Grab basic data for select 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 .= ''; + if ($selected <> '') + { + $season_name = $row['season_name_short']; + } + } + $db->sql_freeresult($result); + + // Grab basic data for select league + $sql = 'SELECT * + FROM ' . FOOTB_LEAGUES . ' + WHERE season = ' . $season . ' + ORDER BY league ASC'; + $result = $db->sql_query($sql); + + $league_options = ''; + if (!$league) + { + $league_options = ''; + $new_league = $xleague; + } + else + { + $league_options = ''; + $new_league = $league; + } + while ($row = $db->sql_fetchrow($result)) + { + // Grab current league + $selected = ($league && $row['league'] == $league) ? ' selected="selected"' : ''; + $league_options .= ''; + if ($selected <> '') + { + $league_name = $row['league_name']; + } + } + $db->sql_freeresult($result); + + $choose_league = true; + $list = false; + break; + + case 'team_mapping': + case 'map_teams': + case 'load_xml_league': + if ($xseason == 0 or $xleague == 0) + { + trigger_error(sprintf($user->lang['NO_XML_SEASON']) . adm_back_link($this->u_action), E_USER_WARNING); + } + + if ($season == 0) + { + // No Season exists + $season = $xseason; + $insert_season = true; + // No league exists, so we want to insert the source league + $league = $xleague; + $insert_league = true; + } + else + { + if ($league == 0) + { + // New league so try to create the source league + $league = ($new_league) ? $new_league : $xleague; + $insert_league = true; + // Selected source league exist + if (sizeof(league_info($season, $league))) + { + trigger_error(sprintf($user->lang['NEW_LEAGUE_EXIST'], $league) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + } + + if (!$xml_season_url or strtoupper($xml_season_url) == 'LOCALHOST') + { + $xml_season_url = 'localhost'; + $xml_league_url = $phpbb_root_path . '/store/league_' . $xseason . '_' . $xleague . '.xml'; + } + else + { + $xml_league_url = substr($xml_season_url, 0, strrpos($xml_season_url, "/") + 1) . + "league.php?season=" . $xseason . "&league=" . $xleague . "&code=" . $xcode; + } + $cache_league = 'football_xml_league_' . $xseason . '_' . $xleague; + $this->xml_ary = $this->xml2array($xml_league_url, $cache_league); + + $team_id_map_ary = array(); + $duplicate_team_ids_ary = array(); + if ($action == 'map_teams') + { + if ($this->check_teams($season, $league, $team_id_map_ary, $duplicate_team_ids_ary, $missing_team_ids_ary)) + { + $action = 'team_mapping'; + } + } + + if ($action == 'team_mapping') + { + if ($this->compare_teams($season, $league, $team_id_map_ary, $duplicate_team_ids_ary)) + { + $display_team_mapping = true; + break; + } + } + + if (!$insert_league) + { + $league_info = league_info($season, $league); + $sql = 'SELECT COUNT(matchday) as matchdays + FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league"; + $result = $db->sql_query($sql); + if ($row = $db->sql_fetchrow($result)) + { + if ($row['matchdays'] <> $league_info['matchdays']) + { + $error[] = sprintf($user->lang['MISMATCH_MATCHDAYS'], $row['matchdays']); + } + } + else + { + $error[] = sprintf($user->lang['MISMATCH_MATCHDAYS'], $row['matchdays']); + } + + $sql = 'SELECT COUNT(match_no) as matches + FROM ' . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league"; + $result = $db->sql_query($sql); + if ($row = $db->sql_fetchrow($result)) + { + if ($row['matches'] <> sizeof($this->xml_ary['footb_matches'])) + { + $error[] = sprintf($user->lang['MISMATCH_MATCHES'], $row['matches']); + } + } + else + { + $error[] = sprintf($user->lang['MISMATCH_MATCHES'], $row['matches']); + } + + if (!sizeof($error)) + { + // Compare Update with existing database and switch season and league + $this->compare_table('FOOTB_LEAGUES', $season, $league, '', true, $error); + $this->compare_table('FOOTB_MATCHDAYS', $season, $league, '', true, $error); + $this->compare_table('FOOTB_TEAMS', $season, $league, '', true, $error); + $this->compare_table('FOOTB_MATCHES', $season, $league,'', true, $error); + } + } + if (!sizeof($error)) + { + foreach ($this->xml_ary['footb_teams'] AS $key => $value) + { + $this->team_ary[$value['team_id']] = $value['team_name']; + } + $this->team_ary[0] = ''; + + $choose_league = false; + $list = true; + if ($insert_season) + { + // Set default values for new season + $this->xml_ary[strtolower('footb_seasons')][0]['season'] = "$season"; + $this->xml_ary[strtolower('footb_seasons')][0]['season_name'] = sprintf($user->lang['SEASON']) . " " . ($season - 1) . "/" . $season; + $this->xml_ary[strtolower('footb_seasons')][0]['season_name_short'] = $season - 1 . "/" . $season; + $this->show_xml($this->xml_ary, 'FOOTB_SEASONS', $season, 0); + } + if ($insert_league) + { + // Show complete update + $this->show_xml($this->xml_ary, 'FOOTB_LEAGUES', $season, $league); + $this->show_xml($this->xml_ary, 'FOOTB_MATCHDAYS', $season, $league); + $this->show_xml($this->xml_ary, 'FOOTB_TEAMS', $season, $league); + $this->show_xml($this->xml_ary, 'FOOTB_MATCHES', $season, $league); + } + else + { + // Display differences between update and database + $this->compare_table('FOOTB_MATCHDAYS', $season, $league, 'matchday', false, $error); + $this->compare_table('FOOTB_TEAMS', $season, $league, 'team_id', false, $error); + $this->compare_table('FOOTB_MATCHES', $season, $league, 'match_no', false, $error); + } + } + break; + case 'insert': + if ($insert_season) + { + if ($count_inserts = $this->insert_league('FOOTB_SEASONS')) + { + $success[] = sprintf($user->lang['DB_INSERT_SEASON'], $count_inserts); + } + } + if ($count_inserts = $this->insert_league('FOOTB_LEAGUES')) + { + $success[] = sprintf($user->lang['DB_INSERT_LEAGUE'], $count_inserts); + } + if ($count_inserts = $this->insert_league('FOOTB_MATCHDAYS')) + { + $success[] = sprintf($user->lang['DB_INSERT_MATCHDAY' . (($count_inserts == 1) ? '' : 'S')], $count_inserts); + } + if ($count_inserts = $this->insert_league('FOOTB_TEAMS')) + { + $success[] = sprintf($user->lang['DB_INSERT_TEAM' . (($count_inserts == 1) ? '' : 'S')], $count_inserts); + } + if ($count_inserts = $this->insert_league('FOOTB_MATCHES')) + { + $success[] = sprintf($user->lang['DB_INSERT_MATCH' . (($count_inserts == 1) ? '' : 'ES')], $count_inserts); + } + $log_message = implode('
', $success); + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FOOTB_UPDATE', false, array($league_name . ' ' . $season . '
' . $log_message)); + break; + case 'update': + if ($count_updates = $this->update_league('FOOTB_MATCHDAYS', $season, $league, 'matchday')) + { + $success[] = sprintf($user->lang['DB_UPDATE_MATCHDAY' . (($count_updates == 1) ? '' : 'S')], $count_updates); + } + if ($count_updates = $this->update_league('FOOTB_TEAMS', $season, $league, 'team_id')) + { + $success[] = sprintf($user->lang['DB_UPDATE_TEAM' . (($count_updates == 1) ? '' : 'S')], $count_updates); + } + if ($count_updates = $this->insert_new_teams($season, $league)) + { + $success[] = sprintf($user->lang['DB_INSERT_TEAM' . (($count_updates == 1) ? '' : 'S')], $count_updates); + } + if ($count_updates = $this->update_league('FOOTB_MATCHES', $season, $league, 'match_no')) + { + $success[] = sprintf($user->lang['DB_UPDATE_MATCH' . (($count_updates == 1) ? '' : 'ES')], $count_updates); + } + + // set delivery for bet in time + $league_info = league_info($season, $league); + if ($league_info['bet_in_time']) + { + $sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, delivery_date, matchday_name, matches) + SELECT m.season, m.league, m.matchday, min(m.match_datetime) AS delivery_date, md.matchday_name, md.matches + FROM ' . FOOTB_MATCHES . ' AS m + JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league) + JOIN ' . FOOTB_MATCHDAYS . " AS md ON (md.season = m.season AND md.league = m.league AND md.matchday = m.matchday) + WHERE m.season = $season + AND m.league = $league + AND l.bet_in_time = 1 + AND m.status = 0 + GROUP BY m.season, m.league, m.matchday"; + $db->sql_query($sql); + $count_updates = $db->sql_affectedrows(); + if ($count_updates) + { + $success[] = sprintf($user->lang['DB_UPDATE_BIT_DELIVER' . (($count_updates == 1) ? '' : 'IES')], $count_updates) ; + } + } + else + { + // set first delivery + $effected_matchdays = ''; + $count_updates = 0; + $sql = 'SELECT md.matchday + FROM ' . FOOTB_MATCHDAYS . ' AS md + INNER JOIN (SELECT season, league, matchday, min(match_datetime) AS min_delivery_date + FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND status = 0 + GROUP BY season, league, matchday) AS agg + WHERE md.season = agg.season + AND md.league = agg.league + AND md.matchday = agg.matchday + AND md.delivery_date > agg.min_delivery_date + ORDER BY md.matchday"; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $count_updates++; + $effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday']; + } + if ($effected_matchdays <> '') + { + $sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches) + SELECT md.season + , md.league + , md.matchday + , md.status + , min_delivery_date AS delivery_date + , md.delivery_date_2 + , md.delivery_date_3 + , md.matchday_name + , md.matches + FROM ' . FOOTB_MATCHDAYS . ' AS md + INNER JOIN (SELECT season, league, matchday, min(match_datetime) AS min_delivery_date + FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND status = 0 + GROUP BY season, league, matchday) AS agg + WHERE md.season = agg.season + AND md.league = agg.league + AND md.matchday = agg.matchday + AND md.delivery_date > agg.min_delivery_date"; + $db->sql_query($sql); + $success[] = sprintf($user->lang['DB_UPDATE_DELIVER' . (($count_updates == 1) ? '' : 'IES')], $effected_matchdays) ; + } + // set second delivery + $effected_matchdays = ''; + $count_updates = 0; + $sql = 'SELECT md.matchday + FROM ' . FOOTB_MATCHDAYS . ' AS md + INNER JOIN (SELECT season, league, matchday, min(match_datetime) AS min_delivery_date + FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND status = -1 + GROUP BY season, league, matchday) AS agg + WHERE md.season = agg.season + AND md.league = agg.league + AND md.matchday = agg.matchday + AND md.delivery_date_2 > agg.min_delivery_date + ORDER BY md.matchday"; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $count_updates++; + $effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday']; + } + if ($effected_matchdays <> '') + { + $sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches) + SELECT md.season + , md.league + , md.matchday + , md.status + , md.delivery_date + , min_delivery_date AS delivery_date_2 + , md.delivery_date_3 + , md.matchday_name + , md.matches + FROM ' . FOOTB_MATCHDAYS . ' AS md + INNER JOIN (SELECT season, league, matchday, min(match_datetime) AS min_delivery_date + FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND status = -1 + GROUP BY season, league, matchday) AS agg + WHERE md.season = agg.season + AND md.league = agg.league + AND md.matchday = agg.matchday + AND md.delivery_date_2 > agg.min_delivery_date"; + $db->sql_query($sql); + $success[] = sprintf($user->lang['DB_UPDATE_DELIVER' . (($count_updates == 1) ? '' : 'IES')], $effected_matchdays) ; + } + // set third delivery + $effected_matchdays = ''; + $count_updates = 0; + $sql = 'SELECT md.matchday + FROM ' . FOOTB_MATCHDAYS . ' AS md + INNER JOIN (SELECT season, league, matchday, min(match_datetime) AS min_delivery_date + FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND status = -2 + GROUP BY season, league, matchday) AS agg + WHERE md.season = agg.season + AND md.league = agg.league + AND md.matchday = agg.matchday + AND md.delivery_date_3 > agg.min_delivery_date + ORDER BY md.matchday"; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $count_updates++; + $effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday']; + } + if ($effected_matchdays <> '') + { + $sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches) + SELECT md.season + , md.league + , md.matchday + , md.status + , md.delivery_date + , md.delivery_date_2 + , min_delivery_date AS delivery_date_3 + , md.matchday_name + , md.matches + FROM ' . FOOTB_MATCHDAYS . ' AS md + INNER JOIN (SELECT season, league, matchday, min(match_datetime) AS min_delivery_date + FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND status = -2 + GROUP BY season, league, matchday) AS agg + WHERE md.season = agg.season + AND md.league = agg.league + AND md.matchday = agg.matchday + AND md.delivery_date_3 > agg.min_delivery_date"; + $db->sql_query($sql); + $success[] = sprintf($user->lang['DB_UPDATE_DELIVER' . (($count_updates == 1) ? '' : 'IES')], $effected_matchdays) ; + } + } + + // check status of matchdays + $local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600); + $sql = "UPDATE phpbb_footb_matchdays AS target + INNER JOIN + ( + SELECT md.season + , md.league + , md.matchday + , IF( md.delivery_date > now(), + 0, + IF(ISNULL(min(e.extra_status)), + IF(min(m.status) = 1 AND max(m.status) > 1, + 2, + GREATEST(min(m.status), 0)), + IF(LEAST(min(m.status), min(e.extra_status)) = 1 AND GREATEST(max(m.status), max(e.extra_status)) > 1, + 2, + GREATEST(LEAST(min(m.status), min(e.extra_status)), 0)))) As new_status + FROM " . FOOTB_MATCHDAYS . ' AS md + LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = md.season AND m.league = md.league AND m.matchday = md.matchday) + LEFT JOIN ' . FOOTB_EXTRA . " AS e ON (e.season = md.season AND e.league = md.league AND e.matchday_eval = md.matchday) + WHERE md.season = $season AND md.league = $league + GROUP BY md.season, md.league, md.matchday) AS source + ON target.season = source.season AND target.league = source.league AND target.matchday = source.matchday + SET target.status = source.new_status"; + $db->sql_query($sql); + $count_updates = $db->sql_affectedrows(); + if ($count_updates) + { + $success[] = sprintf($user->lang['DB_UPDATE_STATUS_MATCHDAY' . (($count_updates == 1) ? '' : 'S')], $count_updates); + } + if (sizeof($success)) + { + $cash = ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) ? true : false; + save_ranking_matchday($season, $league, 1, $cash); + $log_message = implode('
', $success); + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FOOTB_UPDATE', false, array($league_info['league_name'] . ' ' . $season . '
' . $log_message)); + } + else + { + $success[] = sprintf($user->lang['NO_DB_CHANGES']); + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FOOTB_UPDATE', false, array($success[0])); + } + break; + } + $allow_url_fopen = (int) @ini_get('allow_url_fopen'); + if ($allow_url_fopen) + { + if (trim($this->config['football_update_source']) == '') + { + $xml_season_url = ($xml_season_url == '') ? 'http://football.bplaced.net/ext/football/football/xml/seasons.php' : $xml_season_url; + } + else + { + $xml_season_url = trim($this->config['football_update_source']); + } + } + else + { + $xml_season_url = 'localhost'; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_CHOOSE_ACTION' => $this->u_action . "&action=choose", + 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), + 'S_ERROR' => (sizeof($error)) ? true : false, + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + 'S_SUCCESS' => (sizeof($success)) ? true : false, + 'SUCCESS_MSG' => (sizeof($success)) ? implode('
', $success) : '', + 'S_MISSING_TEAMS' => (sizeof($missing_team_ids_ary)) ? sprintf($user->lang['MISSING_TEAMS'], implode(', ', $missing_team_ids_ary)) : '', + 'S_ALLOW_URL_FOPEN' => ($allow_url_fopen) ? true : false, + 'S_CHOOSE' => $choose_league, + 'S_TEAMS' => $display_team_mapping, + 'S_LIST' => $list, + 'S_INSERT_SEASON' => $insert_season, + 'S_INSERT_LEAGUE' => $insert_league, + 'S_CHECK_SAME_STATUS' => '', + 'S_CHECK_ONLY_FINAL' => 'checked="checked"', + 'S_VERSION_NO' => $this->config['football_version'], + 'DO_MATCHDAYS' => ($insert_league) ? sprintf($user->lang['INSERT_MATCHDAYS']) : sprintf($user->lang['UPDATE_MATCHDAYS']), + 'DO_TEAMS' => ($insert_league) ? sprintf($user->lang['INSERT_TEAMS']) : sprintf($user->lang['UPDATE_TEAMS']), + 'DO_MATCHES' => ($insert_league) ? sprintf($user->lang['INSERT_MATCHES']) : sprintf($user->lang['UPDATE_MATCHES']), + 'XML_SEASON_URL' => $xml_season_url, + 'XML_LEAGUE_URL' => $xml_league_url, + 'XML_ARY' => (sizeof($this->xml_ary)) ? urlencode(serialize($this->xml_ary)) : '', + 'S_XSEASON_OPTIONS' => $xseason_options, + 'S_XLEAGUE_OPTIONS' => $xleague_options, + 'S_XSEASON' => $xseason, + 'S_XLEAGUE' => $xleague, + 'S_XCODE' => $xcode, + 'S_SEASON_OPTIONS' => $season_options, + 'S_LEAGUE_OPTIONS' => $league_options, + 'S_SEASON' => $season, + 'S_LEAGUE' => $league, + 'S_LEAGUE_NAME' => $league_name, + 'NEW_LEAGUE' => $new_league, + ) + ); + } + + function xml2array($xml_league_url, $cache_league) + { + global $cache; + + if (!($xml_str = $cache->get($cache_league))) + { + if ($xml_str = @file_get_contents($xml_league_url)) + { + if (strpos($xml_str, 'put($cache_league, $xml_str, 900); + } + else + { + trigger_error(sprintf($user->lang['ERROR_READ_LEAGUE_XML']) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + trigger_error(sprintf($user->lang['ERROR_OPEN_LEAGUE_XML']) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + $xml_league = new \SimpleXMLElement($xml_str); + + $xml_table = array(); + foreach ($xml_league->children() AS $node) + { + $xml_entry = array(); + foreach($node->children() AS $cnode) + { + $xml_entry[$cnode->getName()] = sprintf("%s", $cnode); + } + $xml_table[$node->getName()][] = $xml_entry; + $this->xml_ary[$node->getName()] = $xml_table[$node->getName()]; + } + return $this->xml_ary; + } + + function check_teams($season, $league, &$team_id_map_ary, &$duplicate_team_ids_ary, &$missing_team_ids_ary) + { + global $config, $db, $user, $auth, $template, $cache; + global $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $team_id_ary = array(); + foreach ($this->xml_ary['footb_teams'] AS $xml_team) + { + $new_team_id = $this->request->variable('team_id_db_' . $xml_team['team_id'], 0); + $team_id_map_ary[$xml_team['team_id']] = $new_team_id; + if (in_array($new_team_id, $team_id_ary) or $new_team_id == 0) + { + $duplicate_team_ids_ary[] = $new_team_id; + } + else + { + $team_id_ary[] = $new_team_id; + } + } + $table_name = constant('FOOTB_TEAMS'); + // All database teams selected? + $sql = 'SELECT team_id + FROM ' . $table_name . " + WHERE season = $season + AND league = $league + ORDER BY team_id"; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + if (!in_array($row['team_id'], $team_id_ary)) + { + $missing_team_ids_ary[] = $row['team_id']; + } + } + $db->sql_freeresult($result); + if (sizeof($duplicate_team_ids_ary) or sizeof($missing_team_ids_ary)) + { + // Display Mapping + return true; + } + else + { + // set new IDs in xml_ary + foreach ($this->xml_ary['footb_teams'] AS $key => $xml_team) + { + $this->xml_ary['footb_teams'][$key]['team_id'] = $team_id_map_ary[$xml_team['team_id']]; + } + usort($this->xml_ary['footb_teams'], 'sort_teams'); + + foreach ($this->xml_ary['footb_matches'] AS $key => $xml_team) + { + $this->xml_ary['footb_matches'][$key]['team_id_home'] = $team_id_map_ary[$xml_team['team_id_home']]; + $this->xml_ary['footb_matches'][$key]['team_id_guest'] = $team_id_map_ary[$xml_team['team_id_guest']]; + } + return false; + } + } + + + function compare_teams($season, $league, $team_id_map_ary, $duplicate_team_ids_ary) + { + global $config, $db, $user, $auth, $template, $cache; + global $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $i = 0; + $j = 0; + $db_teams = array(); + $different_teams = false; + $same_quantity = false; + $table_name = constant('FOOTB_TEAMS'); + // Grab basic data for select league + $sql = 'SELECT team_id + , team_name + , team_name_short + , team_symbol + FROM ' . $table_name . " + WHERE season = $season + AND league = $league + ORDER BY team_name"; + $result = $db->sql_query($sql); + $rows = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $same_quantity = (sizeof($rows) == sizeof($this->xml_ary['footb_teams'])) ? true : false; + + if ($same_quantity) + { + foreach ($rows AS $row) + { + $db_teams[$row['team_id']] = $row; + } + } + else + { + $different_teams = true; + $sql = 'SELECT DISTINCT team_id + , team_name + , team_name_short + , team_symbol + FROM ' . $table_name . " + ORDER BY team_name"; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $db_teams[$row['team_id']] = $row; + } + $db->sql_freeresult($result); + } + $row_number = 0; + foreach ($this->xml_ary['footb_teams'] AS $xml_team) + { + $team_options = ''; + $team_id = (sizeof($team_id_map_ary)) ? $team_id_map_ary[$xml_team['team_id']] : $xml_team['team_id']; + if (!$same_quantity) + { + if (array_key_exists($team_id, $db_teams)) + { + $team_options = ''; + } + else + { + $team_options = ''; + } + } + foreach ($db_teams AS $db_team_id => $db_team_data) + { + $selected = ($db_team_id == $team_id) ? ' selected="selected"' : ''; + $team_options .= ''; + } + if (!array_key_exists($team_id, $db_teams) or sizeof($duplicate_team_ids_ary)) + { + $different_teams = true; + } + $row_number++; + $row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('teams', array( + 'ROW_CLASS' => $row_class, + 'TEAM_ID_XML' => $xml_team['team_id'], + 'TEAM_IMAGE_XML' => ($xml_team['team_symbol']) ? $this->ext_football_path . 'images/flags/' . $xml_team['team_symbol'] : $phpbb_root_path . 'football/images/flags/blank.gif', + 'TEAM_NAME_XML' => $xml_team['team_name'], + 'TEAM_NAME_SHORT_XML' => $xml_team['team_name_short'], + 'TEAM_OPTIONS' => $team_options, + 'DUPLICATE_TEAM' => (in_array($team_id, $duplicate_team_ids_ary)) ? true : false, + + )); + } + if ($different_teams) + { + // Display Mapping + return true; + } + else + { + return false; + } + } + + function compare_table($table, $season, $league, $index_field, $check, &$error) + { + global $config, $db, $user, $auth, $template, $cache; + global $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $i = 0; + $j = 0; + $tpl = ''; + $order = ($table == 'FOOTB_MATCHES') ? array('season' => 0, 'league' => 0, 'match_no' => 1, 'team_id_home' => 4, 'team_id_guest' => 5, + 'goals_home' => 6, 'goals_guest' => 7, 'matchday' => 0, 'status' => 12, 'match_datetime' => 2, + 'group_id' => 3, 'formula_home' => 10, 'formula_guest' => 11, 'ko_match' => 13, + 'goals_overtime_home' => 8, 'goals_overtime_guest' => 9) : array(); + $table_name = constant($table); + // Grab basic data for select league + $sql = 'SELECT * + FROM ' . $table_name . " + WHERE season = $season + AND league = $league + ORDER BY 1, 2, 3"; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + if ($table == 'FOOTB_TEAMS') + { + while ($i < sizeof($this->xml_ary[strtolower($table)]) and $this->xml_ary[strtolower($table)][$i]['team_id'] <> $row['team_id']) + { + // New team + if ($check) + { + $this->xml_ary[strtolower($table)][$i]['season'] = "$season"; + $this->xml_ary[strtolower($table)][$i]['league'] = "$league"; + } + else + { + $row_class = (!($j % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $id = 'insert_team'; + $tpl .= $this->print_differences(array(), $this->xml_ary[strtolower($table)][$i], $this->xml_ary[strtolower($table)][$i], $id, $row_class, array()); + $j++; + } + $i++; + } + } + $diff = array_diff_assoc($this->xml_ary[strtolower($table)][$i], $row); + if ($check) + { + foreach ($diff AS $key => $value) + { + switch($key) + { + case 'league': + $this->xml_ary[strtolower($table)][$i]['league'] = "$league"; + break; + case 'league_type': + $error[] = sprintf($user->lang['MISMATCH_LEAGUE_TYPE'], $value); + break; + case 'matchdays': + $error[] = sprintf($user->lang['MISMATCH_MATCHDAYS'], $value); + break; + case 'matches_on_matchday': + $error[] = sprintf($user->lang['MISMATCH_MOM'], $value); + break; + case 'matches': + $error[] = sprintf($user->lang['MISMATCH_MATCHES'], $value); + break; + case 'season': + $this->xml_ary[strtolower($table)][$i]['season'] = "$season"; + break; + } + } + } + else + { + if (sizeof($diff)) + { + $row_class = (!($j % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $id = $table . '_' . $row[$index_field]; + $tpl .= $this->print_differences($row, $this->xml_ary[strtolower($table)][$i], $diff, $id, $row_class, $order); + $j++; + } + } + $i++; + } + $db->sql_freeresult($result); + if (!$check and $tpl <> '') + { + $template->assign_block_vars(strtolower($table), array( + 'TPL' => $tpl, + )); + } + } + + + function show_xml(&$xml_ary, $table, $season, $league) + { + global $config, $db, $user, $auth, $template, $cache; + global $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $j = 0; + $tpl = ''; + switch ($table) + { + case 'FOOTB_LEAGUES': + $order = array('season' => 0, 'league' => 0, 'league_name' => 0, 'league_name_short' => 2, 'league_type' => 4, + 'matchdays' => 6, 'matches_on_matchday' => 8, 'win_result' => 10, 'win_result_02' => 10, 'win_matchday' => 10, + 'win_season' => 10, 'points_mode' => 10, 'points_result' => 12, 'points_tendency' => 12, + 'points_diff' => 12, 'points_last' => 12, 'join_by_user' => 12, 'join_in_season' => 12, + 'bet_in_time' => 12, 'rules_post_id' => 14, 'bet_ko_type' => 14, 'bet_points' => 16); + break; + case 'FOOTB_MATCHES': + $order = array('season' => 0, 'league' => 0, 'match_no' => 1, 'team_id_home' => 4, 'team_id_guest' => 5, + 'goals_home' => 6, 'goals_guest' => 7, 'matchday' => 0, 'status' => 12, 'match_datetime' => 2, + 'group_id' => 3, 'formula_home' => 10, 'formula_guest' => 11, 'ko_match' => 13, + 'goals_overtime_home' => 8, 'goals_overtime_guest' => 9); + break; + default: + $order = array(); + } + foreach ($this->xml_ary[strtolower($table)] AS $key => $xml_row) + { + $this->xml_ary[strtolower($table)][$key]['season'] = "$season"; + if ($league) + { + $this->xml_ary[strtolower($table)][$key]['league'] = "$league"; + } + $row_class = (!($j % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $tpl .= $this->print_xml_data($xml_row, $row_class, $order); + $j++; + } + $template->assign_block_vars(strtolower($table), array( + 'TPL' => $tpl, + )); + } + + + /** + * Print differences beetween Database and XML-Data + */ + function print_differences($table_row, $xml_row, $diff, $id, $row_class, $order) + { + global $user, $league_info; + + if (sizeof($table_row) AND substr($id, 0, 11) == 'FOOTB_TEAMS') + { + if ($xml_row['team_symbol'] == '') + { + unset($diff['team_symbol']); + if (!sizeof($diff)) + { + return ''; + } + } + } + if (sizeof($table_row) AND substr($id, 0, 13) == 'FOOTB_MATCHES') + { + if ($xml_row['status'] > 0 AND ($xml_row['status'] == $table_row['status'] - 3)) + { + unset($diff['status']); + if (!sizeof($diff)) + { + return ''; + } + } + if ($xml_row['status'] < 0 AND $league_info['bet_in_time']) + { + if ($table_row['status'] == 0) + { + unset($diff['status']); + if (!sizeof($diff)) + { + return ''; + } + } + else + { + $diff['status'] = 0; + } + } + } + $tpl = ''; + $tpl_ary = array(); + if (sizeof($diff)) + { + if (sizeof($table_row)) + { + $tpl .= ''; + // match status update and database + if (substr($id, 0, 13) == 'FOOTB_MATCHES') + { + $tpl .= ''; + $tpl .= ''; + if ($xml_row['status'] > 0 AND ($xml_row['status'] == $table_row['status'] +3)) + { + unset($diff['status']); + } + } + + } + else + { + // Insert team + $tpl .= ''; + } + } + + $tpl .= ' '; + foreach ($xml_row AS $key => $value) + { + if (array_key_exists($key, $diff)) + { + if (sizeof($table_row)) + { + $color_open = '* '; + $color_close = ''; + } + else + { + $color_open = '* '; + $color_close = ''; + } + } + else + { + $color_open = ''; + $color_close = ''; + } + if (sizeof($order)) + { + $value = (substr($key, 0, 7) == 'team_id') ? $value . ' ' . $this->team_ary[$value] : $value; + $tpl_ary[$order[$key]] = ($order[$key] % 2) ? $color_open . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . $color_close . ' ' : + '' . $color_open . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . $color_close . '
'; + } + else + { + if ($key <> 'season' and $key <> 'league') + { + // Write table fields + if (sizeof($table_row)) + { + $tpl .= '' . + $color_open . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . $color_close . + ''; + } + else + { + $tpl .= '' . + $color_open . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . $color_close . + ''; + } + } + } + } + if (sizeof($order)) + { + ksort($tpl_ary); + $tpl .= implode(" ", $tpl_ary); + } + if (sizeof($table_row)) + { + $tpl .= ' '; + } + else + { + $tpl .= ''; + } + + return $tpl; + } + + + /** + * Print differences beetween Database and XML-Data + */ + function print_xml_data($xml_row, $row_class, $order) + { + global $user; + + $tpl = ''; + $tpl_ary = array(); + + $tpl .= ''; + foreach ($xml_row AS $key => $value) + { + if (sizeof($order)) + { + $value = (substr($key, 0, 7) == 'team_id') ? $value . ' ' . $this->team_ary[$value] : $value; + $tpl_ary[$order[$key]] = ($order[$key] % 2) ? htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . ' ' : + '' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '
'; + } + else + { + if ($key <> 'season' and $key <> 'league') + { + // Write XML-table fields + $tpl .= '' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . ''; + } + } + } + if (sizeof($order)) + { + ksort($tpl_ary); + $tpl .= implode(" ", $tpl_ary); + } + $tpl .= ' '; + + return $tpl; + } + + /** + * Insert table into database + */ + function insert_league($table) + { + global $db, $user; + + $count_inserts = 0; + $table_name = constant($table); + foreach ($this->xml_ary[strtolower($table)] AS $sql_ary) + { + $sql = 'INSERT IGNORE INTO ' . $table_name . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + if ($db->sql_affectedrows()) + { + $count_inserts++; + } + } + return $count_inserts; + } + + /** + * Update database + */ + function update_league($table, $season, $league, $index_field) + { + global $db, $user; + + $count_updates = 0; + $table_name = constant($table); + $selected_fields = $this->selected_fields($table); + if (!sizeof($selected_fields)) + { + return 0; + } + + if ($table == 'FOOTB_MATCHES') + { + $update_neg_status = $this->request->variable('update_neg_status', false); + $update_same_status = $this->request->variable('update_same_status', false); + $update_only_final = $this->request->variable('update_only_final', false); + } + + // Grab key data for update + $sql = "SELECT $index_field AS index_field + FROM " . $table_name . " + WHERE season = $season + AND league = $league + ORDER BY 1"; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + if ($this->request->variable($table . '_' . $row['index_field'], false)) + { + + $diff_ary = unserialize(urldecode($this->request->variable('row_' . $table . '_' . $row['index_field'], ''))); + $sql_ary = array_intersect_ukey($diff_ary, $selected_fields, 'self::key_compare_func'); + if ($table == 'FOOTB_MATCHES') + { + $update_status = $this->request->variable('status_FOOTB_MATCHES_' . $row['index_field'], 0); + $db_status = $this->request->variable('db_status_FOOTB_MATCHES_' . $row['index_field'], 0); + switch ($update_status) + { + case -2: + case -1: + if (! $update_neg_status) + { + // remove resultfields and status + $sql_ary = array_intersect_ukey($sql_ary, $this->no_result_fields, 'self::key_compare_func'); + } + break; + case 0: + case 1: + // remove resultfields and status + $sql_ary = array_intersect_ukey($sql_ary, $this->no_result_fields, 'self::key_compare_func'); + break; + case 2: + if ($db_status <= 0 or $db_status == 3 or $db_status == 6 or $update_only_final or + (($db_status == 2 or $db_status == 5 ) and ! $update_same_status) ) + { + // remove provisional results and status + $sql_ary = array_intersect_ukey($sql_ary, $this->no_result_fields, 'self::key_compare_func'); + } + else + { + if ($db_status == 4 or $db_status == 5) + { + $sql_ary['status'] = 5; + } + } + break; + case 3: + if (($db_status == 3 or $db_status == 6 ) and !$update_same_status) + { + // don't replace final results + $sql_ary = array_intersect_ukey($sql_ary, $this->no_result_fields, 'self::key_compare_func'); + } + else + { + if ($db_status > 3) + { + $sql_ary['status'] = 6; + } + } + break; + } + } + if (sizeof($sql_ary)) + { + $sql = 'UPDATE ' . $table_name . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND $index_field = " . $row['index_field']; + $db->sql_query($sql); + if ($db->sql_affectedrows()) + { + $count_updates++; + } + } + } + } + return $count_updates; + } + + /** + * Insert new teams into database + */ + function insert_new_teams($season, $league) + { + global $db, $user; + + $count_updates = 0; + $table_name = constant('FOOTB_TEAMS'); + $insert_ary = $this->request->variable('insert_team', array('')); + if (sizeof($insert_ary) == 0) + { + return 0; + } + foreach ($insert_ary AS $insert) + { + $sql_ary = unserialize(urldecode($insert)); + $sql = 'INSERT INTO ' . $table_name . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + if ($db->sql_affectedrows()) + { + $count_updates++; + } + } + return $count_updates; + } + + + /** + * get selected fields + */ + function selected_fields($table) + { + global $db, $user; + + $tablename = strtolower($table); + $var_praefix = 'update_' . substr($tablename, 6) . '_'; + $selected_fields = array(); + $table_fields = array(); + + // Grab fields of table + $table_fields = $this->$tablename; + foreach ($table_fields AS $table_field) + { + switch ($table_field) + { + case 'formula_home': + case 'formula_guest': + $tag_name = 'formula'; + break; + case 'goals_home': + case 'goals_guest': + $tag_name = 'goals'; + break; + case 'goals_overtime_home': + case 'goals_overtime_guest': + $tag_name = 'goals_overtime'; + break; + default: + $tag_name = $table_field; + break; + } + if ($this->request->variable($var_praefix . $tag_name, false)) + { + $selected_fields[$table_field] = 0; + } + } + return $selected_fields; + } +} +?> \ No newline at end of file diff --git a/adm/style/acp_football.html b/adm/style/acp_football.html new file mode 100644 index 0000000..676b526 --- /dev/null +++ b/adm/style/acp_football.html @@ -0,0 +1,65 @@ + + + + +« {L_PREDICTION_LEAGUE} +

{L_TITLE}

+

{L_TITLE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + + +
+ {L_FOOTBALL_VERSION_CHECK} +

{mods.UP_TO_DATE}

+
+
+
{mods.CURRENT_VERSION}
+
+
+
+
{mods.LATEST_VERSION}
+
+ +
+
+
{L_DOWNLOAD} {mods.TITLE} {mods.LATEST_VERSION}
+
+
+
+
{L_RELEASE_ANNOUNCEMENT}
+
+ +
+ +
+ + + + + + +
+ {options.LEGEND} + +
+

{options.TITLE_EXPLAIN}
+
{options.CONTENT}
+
+ + +

+   + +

+ {S_FORM_TOKEN} +
+
+
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_all_bets.html b/adm/style/acp_football_all_bets.html new file mode 100644 index 0000000..7f6d7ac --- /dev/null +++ b/adm/style/acp_football_all_bets.html @@ -0,0 +1,151 @@ + + + + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_ALL_BETS_VIEW}

+

{L_ACP_FOOTBALL_ALL_BETS_VIEW_EXPLAIN}

+ +

{L_SELECT_MATCHDAY}:

+
+
+ + {S_FORM_TOKEN} +
+
+
+
+ + + {S_FORM_TOKEN} +
+
+
+
+ + + + {S_FORM_TOKEN} +
+
+ +
+ {S_LEGEND} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

{match_panel.match.HOME_NAME}-
{match_panel.match.GUEST_NAME}
{L_RESULT}{match_panel.match.RESULT}{L_TOTAL}
{L_TENDENCY} + {match_panel.tendency_footer.tendency.MATCH_ENTRY} + {match_panel.tendency_footer.tendency.TENDENCY} + + {L_POINTS_TOTAL} + {match_panel.tendency_footer.SUMTOTAL} +
{match_panel.user_row.USER_NAME}{match_panel.user_row.bet.BET}{match_panel.user_row.bet.POINTS}{match_panel.user_row.points.POINTS_TOTAL}
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_EXTRA_BET}{extra_panel.QUESTION}{L_EVALUATION}{L_POINTS}
{L_RESULT}{extra_panel.RESULT}{extra_panel.EVALUATION}{extra_panel.POINTS}
{extra_panel.user_row.USER_NAME}{extra_panel.user_row.BET} {extra_panel.user_row.POINTS}
+ +
+ + + + + + + +
+
{L_NO_MATCHES_ON_MATCHDAY}
+
+ +
+
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_bank.html b/adm/style/acp_football_bank.html new file mode 100644 index 0000000..ec9d65f --- /dev/null +++ b/adm/style/acp_football_bank.html @@ -0,0 +1,160 @@ + + + + + + « {L_BACK} +

{PAGE_TYPE} :: {LEAGUE_NAME}

+

{PAGE_TYPE_EXPLAIN}

+ +
+

+ {L_SET_DEPOSITS} • + {L_MARK_ALL} • + {L_UNMARK_ALL}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{POINTS}{TARGET}{ACTUAL}{L_BOOK}{L_MARK}
{member.USERNAME}{member.POINTS}{member.TARGET}{member.ACTUAL}
+ + {L_CASH_POINTS} + + {L_MATCHDAY}: + {S_MATCHDAY} + + + + +
+ + + + + + +
+ + {S_FORM_TOKEN} +
+ + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_BANK_MANAGE}

+

{L_ACP_FOOTBALL_BANK_MANAGE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+
+

{L_SELECT_SEASON}:

+ + {S_FORM_TOKEN} +
+
+ +

{L_LEAGUE_BANK}

+ +

{L_LEAGUE_BANK_EXPLAIN}

+

Offene Posten bis einschließlich dieser Saison

+
+
+

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_LEAGUE}{L_LEAGUE_NAME}{L_BET_POINTS}{L_DEPOSITED}{L_WINS}{L_PAID}{L_MARK}
{leagues.LEAGUE}{leagues.LEAGUE_NAME}{leagues.BET_POINTS} + + {leagues.DEPOSITED} + {leagues.WINS} + + {leagues.PAID} +
{L_NO_LEAGUES_CREATED}
+ + {L_CASH_POINTS} + +
+ + + +
+ + {S_FORM_TOKEN} +
+
+
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_bets.html b/adm/style/acp_football_bets.html new file mode 100644 index 0000000..93f4e3d --- /dev/null +++ b/adm/style/acp_football_bets.html @@ -0,0 +1,153 @@ + + + + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_BETS_MANAGE}

+ +

{L_ACP_FOOTBALL_BETS_MANAGE_EXPLAIN}

+ +

{L_SELECT_MATCHDAY}:

+
+
+ + {S_FORM_TOKEN} +
+
+
+
+ + + {S_FORM_TOKEN} +
+
+
+
+ + + + {S_FORM_TOKEN} +
+
+ +
+
+ + + + + {S_FORM_TOKEN} +
+
+ + + +
+

{L_ADVICE}

+

{SUCCESS_MSG}

+
+ + + +
+
+ {S_LEGEND} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_DATE}{L_NR}{L_GR}{L_HOME}{L_GUEST}{L_GOALS_HOME}{L_GOALS_GUEST}
{bet_edit.MATCH_TIME}{bet_edit.MATCH_NUMBER}{bet_edit.GROUP}{bet_edit.LOGO_HOME} {bet_edit.HOME_NAME}:{bet_edit.LOGO_GUEST} {bet_edit.GUEST_NAME}:
+ + +
+ + + + + + + + + + + + + + + + + + + +
{L_QUESTION}{L_POSSIBLE_POINTS}{L_EVALUATION}{L_BET_OF}
{extra_edit.QUESTION}{extra_edit.EXTRA_POINTS}{extra_edit.EVALUATION} + + + + + + +
+ + {L_CASH_POINTS} + +
+   + + {S_FORM_TOKEN} +
+
+
+ +
+ {S_LEGEND} +
+
{L_NO_MATCHES_ON_MATCHDAY}{L_NO_USERS}
+
+
+ +
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_extra.html b/adm/style/acp_football_extra.html new file mode 100644 index 0000000..8bbad97 --- /dev/null +++ b/adm/style/acp_football_extra.html @@ -0,0 +1,149 @@ + + + + + + « {L_BACK} +

{L_ACP_FOOTBALL_EXTRA_MANAGE}

+

{L_MATCHDAY_EDIT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_EXTRA_DETAILS} +
+
+
{SEASON_NAME}
+
+
+
+
{LEAGUE_NAME}
+
+
+
+
{EXTRA_NO}
+
+
+

{L_EXTRA_QUESTION_TYPE_EXPLAIN}
+
+
+
+

{L_EXTRA_QUESTION_EXPLAIN}
+
+
+
+

{L_EXTRA_MATCHDAY_EXPLAIN}
+
+
+
+

{L_EXTRA_MATCHDAY_EVAL_EXPLAIN}
+
+
+
+

{L_EXTRA_POINTS_EXPLAIN}
+
+
+
+

{L_EXTRA_STATUS_EXPLAIN}
+
+
+
+ +
+ {L_SUBMIT} +   + + {S_FORM_TOKEN} +
+
+ + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_EXTRA_MANAGE}

+

{L_ACP_FOOTBALL_EXTRA_MANAGE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +

{L_SELECT_LEAGUE}:

+
+
+ + {S_FORM_TOKEN} +
+
+ +
+
+ + + {S_FORM_TOKEN} +
+
+ +
+
+ + + + + + + {S_FORM_TOKEN} +
+
+

{L_EXTRA_DEF}

+ +

{L_EXTRA_DEF_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_EXTRA_NO}{L_QUESTION_TYPE}{L_EXTRA_QUESTION}{L_EXTRA_MATCHDAY}{L_EXTRA_MATCHDAY_EVAL}{L_EXTRA_POINTS}{L_STATUS}{L_OPTIONS}{L_ACTION}
{extras.EXTRA_NO}{extras.QUESTION_TYPE}{extras.QUESTION}{extras.MATCHDAY}{extras.MATCHDAY_EVAL}{extras.EXTRA_POINTS}{extras.EXTRA_STATUS}{L_SETTINGS}{L_DELETE}{L_DELETE}
{L_NO_EXTRA_CREATED}
+ + +
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_ko.html b/adm/style/acp_football_ko.html new file mode 100644 index 0000000..ab6e4c6 --- /dev/null +++ b/adm/style/acp_football_ko.html @@ -0,0 +1,85 @@ + + + + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_KO_MANAGE}

+

{L_ACP_FOOTBALL_KO_MANAGE_EXPLAIN}

+ +

{L_SELECT_LEAGUE}:

+
+
+ + {S_FORM_TOKEN} +
+
+
+
+ + + {S_FORM_TOKEN} +
+
+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_KO_MATCHDAYS} +
+
+
+
+
+
+
+
+ + +
+ +
+ {L_MATCHDAY_TARGET} +
+
+
+
+
+ +
+ {L_KO_GROUP} +
+
+
checked="checked" />
+
+
+

{L_GROUP_RANK_EXPLAIN}
+
+
+
+

{L_MOVE_RANK_EXPLAIN}
+
+ {L_MOVE_LEAGUE} + + {L_MATCHDAY} + +
+
+
+ +
+ {L_SUBMIT} +   + + {S_FORM_TOKEN} +
+
+
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_leagues.html b/adm/style/acp_football_leagues.html new file mode 100644 index 0000000..5aeb9c0 --- /dev/null +++ b/adm/style/acp_football_leagues.html @@ -0,0 +1,321 @@ + + + + + + « {L_BACK} +

{L_ACP_FOOTBALL_LEAGUES_MANAGE}

+

{L_LEAGUE_EDIT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_LEAGUE_DETAILS} +
+
+
{SEASON}
+
+
+
+
+ + {LEAGUE} + + +
+
+
+
+
+
+
+

{L_LEAGUE_SHORT_EXPLAIN}
+
+
+
+

{L_LEAGUE_TYPE_EXPLAIN}
+
+ + +
+
+
+

{L_BET_TYPE_KO_EXPLAIN}
+
+ + + +
+
+
+

{L_LEAGUE_MATCHDAYS_EXPLAIN}
+
+
+
+

{L_LEAGUE_MATCHES_EXPLAIN}
+
+ + + + {LEAGUE_MATCHES} + +
+
+
+

{L_LEAGUE_RULES_POST_ID_EXPLAIN}
+
+
+
+

{L_LEAGUE_JOIN_BY_USER_EXPLAIN}
+
+ + + +
+
+
+

{L_LEAGUE_JOIN_IN_SEASON_EXPLAIN}
+
+ + + +
+
+ +
+

{L_LEAGUE_BET_IN_TIME_EXPLAIN}
+
+ + + +
+
+ +
+ +
+ {L_LEAGUE_POINTS} +
+

{L_LEAGUE_POINTS_MODE_EXPLAIN}
+
+
+
+

{L_LEAGUE_POINTS_HIT_EXPLAIN}
+
+
+
+

{L_LEAGUE_POINTS_TENDENCY_EXPLAIN}
+
+
+
+

{L_LEAGUE_POINTS_DIFF_EXPLAIN}
+
+
+
+

{L_LEAGUE_POINTS_LAST_EXPLAIN}
+
+ + + +
+
+
+ +
+ {L_LEAGUE_WINS} +
+

{L_BET_POINTS_EXPLAIN}
+
+
+
+

{L_LEAGUE_WIN_HITS_EXPLAIN}
+
+
+
+

{L_LEAGUE_WIN_HITS_AWAY_EXPLAIN}
+
+
+
+

{L_LEAGUE_WIN_EXPLAIN}
+
+
+
+

{L_LEAGUE_WIN_MATCHDAYS_EXPLAIN}
+
+
+
+

{L_LEAGUE_WIN_SEASON_EXPLAIN}
+
+
+
+ +
+ {L_SUBMIT} +   + + + + + + {S_FORM_TOKEN} +
+
+ + « {L_BACK} +

{L_LEAGUE_MEMBERS} :: {LEAGUE_NAME}

+

{L_MEMBER_EXPLAIN}

+ +
+ +
+ » {L_MEMBER_ALL} +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_JOINED}{L_MARK}
{member.USERNAME}{member.JOINED}
{L_LEAGUE_NO_MEMBER}
+ + + + +
+ + +

{L_MARK_ALL} • + {L_UNMARK_ALL}

+
+ +

{L_ADD_USERS}

+ +

{L_ADD_USERS_EXPLAIN}

+ +
+ {L_ADD_USERS} +
+
+
+
+
+

{L_USERNAMES_EXPLAIN}
+
+
[ {L_FIND_USERNAME} ]
+
+ +

+ +

+ {S_FORM_TOKEN} +
+
+ + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_LEAGUES_MANAGE}

+

{L_ACP_FOOTBALL_LEAGUES_MANAGE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+
+

{L_SELECT_SEASON}:

+ + {S_FORM_TOKEN} +
+
+ +
+ +
+ + + {L_CREATE_LEAGUE}: + + + {S_FORM_TOKEN} +
+
+

{L_LEAGUE_DEF}

+ +

{L_LEAGUE_DEF_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_SEASON}{L_LEAGUE}{L_LEAGUE_NAME}{L_MEMBER}{L_OPTIONS}{L_ACTION}
{leagues.SEASON}{leagues.LEAGUE}{leagues.LEAGUE_NAME}{leagues.LEAGUE_SHORT}{leagues.MEMBERS}{L_SETTINGS}{L_MEMBER}{L_MEMBER}{L_DELETE}{L_DELETE}
{L_NO_LEAGUES_CREATED}
+ +
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_matchdays.html b/adm/style/acp_football_matchdays.html new file mode 100644 index 0000000..c52854f --- /dev/null +++ b/adm/style/acp_football_matchdays.html @@ -0,0 +1,285 @@ + + + + + + « {L_BACK} +

{L_ACP_FOOTBALL_MATCHDAYS_MANAGE}

+

{L_MATCHDAY_EDIT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_MATCHDAY_DETAILS} +
+
+
{SEASON_NAME}
+
+
+
+
{LEAGUE_NAME}
+
+
+
+
{MATCHDAY}
+
+
+
+
+
+
+

{L_MATCHDAY_STATUS_EXPLAIN}
+
{MATCHDAY_STATUS}
+
+ +
+

{L_MATCHDAY_DELIVERY_EXPLAIN}
+
{L_DAY}: + {L_MONTH}: + {L_YEAR}:     + {L_TIME}: : + +
+
+
+

{L_MATCHDAY_DELIVERY2_EXPLAIN}
+
{L_DAY}: + {L_MONTH}: + {L_YEAR}:     + {L_TIME}: : + +
+
+
+

{L_MATCHDAY_DELIVERY3_EXPLAIN}
+
{L_DAY}: + {L_MONTH}: + {L_YEAR}:     + {L_TIME}: : + +
+
+ +
+

{L_MATCHDAY_DELIVERY_EXPLAIN}
+
+ {MATCHDAY_DEL1} +
+
+
+

{L_MATCHDAY_DELIVERY2_EXPLAIN}
+
+ {MATCHDAY_DEL2} +
+
+
+

{L_MATCHDAY_DELIVERY3_EXPLAIN}
+
+ {MATCHDAY_DEL3} +
+
+ + +
+

{L_MATCHDAY_MATCHES_EXPLAIN}
+
+ + + + {MATCHDAY_MATCHES} + +
+
+ + +
+ +
+ {L_SUBMIT} +   + + {S_FORM_TOKEN} +
+
+ + + « {L_BACK} +

{L_CHANGE_DELIVERY}

+

{L_CHANGE_DELIVERY_EXPLAIN}

+ +
+ + +
+ {L_DELIVERY_SET_TIME} +
+

{L_BACKWARD_DELIVERY_EXPLAIN}
+
{L_DAYS}:   + {L_HOURS}:   + {L_MINUTES}: +
+
+
+ + +

{L_UPDATE_DELIVERY}

+ +

{L_UPDATE_DELIVERY_EXPLAIN}

+

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ + + + + + + + + + + + + + + + + + + + + +
{L_MATCHDAY}{L_DELIVERY_NUMBER}{L_DELIVERY}{L_NEW_DELIVERY}{L_SELECT}
{delivery.MATCHDAY}{delivery.NUMBER}{delivery.DELIVERY_DATE_DAY} + + {delivery.DELIVERY_DATE} + + {delivery.NEW_DELIVERY_DAY} {delivery.NEW_DELIVERY} + + + checked="checked" /> +
+

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ + +
+ {L_SUBMIT} + +   + +   + + {S_FORM_TOKEN} +
+
+ + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_MATCHDAYS_MANAGE}

+

{L_ACP_FOOTBALL_MATCHDAYS_MANAGE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +

{L_SELECT_LEAGUE}:

+
+
+ + {S_FORM_TOKEN} +
+
+ +
+
+ + + {S_FORM_TOKEN} +
+
+ +
+
+ + + + + + + + + + + + + + {S_FORM_TOKEN} +
+
+ +
+
+ + + + + + + {S_FORM_TOKEN} +
+
+ +

{L_MATCHDAY_DEF}

+ +

{L_MATCHDAY_DEF_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_MATCHDAY}{L_MATCHDAY_NAME}{L_MATCHDAY_STATUS}{L_MATCHDAY_DELIVERY}{L_MATCHDAY_DELIVERY} 2{L_MATCHDAY_DELIVERY} 3{L_OPTIONS}{L_ACTION}
{matchdays.MATCHDAY}{matchdays.MATCHDAY_NAME}{matchdays.MATCHDAY_STATUS}{matchdays.MATCHDAY_DELIVERY}{matchdays.MATCHDAY_DELIVERY_2}{matchdays.MATCHDAY_DELIVERY_3}{L_SETTINGS}{L_DELETE}{L_DELETE}
{L_NO_MATCHDAYS_CREATED}
+ +
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_matches.html b/adm/style/acp_football_matches.html new file mode 100644 index 0000000..7a1cdef --- /dev/null +++ b/adm/style/acp_football_matches.html @@ -0,0 +1,205 @@ + + + + + + « {L_BACK} +

{L_ACP_FOOTBALL_MATCHES_MANAGE}

+

{L_MATCH_EDIT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_MATCH_DETAILS} +
+
+
{SEASON_NAME}
+
+
+
+
{LEAGUE_NAME}
+
+
+
+
{MATCHDAY_NAME}
+
+
+
+
{MATCH_NUMBER}
+
+
+
+
{L_DAY}: + {L_MONTH}: + {L_YEAR}:     + {L_TIME}: : + +
+
+
+

{L_MATCH_STATUS_EXPLAIN}
+
+ + + {MATCH_STATUS} + +
+
+
+
+
{L_ODD_1}:    + {L_ODD_x}:    + {L_ODD_2}: +
+
+
+
+
+
+ +
+
+
checked="checked" /> +  
+
+
+

{L_MATCH_KO_EXPLAIN}
+
checked="checked" />
+
+ +
+
+
+
+ +
+

{L_FORMULA_HOME_EXPLAIN}
+
+
+ +
+
+
+
+ +
+

{L_FORMULA_GUEST_EXPLAIN}
+
+
+ + +
+ +
+ {L_SUBMIT} +   + + {S_FORM_TOKEN} +
+
+ + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_MATCHES_MANAGE}

+

{L_ACP_FOOTBALL_MATCHES_MANAGE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +

{L_SELECT_MATCHDAY}:

+
+
+ + {S_FORM_TOKEN} +
+
+
+
+ + + {S_FORM_TOKEN} +
+
+
+
+ + + + {S_FORM_TOKEN} +
+
+ +
+
+ + + + + + + + + {S_FORM_TOKEN} +
+
+

{L_MATCHES_DEF}

+ +

{L_MATCHES_DEF_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_MATCH_NUMBER}{L_MATCH_BEGIN}{L_MATCH_STATUS}{L_GROUP}{L_KO}{L_MATCH_HOME}{L_MATCH_GUEST}{L_OPTIONS}{L_ACTION}
{match.MATCH_NUMBER}{match.MATCH_BEGIN}{match.MATCH_STATUS}{match.MATCH_GROUP}{match.MATCH_KO}{match.MATCH_HOME}{match.MATCH_GUEST}{L_SETTINGS}{L_DELETE}{L_DELETE}
{L_NO_MATCHES_CREATED}
+ + +
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_results.html b/adm/style/acp_football_results.html new file mode 100644 index 0000000..d4c21d9 --- /dev/null +++ b/adm/style/acp_football_results.html @@ -0,0 +1,223 @@ + + + + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_RESULTS_MANAGE}

+

{L_ACP_FOOTBALL_RESULTS_MANAGE_EXPLAIN}

+ +

{L_SELECT_MATCHDAY}:

+
+
+ + {S_FORM_TOKEN} +
+
+
+
+ + + {S_FORM_TOKEN} +
+
+
+
+ + + + {S_FORM_TOKEN} +
+
+ + +
+

{L_ADVICE}

+

{SUCCESS_MSG}

+
+ + +
+
+ {S_LEGEND} +

{S_TIME}

+ + + +

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_SELECT}{L_MATCH_BEGIN}{L_VS}{L_RESULT} ({RESULT_EXPLAIN}){LABEL_FINALRESULT}{L_STATUS} {L_NO_VALUATION}{L_DELETE}
+ + checked="checked" /> + +   + + {match.BEGIN}{match.HOME_NAME}:{match.GUEST_NAME} + + + + {match.GOALS_HOME} + + : + + + + {match.GOALS_GUEST} + + + + + + + {match.OVERTIME_HOME} + + + : + + + + + {match.OVERTIME_GUEST} + + + {match.STATUS_COLOR} + checked="checked" + onchange="document.getElementById('select_{match.NUMBER}').checked = true;" /> + + +
+

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
{L_SELECT}{L_QUESTION}{L_POSSIBLE_POINTS}{L_EVALUATION}{L_RESULT}{L_STATUS}
+ + + +   + + {extra_result.QUESTION}{extra_result.EXTRA_POINTS}{extra_result.EVALUATION} + + + + + + _{extra_result.RESULT}_ + + + + + + + _{extra_result.RESULT}_ + + + + {extra_result.RESULT} + + {extra_result.STATUS_COLOR}
+ + {L_CASH_POINTS} checked="checked" /> + +
+
+ {L_SUBMIT} +   + + {S_FORM_TOKEN} +
+
+ + + {L_NO_MATCHES} + + + + +
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ + \ No newline at end of file diff --git a/adm/style/acp_football_seasons.html b/adm/style/acp_football_seasons.html new file mode 100644 index 0000000..3160256 --- /dev/null +++ b/adm/style/acp_football_seasons.html @@ -0,0 +1,105 @@ + + + + + + « {L_BACK} +

{L_ACP_FOOTBALL_SEASONS_MANAGE}

+

{L_SEASON_EDIT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_SEASON_DETAILS} +
+
+
{SEASON} +
+
+
+

{L_SEASON_NAME_EXPLAIN}
+
+
+
+

{L_SEASON_SHORT_EXPLAIN}
+
+
+
+ +
+ {L_SUBMIT} +   + + + + + + {S_FORM_TOKEN} +
+
+ + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_SEASONS_MANAGE}

+

{L_ACP_FOOTBALL_SEASONS_MANAGE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+
+ + {L_CREATE_SEASON}: + + + {S_FORM_TOKEN} +
+
+

{L_SEASON_DEF}

+ +

{L_SEASON_DEF_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_SEASON}{L_SEASON_NAME}{L_SEASON_SHORT}{L_LEAGUES}{L_OPTIONS}{L_ACTION}
{seasons.SEASON}{seasons.SEASON_NAME}{seasons.SEASON_SHORT}{seasons.LEAGUES}{L_SETTINGS}{L_DELETE}{L_DELETE}
{L_NO_SEASONS_CREATED}
+ +
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_teams.html b/adm/style/acp_football_teams.html new file mode 100644 index 0000000..f76c89b --- /dev/null +++ b/adm/style/acp_football_teams.html @@ -0,0 +1,164 @@ + + + + + + « {L_BACK} +

{L_ACP_FOOTBALL_TEAMS_MANAGE}

+

{L_TEAM_EDIT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_TEAM_DETAILS} +
+
+
{SEASON_NAME}
+
+
+
+
{LEAGUE_NAME}
+
+
+
+
{TEAM} +
+
+
+
+
+
+
+

{L_TEAM_SHORT_EXPLAIN}
+
+
+
+

{L_TEAM_SYMBOL_EXPLAIN}
+
+    {TEAM_NAME}
+
+ +
+

{L_TEAM_GROUP_EXPLAIN}
+
+
+
+

{L_TEAM_ROUND_EXPLAIN}
+
+
+ + +
+ +
+ {L_SUBMIT} +   + + + + + + {S_FORM_TOKEN} +
+
+ + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_TEAMS_MANAGE}

+

{L_ACP_FOOTBALL_TEAMS_MANAGE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +

{L_SELECT_LEAGUE}:

+
+
+ + {S_FORM_TOKEN} +
+
+ +
+
+ + + {S_FORM_TOKEN} +
+
+ +
+
+ + + + + {L_ADD_TEAM}: + + + {S_FORM_TOKEN} +
+
+

{L_TEAM_DEF} {S_TEAMS}

+ +

{L_TEAM_DEF_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_TEAM}{L_TEAM_NAME}{L_TEAM_MATCHES}{L_TEAM_AWAY}{L_GROUP}{L_MATCHDAY}{L_OPTIONS}{L_ACTION}
{teams.TEAM}{teams.TEAM_NAME}{teams.TEAM_NAME}{teams.TEAM_SHORT}{teams.TEAM_MATCHES}{teams.TEAM_HOME}{teams.TEAM_GROUP}{teams.TEAM_ROUND}{L_SETTINGS}{L_DELETE}{L_DELETE}
{L_NO_TEAMS_CREATED}
+ {S_MATCHES} {L_TEAM_MATCHES} + +
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_update.html b/adm/style/acp_football_update.html new file mode 100644 index 0000000..8f3045d --- /dev/null +++ b/adm/style/acp_football_update.html @@ -0,0 +1,430 @@ + + + + + « {L_PREDICTION_LEAGUE} +

{L_ACP_FOOTBALL_UPDATE_MANAGE}

+

{L_ACP_FOOTBALL_UPDATE_MANAGE_EXPLAIN}

+ + +
+

{L_ADVICE}

+

{SUCCESS_MSG}

+
+ + +
+
+ {L_SOURCE} +
+

{L_XML_SEASON_URL_EXPLAIN}
+
+ DISABLED /> +   + +
{L_ALLOW_URL_FOPEN} + +
+
+
+
+ + + +
+
+ {L_CHOOSE_LEAGUES} +
+
+
+
+ + + + +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+ {L_SUBMIT} + +   + +   + + {S_FORM_TOKEN} +
+
+ + + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + + +
+ +
+ {L_TEAM_MAPPING} + {S_MISSING_TEAMS} + + + + + + + + + + + + + + + + + + + +
{L_TEAM}{L_TEAM_NAME}{L_TEAM_NAME_SHORT}{L_TEAM_MAPPING}
{teams.TEAM_ID_XML}{teams.TEAM_NAME_XML}    + {teams.TEAM_NAME_XML} + {teams.TEAM_NAME_SHORT_XML}title="{L_DUPLICATE_TEAM}" bgcolor=#ECD5D8> + +
+
+
+ {L_SUBMIT} + + + + + + + + +   +   + {S_FORM_TOKEN} +
+
+ + + +
+

{L_INSERT_LEAGUE}

{L_UPDATE_LEAGUE}

+
+
+
+
{S_SEASON}
+
+
+
+
{S_LEAGUE}
+
+
+
+
{S_LEAGUE_NAME}
+
+
+ +
+ {L_INSERT_SEASON} + + + + + + + + + + + {footb_seasons.TPL} + + +
{L_SEASON}{L_SEASON_NAME}{L_SEASON_SHORT}
+
+ + + +
+ {L_INSERT_LEAGUE} + + + + + + + + + + + + + + + + + {footb_leagues.TPL} + + +
{L_LEAGUE_NAME}{L_LEAGUE_SHORTCUT}{L_LEAGUE_TYPE}{L_LEAGUE_MATCHDAYS}{L_LEAGUE_MATCHES}{L_LEAGUE_POINTS_MODE}{L_LEAGUE_BET_IN_TIME}{L_BET_TYPE_KO}{L_OTHER_FIELDS}
+
+ + + +
+ {DO_MATCHDAYS} + +

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ + + + + + + + + + + + + + + + + + + {footb_matchdays.TPL} + + +
{L_MATCHDAY}{L_MATCHDAY_STATUS} + + + + {L_MATCHDAY_DELIVERY} + + + + {L_MATCHDAY_DELIVERY} 2 + + + + {L_MATCHDAY_DELIVERY} 3 + + + + {L_MATCHDAY_NAME} + + + + {L_MATCHES} + + + + {L_SELECT}
+ +

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ +
+ + + +
+ {DO_TEAMS} + +

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ + + + + + + + + + + + + + + + + + {footb_teams.TPL} + + +
{L_TEAM}{L_TEAM_NAME} + + + + {L_TEAM_NAME_SHORT} + + + + {L_TEAM_SYMBOL} + + + + {L_GROUP} + + + + {L_MATCHDAY} + + + + {L_SELECT}
+ +

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ +
+ + + +
+ {DO_MATCHES} + +

{L_UPDATE_NEG_STATUS}

+

{L_UPDATE_SAME_STATUS}

+

{L_UPDATE_ONLY_FINAL}

+ +

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ + + + + + + + + + + + + + + + + + + {footb_matches.TPL} + + +
{L_MATCHDAY} + + +
+ {L_MATCH_NUMBER} +
{L_MATCH_BEGIN} + + +
+ {L_MATCH_OF_GROUP} + + + +
{L_MATCH_HOME} + + +
+ {L_MATCH_GUEST} + + + +
{L_RESULT} + + +
+   +
{L_EXTRATIME_SHORT} + + +
+   +
{L_FORMULA} + + +
+   +
{L_STATUS} + + +
+ {L_KO} +
{L_SELECT}
+   +
+ +

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+ +
+ + + +
+ {L_SUBMIT} + + + + + + +   + +   + + {S_FORM_TOKEN} +
+ +
+

{L_ADVICE}

+

{L_NO_DIFFERENCES}

+
+ +
+ +
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/acp_football_userguide.html b/adm/style/acp_football_userguide.html new file mode 100644 index 0000000..dfb1282 --- /dev/null +++ b/adm/style/acp_football_userguide.html @@ -0,0 +1,44 @@ + + + + + + « {L_PREDICTION_LEAGUE} + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +

{L_ACP_FOOTBALL} - {L_ACP_FOOTBALL_USERGUIDE}

+

{L_ACP_FOOTBALL_USERGUIDE_EXPLAIN}

+ + + + +
+

{userguide_block.BLOCK_TITLE}

+ +
+ + {userguide_block.userguide_row.USERGUIDE_QUESTION}
+ {userguide_block.userguide_row.USERGUIDE_ANSWER}

+ {ICON_BACK_TO_TOP} {L_BACK_TO_TOP} +
+
+ +
+ + +
+
phpBB Extension - Football Prediction League - Version {S_VERSION_NO} © 2016 football
+ \ No newline at end of file diff --git a/adm/style/css/football_acp.css b/adm/style/css/football_acp.css new file mode 100644 index 0000000..b18556a --- /dev/null +++ b/adm/style/css/football_acp.css @@ -0,0 +1,87 @@ +/* ----------------------------------------------------------------------------------------- + * @package phpBB Extension - Football Football + * @copyright (c) 2016 football (http://football.bplaced.net) + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * ----------------------------------------------------------------------------------------- */ +/* Table for football data */ +/* Specific column styles */ +table.type_f thead th { font-weight:normal; text-transform:uppercase; line-height:1.3em; padding:0 4px 2px 4px; } +table.type_f thead th span { padding-left:7px; } +table.type_f tfoot td { + padding: 3px 4px; + color: #FFFFFF; + background: #70AED3 url("../images/gradient2b.gif") bottom left repeat-x; + border-bottom: 1px solid #6DACD2; + border-top: 1px solid #327AA5; + text-align: left; + font-size: 0.75em; + text-transform: uppercase; +} + +table.type_f tbody tr:hover, +table.type_f tbody tr.hover { + background-color: #FFFFFF; color: #000000; +} +table.type_f body td { padding: 1px 2px; border-top: 1px solid #FAFAFA; } +table.type_f tbody th { padding:1px 2px; border-top: 1px solid #000000; background-color: #BFC1CF; } +table.type_f tbody tr { border: 1px solid #cfcfcf; } +th.td_tendency { text-align: center; padding: 4px 2px 0 2px; font-weight: bold; } +th.td_pts_total { text-align: right; padding: 4px 4px 0 2px; } +td.td_rank { text-align: right; } +td.td_group { text-align: center; } +td.td_hits { text-align: center; } +td.td_wins { text-align: right; padding: 0 2px 0 4px; } +td.td_match_no { text-align: right; } +td.td_logo { text-align: center; } +td.td_team { text-align: left; padding: 0 1em 0 2px; } +td.td_team_home { text-align: right; width: 155px; } +td.td_team_guest { text-align: left; width: 155px; } +td.td_vs { text-align: center; max-width: 1em; padding: 0; } +td.td_goals_home { text-align: right; max-width: 3em; padding: 0;} +td.td_goals_guest { text-align: left; max-width: 3em; padding: 0; white-space: nowrap;} +td.td_pts { text-align: right; padding: 0 2px 0 2px; } +td.td_button { text-align: right; padding-right: 4px; } +td.td_result { text-align: center; } +td.td_season { text-align: center; } +td.td_league { text-align: center; } +td.td_pts_total { text-align: right; padding: 0 4px 0 2px; } +td.td_points { text-align: right; padding: 0 2em 0 2px; } +td.td_fp { text-align: center; } +td.td_matches { text-align: center; } +td.td_diff { text-align: right; } +td.td_counter { text-align: right; } +td.td_name { text-align: left; } + +table.rank td.color_finally, table.football .color_finally, .color_finally , table.football .match_win, .match_win { + font-weight: bold; + color: #00AA00; +} + +table.rank td.color_provisionally, table.football .color_provisionally, .color_provisionally , table.football .match_lost, .match_lost { + font-weight: bold; + color: #AA0000; +} + +table.football .match_draw, .match_draw { + font-weight: bold; + color: #6A6A6A; +} + +table.rank td.color_not_rated, table.football .color_not_rated, .color_not_rated { + font-weight: bold; + color: purple; +} + +/* Background colors where the tables iterate between two colors or mark user*/ +.row_light { background-color: #e1ebf2; } +.row_dark { background-color: #cadceb; } +.row_user { background-color: #99CC99; } +.row_group td { background-color: #12A3EB; color: #FFFFFF !important; } +.row_result { background-color: #BFC1CF; } +.row_result td { padding: 1px 2px; } + + +.message { + font-weight: bold; + color: #AA0000; +} diff --git a/adm/style/frame_results.html b/adm/style/frame_results.html new file mode 100644 index 0000000..79a8292 --- /dev/null +++ b/adm/style/frame_results.html @@ -0,0 +1,13 @@ + +Diese Datei existiert doppelt: Einmal im fooball\football\styles\prsilver\template und einmal im fooball\football\adm\style Ordner +Mit Hilfe dieser Datei werden Fussballergebnisse zum Abgleich und schnelleren Erfassung von externen Seiten, +wie z.B. den Weltfussball.de Torverteiler, eingebunden. +Wenn ihr einen Weltfussball.de Account habt, könnt ihr dort in der Community einen Torverteiler erstellen und den Code hier +unter der entsprechenden Liganummer reinhängen (also 999999 mit der Liganummer bzw. wfb_tv_id ersetzen). +Der Frame wird dann bei der Ergebnisseingabe in der Liga angezeigt, wenn der Spieltag editierbar ist. + + + +
Der Torverteiler - präsentiert von weltfussball.de 
Alles über Fußball oder direkt zur Bundesliga 
+ + diff --git a/block/all_bets.php b/block/all_bets.php new file mode 100644 index 0000000..a3b06a5 --- /dev/null +++ b/block/all_bets.php @@ -0,0 +1,501 @@ +request->variable('start', 0); +$matches_on_matchday = false; + +$sql = 'SELECT COUNT(DISTINCT user_id) AS num_users + FROM ' . FOOTB_BETS . " + WHERE season = $season AND league = $league"; + +$result = $db->sql_query($sql); +$total_users = (int) $db->sql_fetchfield('num_users'); +$db->sql_freeresult($result); + +$sql = "SELECT + m.match_no, + m.status, + m.formula_home, + m.formula_guest, + t1.team_name_short AS home_name, + t2.team_name_short AS guest_name, + t1.team_id AS home_id, + t2.team_id AS guest_id, + m.goals_home, + m.goals_guest, + SUM(IF(b.goals_home + 0 > b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS home, + SUM(IF(b.goals_home = b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS draw, + SUM(IF(b.goals_home + 0 < b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS guest + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . ' AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) + LEFT JOIN ' . FOOTB_BETS . " AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + GROUP BY m.match_no + ORDER BY m.match_datetime ASC, m.match_no ASC"; + +$result = $db->sql_query($sql); +$matches = $db->sql_fetchrowset($result); +$db->sql_freeresult($result); +$count_matches = sizeof($matches); + +if ($user->data['football_mobile']) +{ + if ($count_matches > 3) + { + $split_after = 3; + $splits = ceil($count_matches / 3); + } + else + { + $split_after = $count_matches; + $splits = 1; + } +} +else +{ + if ($count_matches > 11) + { + $split_after = 8; + $splits = ceil($count_matches / 8); + } + else + { + $split_after = $count_matches; + $splits = 1; + } +} +$db->sql_freeresult($result); + +// Make sure $start is set to the last page if it exceeds the amount +if ($start < 0 || $start >= $total_users) +{ + $start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page']; +} +else +{ + $start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page']; +} + +$sql_start = $start * $count_matches; +$sql_limit = $config['football_users_per_page'] * $count_matches; + +// If we've got a hightlight set pass it on to pagination. +// handle pagination. +$base_url = $this->helper->route('football_main_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)); +$pagination = $phpbb_container->get('pagination'); +if ($user->data['football_mobile']) +{ + $sql_start = 0; + $sql_limit = 99999; + + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $sql_limit, $start); +} +else +{ + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start); +} + +$bet_line = array(); +if ($count_matches > 0) +{ + $matches_on_matchday = true; + + $sql = "SELECT + u.user_id, + u.username, + m.status, + b.goals_home AS bet_home, + b.goals_guest AS bet_guest, + " . select_points() . ' + FROM ' . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + ORDER BY LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC"; + + $result = $db->sql_query_limit($sql, $sql_limit, $sql_start); + $user_bets = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $bet_index = 0; + $split_index = 0; + foreach ($user_bets AS $user_bet) + { + if ($bet_index == $count_matches) + { + $bet_index = 0; + $split_index = 0; + } + if (!($bet_index % $split_after)) + { + $split_index++; + } + $sum_total[$user_bet['username']] = 0; + $bet_line[$split_index][] = $user_bet; + $bet_index++; + } +} +$match_index = 0; +$last_match_index = 0; +$split_index = 0; +$matchday_sum_total = 0; +$colorstyle_total = ' color_finally'; +foreach ($matches AS $match) +{ + if (!($match_index % $split_after)) + { + if ($match_index > 0) + { + $total = 0; + $count_user = 0; + $bet_index = 0; + $last_match_index = 0; + foreach ($bet_line[$split_index] AS $user_bet) + { + if ($bet_index == 0) + { + $count_user++; + $row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($user_bet['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('match_panel.user_row', array( + 'ROW_CLASS' => $row_class, + 'USER_NAME' => $user_bet['username'], + ) + ); + $total = 0; + } + $bet_index++; + $total += $user_bet['points']; + if ($user_bet['status'] < 3) + { + $colorstyle_total = ' color_provisionally'; + } + if ($user_bet['status'] < 1 && !$config['football_view_bets']) + { + // hide bets + $bet_home = ($user_bet['bet_home'] == '') ? ' ' : '?'; + $bet_guest = ($user_bet['bet_guest'] == '') ? ' ' : '?'; + } + else + { + $bet_home = $user_bet['bet_home']; + $bet_guest = $user_bet['bet_guest']; + } + + $colorstyle_bet = color_style($user_bet['status']); + $template->assign_block_vars('match_panel.user_row.bet', array( + 'BET' => $bet_home. ':'. $bet_guest, + 'COLOR_STYLE' => $colorstyle_bet, + 'POINTS' => ($user_bet['points'] == '') ? ' ' : $user_bet['points'], + ) + ); + + if ($bet_index == $split_after) + { + $sum_total[$user_bet['username']] += $total; + $matchday_sum_total += $total; + $bet_index = 0; + } + } + + $template->assign_block_vars('match_panel.tendency_footer', array( + 'S_TOTAL' => false, + ) + ); + foreach ($matches_tendency AS $match_tendency) + { + $template->assign_block_vars('match_panel.tendency_footer.tendency', array( + 'TENDENCY' => $match_tendency, + ) + ); + } + } + $matches_tendency = array(); + $split_index++; + if ($split_index == $splits) + { + $display_total = true; + } + else + { + $display_total = false; + } + $template->assign_block_vars('match_panel', array( + 'S_TOTAL' => $display_total, + ) + ); + } + if (0 == $match['home_id']) + { + $home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']); + $home_in_array = explode("#",$home_info); + $homename = $home_in_array[3]; + } + else + { + $homename = $match['home_name']; + } + if (0 == $match['guest_id']) + { + $guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']); + $guest_in_array = explode("#",$guest_info); + $guestname = $guest_in_array[3]; + } + else + { + $guestname = $match['guest_name']; + } + $colorstyle_match = color_style($match['status']); + $template->assign_block_vars('match_panel.match_entry', array( + 'HOME_NAME' => $homename, + 'GUEST_NAME' => $guestname, + 'RESULT' => $match['goals_home']. ':'.$match['goals_guest'], + 'COLOR_STYLE' => $colorstyle_match, + ) + ); + if ($match['status'] < 1 && !$config['football_view_tendencies']) + { + // hide tendencies + $matches_tendency[] = '?-?-?'; + } + else + { + $matches_tendency[] = $match['home']. '-'.$match['draw']. '-'.$match['guest']; + } + $match_index++; + $last_match_index++; +} +if ($count_matches > 0) +{ + $total = 0; + $count_user = 0; + $bet_index = 0; + foreach ($bet_line[$split_index] AS $user_bet) + { + if ($bet_index == 0) + { + $count_user++; + $row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($user_bet['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('match_panel.user_row', array( + 'ROW_CLASS' => $row_class, + 'USER_NAME' => $user_bet['username'], + ) + ); + $total = 0; + } + $bet_index++; + $total += $user_bet['points']; + if ($user_bet['status'] < 3) + { + $colorstyle_total = ' color_provisionally'; + } + if ($user_bet['status'] < 1 && !$config['football_view_bets']) + { + // hide bets + $bet_home = ($user_bet['bet_home'] == '') ? '' : '?'; + $bet_guest = ($user_bet['bet_guest'] == '') ? '' : '?'; + } + else + { + $bet_home = $user_bet['bet_home']; + $bet_guest = $user_bet['bet_guest']; + } + + $colorstyle_bet = color_style($user_bet['status']); + $template->assign_block_vars('match_panel.user_row.bet', array( + 'BET' => $bet_home. ':'. $bet_guest, + 'COLOR_STYLE' => $colorstyle_bet, + 'POINTS' => ($user_bet['points'] == '') ? ' ' : $user_bet['points'], + ) + ); + + if ($bet_index == $last_match_index) + { + $sum_total[$user_bet['username']] += $total; + $matchday_sum_total += $total; + $template->assign_block_vars('match_panel.user_row.points', array( + 'COLOR_STYLE' => $colorstyle_total, + 'POINTS_TOTAL' => $sum_total[$user_bet['username']], + ) + ); + $bet_index = 0; + } + } + + $template->assign_block_vars('match_panel.tendency_footer', array( + 'S_TOTAL' => true, + 'COLOR_STYLE' => $colorstyle_total, //currently ignored + 'SUMTOTAL' => $matchday_sum_total, + ) + ); + foreach ($matches_tendency AS $match_tendency) + { + $template->assign_block_vars('match_panel.tendency_footer.tendency', array( + 'TENDENCY' => $match_tendency, + ) + ); + } +} + +//extra bets +// Calculate extra bets of matchday +$sql_start = $start; +$sql_limit = $config['football_users_per_page']; +$sql = "SELECT e.*, + t1.team_name AS result_team + FROM " . FOOTB_EXTRA . ' AS e + LEFT JOIN ' . FOOTB_TEAMS . " AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result) + WHERE e.season = $season + AND e.league = $league + AND (e.matchday = $matchday OR e.matchday_eval = $matchday) + ORDER BY e.extra_no ASC"; + +$result = $db->sql_query($sql); +while ($row = $db->sql_fetchrow($result)) +{ + $extra_no = $row['extra_no']; + switch($row['question_type']) + { + case '1': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '2': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '3': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '4': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '5': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']); + } + break; + default : + { + $display_type = 2; + $eval_title = ''; + } + break; + } + $extra_colorstyle = color_style($row['extra_status']); + + $template->assign_block_vars('extra_panel', array( + 'QUESTION' => $row['question'], + 'RESULT' => ($display_type == 1) ? $row['result_team'] : $row['result'], + 'POINTS' => $row['extra_points'], + 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), + 'EVALUATION_TITLE' => $eval_title, + 'COLOR_STYLE' => $extra_colorstyle, + ) + ); + + // Get all extra bets of matchday + $bet_number = 0; + $sql = "SELECT u.user_id, + u.username, + e.*, + eb.bet, + eb.bet_points, + t2.team_name AS bet_team + FROM " . FOOTB_BETS . ' AS b + LEFT JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id) + LEFT JOIN ' . FOOTB_EXTRA . " AS e ON (e.season = b.season AND e.league = b.league AND (e.matchday = $matchday OR e.matchday_eval = $matchday) AND e.extra_no = $extra_no) + LEFT JOIN " . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = b.season AND eb.league = b.league AND eb.extra_no = $extra_no AND eb.user_id = b.user_id) + LEFT JOIN " . FOOTB_TEAMS . " AS t2 ON (t2.season = b.season AND t2.league = b.league AND t2.team_id = eb.bet) + WHERE b.season = $season + AND b.league = $league + AND b.match_no = 1 + GROUP by b.user_id + ORDER BY LOWER(u.username) ASC"; + + $result_bet = $db->sql_query_limit($sql, $sql_limit, $sql_start); + + while ($user_row = $db->sql_fetchrow($result_bet)) + { + $bet_number++ ; + $row_class = (!($bet_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($user_row['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + + if ($user_row['extra_status'] < 1 && !$config['football_view_bets']) + { + // hide bets + $bet = ($user_row['bet'] == '') ? ' ' : '?'; + $bet_team = ($user_row['bet_team'] == NULL) ? ' ' : '?'; + } + else + { + $bet = ($user_row['bet'] == '') ? ' ' : $user_row['bet']; + $bet_team = ($user_row['bet_team'] == NULL) ? ' ' : $user_row['bet_team']; + } + + + $template->assign_block_vars('extra_panel.user_row', array( + 'ROW_CLASS' => $row_class, + 'USER_NAME' => $user_row['username'], + 'BET' => ($display_type == 1) ? $bet_team : $bet, + 'BET_POINTS' => $user_row['bet_points'], + 'COLOR_STYLE' => $extra_colorstyle, + ) + ); + } +} + + +$sidename = sprintf($user->lang['ALL_BETS']); +$template->assign_vars(array( + 'S_DISPLAY_ALL_BETS' => true, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['BET']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['RESULTS']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_BET']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_RESULTS']), + 'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday, + 'S_SPALTEN' => ($count_matches * 2) + 2, + 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), + 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users), + ) +); +?> \ No newline at end of file diff --git a/block/bank.php b/block/bank.php new file mode 100644 index 0000000..fb820cd --- /dev/null +++ b/block/bank.php @@ -0,0 +1,235 @@ +auth->acl_get('u_use_football') ) +{ + trigger_error('NO_AUTH_VIEW'); + +} + +global $phpbb_extension_manager; +if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) +{ + $this->user->add_lang_ext('dmzx/ultimatepoints', 'common'); + // Get an instance of the ultimatepoints functions_points + $functions_points = $phpbb_container->get('dmzx.ultimatepoints.core.functions.points'); +} +else +{ + // Get an instance of the football functions_points + $functions_points = $phpbb_container->get('football.football.core.functions.points'); +} + +if (!$user_sel) +{ + if (user_is_member($user->data['user_id'], $season, $league) or $league == 0) + { + $user_sel = $user->data['user_id']; + } +} + +$username = ''; +$member = true; +if ($this->auth->acl_get('a_football_points')) +{ + $where_user = ''; + $multi_view = true; +} +else +{ + $multi_view = false; + if (user_is_member($user->data['user_id'], $season, $league)) + { + $where_user = ' AND b.user_id = ' . $user->data['user_id'] . ' '; + $user_sel = $user->data['user_id']; + } + else + { + if ($league) + { + $member = false; + } + } +} +$where_league = ''; +if ($league) +{ + $where_league = " AND b.league = $league"; +} + +$data = false; +// Select user +$total_users = 0; +$sql = 'SELECT DISTINCT + u.user_id, + u.username + FROM ' . FOOTB_BETS . ' AS b + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) + WHERE season = $season + $where_league + $where_user + ORDER BY LOWER(u.username) ASC"; + +$result = $db->sql_query($sql); + +while($row = $db->sql_fetchrow($result)) +{ + $total_users++; + if ($user_sel == $row['user_id'] OR !$user_sel) + { + $selectid = ' selected="selected"'; + $username = $row['username']; + $user_sel = $row['user_id']; + } + else + { + $selectid = ''; + } + $template->assign_block_vars('form_user', array( + 'S_USER' => $row['user_id'], + 'S_USERNAME' => $row['username'], + 'S_SELECTEDID' => $selectid, + ) + ); +} +$db->sql_freeresult($result); + +$where_season = ''; +if ($season) +{ + $where_season = " AND fp.season = $season"; +} + +$where_league = ''; +$order_by = 'ORDER BY fp.points_type ASC, fp.matchday ASC, fp.league ASC'; + +if ($league) +{ + $where_league = " AND fp.league = $league"; + $order_by = 'ORDER BY fp.league ASC, fp.matchday ASC, fp.points_type ASC'; +} + +// The different book types +$types = array( + 0 => '--', + 1 => sprintf($user->lang['FOOTBALL_BET_POINTS']), + 2 => $user->lang['FOOTBALL_DEPOSIT'], + 3 => sprintf($user->lang['FOOTBALL_WIN']), + 4 => $user->lang['FOOTBALL_WIN'], + 5 => $user->lang['FOOTBALL_WIN'], + 6 => $user->lang['FOOTBALL_WIN'], + 7 => $user->lang['FOOTBALL_PAYOUT'], +); + +// Grab the football points +$sql = 'SELECT fp.season, + s.season_name, + s.season_name_short, + fp.league, + l.league_name, + l.league_name_short, + fp.matchday, + md.matchday_name, + fp.points_type, + fp.points, + fp.points_comment, + fp.cash + FROM ' . FOOTB_POINTS . ' AS fp + INNER JOIN ' . FOOTB_SEASONS . ' AS s ON (s.season = fp.season) + INNER JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = fp.season AND l.league = fp.league) + INNER JOIN ' . FOOTB_MATCHDAYS . ' AS md ON (md.season = fp.season AND md.league = fp.league AND md.matchday = fp.matchday) + WHERE user_id = ' . (int) $user_sel . " + $where_season + $where_league + $order_by"; +$result = $db->sql_query($sql); + +$current_balance = 0.00; +$count = 0; +// Start looping all the football points +while ($row = $db->sql_fetchrow($result)) +{ + $count = $count + 1; + if ($row['points_type'] == POINTS_BET OR $row['points_type'] == POINTS_PAID) + { + $points_sign = '-'; + $points_style = " color: red;"; + $current_balance -= $row['points']; + } + else + { + $points_sign = '+'; + $points_style = " color: green;"; + $current_balance += $row['points']; + } + // Add the items to the template + $template->assign_block_vars('football', array( + 'SEASON' => $season, + 'SEASON_NAME' => $season_name, + 'LEAGUE' => $row['league'], + 'LEAGUE_NAME' => $row['league_name'], + 'LEAGUE_SHORT' => $row['league_name_short'], + 'MATCHDAY' => $row['matchday'], + 'MATCHDAY_NAME' => ($row['matchday_name'] == '') ? $row['matchday'] . '.' . sprintf($user->lang['FOOTBALL_MATCHDAY']) : $row['matchday_name'], + 'MATCHDAY_SHORT'=> $row['matchday'] . '.' . sprintf($user->lang['MATCHDAY_SHORT']), + 'POINTS_SIGN' => $points_sign, + 'POINTS_STYLE' => $points_style, + 'POINTS_TYPE' => $types[$row['points_type']], + 'S_CASH' => $row['cash'], + 'POINTS' => $functions_points->number_format_points($row['points']), + 'COMMENT' => nl2br($row['points_comment']), + )); +} +$db->sql_freeresult($result); + +if ($current_balance < 0) +{ + $points_style = " color: red;"; +} +else +{ + $points_style = " color: green;"; +} + +$template->assign_block_vars('football', array( + 'SEASON' => $season, + 'SEASON_NAME' => '', + 'LEAGUE' => $league, + 'LEAGUE_NAME' => '', + 'MATCHDAY' => '', + 'MATCHDAY_NAME' => '', + 'POINTS_SIGN' => '', + 'POINTS_STYLE' => $points_style, + 'POINTS_TYPE' => '', + 'S_CASH' => 1, + 'POINTS' => $functions_points->number_format_points($current_balance), + 'COMMENT' => ($league == 0) ? sprintf($user->lang['FOOTBALL_BALANCES']) : sprintf($user->lang['FOOTBALL_BALANCE']), +)); + +$sidename = sprintf($user->lang['FOOTBALL_BANK']); +$template->assign_vars(array( + 'S_DISPLAY_BANK' => true, + 'S_MATCHDAY_HIDE' => true, + 'S_MEMBER' => $member, + 'S_SIDENAME' => $sidename, + 'S_MULTI_VIEW' => $multi_view, + 'L_TOTAL_ENTRIES' => ($count == 1) ? $count . ' ' .sprintf($user->lang['FOOTBALL_RECORD']) : $count . ' ' .sprintf($user->lang['FOOTBALL_RECORDS']), + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['RANK_TOTAL']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['MY_BETS']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_RANK_TOTAL']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_BETS']), + 'USERNAME' => $username, + 'POINTS' => $config['football_win_name'], + ) +); + +?> \ No newline at end of file diff --git a/block/bet.php b/block/bet.php new file mode 100644 index 0000000..dce1b52 --- /dev/null +++ b/block/bet.php @@ -0,0 +1,534 @@ +data['user_id']; +$lang_dates = $user->lang['datetime']; +$user_is_member = user_is_member($userid, $season, $league); +$display_rating = false; + +// Calculate multiple delivery +$display_delivery2 = false; +$display_delivery3 = false; +$delivery2 = ''; +$delivery3 = ''; +$sql = "SELECT + delivery_date_2, + delivery_date_3, + CONCAT( + CASE DATE_FORMAT(delivery_date_2,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(delivery_date_2,' %d.%m.%Y %H:%i') + ) as deliverytime2, + CONCAT( + CASE DATE_FORMAT(delivery_date_3,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(delivery_date_3,' %d.%m.%Y %H:%i') + ) as deliverytime3 + FROM " . FOOTB_MATCHDAYS . " + WHERE season = $season + AND league = $league + AND matchday = $matchday"; + +$result = $db->sql_query($sql); + +if ($row = $db->sql_fetchrow($result)) +{ + if ($row['delivery_date_2'] <> '') + { + $display_delivery2 = true; + $delivery2 = $row['deliverytime2']; + } + if ($row['delivery_date_3'] <> '') + { + $display_delivery3 = true; + $delivery3 = $row['deliverytime3']; + } +} +$db->sql_freeresult($result); + +// Calculate matches and bets of matchday +$sql = "SELECT + m.league, + m.match_no, + m.matchday, + m.status, + m.group_id, + m.formula_home, + m.formula_guest, + t1.team_symbol AS home_symbol, + t2.team_symbol AS guest_symbol, + t1.team_id AS home_id, + t2.team_id AS guest_id, + t1.team_name AS home_name, + t2.team_name AS guest_name, + t1.team_name_short AS home_short, + t2.team_name_short AS guest_short, + b.goals_home AS bet_home, + b.goals_guest AS bet_guest, + m.goals_home, + m.goals_guest, + m.trend, + m.odd_1, + m.odd_x, + m.odd_2, + m.rating, + CONCAT( + CASE DATE_FORMAT(m.match_datetime,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i') + ) AS match_time, + " . select_points() . ' + FROM ' . FOOTB_MATCHES . ' AS m + INNER JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no AND b.user_id = $userid) + LEFT JOIN " . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + GROUP BY m.match_no + ORDER BY m.match_datetime ASC, m.match_no ASC"; + +$result = $db->sql_query($sql); +$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + +while ($row = $db->sql_fetchrow($result)) +{ + $data_bet = true; + $matchnumber++ ; + $row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $display_link = true; + $display_rating = ($display_rating || ($row['rating'] <> '0.00')); + + if (0 == $row['home_id']) + { + $display_link = false; + $home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']); + $home_in_array = explode("#",$home_info); + $homelogo = $home_in_array[0]; + $homeid = $home_in_array[1]; + $homename = $home_in_array[2]; + $homeshort = $home_in_array[2]; + } + else + { + $homelogo = $row['home_symbol']; + $homeid = $row['home_id']; + $homename = $row['home_name']; + $homeshort = $row['home_short']; + } + + if (0 == $row['guest_id']) + { + $display_link = false; + $guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']); + $guest_in_array = explode("#",$guest_info); + $guestlogo = $guest_in_array[0]; + $guestid = $guest_in_array[1]; + $guestname = $guest_in_array[2]; + $guestshort = $guest_in_array[2]; + } + else + { + $guestlogo = $row['guest_symbol']; + $guestid = $row['guest_id']; + $guestname = $row['guest_name']; + $guestshort = $row['guest_short']; + } + if ($homelogo <> '') + { + $logoH = "\""" ; + } + else + { + $logoH = "\"\"" ; + } + + if ($guestlogo <> '') + { + $logoG = "\""" ; + } + else + { + $logoG = "\"\"" ; + } + + if ($row['status'] == -1) + { + $delivertag = "*"; + } + else + { + if ($row['status'] == -2) + { + $delivertag = "**"; + } + else + { + $delivertag = ''; + } + } + + if ($row['group_id'] == '') + { + $group_id = ' '; + } + else + { + $data_group = true; + $group_id = $row['group_id']; + } + + if ($row['status'] <= 0) + { + $edit_mode = true; + $template->assign_block_vars('bet_edit', array( + 'ROW_CLASS' => $row_class, + 'LEAGUE_ID' => $row['league'], + 'MATCH_NUMBER' => $row['match_no'], + 'MATCHDAY' => $row['matchday'], + 'STATUS' => $row['status'], + 'MATCH_TIME' => $row['match_time'], + 'GROUP' => $group_id, + 'HOME_ID' => $homeid, + 'GUEST_ID' => $guestid, + 'LOGO_HOME' => $logoH, + 'LOGO_GUEST' => $logoG, + 'HOME_NAME' => $homename, + 'GUEST_NAME' => $guestname, + 'HOME_SHORT' => $homeshort, + 'GUEST_SHORT' => $guestshort, + 'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], + 'tid' => $homeid, 'mode' => 'all')), + 'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], + 'tid' => $guestid, 'mode' => 'all')), + 'BET_HOME' => $row['bet_home'], + 'BET_GUEST' => $row['bet_guest'], + 'DELIVERTAG' => $delivertag, + 'GOALS_HOME' => ($row['goals_home'] == '') ? ' ' : $row['goals_home'], + 'GOALS_GUEST' => ($row['goals_guest'] == '') ? ' ' : $row['goals_guest'], + 'POINTS' => ($row['points'] == '') ? ' ' : $row['points'], + 'U_MATCH_STATS' => $this->helper->route('football_football_popup', array('popside' => 'hist_popup', 's' => $season, 'l' => $row['league'], + 'hid' => $homeid, 'gid' => $guestid, 'm' => $row['matchday'], + 'mn' => $row['match_no'], 'gr' => $row['group_id'])), + 'DATA_RESULTS' => $data_bet_results, + 'DISPLAY_LINK' => $display_link, + 'TREND' => $row['trend'], + 'ODDS' => ($row['odd_1'] == '') ? '' : $row['odd_1'] . '|' . $row['odd_x'] . '|' . $row['odd_2'], + 'RATING' => $row['rating'], + ) + ); + } + else + { + $data_bet_results = true; + $colorstyle = color_style($row['status']); + + $template->assign_block_vars('bet_view', array( + 'ROW_CLASS' => $row_class, + 'LEAGUE_ID' => $row['league'], + 'MATCH_NUMBER' => $row['match_no'], + 'MATCHDAY' => $row['matchday'], + 'STATUS' => $row['status'], + 'MATCH_TIME' => $row['match_time'], + 'GROUP' => $group_id, + 'HOME_ID' => $homeid, + 'GUEST_ID' => $guestid, + 'LOGO_HOME' => $logoH, + 'LOGO_GUEST' => $logoG, + 'HOME_NAME' => $homename, + 'GUEST_NAME' => $guestname, + 'HOME_SHORT' => $homeshort, + 'GUEST_SHORT' => $guestshort, + 'BET_HOME' => ($row['bet_home'] == '') ? ' ' : $row['bet_home'], + 'BET_GUEST' => ($row['bet_guest'] == '') ? ' ' : $row['bet_guest'], + 'GOALS_HOME' => ($row['goals_home'] == '') ? ' ' : $row['goals_home'], + 'GOALS_GUEST' => ($row['goals_guest'] == '') ? ' ' : $row['goals_guest'], + 'POINTS' => ($row['points'] == '') ? ' ' : $row['points'], + 'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], + 'tid' => $homeid, 'mode' => 'all')), + 'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], + 'tid' => $guestid, 'mode' => 'all')), + 'U_MATCH_STATS' => $this->helper->route('football_football_popup', array('popside' => 'hist_popup', 's' => $season, 'l' => $row['league'], + 'hid' => $homeid, 'gid' => $guestid, 'm' => $row['matchday'], + 'mn' => $row['match_no'], 'gr' => $row['group_id'])), + 'COLOR_STYLE' => $colorstyle, + 'DISPLAY_LINK' => $display_link, + 'TREND' => $row['trend'], + 'ODDS' => ($row['odd_1'] == '') ? '' : $row['odd_1'] . '|' . $row['odd_x'] . '|' . $row['odd_2'], + 'RATING' => $row['rating'], + ) + ); + } +} +$db->sql_freeresult($result); + +// Calculate extra bets of matchday +// Start select team +$sql = 'SELECT + team_id AS option_value, + team_name AS option_name + FROM ' . FOOTB_TEAMS . " + WHERE season = $season + AND league = $league + ORDER BY team_name ASC"; + +$result = $db->sql_query($sql); +$option_rows = $db->sql_fetchrowset($result); +$db->sql_freeresult($result); + +$sql = "SELECT e.*, + eb.bet, + eb.bet_points, + t1.team_name AS result_team, + t2.team_name AS bet_team + FROM " . FOOTB_EXTRA . ' AS e + LEFT JOIN ' . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = e.season AND eb.league = e.league AND eb.extra_no = e.extra_no AND eb.user_id = $userid) + LEFT JOIN " . FOOTB_TEAMS . ' AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = e.season AND t2.league = e.league AND t2.team_id = eb.bet) + WHERE e.season = $season + AND e.league = $league + AND e.matchday = $matchday + ORDER BY e.extra_no ASC"; + +$result = $db->sql_query($sql); + +$extra_bet = false; +$extra_edit = false; +$extra_results = false; +$extranumber = 0; + +while ($row = $db->sql_fetchrow($result)) +{ + $extra_bet = true; + $extranumber++ ; + $row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + + switch($row['question_type']) + { + case '1': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '2': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '3': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '4': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '5': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']); + } + break; + default : + { + $display_type = 2; + $eval_title = ''; + } + break; + } + + if ($row['extra_status'] <= 0) + { + // edit extra bets + $extra_edit = true; + $bet_extra = ($row['bet_team'] == NULL) ? '' : $row['bet_team']; + + switch($row['question_type']) + { + case '3': + case '4': + { + $option_arr = array(); + for ($i = 65; $i <= 72; $i++) + { + if (strstr($row['question'], chr($i) . ':')) + { + $option_arr[] = array( + 'option_value' => chr($i), + 'option_name' => chr($i), + ); + } + } + if (sizeof($option_arr) > 1) + { + $display_type = 1; + $option_rows = $option_arr; + $bet_extra = $row['bet']; + } + } + break; + } + + $template->assign_block_vars('extra_edit', array( + 'ROW_CLASS' => $row_class, + 'EXTRA_NO' => $row['extra_no'], + 'QUESTION' => $row['question'], + 'EXTRA_POINTS' => $row['extra_points'], + 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), + 'EVALUATION_TITLE' => $eval_title, + 'BET' => ($display_type == 1) ? $bet_extra : $row['bet'], + 'S_DISPLAY_TYPE' => $display_type, + ) + ); + + if ($display_type == 1) + { + $selected = ($row['bet'] == '') ? ' selected="selected"' : ''; + + $template->assign_block_vars('extra_edit.extra_option', array( + 'OPTION_VALUE' => '', + 'OPTION_NAME' => sprintf($user->lang['SELECT']), + 'S_SELECTED' => $selected)); + + foreach ($option_rows as $option_row) + { + $selected = ($row['bet'] && $option_row['option_value'] == $row['bet']) ? ' selected="selected"' : ''; + $template->assign_block_vars('extra_edit.extra_option', array( + 'OPTION_VALUE' => $option_row['option_value'], + 'OPTION_NAME' => $option_row['option_name'], + 'S_SELECTED' => $selected)); + } + } + } + else + { + // view extra bets + $extra_results = true; + $extra_colorstyle = color_style($row['extra_status']); + $extra_result = ($row['result'] == '') ? ' ' : $row['result']; + $result_extra = ($row['result_team'] == NULL) ? ' ' : $row['result_team']; + $bet = ($row['bet'] == '') ? ' ' : $row['bet']; + $bet_extra = ($row['bet_team'] == NULL) ? ' ' : $row['bet_team']; + + $template->assign_block_vars('extra_view', array( + 'ROW_CLASS' => $row_class, + 'QUESTION' => $row['question'], + 'EXTRA_POINTS' => $row['extra_points'], + 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), + 'EVALUATION_TITLE' => $eval_title, + 'RESULT' => ($display_type == 1) ? $result_extra : $extra_result, + 'BET' => ($display_type == 1) ? $bet_extra : $bet, + 'BET_POINTS' => $row['bet_points'], + 'COLOR_STYLE' => $extra_colorstyle, + ) + ); + } +} +$league_info = league_info($season, $league); +$bet_explain = ''; +switch ($league_info['bet_ko_type']) +{ + case BET_KO_90: + $bet_explain = sprintf($user->lang['MIN90']); + break; + case BET_KO_EXTRATIME: + $bet_explain = sprintf($user->lang['EXTRATIME_SHORT']); + break; + case BET_KO_PENALTY: + $bet_explain = sprintf($user->lang['PENALTY']); + break; + default: + $bet_explain = sprintf($user->lang['MIN90']); + break; +} + +$link_rules = ''; +if (!$data_bet AND join_allowed($season, $league) AND $user->data['user_id'] != ANONYMOUS) +{ + if ($league_info["rules_post_id"]) + { + $join_league = true; + $link_rules = append_sid($phpbb_root_path . "viewtopic.$phpEx?p=" . $league_info["rules_post_id"]); + } + else + { + $link_rules = ''; + } +} + +$sidename = sprintf($user->lang['BET']); +$template->assign_vars(array( + 'S_DISPLAY_BET' => true, + 'S_SIDENAME' => $sidename, + 'BET_EXPLAIN' => $bet_explain, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'stat_results', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['STAT_RESULTS']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['ALL_BETS']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_STAT_RESULTS']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_ALL_BETS']), + 'JOIN_LEAGUE' => ($link_rules == '') ? '' : sprintf($user->lang['JOIN_LEAGUE'], $link_rules), + 'S_FORM_ACTION_BET' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'bet')), + 'S_FORM_ACTION_JOIN' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'join')), + 'S_USER_IS_MEMBER' => $user_is_member, + 'S_DATA_BET' => $data_bet, + 'S_DATA_GROUP' => $data_group, + 'S_DATA_BET_RESULTS' => $data_bet_results, + 'S_EDIT_MODE' => $edit_mode, + 'S_DISPLAY_DELIVERY2' => $display_delivery2, + 'S_DISPLAY_DELIVERY3' => $display_delivery3, + 'S_DELIVERY2' => $delivery2, + 'S_DELIVERY3' => $delivery3, + 'S_JOIN_LEAGUE' => $join_league, + 'S_EXTRA_BET' => $extra_bet, + 'S_EXTRA_RESULTS' => $extra_results, + 'S_EXTRA_EDIT' => $extra_edit, + 'S_DISPLAY_RATING' => $display_rating, + ) +); + +?> \ No newline at end of file diff --git a/block/bet_popup.php b/block/bet_popup.php new file mode 100644 index 0000000..f892cd5 --- /dev/null +++ b/block/bet_popup.php @@ -0,0 +1,391 @@ +data['user_id'] == ANONYMOUS) + { + trigger_error('NO_GUEST_VIEW'); + } +} +if (!$config['football_user_view']) +{ + // Only Prediction League member should see this page + // Check Prediction League authorisation + if ( !$this->auth->acl_get('u_use_football') ) + { + trigger_error('NO_AUTH_VIEW'); + } +} + +// Football disabled? +if ($config['football_disable']) +{ + $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; + trigger_error($message); +} + +$userid = $this->request->variable('u', 0); +$season = $this->request->variable('s', 0); +$league = $this->request->variable('l', 0); +$matchday = $this->request->variable('m', 0); + +$error_message = ''; +$username = '?'; +if (!$userid OR !$season OR !$league OR !$matchday) +{ + $data_bet = false; + if (!$userid) + { + $error_message .= sprintf($user->lang['NO_USERID']) . '
'; + } + if (!$season) + { + $error_message .= sprintf($user->lang['NO_SEASON']) . '
'; + } + if (!$league) + { + $error_message .= sprintf($user->lang['NO_LEAGUE']) . '
'; + } + if (!$matchday) + { + $error_message .= sprintf($user->lang['NO_MATCHDAY']) . '
'; + } +} +else +{ + $season_info = season_info($season); + if (sizeof($season_info)) + { + $league_info = league_info($season, $league); + if (sizeof($league_info)) + { + // Get username + $sql = 'SELECT username + FROM ' . USERS_TABLE . " + WHERE user_id = $userid "; + $result = $db->sql_query($sql); + if ($row = $db->sql_fetchrow($result)) + { + $username = $row['username']; + } + else + { + $data_bet = false; + $error_message .= sprintf($user->lang['NO_USERID']) . '
'; + } + $db->sql_freeresult($result); + + $display_group = false; + $lang_dates = $user->lang['datetime']; + // Required for select_points function: + $league_info = league_info($season, $league); + + // Calculate matches and bets of matchday + $sql = "SELECT + m.league, + m.match_no, + m.matchday, + m.status, + m.group_id, + m.formula_home, + m.formula_guest, + t1.team_symbol AS home_symbol, + t2.team_symbol AS guest_symbol, + t1.team_id AS home_id, + t2.team_id AS guest_id, + t1.team_name AS home_name, + t2.team_name AS guest_name, + b.goals_home AS bet_home, + b.goals_guest AS bet_guest, + m.goals_home, + m.goals_guest, + CONCAT( + CASE DATE_FORMAT(m.match_datetime,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i') + ) AS match_time, + " . select_points() . " + FROM " . FOOTB_MATCHES . ' AS m + INNER JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no AND b.user_id = $userid) + LEFT JOIN " . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + GROUP BY m.match_no + ORDER BY m.match_datetime ASC, m.match_no ASC"; + + $result = $db->sql_query($sql); + if ($row = $db->sql_fetchrow($result)) + { + $data_bet = true; + $matchnumber = 0; + $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + do + { + $matchnumber++ ; + $row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $display_link = true; + if (0 == $row['home_id']) + { + $home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']); + $home_in_array = explode("#",$home_info); + $homelogo = $home_in_array[0]; + $homeid = $home_in_array[1]; + $homename = $home_in_array[2]; + } + else + { + $homelogo = $row['home_symbol']; + $homeid = $row['home_id']; + $homename = $row['home_name']; + } + if (0 == $row['guest_id']) + { + $guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']); + $guest_in_array = explode("#",$guest_info); + $guestlogo = $guest_in_array[0]; + $guestid = $guest_in_array[1]; + $guestname = $guest_in_array[2]; + } + else + { + $guestlogo = $row['guest_symbol']; + $guestid = $row['guest_id']; + $guestname = $row['guest_name']; + } + if ($homelogo <> '') + { + $logoH = "\""" ; + } + else + { + $logoH = "\"\"" ; + } + if ($guestlogo <> '') + { + $logoG = "\""" ; + } + else + { + $logoG = "\"\"" ; + } + + if ($row['group_id'] == '') + { + $group_id = ' '; + } + else + { + $display_group = true; + $group_id = $row['group_id']; + } + + + if ($row['status'] < 1 && !$config['football_view_bets']) + { + // hide bets + $bet_home = ($row['bet_home'] == '') ? ' ' : '?'; + $bet_guest = ($row['bet_guest'] == '') ? ' ' : '?'; + } + else + { + $bet_home = ($row['bet_home'] == '') ? ' ' : $row['bet_home']; + $bet_guest = ($row['bet_guest'] == '') ? ' ' : $row['bet_guest']; + } + + $colorstyle = color_style($row['status']); + $template->assign_block_vars('bet_view', array( + 'ROW_CLASS' => $row_class, + 'LEAGUE_ID' => $row['league'], + 'MATCH_NUMBER' => $row['match_no'], + 'MATCHDAY' => $row['matchday'], + 'STATUS' => $row['status'], + 'MATCH_TIME' => $row['match_time'], + 'GROUP' => $group_id, + 'HOME_ID' => $homeid, + 'GUEST_ID' => $guestid, + 'LOGO_HOME' => $logoH, + 'LOGO_GUEST' => $logoG, + 'HOME_NAME' => $homename, + 'GUEST_NAME' => $guestname, + 'BET_HOME' => $bet_home, + 'BET_GUEST' => $bet_guest, + 'GOALS_HOME' => ($row['goals_home'] == '') ? ' ' : $row['goals_home'], + 'GOALS_GUEST' => ($row['goals_guest'] == '') ? ' ' : $row['goals_guest'], + 'POINTS' => ($row['points'] == '') ? ' ' : $row['points'], + 'COLOR_STYLE' => $colorstyle, + ) + ); + } + while ($row = $db->sql_fetchrow($result)); + $db->sql_freeresult($result); + } + else + { + $data_bet = false; + $error_message .= sprintf($user->lang['NO_BETS']) . '
'; + } + } + else + { + $data_bet = false; + $error_message .= sprintf($user->lang['NO_LEAGUE']) . '
'; + } + } + else + { + $data_bet = false; + $error_message .= sprintf($user->lang['NO_SEASON']) . '
'; + } +} + +// Calculate extra bets of matchday +$sql = "SELECT e.*, + eb.bet, + eb.bet_points, + t1.team_name AS result_team, + t2.team_name AS bet_team + FROM " . FOOTB_EXTRA . ' AS e + LEFT JOIN ' . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = e.season AND eb.league = e.league AND eb.extra_no = e.extra_no AND eb.user_id = $userid) + LEFT JOIN " . FOOTB_TEAMS . ' AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = e.season AND t2.league = e.league AND t2.team_id = eb.bet) + WHERE e.season = $season + AND e.league = $league + AND e.matchday = $matchday + ORDER BY e.extra_no ASC"; + +$result = $db->sql_query($sql); + +$extra_bet = false; +$extranumber = 0; + +while ($row = $db->sql_fetchrow($result)) +{ + $extra_bet = true; + $extranumber++ ; + $row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + + if ($row['extra_status'] < 1 && !$config['football_view_bets']) + { + // hide bets + $bet = ($row['bet'] == '') ? ' ' : '?'; + $bet_team = ($row['bet_team'] == NULL) ? ' ' : '?'; + } + else + { + $bet = ($row['bet'] == '') ? ' ' : $row['bet']; + $bet_team = ($row['bet_team'] == NULL) ? ' ' : $row['bet_team']; + } + $extra_colorstyle = color_style($row['extra_status']); + + switch($row['question_type']) + { + case '1': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '2': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '3': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '4': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']); + } + break; + case '5': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + default : + { + $display_type = 2; + $eval_title = ''; + } + break; + } + + $template->assign_block_vars('extra_view', array( + 'ROW_CLASS' => $row_class, + 'QUESTION' => $row['question'], + 'EXTRA_POINTS' => $row['extra_points'], + 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), + 'EVALUATION_TITLE' => $eval_title, + 'RESULT' => ($display_type == 1) ? $row['result_team'] : $row['result'], + 'BET' => ($display_type == 1) ? $bet_team : $bet, + 'BET_POINTS' => $row['bet_points'], + 'COLOR_STYLE' => $extra_colorstyle, + ) + ); +} + +$sidename = sprintf($user->lang['BET']); +if ($data_bet) +{ + $template->assign_vars(array( + 'S_SIDENAME' => $sidename, + 'S_USER_NAME' => $username, + 'S_ERROR_MESSAGE' => $error_message, + 'S_FROM' => sprintf($user->lang['FROM_DAY_SEASON'], $matchday, $season), + 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), + 'S_DATA_BET' => $data_bet, + 'S_DISPLAY_GROUP' => $display_group, + 'S_EXTRA_BET' => $extra_bet, + ) + ); + + // output page + page_header(sprintf($user->lang['BETS_OF']) . ' ' . $username); +} +else +{ + $template->assign_vars(array( + 'S_SIDENAME' => $sidename, + 'S_USER_NAME' => '', + 'S_ERROR_MESSAGE' => $error_message, + 'S_FROM' => '', + 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), + 'S_DATA_BET' => $data_bet, + 'S_DISPLAY_GROUP' => false, + ) + ); + + // output page + page_header(sprintf($user->lang['BETS_OF'])); +} + +$template->set_filenames(array( + 'body' => 'bet_popup.html') +); + +page_footer(); +?> \ No newline at end of file diff --git a/block/delivery.php b/block/delivery.php new file mode 100644 index 0000000..0078c49 --- /dev/null +++ b/block/delivery.php @@ -0,0 +1,157 @@ +data['user_id']; +$lang_dates = $user->lang['datetime']; +$index = 0; +$local_board_time = time() + (($config['board_timezone'] - $config['football_host_timezone']) * 3600); +$sql = "(SELECT + m.season, + m.league, + m.matchday, + l.league_name_short, + CASE m.matchday_name + WHEN '' + THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "') + ELSE m.matchday_name + END AS matchday_name, + CONCAT( + CASE DATE_FORMAT(m.delivery_date,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(m.delivery_date,' %d.%m.%y %H:%i') + ) as delivery_time, + m.delivery_date AS delivery, + SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count, + COUNT(*) AS matches_count, + SUM(IF(eb.extra_no > 0, IF(eb.bet = '', 0, 1), 0)) AS extra_bets_count, + SUM(IF(e.extra_no > 0, 1, 0)) AS extra_count + FROM " . FOOTB_MATCHDAYS . " AS m + JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league) + JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = 0) + JOIN " . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = ma.match_no AND b.user_id = $user_id) + LEFT JOIN " . FOOTB_EXTRA . " AS e ON (e.season = m.season AND e.league = m.league AND e.matchday = m.matchday AND e.extra_status = 0) + LEFT JOIN " . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = m.season AND eb.league = m.league AND eb.extra_no = e.extra_no AND eb.user_id = $user_id) + WHERE m.delivery_date > FROM_UNIXTIME('$local_board_time') + AND m.status <= 0 + GROUP BY m.delivery_date, m.league, b.user_id + ) + UNION + (SELECT + m.season, + m.league, + m.matchday, + l.league_name_short, + CASE m.matchday_name + WHEN '' + THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "') + ELSE m.matchday_name + END AS matchday_name, + CONCAT( + CASE DATE_FORMAT(m.delivery_date_2,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(m.delivery_date_2,' %d.%m.%y %H:%i') + ) as delivery_time, + m.delivery_date_2 AS delivery , + SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count, + COUNT(*) AS matches_count, + 0 AS extra_bets_count, + 0 AS extra_count + FROM " . FOOTB_MATCHDAYS . " AS m + JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league) + JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = -1) + JOIN " . FOOTB_BETS . " AS b ON (b.season = ma.season AND b.league = ma.league AND b.match_no = ma.match_no AND b.user_id = $user_id) + WHERE m.delivery_date_2 > FROM_UNIXTIME('$local_board_time') + AND m.status <= 0 + GROUP BY m.delivery_date, m.league, b.user_id + ) + UNION + (SELECT + m.season, + m.league, + m.matchday, + l.league_name_short, + CASE m.matchday_name + WHEN '' + THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "') + ELSE m.matchday_name + END AS matchday_name, + CONCAT( + CASE DATE_FORMAT(m.delivery_date_3,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(m.delivery_date_3,' %d.%m.%y %H:%i') + ) as delivery_time, + m.delivery_date_3 AS delivery, + SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count, + COUNT(*) AS matches_count, + 0 AS extra_bets_count, + 0 AS extra_count + FROM " . FOOTB_MATCHDAYS . " AS m + JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league) + JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = -2) + JOIN " . FOOTB_BETS . " AS b ON (b.season = ma.season AND b.league = ma.league AND b.match_no = ma.match_no AND b.user_id = $user_id) + WHERE m.delivery_date_3 > FROM_UNIXTIME('$local_board_time') + AND m.status <= 0 + GROUP BY m.delivery_date, m.league, b.user_id + ) + ORDER BY delivery, league"; + +$result = $db->sql_query($sql); +while($row = $db->sql_fetchrow($result) AND $index < 11) +{ + $index++; + $data_delivery = true; + $row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + + $template->assign_block_vars('delivery', array( + 'ROW_CLASS' => $row_class, + 'U_BET_LINK' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $row['season'], 'l' => $row['league'], 'm' => $row['matchday'])), + 'LEAGUE_SHORT' => $row['league_name_short'], + 'MATCHDAY_NAME' => $row['matchday_name'], + 'COLOR' => ($row['bets_count'] == $row['matches_count'] && $row['extra_bets_count'] == $row['extra_count']) ? 'green' : 'red', + 'TITLE' => ($row['bets_count'] == $row['matches_count']) ? sprintf($user->lang['DELIVERY_READY']) : sprintf($user->lang['DELIVERY_NOT_READY']), + 'DELIVERY' => $row['delivery_time'], + ) + ); +} +$db->sql_freeresult($result); + +$template->assign_vars(array( + 'S_DISPLAY_DELIVERY' => $data_delivery, + 'S_DATA_DELIVERY' => $data_delivery, + ) +); + +?> \ No newline at end of file diff --git a/block/dload_bank.php b/block/dload_bank.php new file mode 100644 index 0000000..7745db3 --- /dev/null +++ b/block/dload_bank.php @@ -0,0 +1,134 @@ +user->add_lang_ext('football/football', 'info_acp_bank'); + +// Check Prediction League authorisation +if ( !$this->auth->acl_get('u_use_football') ) +{ + trigger_error('NO_AUTH_VIEW'); +} + +$action=''; + $phpbb_root_path = './../../'; + +if (!$season OR !$league) +{ + redirect($this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league))); +} +else +{ + $season_info = season_info($season); + if (!sizeof($season_info)) + { + $error_message = sprintf($user->lang['NO_SEASON']); + trigger_error($error_message); + } + else + { + $league_info = league_info($season, $league); + if (!sizeof($league_info)) + { + $error_message = sprintf($user->lang['NO_LEAGUE']); + trigger_error($error_message); + } + else + { + $bet_points = $league_info['bet_points']; + $league_name =$league_info['league_name']; + $league_short =$league_info['league_name_short']; + + $user_points = ''; + global $phpbb_extension_manager; + if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $config['points_enable']) + { + $user_points = 'u.user_points,'; + } + else + { + $user_points = "0.00 AS user_points,"; + } + + // Grab the members points + $sql = "SELECT + b.user_id, + u.username, + $user_points + $bet_points AS bet_points, + SUM(IF(p.points_type = " . POINTS_BET . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_bet_points, + SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_deposit, + SUM(IF(p.points_type IN (' . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . '), + IF(p.cash = 0, p.points, 0.00), + 0.00)) AS no_cash_wins, + SUM(IF(p.points_type = ' . POINTS_PAID . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_paid, + SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', p.points, 0.00)) AS deposit, + IF(SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points, p.points * -1.0)) > 0, + SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points, p.points * -1.0)), 0.00) AS new_deposit, + SUM(IF(p.points_type IN (' . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . '), + p.points, 0.00)) AS wins, + SUM(IF(p.points_type = ' . POINTS_PAID . ', p.points, 0.00)) AS paid, + IF(SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)) > 0, + SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)), 0.00) AS new_pay + FROM ' . FOOTB_BETS . ' AS b + JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id) + LEFT JOIN ' . FOOTB_POINTS . " AS p ON (p.season = $season AND p.league = $league AND p.user_id = b.user_id) + WHERE b.season = $season + AND b.league = $league + AND b.match_no = 1 + GROUP BY b.user_id + ORDER BY u.username ASC"; + + if(!$result = $db->sql_query($sql)) + { + trigger_error('NO_LEAGUE'); + } + $user_rows = $db->sql_fetchrowset($result); + $export_file = $league_short . '_' . $season . '_bank.csv'; + $newline = "\r\n"; + header('Pragma: no-cache'); + header("Content-Type: text/csv; name=\"$export_file\""); + header("Content-disposition: attachment; filename=$export_file"); + $export= ''; + $export .= $league_name . ' ' . sprintf($user->lang['SEASON']) . ' ' . $season. $newline; + $export .= sprintf($user->lang['NAME']) . ';' . $config['football_win_name'] . ';' . sprintf($user->lang['BET_POINTS']) . ';' . + sprintf($user->lang['DEPOSITED']) . ';' . sprintf($user->lang['DEPOSIT']) . ';' . sprintf($user->lang['WINS']) . ';' . + sprintf($user->lang['PAID']) . ';' . sprintf($user->lang['PAYOUT']) . ';' . $newline; + + $curr_season = curr_season(); + foreach ($user_rows as $user_row) + { + if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $config['points_enable'] && $season == $curr_season) + { + $no_cash_bet_points = ($user_row['no_cash_bet_points'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_bet_points']) . ')'; + $no_cash_deposit = ($user_row['no_cash_deposit'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_deposit']) . ')'; + $no_cash_wins = ($user_row['no_cash_wins'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_wins']) . ')'; + $no_cash_paid = ($user_row['no_cash_paid'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_paid']) . ')'; + } + else + { + $no_cash_bet_points = ''; + $no_cash_deposit = ''; + $no_cash_wins = ''; + $no_cash_paid = ''; + } + $export .= str_replace("\"", "\"\"", $user_row['username']) . ';' . + str_replace('.', ',', $user_row['user_points']) . ';' . + str_replace('.', ',', $user_row['bet_points']) . $no_cash_bet_points . ';' . + str_replace('.', ',', $user_row['deposit']) . $no_cash_deposit . ';' . + str_replace('.', ',', $user_row['new_deposit']) . ';' . + str_replace('.', ',', $user_row['wins']) . $no_cash_wins . ';' . + str_replace('.', ',', $user_row['paid']) . $no_cash_paid . ';' . + str_replace('.', ',', $user_row['new_pay']) . ';' . $newline; + } + echo utf8_decode($export); + exit; + } + } +} +?> \ No newline at end of file diff --git a/block/dload_bank_open.php b/block/dload_bank_open.php new file mode 100644 index 0000000..a4acc2e --- /dev/null +++ b/block/dload_bank_open.php @@ -0,0 +1,87 @@ +user->add_lang_ext('football/football', 'info_acp_bank'); + +// Check Prediction League authorisation +if ( !$this->auth->acl_get('u_use_football') ) +{ + trigger_error('NO_AUTH_VIEW'); +} + +$action=''; + +if (!$season) +{ + redirect($this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season))); +} +else +{ + $season_info = season_info($season); + if (!sizeof($season_info)) + { + $error_message = sprintf($user->lang['NO_SEASON']); + trigger_error($error_message); + } + else + { + // Grab the members points + $sql = 'SELECT + u.username, + p.season, + p.league, + round(sum(if(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)),2) as saldo + FROM ' . FOOTB_POINTS . ' AS p + JOIN ' . USERS_TABLE . " AS u ON (u.user_id = p.user_id) + WHERE p.season <= $season + GROUP BY p.season, p.league, u.username + HAVING saldo <> 0.00 + ORDER BY u.username, p.season, p.league"; + + if(!$result = $db->sql_query($sql)) + { + trigger_error('NO_SEASON'); + } + $user_rows = $db->sql_fetchrowset($result); + $export_file = $season. '_bank.csv'; + $newline = "\r\n"; + header('Pragma: no-cache'); + header("Content-Type: text/csv; name=\"$export_file\""); + header("Content-disposition: attachment; filename=$export_file"); + $export= ''; + $export .= sprintf($user->lang['SEASON']) . ' ' . $season. $newline; + $export .= sprintf($user->lang['NAME']) . ';' . sprintf($user->lang['SEASON']) . ';' . sprintf($user->lang['LEAGUE']) . ';Saldo;' . $newline; + + $last_username = ''; + $sum_saldo = 0.0; + foreach ($user_rows as $user_row) + { + if ($last_username != '' AND $last_username != $user_row['username']) + { + $export .= str_replace("\"", "\"\"", $last_username) . ';Summe;;' . + str_replace('.', ',', $sum_saldo) . ';' . $newline; + $sum_saldo = 0.0; + } + $export .= str_replace("\"", "\"\"", $user_row['username']) . ';' . + $user_row['season'] . ';' . + $user_row['league'] . ';' . + str_replace('.', ',', $user_row['saldo']) . ';' . $newline; + $sum_saldo += $user_row['saldo']; + $last_username = $user_row['username']; + } + if ($last_username != '') + { + $export .= str_replace("\"", "\"\"", $last_username) . ';Summe;;' . + str_replace('.', ',', $sum_saldo) . ';' . $newline; + } + echo utf8_decode($export); + exit; + } +} +?> \ No newline at end of file diff --git a/block/dload_export.php b/block/dload_export.php new file mode 100644 index 0000000..8465686 --- /dev/null +++ b/block/dload_export.php @@ -0,0 +1,52 @@ +auth->acl_get('u_use_football') ) +{ + trigger_error('NO_AUTH_VIEW'); +} + +$action=''; + +if (!$season OR !$league) +{ + redirect($this->helper->route('football_main_controller', array('side' => 'bet'))); +} +else +{ + if (user_is_member($user->data['user_id'], $season, $league)) + { + $season_info = season_info($season); + if (!sizeof($season_info)) + { + $error_message = sprintf($user->lang['NO_SEASON']); + trigger_error($error_message); + } + else + { + $league_info = league_info($season, $league); + if (!sizeof($league_info)) + { + $error_message = sprintf($user->lang['NO_LEAGUE']); + trigger_error($error_message); + } + else + { + include($this->football_includes_path . 'export.' . $this->php_ext); + } + } + } + else + { + redirect($this->helper->route('football_main_controller', array('side' => 'bet'))); + } +} + +?> diff --git a/block/hist_popup.php b/block/hist_popup.php new file mode 100644 index 0000000..50e8e9b --- /dev/null +++ b/block/hist_popup.php @@ -0,0 +1,1352 @@ +data['user_id'] == ANONYMOUS) + { + trigger_error('NO_GUEST_VIEW'); + } +} +if (!$config['football_user_view']) +{ + // Only Prediction League member should see this page + // Check Prediction League authorisation + if ( !$this->auth->acl_get('u_use_football') ) + { + trigger_error('NO_AUTH_VIEW'); + } +} + +//Football disabled? +if ($config['football_disable']) +{ + $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; + trigger_error($message); +} + +$home_id = $this->request->variable('hid', 0); +$guest_id = $this->request->variable('gid', 0); +$season = $this->request->variable('s', 0); +$league = $this->request->variable('l', 0); +$matchday = $this->request->variable('m', 0); +$matchnumber = $this->request->variable('mn', 0); +$group_id = $this->request->variable('gr', ''); + + +// Check parms +$error_message = ''; +$data_history = false; +if (!$home_id OR !$guest_id OR !$season OR !$league OR !$matchday OR !$matchnumber) +{ + $data_history = false; + if (!$home_id) + { + $error_message .= sprintf($user->lang['NO_HOMETEAM']) . '
'; + } + if (!$guest_id) + { + $error_message .= sprintf($user->lang['NO_GUESTTEAM']) . '
'; + } + if (!$season) + { + $error_message .= sprintf($user->lang['NO_SEASON']) . '
'; + } + if (!$league) + { + $error_message .= sprintf($user->lang['NO_LEAGUE']) . '
'; + } + if (!$matchday) + { + $error_message .= sprintf($user->lang['NO_MATCHDAY']) . '
'; + } + if (!$matchnumber) + { + $error_message .= sprintf($user->lang['NO_MATCH']) . '
'; + } +} +else +{ + $season_info = season_info($season); + if (sizeof($season_info)) + { + $league_info = league_info($season, $league); + if (sizeof($league_info)) + { + $data_history = true; + $data_hist = false; + $data_home =false; + $data_guest = false; + $data_last_home = false; + $data_last_away = false; + $form_from = $matchday-5; + $value_h = 0; + $value_g = 0; + $value_hg = 0; + $value_gg = 0; + $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + + $sql = 'SELECT * + FROM ' . FOOTB_TEAMS . " + WHERE season = $season + AND league = $league + AND team_id = $home_id"; + + $result = $db->sql_query($sql); + if ($row = $db->sql_fetchrow($result)) + { + $home_name = $row['team_name']; + if ($row['team_symbol'] <> '') + { + $logo[$home_id] = "\""" ; + } + else + { + $logo[$home_id] = "\"\"" ; + } + $db->sql_freeresult($result); + } + else + { + $error_message .= sprintf($user->lang['NO_HOMETEAM']) . '
'; + $data_history = false; + } + $db->sql_freeresult($result); + + $sql = 'SELECT * + FROM ' . FOOTB_TEAMS . " + WHERE season = $season + AND league = $league + AND team_id = $guest_id"; + + $result = $db->sql_query($sql); + if ($row = $db->sql_fetchrow($result)) + { + $guest_name = $row['team_name']; + if ($row['team_symbol'] <> '') + { + $logo[$guest_id] = "\""" ; + } + else + { + $logo[$guest_id] = "\"\"" ; + } + $db->sql_freeresult($result); + } + else + { + $error_message .= sprintf($user->lang['NO_GUESTTEAM']) . '
'; + $data_history = false; + } + $db->sql_freeresult($result); + + + // Match history + $sql = "SELECT + IF(mh.team_id_home = $home_id, + IF(mh.goals_home + 0 > mh.goals_guest, '+0', IF(mh.goals_home = mh.goals_guest, '30', '-0')), + IF(mh.goals_home + 0 < mh.goals_guest, '+90', IF(mh.goals_home = mh.goals_guest, '60', '-90'))) AS chart_points, + mh.match_date AS season, + mh.match_type AS league, + mh.team_id_home AS home_id, + mh.team_id_guest AS guest_id, + th.team_name AS home_name, + tg.team_name AS guest_name, + mh.goals_home, + mh.goals_guest + FROM " . FOOTB_MATCHES_HIST . ' AS mh + LEFT JOIN ' . FOOTB_TEAMS . " AS th ON (th.season = $season AND th.league = $league AND th.team_id = mh.team_id_home) + LEFT JOIN " . FOOTB_TEAMS . " AS tg ON (tg.season = $season AND tg.league = $league AND tg.team_id = mh.team_id_guest) + WHERE ((mh.team_id_home = $home_id AND mh.team_id_guest = $guest_id) + OR (mh.team_id_home = $guest_id AND mh.team_id_guest = $home_id)) + ORDER BY mh.match_date ASC"; + + $result = $db->sql_query($sql); + $history = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $history_count = sizeof($history); + // Match history + $sql = "SELECT + IF(m.team_id_home = $home_id, + IF(m.goals_home + 0 > m.goals_guest, '+0', IF(m.goals_home = m.goals_guest, '30', '-0')), + IF(m.goals_home + 0 < m.goals_guest, '+90', IF(m.goals_home = m.goals_guest, '60', '-90'))) AS chart_points, + m.season, + m.league, + m.team_id_home AS home_id, + m.team_id_guest AS guest_id, + th.team_name AS home_name, + tg.team_name AS guest_name, + m.goals_home, + m.goals_guest + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . " AS th ON (th.season = $season AND th.league = $league AND th.team_id = m.team_id_home) + LEFT JOIN " . FOOTB_TEAMS . " AS tg ON (tg.season = $season AND tg.league = $league AND tg.team_id = m.team_id_guest) + WHERE ((m.team_id_home = $home_id AND m.team_id_guest = $guest_id) OR (m.team_id_home = $guest_id AND m.team_id_guest = $home_id)) + AND m.status IN (3,6) + AND (m.season <> $season OR m.league <> $league OR m.match_no < $matchnumber) + ORDER BY m.season ASC, m.matchday ASC"; + + $result = $db->sql_query($sql); + if ($history_count != 0) + { + $history = array_merge($history, $db->sql_fetchrowset($result)); + } + else + { + $history = $db->sql_fetchrowset($result); + } + $db->sql_freeresult($result); + $history_count = sizeof($history); + if ($history_count != 0) + { + $chart_points = ''; + $data_hist = true; + $rank = 0; + $map_total_coords = array(); + $map_total_titles = array(); + foreach ($history as $row) + { + $chart_points = $chart_points . $row['chart_points'] . ','; + $coord_start = $start + ($rank * $vert); + $coord_end = $end + ($rank * $vert); + if (abs($row['chart_points']) > 45) + { + $coords = $coord_start . ",45," . $coord_end . "," . abs($row['chart_points']); + } + else + { + $coords = $coord_start . "," . abs($row['chart_points']) . "," . $coord_end . ",45"; + } + $map_total_coords[] = $coords; + $map_total_titles[] = $row['home_name'] . ' - ' . $row['guest_name'] . ' ' . $row['goals_home'] . ':' . $row['goals_guest']; + $rank++ ; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('historie', array( + 'ROW_CLASS' => $row_class, + 'SEASON' => $row['season'], + 'LEAGUE' => $row['league'], + 'HLOGO' => $logo[$row['home_id']], + 'HNAME' => $row['home_name'], + 'GLOGO' => $logo[$row['guest_id']], + 'GNAME' => $row['guest_name'], + 'GOALS_HOME' => $row['goals_home'], + 'GOALS_GUEST' => $row['goals_guest'], + ) + ); + } + $db->sql_freeresult($result); + + // Statistic and forecast-points for historie + $sql = "SELECT + SUM(IF(team_id_home = $home_id, goals_home , goals_guest)) AS hg, + SUM(IF(team_id_home = $guest_id, goals_home , goals_guest)) AS gg, + SUM(IF(team_id_home = $home_id, IF(goals_home + 0 > goals_guest AND goals_home <> '' AND goals_guest <> '', 1 ,0), 0)) AS hw, + SUM(IF(team_id_home = $home_id, IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '', 1 ,0), 0)) AS hd, + SUM(IF(team_id_home = $home_id, IF(goals_home + 0 < goals_guest AND goals_home <> '' AND goals_guest <> '', 1 ,0), 0)) AS hl, + SUM(IF(team_id_home = $home_id, IF(goals_home + 0 > goals_guest, 1 ,0), IF(goals_home + 0 < goals_guest,1,0))) AS gw, + SUM(IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '',1,0)) AS gd, + SUM(IF(team_id_home = $home_id, IF(goals_home + 0 < goals_guest, 1 ,0), IF(goals_home + 0 > goals_guest,1,0))) AS gl, + SUM(IF(team_id_home = $home_id, + IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)), + IF(goals_home + 0 < goals_guest, 4, IF(goals_home = goals_guest, 2, 0)) + ) + ) AS value_h, + SUM(IF(team_id_home = $guest_id, + IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)), + IF(goals_home + 0 < goals_guest, 4, IF(goals_home = goals_guest, 2, 0)) + ) + ) AS value_g + FROM " . FOOTB_MATCHES_HIST . " + WHERE ((team_id_home = $home_id AND team_id_guest = $guest_id) + OR (team_id_home = $guest_id AND team_id_guest = $home_id))"; + + $result = $db->sql_query($sql); + $row_hist = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $sql = "SELECT + SUM(IF(team_id_home = $home_id, goals_home , goals_guest)) AS hg, + SUM(IF(team_id_home = $guest_id, goals_home , goals_guest)) AS gg, + SUM(IF(team_id_home = $home_id, IF(goals_home + 0 > goals_guest, 1 ,0), 0)) AS hw, + SUM(IF(team_id_home = $home_id, IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '', 1 ,0), 0)) AS hd, + SUM(IF(team_id_home = $home_id, IF(goals_home + 0 < goals_guest, 1 ,0), 0)) AS hl, + SUM(IF(team_id_home = $home_id, IF(goals_home + 0 > goals_guest, 1 ,0), IF(goals_home + 0 < goals_guest, 1, 0))) AS gw, + SUM(IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '', 1, 0)) AS gd, + SUM(IF(team_id_home = $home_id, IF(goals_home + 0 < goals_guest, 1 ,0), IF(goals_home + 0 > goals_guest, 1, 0))) AS gl, + SUM(IF(team_id_home = $home_id, + IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '', 1, 0)), + IF(goals_home + 0 < goals_guest, 4, IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '', 2, 0)) + ) + ) AS value_h, + SUM(IF(team_id_home = $guest_id, + IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '',1,0)), + IF(goals_home + 0 < goals_guest,4, IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '',2,0)) + ) + ) AS value_g + FROM " . FOOTB_MATCHES . " + WHERE ((team_id_home = $home_id AND team_id_guest = $guest_id) OR (team_id_home = $guest_id AND team_id_guest = $home_id)) + AND status IN (3,6) + AND (season <> $season OR league <> $league OR match_no < $matchnumber)"; + + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + if (sizeof($row_hist)) + { + if (sizeof($row)) + { + $row['hg'] += $row_hist['hg']; + $row['gg'] += $row_hist['gg']; + $row['hw'] += $row_hist['hw']; + $row['hd'] += $row_hist['hd']; + $row['hl'] += $row_hist['hl']; + $row['gw'] += $row_hist['gw']; + $row['gd'] += $row_hist['gd']; + $row['gl'] += $row_hist['gl']; + $row['value_h'] += $row_hist['value_h']; + $row['value_g'] += $row_hist['value_g']; + } + else + { + $row = $row_hist; + } + } + + $stat_hist = ''; + $percent_home = 0; + $percent_draw = 0; + $percent_guest = 0; + if (sizeof($row)) + { + if ($history_count <= 2) + { + // $history_count = 1 => draws * 1/4 + // $history_count = 2 => draws * 1/6 + $percent_draw = round($row['gd'] / ((2 * $history_count) + 2),2); + } + else + { + // $history_count > 2 => draws * 1/2 + $percent_draw = round($row['gd'] / ($history_count * 2),2); + } + $value_h = round($row['value_h'] / ($history_count * 2),2); + $value_g = round($row['value_g'] / ($history_count * 2),2); + + $stat_hist = sprintf($user->lang['THIS_MATCH']) . ': ' . $row['hw'] . '/' . $row['hd'] . '/'. $row['hl'] . '   ' . + sprintf($user->lang['TOTAL']) . ': ' . $row['gw'] . '/'. $row['gd'] . '/' . $row['gl'] . '   ' . + sprintf($user->lang['GOALS']) . ': ' . $row['hg'] . ':'. $row['gg'] . '   ' . + sprintf($user->lang['FORECAST_PTS']) . ': ' . $value_h . ':' . $value_g; + + $template->assign_vars(array( + 'STAT_HIST' => $stat_hist, + ) + ); + } + $db->sql_freeresult($result); + + //Charts history + $chart_points = substr($chart_points, 0, strlen($chart_points) - 1); + $chart= "football_root_path + . "includes/chart_hist.php?v1=$chart_points' alt='" . sprintf($user->lang['TOTAL']) . "' usemap='#map_total'/>"; + $template->assign_block_vars('chart_hist_total', array( + 'CHARTIMAGE' => $chart, + ) + ); + for ($i = 0; $i < sizeof($map_total_coords); $i++) + { + $template->assign_block_vars('chart_hist_total.map_total', array( + 'COORDS' => $map_total_coords[$i], + 'TITLE' => $map_total_titles[$i], + ) + ); + } + } + + + // Table total + + if ($group_id == '' OR $group_id == '??') + { + $where_group = ''; + } + else + { + $where_group = " AND m.group_id = '" . $db->sql_escape($group_id) . "'"; + } + $sql = "SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS wins, + SUM(IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '', 1, 0)) AS draws, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 < goals_guest, 1, 0), IF(goals_home + 0 > goals_guest, 1, 0))) AS lost, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '', 1, 0)), + IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0)) + ) + ) AS points, + SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest, goals_guest - goals_home)) AS gdiff, + SUM(IF(m.team_id_home = t.team_id, goals_home, goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id, goals_guest, goals_home)) AS goals_against + FROM " . FOOTB_TEAMS . " AS t + LEFT JOIN " . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.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 + AND (m.matchday < $matchday) + AND (m.status IN (3,6)) $where_group + GROUP BY t.team_id + ORDER BY points DESC, gdiff DESC, goals DESC"; + + $result = $db->sql_query($sql); + $rank = 0; + $current_rank = 0; + $last_goals = 0; + $last_goals_againts = 0; + $last_points = 0; + while ($row = $db->sql_fetchrow($result)) + { + $rank++; + if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) + { + $current_rank = $rank; + } + $last_points = $row['points']; + $last_goals = $row['goals']; + $last_goals_againts = $row['goals_against']; + if ($home_id == $row['team_id']) + { + $data_home = true; + $value_h += round($row['points'] / ($row['matches'] * 3), 2); + $plfp = $current_rank . '(' . round($row['points'] / ($row['matches'] * 3), 2) . ')'; + $template->assign_block_vars('table_hometeam', array( + 'ROW_CLASS' => 'bg2 row_dark', + 'TABLE' => sprintf($user->lang['TABLE_TOTAL']), + 'PLFP' => $plfp, + 'MATCHES' => $row['matches'], + 'WINS' => $row['wins'], + 'DRAW' => $row['draws'], + 'LOST' => $row['lost'], + 'GOALS_HOME' => $row['goals'], + 'GOALS_GUEST' => $row['goals_against'], + 'GDIFF' => $row['gdiff'], + 'POINTS' => $row['points'], + ) + ); + } + if ($guest_id == $row['team_id']) + { + $data_guest = true; + $value_g += round($row['points'] / ($row['matches'] * 3),2); + $plfp = $current_rank . '(' . round($row['points'] / ($row['matches'] * 3), 2) . ')'; + $template->assign_block_vars('table_guestteam', array( + 'ROW_CLASS' => 'bg2 row_dark', + 'TABLE' => sprintf($user->lang['TABLE_TOTAL']), + 'PLFP' => $plfp, + 'MATCHES' => $row['matches'], + 'WINS' => $row['wins'], + 'DRAW' => $row['draws'], + 'LOST' => $row['lost'], + 'GOALS_HOME' => $row['goals'], + 'GOALS_GUEST' => $row['goals_against'], + 'GDIFF' => $row['gdiff'], + 'POINTS' => $row['points'], + ) + ); + } + } + $db->sql_freeresult($result); + + // Hometable hometeam + if ($data_home) + { + $sql = "SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS wins, + SUM(IF(goals_home = goals_guest, 1, 0)) AS draws, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 < goals_guest, 1, 0), IF(goals_home + 0 > goals_guest, 1, 0))) AS lost, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '', 1, 0)), + IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0)) + ) + ) AS points, + SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS gdiff, + SUM(IF(m.team_id_home = t.team_id, goals_home , goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id, goals_guest , goals_home)) AS goals_against + FROM " . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league AND m.team_id_home = t.team_id) + WHERE t.season = $season + AND t.league = $league + AND m.matchday < $matchday + AND m.status IN (3,6) + GROUP BY t.team_id + ORDER BY points DESC, gdiff DESC, goals DESC"; + + $result = $db->sql_query($sql); + $rank = 0; + $current_rank = 0; + $last_goals = 0; + $last_goals_againts = 0; + $last_points = 0; + while ($row = $db->sql_fetchrow($result)) + { + $data_home = true; + $rank++; + if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) + { + $current_rank = $rank; + } + $last_points = $row['points']; + $last_goals = $row['goals']; + $last_goals_againts = $row['goals_against']; + if ($home_id == $row['team_id']) + { + $win = $row['wins']; + $draw = $row['draws']; + $lost = $row['lost']; + $value_hg = round(((($win * 3) + $draw) / ($win + $draw + $lost)),2); + $value_h += $value_hg; + $plfp = $current_rank . '(' . $value_hg . ')'; + $template->assign_block_vars('table_hometeam', array( + 'ROW_CLASS' => 'bg1 row_light', + 'TABLE' => sprintf($user->lang['TABLE_HOME']), + 'PLFP' => $plfp, + 'MATCHES' => $row['matches'], + 'WINS' => $row['wins'], + 'DRAW' => $row['draws'], + 'LOST' => $row['lost'], + 'GOALS_HOME' => $row['goals'], + 'GOALS_GUEST' => $row['goals_against'], + 'GDIFF' => $row['gdiff'], + 'POINTS' => $row['points'], + ) + ); + } + } + $db->sql_freeresult($result); + } + + //Away-Table guestteam + if ($data_guest) + { + $sql = "SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), IF(m.goals_home + 0 > m.goals_guest, 1, 0), IF(m.goals_home + 0 < m.goals_guest, 1, 0))) AS wins, + SUM(IF(m.goals_home = m.goals_guest AND goals_home <> '' AND goals_guest <> '',1,0)) AS draws, + SUM(IF((m.team_id_home = t.team_id), IF(m.goals_home + 0 < m.goals_guest, 1, 0), IF(m.goals_home + 0 > m.goals_guest, 1, 0))) AS lost, + SUM(IF(m.team_id_home = t.team_id, + IF(m.goals_home + 0 > m.goals_guest, 3, IF(m.goals_home = m.goals_guest AND goals_home <> '' AND goals_guest <> '', 1, 0)), + IF(m.goals_home + 0 < m.goals_guest, 3, IF(m.goals_home = m.goals_guest, 1, 0)) + ) + ) AS points, + SUM(IF(m.team_id_home = t.team_id,m.goals_home - m.goals_guest , m.goals_guest - m.goals_home)) AS gdiff, + SUM(IF(m.team_id_home = t.team_id,m.goals_home , m.goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id,m.goals_guest , m.goals_home)) AS goals_against + FROM " . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league AND m.team_id_guest = t.team_id) + WHERE t.season = $season + AND t.league = $league + AND m.matchday < $matchday + AND m.status IN (3,6) + GROUP BY t.team_id + ORDER BY points DESC, gdiff DESC, goals DESC"; + + $result = $db->sql_query($sql); + $rank = 0; + $current_rank = 0; + $last_goals = 0; + $last_goals_againts = 0; + $last_points = 0; + while ($row = $db->sql_fetchrow($result)) + { + $rank++; + if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) + { + $current_rank = $rank; + } + $last_points = $row['points']; + $last_goals = $row['goals']; + $last_goals_againts = $row['goals_against']; + if ($guest_id == $row['team_id']) + { + $data_guest = true; + $win = $row['wins']; + $draw = $row['draws']; + $lost = $row['lost']; + $value_gg = round(((($win * 4) + ($draw * 2)) / ($win + $draw + $lost)),2); + $value_g += $value_gg; + $plfp = $current_rank . '(' . $value_gg . ')'; + $template->assign_block_vars('table_guestteam', array( + 'ROW_CLASS' => 'bg1 row_light', + 'TABLE' => sprintf($user->lang['TABLE_AWAY']), + 'PLFP' => $plfp, + 'MATCHES' => $row['matches'], + 'WINS' => $row['wins'], + 'DRAW' => $row['draws'], + 'LOST' => $row['lost'], + 'GOALS_HOME' => $row['goals'], + 'GOALS_GUEST' => $row['goals_against'], + 'GDIFF' => $row['gdiff'], + 'POINTS' => $row['points'], + ) + ); + } + } + $db->sql_freeresult($result); + } + + // Form-Table + $points_home = 0; + $points_guest = 0; + $form_matches = 0; + if ($data_home or $data_guest) + { + $sql = "SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS wins, + SUM(IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '', 1, 0)) AS draws, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 < goals_guest, 1, 0), IF(goals_home + 0 > goals_guest, 1, 0))) AS lost, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest AND goals_home <> '' AND goals_guest <> '', 1, 0)), + IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0)) + ) + ) AS points, + SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS gdiff, + SUM(IF(m.team_id_home = t.team_id, goals_home , goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id, goals_guest , goals_home)) AS goals_against + FROM " . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.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 + AND m.matchday >= $form_from + AND m.matchday < $matchday + AND m.status IN (3,6) + GROUP BY t.team_id + ORDER BY points DESC, gdiff DESC, goals DESC"; + + $result = $db->sql_query($sql); + $rank = 0; + $current_rank = 0; + $last_goals = 0; + $last_goals_againts = 0; + $last_points = 0; + while ($row = $db->sql_fetchrow($result)) + { + $rank++; + if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) + { + $current_rank = $rank; + } + $last_points = $row['points']; + $last_goals = $row['goals']; + $last_goals_againts = $row['goals_against']; + if ($home_id == $row['team_id']) + { + $points_home = $row['points']; + if ($row['matches'] > $form_matches) + { + $form_matches = $row['matches']; + } + $data_home = true; + $win = $row['wins']; + $draw = $row['draws']; + $lost = $row['lost']; + $value_hg = round(((($win * 2) + $draw) / ($win + $draw + $lost)),2); + $value_h += $value_hg; + $plfp = $current_rank . '(' . $value_hg . ')'; + $template->assign_block_vars('table_hometeam', array( + 'ROW_CLASS' => 'bg2 row_dark', + 'TABLE' => sprintf($user->lang['TABLE_FORM']), + 'PLFP' => $plfp, + 'MATCHES' => $row['matches'], + 'WINS' => $row['wins'], + 'DRAW' => $row['draws'], + 'LOST' => $row['lost'], + 'GOALS_HOME' => $row['goals'], + 'GOALS_GUEST' => $row['goals_against'], + 'GDIFF' => $row['gdiff'], + 'POINTS' => $row['points'], + ) + ); + } + if ($guest_id == $row['team_id']) + { + $points_guest = $row['points']; + if ($row['matches'] > $form_matches) + { + $form_matches = $row['matches']; + } + $data_guest = true; + $win = $row['wins']; + $draw = $row['draws']; + $lost = $row['lost']; + $value_gg = round(((($win * 2) + $draw) / ($win + $draw + $lost)),2); + $value_g += $value_gg; + $plfp = $current_rank . '(' . $value_gg . ')'; + $template->assign_block_vars('table_guestteam', array( + 'ROW_CLASS' => 'bg2 row_dark', + 'TABLE' => sprintf($user->lang['TABLE_FORM']), + 'PLFP' => $plfp, + 'MATCHES' => $row['matches'], + 'WINS' => $row['wins'], + 'DRAW' => $row['draws'], + 'LOST' => $row['lost'], + 'GOALS_HOME' => $row['goals'], + 'GOALS_GUEST' => $row['goals_against'], + 'GDIFF' => $row['gdiff'], + 'POINTS' => $row['points'], + ) + ); + } + } + $db->sql_freeresult($result); + } + + $matches_played = 0; + $draws_home = 0; + $draws_guest = 0; + + // Chart hometeam + if ($data_home) + { + $sql = "SELECT + IF(m.team_id_home = t.team_id, + IF(goals_home + 0 > goals_guest, '+0', IF(goals_home = goals_guest, '30', '-0')), + IF(goals_home + 0 < goals_guest, '+90', IF(goals_home = goals_guest, '60', '-90'))) AS chart_points, + th.team_name AS home_name, + tg.team_name AS guest_name, + m.goals_home, + m.goals_guest + FROM " . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league + AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) + LEFT JOIN ' . FOOTB_TEAMS . " AS th ON (th.season = $season AND th.league = $league AND th.team_id = m.team_id_home) + LEFT JOIN " . FOOTB_TEAMS . " AS tg ON (tg.season = $season AND tg.league = $league AND tg.team_id = m.team_id_guest) + WHERE t.season = $season + AND t.league = $league + AND m.matchday <= $matchday + AND m.match_no <> $matchnumber + AND m.status IN (3,6) + AND t.team_id=$home_id + ORDER BY m.match_datetime ASC"; + + $result = $db->sql_query($sql); + $trend = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $trend_count = sizeof($trend); + $chart_points = ''; + $map_home_coords = array(); + $map_home_titles = array(); + $rank = 0; + foreach ($trend as $row) + { + if ($row['chart_points'] == '30' or $row['chart_points'] == '60') + { + $draws_home += 1; + } + $chart_points = $chart_points . $row['chart_points']. ','; + $coord_start = $start + ($rank * $vert); + $coord_end = $end + ($rank * $vert); + if (abs($row['chart_points']) > 45) + { + $coords = $coord_start . ",45," . $coord_end . "," . abs($row['chart_points']); + } + else + { + $coords = $coord_start . "," . abs($row['chart_points']) . "," . $coord_end . ",45"; + } + $map_home_coords[] = $coords; + $map_home_titles[] = $row['home_name'] . ' - ' . $row['guest_name'] . ' ' . $row['goals_home'] . ':' . $row['goals_guest']; + $rank++; + } + $chart_points = substr($chart_points, 0, strlen($chart_points) - 1); + $chart= "football_root_path + . "includes/chart_hist.php?v1=$chart_points' alt='" . sprintf($user->lang['HIST_CHART']) . "' usemap='#map_home'/>"; + $template->assign_block_vars('chart_home', array( + 'CHARTIMAGE' => $chart, + ) + ); + for ($i = 0; $i < sizeof($map_home_coords); $i++) + { + $template->assign_block_vars('chart_home.map_home', array( + 'COORDS' => $map_home_coords[$i], + 'TITLE' => $map_home_titles[$i], + ) + ); + } + $matches_played = sizeof($map_home_coords); + } + + //Chart guestteam + if ($data_guest) + { + $sql = "SELECT + IF(m.team_id_home = t.team_id, + IF(goals_home + 0 > goals_guest, '+0', IF(goals_home = goals_guest, '30', '-0')), + IF(goals_home + 0 < goals_guest, '+90', IF(goals_home = goals_guest, '60', '-90') + ) + ) AS chart_points, + th.team_name AS home_name, + tg.team_name AS guest_name, + m.goals_home, + m.goals_guest + FROM " . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league + AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) + LEFT JOIN ' . FOOTB_TEAMS . " AS th ON (th.season = $season AND th.league = $league AND th.team_id = m.team_id_home) + LEFT JOIN " . FOOTB_TEAMS . " AS tg ON (tg.season = $season AND tg.league = $league AND tg.team_id = m.team_id_guest) + WHERE t.season = $season + AND t.league = $league + AND m.matchday <= $matchday + AND m.match_no <> $matchnumber + AND m.status IN (3,6) + AND t.team_id=$guest_id + ORDER BY m.match_datetime ASC"; + + $result = $db->sql_query($sql); + $trend = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $trend_count = sizeof($trend); + $chart_points = ''; + $map_guest_coords = array(); + $map_guest_titles = array(); + $rank = 0; + foreach ($trend as $row) + { + if ($row['chart_points'] == '30' or $row['chart_points'] == '60') + { + $draws_guest += 1; + } + $chart_points = $chart_points . $row['chart_points']. ','; + $coord_start = $start + ($rank * $vert); + $coord_end = $end + ($rank * $vert); + if (abs($row['chart_points']) > 45) + { + $coords = $coord_start . ",45," . $coord_end . "," . abs($row['chart_points']); + } + else + { + $coords = $coord_start . "," . abs($row['chart_points']) . "," . $coord_end . ",45"; + } + $map_guest_coords[] = $coords; + $map_guest_titles[] = $row['home_name'] . ' - ' . $row['guest_name'] . ' ' . $row['goals_home'] . ':' . $row['goals_guest']; + $rank++; + } + $chart_points = substr($chart_points, 0, strlen($chart_points) - 1); + $chart= "football_root_path + . "includes/chart_hist.php?v1=$chart_points' alt='" . sprintf($user->lang['HIST_CHART']) . "' usemap='#map_guest'/>"; + $template->assign_block_vars('chart_guest', array( + 'CHARTIMAGE' => $chart, + ) + ); + for ($i = 0; $i < sizeof($map_guest_coords); $i++) + { + $template->assign_block_vars('chart_guest.map_guest', array( + 'COORDS' => $map_guest_coords[$i], + 'TITLE' => $map_guest_titles[$i], + ) + ); + } + $matches_played = $matches_played + sizeof($map_guest_coords); + } + + if ($data_home and $data_guest) + { + $percent_draws_season = round(($draws_home + $draws_guest) / $matches_played, 2); + } + else + { + $percent_draws_season = 0.0; + $form_matches = 0; + } + if ($history_count <= 2) + { + switch($form_matches) + { + case 0: + $percent_draw += (2 - $history_count) * 0.1; + break; + case 1: + $percent_draw += (2 - $history_count) * 0.1 + round($percent_draws_season / 4, 2); + break; + default: + $percent_draw += (2 - $history_count) * 0.1 + round($percent_draws_season / 2, 2); + break; + } + } + else + { + if (abs($points_home - $points_guest) < 3) + { + $equal_form_factor = 1.1; + } + else + { + $equal_form_factor = 1.0; + } + switch($form_matches) + { + case 0: + $percent_draw = round($percent_draw * 1.5, 2); + break; + case 1: + $percent_draw = round(($percent_draw * 1.5) + ($percent_draws_season / 8), 2); + break; + case 2: + case 3: + case 4: + $percent_draw = round(($percent_draw * $equal_form_factor) + ($percent_draws_season / 4), 2); + break; + default: + $percent_draw = round(($percent_draw * $equal_form_factor) + ($percent_draws_season / 2), 2); + if ($percent_draw > 1.0) + { + $percent_draw = 1.0; + } + //$percent_draw = ($percent_draw * $equal_form_factor) + ($percent_draws_season / 2) ; + break; + } + } + $percent_draw = $percent_draw; + + // last matches hometeam + $sql = "(SELECT + match_date AS matchtime, + IF(mh.team_id_home = $home_id, 'H', 'A') AS match_place, + IF(mh.team_id_home = $home_id, tgh.team_name, thh.team_name) AS against, + mh.goals_home, + mh.goals_guest, + IF(mh.team_id_home = $home_id, + IF(mh.goals_home + 0 > mh.goals_guest, 1, IF(mh.goals_home = mh.goals_guest, 0, 2)), + IF(mh.goals_home + 0 < mh.goals_guest, 1, IF(mh.goals_home = mh.goals_guest, 0, 2) + ) + ) AS match_res + FROM " . FOOTB_MATCHES_HIST . ' AS mh + LEFT JOIN ' . FOOTB_TEAMS_HIST . ' AS thh ON thh.team_id = mh.team_id_home + LEFT JOIN ' . FOOTB_TEAMS_HIST . " AS tgh ON tgh.team_id = mh.team_id_guest + WHERE (mh.team_id_home = $home_id + OR mh.team_id_guest = $home_id) + ) + UNION + (SELECT + match_datetime AS matchtime, + IF(m.team_id_home = $home_id, 'H', 'A') AS match_place, + IF(m.team_id_home = $home_id, tg.team_name, th.team_name) AS against, + m.goals_home, + m.goals_guest, + IF(m.team_id_home = $home_id, + IF(m.goals_home + 0 > m.goals_guest, 1, IF(m.goals_home = m.goals_guest, 0, 2)), + IF(m.goals_home + 0 < m.goals_guest, 1, IF(m.goals_home = m.goals_guest, 0, 2) + ) + ) AS match_res + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS th ON (th.season = m.season AND th.league = m.league AND th.team_id = team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS tg ON (tg.season = m.season AND tg.league = m.league AND tg.team_id = team_id_guest) + WHERE m.season = $season + AND m.league = $league + AND m.matchday <= $matchday + AND m.match_no <> $matchnumber + AND (m.team_id_home = $home_id OR m.team_id_guest = $home_id) + AND m.status IN(3,6) + ) + ORDER BY matchtime"; + + $result = $db->sql_query($sql); + $lastmatches = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $numb_matches = sizeof($lastmatches); + + + if ($numb_matches > 10) + $start = $numb_matches - 10; + else + $start = 0; + $rank = 0; + foreach ($lastmatches as $row) + { + $rank++; + if ($rank > $start) + { + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $match_res_style=''; + switch($row['match_res']) + { + case 0: + $match_res_style = 'match_draw'; + break; + case 1: + $match_res_style = 'match_win'; + break; + case 2: + $match_res_style = 'match_lost'; + break; + } + $template->assign_block_vars('last_hometeam', array( + 'ROW_CLASS' => $row_class, + 'MATCH_RESULT' => $match_res_style, + 'PLACE' => $row['match_place'], + 'AGAINST' => $row['against'], + 'GOALS_HOME' => $row['goals_home'], + 'GOALS_GUEST' => $row['goals_guest'], + ) + ); + } + } + $db->sql_freeresult($result); + + //last matches home hometeam + $sql = '(SELECT + match_date AS matchtime, + th.team_name AS against, + mh.goals_home, + mh.goals_guest, + IF(mh.goals_home + 0 > mh.goals_guest, 1, IF(mh.goals_home = mh.goals_guest, 0, 2)) AS match_res + FROM ' . FOOTB_MATCHES_HIST . ' AS mh + LEFT JOIN ' . FOOTB_TEAMS_HIST . " AS th ON th.team_id = mh.team_id_guest + WHERE mh.team_id_home = $home_id + ) + UNION + (SELECT + match_datetime AS matchtime, + t.team_name AS against, + m.goals_home, + m.goals_guest, + IF(m.goals_home + 0 > m.goals_guest, 1, IF(m.goals_home = m.goals_guest, 0, 2)) AS match_res + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . " AS t ON (t.season = m.season AND t.league = m.league AND t.team_id = m.team_id_guest) + WHERE m.season = $season + AND m.league = $league + AND m.matchday <= $matchday + AND m.match_no <> $matchnumber + AND m.team_id_home = $home_id + AND m.status IN (3,6) + ) + ORDER BY matchtime"; + + $result = $db->sql_query($sql); + $lastmatches = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $numb_matches = sizeof($lastmatches); + + if ($numb_matches > 5) + $start = $numb_matches - 5; + else + $start = 0; + $rank = 0; + foreach ($lastmatches as $row) + { + $data_last_home = true; + $rank++; + if ($rank > $start) + { + $row_class = (!(($rank-$start) % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $match_res_style=''; + switch($row['match_res']) + { + case 0: + $match_res_style = 'match_draw'; + break; + case 1: + $match_res_style = 'match_win'; + break; + case 2: + $match_res_style = 'match_lost'; + break; + } + $template->assign_block_vars('lasthome_hometeam', array( + 'ROW_CLASS' => $row_class, + 'MATCH_RESULT' => $match_res_style, + 'AGAINST' => $row['against'], + 'GOALS_HOME' => $row['goals_home'], + 'GOALS_GUEST' => $row['goals_guest'], + ) + ); + } + } + $db->sql_freeresult($result); + + //last game guestteam + $sql = "(SELECT + match_date AS matchtime, + IF(mh.team_id_home = $guest_id, 'H', 'A') AS match_place, + IF(mh.team_id_home = $guest_id, tgh.team_name, thh.team_name) AS against, + mh.goals_home, + mh.goals_guest, + IF(mh.team_id_home = $guest_id, + IF(mh.goals_home + 0 > mh.goals_guest, 1, IF(mh.goals_home = mh.goals_guest, 0, 2)), + IF(mh.goals_home + 0 < mh.goals_guest, 1, IF(mh.goals_home = mh.goals_guest, 0, 2) + ) + ) AS match_res + FROM " . FOOTB_MATCHES_HIST . ' AS mh + LEFT JOIN ' . FOOTB_TEAMS_HIST . ' AS thh ON thh.team_id = mh.team_id_home + LEFT JOIN ' . FOOTB_TEAMS_HIST . " AS tgh ON tgh.team_id = mh.team_id_guest + WHERE mh.team_id_home = $guest_id + OR mh.team_id_guest = $guest_id + ) + UNION + (SELECT + match_datetime AS matchtime, + IF(m.team_id_home = $guest_id, 'H', 'A') AS match_place, + IF(m.team_id_home = $guest_id, tg.team_name, th.team_name) AS against, + m.goals_home, + m.goals_guest, + IF(m.team_id_home = $guest_id, + IF(m.goals_home + 0 > m.goals_guest, 1, IF(m.goals_home = m.goals_guest, 0, 2)), + IF(m.goals_home + 0 < m.goals_guest, 1, IF(m.goals_home = m.goals_guest, 0, 2) + ) + ) AS match_res + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS th ON (th.season = m.season AND th.league = m.league AND th.team_id = team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS tg ON (tg.season = m.season AND tg.league = m.league AND tg.team_id = team_id_guest) + WHERE m.season = $season + AND m.league = $league + AND m.matchday <= $matchday + AND m.match_no <> $matchnumber + AND (m.team_id_home = $guest_id OR m.team_id_guest = $guest_id) + AND m.status IN(3,6) + ) + ORDER BY matchtime"; + + $result = $db->sql_query($sql); + $lastmatches = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $numb_matches = sizeof($lastmatches); + + if ($numb_matches > 10) + $start = $numb_matches - 10; + else + $start = 0; + $rank = 0; + foreach ($lastmatches as $row) + { + $rank++; + if ($rank > $start) + { + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $match_res_style=''; + switch($row['match_res']) + { + case 0: + $match_res_style = 'match_draw'; + break; + case 1: + $match_res_style = 'match_win'; + break; + case 2: + $match_res_style = 'match_lost'; + break; + } + $template->assign_block_vars('last_guestteam', array( + 'ROW_CLASS' => $row_class, + 'MATCH_RESULT' => $match_res_style, + 'PLACE' => $row['match_place'], + 'AGAINST' => $row['against'], + 'GOALS_HOME' => $row['goals_home'], + 'GOALS_GUEST' => $row['goals_guest'], + ) + ); + } + } + $db->sql_freeresult($result); + + //last matches away guestteam + $sql = '(SELECT + match_date AS matchtime, + th.team_name AS against, + mh.goals_home AS goals_home, + mh.goals_guest, + IF(mh.goals_home + 0 < mh.goals_guest, 1, IF(mh.goals_home = mh.goals_guest, 0, 2)) AS match_res + FROM ' . FOOTB_MATCHES_HIST . ' As mh + LEFT JOIN ' . FOOTB_TEAMS_HIST . " AS th ON th.team_id = mh.team_id_home + WHERE mh.team_id_guest = $guest_id + ) + UNION + (SELECT + match_datetime AS matchtime, + t.team_name AS against, + m.goals_home AS goals_home, + m.goals_guest, + IF(m.goals_home + 0 < m.goals_guest, 1, IF(m.goals_home = m.goals_guest, 0, 2)) AS match_res + FROM " . FOOTB_MATCHES . ' As m + LEFT JOIN ' . FOOTB_TEAMS . " AS t ON (t.season = m.season AND t.league = m.league AND t.team_id = m.team_id_home) + WHERE m.season = $season AND m.league = $league AND m.matchday <= $matchday AND m.match_no <> $matchnumber + AND m.team_id_guest = $guest_id + AND m.status IN (3,6) + ) + ORDER BY matchtime"; + + $result = $db->sql_query($sql); + $lastmatches = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $numb_matches = sizeof($lastmatches); + + if ($numb_matches > 5) + $start = $numb_matches - 5; + else + $start = 0; + $rank = 0; + foreach ($lastmatches as $row) + { + $data_last_away = true; + $rank++; + if ($rank > $start) + { + $row_class = (!(($rank-$start) % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $match_res_style=''; + switch($row['match_res']) + { + case 0: + $match_res_style = 'match_draw'; + break; + case 1: + $match_res_style = 'match_win'; + break; + case 2: + $match_res_style = 'match_lost'; + break; + } + $template->assign_block_vars('lastaway_guestteam', array( + 'ROW_CLASS' => $row_class, + 'MATCH_RESULT' => $match_res_style, + 'AGAINST' => $row['against'], + 'GOALS_HOME' => $row['goals_home'], + 'GOALS_GUEST' => $row['goals_guest'], + ) + ); + } + } + $db->sql_freeresult($result); + + if ($history_count == 0 and !($data_home and $data_guest)) + { + $percent_draw = 0; + $percent_home = 0; + $percent_guest = 0; + } + else + { + if ($value_h + $value_g == 0) + { + $percent_draw = 0; + $percent_home = 0; + $percent_guest = 0; + } + else + { + $percent_draw = round(($percent_draw * 100),0); + $rest = 100 - $percent_draw; + if ($rest > 0) + { + $percent_home = round(($rest * $value_h) / ($value_h + $value_g),0); + $percent_guest = $rest - $percent_home; + } + else + { + $percent_home = 0; + $percent_guest = 0; + } + } + } + + $sql_ary = array( + 'trend' => $percent_home . '|' . $percent_draw. '|' . $percent_guest, + ); + + $sql = 'UPDATE ' . FOOTB_MATCHES . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $result = $db->sql_query($sql); + + + + $forecast_value = 0; + $forecast_quote = sprintf($user->lang['FORECAST_PTS']) . ': '. $value_h. ' : '. $value_g; + $forecast_value = $value_h - $value_g; + if($forecast_value >= -0.5 && $forecast_value <= 0.5) + { + $forecast = sprintf($user->lang['TENDENCY']) . ': '. sprintf($user->lang['DRAW']); + } + else if($forecast_value > 0.5) + { + $forecast = sprintf($user->lang['TENDENCY']) . ': '. sprintf($user->lang['WIN_FOR']) . ' '. $logo[$home_id]. ' '. $home_name; + } + else + { + $forecast = sprintf($user->lang['TENDENCY']) . ': '. sprintf($user->lang['WIN_FOR']) . ' '. $logo[$guest_id]. ' '. $guest_name;; + } + } + else + { + $data_history = false; + $error_message .= sprintf($user->lang['NO_LEAGUE']) . '
'; + } + } + else + { + $data_history = false; + $error_message .= sprintf($user->lang['NO_SEASON']) . '
'; + } +} + +if ($data_history) +{ + $main_title = $logo[$home_id]. ' '. $home_name. ' : '. $guest_name. ' '. $logo[$guest_id]; + $template->assign_vars(array( + 'MAIN_TITLE' => $main_title, + 'TEAM_HOME' => $logo[$home_id]. ' '. $home_name, + 'TEAM_GUEST' => $logo[$guest_id]. ' '. $guest_name, + 'FORECAST_QUOTE' => $forecast_quote, + 'FORECAST' => $forecast, + 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), + 'S_ERROR_MESSAGE' => $error_message, + 'S_DATA_HISTORY' => $data_history, + 'S_DATA_HIST' => $data_hist, + 'S_DATA_HOME' => $data_home, + 'S_DATA_GUEST' => $data_guest, + 'S_DATA_LASTHOME' => $data_last_home, + 'S_DATA_LASTAWAY' => $data_last_away, + ) + ); + + // output page + page_header(sprintf($user->lang['MATCH_STATS'])); +} +else +{ + $template->assign_vars(array( + 'MAIN_TITLE' => '', + 'TEAM_HOME' => '', + 'TEAM_GUEST' => '', + 'FORECAST_QUOTE' => '', + 'FORECAST' => '', + 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), + 'S_ERROR_MESSAGE' => $error_message, + 'S_DATA_HISTORY' => $data_history, + 'S_DATA_HIST' => false, + 'S_DATA_HOME' => false, + 'S_DATA_GUEST' => false, + 'S_DATA_LASTHOME' => false, + 'S_DATA_LASTAWAY' => false, + ) + ); + + // output page + page_header(sprintf($user->lang['MATCH_STATS'])); +} + +$template->set_filenames(array( + 'body' => 'hist_popup.html') +); + +page_footer(); +?> \ No newline at end of file diff --git a/block/last_users.php b/block/last_users.php new file mode 100644 index 0000000..83d85c9 --- /dev/null +++ b/block/last_users.php @@ -0,0 +1,65 @@ + u.user_lastvisit, MAX(s.session_time), u.user_lastvisit) AS lastvisit + , IF(MAX(s.session_time) > u.user_lastvisit, MAX(CONCAT(s.session_time,s.session_browser)), "") AS session_browser + FROM ' . USERS_TABLE . ' AS u + LEFT JOIN ' . SESSIONS_TABLE . ' AS s ON (u.user_id = s.session_user_id) + WHERE u.user_lastvisit > 0 + GROUP BY u.user_id + ORDER BY lastvisit DESC'; + +$result = $db->sql_query_limit($sql, 5); +$first = true; +while ($row = $db->sql_fetchrow($result)) +{ + if (!$row['lastvisit'] && $first == true) + { + $display_last_users = false; + } + else + { + $display_last_users = true; + if($row['lastvisit'] > 0) + { + $browser = ''; + if (preg_match('/iPad|iPhone|iOS|Opera Mobi|BlackBerry|Android|IEMobile|Symbian/', $row['session_browser'], $match_browser)) + { + $browser = ' (' . $match_browser[0] . ')'; + } + $template->assign_block_vars('last_users', array( + 'USER_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']) . $browser, + 'LAST_VISIT_DATE' => $user->format_date($row['lastvisit']), + )); + } + } + $first = false; +} +$db->sql_freeresult($result); + +// Assign specific vars +$template->assign_vars(array( + 'LAST_USERS' => sprintf($user->lang['LAST_VISITORS'], 5), + 'S_DISPLAY_LAST_USERS' => $display_last_users, + 'S_LAST_USERS' => true, +)); + +?> \ No newline at end of file diff --git a/block/my_bets.php b/block/my_bets.php new file mode 100644 index 0000000..8e528a6 --- /dev/null +++ b/block/my_bets.php @@ -0,0 +1,332 @@ +data['user_id'], $season, $league)) + { + $user_sel = $user->data['user_id']; + } +} +$username = ''; + +$data = false; +// select user +$sql = 'SELECT DISTINCT + u.user_id, + u.username + FROM ' . FOOTB_BETS . ' AS b + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) + WHERE season = $season AND league = $league + ORDER BY LOWER(u.username) ASC"; + +$numb_users = 0; +$result = $db->sql_query($sql); +while($row = $db->sql_fetchrow($result)) +{ + $numb_users++; + $data = true; + if ($user_sel == $row['user_id'] OR !$user_sel) + { + $selectid = ' selected="selected"'; + $username = $row['username']; + $user_sel = $row['user_id']; + } + else + { + $selectid = ''; + } + $template->assign_block_vars('form_user', array( + 'S_USER' => $row['user_id'], + 'S_USERNAME' => $row['username'], + 'S_SELECTEDID' => $selectid, + ) + ); +} +$db->sql_freeresult($result); + +// All bets of selected user group by bet +$rank = 0; +$bets_home_win = 0; +$bets_draw = 0; +$bets_guest_win = 0; +$win_home_win = 0; +$win_draw = 0; +$win_guest_win = 0; +$points_home_win = 0; +$points_draw = 0; +$points_guest_win = 0; + +$sql = 'SELECT + COUNT(b.match_no) AS bets, + b.goals_home, + b.goals_guest, + SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0) + ) + ) AS hits, + SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) + ) + ) AS tendencies, + ' . select_points('m',true) . ' + FROM ' . FOOTB_BETS . ' AS b + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) + WHERE b.season = $season + AND b.league = $league + AND b.goals_home <> '' + AND b.goals_guest <> '' + AND m.status = 3 + AND b.user_id = $user_sel + AND m.matchday <= $matchday + GROUP by b.goals_home, b.goals_guest + ORDER by bets DESC"; + +$result = $db->sql_query($sql); + +while($row = $db->sql_fetchrow($result)) +{ + if ($row['goals_home'] > $row['goals_guest']) + { + $bets_home_win += $row['bets']; + $win_home_win += $row['hits'] + $row['tendencies']; + $points_home_win += $row['points']; + } + if ($row['goals_home'] == $row['goals_guest']) + { + $bets_draw += $row['bets']; + $win_draw += $row['hits'] + $row['tendencies']; + $points_draw += $row['points']; + } + if ($row['goals_home'] < $row['goals_guest']) + { + $bets_guest_win += $row['bets']; + $win_guest_win += $row['hits'] + $row['tendencies']; + $points_guest_win += $row['points']; + } + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('bets', array( + 'ROW_CLASS' => $row_class, + 'GOALSHOME' => $row['goals_home'], + 'GOALSGUEST' => $row['goals_guest'], + 'COUNT' => $row['bets'], + 'DIRECTHITS' => $row['hits'], + 'TENDENCIES' => $row['tendencies'], + 'TOTAL' => $row['hits'] + $row['tendencies'], + 'POINTS' => $row['points'], + 'AVERAGE' => round($row['points'] / $row['bets'],1), + ) + ); +} +$db->sql_freeresult($result); + +// Tendencies of all results +$sql = "SELECT + SUM(IF(goals_home + 0 > goals_guest,1,0)) AS SUM_HOME_WIN, + SUM(IF(goals_home = goals_guest,1,0)) AS SUM_DRAW, + SUM(IF(goals_home + 0 < goals_guest,1,0)) AS SUM_GUEST_WIN + FROM " . FOOTB_MATCHES . " + WHERE season = $season + AND league = $league + AND status = 3 + AND matchday <= $matchday"; + +$result = $db->sql_query($sql); + +while($row = $db->sql_fetchrow($result)) +{ + $template->assign_block_vars('bets_wdl', array( + 'ROW_CLASS' => 'bg2 row_dark', + 'SCORE' => sprintf($user->lang['PLAYED']), + 'HOMEWIN' => $row['SUM_HOME_WIN'], + 'DRAW' => $row['SUM_DRAW'], + 'GUESTWIN' => $row['SUM_GUEST_WIN'], + ) + ); + // Muliply with user of this league + $template->assign_block_vars('bets_wdl_all', array( + 'ROW_CLASS' => 'bg2 row_dark', + 'SCORE' => sprintf($user->lang['PLAYED']), + 'HOMEWIN' => $row['SUM_HOME_WIN'] * $numb_users, + 'DRAW' => $row['SUM_DRAW'] * $numb_users, + 'GUESTWIN' => $row['SUM_GUEST_WIN'] * $numb_users, + ) + ); +} +$db->sql_freeresult($result); + +// Count tendencies (bets of selected user) +$template->assign_block_vars('bets_wdl', array( + 'ROW_CLASS' => 'bg1 row_light', + 'SCORE' => sprintf($user->lang['GUESSED']), + 'HOMEWIN' => $bets_home_win, + 'DRAW' => $bets_draw, + 'GUESTWIN' => $bets_guest_win, + ) +); +// Scored with tendency (bets of selected user) +$template->assign_block_vars('bets_wdl', array( + 'ROW_CLASS' => 'bg2 row_dark', + 'SCORE' => sprintf($user->lang['SCORED']), + 'HOMEWIN' => $win_home_win, + 'DRAW' => $win_draw, + 'GUESTWIN' => $win_guest_win, + ) +); +// Points with tendency (bets of selected user) +$template->assign_block_vars('bets_wdl', array( + 'ROW_CLASS' => 'bg1 row_light', + 'SCORE' => sprintf($user->lang['POINTS']), + 'HOMEWIN' => $points_home_win, + 'DRAW' => $points_draw, + 'GUESTWIN' => $points_guest_win, + ) +); + +// All bets of all users group by bet +$rank = 0; +$bets_home_win = 0; +$bets_draw = 0; +$bets_guest_win = 0; +$win_home_win = 0; +$win_draw = 0; +$win_guest_win = 0; +$points_home_win = 0; +$points_draw = 0; +$points_guest_win = 0; + +$sql = 'SELECT + COUNT(b.match_no) AS bets, + b.goals_home, + b.goals_guest, + SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0) + ) + ) AS hits, + SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) + ) + ) AS tendencies, + ' . select_points('m',true) . ' + FROM ' . FOOTB_BETS . ' AS b + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) + WHERE b.season = $season + AND b.league = $league + AND b.goals_home <> '' + AND b.goals_guest <> '' + AND m.status = 3 + AND m.matchday <= $matchday + GROUP by b.goals_home, b.goals_guest + ORDER by bets DESC"; + +$result = $db->sql_query($sql); + +while($row = $db->sql_fetchrow($result)) +{ + if ($row['goals_home'] > $row['goals_guest']) + { + $bets_home_win += $row['bets']; + $win_home_win += $row['hits'] + $row['tendencies']; + $points_home_win += $row['points']; + } + if ($row['goals_home'] == $row['goals_guest']) + { + $bets_draw += $row['bets']; + $win_draw += $row['hits'] + $row['tendencies']; + $points_draw += $row['points']; + } + if ($row['goals_home'] < $row['goals_guest']) + { + $bets_guest_win += $row['bets']; + $win_guest_win += $row['hits'] + $row['tendencies']; + $points_guest_win += $row['points']; + } + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('allbets', array( + 'ROW_CLASS' => $row_class, + 'GOALSHOME' => $row['goals_home'], + 'GOALSGUEST' => $row['goals_guest'], + 'COUNT' => $row['bets'], + 'DIRECTHITS' => $row['hits'], + 'TENDENCIES' => $row['tendencies'], + 'TOTAL' => $row['hits'] + $row['tendencies'], + 'POINTS' => $row['points'], + 'AVERAGE' => round($row['points'] / $row['bets'],1), + ) + ); +} +$db->sql_freeresult($result); + +// Count tendencies (bets of all user) +$template->assign_block_vars('bets_wdl_all', array( + 'ROW_CLASS' => 'bg2 row_dark', + 'SCORE' => sprintf($user->lang['GUESSED']), + 'HOMEWIN' => $bets_home_win, + 'DRAW' => $bets_draw, + 'GUESTWIN' => $bets_guest_win, + ) +); +// Scored with tendency (bets of all user) +$template->assign_block_vars('bets_wdl_all', array( + 'ROW_CLASS' => 'bg1 row_light', + 'SCORE' => sprintf($user->lang['SCORED']), + 'HOMEWIN' => $win_home_win, + 'DRAW' => $win_draw, + 'GUESTWIN' => $win_guest_win, + ) +); +// Points with tendency (bets of all user) +$template->assign_block_vars('bets_wdl_all', array( + 'ROW_CLASS' => 'bg2 row_dark', + 'SCORE' => sprintf($user->lang['POINTS']), + 'HOMEWIN' => $points_home_win, + 'DRAW' => $points_draw, + 'GUESTWIN' => $points_guest_win, + ) +); + +$sidename = sprintf($user->lang['MY_BETS']); +$template->assign_vars(array( + 'S_DISPLAY_MY_BETS' => true, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => ($config['football_bank']) ? $this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)) : + $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => ($config['football_bank']) ? '< ' . sprintf($user->lang['FOOTBALL_BANK']) : + '< ' . sprintf($user->lang['RANK_TOTAL']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_points', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['MY_POINTS']) . ' >', + 'LEFT_TITLE' => ($config['football_bank']) ? sprintf($user->lang['TITLE_FOOTBALL_BANK']) : sprintf($user->lang['TITLE_RANK_TOTAL']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_POINTS']), + 'S_DATA_MY_BETS' => $data, + 'SEASON' => $season, + 'LEAGUE' => $league, + 'USERNAME' => $username, + ) +); + +?> \ No newline at end of file diff --git a/block/my_chart.php b/block/my_chart.php new file mode 100644 index 0000000..9bce108 --- /dev/null +++ b/block/my_chart.php @@ -0,0 +1,339 @@ +sql_query($sql); +$current_ranks = $db->sql_fetchrowset($result); +$total_users = sizeof($current_ranks); +if ($total_users > 3 AND $total_users <= 50) +{ + $data = true; + $middle = round($total_users / 2,0); + // If user = leader then first = seconde + $user_first = $current_ranks[0]['user_id']; + if ($user_first == $user->data['user_id']) + $user_first = $current_ranks[1]['user_id']; + // If user = middle then middle = middle - 1 + $user_middle = $current_ranks[$middle-1]['user_id']; + if ($user_middle == $user->data['user_id']) + $user_middle = $current_ranks[$middle]['user_id']; + // If user = last then last = last but one + $user_last = $current_ranks[$total_users - 1]['user_id']; + if ($user_last == $user->data['user_id']) + $user_last = $current_ranks[$total_users - 2]['user_id']; + + if (user_is_member($user->data['user_id'], $season, $league)) + { + // Take user, leader, middle and last + $user1 = $this->request->variable('user1', $user->data['user_id']); + $user2 = $this->request->variable('user2', $user_first); + $user3 = $this->request->variable('user3', $user_middle); + $user4 = $this->request->variable('user4', $user_last); + } + else + { + // Only take leader, middle and last + $user1 = $this->request->variable('user1', $user_first); + $user2 = $this->request->variable('user2', $user_middle); + $user3 = $this->request->variable('user3', $user_last); + $user4 = $this->request->variable('user4', 0); + } + + // Add empty choice + $template->assign_block_vars('form_user2', array( + 'S_USERNAME' => sprintf($user->lang['OPTION_USER']), + 'S_USERID' => 0, + 'S_SELECTEDID2' => '', + ) + ); + $template->assign_block_vars('form_user3', array( + 'S_USERNAME' => sprintf($user->lang['OPTION_USER']), + 'S_USERID' => 0, + 'S_SELECTEDID3' => '', + ) + ); + $template->assign_block_vars('form_user4', array( + 'S_USERNAME' => sprintf($user->lang['OPTION_USER']), + 'S_USERID' => 0, + 'S_SELECTEDID4' => '', + ) + ); + + // Start select user + foreach ($current_ranks as $rank_user) + { + $curr_userid =$rank_user['user_id']; + if ($user1 == $curr_userid) + { + $selectid1 = ' selected="selected"'; + $username = $rank_user['username']; + } + else + { + $selectid1 = ''; + } + if ($user2 == $curr_userid) + { + $selectid2 = ' selected="selected"'; + $username2 = $rank_user['username']; + } + else + { + $selectid2 = ''; + } + if ($user3 == $curr_userid) + { + $selectid3 = ' selected="selected"'; + $username3 = $rank_user['username']; + } + else + { + $selectid3 = ''; + } + if ($user4 == $curr_userid) + { + $selectid4 = ' selected="selected"'; + $username4 = $rank_user['username']; + } + else + { + $selectid4 = ''; + } + if ($curr_userid != $user2 AND $curr_userid != $user3 AND $curr_userid != $user4) + $template->assign_block_vars('form_user1', array( + 'S_USERNAME' => $rank_user['username'], + 'S_USERID' => $curr_userid, + 'S_SELECTEDID' => $selectid1)); + if ($curr_userid != $user1 AND $curr_userid != $user3 AND $curr_userid != $user4) + $template->assign_block_vars('form_user2', array( + 'S_USERNAME' => $rank_user['username'], + 'S_USERID' => $curr_userid, + 'S_SELECTEDID' => $selectid2)); + if ($curr_userid != $user1 AND $curr_userid != $user2 AND $curr_userid != $user4) + $template->assign_block_vars('form_user3', array( + 'S_USERNAME' => $rank_user['username'], + 'S_USERID' => $curr_userid, + 'S_SELECTEDID' => $selectid3)); + if ($curr_userid != $user1 AND $curr_userid != $user2 AND $curr_userid != $user3) + $template->assign_block_vars('form_user4', array( + 'S_USERNAME' => $rank_user['username'], + 'S_USERID' => $curr_userid, + 'S_SELECTEDID' => $selectid4)); + } + + $ranks_total_1 = ''; + $ranks_dayl_1 = ''; + $points_1 = ''; + $sql = 'SELECT * + FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday <= $matchday + AND user_id = $user1 + ORDER BY matchday ASC"; + + $result = $db->sql_query($sql); + + while($row = $db->sql_fetchrow($result)) + { + $points_1 = $points_1. $row['points']. ','; + $ranks_total_1 = $ranks_total_1. $row['rank_total']. ','; + $ranks_dayl_1 = $ranks_dayl_1. $row['rank']. ','; + } + $points_1 = substr($points_1, 0, strlen($points_1) - 1); + $ranks_total_1 = substr($ranks_total_1, 0, strlen($ranks_total_1) - 1); + $ranks_dayl_1 = substr($ranks_dayl_1, 0, strlen($ranks_dayl_1) - 1); + $db->sql_freeresult($result); + + $ranks_total_2 = ''; + $ranks_dayl_2 = ''; + $points_2 = ''; + if ($user2 != 0) + { + $sql = 'SELECT * + FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday <= $matchday + AND user_id = $user2 + ORDER BY matchday ASC"; + + $result = $db->sql_query($sql); + + while($row = $db->sql_fetchrow($result)) + { + $points_2 = $points_2 . $row['points']. ','; + $ranks_total_2 = $ranks_total_2 . $row['rank_total']. ','; + $ranks_dayl_2 = $ranks_dayl_2 . $row['rank']. ','; + } + $points_2 = substr($points_2, 0, strlen($points_2) - 1); + $ranks_total_2 = substr($ranks_total_2, 0, strlen($ranks_total_2) - 1); + $ranks_dayl_2 = substr($ranks_dayl_2, 0, strlen($ranks_dayl_2) - 1); + $db->sql_freeresult($result); + } + + $ranks_total_3 = ''; + $ranks_dayl_3 = ''; + $points_3 = ''; + if ($user3 != 0) + { + $sql = 'SELECT * + FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday <= $matchday + AND user_id = $user3 + ORDER BY matchday ASC"; + + $result = $db->sql_query($sql); + + while($row = $db->sql_fetchrow($result)) + { + $points_3 = $points_3. $row['points']. ','; + $ranks_total_3 = $ranks_total_3. $row['rank_total']. ','; + $ranks_dayl_3 = $ranks_dayl_3. $row['rank']. ','; + } + $points_3 = substr($points_3,0,strlen($points_3)-1); + $ranks_total_3 = substr($ranks_total_3,0,strlen($ranks_total_3)-1); + $ranks_dayl_3 = substr($ranks_dayl_3,0,strlen($ranks_dayl_3)-1); + $db->sql_freeresult($result); + } + + $ranks_total_4 = ''; + $ranks_dayl_4 = ''; + $points_4 = ''; + if ($user4 != 0) + { + $sql = 'SELECT * + FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday <= $matchday + AND user_id = $user4 + ORDER BY matchday ASC"; + + $result = $db->sql_query($sql); + + while($row = $db->sql_fetchrow($result)) + { + $points_4 = $points_4. $row['points']. ','; + $sptagplatz = $row['rank']; + $ranks_total_4 = $ranks_total_4. $row['rank_total']. ','; + $ranks_dayl_4 = $ranks_dayl_4. $row['rank']. ','; + } + $points_4 = substr($points_4,0,strlen($points_4)-1); + $ranks_total_4 = substr($ranks_total_4,0,strlen($ranks_total_4)-1); + $ranks_dayl_4 = substr($ranks_dayl_4,0,strlen($ranks_dayl_4)-1); + $db->sql_freeresult($result); + } + + $min = ''; + $max = ''; + if ($user1 != 0) + { + $sql = 'SELECT + MIN(points) As points_min, + MAX(points) As points_max + FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday <= $matchday + GROUP BY matchday + ORDER BY matchday ASC"; + + $result = $db->sql_query($sql); + + while($row = $db->sql_fetchrow($result)) + { + $min = $min. $row['points_min']. ','; + $max = $max. $row['points_max']. ','; + } + $min = substr($min,0,strlen($min)-1); + $max = substr($max,0,strlen($max)-1); + $db->sql_freeresult($result); + } + // Create and display charts + $chart= "football_root_path + . "includes/chart_rank.php?t=$total_users&m=$matchday&v1=$ranks_total_1&v2=$ranks_total_2&v3=$ranks_total_3&v4=$ranks_total_4&c=" + . sprintf($user->lang['PLACE']) . "' alt='" + . sprintf($user->lang['CHART_TOTAL']) + . "'/>"; + $template->assign_block_vars('chart_rank', array( + 'CHARTIMAGE' => $chart, + ) + ); + $chart= "football_root_path + . "includes/chart_rank.php?t=$total_users&m=$matchday&v1=$ranks_dayl_1&v2=$ranks_dayl_2&v3=$ranks_dayl_3&v4=$ranks_dayl_4&c=" + . sprintf($user->lang['PLACE']) . "' alt='" + . sprintf($user->lang['CHART_MATCHDAY']) + . "'/>"; + $template->assign_block_vars('chart_matchtdays', array( + 'CHARTIMAGE' => $chart, + ) + ); + $chart= "football_root_path + . "includes/chart_points.php?m=$matchday&v1=$points_1&v2=$points_2&v3=$points_3&v4=$points_4&min=$min&max=$max&c=" + . sprintf($user->lang['POINTS']) . ',' . sprintf($user->lang['BANDWIDTH']) . "' alt='" + . sprintf($user->lang['CHART_POINTS']) + . "'/>"; + $template->assign_block_vars('chart_points', array( + 'CHARTIMAGE' => $chart, + ) + ); +} +$sidename = sprintf($user->lang['MY_CHART']); +$template->assign_vars(array( + 'S_DISPLAY_MY_CHART' => true, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_rank', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['MY_RANK']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['MY_KOEFF']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_RANKS']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_KOEFF']), + 'S_DATA_MY_CHART' => $data, + 'SEASON' => $season, + 'LEAGUE' => $league, + 'S_USER1' => $user1, + 'S_USER2' => $user2, + 'S_USER3' => $user3, + 'S_USER4' => $user4, + 'USERNAME1' => $username, + 'USERNAME2' => $username2, + 'USERNAME3' => $username3, + 'USERNAME4' => $username4, + ) +); +?> \ No newline at end of file diff --git a/block/my_koeff.php b/block/my_koeff.php new file mode 100644 index 0000000..7540173 --- /dev/null +++ b/block/my_koeff.php @@ -0,0 +1,393 @@ +request->variable('start', 0); +$matches_on_matchday = false; + +if (!$user_sel) +{ + if (user_is_member($user->data['user_id'], $season, $league)) + { + $user_sel = $user->data['user_id']; + } +} +$username = ''; + +$data = false; +// Select user +$total_users = 0; +$sql = 'SELECT DISTINCT + u.user_id, + u.username + FROM ' . FOOTB_BETS . ' AS b + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) + WHERE season = $season + AND league = $league + ORDER BY LOWER(u.username) ASC"; + +$result = $db->sql_query($sql); + +while($row = $db->sql_fetchrow($result)) +{ + $total_users++; + if ($user_sel == $row['user_id'] OR !$user_sel) + { + $selectid = ' selected="selected"'; + $username = $row['username']; + $user_sel = $row['user_id']; + } + else + { + $selectid = ''; + } + $template->assign_block_vars('form_user', array( + 'S_USER' => $row['user_id'], + 'S_USERNAME' => $row['username'], + 'S_SELECTEDID' => $selectid, + ) + ); +} +$db->sql_freeresult($result); +// Select matches with results and tendencies +$sql = "SELECT + m.match_no, + m.status, + m.formula_home, + m.formula_guest, + t1.team_name_short AS home_name, + t2.team_name_short AS guest_name, + t1.team_id AS home_id, + t2.team_id AS guest_id, + m.goals_home, + m.goals_guest, + SUM(IF(b.goals_home + 0 > b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS home, + SUM(IF(b.goals_home = b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS draw, + SUM(IF(b.goals_home + 0 < b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS guest + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season=m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . ' AS t2 ON (t2.season=m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) + LEFT JOIN ' . FOOTB_BETS . " AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + GROUP BY m.match_no + ORDER BY m.match_datetime ASC, m.match_no ASC"; + +$result = $db->sql_query($sql); +$matches = $db->sql_fetchrowset($result); +$db->sql_freeresult($result); +$count_matches = sizeof($matches); +if ($count_matches > 11) +{ + $split_after = 8; + $splits = floor($count_matches / 8); +} +else +{ + $split_after = $count_matches; + $splits = 1; +} +$db->sql_freeresult($result); + +// Make sure $start is set to the last page if it exceeds the amount +if ($start < 0 || $start >= $total_users) +{ + $start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page']; +} +else +{ + $start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page']; +} + +$sql_start = $start * $count_matches; +$sql_limit = $config['football_users_per_page'] * $count_matches; + +// handle pagination. +$base_url = $this->helper->route('football_main_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday, 'u' => "$user_sel")); +$pagination = $phpbb_container->get('pagination'); +$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start); + +$bet_line = array(); +if ($count_matches > 0) +{ + $matches_on_matchday = true; + // Select user bets and points on user results + $sql = "SELECT + u.user_id, + u.username, + m.status, + b.goals_home AS bet_home, + b.goals_guest AS bet_guest, + " . select_points("bu") . " + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_BETS . ' AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + LEFT JOIN ' . FOOTB_BETS . " AS bu ON(bu.season = m.season AND bu.league = m.league AND bu.match_no = m.match_no AND bu.user_id = $user_sel) + LEFT JOIN " . USERS_TABLE . " AS u ON (u.user_id = b.user_id) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + ORDER BY LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC"; + + $result = $db->sql_query_limit($sql, $sql_limit, $sql_start); + $user_bets = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + $bet_index = 0; + $split_index = 0; + foreach ($user_bets AS $user_bet) + { + $data = true; + if ($bet_index == $count_matches) + { + $bet_index = 0; + $split_index = 0; + } + if (!($bet_index % $split_after)) + { + $split_index++; + } + $sum_total[$user_bet['username']] = 0; + $bet_line[$split_index][] = $user_bet; + $bet_index++; + } +} +$match_index = 0; +$split_index = 0; +$matchday_sum_total = 0; +$colorstyle_total = ' color_finally'; +foreach ($matches AS $match) +{ + if (!($match_index % $split_after)) + { + if ($match_index > 0) + { + $total = 0; + $count_user = 0; + $bet_index = 0; + foreach ($bet_line[$split_index] AS $user_bet) + { + if ($bet_index == 0) + { + $count_user++; + $row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($user_bet['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('match_panel.user_row', array( + 'ROW_CLASS' => $row_class, + 'USER_NAME' => $user_bet['username'], + ) + ); + $total = 0; + } + $bet_index++; + $total += $user_bet['points']; + if ($user_bet['status'] < 1 && !$config['football_view_bets']) + { + // hide bets + $bet_home = ($user_bet['bet_home'] == '') ? ' ' : '?'; + $bet_guest = ($user_bet['bet_guest'] == '') ? ' ' : '?'; + } + else + { + $bet_home = $user_bet['bet_home']; + $bet_guest = $user_bet['bet_guest']; + } + + $colorstyle_bet = color_style($user_bet['status']); + $template->assign_block_vars('match_panel.user_row.bet', array( + 'BET' => $bet_home. ':'. $bet_guest, + 'COLOR_STYLE' => $colorstyle_bet, + 'POINTS' => ($user_bet['points'] == '') ? ' ' : $user_bet['points'], + ) + ); + + if ($bet_index == $split_after) + { + $sum_total[$user_bet['username']] += $total; + $matchday_sum_total += $total; + $bet_index = 0; + } + } + + $template->assign_block_vars('match_panel.tendency_footer', array( + 'S_TOTAL' => false, + ) + ); + foreach ($matches_tendency AS $match_tendency) + { + $template->assign_block_vars('match_panel.tendency_footer.tendency', array( + 'TENDENCY' => $match_tendency, + ) + ); + } + } + $matches_tendency = array(); + $split_index++; + if ($split_index == $splits) + { + $display_total = true; + } + else + { + $display_total = false; + } + $template->assign_block_vars('match_panel', array( + 'S_TOTAL' => $display_total, + ) + ); + } + if (0 == $match['home_id']) + { + $home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']); + $home_in_array = explode("#",$home_info); + $homename = $home_in_array[3]; + } + else + { + $homename = $match['home_name']; + } + if (0 == $match['guest_id']) + { + $guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']); + $guest_in_array = explode("#",$guest_info); + $guestname = $guest_in_array[3]; + } + else + { + $guestname = $match['guest_name']; + } + $colorstyle_match = color_style($match['status']); + $template->assign_block_vars('match_panel.match_entry', array( + 'HOME_NAME' => $homename, + 'GUEST_NAME' => $guestname, + 'RESULT' => $match['goals_home'] . ':' . $match['goals_guest'], + 'COLOR_STYLE' => $colorstyle_match, + ) + ); + if ($match['status'] < 1 && !$config['football_view_tendencies']) + { + // hide tendencies + $matches_tendency[] = '?-?-?'; + } + else + { + $matches_tendency[] = $match['home'] . '-' . $match['draw'] . '-' . $match['guest']; + } + $match_index++; +} +if ($count_matches > 0) +{ + $total = 0; + $count_user = 0; + $bet_index = 0; + foreach ($bet_line[$split_index] AS $user_bet) + { + if ($bet_index == 0) + { + $count_user++; + $row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($user_bet['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('match_panel.user_row', array( + 'ROW_CLASS' => $row_class, + 'USER_NAME' => $user_bet['username'], + ) + ); + $total = 0; + } + $bet_index++; + $total += $user_bet['points']; + if ($user_bet['status'] < 1) + { + if ($user_bet['bet_home'] == '') + { + $bet_home = ''; + } + else + { + $bet_home = '?'; + } + if ($user_bet['bet_guest'] == '') + { + $bet_guest = ''; + } + else + { + $bet_guest = '?'; + } + } + else + { + $bet_home = $user_bet['bet_home']; + $bet_guest = $user_bet['bet_guest']; + } + + $colorstyle_bet = color_style($user_bet['status']); + $template->assign_block_vars('match_panel.user_row.bet', array( + 'BET' => $bet_home. ':'. $bet_guest, + 'COLOR_STYLE' => $colorstyle_bet, + 'POINTS' => ($user_bet['points'] == '') ? ' ' : $user_bet['points'], + ) + ); + + if ($bet_index == $split_after) + { + $sum_total[$user_bet['username']] += $total; + $matchday_sum_total += $total; + $template->assign_block_vars('match_panel.user_row.points', array( + 'COLOR_STYLE' => $colorstyle_total, + 'POINTS_TOTAL' => $sum_total[$user_bet['username']], + ) + ); + $bet_index = 0; + } + } + + $template->assign_block_vars('match_panel.tendency_footer', array( + 'S_TOTAL' => true, + 'COLOR_STYLE' => $colorstyle_total, //currently ignored + 'SUMTOTAL' => $matchday_sum_total, + ) + ); + foreach ($matches_tendency AS $match_tendency) + { + $template->assign_block_vars('match_panel.tendency_footer.tendency', array( + 'TENDENCY' => $match_tendency, + ) + ); + } +} + +$sidename = sprintf($user->lang['MY_KOEFF']); +$template->assign_vars(array( + 'S_DISPLAY_MY_KOEFF' => true, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_chart', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['MY_CHART']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'stat_points', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['STAT_POINTS']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_CHART']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_STAT_POINTS']), + 'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday, + 'S_SPALTEN' => ($count_matches * 2) + 2, + 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), + 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users), + 'USERNAME' => $username, + ) +); + +?> \ No newline at end of file diff --git a/block/my_points.php b/block/my_points.php new file mode 100644 index 0000000..5d8afca --- /dev/null +++ b/block/my_points.php @@ -0,0 +1,204 @@ +data['user_id'], $season, $league)) + { + $user_sel = $user->data['user_id']; + } +} +$username = ''; +$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + +$data = false; +// Select user +$sql = 'SELECT DISTINCT + u.user_id, + u.username + FROM ' . FOOTB_BETS . ' AS b + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) + WHERE season = $season + AND league = $league + ORDER BY LOWER(u.username) ASC"; + +$result = $db->sql_query($sql); +while($row = $db->sql_fetchrow($result)) +{ + $data = true; + if ($user_sel == $row['user_id'] OR !$user_sel) + { + $selectid = ' selected="selected"'; + $username = $row['username']; + $user_sel = $row['user_id']; + } + else + { + $selectid = ''; + } + $template->assign_block_vars('form_user', array( + 'S_USER' => $row['user_id'], + 'S_USERNAME' => $row['username'], + 'S_SELECTEDID' => $selectid, + ) + ); +} +$db->sql_freeresult($result); + +$rank = 0; +// Select sum of users points group by team +$sql = "SELECT + t.*, + SUM(1) AS bets, + SUM(IF((m.team_id_home = t.team_id), + IF(b.goals_home + 0 > b.goals_guest, 1, 0), + IF(b.goals_home + 0 < b.goals_guest, 1, 0) + ) + ) AS win, + SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, + SUM(IF((m.team_id_home = t.team_id), + IF(b.goals_home + 0 < b.goals_guest, 1, 0), + IF(b.goals_home + 0 > b.goals_guest, 1, 0) + ) + ) AS lost, + SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest=m.goals_guest), + 0,1 + ) + ) + )AS tendencies, + SUM(IF((b.goals_home = m.goals_home) AND (b.goals_guest=m.goals_guest),1,0))AS hits, + " . select_points('m',true) . " + FROM " . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league + AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) + LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no=m.match_no) + WHERE t.season = $season + AND t.league = $league + AND m.status IN (3,6) + AND b.user_id = $user_sel + AND b.goals_home <> '' + AND b.goals_guest <> '' + AND m.matchday <= $matchday + GROUP BY t.team_id + ORDER BY points DESC"; + +$result = $db->sql_query($sql); + +while($row = $db->sql_fetchrow($result)) +{ + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $logo = "\""" ; + $template->assign_block_vars('points', array( + 'ROW_CLASS' => $row_class, + 'RANK' => $rank, + 'LOGO' => $logo, + 'TEAM' => $row['team_name_short'], + 'COUNT' => $row['bets'], + 'WIN' => $row['win'], + 'DRAW' => $row['draw'], + 'LOST' => $row['lost'], + 'DIRECTHITS' => $row['hits'], + 'TENDENCIES' => $row['tendencies'], + 'TOTAL' => $row['hits'] + $row['tendencies'], + 'POINTS' => $row['points'], + ) + ); +} +$db->sql_freeresult($result); + +$rank = 0; +// Select sum of all users points group by team +$sql = "SELECT + t.*, + SUM(1) AS bets, + SUM(IF((m.team_id_home = t.team_id), + IF(b.goals_home + 0 > b.goals_guest, 1, 0), + IF(b.goals_home + 0 < b.goals_guest, 1, 0) + ) + ) AS win, + SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, + SUM(IF((m.team_id_home = t.team_id), + IF(b.goals_home + 0 < b.goals_guest, 1, 0), + IF(b.goals_home + 0 > b.goals_guest, 1, 0) + ) + ) AS lost, + SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) + ) + )AS tendencies, + SUM(IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)) AS hits, + " . select_points('m',true) . " + FROM " . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league + AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) + LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no=m.match_no) + WHERE t.season = $season + AND t.league = $league + AND b.goals_home <> '' + AND b.goals_guest <> '' + AND m.status IN (3,6) + AND m.matchday <= $matchday + GROUP BY t.team_id + ORDER BY points DESC"; + +$result = $db->sql_query($sql); + +while($row = $db->sql_fetchrow($result)) +{ + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $logo = "\""" ; + $template->assign_block_vars('allpoints', array( + 'ROW_CLASS' => $row_class, + 'RANK' => $rank, + 'LOGO' => $logo, + 'TEAM' => $row['team_name_short'], + 'COUNT' => $row['bets'], + 'WIN' => $row['win'], + 'DRAW' => $row['draw'], + 'LOST' => $row['lost'], + 'DIRECTHITS' => $row['hits'], + 'TENDENCIES' => $row['tendencies'], + 'TOTAL' => $row['hits'] + $row['tendencies'], + 'POINTS' => $row['points'], + ) + ); +} +$db->sql_freeresult($result); + +$sidename = sprintf($user->lang['MY_POINTS']); +$template->assign_vars(array( + 'S_DISPLAY_MY_POINTS' => true, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['MY_BETS']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_table', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['MY_TABLE']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_BETS']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_TABLE']), + 'S_DATA_MY_POINTS' => $data, + 'SEASON' => $season, + 'LEAGUE' => $league, + 'USERNAME' => $username, + ) +); +?> \ No newline at end of file diff --git a/block/my_rank.php b/block/my_rank.php new file mode 100644 index 0000000..8116a26 --- /dev/null +++ b/block/my_rank.php @@ -0,0 +1,179 @@ +data['user_id'], $season, $league)) + { + $user_sel = $user->data['user_id']; + } +} +$username = ''; + +$data = false; +// select user +$sql = 'SELECT DISTINCT + u.user_id, + u.username + FROM ' . FOOTB_BETS . ' AS w + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = w.user_id) + WHERE season = $season + AND league = $league + ORDER BY LOWER(u.username) ASC "; + + +$result = $db->sql_query($sql); +while($row = $db->sql_fetchrow($result)) +{ + if ($user_sel == $row['user_id'] OR !$user_sel) + { + $selectid = ' selected="selected"'; + $username = $row['username']; + $user_sel = $row['user_id']; + } + else + { + $selectid = ''; + } + $template->assign_block_vars('form_user', array( + 'S_USER' => $row['user_id'], + 'S_USERNAME' => $row['username'], + 'S_SELECTEDID' => $selectid, + ) + ); +} +$db->sql_freeresult($result); + +$rank = 0; +// Get ranks 1-3 of selected user +$sql = 'SELECT + season, + COUNT(matchday) AS matchdays, + SUM(points) AS points, + SUM(IF(rank = 1, 1, 0)) AS rank1, + SUM(IF(rank = 2, 1, 0)) AS rank2, + SUM(IF(rank = 3, 1, 0)) AS rank3 + FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND user_id = $user_sel + GROUP BY user_id, season + ORDER BY season ASC"; + +$result = $db->sql_query($sql); + +while($row = $db->sql_fetchrow($result)) +{ + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('myrank', array( + 'ROW_CLASS' => $row_class, + 'SEASON' => $row['season'], + 'MATCHDAYS' => $row['matchdays'], + 'POINTS' => $row['points'], + 'RANK1' => $row['rank1'], + 'RANK2' => $row['rank2'], + 'RANK3' => $row['rank3'], + ) + ); +} +$db->sql_freeresult($result); + +$rank = 0; +// Get all ranks 1-3 of selected user +$sql = 'SELECT + COUNT(matchday) AS matchdays, + rank + FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND user_id = $user_sel + GROUP BY user_id, rank + ORDER BY rank ASC"; + +$result = $db->sql_query($sql); + +while($row = $db->sql_fetchrow($result)) +{ + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('season_ranks', array( + 'ROW_CLASS' => $row_class, + 'RANK' => $row['rank'], + 'MATCHDAYS' => $row['matchdays'], + ) + ); +} +$db->sql_freeresult($result); + +$rank = 0; +// Get ranks 1-3 of all users +$sql = 'SELECT + r.user_id, + u.username, + COUNT(r.matchday) AS matchdays, + SUM(r.points) AS points, + SUM(IF(r.rank =1, 1, 0)) AS rank1, + SUM(IF(r.rank =2, 1, 0)) AS rank2, + SUM(IF(r.rank =3, 1, 0)) AS rank3 + FROM ' . FOOTB_RANKS . " AS r + LEFT JOIN " . USERS_TABLE . " AS u ON (u.user_id = r.user_id) + WHERE r.season = $season + AND r.league = $league + GROUP BY r.user_id + ORDER BY rank1 DESC, rank2 DESC, rank3 DESC"; + +$result = $db->sql_query($sql); +while($row = $db->sql_fetchrow($result)) +{ + $data = true; + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('allranks', array( + 'ROW_CLASS' => $row_class, + 'NAME' => $row['username'], + 'MATCHDAYS' => $row['matchdays'], + 'POINTS' => $row['points'], + 'AVERAGE' => round($row['points'] / $row['matchdays'],1), + 'RANK1' => $row['rank1'], + 'RANK2' => $row['rank2'], + 'RANK3' => $row['rank3'], + ) + ); +} +$db->sql_freeresult($result); + +$sidename = sprintf($user->lang['MY_RANK']); +$template->assign_vars(array( + 'S_DISPLAY_MY_RANK' => true, + 'S_MATCHDAY_HIDE' => true, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_table', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['MY_TABLE']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_chart', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['MY_CHART']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_TABLE']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_CHART']), + 'S_DATA_MY_RANK' => $data, + 'SEASON' => $season, + 'LEAGUE' => $league, + 'USERNAME' => $username, + ) +); + +?> \ No newline at end of file diff --git a/block/my_table.php b/block/my_table.php new file mode 100644 index 0000000..013bbe3 --- /dev/null +++ b/block/my_table.php @@ -0,0 +1,438 @@ +data['user_id'], $season, $league)) + { + $user_sel = $user->data['user_id']; + } +} +$username = ''; +$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + +// select user +$sql = 'SELECT DISTINCT + u.user_id, + u.username + FROM ' . FOOTB_BETS . ' AS b + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) + WHERE season = $season + AND league = $league + ORDER BY LOWER(u.username) ASC"; + +$result = $db->sql_query($sql); + +if ($user_sel == 900) +{ + $selectid = ' selected="selected"'; + $username = 'Alle'; + $user_sel = 900; + $where_user = ""; +} +else +{ + $selectid = ''; + $where_user = "b.user_id = $user_sel AND "; +} +$template->assign_block_vars('form_user', array( + 'S_USER' => 900, + 'S_USERNAME' => 'Alle', + 'S_SELECTEDID' => $selectid, + ) +); + +while($row = $db->sql_fetchrow($result)) +{ + if ($user_sel == $row['user_id'] OR !$user_sel) + { + $selectid = ' selected="selected"'; + $username = $row['username']; + $user_sel = $row['user_id']; + } + else + { + $selectid = ''; + } + $template->assign_block_vars('form_user', array( + 'S_USER' => $row['user_id'], + 'S_USERNAME' => $row['username'], + 'S_SELECTEDID' => $selectid, + ) + ); +} +$db->sql_freeresult($result); + +$data_table = false; +$data_form = false; +if ($matchday > 5) +{ + $form_from = $matchday - 5; +} +else +{ + $form_from = 1; +} + +$sql = ' + SELECT * + FROM ' . FOOTB_LEAGUES . " + WHERE season = $season + AND league = $league"; + +$result = $db->sql_query($sql); +$row = $db->sql_fetchrow($result); +$league_type = $row['league_type']; +$db->sql_freeresult($result); + +$text_form = sprintf($user->lang['TABLE_FORM_FROM'], $form_from); + +$rank = 0; +// Select table on selected user bets +$sql = 'SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), + IF(b.goals_home + 0 > b.goals_guest, 1, 0), + IF(b.goals_home + 0 < b.goals_guest, 1, 0) + ) + ) AS win, + SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, + SUM(IF((m.team_id_home = t.team_id), + IF(b.goals_home + 0 < b.goals_guest, 1, 0), + IF(b.goals_home + 0 > b.goals_guest, 1, 0) + ) + ) AS lost, + SUM(IF(m.team_id_home = t.team_id, + IF(b.goals_home + 0 > b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0)), + IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0)) + ) + ) AS points, + SUM(IF(m.team_id_home = t.team_id, + IF(m.goals_home + 0 > m.goals_guest, 3, IF(m.goals_home = m.goals_guest, 1, 0)), + IF(m.goals_home + 0 < m.goals_guest, 3, IF(m.goals_home = m.goals_guest, 1, 0)) + ) + ) AS realpoints, + SUM(IF(m.team_id_home = t.team_id, b.goals_home - b.goals_guest, b.goals_guest - b.goals_home)) AS goals_diff, + SUM(IF(m.team_id_home = t.team_id, b.goals_home, b.goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id, b.goals_guest, b.goals_home)) AS goals_against + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league + AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) + LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no) + WHERE $where_user + t.season = $season + AND t.league = $league + AND b.goals_home <> '' + AND b.goals_guest <> '' + AND m.matchday <= $matchday + AND m.status IN (2, 3,5,6) + GROUP BY t.team_id + ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; + +$result = $db->sql_query($sql); +$lastGroup = ''; +$sumdiff = 0; +while($row = $db->sql_fetchrow($result)) +{ + if ($lastGroup != $row['group_id']) + { + $lastGroup = $row['group_id']; + $rank = 0; + $template->assign_block_vars('total', array( + 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], + ) + ); + } + if ($league_type != 2 OR $row['group_id'] != '') + { + $data_table = true; + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $logo = "\""" ; + $pdiff = $row['points'] - $row['realpoints']; + if ($pdiff >= 0) + { + $sumdiff += $pdiff; + $pdiff = ' (+' . $pdiff . ')'; + + } + else + { + $sumdiff -= $pdiff; + $pdiff = ' (' . $pdiff . ')'; + } + if ($user_sel == 900) + { + $pdiff = ''; + } + + $template->assign_block_vars('total', array( + 'RANK' => $rank . '.', + 'ROW_CLASS' => $row_class, + 'LOGO' => $logo, + 'TEAM_ID' => $row['team_id'], + 'TEAM' => $row['team_name_short'], + 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, + 'tid' => $row['team_id'], 'mode' => 'played')), + 'GAMES' => $row['matches'], + 'WIN' => $row['win'], + 'DRAW' => $row['draw'], + 'LOST' => $row['lost'], + 'GOALS' => $row['goals'], + 'GOALS_AGAINST' => $row['goals_against'], + 'GOALS_DIFF' => $row['goals_diff'], + 'POINTS' => $row['points'] . $pdiff, + ) + ); + } +} +$db->sql_freeresult($result); + +$rank = 0; +// Select formtable on selected user bets +$sql = 'SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), + IF(b.goals_home + 0 > b.goals_guest, 1, 0), + IF(b.goals_home + 0 < b.goals_guest, 1, 0) + ) + ) AS win, + SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, + SUM(IF((m.team_id_home = t.team_id), + IF(b.goals_home + 0 < b.goals_guest, 1, 0), + IF(b.goals_home + 0 > b.goals_guest, 1, 0) + ) + ) AS lost, + SUM(IF(m.team_id_home = t.team_id, + IF(b.goals_home + 0 > b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0)), + IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0)) + ) + ) AS points, + SUM(IF(m.team_id_home = t.team_id, b.goals_home - b.goals_guest, b.goals_guest - b.goals_home)) AS goals_diff, + SUM(IF(m.team_id_home = t.team_id, b.goals_home, b.goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id, b.goals_guest, b.goals_home)) AS goals_against + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league + AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) + LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no) + WHERE $where_user + t.season = $season + AND t.league = $league + AND b.goals_home <> '' + AND b.goals_guest <> '' + AND m.matchday >= $form_from + AND m.status IN (2, 3,5,6) + GROUP BY t.team_id + ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; + +$result = $db->sql_query($sql); +$lastGroup = ''; +while($row = $db->sql_fetchrow($result)) +{ + $data_form = true; + if ($lastGroup != $row['group_id']) + { + $lastGroup = $row['group_id']; + $rank = 0; + $template->assign_block_vars('form', array( + 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], + ) + ); + } + if ($league_type != 2 OR $row['group_id'] != '') + { + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $logo = "\""" ; + + $template->assign_block_vars('form', array( + 'RANK' => $rank . '.', + 'ROW_CLASS' => $row_class, + 'LOGO' => $logo, + 'TEAM_ID' => $row['team_id'], + 'TEAM' => $row['team_name_short'], + 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, + 'tid' => $row['team_id'], 'mode' => 'rest')), + 'GAMES' => $row['matches'], + 'WIN' => $row['win'], + 'DRAW' => $row['draw'], + 'LOST' => $row['lost'], + 'GOALS' => $row['goals'], + 'GOALS_AGAINST' => $row['goals_against'], + 'GOALS_DIFF' => $row['goals_diff'], + 'POINTS' => $row['points'], + ) + ); + } +} +$db->sql_freeresult($result); + +$rank = 0; +// Select home-table on selected user bets +$sql = 'SELECT + t.*, + SUM(1) AS matches, + SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS win, + SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, + SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS lost, + SUM(IF(b.goals_home + 0 > b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))) AS points, + SUM(b.goals_home - b.goals_guest) AS goals_diff, + SUM(b.goals_home) AS goals, + SUM(b.goals_guest) AS goals_against + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league + AND m.team_id_home = t.team_id AND m.group_id = t.group_id) + LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no) + WHERE $where_user + t.season = $season + AND t.league = $league + AND b.goals_home <> '' + AND b.goals_guest <> '' + AND m.matchday <= $matchday + AND m.status IN (2, 3,5,6) + GROUP BY t.team_id + ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; + +$result = $db->sql_query($sql); +$lastGroup = ''; +while($row = $db->sql_fetchrow($result)) +{ + if ($lastGroup != $row['group_id']) + { + $lastGroup = $row['group_id']; + $rank = 0; + $template->assign_block_vars('home', array( + 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], + ) + ); + } + if ($league_type != 2 OR $row['group_id'] != '') + { + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $logo = "\""" ; + + $template->assign_block_vars('home', array( + 'RANK' => $rank . '.', + 'ROW_CLASS' => $row_class, + 'LOGO' => $logo, + 'TEAM_ID' => $row['team_id'], + 'TEAM' => $row['team_name_short'], + 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, + 'tid' => $row['team_id'], 'mode' => 'home')), + 'GAMES' => $row['matches'], + 'WIN' => $row['win'], + 'DRAW' => $row['draw'], + 'LOST' => $row['lost'], + 'GOALS' => $row['goals'], + 'GOALS_AGAINST' => $row['goals_against'], + 'GOALS_DIFF' => $row['goals_diff'], + 'POINTS' => $row['points'], + ) + ); + } +} +$db->sql_freeresult($result); + +$rank = 0; +// Select away-table on selected user bets +$sql = 'SELECT + t.*, + SUM(1) AS matches, + SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS win, + SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, + SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS lost, + SUM(IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))) AS points, + SUM(b.goals_guest - b.goals_home) AS goals_diff, + SUM(b.goals_guest) AS goals, + SUM(b.goals_home) AS goals_against + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league AND m.team_id_guest = t.team_id AND m.group_id = t.group_id) + LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no) + WHERE $where_user + t.season = $season + AND t.league = $league + AND b.goals_home <> '' + AND b.goals_guest <> '' + AND m.matchday <= $matchday + AND m.status IN (2, 3,5,6) + GROUP BY t.team_id + ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; + +$result = $db->sql_query($sql); +$lastGroup = ''; +while($row = $db->sql_fetchrow($result)) +{ + if ($lastGroup != $row['group_id']) + { + $lastGroup = $row['group_id']; + $rank = 0; + $template->assign_block_vars('away', array( + 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], + ) + ); + } + if ($league_type != 2 OR $row['group_id'] != '') + { + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $logo = "\""" ; + + $template->assign_block_vars('away', array( + 'RANK' => $rank . '.', + 'ROW_CLASS' => $row_class, + 'LOGO' => $logo, + 'TEAM_ID' => $row['team_id'], + 'TEAM' => $row['team_name_short'], + 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, + 'tid' => $row['team_id'], 'mode' => 'away')), + 'GAMES' => $row['matches'], + 'WIN' => $row['win'], + 'DRAW' => $row['draw'], + 'LOST' => $row['lost'], + 'GOALS' => $row['goals'], + 'GOALS_AGAINST' => $row['goals_against'], + 'GOALS_DIFF' => $row['goals_diff'], + 'POINTS' => $row['points'], + ) + ); + } +} +$db->sql_freeresult($result); + +$sidename = sprintf($user->lang['MY_TABLE']); +$template->assign_vars(array( + 'S_DISPLAY_MY_TABLE' => true, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_points', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['MY_TABLE']), + 'LEFT_LINK' => '< ' . sprintf($user->lang['MY_POINTS']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_rank', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['MY_TABLE']), + 'RIGHT_LINK' => sprintf($user->lang['MY_RANK']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_POINTS']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_RANKS']), + 'S_DATA_MY_TABLE' => $data_table, + 'S_DATA_FORM' => $data_form, + 'SEASON' => $season, + 'LEAGUE' => $league, + 'TEXT_FORM' => $text_form, + 'S_PDIFF' => $sumdiff, + 'USERNAME' => $username, + ) +); + +?> \ No newline at end of file diff --git a/block/odds.php b/block/odds.php new file mode 100644 index 0000000..979966f --- /dev/null +++ b/block/odds.php @@ -0,0 +1,211 @@ +lang['datetime']; + +$sql = "SELECT + m.league, + m.match_no, + CONCAT( + CASE DATE_FORMAT(m.match_datetime,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i') + ) AS match_time, + t1.team_symbol AS home_symbol, + t2.team_symbol AS guest_symbol, + t1.team_name_short AS home_name, + t2.team_name_short AS guest_name, + t1.team_id AS home_id, + t2.team_id AS guest_id, + m.goals_home, + m.goals_guest, + m.goals_overtime_home AS kogoals_home, + m.goals_overtime_guest AS kogoals_guest, + m.ko_match, + m.group_id, + m.formula_home, + m.formula_guest, + m.odd_1, + m.odd_x, + m.odd_2, + m.trend FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + ORDER BY m.match_datetime ASC, m.match_no ASC"; + +$result = $db->sql_query($sql); +$rows = $db->sql_fetchrowset($result); + +$league_info = league_info($season, $league); +$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); +//while($row = $db->sql_fetchrow($result)) +foreach ($rows as $row) +{ + $data_odds = true; + $matchnumber++ ; + $row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if (0 == $row['home_id']) + { + $home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']); + $home_in_array = explode("#",$home_info); + $homelogo = $home_in_array[0]; + $homeid = $home_in_array[1]; + $homename = $home_in_array[2]; + } + else + { + $homelogo = $row['home_symbol']; + $homeid = $row['home_id']; + $homename = $row['home_name']; + } + if (0 == $row['guest_id']) + { + $guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']); + $guest_in_array = explode("#",$guest_info); + $guestlogo = $guest_in_array[0]; + $guestid = $guest_in_array[1]; + $guestname = $guest_in_array[2]; + } + else + { + $guestlogo = $row['guest_symbol']; + $guestid = $row['guest_id']; + $guestname = $row['guest_name']; + } + if ($homelogo <> '') + { + $logoH = "\""" ; + } + else + { + $logoH = "\"\"" ; + } + if ($guestlogo <> '') + { + $logoG = "\""" ; + } + else + { + $logoG = "\"\"" ; + } + + if ($row['ko_match']) + { + $display_ko = true; + $ko_match = true; + } + else + { + $ko_match = false; + } + + if ($row['group_id'] == '') + { + $group_id = ' '; + } + else + { + $display_group = true; + $group_id = $row['group_id']; + } + + $edit_match = false; + $goals_home = ($row['goals_home'] == '') ? ' ' : $row['goals_home']; + $goals_guest = ($row['goals_guest'] == '') ? ' ' : $row['goals_guest']; + $kogoals_home = ($row['kogoals_home'] == '') ? ' ' : $row['kogoals_home']; + $kogoals_guest = ($row['kogoals_guest'] == '') ? ' ' : $row['kogoals_guest']; + + $template->assign_block_vars('odds', array( + 'ROW_CLASS' => $row_class, + 'MATCH_NUMBER' => $row['match_no'], + 'MATCHDAY' => $matchday, + 'MATCH_TIME' => $row['match_time'], + 'GROUP' => $group_id, + 'HOME_ID' => $homeid, + 'GUEST_ID' => $guestid, + 'LOGO_HOME' => $logoH, + 'LOGO_GUEST' => $logoG, + 'HOME_NAME' => $homename, + 'GUEST_NAME' => $guestname, + 'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, + 'tid' => $homeid, 'mode' => 'all')), + 'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, + 'tid' => $guestid, 'mode' => 'all')), + 'GOALS_HOME' => $goals_home, + 'GOALS_GUEST' => $goals_guest, + 'COLOR_STYLE' => '', + 'KOGOALS_HOME' => $kogoals_home, + 'KOGOALS_GUEST' => $kogoals_guest, + 'S_KO_MATCH' => $ko_match, + 'TREND' => $row['trend'], + 'U_MATCH_STATS' => $this->helper->route('football_football_popup', array('popside' => 'hist_popup', 's' => $season, 'l' => $league, + 'hid' => $homeid, 'gid' => $guestid, 'm' => $matchday, + 'mn' => $row['match_no'], 'gr' => $row['group_id'])), + 'ODD_1' => $row['odd_1'], + 'ODD_X' => $row['odd_x'], + 'ODD_2' => $row['odd_2'], + ) + ); +} +$db->sql_freeresult($result); + +$sidename = 'Chancen'; +switch ($league_info['bet_ko_type']) +{ + case BET_KO_90: + $result_explain = sprintf($user->lang['MIN90']); + $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); + break; + case BET_KO_EXTRATIME: + $result_explain = sprintf($user->lang['EXTRATIME_SHORT']); + $label_finalresult = sprintf($user->lang['PENALTY']); + break; + case BET_KO_PENALTY: + $result_explain = sprintf($user->lang['PENALTY']); + $display_ko = false; + break; + default: + $result_explain = sprintf($user->lang['MIN90']); + $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); + break; +} + +$template->assign_vars(array( + 'S_DISPLAY_ODDS' => true, + 'S_SIDENAME' => $sidename, + 'RESULT_EXPLAIN' => $result_explain, + 'LABEL_FINALRESULT' => $label_finalresult, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['BET']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['TABLE']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_BET']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_TABLE']), + 'S_DATA_ODDS' => $data_odds, + ) +); + +?> \ No newline at end of file diff --git a/block/rank_matchday.php b/block/rank_matchday.php new file mode 100644 index 0000000..1392800 --- /dev/null +++ b/block/rank_matchday.php @@ -0,0 +1,72 @@ + 0) +{ + $data_rank_matchday = false; + $index = 0; + $sql = "SELECT + r.status, + r.rank, + r.user_id, + u.username, + r.points, + IF(r.win=0, '', r.win) AS win + FROM " . FOOTB_RANKS . ' AS r + LEFT Join ' . USERS_TABLE . " AS u ON (r.user_id = u.user_id) + WHERE r.season = $season + AND r.league = $league + AND r.matchday = $matchday + AND r.status IN (2,3) + ORDER BY rank ASC, LOWER(u.username) ASC"; + + $result = $db->sql_query($sql); + while($row = $db->sql_fetchrow($result)) + { + $index++; + if (($index <= $config['football_display_ranks']) OR ($row['user_id'] == $user->data['user_id'])) + { + $data_rank_matchday = true; + $row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $colorstyle = color_style($row['status']); + + $template->assign_block_vars('rank', array( + 'RANK' => $row['rank'], + 'ROW_CLASS' => $row_class, + 'USERID' => $row['user_id'], + 'USERNAME' => $row['username'], + 'U_BET_USER' => $this->helper->route('football_football_popup', array('popside' => 'bet_popup', 's' => $season, 'l' => $league, + 'm' => $matchday, 'u' => $row['user_id'])), + 'POINTS' => $row['points'], + 'COLOR_STYLE' => $colorstyle, + 'WIN' => $row['win'], + ) + ); + } + } + $db->sql_freeresult($result); + $league_info = league_info($season, $league); + + $template->assign_vars(array( + 'S_DISPLAY_RANK_MATCHDAY' => true, + 'S_DATA_RANK_MATCHDAY' => $data_rank_matchday, + 'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true, + 'WIN_NAME' => $config['football_win_name'], + )); +} +?> \ No newline at end of file diff --git a/block/rank_total.php b/block/rank_total.php new file mode 100644 index 0000000..3773671 --- /dev/null +++ b/block/rank_total.php @@ -0,0 +1,94 @@ + 0) +{ + $sql = 'SELECT + r.matchday AS last_matchday + FROM '. FOOTB_RANKS . " AS r + WHERE r.season = $season + AND r.league = $league + AND r.status IN (2,3) + ORDER BY r.matchday DESC"; + + $result = $db->sql_query_limit($sql, 1); + if($row = $db->sql_fetchrow($result)) + { + $last_matchday = $row['last_matchday']; + $db->sql_freeresult($result); + $rank_matchday = ($last_matchday < $matchday) ? $last_matchday : $matchday; + + $sql = 'SELECT + r.rank_total AS rank, + r.user_id, + u.username, + u.user_colour, + r.status AS status, + r.points_total AS points, + r.win_total AS win + FROM '. FOOTB_RANKS . ' AS r + LEFT JOIN '. USERS_TABLE . " AS u ON (r.user_id = u.user_id) + WHERE r.season = $season + AND r.league = $league + AND r.matchday = $rank_matchday + AND r.status IN (2,3) + ORDER BY points DESC, LOWER(u.username) ASC"; + + $result = $db->sql_query($sql); + + $index = 0; + while($row = $db->sql_fetchrow($result)) + { + $index++; + $data_rank_total = true; + if (($index <= $config['football_display_ranks']) OR ($row['user_id'] == $user->data['user_id'])) + { + $row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $colorstyle = color_style($row['status']); + + $template->assign_block_vars("ranktotal", array( + 'RANK' => $row['rank'], + 'ROW_CLASS' => $row_class, + 'USERID' => $row['user_id'], + 'USERNAME' => $row['username'], + 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), + 'URL' => $phpbb_root_path . "profile.php?mode=viewprofile&u=" . $row['user_id'], + 'POINTS' => $row['points'], + 'COLOR_STYLE' => $colorstyle, + 'WIN' => $row['win'] , + ) + ); + } + } + $db->sql_freeresult($result); + } + else + { + $data_rank_total = false; + } + $league_info = league_info($season, $league); + + $template->assign_vars(array( + 'S_DISPLAY_RANK_TOTAL' => true, + 'S_DATA_RANK_TOTAL' => $data_rank_total, + 'S_WIN' => ($league_info['win_matchday'] == '0' and $league_info['win_season'] == '0') ? false : true, + 'WIN_NAME' => $config['football_win_name'], + ) + ); +} +?> \ No newline at end of file diff --git a/block/ranks_matchday.php b/block/ranks_matchday.php new file mode 100644 index 0000000..f147eef --- /dev/null +++ b/block/ranks_matchday.php @@ -0,0 +1,270 @@ +request->variable('start', 0); +$win_user_most_hits = array(); +$win_user_most_hits_away = array(); +$season_wins = array(); +$win_user_most_hits = win_user_most_hits($season, $league, $matchday); +$win_user_most_hits_away = win_user_most_hits_away($season, $league, $matchday); + +// Statistics of matchday +$sql = "SELECT + b.user_id, + COUNT(b.match_no) AS matches, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS bets, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0), + 0 + ) + ) AS hits, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((m.goals_home <= m.goals_guest), + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0), + 0 + ), + 0 + ) + ) AS hits02, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) OR + (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR + (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) + ), + 0 + ) + ) AS tendency + FROM " . FOOTB_BETS . ' AS b + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) + WHERE b.season = $season + AND b.league = $league + AND m.status IN (2,3) + AND m.matchday = $matchday + GROUP BY user_id"; + +$result = $db->sql_query($sql); +$usersstats = $db->sql_fetchrowset($result); +$db->sql_freeresult($result); +foreach ($usersstats AS $userstats) +{ + $betsof[$userstats['user_id']] = $userstats['bets']; + $nobetsof[$userstats['user_id']] = $userstats['matches'] - $userstats['bets']; + $tendenciesof[$userstats['user_id']] = $userstats['tendency']; + $hitsof[$userstats['user_id']] = $userstats['hits']; + $hits02of[$userstats['user_id']] = $userstats['hits02']; +} + +// ranks of matchday +$sql = 'SELECT + rank, + user_id + FROM '. FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday = $matchday + AND status IN (2,3) + ORDER BY rank ASC, user_id ASC"; +$result = $db->sql_query($sql); +$ranks = $db->sql_fetchrowset($result); +$db->sql_freeresult($result); +$total_users = sizeof($ranks); +foreach ($ranks AS $rank) +{ + $rankof[$rank['user_id']] = $rank['rank']; +} + +if ($matchday > 1) +{ + // rank previous matchday + $sql = 'SELECT + rank AS last_rang, + user_id + FROM '. FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday = ($matchday-1) + AND status IN (2,3) + ORDER BY last_rang ASC, user_id ASC"; + + $result = $db->sql_query($sql); + $ranks = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + foreach ($ranks AS $rank) + { + $prevrankof[$rank['user_id']] = $rank['last_rang']; + } +} + +if ($matchday == $maxmatchday) +{ + $season_wins = season_wins($season, $league, $matchday); +} + +// Make sure $start is set to the last page if it exceeds the amount +if ($start < 0 || $start >= $total_users) +{ + $sql_start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page']; +} +else +{ + $sql_start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page']; +} +$sql_limit = $config['football_users_per_page']; + +// handle pagination. +$base_url = $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)); +$pagination = $phpbb_container->get('pagination'); +$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start); + $data_ranks = false; +$index = 0; +$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + +$sql = 'SELECT + r.rank, + r.status, + r.user_id, + r.points, + r.win AS wins, + u.user_colour, + u.username + FROM '. FOOTB_RANKS . ' AS r + LEFT Join '. USERS_TABLE . " AS u ON (r.user_id = u.user_id) + WHERE r.season = $season + AND r.league = $league + AND r.matchday = $matchday + AND r.status IN (2,3) + ORDER BY r.rank ASC, r.points DESC, LOWER(u.username) ASC"; + +$result = $db->sql_query_limit($sql, $sql_limit, $sql_start); +while($row = $db->sql_fetchrow($result)) +{ + $index++; + $data_ranks = true; + if (isset($prevrankof[$row['user_id']])) + { + if ($rankof[$row['user_id']] == '') + { + $change_sign = ''; + $change_img = ''; + $change_differ = ' '; + } + else + { + if ($rankof[$row['user_id']] == $prevrankof[$row['user_id']]) + { + $change_sign = '='; + $change_img = "\""lang['NO_CHANGES'] . "\"/>"; + $change_differ = ' '; + } + else + { + if ($rankof[$row['user_id']] > $prevrankof[$row['user_id']]) + { + $change_sign = '+'; + $change_img = "\""lang['WORSENED'] . "\"/>"; + $differ = $rankof[$row['user_id']] - $prevrankof[$row['user_id']]; + $change_differ = ' (' . $differ . ')'; + } + else + { + $change_sign = '-'; + $change_img = "\""lang['IMPROVED'] . "\"/>"; + $differ = $prevrankof[$row['user_id']] - $rankof[$row['user_id']]; + $change_differ = ' (' . $differ . ')'; + } + } + } + } + else + { + $change_sign = ''; + $change_img = ''; + $change_differ = ' '; + } + + if ($matchday == $maxmatchday) + { + // if someone didn't bet the hole Season + if(!isset($win_user_most_hits[$row['user_id']]['win'])) + { + $win_user_most_hits[$row['user_id']]['win'] = 0; + } + if(!isset($win_user_most_hits_away[$row['user_id']]['win'])) + { + $win_user_most_hits_away[$row['user_id']]['win'] = 0; + } + if(!isset($season_wins[$row['user_id']]['win'])) + { + $season_wins[$row['user_id']]['win'] = 0; + } + $win_total = sprintf('%01.2f',$row['wins'] + $win_user_most_hits[$row['user_id']]['win'] + $win_user_most_hits_away[$row['user_id']]['win'] + + $season_wins[$row['user_id']]['win']); + } + else + { + $win_total = sprintf('%01.2f',$row['wins']); + } + $row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $colorstyle = color_style($row['status']); + + $template->assign_block_vars('rankstotal', array( + 'ROW_CLASS' => $row_class, + 'RANK' => $rankof[$row['user_id']], + 'CHANGE_SIGN' => $change_sign, + 'CHANGE_IMG' => $change_img, + 'CHANGE_DIFFER' => $change_differ, + 'USERID' => $row['user_id'], + 'USERNAME' => $row['username'], + 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), + 'BETS' => $betsof[$row['user_id']], + 'NOBETS' => ($nobetsof[$row['user_id']] == 0) ? ' ' : $nobetsof[$row['user_id']], + 'TENDENCIES' => ($tendenciesof[$row['user_id']] == 0) ? ' ' : $tendenciesof[$row['user_id']], + 'DIRECTHITS' => ($hitsof[$row['user_id']] == 0) ? ' ' : $hitsof[$row['user_id']], + 'DIRECTHITS02' => ($hits02of[$row['user_id']] == 0) ? ' ' : $hits02of[$row['user_id']], + 'POINTS' => $row['points'], + 'COLOR_STYLE' => $colorstyle, + 'WIN' => $win_total, + ) + ); +} +$db->sql_freeresult($result); +$league_info = league_info($season, $league); + +$sidename = sprintf($user->lang['RANK_MATCHDAY']); +$template->assign_vars(array( + 'S_DISPLAY_RANKS_MATCHDAY' => true, + 'S_DISPLAY_HITS02' => $config['football_win_hits02'], + 'S_SIDENAME' => $sidename, + 'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['TABLE']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['RANK_TOTAL']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_TABLE']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_RANK_TOTAL']), + 'S_DATA_RANKS' => $data_ranks, + 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), + 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users), + 'WIN_NAME' => $config['football_win_name'], + ) +); + +?> \ No newline at end of file diff --git a/block/ranks_total.php b/block/ranks_total.php new file mode 100644 index 0000000..19e2c95 --- /dev/null +++ b/block/ranks_total.php @@ -0,0 +1,590 @@ +request->variable('start', 0); +$mode = $this->request->variable('mode', ''); + +switch ($mode) +{ + case 'alltime': + // Statistics + $sql = "SELECT + b.user_id, + COUNT(b.match_no) AS matches, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS bets, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) + ), + 0 + ) + ) AS tendency + FROM " . FOOTB_BETS . ' AS b + LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) + LEFT JOIN ' . FOOTB_LEAGUES . " AS l ON (l.season = b.season AND l.league = b.league) + WHERE b.league = $league + AND ((b.season < $season) OR (b.season = $season AND m.matchday <= $matchday)) + AND m.status IN (2,3) + GROUP BY user_id"; + + $result = $db->sql_query($sql); + $rows = $db->sql_fetchrowset($result); + $total_users = sizeof($rows); + $db->sql_freeresult($result); + + foreach ($rows AS $row) + { + $bets_of[$row['user_id']] = $row['bets']; + $nobets_of[$row['user_id']] = $row['matches'] - $row['bets']; + } + + // Wins + $sql = 'SELECT + r.user_id, + sum(r.win_total) As win_total + FROM ' . FOOTB_RANKS . ' AS r + LEFT JOIN ' . FOOTB_LEAGUES . " AS l ON (l.season = r.season AND l.league = r.league) + WHERE r.league = $league + AND ((r.season < $season AND r.matchday = l.matchdays) OR (r.season = $season AND r.matchday = $matchday)) + AND r.status IN (2,3) + GROUP BY user_id + ORDER BY r.user_id ASC"; + + $result = $db->sql_query($sql); + + $win_arr = array(); + while($row = $db->sql_fetchrow($result)) + { + $win_arr[$row['user_id']] = $row['win_total']; + } + $db->sql_freeresult($result); + + $data_ranks = false; + $pagination = ''; + + $sql = 'SELECT + r.user_id, + u.username, + min(r.status) AS status, + sum(r.points) As points_total, + sum(r.tendencies) As tendencies, + sum(r.correct_result) As hits + FROM ' . FOOTB_RANKS . ' AS r + LEFT JOIN ' . USERS_TABLE . ' AS u ON (r.user_id = u.user_id) + LEFT JOIN ' . FOOTB_LEAGUES . " AS l ON (l.season = r.season AND l.league = r.league) + WHERE r.league = $league + AND ((r.season < $season) OR (r.season = $season AND r.matchday <= $matchday)) + AND r.status IN (2,3) + GROUP BY user_id + ORDER BY points_total DESC, LOWER(u.username) ASC"; + + $result = $db->sql_query($sql); + + $ranking_arr = array(); + while($row = $db->sql_fetchrow($result)) + { + $ranking_arr[$row['user_id']] = $row; + } + $db->sql_freeresult($result); + + + // Make sure $start is set to the last page if it exceeds the amount + if ($start < 0 || $start >= $total_users) + { + $index_start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page']; + } + else + { + $index_start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page']; + } + $index_end = $index_start + $config['football_users_per_page'] - 1; + + // handle pagination. + $base_url = $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'alltime')); + $pagination = $phpbb_container->get('pagination'); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start); + + $index = 0; + $rank = 0; + $last_points = 0; + $data_rank_total = false; + foreach ($ranking_arr AS $curr_rank) + { + if ($curr_rank['points_total'] <> $last_points) + { + $rank = $index + 1; + $last_points = $curr_rank['points_total']; + } + $data_ranks = true; + if (($index_start <= $index) && ($index <= $index_end)) + { + $row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($curr_rank['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $colorstyle = color_style($curr_rank['status']); + + $template->assign_block_vars('rankstotal', array( + 'ROW_CLASS' => $row_class, + 'RANK' => $rank, + 'USERID' => $curr_rank['user_id'], + 'USERNAME' => $curr_rank['username'], + 'URL' => $phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $curr_rank['user_id'], + 'BETS' => $bets_of[$curr_rank['user_id']], + 'NOBETS' => ($nobets_of[$curr_rank['user_id']] == 0) ? ' ' : $nobets_of[$curr_rank['user_id']], + 'TENDENCIES' => ($curr_rank['tendencies'] == 0) ? ' ' : $curr_rank['tendencies'], + 'DIRECTHITS' => ($curr_rank['hits'] == 0) ? ' ' : $curr_rank['hits'], + 'POINTS' => $curr_rank['points_total'], + 'COLOR_STYLE' => $colorstyle, + 'WIN' => $win_arr[$curr_rank['user_id']], + ) + ); + } + $index++; + } + $db->sql_freeresult($result); + + $sidename = sprintf($user->lang['RANK_TOTAL']); + $league_info = league_info($season, $league); + $template->assign_vars(array( + 'S_DISPLAY_RANKS_TOTAL' => true, + 'S_DISPLAY_HITS02' => $config['football_win_hits02'], + 'S_DATA_RANKS' => $data_ranks, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['RANK_MATCHDAY']), + 'U_RIGHT' => ($config['football_bank']) ? $this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)) : + $this->helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => ($config['football_bank']) ? sprintf($user->lang['FOOTBALL_BANK']) . ' >' : sprintf($user->lang['MY_BETS']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_RANK_MATCHDAY']), + 'RIGHT_TITLE' => ($config['football_bank']) ? sprintf($user->lang['TITLE_FOOTBALL_BANK']) : sprintf($user->lang['TITLE_MY_BETS']), + 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), + 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users), + 'S_WIN' => false, + 'WIN_NAME' => $config['football_win_name'], + 'S_SHOW_OTHER_LINKS' => true, + 'S_HEADER' => sprintf($user->lang['RANKING_ALL_TIME']), + 'S_LINK_RANKING' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'S_LINK_ALL_TIME' => '', + 'S_LINK_COMPARE' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'compare')), + ) + ); + break; + + case 'compare': + // Statistics + $sql = "SELECT + b.season as season, + b.user_id, + COUNT(b.match_no) AS matches, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS bets, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) + ), + 0 + ) + ) AS tendency, + SUM(IF(b.goals_home = m.goals_home AND b.goals_guest = m.goals_guest, 1, 0)) AS hits + FROM " . FOOTB_BETS . ' AS b + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) + WHERE b.season <= $season + AND b.league = $league + AND m.matchday <= $matchday + AND m.status IN (2,3) + GROUP BY b.season, b.user_id"; + + $result = $db->sql_query($sql); + $rows = $db->sql_fetchrowset($result); + $total_users = sizeof($rows); + $db->sql_freeresult($result); + + foreach ($rows AS $row) + { + $bets_of[$row['user_id'] . '#' . $row['season']] = $row['bets']; + $nobets_of[$row['user_id'] . '#' . $row['season']] = $row['matches'] - $row['bets']; + $tendency_of[$row['user_id'] . '#' . $row['season']] = $row['tendency']; + $hits_of[$row['user_id'] . '#' . $row['season']] = $row['hits']; + } + + // Wins + $sql = 'SELECT + r.season as season, + r.user_id, + sum(r.win_total) As win_total + FROM ' . FOOTB_RANKS . " AS r + WHERE r.season <= $season + AND r.league = $league + AND r.matchday = $matchday + AND r.status IN (2,3) + GROUP BY season, user_id + ORDER BY r.user_id ASC, season ASC"; + + $result = $db->sql_query($sql); + + $win_arr = array(); + while($row = $db->sql_fetchrow($result)) + { + $win_arr[$row['user_id'] . '#' . $row['season']] = $row['win_total']; + } + $db->sql_freeresult($result); + + $data_ranks = false; + $pagination = ''; + + $sql = 'SELECT + r.season, + r.user_id, + u.username, + r.rank_total, + r.status, + r.points_total + FROM ' . FOOTB_RANKS . ' AS r + LEFT JOIN ' . USERS_TABLE . " AS u ON (r.user_id = u.user_id) + WHERE r.season <= $season + AND r.league = $league + AND r.matchday = $matchday + AND r.status IN (2,3) + ORDER BY r.points_total DESC, LOWER(u.username) ASC"; + + $result = $db->sql_query($sql); + + $ranking_arr = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + + // Make sure $start is set to the last page if it exceeds the amount + if ($start < 0 || $start >= $total_users) + { + $index_start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page']; + } + else + { + $index_start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page']; + } + $index_end = $index_start + $config['football_users_per_page'] - 1; + + // handle pagination. + $base_url = $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'compare')); + $pagination = $phpbb_container->get('pagination'); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start); + + $index = 0; + $rank = 0; + $last_points = 0; + $data_rank_total = false; + foreach ($ranking_arr AS $curr_rank) + { + if ($curr_rank['points_total'] <> $last_points) + { + $rank = $index + 1; + $last_points = $curr_rank['points_total']; + } + $data_ranks = true; + if (($index_start <= $index) && ($index <= $index_end)) + { + $row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($curr_rank['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $colorstyle = color_style($curr_rank['status']); + + $template->assign_block_vars('rankstotal', array( + 'ROW_CLASS' => $row_class, + 'RANK' => $rank, + 'USERID' => $curr_rank['user_id'], + 'USERNAME' => $curr_rank['username'], + 'SEASON' => $curr_rank['season'], + 'SEASON_RANK' => $curr_rank['rank_total'], + 'URL' => $phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $curr_rank['user_id'], + 'BETS' => $bets_of[$curr_rank['user_id'] . '#' . $curr_rank['season']], + 'NOBETS' => ($nobets_of[$curr_rank['user_id'] . '#' . $curr_rank['season']] == 0) ? ' ' : $nobets_of[$curr_rank['user_id'] . '#' . $curr_rank['season']], + 'TENDENCIES' => ($tendency_of[$curr_rank['user_id'] . '#' . $curr_rank['season']] == 0) ? ' ' : $tendency_of[$curr_rank['user_id'] . '#' . $curr_rank['season']], + 'DIRECTHITS' => ($hits_of[$curr_rank['user_id'] . '#' . $curr_rank['season']] == 0) ? ' ' : $hits_of[$curr_rank['user_id'] . '#' . $curr_rank['season']], + 'POINTS' => $curr_rank['points_total'], + 'COLOR_STYLE' => $colorstyle, + 'WIN' => $win_arr[$curr_rank['user_id'] . '#' . $curr_rank['season']], + ) + ); + } + $index++; + } + $db->sql_freeresult($result); + + $sidename = sprintf($user->lang['RANK_TOTAL']); + $league_info = league_info($season, $league); + $template->assign_vars(array( + 'S_DISPLAY_RANKS_TOTAL' => true, + 'S_DISPLAY_HITS02' => $config['football_win_hits02'], + 'S_DATA_RANKS' => $data_ranks, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['RANK_MATCHDAY']), + 'U_RIGHT' => ($config['football_bank']) ? $this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)) : + $this->helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => ($config['football_bank']) ? sprintf($user->lang['FOOTBALL_BANK']) . ' >' : sprintf($user->lang['MY_BETS']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_RANK_MATCHDAY']), + 'RIGHT_TITLE' => ($config['football_bank']) ? sprintf($user->lang['TITLE_FOOTBALL_BANK']) : sprintf($user->lang['TITLE_MY_BETS']), + 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), + 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users), + 'S_WIN' => ($league_info['win_matchday'] == '0' and $league_info['win_season'] == '0') ? false : ($this->auth->acl_gets('a_')) ? true : false, + 'WIN_NAME' => $config['football_win_name'], + 'S_SHOW_OTHER_LINKS' => true, + 'S_HEADER' => sprintf($user->lang['RANKING_COMPARE']), + 'S_LINK_RANKING' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'S_LINK_ALL_TIME' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'alltime')), + 'S_LINK_COMPARE' => '', + ) + ); + break; + + default: + + $win_user_most_hits = array(); + $win_user_most_hits_away = array(); + $win_user_most_hits = win_user_most_hits($season, $league, $matchday); + $win_user_most_hits_away = win_user_most_hits_away($season, $league, $matchday); + + // Statistics + $sql = "SELECT + b.user_id, + COUNT(b.match_no) AS matches, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS bets, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) + ), + 0 + ) + ) AS tendency + FROM " . FOOTB_BETS . ' AS b + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) + WHERE b.season = $season + AND b.league = $league + AND m.status IN (2,3) + AND m.matchday <= $matchday + GROUP BY user_id"; + + $result = $db->sql_query($sql); + $rows = $db->sql_fetchrowset($result); + $total_users = sizeof($rows); + $db->sql_freeresult($result); + + foreach ($rows AS $row) + { + $bets_of[$row['user_id']] = $row['bets']; + $nobets_of[$row['user_id']] = $row['matches'] - $row['bets']; + $tendency_of[$row['user_id']] = $row['tendency']; + } + + $data_ranks = false; + $pagination = ''; + + $prev_rank_of = array(); + if ($matchday > 1) + { + // previous rank total + $sql = 'SELECT + rank_total, + user_id + FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday = ($matchday-1) + AND status IN (2,3) + ORDER BY rank_total ASC, user_id ASC"; + $result = $db->sql_query($sql); + $rows = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + foreach ($rows AS $row) + { + $prev_rank_of[$row['user_id']] = $row['rank_total']; + } + } + + $sql = 'SELECT + r.rank_total, + r.user_id, + u.username, + u.user_colour, + r.status, + r.points_total, + r.win_total + FROM ' . FOOTB_RANKS . ' AS r + LEFT JOIN ' . USERS_TABLE . " AS u ON (r.user_id = u.user_id) + WHERE r.season = $season + AND r.league = $league + AND r.matchday = $matchday + AND r.status IN (2,3) + GROUP BY user_id + ORDER BY r.points_total DESC, LOWER(u.username) ASC"; + + $result = $db->sql_query($sql); + + $ranking_arr = array(); + while($row = $db->sql_fetchrow($result)) + { + $ranking_arr[$row['user_id']] = $row; + } + $db->sql_freeresult($result); + + // Make sure $start is set to the last page if it exceeds the amount + if ($start < 0 || $start >= $total_users) + { + $index_start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page']; + } + else + { + $index_start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page']; + } + $index_end = $index_start + $config['football_users_per_page'] - 1; + + // handle pagination. + $base_url = $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)); + $pagination = $phpbb_container->get('pagination'); + if ($user->data['football_mobile']) + { + $index_start = 0; + $index_end = 9999; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $index_end, $start); + } + else + { + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start); + } + + $index = 0; + $data_rank_total = false; + $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + foreach ($ranking_arr AS $curr_rank) + { + $data_ranks = true; + $rank = $curr_rank['rank_total']; + + if (($index_start <= $index) && ($index <= $index_end)) + { + // Display page + if (isset($prev_rank_of[$curr_rank['user_id']])) + { + if ($rank == $prev_rank_of[$curr_rank['user_id']]) + { + $change_sign = '='; + $change_img = "\""lang['NO_CHANGES'] . "\"/>"; + $change_differ = ''; + } + else + { + if ($rank > $prev_rank_of[$curr_rank['user_id']]) + { + $change_sign = '+'; + $change_img = "\""lang['WORSENED'] . "\"/>"; + $differ = $rank - $prev_rank_of[$curr_rank['user_id']]; + $change_differ = ' (' . $differ . ')'; + } + else + { + $change_sign = '-'; + $change_img = "\""lang['IMPROVED'] . "\"/>"; + $differ = $prev_rank_of[$curr_rank['user_id']] - $rank; + $change_differ = ' (' . $differ . ')'; + } + } + } + else + { + $change_sign = ''; + $change_img = ''; + $change_differ = ''; + } + + $win_total = sprintf('%01.2f',$curr_rank['win_total']); + if(!isset($win_user_most_hits[$curr_rank['user_id']]['direct_hit'])) + { + $win_user_most_hits[$curr_rank['user_id']]['direct_hit'] = 0; + } + if(!isset($win_user_most_hits_away[$curr_rank['user_id']]['direct_hit'])) + { + $win_user_most_hits_away[$curr_rank['user_id']]['direct_hit'] = 0; + } + $row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($curr_rank['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $colorstyle = color_style($curr_rank['status']); + + $template->assign_block_vars('rankstotal', array( + 'ROW_CLASS' => $row_class, + 'RANK' => $rank, + 'CHANGE_SIGN' => $change_sign, + 'CHANGE_IMG' => $change_img, + 'CHANGE_DIFFER' => $change_differ, + 'USERID' => $curr_rank['user_id'], + 'USERNAME' => $curr_rank['username'], + 'U_PROFILE' => get_username_string('profile', $curr_rank['user_id'], $curr_rank['username'], $curr_rank['user_colour']), + 'BETS' => $bets_of[$curr_rank['user_id']], + 'NOBETS' => ($nobets_of[$curr_rank['user_id']] == 0) ? ' ' : $nobets_of[$curr_rank['user_id']], + 'TENDENCIES' => ($tendency_of[$curr_rank['user_id']] == 0) ? ' ' : $tendency_of[$curr_rank['user_id']], + 'DIRECTHITS' => ($win_user_most_hits[$curr_rank['user_id']]['direct_hit'] == 0) ? ' ' : $win_user_most_hits[$curr_rank['user_id']]['direct_hit'], + 'DIRECTHITS02' => ($win_user_most_hits_away[$curr_rank['user_id']]['direct_hit'] == 0) ? ' ' : $win_user_most_hits_away[$curr_rank['user_id']]['direct_hit'], + 'POINTS' => $curr_rank['points_total'], + 'COLOR_STYLE' => $colorstyle, + 'WIN' => $win_total, + ) + ); + } + $index++; + } + $db->sql_freeresult($result); + + $sidename = sprintf($user->lang['RANK_TOTAL']); + $league_info = league_info($season, $league); + $template->assign_vars(array( + 'S_DISPLAY_RANKS_TOTAL' => true, + 'S_DISPLAY_HITS02' => $config['football_win_hits02'], + 'S_DATA_RANKS' => $data_ranks, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['RANK_MATCHDAY']), + 'U_RIGHT' => ($config['football_bank']) ? $this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)) : + $this->helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => ($config['football_bank']) ? sprintf($user->lang['FOOTBALL_BANK']) . ' >' : sprintf($user->lang['MY_BETS']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_RANK_MATCHDAY']), + 'RIGHT_TITLE' => ($config['football_bank']) ? sprintf($user->lang['TITLE_FOOTBALL_BANK']) : sprintf($user->lang['TITLE_MY_BETS']), + 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), + 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users), + 'S_WIN' => ($league_info['win_matchday'] == '0' and $league_info['win_season'] == '0') ? false : true, + 'WIN_NAME' => $config['football_win_name'], + 'S_SHOW_OTHER_LINKS' => true, + 'S_LINK_RANKING' => '', + 'S_LINK_ALL_TIME' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'alltime')), + 'S_LINK_COMPARE' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'compare')), + ) + ); + break; +} + +?> \ No newline at end of file diff --git a/block/results.php b/block/results.php new file mode 100644 index 0000000..8e19e9c --- /dev/null +++ b/block/results.php @@ -0,0 +1,433 @@ +data['user_id'], $season, $league); +$edit_mode = false; +$display_group = false; +$display_ko = false; +$data_results = false; +$lang_dates = $user->lang['datetime']; +$matchnumber = 0; +$editstatus = array(1, 2, 4, 5); + +$league_info = league_info($season, $league); +// Calculate matches AND results of matchday +$sql = "SELECT + m.match_no, + m.matchday, + m.status, + m.group_id, + m.formula_home, + m.formula_guest, + t1.team_symbol AS home_symbol, + t2.team_symbol AS guest_symbol, + t1.team_id AS home_id, + t2.team_id AS guest_id, + t1.team_name AS home_name, + t2.team_name AS guest_name, + t1.team_name_short AS home_short, + t2.team_name_short AS guest_short, + m.goals_home, + m.goals_guest, + m.ko_match AS ko_match, + m.goals_overtime_home AS kogoals_home, + m.goals_overtime_guest AS kogoals_guest, + CONCAT( + CASE DATE_FORMAT(m.match_datetime,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i') + ) AS match_time + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) + WHERE m.season = $season + AND m.league = $league + AND m.matchday = $matchday + ORDER BY m.match_datetime ASC, m.match_no ASC"; + +$result = $db->sql_query($sql); +$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); +while($row = $db->sql_fetchrow($result)) +{ + $data_results = true; + $matchnumber++ ; + $row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if (0 == $row['home_id']) + { + $home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']); + $home_in_array = explode("#",$home_info); + $homelogo = $home_in_array[0]; + $homeid = $home_in_array[1]; + $homename = $home_in_array[2]; + $homeshort = $home_in_array[2]; + } + else + { + $homelogo = $row['home_symbol']; + $homeid = $row['home_id']; + $homename = $row['home_name']; + $homeshort = $row['home_short']; + } + if (0 == $row['guest_id']) + { + $guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']); + $guest_in_array = explode("#",$guest_info); + $guestlogo = $guest_in_array[0]; + $guestid = $guest_in_array[1]; + $guestname = $guest_in_array[2]; + $guestshort = $guest_in_array[2]; + } + else + { + $guestlogo = $row['guest_symbol']; + $guestid = $row['guest_id']; + $guestname = $row['guest_name']; + $guestshort = $row['guest_short']; + } + if ($homelogo <> '') + { + $logoH = "\""" ; + } + else + { + $logoH = "\"\"" ; + } + if ($guestlogo <> '') + { + $logoG = "\""" ; + } + else + { + $logoG = "\"\"" ; + } + + if ($row['ko_match']) + { + $display_ko = true; + $ko_match = true; + } + else + { + $ko_match = false; + } + + if ($row['group_id'] == '') + { + $group_id = ' '; + } + else + { + $display_group = true; + $group_id = $row['group_id']; + } + + + if (in_array($row['status'], $editstatus) AND $user_is_member) + { + $edit_mode = true; + $edit_match = true; + $goals_home = $row['goals_home']; + $goals_guest = $row['goals_guest']; + $kogoals_home = $row['kogoals_home']; + $kogoals_guest = $row['kogoals_guest']; + } + else + { + $edit_match = false; + $goals_home = ($row['goals_home'] == '') ? ' ' : $row['goals_home']; + $goals_guest = ($row['goals_guest'] == '') ? ' ' : $row['goals_guest']; + $kogoals_home = ($row['kogoals_home'] == '') ? ' ' : $row['kogoals_home']; + $kogoals_guest = ($row['kogoals_guest'] == '') ? ' ' : $row['kogoals_guest']; + } + $template->assign_block_vars('result', array( + 'ROW_CLASS' => $row_class, + 'MATCH_NUMBER' => $row['match_no'], + 'MATCHDAY' => $row['matchday'], + 'STATUS' => $row['status'], + 'MATCH_TIME' => $row['match_time'], + 'GROUP' => $group_id, + 'HOME_ID' => $homeid, + 'GUEST_ID' => $guestid, + 'LOGO_HOME' => $logoH, + 'LOGO_GUEST' => $logoG, + 'HOME_NAME' => $homename, + 'GUEST_NAME' => $guestname, + 'HOME_SHORT' => $homeshort, + 'GUEST_SHORT' => $guestshort, + 'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, + 'tid' => $homeid, 'mode' => 'all')), + 'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, + 'tid' => $guestid, 'mode' => 'all')), + 'GOALS_HOME' => $goals_home, + 'GOALS_GUEST' => $goals_guest, + 'COLOR_STYLE' => color_style($row['status']), + 'KOGOALS_HOME' => $kogoals_home, + 'KOGOALS_GUEST' => $kogoals_guest, + 'S_KO_MATCH' => $ko_match, + 'S_EDIT_MATCH' => $edit_match, + ) + ); +} +$db->sql_freeresult($result); + +// Calculate extra bets of matchday +// Start select team +$sql = 'SELECT + team_id AS option_value, + team_name AS option_name + FROM ' . FOOTB_TEAMS . " + WHERE season = $season + AND league = $league + ORDER BY team_name ASC"; + +$result = $db->sql_query($sql); +$option_rows = $db->sql_fetchrowset($result); +$db->sql_freeresult($result); + +if ($edit_mode) +{ + $template->assign_block_vars('worldfootball', array('LEAGUE' => $league-1,)); +} + +$sql = "SELECT e.*, + t1.team_name AS result_team + FROM " . FOOTB_EXTRA . ' AS e + LEFT JOIN ' . FOOTB_TEAMS . " AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result) + WHERE e.season = $season + AND e.league = $league + AND e.matchday_eval = $matchday + ORDER BY e.extra_no ASC"; + +$result = $db->sql_query($sql); + +$extra_results = false; +$extranumber = 0; +while ($row = $db->sql_fetchrow($result)) +{ + $extra_results = true; + $extranumber++ ; + $row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + + switch($row['question_type']) + { + case '1': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '2': + { + $display_type = 1; + $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); + } + break; + case '3': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_HIT']); + } + break; + case '4': + case '5': + { + $display_type = 2; + $eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']); + } + break; + default : + { + $display_type = 2; + $eval_title = ''; + } + break; + } + + if ($row['extra_status'] > 0 && $row['extra_status'] < 3 && $user_is_member) + { + $edit_mode = true; + $result_extra = ($row['result_team'] == NULL) ? '' : $row['result_team']; + + $multiple = ''; + switch($row['question_type']) + { + case '2': + { + $multiple = ' multiple="multiple" size="3" '; + } + break; + case '4': + { + $option_arr = array(); + for ($i = 65; $i <= 72; $i++) + { + if (strstr($row['question'], chr($i) . ':')) + { + $option_arr[] = array( + 'option_value' => chr($i), + 'option_name' => chr($i), + ); + } + } + if (sizeof($option_arr) > 1) + { + $display_type = 1; + $option_rows = $option_arr; + $result_extra = $row['result']; + $multiple = ' multiple="multiple" size="3" '; + } + } + break; + case '3': + { + $option_arr = array(); + for ($i = 65; $i <= 72; $i++) + { + if (strstr($row['question'], chr($i) . ':')) + { + $option_arr[] = array( + 'option_value' => chr($i), + 'option_name' => chr($i), + ); + } + } + if (sizeof($option_arr) > 1) + { + $display_type = 1; + $option_rows = $option_arr; + $result_extra = $row['result']; + } + } + break; + } + + $template->assign_block_vars('extra_result', array( + 'ROW_CLASS' => $row_class, + 'EXTRA_NO' => $row['extra_no'], + 'S_EDIT_EXTRA' => true, + 'QUESTION' => $row['question'], + 'EXTRA_POINTS' => $row['extra_points'], + 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), + 'EVALUATION_TITLE' => $eval_title, + 'RESULT' => ($display_type == 1) ? $result_extra : $row['result'], + 'S_DISPLAY_TYPE' => $display_type, + ) + ); + + if ($display_type == 1) + { + $selected = ($row['result'] == '') ? ' selected="selected"' : ''; + + $template->assign_block_vars('extra_result.extra_option', array( + 'OPTION_VALUE' => '', + 'OPTION_NAME' => sprintf($user->lang['SELECT']), + 'S_SELECTED' => $selected)); + + foreach ($option_rows as $option_row) + { + if (strstr($row['result'], ';')) + { + $selected = ''; + $result_arr = explode(';', $row['result']); + foreach($result_arr AS $result_value) + { + if ($result_value <> '') + { + if ($option_row['option_value'] == $result_value) + { + $selected = ' selected="selected"'; + } + } + } + } + else + { + $selected = ($option_row['option_value'] == $row['result']) ? ' selected="selected"' : ''; + } + $template->assign_block_vars('extra_result.extra_option', array( + 'OPTION_VALUE' => $option_row['option_value'], + 'OPTION_NAME' => $option_row['option_name'], + 'S_SELECTED' => $selected)); + } + } + } + else + { + $extra_colorstyle = color_style($row['extra_status']); + $extra_result = ($row['result'] == '') ? ' ' : $row['result']; + $result_extra = ($row['result_team'] == NULL) ? ' ' : $row['result_team']; + + $template->assign_block_vars('extra_result', array( + 'ROW_CLASS' => $row_class, + 'S_EDIT_EXTRA' => false, + 'QUESTION' => $row['question'], + 'EXTRA_POINTS' => $row['extra_points'], + 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), + 'RESULT' => ($display_type == 1) ? $result_extra : $extra_result, + 'COLOR_STYLE' => $extra_colorstyle, + ) + ); + } +} + +$sidename = sprintf($user->lang['RESULTS']); +switch ($league_info['bet_ko_type']) +{ + case BET_KO_90: + $result_explain = sprintf($user->lang['MIN90']); + $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); + break; + case BET_KO_EXTRATIME: + $result_explain = sprintf($user->lang['EXTRATIME_SHORT']); + $label_finalresult = sprintf($user->lang['PENALTY']); + break; + case BET_KO_PENALTY: + $result_explain = sprintf($user->lang['PENALTY']); + $display_ko = false; + break; + default: + $result_explain = sprintf($user->lang['MIN90']); + $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); + break; +} + +$template->assign_vars(array( + 'S_DISPLAY_RESULTS' => true, + 'S_EXTRA_RESULTS' => $extra_results, + 'S_SIDENAME' => $sidename, + 'RESULT_EXPLAIN' => $result_explain, + 'LABEL_FINALRESULT' => $label_finalresult, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['ALL_BETS']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['TABLE']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_ALL_BETS']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_TABLE']), + 'S_FORM_ACTION_RESULT' => $this->helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'result')), + 'S_DATA_RESULTS' => $data_results, + 'S_USER_IS_MEMBER' => $user_is_member, + 'S_DISPLAY_GROUP' => $display_group, + 'S_DISPLAY_KO' => $display_ko, + 'S_EDIT_MODE' => $edit_mode, + ) +); + +?> \ No newline at end of file diff --git a/block/rules_popup.php b/block/rules_popup.php new file mode 100644 index 0000000..ccff232 --- /dev/null +++ b/block/rules_popup.php @@ -0,0 +1,226 @@ +data['user_id'] == ANONYMOUS) + { + trigger_error('NO_GUEST_VIEW'); + } +} +if (!$config['football_user_view']) +{ + // Only Prediction League member should see this page + // Check Prediction League authorisation + if ( !$this->auth->acl_get('u_use_football') ) + { + trigger_error('NO_AUTH_VIEW'); + } +} + +// Football disabled? +if ($config['football_disable']) +{ + $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; + trigger_error($message); +} + +$season = $this->request->variable('s', 0); +$league = $this->request->variable('l', 0); + +// Check parms +$error_message = ''; +if (!$season OR !$league) +{ + $data_rules = false; + if (!$season) + { + $error_message .= sprintf($user->lang['NO_SEASON']) . '
'; + } + if (!$league) + { + $error_message .= sprintf($user->lang['NO_LEAGUE']) . '
'; + } +} +else +{ + $season_info = season_info($season); + if (sizeof($season_info)) + { + $season_name = $season_info['season_name']; + $league_info = league_info($season, $league); + if (sizeof($league_info)) + { + $data_rules = true; + $matchdays = $league_info['matchdays']; + $league_name = $league_info['league_name']; + + if ($user->data['is_registered'] and !$user->data['is_bot']) + { + $win_hits = ''; + $win_hits02 = ''; + $win_matchday = explode(';', "0;" . $league_info['win_matchday']); + $win_season = explode(';',"0;" . $league_info['win_season']); + $win_hits = $league_info['win_result']; + $win_hits02 = $league_info['win_result_02']; + + if($win_hits != '' AND $win_hits != 0) + { + $template->assign_block_vars('wintable', array( + 'WIN_DESC' => sprintf($user->lang['WIN_HITS']), + ) + ); + $template->assign_block_vars('wintable.entry', array( + 'ROW_CLASS' => 'bg1 row_light', + 'RANK' => '1. ' . sprintf($user->lang['PLACE']), + 'WIN' => $win_hits, + ) + ); + } + + if($win_hits02 != '' AND $win_hits02 != 0 AND $config['football_win_hits02']) + { + $template->assign_block_vars('wintable', array( + 'WIN_DESC' => sprintf($user->lang['WIN_HITS02']), + ) + ); + $template->assign_block_vars('wintable.entry', array( + 'ROW_CLASS' => 'bg1 row_light', + 'RANK' => '1. ' . sprintf($user->lang['PLACE']), + 'WIN' => $win_hits02, + ) + ); + } + + + if($win_matchday[1] != '' AND $win_matchday[1] != 0) + { + $template->assign_block_vars('wintable', array( + 'WIN_DESC' => sprintf($user->lang['WINS_MATCHDAY']), + ) + ); + $rank = 1; + while ($win_matchday[$rank] != '') + { + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('wintable.entry', array( + 'ROW_CLASS' => $row_class, + 'RANK' => $rank . '. ' . sprintf($user->lang['PLACE']), + 'WIN' => $win_matchday[$rank], + ) + ); + $rank++ ; + if ($rank > sizeof($win_matchday)-1) + { + break; + } + } + } + + if($win_season[1] != '' AND $win_season[1] != 0) + { + $template->assign_block_vars('wintable', array( + 'WIN_DESC' => sprintf($user->lang['WINS_SEASON']), + ) + ); + $rank = 1; + while ($win_season[$rank] != '') + { + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('wintable.entry', array( + 'ROW_CLASS' => $row_class, + 'RANK' => $rank. '. ' . sprintf($user->lang['PLACE']), + 'WIN' => $win_season[$rank], + ) + ); + $rank++ ; + if ($rank > sizeof($win_season)-1) + { + break; + } + } + } + } + } + else + { + $data_rules = false; + $error_message .= sprintf($user->lang['NO_LEAGUE']) . '
'; + $league_name = ''; + } + } + else + { + $data_rules = false; + $error_message .= sprintf($user->lang['NO_SEASON']) . '
'; + $season_name = ''; + } +} + +$sidename = sprintf($user->lang['FOOTBALL_RULES']); +if ($data_rules) +{ + $link_rules = append_sid($phpbb_root_path . "viewtopic.$phpEx?p=" . $league_info["rules_post_id"]); + $points_tendency = ($league_info['points_mode'] < 3) ? sprintf($user->lang['POINTS_TENDENCY' . $league_info['points_mode']], $league_info['points_tendency']) : sprintf($user->lang['POINTS_TENDENCY'], $league_info['points_tendency']); + $template->assign_vars(array( + 'S_SIDENAME' => $sidename, + 'S_DATA_RULES' => $data_rules, + 'S_BET_IN_TIME' => $league_info['bet_in_time'], + 'S_RULES_POST_ID' => $league_info['rules_post_id'], + 'S_ERROR_MESSAGE' => $error_message, + 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), + 'WIN_NAME' => $config['football_win_name'], + 'JOIN_MODE' => ($league_info['join_by_user']) ? (($league_info['join_in_season']) ? sprintf($user->lang['JOIN_IN_SEASON']) : sprintf($user->lang['JOIN_BY_USER'])) : sprintf($user->lang['JOIN_BY_ADMIN']), + 'POINTS_HIT' => sprintf($user->lang['POINTS_HIT'], $league_info['points_result']) . '
', + 'POINTS_TENDENCY' => $points_tendency . '
', + 'POINTS_DIFF' => ($league_info['points_mode'] == 4) ? sprintf($user->lang['POINTS_DIFFERENCE'], $league_info['points_diff']) . '
' : '', + 'POINTS_LAST' => ($league_info['points_last']) ? sprintf($user->lang['POINTS_NO_BET']) . '
' : '', + 'LINK_RULES' => sprintf($user->lang['LINK_RULES'], $link_rules), + 'SEASONNAME' => $season_info['season_name'], + 'LEAGUENAME' => $league_name, + ) + ); + + // output page + page_header(sprintf($user->lang['FOOTBALL_RULES' ]) . ' ' . $league_info['league_name'] . ' ' . $season_info['season_name']); +} +else +{ + $template->assign_vars(array( + 'S_SIDENAME' => $sidename, + 'S_DATA_RULES' => $data_rules, + 'S_BET_IN_TIME' => false, + 'S_RULES_POST_ID' => 0, + 'S_ERROR_MESSAGE' => $error_message, + 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), + 'WIN_NAME' => $config['football_win_name'], + 'JOIN_MODE' => '', + 'POINTS_HIT' => '', + 'POINTS_TENDENCY' => '', + 'POINTS_DIFF' => '', + 'POINTS_LAST' => '', + 'LINK_RULES' => '', + 'SEASONNAME' => '', + 'LEAGUENAME' => '', + ) + ); + + // output page + page_header(sprintf($user->lang['FOOTBALL_RULES' ])); +} +$template->set_filenames(array( + 'body' => 'rules_popup.html' + ) +); +// $template->display('popup'); + +page_footer(); + +?> \ No newline at end of file diff --git a/block/stat_points.php b/block/stat_points.php new file mode 100644 index 0000000..f3f5f38 --- /dev/null +++ b/block/stat_points.php @@ -0,0 +1,170 @@ +sql_query_limit($sql, 20); +while($row = $db->sql_fetchrow($result)) +{ + $data = true; + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('top20', array( + 'ROW_CLASS' => $row_class, + 'NAME' => $row['username'], + 'MATCHDAY' => $row['matchday'], + 'POINTS' => $row['points'], + 'WIN' => $row['win'], + 'DIRECTHITS' => $row['correct_result'], + 'TENDENCIES' => $row['tendencies'] - $row['correct_result'], + 'TOTAL' => $row['tendencies'], + ) + ); +} +$db->sql_freeresult($result); + +$rank = 0; +$sql = 'SELECT + r.user_id, + u.username, + r.* + FROM ' . FOOTB_RANKS . ' AS r + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id) + WHERE r.season = $season + AND r.league = $league + ORDER BY r.points ASC"; + +$result = $db->sql_query_limit($sql, 20); +while($row = $db->sql_fetchrow($result)) +{ + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('flop20', array( + 'ROW_CLASS' => $row_class, + 'NAME' => $row['username'], + 'MATCHDAY' => $row['matchday'], + 'POINTS' => $row['points'], + 'DIRECTHITS' => $row['correct_result'], + 'TENDENCIES' => $row['tendencies'] - $row['correct_result'], + 'TOTAL' => $row['tendencies'], + ) + ); +} +$db->sql_freeresult($result); + +$rank = 0; +$sql = 'SELECT + r.user_id, + u.username, + r.* + FROM ' . FOOTB_RANKS . ' AS r + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id) + WHERE league = $league + ORDER BY r.points DESC"; + +$result = $db->sql_query_limit($sql, 20); +while($row = $db->sql_fetchrow($result)) +{ + $data_all = true; + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('alltop20', array( + 'ROW_CLASS' => $row_class, + 'NAME' => $row['username'], + 'SEASON' => $row['season'], + 'MATCHDAY' => $row['matchday'], + 'POINTS' => $row['points'], + 'WIN' => $row['win'], + 'DIRECTHITS' => $row['correct_result'], + 'TENDENCIES' => $row['tendencies'] - $row['correct_result'], + 'TOTAL' => $row['tendencies'], + ) + ); +} +$db->sql_freeresult($result); + +$rank = 0; +$sql = 'SELECT + r.user_id, + u.username, + COUNT(points) AS count_zero + FROM ' . FOOTB_RANKS . ' AS r + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id) + WHERE r.league = $league + AND r.points = 0 + GROUP BY r.user_id + ORDER BY count_zero DESC"; + +$result = $db->sql_query_limit($sql, 20); +while($row = $db->sql_fetchrow($result)) +{ + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['user_id'] == $user->data['user_id']) + { + $row_class = 'bg3 row_user'; + } + $template->assign_block_vars('allflop20', array( + 'ROW_CLASS' => $row_class, + 'NAME' => $row['username'], + 'COUNTZERO' => $row['count_zero'], + ) + ); +} +$db->sql_freeresult($result); + +$league_info = league_info($season, $league); +$sidename = sprintf($user->lang['STAT_POINTS']); +$template->assign_vars(array( + 'S_DISPLAY_STAT_POINTS' => true, + 'S_MATCHDAY_HIDE' => true, + 'S_SIDENAME' => $sidename, + 'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['MY_KOEFF']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'stat_results', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['STAT_RESULTS']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_KOEFF']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_STAT_RESULTS']), + 'S_DATA_STAT_POINTS' => $data, + 'S_DATA_ALL_POINTS' => $data_all, + 'SEASON' => $season, + 'LEAGUE' => $league, + ) +); + +?> \ No newline at end of file diff --git a/block/stat_results.php b/block/stat_results.php new file mode 100644 index 0000000..c72deea --- /dev/null +++ b/block/stat_results.php @@ -0,0 +1,146 @@ +phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + +$rank = 0; +// Select results and count +$sql = 'SELECT + COUNT(DISTINCT(m.match_no)) AS count_result, + COUNT(m.match_no) AS count_bets, + m.goals_home, + m.goals_guest, + SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0) + ) + ) AS hits, + SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), + 0, + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) + ) + ) AS tendencies, + ' . select_points('m',true) . ' + FROM ' . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_BETS . " AS b ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) + WHERE m.season = $season + AND m.league = $league + AND b.goals_home <> '' + AND b.goals_guest <> '' + AND (m.status IN (3,6)) + AND m.matchday <= $matchday + GROUP BY m.goals_home, m.goals_guest + ORDER BY count_bets DESC"; + +$result = $db->sql_query($sql); +while($row = $db->sql_fetchrow($result)) +{ + $data = true; + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $template->assign_block_vars('result', array( + 'ROW_CLASS' => $row_class, + 'GOALS_HOME' => $row['goals_home'], + 'GOALS_GUEST' => $row['goals_guest'], + 'RESULTS' => $row['count_result'], + 'BETS' => $row['count_bets'], + 'HITS' => $row['hits'], + 'TENDENCIES' => $row['tendencies'], + 'TOTAL' => $row['hits'] + $row['tendencies'], + 'POINTS' => $row['points'], + 'AVERAGE' => round($row['points'] / $row['count_bets'],1), + ) + ); +} +$db->sql_freeresult($result); +// Get goaldifferences by team +$sql = "SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS wins, + SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > (goals_guest+2), 1, 0), IF((goals_home + 2) < goals_guest, 1, 0))) AS plus3, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home = (goals_guest+2), 1, 0), IF((goals_home + 2) = goals_guest, 1, 0))) AS plus2, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home = (goals_guest+1), 1, 0), IF((goals_home + 1) = goals_guest, 1, 0))) AS plus1, + SUM(IF((m.team_id_home = t.team_id), IF((goals_home + 1) = goals_guest, 1, 0), IF(goals_home = (goals_guest + 1), 1, 0))) AS minus1, + SUM(IF((m.team_id_home = t.team_id), IF((goals_home + 2) = goals_guest, 1, 0), IF(goals_home = (goals_guest + 2), 1, 0))) AS minus2, + SUM(IF((m.team_id_home = t.team_id), IF((goals_home + 2) < goals_guest, 1, 0), IF(goals_home + 0 > (goals_guest + 2), 1, 0))) AS minus3, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)), + IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0)) + ) + ) AS points, + SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goal_diff, + SUM(IF(m.team_id_home = t.team_id, goals_home , goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id, goals_guest , goals_home)) AS goals_get + FROM " . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.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 + AND m.season = $season + AND m.league = $league + AND m.status IN (3,6) + AND m.matchday <= $matchday + GROUP BY t.team_id + ORDER BY points DESC, goal_diff DESC, goals DESC"; + +$result = $db->sql_query($sql); +$rank = 0; +while($row = $db->sql_fetchrow($result)) +{ + $rank++; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $logo = "\""" ; + $template->assign_block_vars('points', array( + 'ROW_CLASS' => $row_class, + 'RANK' => $rank, + 'LOGO' => $logo, + 'TEAM' => $row['team_name_short'], + 'MATCHES' => $row['matches'], + 'PLUS3' => $row['plus3'], + 'PLUS2' => $row['plus2'], + 'PLUS1' => $row['plus1'], + 'DRAW' => $row['draw'], + 'MINUS1' => $row['minus1'], + 'MINUS2' => $row['minus2'], + 'MINUS3' => $row['minus3'], + 'GOALS_DIFF' => $row['goal_diff'], + 'POINTS' => $row['points'], + ) + ); +} +$db->sql_freeresult($result); + +$sidename = sprintf($user->lang['STAT_RESULTS']); +$template->assign_vars(array( + 'S_DISPLAY_STAT_RESULTS' => true, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'stat_points', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['STAT_POINTS']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['BET']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_STAT_POINTS']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_BET']), + 'S_DATA_STAT_RESULTS' => $data, + 'SEASON' => $season, + 'LEAGUE' => $league, + ) +); + +?> \ No newline at end of file diff --git a/block/table.php b/block/table.php new file mode 100644 index 0000000..52ad240 --- /dev/null +++ b/block/table.php @@ -0,0 +1,420 @@ + 5) +{ + $form_from = $matchday - 5; +} +else +{ + $form_from = 1; +} +$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + +$sql = 'SELECT * + FROM ' . FOOTB_LEAGUES . " + WHERE season = $season + AND league = $league"; +$result = $db->sql_query($sql); +$row = $db->sql_fetchrow($result); +$league_type = $row['league_type']; +$db->sql_freeresult($result); + +$text_form = sprintf($user->lang['TABLE_FORM_FROM'], $form_from); + +$rank = 0; +// Get table-information +$sql = "SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS win, + SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 < goals_guest, 1, 0), IF(goals_home + 0 > goals_guest, 1, 0))) AS lost, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)), + IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0)) + ) + ) - IF(t.team_id = 20 AND t.season = 2011 AND $matchday > 7, 2, 0) AS points, + SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goals_diff, + SUM(IF(m.team_id_home = t.team_id, goals_home , goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id, goals_guest , goals_home)) AS goals_against + FROM " . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league + AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) + WHERE t.season = $season + AND t.league = $league + AND m.matchday <= $matchday + AND m.status IN (2, 3,5,6) + GROUP BY t.team_id + ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; + +$result = $db->sql_query($sql); +$last_group = ''; +$current_rank = 0; +$last_goals = 0; +$last_goals_againts = 0; +$last_points = 0; +while($row = $db->sql_fetchrow($result)) +{ + if ($last_group != $row['group_id']) + { + $last_group = $row['group_id']; + $rank = 0; + $last_goals = 0; + $last_goals_againts = 0; + $last_points = 0; + $template->assign_block_vars('total', array( + 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], + ) + ); + } + if ($league_type != 2 OR $row['group_id'] != '') + { + $data_table = true; + $rank++; + if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) + { + $current_rank = $rank . '.'; + } + else + { + $current_rank = ''; + } + $last_points = $row['points']; + $last_goals = $row['goals']; + $last_goals_againts = $row['goals_against']; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['team_symbol'] <> '') + { + $logo = "\""" ; + } + else + { + $logo = "\"\"" ; + } + + $template->assign_block_vars('total', array( + 'RANK' => $current_rank, + 'ROW_CLASS' => $row_class, + 'LOGO' => $logo, + 'TEAM_ID' => $row['team_id'], + 'TEAM' => $row['team_name'], + 'TEAM_SHORT' => $row['team_name_short'], + 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], + 'tid' => $row['team_id'], 'mode' => 'played')), + 'GAMES' => $row['matches'], + 'WIN' => $row['win'], + 'DRAW' => $row['draw'], + 'LOST' => $row['lost'], + 'GOALS' => $row['goals'], + 'GOALS_AGAINST' => $row['goals_against'], + 'GOALS_DIFF' => $row['goals_diff'], + 'POINTS' => $row['points'], + ) + ); + } +} +$db->sql_freeresult($result); +$rank = 0; +// Get form-table-information +$sql = 'SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS win, + SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 < goals_guest, 1, 0), IF(goals_home + 0 > goals_guest, 1, 0))) AS lost, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)), + IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0)) + ) + ) AS points, + SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goals_diff, + SUM(IF(m.team_id_home = t.team_id, goals_home, goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id, goals_guest, goals_home)) AS goals_against + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league + AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) + WHERE t.season = $season + AND t.league = $league + AND m.matchday >= $form_from + AND m.status IN (2, 3,5,6) + GROUP BY t.team_id + ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; + +$result = $db->sql_query($sql); +$last_group = ''; +$current_rank = 0; +$last_goals = 0; +$last_goals_againts = 0; +$last_points = 0; +while($row = $db->sql_fetchrow($result)) +{ + if ($last_group != $row['group_id']) + { + $last_group = $row['group_id']; + $rank = 0; + $last_goals = 0; + $last_goals_againts = 0; + $last_points = 0; + $template->assign_block_vars('form', array( + 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], + ) + ); + } + if ($league_type != 2 OR $row['group_id'] != '') + { + $data_form = true; + $rank++; + if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) + { + $current_rank = $rank . '.'; + } + else + { + $current_rank = ''; + } + $last_points = $row['points']; + $last_goals = $row['goals']; + $last_goals_againts = $row['goals_against']; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['team_symbol'] <> '') + { + $logo = "\""" ; + } + else + { + $logo = "\"\"" ; + } + + $template->assign_block_vars('form', array( + 'RANK' => $current_rank, + 'ROW_CLASS' => $row_class, + 'LOGO' => $logo, + 'TEAM_ID' => $row['team_id'], + 'TEAM' => $row['team_name'], + 'TEAM_SHORT' => $row['team_name_short'], + 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], + 'tid' => $row['team_id'], 'mode' => 'rest')), + 'GAMES' => $row['matches'], + 'WIN' => $row['win'], + 'DRAW' => $row['draw'], + 'LOST' => $row['lost'], + 'GOALS' => $row['goals'], + 'GOALS_AGAINST' => $row['goals_against'], + 'GOALS_DIFF' => $row['goals_diff'], + 'POINTS' => $row['points'], + ) + ); + } +} +$db->sql_freeresult($result); +$rank = 0; +// Get home-table-information +$sql = 'SELECT + t.*, + SUM(1) AS matches, + SUM(IF(goals_home + 0 > goals_guest, 1, 0)) AS win, + SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, + SUM(IF(goals_home + 0 < goals_guest, 1, 0)) AS lost, + SUM(IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) AS points, + SUM(goals_home - goals_guest) AS goals_diff, + SUM(goals_home) AS goals, + SUM(goals_guest) AS goals_against + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league + AND m.team_id_home = t.team_id AND m.group_id = t.group_id) + WHERE t.season = $season + AND t.league = $league + AND m.matchday <= $matchday + AND m.status IN (2, 3,5,6) + GROUP BY t.team_id + ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; + +$result = $db->sql_query($sql); +$last_group = ''; +$current_rank = 0; +$last_goals = 0; +$last_goals_againts = 0; +$last_points = 0; +while($row = $db->sql_fetchrow($result)) +{ + if ($last_group != $row['group_id']) + { + $last_group = $row['group_id']; + $rank = 0; + $last_goals = 0; + $last_goals_againts = 0; + $last_points = 0; + $template->assign_block_vars('home', array( + 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], + ) + ); + } + if ($league_type != 2 OR $row['group_id'] != '') + { + $rank++; + if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) + { + $current_rank = $rank . '.'; + } + else + { + $current_rank = ''; + } + $last_points = $row['points']; + $last_goals = $row['goals']; + $last_goals_againts = $row['goals_against']; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['team_symbol'] <> '') + { + $logo = "\""" ; + } + else + { + $logo = "\"\"" ; + } + + $template->assign_block_vars('home', array( + 'RANK' => $current_rank, + 'ROW_CLASS' => $row_class, + 'LOGO' => $logo, + 'TEAM_ID' => $row['team_id'], + 'TEAM' => $row['team_name'], + 'TEAM_SHORT' => $row['team_name_short'], + 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], + 'tid' => $row['team_id'], 'mode' => 'home')), + 'GAMES' => $row['matches'], + 'WIN' => $row['win'], + 'DRAW' => $row['draw'], + 'LOST' => $row['lost'], + 'GOALS' => $row['goals'], + 'GOALS_AGAINST' => $row['goals_against'], + 'GOALS_DIFF' => $row['goals_diff'], + 'POINTS' => $row['points'], + ) + ); + } +} +$db->sql_freeresult($result); +$rank = 0; +// Get away-table-information +$sql = 'SELECT + t.*, + SUM(1) AS matches, + SUM(IF(goals_home + 0 < goals_guest, 1, 0)) AS win, + SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, + SUM(IF(goals_home + 0 > goals_guest, 1, 0)) AS lost, + SUM(IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) AS points, + SUM(goals_guest - goals_home) AS goals_diff, + SUM(goals_guest) AS goals, + SUM(goals_home) AS goals_against + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league + AND m.team_id_guest = t.team_id AND m.group_id = t.group_id) + WHERE t.season = $season + AND t.league = $league + AND m.matchday <= $matchday + AND m.status IN (2, 3,5,6) + GROUP BY t.team_id + ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; + +$result = $db->sql_query($sql); +$last_group = ''; +$current_rank = 0; +$last_goals = 0; +$last_goals_againts = 0; +$last_points = 0; +while($row = $db->sql_fetchrow($result)) +{ + if ($last_group != $row['group_id']) + { + $last_group = $row['group_id']; + $rank = 0; + $last_goals = 0; + $last_goals_againts = 0; + $last_points = 0; + $template->assign_block_vars('away', array( + 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], + ) + ); + } + if ($league_type != 2 OR $row['group_id'] != '') + { + $rank++; + if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) + { + $current_rank = $rank . '.'; + } + else + { + $current_rank = ''; + } + $last_points = $row['points']; + $last_goals = $row['goals']; + $last_goals_againts = $row['goals_against']; + $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + if ($row['team_symbol'] <> '') + { + $logo = "\""" ; + } + else + { + $logo = "\"\"" ; + } + + $template->assign_block_vars('away', array( + 'RANK' => $current_rank, + 'ROW_CLASS' => $row_class, + 'LOGO' => $logo, + 'TEAM_ID' => $row['team_id'], + 'TEAM' => $row['team_name'], + 'TEAM_SHORT' => $row['team_name_short'], + 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], + 'tid' => $row['team_id'], 'mode' => 'away')), + 'GAMES' => $row['matches'], + 'WIN' => $row['win'], + 'DRAW' => $row['draw'], + 'LOST' => $row['lost'], + 'GOALS' => $row['goals'], + 'GOALS_AGAINST' => $row['goals_against'], + 'GOALS_DIFF' => $row['goals_diff'], + 'POINTS' => $row['points'], + ) + ); + } +} + +$db->sql_freeresult($result); +$sidename = sprintf($user->lang['TABLE']); +$template->assign_vars(array( + 'S_DISPLAY_TABLE' => true, + 'S_SIDENAME' => $sidename, + 'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'LEFT_LINK' => '< ' . sprintf($user->lang['RESULTS']), + 'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'RIGHT_LINK' => sprintf($user->lang['RANK_MATCHDAY']) . ' >', + 'LEFT_TITLE' => sprintf($user->lang['TITLE_RESULTS']), + 'RIGHT_TITLE' => sprintf($user->lang['TITLE_RANK_MATCHDAY']), + 'S_DATA_TABLE' => $data_table, + 'S_DATA_FORM' => $data_form, + 'SEASON' => $season, + 'LEAGUE' => $league, + 'TEXT_FORM' => $text_form, + ) +); + +?> \ No newline at end of file diff --git a/block/under_construction.php b/block/under_construction.php new file mode 100644 index 0000000..c3c866e --- /dev/null +++ b/block/under_construction.php @@ -0,0 +1,23 @@ +lang['UNDER_CONSTRUCTION']); +$template->assign_vars(array( + 'S_SIDENAME' => $sidename, + 'S_DISPLAY_UNDER_CONSTRUCTION' => true, + ) +); + +?> \ No newline at end of file diff --git a/block/viewplan_popup.php b/block/viewplan_popup.php new file mode 100644 index 0000000..f9525a1 --- /dev/null +++ b/block/viewplan_popup.php @@ -0,0 +1,297 @@ +data['user_id'] == ANONYMOUS) + { + trigger_error('NO_GUEST_VIEW'); + } +} +if (!$config['football_user_view']) +{ + // Only Prediction League member should see this page + // Check Prediction League authorisation + if ( !$this->auth->acl_get('u_use_football') ) + { + trigger_error('NO_AUTH_VIEW'); + } +} + +// Football disabled? +if ($config['football_disable']) +{ + $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; + trigger_error($message); +} + +$mode = $this->request->variable('mode', ''); +$season = $this->request->variable('s', 0); +$league = $this->request->variable('l', 0); +$team_id = $this->request->variable('tid', 0); + +switch($mode) +{ + case 'played': + $mode_desc = sprintf($user->lang['PLAYED_MATCHES']); + $where = ' AND m.status IN (3,6) '; + $data_results = true; + break; + case 'rest': + $mode_desc = sprintf($user->lang['REST_MATCHES']); + $where = ' AND m.status IN (0,1,2,4,5) '; + $data_results = false; + break; + case 'home': + $mode_desc = sprintf($user->lang['HOME_MATCHES']); + $where = " AND m.team_id_home = $team_id AND m.status IN (3,6) "; + $data_results = true; + break; + case 'away': + $mode_desc = sprintf($user->lang['AWAY_MATCHES']); + $where = " AND m.team_id_guest = $team_id AND m.status IN (3,6) "; + $data_results = true; + break; + // ALL is Default + default: + $mode_desc = sprintf($user->lang['ALL_MATCHES']); + $where = ''; + $data_results = true; + break; +} + +// Check parms +$error_message = ''; +if (!$season OR !$league OR !$team_id) +{ + $data_plan = false; + if (!$season) + { + $error_message .= sprintf($user->lang['NO_SEASON']) . '
'; + } + if (!$league) + { + $error_message .= sprintf($user->lang['NO_LEAGUE']) . '
'; + } + if (!$team_id) + { + $error_message .= sprintf($user->lang['NO_TEAM_ID']) . '
'; + } +} +else +{ + $data_group = false; + $lang_dates = $user->lang['datetime']; + + + // Calculate matches and bets of matchday + $sql = "SELECT + IF(m.team_id_home = $team_id, 'H', 'A') AS match_place, + IF(((m.status=3) OR (m.status=6)), + IF(m.team_id_home = $team_id, + IF(m.goals_home + 0 > m.goals_guest, 'match_win', IF(m.goals_home = m.goals_guest, 'match_draw', 'match_lost')), + IF(m.goals_home + 0 < m.goals_guest, 'match_win', IF(m.goals_home = m.goals_guest, 'match_draw', 'match_lost'))), + '') AS match_style, + m.match_no, + m.matchday, + m.status, + m.group_id, + t1.team_symbol AS home_symbol, + t2.team_symbol AS guest_symbol, + t1.team_id AS home_id, + t2.team_id AS guest_id, + t1.team_name AS home_name, + t2.team_name AS guest_name, + t1.team_name_short AS home_short, + t2.team_name_short AS guest_short, + m.goals_home, + m.goals_guest, + CONCAT( + CASE DATE_FORMAT(m.match_datetime,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i') + ) AS match_time + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id=m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id=m.team_id_guest) + WHERE m.season = $season + AND m.league = $league + AND (m.team_id_home = $team_id OR m.team_id_guest = $team_id) + $where + GROUP BY m.match_no + ORDER BY m.match_datetime ASC, m.match_no ASC"; + $result = $db->sql_query($sql); + if ($row = $db->sql_fetchrow($result)) + { + $data_plan = true; + $matchnumber = 0; + $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + do + { + $matchnumber++ ; + $row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; + $display_link = true; + $homelogo = $row['home_symbol']; + $guestlogo = $row['guest_symbol']; + if ($homelogo <> '') + { + $logoH = "\""" ; + } + else + { + $logoH = "\"\"" ; + } + if ($guestlogo <> '') + { + $logoG = "\""" ; + } + else + { + $logoG = "\"\"" ; + } + + if ($row['group_id'] == '') + { + $group_id = ' '; + } + else + { + $data_group = true; + $group_id = $row['group_id']; + } + + if ($row['match_place'] == 'H') + { + $color_home = $row['match_style']; + $color_guest = ''; + } + else + { + $color_home = ''; + $color_guest = $row['match_style']; + } + $color_goals = $row['match_style']; + + $template->assign_block_vars('match', array( + 'ROW_CLASS' => $row_class, + 'MATCH_TIME' => $row['match_time'], + 'GROUP' => $group_id, + 'LOGO_HOME' => $logoH, + 'LOGO_GUEST' => $logoG, + 'HOME_NAME' => $row['home_short'], + 'GUEST_NAME' => $row['guest_short'], + 'GOALS_HOME' => ($row['goals_home'] == '') ? ' ' : $row['goals_home'], + 'GOALS_GUEST' => ($row['goals_guest'] == '') ? ' ' : $row['goals_guest'], + 'COLOR_HOME' => $color_home, + 'COLOR_GUEST' => $color_guest, + 'COLOR_GOALS' => $color_goals, + ) + ); + } + while ($row = $db->sql_fetchrow($result)); + $db->sql_freeresult($result); + } + else + { + $data_plan = false; + } + + $season_info = season_info($season); + if (sizeof($season_info) == 0) + { + $error_message .= sprintf($user->lang['NO_SEASON']) . '
'; + $season_name = ''; + } + else + { + $season_name = $season_info["season_name"]; + + $league_info = league_info($season, $league); + if (sizeof($league_info) == 0) + { + $error_message .= sprintf($user->lang['NO_LEAGUE']) . '
'; + $league_name = ''; + + } + else + { + $league_name = $league_info["league_name"]; + + $team_info = team_info($season, $league, $team_id); + if (sizeof($team_info) == 0) + { + $error_message .= sprintf($user->lang['NO_TEAM_ID']) . '
'; + $team_name = ''; + $logo = ''; + } + else + { + $team_name = $team_info["team_name"]; + $logo = "\""" ; + } + } + } +} + +$sidename = sprintf($user->lang['PLAN']); +if ($data_plan) +{ + $template->assign_vars(array( + 'S_SIDENAME' => $sidename, + 'S_DATA_PLAN' => $data_plan, + 'S_DATA_GROUP' => $data_group, + 'S_ERROR_MESSAGE' => $error_message, + 'MODE_DESC' => $mode_desc, + 'LOGO' => $logo, + 'TEAM' => $team_name, + 'SEASON' => $season_name, + 'LEAGUE' => $league_name, + 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), + 'S_DATA_RESULTS' => $data_results, + ) + ); + + // output page + page_header($mode_desc . ' ' . $team_name); +} +else +{ + $template->assign_vars(array( + 'S_SIDENAME' => $sidename, + 'S_DATA_PLAN' => $data_plan, + 'S_DATA_GROUP' => false, + 'S_ERROR_MESSAGE' => $error_message, + 'MODE_DESC' => $mode_desc, + 'LOGO' => '', + 'TEAM' => '', + 'SEASON' => '', + 'LEAGUE' => '', + 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), + 'S_DATA_RESULTS' => false, + ) + ); + + // output page + page_header($mode_desc); +} +$template->set_filenames(array( + 'body' => 'viewplan_popup.html') +); + +page_footer(); + +?> \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..54884e3 --- /dev/null +++ b/composer.json @@ -0,0 +1,29 @@ +{ + "name": "football/football", + "type": "phpbb-extension", + "description": "Football Prediction League for phpBB 3.1", + "homepage": "http://football.bplaced.net", + "version": "0.9.5", + "time": "2016-04-22", + "license": "GPL-2.0", + "authors": [{ + "name": "J. Helmke", + "email": "phpBB3.football@gmx.de", + "homepage": "http://football.bplaced.net", + "role": "Lead Developer" + }], + "require": { + "php": ">=5.3.3" + }, + "extra": { + "display-name": "Football Prediction League", + "soft-require": { + "phpbb/phpbb": "3.1.*" + }, + "version-check": { + "host": "football.bplaced.net", + "directory": "/updatecheck", + "filename": "football_predictionleague.json" + } + } +} diff --git a/config/routing.yml b/config/routing.yml new file mode 100644 index 0000000..6dbfa2c --- /dev/null +++ b/config/routing.yml @@ -0,0 +1,20 @@ +football_main_controller: + path: /football/{side} + defaults: { _controller: football.football.controller:handle } + +football_football_popup: + path: /football/{popside} + defaults: { _controller: football.football.controller_popup:handlepopup } + +football_football_download: + path: /football/{downside} + defaults: { _controller: football.football.controller_download:handledownload } + +football_football_xml: + path: /football/xml/{xmlside} + defaults: { _controller: football.football.controller_xml:handlexml } + +# Redirect to football by default +football_football_redirect_controller: + path: / + defaults: { _controller: football.football.main:handle } diff --git a/config/services.yml b/config/services.yml new file mode 100644 index 0000000..ef09bde --- /dev/null +++ b/config/services.yml @@ -0,0 +1,114 @@ +parameters: + football.version_data: + author: football + title: Football Prediction League + version: football_version + file: + - football.bplaced.net + - /updatecheck + - football_predictionleague.json + +services: + football.football.controller: + class: football\football\controller\main + arguments: + - @auth + - @config + - @ext.manager + - @notification_manager + - @log + - @path_helper + - @dbal.conn + - @controller.helper + - @template + - @user + - @pagination + - %core.root_path% + - %core.php_ext% + + football.football.controller_popup: + class: football\football\controller\popup + arguments: + - @auth + - @config + - @ext.manager + - @path_helper + - @dbal.conn + - @controller.helper + - @template + - @user + - @pagination + - %core.root_path% + - %core.php_ext% + + football.football.controller_download: + class: football\football\controller\download + arguments: + - @auth + - @config + - @ext.manager + - @path_helper + - @dbal.conn + - @controller.helper + - @template + - @user + - %core.root_path% + - %core.php_ext% + + football.football.version.check: + class: football\football\includes\version_check + scope: prototype + arguments: + - %football.version_data% + - @config + - @version_helper + - @template + - @user + + football.football.controller_xml: + class: football\football\controller\xmlplan + arguments: + - @config + - @ext.manager + - @path_helper + - @dbal.conn + - @user + - %core.root_path% + - %core.php_ext% + + football.football.core.functions.points: + class: football\football\core\functions_points + arguments: + - @user + - @dbal.conn + + football.football.listener: + class: football\football\event\main_listener + arguments: + - @auth + - @config + - @controller.helper + - @template + - @path_helper + - @ext.manager + - @user + - %core.root_path% + - %core.php_ext% + tags: + - { name: event.listener } + + football.football.cron.task.football_remember: + class: football\football\cron\task\football_remember + arguments: + - %core.root_path% + - %core.php_ext% + - @ext.manager + - @path_helper + - @dbal.conn + - @config + - @log + - @user + calls: + - [set_name, [football.football.cron.task.football_remember]] + tags: + - { name: cron.task } diff --git a/controller/download.php b/controller/download.php new file mode 100644 index 0000000..c93fcc9 --- /dev/null +++ b/controller/download.php @@ -0,0 +1,160 @@ +auth = $auth; + $this->config = $config; + $this->db = $db; + $this->phpbb_extension_manager = $phpbb_extension_manager; + $this->phpbb_path_helper = $phpbb_path_helper; + $this->helper = $helper; + $this->template = $template; + $this->user = $user; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + + $this->football_includes_path = $phpbb_root_path . 'ext/football/football/includes/'; + $this->football_root_path = $phpbb_root_path . 'ext/football/football/'; + + } + + public function handledownload($downside) + { + global $db, $user, $cache, $request, $template, $season, $league, $matchday; + global $config, $phpbb_root_path, $phpbb_container, $phpEx, $league_info; + + define('IN_FOOTBALL', true); + + $this->db = $db; + $this->user = $user; + $this->cache = $cache; + $this->template = $template; + $this->config = $config; + $this->request = $request; + + // Add football controller language file + $this->user->add_lang_ext('football/football', 'football'); + + // required includes + include($this->football_includes_path . 'constants.' . $this->php_ext); + include($this->football_includes_path . 'functions.' . $this->php_ext); + + if ($config['board_disable'] && !$this->auth->acl_gets('a_')) + { + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + trigger_error($message); + } + + if ($config['football_disable']) + { + $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; + trigger_error($message); + exit; + } + + // Can this user view Prediction Leagues pages? + if (!$config['football_guest_view']) + { + // No guest view, call login for guest + if ($user->data['user_id'] == ANONYMOUS) + { + login_box('', ($user->lang['LOGIN_EXPLAIN_FOOTBALL'])); + } + } + if (!$config['football_user_view']) + { + // Only Prediction League member should see these pages + // Check Prediction League authorisation + if ( !$this->auth->acl_get('u_use_football') ) + { + trigger_error('NO_AUTH_VIEW'); + } + } + + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + + $league_info = array(); + $league_info = league_info($season, $league); + + if ($config['football_override_style']) + { + $user->data['user_style'] = $config['football_style']; + } + + include($this->football_root_path . 'block/' . $downside . '.' . $this->php_ext); + } +} diff --git a/controller/main.php b/controller/main.php new file mode 100644 index 0000000..dc7e085 --- /dev/null +++ b/controller/main.php @@ -0,0 +1,1008 @@ +auth = $auth; + $this->config = $config; + $this->db = $db; + $this->phpbb_extension_manager = $phpbb_extension_manager; + $this->notification_manager = $notification_manager; + $this->log = $log; + $this->phpbb_path_helper = $phpbb_path_helper; + $this->helper = $helper; + $this->template = $template; + $this->user = $user; + $this->pagination = $pagination; + $this->$phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + + $this->football_includes_path = $phpbb_root_path . 'ext/football/football/includes/'; + $this->football_root_path = $phpbb_root_path . 'ext/football/football/'; + + } + + public function handle($side) + { + global $db, $user, $cache, $request, $template, $season, $league, $matchday; + global $config, $phpbb_root_path, $phpbb_container, $log, $phpEx, $league_info; + global $mobile_device, $mobile_browser; + + define('IN_FOOTBALL', true); + + $this->cache = $cache; + $this->request = $request; + + // Add football controller language file + $this->user->add_lang_ext('football/football', 'football'); + + // required includes + include($this->football_includes_path . 'constants.' . $this->php_ext); + include($this->football_includes_path . 'functions.' . $this->php_ext); + + if ($config['board_disable'] && !$this->auth->acl_gets('a_')) + { + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + trigger_error($message); + } + + if ($config['football_disable']) + { + $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; + trigger_error($message); + exit; + } + + // Can this user view Prediction Leagues pages? + if (!$config['football_guest_view']) + { + // No guest view, call login for guest + if ($user->data['user_id'] == ANONYMOUS) + { + login_box('', ($user->lang['LOGIN_EXPLAIN_FOOTBALL'])); + } + } + if (!$config['football_user_view']) + { + // Only Prediction League member should see these pages + // Check Prediction League authorisation + if ( !$this->auth->acl_get('u_use_football') ) + { + trigger_error('NO_AUTH_VIEW'); + } + } + + // Display football information + $football_info = ''; + if ($config['football_info_display']) + { + $football_info = (!empty($config['football_info'])) ? $config['football_info'] : ''; + } + + $view = $this->request->variable('view', ''); + $action = $this->request->variable('action', ''); + + // Obtain parameters + // Obtain season + $season = $this->request->variable('s', 0); + if ($season || ($this->config['football_season_start'] == 0)) + { + // Check given season + $sql = 'SELECT * FROM ' . FOOTB_SEASONS . " WHERE season = $season"; + $result = $db->sql_query($sql); + if(!$row = $db->sql_fetchrow($result)) + { + $season = curr_season(); + } + $db->sql_freeresult($result); + } + else + { + $season = $this->config['football_season_start']; + } + $this->season = $season; + // End obtain season + + // Obtain league + $maxmatchday = 0; + $league_info = array(); + if ($season) + { + $league = $this->request->variable('l', 0); + if ($league) + { + // Check given league + $sql = 'SELECT * FROM ' . FOOTB_LEAGUES . " WHERE season = $season AND league = $league"; + $result = $db->sql_query($sql); + if(!$row = $db->sql_fetchrow($result)) + { + // Set starting league + if ($config['football_view_current']) + { + $league = current_league($season); + } + else + { + $league = first_league($season); + } + } + else + { + $league_info = $row; + } + $db->sql_freeresult($result); + } + else + { + if ($side <> 'bank') + { + // Set starting league + if ($config['football_view_current']) + { + $league = current_league($season); + } + else + { + $league = first_league($season); + } + } + } + } + else + { + $league = 0; + } + // End obtain league + + // Obtain selected user + $user_sel = $this->request->variable('u', 0); + if ($user_sel) + { + $link_user = '&u=' . $user_sel; + } + else + { + $link_user = ''; + } + // End obtain matchday + + //***************************************************************************** + // Close open matchdays + close_open_matchdays(); + + //***************************************************************************** + // Obtain matchday + if ($league) + { + // League information not set? + if (!sizeof($league_info)) + { + // Get league information for this league (required for select_points) + $league_info = league_info($season, $league); + } + $maxmatchday = $league_info['matchdays']; + $curr_matchday = curr_matchday($season, $league); + $matchday = $this->request->variable('m', $curr_matchday); + // If switched from another league with more matchdays + if(($matchday < 1) OR ($matchday > $maxmatchday)) + { + $matchday = $curr_matchday; + } + } + else + { + $curr_matchday = 0; + $matchday = 0; + } + // End obtain matchday + // End obtain parameters + $request->overwrite('s', $season); + $request->overwrite('l', $league); + $request->overwrite('m', $matchday); + + //***************************************************************************** + // Start execute the action + $dbmsg = ''; + switch($action) + { + case 'switch': + // Switch Style and write to user table + $sql_ary = array( + 'football_mobile' => (int) !$user->data['football_mobile'], + ); + $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE session_id = '" . $db->sql_escape($user->session_id) . "'"; + $db->sql_query($sql); + $user->data['football_mobile'] = (int) !$user->data['football_mobile']; + break; + case 'bet': + if ($user->data['user_id'] != ANONYMOUS or $config['server_name'] == 'football.bplaced.net') + { + $user_id = $user->data['user_id']; + $sql = 'SELECT * FROM ' . FOOTB_MATCHES . " WHERE season = $season AND league = $league AND matchday = $matchday AND status <= 0"; + $resultopen = $db->sql_query($sql); + + $rows = $db->sql_fetchrowset($resultopen); + + $count_matches = 0; + $count_updates = 0; + foreach ($rows as $row) + { + $match_no = $row['match_no']; + $goalsh = $this->request->variable('goalsh' . $match_no, 'nv'); + $goalsg = $this->request->variable('goalsg' . $match_no, 'nv'); + if ($goalsh != 'nv' AND $goalsg != 'nv') + { + if(($goalsh != '') AND ($goalsg != '')) + { + if(is_numeric($goalsh) AND is_numeric($goalsg) AND $goalsh >= 0 AND $goalsg >= 0) + { + if (0 == $count_matches) + { + $sameh = $goalsh; + $sameg = $goalsg; + $same = 1; + } + else + { + if ($goalsh != $sameh OR $goalsg != $sameg) + $same = 0; + } + $sql = 'SELECT * FROM ' . FOOTB_BETS . " WHERE season = $season AND league = $league AND match_no = $match_no and user_id = $user_id"; + $result = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + if(!$row2) + { + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'match_no' => (int) $match_no, + 'user_id' => (int) $user_id, + 'goals_home' => (int) $goalsh, + 'goals_guest' => (int) $goalsg, + 'bet_time' => time(), + ); + $sql = 'INSERT INTO ' . FOOTB_BETS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + $count_updates++; + } + else + { + if($row2['goals_home'] != $goalsh OR $row2['goals_guest'] != $goalsg) + { + $sql_ary = array( + 'goals_home' => (int) $goalsh, + 'goals_guest' => (int) $goalsg, + 'bet_time' => time(), + ); + $sql = 'UPDATE ' . FOOTB_BETS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND match_no = $match_no AND user_id = $user_id"; + $db->sql_query($sql); + $count_updates++; + } + } + $count_matches++; + $lastmatch_no = $match_no; + } + } + else + { + // Goals unset + $sql_ary = array( + 'goals_home' => '', + 'goals_guest' => '', + 'bet_time' => time(), + ); + $sql = 'UPDATE ' . FOOTB_BETS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND match_no = $match_no AND user_id = $user_id"; + $db->sql_query($sql); + } + } + } + if ($count_updates > 0) + { + if ($same AND ($count_matches > 6) AND $config['football_same_allowed'] == 0) + { + $sql_ary = array( + 'goals_home' => (int) $goalsh + 1, + 'bet_time' => time(), + ); + $sql = 'UPDATE ' . FOOTB_BETS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND match_no = $lastmatch_no and user_id = $user_id"; + $db->sql_query($sql); + $dbmsg = sprintf($user->lang['SAMESAVED'], $count_updates); + } + else + { + if ($count_updates == 1) + { + $dbmsg = sprintf($user->lang['BETSAVED']); + } + else + { + $dbmsg = sprintf($user->lang['BETSSAVED'], $count_updates); + } + } + } + else + { + $dbmsg = sprintf($user->lang['NO_BETS_SAVED']); + } + $db->sql_freeresult($resultopen); + + // extra bets + $sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND matchday = $matchday AND extra_status <= 0"; + $resultextra = $db->sql_query($sql); + $count_extra_updates = 0; + while( $row = $db->sql_fetchrow($resultextra)) + { + $extra_no = $row['extra_no']; + $extra_bet = $this->request->variable('extra' . $extra_no, 'nv'); + if ($extra_bet != 'nv') + { + if ($row['question_type'] == 5 && !is_numeric($extra_bet)) + { + $extra_bet = ''; + } + if ($extra_bet != '') + { + $sql = 'SELECT * FROM ' . FOOTB_EXTRA_BETS . " WHERE season = $season AND league = $league AND extra_no = $extra_no and user_id = $user_id"; + $result = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + if(!$row2) + { + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'extra_no' => (int) $extra_no, + 'user_id' => (int) $user_id, + 'bet' => $extra_bet, + 'bet_points' => 0, + ); + $sql = 'INSERT INTO ' . FOOTB_EXTRA_BETS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + else + { + $sql_ary = array( + 'bet' => $extra_bet, + ); + $sql = 'UPDATE ' . FOOTB_EXTRA_BETS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND extra_no = $extra_no AND user_id = $user_id"; + $db->sql_query($sql); + } + $count_extra_updates++; + } + else + { + // extra bet unset + $sql_ary = array( + 'bet' => '', + ); + $sql = 'UPDATE ' . FOOTB_EXTRA_BETS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND extra_no = $extra_no AND user_id = $user_id"; + $db->sql_query($sql); + } + } + } + if ($count_extra_updates) + { + $dbmsg = $dbmsg . ' ' . sprintf($user->lang['EXTRA_BET' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates); + } + } + break; + case 'result': + // Save results + $user_id = $user->data['user_id']; + $sqlmatches = 'SELECT * FROM ' . FOOTB_MATCHES . " WHERE season = $season AND league = $league AND matchday = $matchday"; + $resultmatches = $db->sql_query($sqlmatches); + $count_matches = 0; + $count_clear = 0; + $count_input = 0; + $count_null = 0; + while( $row = $db->sql_fetchrow($resultmatches)) + { + $count_matches++; + $match_no = $row['match_no']; + $status = $row['status']; + $this->request->variable('l', 0); + $goalsh = $this->request->variable('goalsh' . $match_no, 'nv'); + $goalsg = $this->request->variable('goalsg' . $match_no, 'nv'); + $oldgoalsh = $this->request->variable('oldgoalsh' . $match_no, 'nv'); + $oldgoalsg = $this->request->variable('oldgoalsg' . $match_no, 'nv'); + if ($goalsh != 'nv' AND $goalsg != 'nv') + { + // Both variables exists + // Read overtime goals + $goals_ko_h = $this->request->variable('goals_ko_h' . $match_no, 'nv'); + $goals_ko_g = $this->request->variable('goals_ko_g' . $match_no, 'nv'); + $oldgoals_ko_h = $this->request->variable('oldgoals_ko_h' . $match_no, 'nv'); + $oldgoals_ko_g = $this->request->variable('oldgoals_ko_g' . $match_no, 'nv'); + if (($status <> 3) && ($status <> 6)) + { + if(($goalsh != '') AND ($goalsg != '')) + { + // Goals set + // Set new match status + if ($status < 3) + $status = 2; + else + $status = 5; + if (is_numeric($goalsh) AND is_numeric($goalsg) AND $goalsh >= 0 AND $goalsg >= 0) + { + // Values + if(!is_numeric($goals_ko_h) OR !is_numeric($goals_ko_g) OR $goals_ko_h < 0 OR $goals_ko_g < 0) + { + // No overtime goals + if (($goalsh <> $oldgoalsh) OR ($goalsg <> $oldgoalsg)) + { + // Goals changed + $sql_ary = array( + 'goals_home' => (int) $goalsh, + 'goals_guest' => (int) $goalsg, + 'goals_overtime_home' => '', + 'goals_overtime_guest' => '', + 'status' => $status, + ); + $sql = 'UPDATE ' . FOOTB_MATCHES . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND match_no = $match_no"; + $db->sql_query($sql); + $count_input++; + } + } + else + { + // With overtime goals + if (($goalsh <> $oldgoalsh) OR ($goalsg <> $oldgoalsg) OR ($goals_ko_h <> $oldgoals_ko_h) OR ($goals_ko_g <> $oldgoals_ko_g)) + { + // Goals or overtime goals changed + $sql_ary = array( + 'goals_home' => (int) $goalsh, + 'goals_guest' => (int) $goalsg, + 'goals_overtime_home' => (int) $goals_ko_h, + 'goals_overtime_guest' => (int) $goals_ko_g, + 'status' => $status, + ); + $sql = 'UPDATE ' . FOOTB_MATCHES . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND match_no = $match_no"; + $db->sql_query($sql); + $count_input++; + } + } + } + } + else + { + // Goals unset + // Set new match status + if ($status < 3) + { + $status = 1; + } + else + { + $status = 4; + } + if (($goalsh <> $oldgoalsh) OR ($goalsg <> $oldgoalsg) OR ($goals_ko_h <> $oldgoals_ko_h) OR ($goals_ko_g <> $oldgoals_ko_g)) + { + // Goals or overtime goals unset + $sql_ary = array( + 'goals_home' => '', + 'goals_guest' => '', + 'goals_overtime_home' => '', + 'goals_overtime_guest' => '', + 'status' => $status, + ); + $sql = 'UPDATE ' . FOOTB_MATCHES . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND match_no = $match_no"; + $db->sql_query($sql); + $count_clear++; + } + $count_null++; + } + } + } + } + $db->sql_freeresult($resultmatches); + switch($count_input) + { + case '0': + { + $dbmsg = sprintf($user->lang['NO_RESULT_SAVE']); + } + break; + case '1': + { + $dbmsg = sprintf($user->lang['RESULT_SAVE'], $count_input); + } + break; + default: + { + $dbmsg = sprintf($user->lang['RESULTS_SAVE'], $count_input); + } + break; + } + switch($count_clear) + { + case '0': + { + } + break; + case '1': + { + $dbmsg .= sprintf($user->lang['RESULT_CLEARED'], $count_clear); + } + break; + default: + { + $dbmsg .= sprintf($user->lang['RESULTS_CLEARED'], $count_clear); + } + break; + } + + $sqlopen = 'SELECT * FROM ' . FOOTB_MATCHES . " WHERE season = $season AND league = $league AND matchday = $matchday AND status = 0"; + $resultopen = $db->sql_query($sqlopen); + $row = $db->sql_fetchrowset($resultopen); + $db->sql_freeresult($resultopen); + if (sizeof($row) == 0) + { + // No open matches, so we could set matchday status + if ($count_null == $count_matches) + { + $sql_ary = array( + 'status' => 1, + ); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday AND status < 3"; + $db->sql_query($sql); + } + else + { + $sql_ary = array( + 'status' => 2, + ); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday AND delivery_date_2 = '' AND status < 3"; + $db->sql_query($sql); + } + } + + // extra bets + $sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND matchday_eval = $matchday AND extra_status > 0"; + $resultextra = $db->sql_query($sql); + $count_extra_updates = 0; + while( $row = $db->sql_fetchrow($resultextra)) + { + $extra_no = $row['extra_no']; + $extra_results = $this->request->variable('extra' . $extra_no, array('nv')); + $extra_result = ''; + if (sizeof($extra_results) > 0) + { + foreach ($extra_results as $extra_selected_value) + { + $extra_result = ($extra_result == '') ? $extra_selected_value : $extra_result . ';' . $extra_selected_value; + } + } + else + { + $extra_result = $this->request->variable('extra' . $extra_no, 'nv'); + } + if ($extra_result != 'nv') + { + if ($row['question_type'] == 5 && !is_numeric($extra_result)) + { + $extra_result = ''; + } + if ($extra_result != '') + { + $sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND extra_no = $extra_no"; + $result = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + if($row2) + { + $sql_ary = array( + 'result' => $extra_result, + 'extra_status' => 2, + ); + $sql = 'UPDATE ' . FOOTB_EXTRA . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND extra_no = $extra_no"; + $db->sql_query($sql); + $count_extra_updates++; + } + } + else + { + // extra result unset + $sql_ary = array( + 'result' => '', + 'extra_status' => 1, + ); + $sql = 'UPDATE ' . FOOTB_EXTRA . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND extra_no = $extra_no"; + $db->sql_query($sql); + } + } + } + if ($count_extra_updates) + { + $dbmsg = $dbmsg . ' ' . sprintf($user->lang['EXTRA_RESULT' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates); + } + calculate_extra_points($season, $league, $matchday); + save_ranking_matchday($season, $league, $matchday); + break; + case 'join': + join_league($season, $league, $user->data['user_id']); + break; + default: + break; + } + + // End execute the action + //***************************************************************************** + + + // Start select season + $season_name = ''; + $sql = 'SELECT DISTINCT s.season, s.season_name, s.season_name_short FROM ' . FOOTB_SEASONS . ' AS s + INNER JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season) + INNER JOIN ' . FOOTB_MATCHDAYS . ' AS sp ON (sp.season = s.season AND sp.league = l.league) + WHERE 1 + ORDER BY season DESC'; + $result = $db->sql_query($sql); + while( $row = $db->sql_fetchrow($result)) + { + $selected = ($season && $row['season'] == $season) ? ' selected="selected"' : ''; + if ($selected) + { + $season_name = htmlspecialchars($row['season_name_short']); + } + $template->assign_block_vars('form_season', array( + 'S_SEASON' => htmlspecialchars($row['season']), + 'S_SEASONNAME' => htmlspecialchars($row['season_name_short']), + 'S_SELECTED' => $selected)); + } + $db->sql_freeresult($result); + + // End select season + + //***************************************************************************** + + // Start select league + if ($side == 'bank') + { + $template->assign_block_vars('form_league', array( + 'S_LEAGUE' => 0, + 'S_LEAGUENAME' => sprintf($user->lang['ALL_LEAGUES']), + 'S_SELECTED' => $league == 0 ? ' selected="selected"' : '' + ) + ); + } + + $league_name = ''; + $sql = 'SELECT * FROM ' . FOOTB_LEAGUES . " WHERE season = $season AND league_type >= 1"; + $result = $db->sql_query($sql); + while( $row = $db->sql_fetchrow($result)) + { + $selected = ($league && $row['league'] == $league) ? ' selected="selected"' : ''; + if ($selected) + { + $league_name = $row['league_name']; + } + $template->assign_block_vars('form_league', array( + 'S_LEAGUE' => $row['league'], + 'S_LEAGUENAME' => $row['league_name'], + 'S_SELECTED' => $selected + ) + ); + } + $db->sql_freeresult($result); + + // End select League + + //***************************************************************************** + // For nav_delivery + $prev_deadline = ''; + $prev_link = ''; + $prev_class = ''; + $next_deadline = ''; + $next_link = ''; + $next_class = ''; + $current_matchday = ''; + + // Start select matchday + $matchdayname = ''; + $matchday_name = ''; + $status = 0; + $sql = 'SELECT * FROM ' . FOOTB_LEAGUES . " WHERE season = $season AND league = $league"; + $result = $db->sql_query($sql); + if( $row = $db->sql_fetchrow($result)) + { + $count_matchdays = $row['matchdays']; + $league_type = $row['league_type']; + $db->sql_freeresult($result); + $lang_dates = $user->lang['datetime']; + $local_board_time = time() + (($config['board_timezone'] - $config['football_host_timezone']) * 3600); + $sql = "SELECT *, + CONCAT( + CASE DATE_FORMAT(delivery_date,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(delivery_date,' %d.%m.%y %H:%i') + ) as deliverytime, + IF(delivery_date < FROM_UNIXTIME('$local_board_time'),'pastlink','futurelink') AS linkclass + FROM " . FOOTB_MATCHDAYS . " WHERE season = $season AND league = $league AND matchday <= $count_matchdays + ORDER BY matchday ASC"; + $result = $db->sql_query($sql); + $status = 3; + while ($row = $db->sql_fetchrow($result)) + { + if ($league_type == 1 and $row['matchday_name'] == '') + { + $matchdayname = $row['matchday'] . '.' . sprintf($user->lang['MATCHDAY']); + } + else + { + $matchdayname = $row['matchday_name']; + } + if ($matchdayname == '') + { + $matchdayname = $row['matchday'] . '.' . sprintf($user->lang['MATCHDAY']); + } + + $selected = ($matchday && $row['matchday'] == $matchday) ? ' selected="selected"' : ''; + if ($selected) + { + $matchday_name = $matchdayname; + $status = $row['status']; + } + + if (($matchday - 1) == $row['matchday']) + { + $prev_deadline = $row['deliverytime']; + $prev_link = append_sid($side,"s=$season&l=$league&m=" . $row['matchday'] . $link_user); + $prev_class = $row['linkclass']; + } + + if (($matchday + 1) == $row['matchday']) + { + $next_deadline = $row['deliverytime']; + $next_link = append_sid($side,"s=$season&l=$league&m=" . $row['matchday'] . $link_user); + $next_class = $row['linkclass']; + } + + + if ($curr_matchday == $row['matchday']) + { + $current = '*'; + } + else + { + $current = ''; + } + + $template->assign_block_vars('form_matchday', array( + 'S_MATCHDAY' => $row['matchday'], + 'S_MATCHDAYNAME' => $matchdayname, + 'S_SELECTED' => $selected, + 'S_CURRENT' => $current)); + } + $db->sql_freeresult($result); + } + // End select matchday + + $select_menu_options = ''; + if (!$user->data['football_mobile']) + { + // Start matchday list + include($this->football_root_path . 'block/rank_matchday.' . $this->php_ext); + // End matchday list + + //***************************************************************************** + + // Start total list + include($this->football_root_path . 'block/rank_total.' . $this->php_ext); + // End total list + + //***************************************************************************** + + // Start delivery list + include($this->football_root_path . 'block/delivery.' . $this->php_ext); + // End delivery list + + //***************************************************************************** + } + // Start assign vars + $sql_ary = array( + 'football_season' => (int) $season, + 'football_league' => (int) $league, + 'football_matchday' => (int) $matchday, + ); + + $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE session_id = '" . $db->sql_escape($user->session_id) . "'"; + $result = $db->sql_query($sql); + + $db->sql_freeresult($result); + $u_footb_parm = "s=$season&l=$league&m=$matchday"; + $u_footb_sl = "s=$season&l=$league"; + $start = $this->request->variable('start', 0); + $print_start = ($start) ? "start=$start&" : ''; + + $template->assign_vars(array( + 'U_PRINT_FOOTBALL' => $this->helper->route('football_main_controller', array('side' => $side, 's' => $season, 'l' => $league, 'm' => $matchday, 'view' => 'print')), + 'U_MOBILE_SWITCH' => $this->helper->route('football_main_controller', array('side' => $side, 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'switch')), + 'U_SIDE_LINK' => $this->helper->route('football_main_controller', array('side' => $side, 's' => $season, 'l' => $league, 'm' => $matchday)), + 'L_TOP_RANKSP' => sprintf($user->lang['RANKING']) . ' ' . $matchday . '. ' . sprintf($user->lang['MATCHDAY']), + 'L_TOP_RANKGESAMT' => sprintf($user->lang['TOTAL_RANKING']) . ' ' . $matchday . '. ' . sprintf($user->lang['MATCHDAY']), + 'PHPBB_ROOT_PATH' => $this->phpbb_root_path, + 'EXT_PATH_IMAGES' => $this->football_root_path . 'images/', + 'S_FOOTBALL_MOBILE' => $user->data['football_mobile'], + 'S_FOOTBALL_INFO' => $football_info, + 'S_FOOTBALL_BANK' => $config['football_bank'], + 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $this->football_root_path . 'football/'), + 'S_FOOTBALL_FULLSCREEN' => $config['football_fullscreen'], + 'S_VIEW' => $view, + 'S_SIDE' => $side, + 'S_SEASON' => $season, + 'S_LEAGUE' => $league, + 'S_MATCHDAY' => $matchday, + 'S_USER_SEL' => $user_sel, + 'S_SEASON_NAME' => $season_name, + 'S_LEAGUE_NAME' => $league_name, + 'S_MATCHDAY_NAME' => $matchday_name, + 'S_FORMSELF' => $this->helper->route('football_main_controller', array('side' => $side)), + 'S_DELIVERY' => delivery($season, $league, $matchday), + // For nav_delivery + 'S_PREV_LINK' => $prev_link, + 'S_PREV_CLASS' => $prev_class, + 'S_PREV_DEADLINE' => $prev_deadline, + 'S_CURR_LINK' => $this->helper->route('football_main_controller', array('side' => $side, 's' => $season, 'l' => $league)), + 'S_CURR_MATCHDAY' => $curr_matchday, + 'S_NEXT_LINK' => $next_link, + 'S_NEXT_CLASS' => $next_class, + 'S_NEXT_DEADLINE' => $next_deadline, + 'S_DBMSG' => $dbmsg, + 'FOOTBALL_LEFT_COLUMN' => $config['football_left_column_width'], + 'FOOTBALL_RIGHT_COLUMN' => $config['football_right_column_width'], + + )); + // End assign vars + + //***************************************************************************** + if (!$matchday and $side <> 'bank') + { + include($this->football_root_path . 'block/under_construction.' . $this->php_ext); + } + else + { + include($this->football_root_path . 'block/' . $side . '.' . $this->php_ext); + } + + if ($user->data['football_mobile']) + { + $mobile = 'mobile_'; + } + else + { + $mobile = ''; + include($this->football_root_path . 'block/last_users.' . $this->php_ext); + } + // Send data to the template file + if ($view == 'print') + { + return $this->helper->render($mobile . 'football_print.html', $this->user->lang['PREDICTION_LEAGUE']); + } + else + { + return $this->helper->render($mobile . 'football_body.html', $this->user->lang['PREDICTION_LEAGUE']); + } + } +} diff --git a/controller/popup.php b/controller/popup.php new file mode 100644 index 0000000..03077d0 --- /dev/null +++ b/controller/popup.php @@ -0,0 +1,170 @@ +auth = $auth; + $this->config = $config; + $this->db = $db; + $this->phpbb_extension_manager = $phpbb_extension_manager; + $this->phpbb_path_helper = $phpbb_path_helper; + $this->helper = $helper; + $this->template = $template; + $this->user = $user; + $this->pagination = $pagination; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + + $this->football_includes_path = $phpbb_root_path . 'ext/football/football/includes/'; + $this->football_root_path = $phpbb_root_path . 'ext/football/football/'; + + } + + public function handlepopup($popside) + { + global $db, $user, $cache, $request, $template, $season, $league, $matchday; + global $config, $phpbb_root_path, $phpbb_container, $phpEx, $league_info; + + define('IN_FOOTBALL', true); + + $this->db = $db; + $this->user = $user; + $this->cache = $cache; + $this->template = $template; + $this->config = $config; + $this->request = $request; + + // Add football controller language file + $this->user->add_lang_ext('football/football', 'football'); + + // required includes + include($this->football_includes_path . 'constants.' . $this->php_ext); + include($this->football_includes_path . 'functions.' . $this->php_ext); + + if ($config['board_disable'] && !$this->auth->acl_gets('a_')) + { + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + trigger_error($message); + } + + if ($config['football_disable']) + { + $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; + trigger_error($message); + exit; + } + + // Can this user view Prediction Leagues pages? + if (!$config['football_guest_view']) + { + // No guest view, call login for guest + if ($user->data['user_id'] == ANONYMOUS) + { + login_box('', ($user->lang['LOGIN_EXPLAIN_FOOTBALL'])); + } + } + if (!$config['football_user_view']) + { + // Only Prediction League member should see these pages + // Check Prediction League authorisation + if ( !$this->auth->acl_get('u_use_football') ) + { + trigger_error('NO_AUTH_VIEW'); + } + } + + $season = $this->request->variable('s', 0); + $league = $this->request->variable('l', 0); + $matchday = $this->request->variable('m', $curr_matchday); + $league_info = array(); + $league_info = league_info($season, $league); + + if ($config['football_override_style']) + { + $user->data['user_style'] = $config['football_style']; + } + + include($this->football_root_path . 'block/' . $popside . '.' . $this->php_ext); + + + // Send data to the template file + return $this->helper->render($popside . '.html', $this->user->lang['PREDICTION_LEAGUE']); + } +} diff --git a/controller/xmlplan.php b/controller/xmlplan.php new file mode 100644 index 0000000..af56627 --- /dev/null +++ b/controller/xmlplan.php @@ -0,0 +1,114 @@ +config = $config; + $this->phpbb_extension_manager = $phpbb_extension_manager; + $this->phpbb_path_helper = $phpbb_path_helper; + $this->db = $db; + $this->user = $user; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + + $this->football_includes_path = $phpbb_root_path . 'ext/football/football/includes/'; + $this->football_root_path = $phpbb_root_path . 'ext/football/football/'; + } + + public function handlexml($xmlside) + { + global $db, $user, $cache, $request, $season, $league, $football_root_path; + global $config, $phpbb_root_path, $phpEx, $table_prefix, $ext_path; + + define('IN_FOOTBALL', true); + + $this->db = $db; + $this->user = $user; + $this->cache = $cache; + $this->config = $config; + $this->request = $request; + $football_root_path = $phpbb_root_path . 'ext/football/football/'; + $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + + // Add football controller language file + $this->user->add_lang_ext('football/football', 'info_acp_update'); + + // required includes + include($this->football_includes_path . 'constants.' . $this->php_ext); + include($this->football_includes_path . 'functions.' . $this->php_ext); + + if ($config['board_disable']) + { + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + trigger_error($message); + } + + if ($config['football_disable']) + { + $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; + trigger_error($message); + exit; + } + + + include($this->football_root_path . 'xml/' . $xmlside . '.' . $this->php_ext); + } +} diff --git a/core/functions_points.php b/core/functions_points.php new file mode 100644 index 0000000..d545273 --- /dev/null +++ b/core/functions_points.php @@ -0,0 +1,130 @@ +user = $user; + $this->db = $db; + } + + /** + * Add points to user + */ + function add_points($user_id, $amount) + { + // Select users current points + $sql_array = array( + 'SELECT' => 'user_points', + 'FROM' => array( + USERS_TABLE => 'u', + ), + 'WHERE' => 'user_id = ' . (int) $user_id, + ); + $sql = $this->db->sql_build_query('SELECT', $sql_array); + $result = $this->db->sql_query($sql); + $user_points = $this->db->sql_fetchfield('user_points'); + $this->db->sql_freeresult($result); + + // Add the points + $data = array( + 'user_points' => $user_points + $amount + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $data) . ' + WHERE user_id = ' . (int) $user_id; + $this->db->sql_query($sql); + + return; + } + + /** + * Substract points from user + */ + function substract_points($user_id, $amount) + { + // Select users current points + $sql_array = array( + 'SELECT' => 'user_points', + 'FROM' => array( + USERS_TABLE => 'u', + ), + 'WHERE' => 'user_id = ' . (int) $user_id, + ); + $sql = $this->db->sql_build_query('SELECT', $sql_array); + $result = $this->db->sql_query($sql); + $user_points = $this->db->sql_fetchfield('user_points'); + $this->db->sql_freeresult($result); + + // Update the points + $data = array( + 'user_points' => $user_points - $amount + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $data) . ' + WHERE user_id = ' . (int) $user_id; + $this->db->sql_query($sql); + + return; + } + + /** + * Set the amount of points to user + */ + function set_points($user_id, $amount) + { + // Set users new points + $data = array( + 'user_points' => $amount + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $data) . ' + WHERE user_id = ' . (int) $user_id; + $this->db->sql_query($sql); + + return; + } + + + /** + * Preformat numbers + */ + function number_format_points($num) + { + $decimals = 2; + + return number_format($num, $decimals, $this->user->lang['FOOTBALL_SEPARATOR_DECIMAL'], $this->user->lang['FOOTBALL_SEPARATOR_THOUSANDS']); + } + +} diff --git a/cron/task/football_remember.php b/cron/task/football_remember.php new file mode 100644 index 0000000..8c8837d --- /dev/null +++ b/cron/task/football_remember.php @@ -0,0 +1,325 @@ +root_path = $root_path; + $this->php_ext = $php_ext; + $this->phpbb_extension_manager = $phpbb_extension_manager; + $this->phpbb_path_helper = $phpbb_path_helper; + $this->db = $db; + $this->config = $config; + $this->phpbb_log = $log; + $this->user = $user; + } + + /** + * Runs this cron task. + * + * @return null + */ + public function run() + { + global $request; + + $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + include($ext_path . 'includes/functions.' . $this->php_ext); + include($ext_path . 'includes/constants.' . $this->php_ext); + + // Load extension language file + $this->user->add_lang_ext('football/football', 'info_acp_football'); + + // mode=test ? + $mode = $request->variable('mode', ''); + $days = $request->variable('days', 0); + + //Mail Settings + $use_queue = false; + $used_method = NOTIFY_EMAIL; + $priority = MAIL_NORMAL_PRIORITY; + + + $season = curr_season(); + //Matchdays to close in 24 hours and 24 hours later + $local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600); + // shift days to test + $local_board_time = $local_board_time + ($days * 86400); + + if ($mode <> 'test') + { + // Update next run + $run_time = getdate($this->config['football_remember_next_run']); + $next_run = mktime($run_time['hours'], $run_time['minutes'], 0, date("n"), date("j") + 1, date("Y")); + $this->config->set('football_remember_next_run', $next_run, true); + } + else + { + $message = sprintf($this->user->lang['LOG_FOOTBALL_MSG_TEST' . (($days == 0) ? '' : '_TRAVEL')], date("d.m.Y H:i", $local_board_time)); + $this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON_TEST', false, array($message)); + } + + $sql = 'SELECT + m.*, + l.* + FROM ' . FOOTB_MATCHDAYS . ' AS m + LEFT JOIN ' . FOOTB_LEAGUES . " AS l ON (l.season = m.season AND l.league = m.league) + WHERE m.season >= $season AND m.status = 0 + AND (DATE_SUB(m.delivery_date, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time')) + AND (DATE_SUB(m.delivery_date, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time'))"; + $result = $this->db->sql_query($sql); + $toclose = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + // If we found matchdays to close, search missing bets and mail them + foreach ($toclose as $close) + { + // prepare some variables + $first_mail = true; + $season = $close['season']; + $league = $close['league']; + $league_name = $close['league_name']; + $league_short = $close['league_name_short']; + $delivery = $close['delivery_date']; + $matchday = $close['matchday']; + $subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_SUBJECT'], $league_short, $matchday); + $usernames = ''; + + // find missing users + $sql = 'SELECT + u.user_email AS user_email, + u.username AS username, + u.user_id AS userid, + u.user_lang + FROM ' . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id + LEFT JOIN ' . USERS_TABLE. " AS u ON u.user_id = b.user_id + WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday + AND ((b.goals_home = '') OR (b.goals_guest = '')) + AND m.status = 0 AND p.pf_footb_rem_f = 1 + GROUP BY b.user_id + UNION + SELECT + p.pf_footb_email AS user_email, + u.username AS username, + u.user_id AS userid, + u.user_lang + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id + LEFT JOIN ' . USERS_TABLE. " AS u ON u.user_id = b.user_id + WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday + AND ((b.goals_home = '') OR (b.goals_guest = '')) + AND m.status = 0 AND p.pf_footb_rem_s = 1 + GROUP BY b.user_id + "; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + + if (!$row) + { + $this->db->sql_freeresult($result); + } + else + { + + // Send the messages + include_once($this->root_path . 'includes/functions_messenger.' . $this->php_ext); + $messenger = new \messenger($use_queue); + include_once($this->root_path . 'includes/functions_user.' . $this->php_ext); + $errored = false; + $messenger->headers('X-AntiAbuse: Board servername - ' . $this->config['server_name']); + $messenger->headers('X-AntiAbuse: User_id - ' . ANONYMOUS); + $messenger->headers('X-AntiAbuse: Username - CRON TASK Football remember'); + $messenger->headers('X-AntiAbuse: User IP - ' . $this->user->ip); + $messenger->subject(htmlspecialchars_decode($subject)); + $messenger->set_mail_priority($priority); + + do + { + // Send the messages + $used_lang = $row['user_lang']; + $mail_template_path = $ext_path . 'language/' . $used_lang . '/email/'; + + if ($mode <> 'test') + { + $messenger->to($row['user_email'], $row['username']); + } + else + { + // test send to board email + $messenger->to($this->config['board_email'], $this->config['sitename']); + } + $messenger->template('footb_send_remember', $used_lang, $mail_template_path); + + $messenger->assign_vars(array( + 'USERNAME' => $row['username'], + 'LEAGUE' => $league_name, + 'MATCHDAY' => $matchday, + 'DELIVERY' => $delivery, + 'CONTACT_EMAIL' => $this->config['board_contact']) + ); + + if ($mode <> 'test') + { + if (!($messenger->send($used_method))) + { + $message = '' . sprintf($this->user->lang['FOOTBALL_REMEMBER_ERROR_EMAIL'], $league_short, $row['user_email']) . ''; + $this->phpbb_log->add('critical', ANONYMOUS, '', 'LOG_ERROR_EMAIL', false, array($message)); + $usernames .= (($usernames != '') ? ', ' : '') . $row['username']. '!'; + } + else + { + $usernames .= (($usernames != '') ? ', ' : '') . $row['username']; + } + } + else + { + // Test mode + if ($first_mail) + { + // only send one mail + if (!($messenger->send($used_method))) + { + $message = '' . sprintf($this->user->lang['FOOTBALL_REMEMBER_ERROR_EMAIL'], $league_short, $row['user_email']) . ''; + $this->phpbb_log->add('critical', ANONYMOUS, '', 'LOG_ERROR_EMAIL', false, array($message)); + $usernames .= (($usernames != '') ? ', ' : '') . $row['username']. '!'; + } + else + { + $usernames .= (($usernames != '') ? ', ' : '') . $row['username']; + } + $first_mail = false; + } + else + { + $usernames .= (($usernames != '') ? ', ' : '') . $row['username']; + } + } + } + while ($row = $this->db->sql_fetchrow($result)); + $this->db->sql_freeresult($result); + + // Only if mails have already been sent previously + if ($usernames <> '') + { + // send mail to board administration + $used_lang = $this->config['default_lang']; + $mail_template_path = $ext_path . 'language/' . $used_lang . '/email/'; + $subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_SUBJECT_BOARD'], $league_short, $matchday); + $messenger->to($this->config['board_email'], $this->config['sitename']); + $messenger->subject(htmlspecialchars_decode($subject)); + $messenger->template('footb_board_remember', $used_lang, $mail_template_path); + $messenger->assign_vars(array( + 'CONTACT_EMAIL' => $this->config['board_contact'], + 'REMEMBER_LIST' => $usernames, + ) + ); + + if (!($messenger->send($used_method))) + { + $message = '' . sprintf($this->user->lang['FOOTBALL_REMEMBER_ERROR_EMAIL_BOARD'], $league_short, $this->config['board_email']) . ''; + $this->phpbb_log->add('critical', ANONYMOUS, '', 'LOG_ERROR_EMAIL', false, array($message)); + } + else + { + $log_subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_SEND'], $league_short, $usernames) ; + $this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON', false, array($log_subject)); + } + } + else + { + // Log the cronjob run + $log_subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_NOBODY']) ; + $this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON', false, array($log_subject)); + } + } + } + if (sizeof($toclose) == 0) + { + // Log the cronjob run + $log_subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_NO_DELIVERY']) ; + $this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON', false, array($log_subject)); + } + + return; + } + + /** + * Returns whether this cron task can run, given current board configuration. + * + * @return bool + */ + public function is_runnable() + { + return (bool) $this->config['football_remember_enable']; + } + + /** + * Returns whether this cron task should run now, because next run time + * has passed. + * + * @return bool + */ + public function should_run() + { + global $request; + $mode = $request->variable('mode', ''); + + if ($mode <> 'test') + { + return $this->config['football_remember_next_run'] < time(); + } + else + { + return true; + } + } +} +?> \ No newline at end of file diff --git a/event/main_listener.php b/event/main_listener.php new file mode 100644 index 0000000..ec81a3d --- /dev/null +++ b/event/main_listener.php @@ -0,0 +1,551 @@ +auth = $auth; + $this->config = $config; + $this->controller_helper = $helper; + $this->template = $template; + $this->phpbb_path_helper = $path_helper; + $this->phpbb_extension_manager = $phpbb_extension_manager; + $this->user = $user; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + +// include($path_helper->update_web_root_path($phpbb_extension_manager->get_extension_path('football/football', true)) . 'includes/constants.' . $php_ext); + } + + /** + * Assign functions defined in this class to event listeners in the core + * + * @return array + */ + static public function getSubscribedEvents() + { + return array( + 'core.viewonline_overwrite_location' => 'viewonline_page', + 'core.user_setup' => 'load_language_on_setup', + 'core.page_header' => 'add_football_links', + 'core.session_kill_after' => 'detect_mobile_device', + 'core.session_create_after' => 'detect_mobile_device', + 'core.permissions' => 'add_permission_cat', + ); + } + + /** + * Show users as viewing the football prediction league on Who Is Online page + * + * @param object $event The event object + * @return null + */ + public function viewonline_page($event) + { + global $db; + if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/football') === 0) + { + $action = substr($event['row']['session_page'], 17); + $url_parts = $this->phpbb_path_helper->get_url_parts($action, false); + $params = (isset($url_parts['params'])) ? $url_parts['params'] : array(); + if (isset($params['l']) and isset($params['s'])) + { + include_once($this->phpbb_root_path . 'ext/football/football/includes/constants.' . $this->php_ext); + $season = $params['s']; + $league =$params['l']; + $sql = 'SELECT league_name FROM ' . FOOTB_LEAGUES . " + WHERE season = $season AND league = $league + "; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $event['location'] = $this->user->lang('VIEWING_LEAGUE' . (empty($url_parts['base']) ? '' : '_' . strtoupper ($url_parts['base'])), $row['league_name']); + } + else + { + $event['location_url'] = $this->controller_helper->route('football_main_controller', array_merge(array('side' => $url_parts['base']), $url_parts['params'])); + } + $db->sql_freeresult($result); + } + else + { + $event['location'] = $this->user->lang('VIEWING_FOOTBALL' . (empty($url_parts['base']) ? '' : '_' . strtoupper ($url_parts['base']))); + } + $event['location_url'] = $this->controller_helper->route('football_main_controller', array_merge(array('side' => $url_parts['base']), $url_parts['params'])); + } + } + + /** + * Load football prediction league language during user setup + * + * @param object $event The event object + * @return null + */ + public function load_language_on_setup($event) + { + $lang_set_ext = $event['lang_set_ext']; + $lang_set_ext[] = array( + 'ext_name' => 'football/football', + 'lang_set' => 'football', + ); + if (defined('ADMIN_START')) + { + $lang_set_ext[] = array( + 'ext_name' => 'football/football', + 'lang_set' => 'permissions_football', + ); + } + $event['lang_set_ext'] = $lang_set_ext; + } + + /** + * Add football links if user is authed to see it + * + * @return null + */ + public function add_football_links($event) + { + global $request, $cache, $season, $league, $matchday; + + $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); + if (!$this->has_football_access()) + { + return; + } + + if (isset($this->config['football_side']) && $this->config['football_side'] && !$this->user->data['football_mobile']) + { + if (!($wrapped_football_name = $cache->get('wrapped_football_name'))) + { + $wrapped_football_name = ''; + $string = utf8_decode($this->config['football_name']); + for($i = 0; $i < strlen($string); $i++) + { + $wrapped_football_name .= strtoupper($string[$i]) . '
'; + } + $wrapped_football_name = utf8_encode($wrapped_football_name); + $cache->put($wrapped_football_name, $wrapped_football_name); + } + + $this->template->assign_vars(array( + 'S_FOOTBALLSIDE' => $wrapped_football_name, + 'S_FOOTBALL_SIDE' => true, + )); + } + + + $football_season = (empty($this->user->data['football_season'])) ? 0 : $this->user->data['football_season']; + $football_league = (empty($this->user->data['football_league'])) ? 0 : $this->user->data['football_league']; + $football_matchday = (empty($this->user->data['football_matchday'])) ? 0 : $this->user->data['football_matchday']; + + $season = $request->variable('s', $football_season); + $league = $request->variable('l', $football_league); + $matchday = $request->variable('m', $football_matchday); + + $in_football_ext = (!defined('IN_FOOTBALL')) ? false : IN_FOOTBALL; + + $this->template->assign_vars(array( + 'S_DISPLAY_FOOTBALL_MENU' => $this->config['football_menu'], + 'S_FOOTBALL_BREADCRUMB' => $this->config['football_breadcrumb'], + 'S_FOOTBALL_NAME' => $this->config['football_name'], + 'S_FOOTBALL_HEADER_LEAGUE' => $league, + 'S_FOOTBALL_EXT_PATH' => $ext_path, + 'S_FOOTBALL_HEADER_ENABLED' => $this->config['football_header_enable'] ? $in_football_ext : false, + 'U_FOOTBALL' => $this->controller_helper->route('football_main_controller', array('side' => 'bet')), + 'U_BET' => $this->controller_helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_ALL_BETS' => $this->controller_helper->route('football_main_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_RESULTS' => $this->controller_helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_TABLE' => $this->controller_helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_RANKS_TOTAL' => $this->controller_helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_RANKS_MATCHDAY' => $this->controller_helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_DELIVERY_LIST' => $this->controller_helper->route('football_main_controller', array('side' => 'delivery', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_LAST_VISITORS' => $this->controller_helper->route('football_main_controller', array('side' => 'last_users', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_FOOTBALL_BANK' => $this->controller_helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_RULES' => $this->controller_helper->route('football_football_popup', array('popside' => 'rules_popup', 's' => $season, 'l' => $league)), + 'U_EXPORT' => $this->controller_helper->route('football_football_download', array('downside' => 'dload_export', 's' => $season, 'l' => $league)), + 'U_ODDS' => $this->controller_helper->route('football_main_controller', array('side' => 'odds', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'S_MENU_LINK1' => (strlen($this->config['football_menu_link1']) > 4) ? true : false, + 'U_MENU_LINK1' => $this->config['football_menu_link1'], + 'MENU_DESC_LINK1' => $this->config['football_menu_desc1'], + 'S_MENU_LINK2' => (strlen($this->config['football_menu_link2']) > 4) ? true : false, + 'U_MENU_LINK2' => $this->config['football_menu_link2'], + 'MENU_DESC_LINK2' => $this->config['football_menu_desc2'], + 'S_MENU_LINK3' => (strlen($this->config['football_menu_link3']) > 4) ? true : false, + 'U_MENU_LINK3' => (strpos($this->config['football_menu_link3'], 'xml/league.php') === false) ? $this->config['football_menu_link3'] : $this->config['football_menu_link3'] . "&season=$season&league=$league", + 'MENU_DESC_LINK3' => $this->config['football_menu_desc3'], + 'U_MY_BETS' => $this->controller_helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_MY_POINTS' => $this->controller_helper->route('football_main_controller', array('side' => 'my_points', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_MY_TABLE' => $this->controller_helper->route('football_main_controller', array('side' => 'my_table', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_MY_RANK' => $this->controller_helper->route('football_main_controller', array('side' => 'my_rank', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_MY_CHART' => $this->controller_helper->route('football_main_controller', array('side' => 'my_chart', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_MY_KOEFF' => $this->controller_helper->route('football_main_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_STAT_RESULTS' => $this->controller_helper->route('football_main_controller', array('side' => 'stat_results', 's' => $season, 'l' => $league, 'm' => $matchday)), + 'U_STAT_POINTS' => $this->controller_helper->route('football_main_controller', array('side' => 'stat_points', 's' => $season, 'l' => $league, 'm' => $matchday)), + )); + } + + /** + * Detect mobile devices + * + * @return null + */ + public function detect_mobile_device() + { + global $db, $request, $mobile_device, $mobile; + + $mobile = false; + $user_agent = $request->server('HTTP_USER_AGENT'); + if ($this->user->data['football_mobile_device'] == '') + { + switch(true) + { + /** Remove Bots from the list */ + case (preg_match('/bot|yahoo|Java|httpget/i', $user_agent)); + $mobile = false; + break; + case (preg_match('/ipad/i', $user_agent)); + $mobile_device = 'iPad'; + $mobile = true; + break; + case (preg_match('/ipod/i', $user_agent)); + $mobile_device = 'iPod'; + $mobile = true; + break; + case (preg_match('/iphone/i', $user_agent)); + $mobile_device = 'iPhone'; + $mobile = true; + break; + case (preg_match('/android/i', $user_agent)); + if (preg_match('/SM-G870A|SM-G900A|SM-G900F|SM-G900H|SM-G900M|SM-G900P|SM-G900R4|SM-G900T|SM-G900V|SM-G900W8|SM-G800F/i', $user_agent)) + { + $mobile_device = 'Samsung S5'; + } + elseif (preg_match('/SGH-I497/i', $user_agent)) + { + $mobile_device = 'Samsung Tablet'; + } + elseif (preg_match('/GT-P5210|SM-T110|SM-T310/i', $user_agent)) + { + $mobile_device = 'Samsung Tab 3'; + } + elseif (preg_match('/SM-T335|SM-T530/i', $user_agent)) + { + $mobile_device = 'Samsung Tab 4'; + } + elseif (preg_match('/SM-T520/i', $user_agent)) + { + $mobile_device = 'Samsung TabPRO'; + } + elseif (preg_match('/SGH-I537|GT-I9505|GT-I9500|SPH-L720T/i', $user_agent)) + { + $mobile_device = 'Samsung S4'; + } + elseif (preg_match('/GT-I9100P/i', $user_agent)) + { + $mobile_device = 'Samsung S2'; + } + elseif (preg_match('/SM-N7505|SM-N9005|SM-P600/i', $user_agent)) + { + $mobile_device = 'Samsung Note 3'; + } + elseif (preg_match('/SM-N910C|SM-N910F/i', $user_agent)) + { + $mobile_device = 'Samsung Note 4'; + } + elseif (preg_match('/SM-G357FZ/i', $user_agent)) + { + $mobile_device = 'Samsung Ace 4'; + } + elseif (preg_match('/SM-G925P/i', $user_agent)) + { + $mobile_device = 'Samsung S6 Edge'; + } + elseif (preg_match('/GT-S7582/i', $user_agent)) + { + $mobile_device = 'Samsung S Duos 2'; + } + elseif (preg_match('/GT-I9100P/i', $user_agent)) + { + $mobile_device = 'Samsung S2'; + } + elseif (preg_match('/IMM76B/i', $user_agent)) + { + $mobile_device = 'Samsung Nexus'; + } + elseif (preg_match('/TF101/i', $user_agent)) + { + $mobile_device = 'Asus Transformer Tablet'; + } + elseif (preg_match('/Archos 40b/i', $user_agent)) + { + $mobile_device = 'Archos 40b Titanium Surround'; + } + elseif (preg_match('/A0001/i', $user_agent)) + { + $mobile_device = 'OnePlus One'; + } + elseif (preg_match('/Orange Nura/i', $user_agent)) + { + $mobile_device = 'Orange Nura'; + } + elseif (preg_match('/XT1030/i', $user_agent)) + { + $mobile_device = 'Motorola Droid Mini'; + } + elseif (preg_match('/TIANYU-KTOUCH/i', $user_agent)) + { + $mobile_device = 'Tianyu K-Touch'; + } + elseif (preg_match('/D2005|D2105/i', $user_agent)) + { + $mobile_device = 'Sony Xperia E1 Dual'; + } + elseif (preg_match('/C2005|D2303/i', $user_agent)) + { + $mobile_device = 'Sony XPERIA M2'; + } + elseif (preg_match('/C6906/i', $user_agent)) + { + $mobile_device = 'Sony Xperia Z1'; + } + elseif (preg_match('/D5803/i', $user_agent)) + { + $mobile_device = 'Sony Xperia Z3'; + } + elseif (preg_match('/ASUS_T00J/i', $user_agent)) + { + $mobile_device = 'ASUS T00J'; + } + elseif (preg_match('/Aquaris E5/i', $user_agent)) + { + $mobile_device = 'Aquaris E5 HD'; + } + elseif (preg_match('/P710/i', $user_agent)) + { + $mobile_device = 'LG Optimus L7 II'; + } + elseif (preg_match('/HTC Desire|626s/i', $user_agent)) + { + $mobile_device = 'HTC Desire'; + } + elseif (preg_match('/Nexus 4|LRX22C|LVY48F/i', $user_agent)) + { + $mobile_device = 'Nexus 4'; + } + elseif (preg_match('/Nexus 5|LMY48S/i', $user_agent)) + { + $mobile_device = 'Nexus 5'; + } + elseif (preg_match('/Nexus 7|KTU84P/i', $user_agent)) + { + $mobile_device = 'Nexus 7'; + } + elseif (preg_match('/Nexus 9|LMY47X/i', $user_agent)) + { + $mobile_device = 'Nexus 9'; + } + elseif (preg_match('/Lenovo_K50_T5/i', $user_agent)) + { + $mobile_device = 'Lenovo K50-t5'; + } + elseif (preg_match('/HUAWEI GRA-L09/i', $user_agent)) + { + $mobile_device = 'HUAWEI P8'; + } + else + { + $mobile_device = 'ANDROID'; + } + $mobile = true; + break; + case (preg_match('/lg/i', $user_agent)); + $mobile_device = 'LG'; + $mobile = true; + break; + case (preg_match('/opera mini/i', $user_agent)); + $mobile_device = 'MOBILE'; + $mobile = true; + break; + case (preg_match('/blackberry/i', $user_agent)); + if (preg_match('/BlackBerry9900|BlackBerry9930|BlackBerry9790|BlackBerry9780|BlackBerry9700|BlackBerry9650|BlackBerry9000/i', $user_agent)) + { + $mobile_device = 'BlackBerry Bold'; + } + elseif (preg_match('/BlackBerry9380|BlackBerry9370|BlackBerry9360|BlackBerry9350|BlackBerry9330|BlackBerry9320|BlackBerry9300|BlackBerry9220|BlackBerry8980|BlackBerry8900|BlackBerry8530|BlackBerry8520|BlackBerry8330|BlackBerry8320|BlackBerry8310|BlackBerry8300/i', $user_agent)) + { + $mobile_device = 'BlackBerry Curve'; + } + elseif (preg_match('/BlackBerry9860|BlackBerry9850|BlackBerry9810|BlackBerry9800/i', $user_agent)) + { + $mobile_device = 'BlackBerry Torch'; + } + elseif (preg_match('/BlackBerry9900/i', $user_agent)) + { + $mobile_device = 'BlackBerry Touch'; + } + elseif (preg_match('/BlackBerry9105/i', $user_agent)) + { + $mobile_device = 'BlackBerry Pearl'; + } + elseif (preg_match('/BlackBerry8220/i', $user_agent)) + { + $mobile_device = 'BlackBerry Pearl Flip'; + } + elseif (preg_match('/BlackBerry PlayBook|BlackBerry Porsche|BlackBerry Passport|BlackBerry Storm|BlackBerry Storm2/', $user_agent, $match_device)) + { + $mobile_device = $match_device[0]; + } + else + { + $mobile_device = 'BlackBerry'; + } + $mobile = true; + break; + case (preg_match('/(pre\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine)/i', $user_agent)); + $mobile_device = 'Palm'; + $mobile = true; + break; + case (preg_match('/(iris|3g_t|windows ce|windows Phone|opera mobi|windows ce; smartphone;|windows ce; iemobile)/i', $user_agent)); + $mobile_device = 'Windows Smartphone'; + $mobile = true; + break; + case (preg_match('/lge vx10000/i', $user_agent)); + $mobile_device = 'Voyager'; + $mobile = true; + break; + case (preg_match('/(mini 9.5|vx1000|lge |m800|e860|u940|ux840|compal|wireless| mobi|ahong|lg380|lgku|lgu900|lg210|lg47|lg920|lg840|lg370|sam-r|mg50|s55|g83|t66|vx400|mk99|d615|d763|el370|sl900|mp500|samu3|samu4|vx10|xda_|samu5|samu6|samu7|samu9|a615|b832|m881|s920|n210|s700|c-810|_h797|mob-x|sk16d|848b|mowser|s580|r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|i250|sprint|w398samr810|m5252|c7100|mt126|x225|s5330|s820|htil-g1|fly v71|s302|-x113|novarra|k610i|-three|8325rc|8352rc|sanyo|vx54|c888|nx250|n120|mtk |c5588|s710|t880|c5005|i;458x|p404i|s210|c5100|teleca|s940|c500|s590|foma|samsu|vx8|vx9|a1000|_mms|myx|a700|gu1100|bc831|e300|ems100|me701|me702m-three|sd588|s800|8325rc|ac831|mw200|brew |d88|htc\/|htc_touch|355x|m50|km100|d736|p-9521|telco|sl74|ktouch|m4u\/|me702|8325rc|kddi|phone|lg |sonyericsson|samsung|240x|x320|vx10|nokia|sony cmd|motorola|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo)/i', $user_agent)); + $mobile_device = 'MOBILE'; + $mobile = true; + break; + case (isset($post['HTTP_X_WAP_PROFILE'])||isset($post['HTTP_PROFILE'])); + $mobile_device = 'MOBILE'; + $mobile = true; + break; + case (in_array(strtolower(substr($user_agent,0,4)),array('1207'=>'1207','3gso'=>'3gso','4thp'=>'4thp','501i'=>'501i','502i'=>'502i','503i'=>'503i','504i'=>'504i','505i'=>'505i','506i'=>'506i','6310'=>'6310','6590'=>'6590','770s'=>'770s','802s'=>'802s','a wa'=>'a wa','acer'=>'acer','acs-'=>'acs-','airn'=>'airn','alav'=>'alav','asus'=>'asus','attw'=>'attw','au-m'=>'au-m','aur '=>'aur ','aus '=>'aus ','abac'=>'abac','acoo'=>'acoo','aiko'=>'aiko','alco'=>'alco','alca'=>'alca','amoi'=>'amoi','anex'=>'anex','anny'=>'anny','anyw'=>'anyw','aptu'=>'aptu','arch'=>'arch','argo'=>'argo','bell'=>'bell','bird'=>'bird','bw-n'=>'bw-n','bw-u'=>'bw-u','beck'=>'beck','benq'=>'benq','bilb'=>'bilb','blac'=>'blac','c55/'=>'c55/','cdm-'=>'cdm-','chtm'=>'chtm','capi'=>'capi','cond'=>'cond','craw'=>'craw','dall'=>'dall','dbte'=>'dbte','dc-s'=>'dc-s','dica'=>'dica','ds-d'=>'ds-d','ds12'=>'ds12','dait'=>'dait','devi'=>'devi','dmob'=>'dmob','doco'=>'doco','dopo'=>'dopo','el49'=>'el49','erk0'=>'erk0','esl8'=>'esl8','ez40'=>'ez40','ez60'=>'ez60','ez70'=>'ez70','ezos'=>'ezos','ezze'=>'ezze','elai'=>'elai','emul'=>'emul','eric'=>'eric','ezwa'=>'ezwa','fake'=>'fake','fly-'=>'fly-','fly_'=>'fly_','g-mo'=>'g-mo','g1 u'=>'g1 u','g560'=>'g560','gf-5'=>'gf-5','grun'=>'grun','gene'=>'gene','go.w'=>'go.w','good'=>'good','grad'=>'grad','hcit'=>'hcit','hd-m'=>'hd-m','hd-p'=>'hd-p','hd-t'=>'hd-t','hei-'=>'hei-','hp i'=>'hp i','hpip'=>'hpip','hs-c'=>'hs-c','htc '=>'htc ','htc-'=>'htc-','htca'=>'htca','htcg'=>'htcg','htcp'=>'htcp','htcs'=>'htcs','htct'=>'htct','htc_'=>'htc_','haie'=>'haie','hita'=>'hita','huaw'=>'huaw','hutc'=>'hutc','i-20'=>'i-20','i-go'=>'i-go','i-ma'=>'i-ma','i230'=>'i230','iac'=>'iac','iac-'=>'iac-','iac/'=>'iac/','ig01'=>'ig01','im1k'=>'im1k','inno'=>'inno','iris'=>'iris','jata'=>'jata','java'=>'java','kddi'=>'kddi','kgt'=>'kgt','kgt/'=>'kgt/','kpt '=>'kpt ','kwc-'=>'kwc-','klon'=>'klon','lexi'=>'lexi','lg g'=>'lg g','lg-a'=>'lg-a','lg-b'=>'lg-b','lg-c'=>'lg-c','lg-d'=>'lg-d','lg-f'=>'lg-f','lg-g'=>'lg-g','lg-k'=>'lg-k','lg-l'=>'lg-l','lg-m'=>'lg-m','lg-o'=>'lg-o','lg-p'=>'lg-p','lg-s'=>'lg-s','lg-t'=>'lg-t','lg-u'=>'lg-u','lg-w'=>'lg-w','lg/k'=>'lg/k','lg/l'=>'lg/l','lg/u'=>'lg/u','lg50'=>'lg50','lg54'=>'lg54','lge-'=>'lge-','lge/'=>'lge/','lynx'=>'lynx','leno'=>'leno','m1-w'=>'m1-w','m3ga'=>'m3ga','m50/'=>'m50/','maui'=>'maui','mc01'=>'mc01','mc21'=>'mc21','mcca'=>'mcca','medi'=>'medi','meri'=>'meri','mio8'=>'mio8','mioa'=>'mioa','mo01'=>'mo01','mo02'=>'mo02','mode'=>'mode','modo'=>'modo','mot '=>'mot ','mot-'=>'mot-','mt50'=>'mt50','mtp1'=>'mtp1','mtv '=>'mtv ','mate'=>'mate','maxo'=>'maxo','merc'=>'merc','mits'=>'mits','mobi'=>'mobi','motv'=>'motv','mozz'=>'mozz','n100'=>'n100','n101'=>'n101','n102'=>'n102','n202'=>'n202','n203'=>'n203','n300'=>'n300','n302'=>'n302','n500'=>'n500','n502'=>'n502','n505'=>'n505','n700'=>'n700','n701'=>'n701','n710'=>'n710','nec-'=>'nec-','nem-'=>'nem-','newg'=>'newg','neon'=>'neon','netf'=>'netf','noki'=>'noki','nzph'=>'nzph','o2 x'=>'o2 x','o2-x'=>'o2-x','opwv'=>'opwv','owg1'=>'owg1','opti'=>'opti','oran'=>'oran','p800'=>'p800','pand'=>'pand','pg-1'=>'pg-1','pg-2'=>'pg-2','pg-3'=>'pg-3','pg-6'=>'pg-6','pg-8'=>'pg-8','pg-c'=>'pg-c','pg13'=>'pg13','phil'=>'phil','pn-2'=>'pn-2','pt-g'=>'pt-g','palm'=>'palm','pana'=>'pana','pire'=>'pire','pock'=>'pock','pose'=>'pose','psio'=>'psio','qa-a'=>'qa-a','qc-2'=>'qc-2','qc-3'=>'qc-3','qc-5'=>'qc-5','qc-7'=>'qc-7','qc07'=>'qc07','qc12'=>'qc12','qc21'=>'qc21','qc32'=>'qc32','qc60'=>'qc60','qci-'=>'qci-','qwap'=>'qwap','qtek'=>'qtek','r380'=>'r380','r600'=>'r600','raks'=>'raks','rim9'=>'rim9','rove'=>'rove','s55/'=>'s55/','sage'=>'sage','sams'=>'sams','sc01'=>'sc01','sch-'=>'sch-','scp-'=>'scp-','sdk/'=>'sdk/','se47'=>'se47','sec-'=>'sec-','sec0'=>'sec0','sec1'=>'sec1','semc'=>'semc','sgh-'=>'sgh-','shar'=>'shar','sie-'=>'sie-','sk-0'=>'sk-0','sl45'=>'sl45','slid'=>'slid','smb3'=>'smb3','smt5'=>'smt5','sp01'=>'sp01','sph-'=>'sph-','spv '=>'spv ','spv-'=>'spv-','sy01'=>'sy01','samm'=>'samm','sany'=>'sany','sava'=>'sava','scoo'=>'scoo','send'=>'send','siem'=>'siem','smar'=>'smar','smit'=>'smit','soft'=>'soft','sony'=>'sony','t-mo'=>'t-mo','t218'=>'t218','t250'=>'t250','t600'=>'t600','t610'=>'t610','t618'=>'t618','tcl-'=>'tcl-','tdg-'=>'tdg-','telm'=>'telm','tim-'=>'tim-','ts70'=>'ts70','tsm-'=>'tsm-','tsm3'=>'tsm3','tsm5'=>'tsm5','tx-9'=>'tx-9','tagt'=>'tagt','talk'=>'talk','teli'=>'teli','topl'=>'topl','hiba'=>'hiba','up.b'=>'up.b','upg1'=>'upg1','utst'=>'utst','v400'=>'v400','v750'=>'v750','veri'=>'veri','vk-v'=>'vk-v','vk40'=>'vk40','vk50'=>'vk50','vk52'=>'vk52','vk53'=>'vk53','vm40'=>'vm40','vx98'=>'vx98','virg'=>'virg','vite'=>'vite','voda'=>'voda','vulc'=>'vulc','w3c '=>'w3c ','w3c-'=>'w3c-','wapj'=>'wapj','wapp'=>'wapp','wapu'=>'wapu','wapm'=>'wapm','wig '=>'wig ','wapi'=>'wapi','wapr'=>'wapr','wapv'=>'wapv','wapy'=>'wapy','wapa'=>'wapa','waps'=>'waps','wapt'=>'wapt','winc'=>'winc','winw'=>'winw','wonu'=>'wonu','x700'=>'x700','xda2'=>'xda2','xdag'=>'xdag','yas-'=>'yas-','your'=>'your','zte-'=>'zte-','zeto'=>'zeto','acs-'=>'acs-','alav'=>'alav','alca'=>'alca','amoi'=>'amoi','aste'=>'aste','audi'=>'audi','avan'=>'avan','benq'=>'benq','bird'=>'bird','blac'=>'blac','blaz'=>'blaz','brew'=>'brew','brvw'=>'brvw','bumb'=>'bumb','ccwa'=>'ccwa','cell'=>'cell','cldc'=>'cldc','cmd-'=>'cmd-','dang'=>'dang','doco'=>'doco','eml2'=>'eml2','eric'=>'eric','fetc'=>'fetc','hipt'=>'hipt','http'=>'http','ibro'=>'ibro','idea'=>'idea','ikom'=>'ikom','inno'=>'inno','ipaq'=>'ipaq','jbro'=>'jbro','jemu'=>'jemu','java'=>'java','jigs'=>'jigs','kddi'=>'kddi','keji'=>'keji','kyoc'=>'kyoc','kyok'=>'kyok','leno'=>'leno','lg-c'=>'lg-c','lg-d'=>'lg-d','lg-g'=>'lg-g','lge-'=>'lge-','libw'=>'libw','m-cr'=>'m-cr','maui'=>'maui','maxo'=>'maxo','midp'=>'midp','mits'=>'mits','mmef'=>'mmef','mobi'=>'mobi','mot-'=>'mot-','moto'=>'moto','mwbp'=>'mwbp','mywa'=>'mywa','nec-'=>'nec-','newt'=>'newt','nok6'=>'nok6','noki'=>'noki','o2im'=>'o2im','opwv'=>'opwv','palm'=>'palm','pana'=>'pana','pant'=>'pant','pdxg'=>'pdxg','phil'=>'phil','play'=>'play','pluc'=>'pluc','port'=>'port','prox'=>'prox','qtek'=>'qtek','qwap'=>'qwap','rozo'=>'rozo','sage'=>'sage','sama'=>'sama','sams'=>'sams','sany'=>'sany','sch-'=>'sch-','sec-'=>'sec-','send'=>'send','seri'=>'seri','sgh-'=>'sgh-','shar'=>'shar','sie-'=>'sie-','siem'=>'siem','smal'=>'smal','smar'=>'smar','sony'=>'sony','sph-'=>'sph-','symb'=>'symb','t-mo'=>'t-mo','teli'=>'teli','tim-'=>'tim-','tosh'=>'tosh','treo'=>'treo','tsm-'=>'tsm-','upg1'=>'upg1','upsi'=>'upsi','vk-v'=>'vk-v','voda'=>'voda','vx52'=>'vx52','vx53'=>'vx53','vx60'=>'vx60','vx61'=>'vx61','vx70'=>'vx70','vx80'=>'vx80','vx81'=>'vx81','vx83'=>'vx83','vx85'=>'vx85','wap-'=>'wap-','wapa'=>'wapa','wapi'=>'wapi','wapp'=>'wapp','wapr'=>'wapr','webc'=>'webc','whit'=>'whit','winw'=>'winw','wmlb'=>'wmlb','xda-'=>'xda-',))); + $mobile_device = 'MOBILE'; + $mobile = true; + break; + default; + $mobile_device = 'Desktop'; + $mobile = false; + break; + } + + // Write to sessions table + $sql_ary = array( + 'football_mobile' => $mobile, + 'football_mobile_device' => $db->sql_escape($mobile_device), + ); + $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE session_id = '" . $db->sql_escape($this->user->session_id) . "'"; + $db->sql_query($sql); + $this->user->data['football_mobile'] = $mobile; + $this->user->data['football_mobile_device'] = $mobile_device; + } + } + + /** + * Check if user should be able to access football prediction league + * + * @return bool True of user should be able to access it, false if not + */ + protected function has_football_access() + { + // Can this user view Prediction Leagues pages? + if (!$this->config['football_guest_view']) + { + if ($this->user->data['user_id'] == ANONYMOUS) + { + return false; + } + } + if (!$this->config['football_user_view']) + { + return $this->auth->acl_get('u_use_football') && ! $this->config['football_disable']; + } + return ! $this->config['football_disable']; + } + + public function add_permission_cat($event) + { + $perm_cat = $event['categories']; + $perm_cat['football'] = 'ACP_FOOTBALL'; + $event['categories'] = $perm_cat; + + $permission = $event['permissions']; + $permission['u_use_football'] = array('lang' => 'ACL_U_USE_FOOTBALL', 'cat' => 'football'); + $permission['a_football_config'] = array('lang' => 'ACL_A_FOOTBALL_CONFIG', 'cat' => 'football'); + $permission['a_football_delete'] = array('lang' => 'ACL_A_FOOTBALL_DELETE', 'cat' => 'football'); + $permission['a_football_editbets'] = array('lang' => 'ACL_A_FOOTBALL_EDITBETS', 'cat' => 'football'); + $permission['a_football_plan'] = array('lang' => 'ACL_A_FOOTBALL_PLAN', 'cat' => 'football'); + $permission['a_football_results'] = array('lang' => 'ACL_A_FOOTBALL_RESULTS', 'cat' => 'football'); + $permission['a_football_points'] = array('lang' => 'ACL_A_FOOTBALL_POINTS', 'cat' => 'football'); + $event['permissions'] = $permission; + } +} diff --git a/football.gif b/football.gif new file mode 100644 index 0000000..3aeda42 Binary files /dev/null and b/football.gif differ diff --git a/images/arrow_down.gif b/images/arrow_down.gif new file mode 100644 index 0000000..2f3c160 Binary files /dev/null and b/images/arrow_down.gif differ diff --git a/images/arrow_up.gif b/images/arrow_up.gif new file mode 100644 index 0000000..ee3aa68 Binary files /dev/null and b/images/arrow_up.gif differ diff --git a/images/flags/blank.gif b/images/flags/blank.gif new file mode 100644 index 0000000..d1fc54a Binary files /dev/null and b/images/flags/blank.gif differ diff --git a/images/football.gif b/images/football.gif new file mode 100644 index 0000000..3aeda42 Binary files /dev/null and b/images/football.gif differ diff --git a/images/football.ico b/images/football.ico new file mode 100644 index 0000000..6995a07 Binary files /dev/null and b/images/football.ico differ diff --git a/images/index.htm b/images/index.htm new file mode 100644 index 0000000..e0cc5f3 --- /dev/null +++ b/images/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/images/no_change.gif b/images/no_change.gif new file mode 100644 index 0000000..59eafbf Binary files /dev/null and b/images/no_change.gif differ diff --git a/images/site_logo.gif b/images/site_logo.gif new file mode 100644 index 0000000..b1b44f6 Binary files /dev/null and b/images/site_logo.gif differ diff --git a/images/spacer.gif b/images/spacer.gif new file mode 100644 index 0000000..cd29009 Binary files /dev/null and b/images/spacer.gif differ diff --git a/images/under_construction.gif b/images/under_construction.gif new file mode 100644 index 0000000..d18883b Binary files /dev/null and b/images/under_construction.gif differ diff --git a/includes/chart_hist.php b/includes/chart_hist.php new file mode 100644 index 0000000..f59aef5 --- /dev/null +++ b/includes/chart_hist.php @@ -0,0 +1,66 @@ + diff --git a/includes/chart_points.php b/includes/chart_points.php new file mode 100644 index 0000000..8fc109e --- /dev/null +++ b/includes/chart_points.php @@ -0,0 +1,126 @@ + ($rows - 2)) + imagestring($image, 3, 10, $i * $horz - 6, $maximum - (($i - 1) * 5), $colorBlack); + else + imagestring($image, 3, 3,$i * $horz - 6, $maximum - (($i - 1) * 5), $colorBlack); +} +imagestring($image, 1, 0, 0, $caption_lang[0] , $colorBlack); + + +// Create grid +for ($i = 1; $i <= $matchdays; $i++) +{ + $label = $i + 1; + imageline($image, $i * $vert, $horz, $i * $vert, $imgHeight - 50, $colorGrey); + if ($i < 10) + imagestring($image,3,$i * $vert - 3, $imgHeight - 40, $i, $colorBlack); + else + imagestring($image, 3, $i * $vert - 6, $imgHeight - 40, $i, $colorBlack); +} + +imageline($image, 3, $imgHeight - $horz + 6, 15, $imgHeight - $horz + 6, $colorBlack); +imagestring($image, 3, 20, $imgHeight - $horz, $caption_lang[1] , $colorBlack); + +imagesetthickness($image, 2); + +$count_values=count($graphvalues1); +// Create line graph +for ($i = 1; $i < $count_values; $i++) +{ + imageline($image, $i * $vert, (($maximum - $graphvalues1[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues1[$i]) * $horzp + $horz), $colorBlue); +} + +$count_values=count($graphvalues2); +// Create line graph +for ($i = 1; $i < $count_values; $i++) +{ + imageline($image, $i * $vert, (($maximum - $graphvalues2[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues2[$i]) * $horzp + $horz), $colorGreen); +} + +$count_values=count($graphvalues3); +// Create line graph +for ($i = 1; $i < $count_values; $i++) +{ + imageline($image, $i * $vert, (($maximum - $graphvalues3[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues3[$i]) * $horzp + $horz), $colorAzur); +} + +$count_values=count($graphvalues4); +// Create line graph +for ($i = 1; $i < $count_values; $i++) +{ + imageline($image, $i * $vert, (($maximum - $graphvalues4[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues4[$i]) * $horzp + $horz), $colorRed); +} + +$count_values=count($graphvaluesmin); +// Create line graph +for ($i = 1; $i < $count_values; $i++) +{ + imageline($image, $i * $vert, (($maximum - $graphvaluesmin[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvaluesmin[$i]) * $horzp + $horz), $colorBlack); +} + +$count_values=count($graphvaluesmax); +// Create line graph +for ($i = 1; $i < $count_values; $i++) +{ + imageline($image, $i * $vert, (($maximum - $graphvaluesmax[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvaluesmax[$i]) * $horzp + $horz), $colorBlack); +} + +// Output graph and clear image from memory +imagepng($image); +imagedestroy($image); +?> diff --git a/includes/chart_rank.php b/includes/chart_rank.php new file mode 100644 index 0000000..273d617 --- /dev/null +++ b/includes/chart_rank.php @@ -0,0 +1,97 @@ + diff --git a/includes/constants.php b/includes/constants.php new file mode 100644 index 0000000..c4e3677 --- /dev/null +++ b/includes/constants.php @@ -0,0 +1,45 @@ + \ No newline at end of file diff --git a/includes/export.php b/includes/export.php new file mode 100644 index 0000000..7af6d41 --- /dev/null +++ b/includes/export.php @@ -0,0 +1,271 @@ +sql_query($sql) ) +{ + trigger_error('NO_LEAGUE'); +} +$league_short = $db->sql_fetchfield('league_name_short'); +$db->sql_freeresult($result); +$export_file = $league_short . '_'. $season. '_Tipps.csv'; +$path_attachment = './../../files/' . $export_file; +$newline = "\r\n"; + +if (!isset($_POST['send'])) +{ + header('Pragma: no-cache'); + header("Content-Type: text/csv; name=\"$export_file\""); + header("Content-disposition: attachment; filename=$export_file"); + +// header('Content-Type: text/x-csv'); +// header('Expires: ' . gmdate('D, d M Y H:i:m') . ' GMT'); +// header('Content-Disposition: attachment; filename='. $export_file); + $phpbb_root_path = './../'; +} +else +{ + $phpbb_root_path = './../../'; +} + +$sql_users = 'SELECT DISTINCT + b.user_id, + u.username + FROM ' . FOOTB_BETS . ' AS b + LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) + WHERE b.season = $season AND b.league = $league + ORDER BY b.user_id ASC"; + +$sql_results = "SELECT + m.match_no, + DATE_FORMAT(m.match_datetime,'%d.%m.%Y') AS match_time, + m.matchday, + m.formula_home, + m.formula_guest, + t1.team_id AS hid, + t2.team_id AS gid, + t1.team_name_short AS team_home, + t2.team_name_short AS team_guest, + m.status, + m.goals_home, + m.goals_guest + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id=m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id=m.team_id_guest) + WHERE m.season = $season AND m.league = $league + ORDER BY m.match_no ASC"; + +$sql_bets = "SELECT + m.matchday, + m.match_no, + b.user_id, + IF(m.status > 0, b.goals_home, '') AS bet_home, + IF(m.status > 0, b.goals_guest, '') AS bet_guest + FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + WHERE m.season = $season AND m.league = $league + ORDER BY matchday ASC, match_no ASC, user_id ASC"; + +if(!$result_users = $db->sql_query($sql_users)) +{ + trigger_error('NO_USER'); +} +$rows_users = $db->sql_fetchrowset($result_users); +$count_user = sizeof($rows_users); +$db->sql_freeresult($result_users); +$j = 0; +$column = array(); +foreach ($rows_users as $row_user) +{ + $column[(8 + (3 * ($j)))] = str_replace("\"", "\"\"", $row_user['username']); + $lastcolumn = 8 + (3 * ($j)); + $bet_column[$row_user['user_id']] = $lastcolumn; + $j++; +} +$export_row_users = "\"\";\"\";\"\";\"\";\"\";\"\";"; +for($j = 8; $j <= $lastcolumn; $j = $j + 3) +{ + $export_row_users .= "\"\";\"\";\"" . $column[$j] . "\""; + if($j != $lastcolumn) + { + $export_row_users .= ';'; + } +} +$export_row_users .= $newline; + +if( !$result_results = $db->sql_query($sql_results) ) +{ + trigger_error('NO_RESULTS'); +} +$rows_results = $db->sql_fetchrowset($result_results); +$count_results = sizeof($rows_results); +$db->sql_freeresult($result_results); + +if( !$result_bets = $db->sql_query($sql_bets) ) +{ + trigger_error('NO_BETS'); +} +$rows_bets = $db->sql_fetchrowset($result_bets); +$count_bets = sizeof($rows_bets); +$db->sql_freeresult($result_results); +$column = array(); +$lastcolumn = 0; +$last_match_num = 0; +foreach ($rows_bets as $row_bet) +{ + if ($row_bet['match_no'] == $last_match_num) + { + $column[$bet_column[$row_bet['user_id']]] = str_replace("\"", "\"\"", $row_bet['bet_home']); + $column[$bet_column[$row_bet['user_id']] + 1] = str_replace("\"", "\"\"", $row_bet['bet_guest']); + $column[$bet_column[$row_bet['user_id']] + 2] = ''; + $lastcolumn = $bet_column[$row_bet['user_id']] + 2; + } + else + { + if ($lastcolumn > 0) + { + $export_bets[$last_match_num] = ''; + for($j=8; $j<=$lastcolumn; $j++) + { + $export_bets[$last_match_num] .= "\"" . $column[$j] . "\""; + if($j!=$lastcolumn) + { + $export_bets[$last_match_num] .= ';'; + } + } + $export_bets[$last_match_num] .= $newline; + } + $column = array(); + $last_match_num = $row_bet['match_no']; + $column[$bet_column[$row_bet['user_id']]] = str_replace("\"", "\"\"", $row_bet['bet_home']); + $column[$bet_column[$row_bet['user_id']] + 1] = str_replace("\"", "\"\"", $row_bet['bet_guest']); + $column[$bet_column[$row_bet['user_id']] + 2] = ''; + $lastcolumn = $bet_column[$row_bet['user_id']] + 2; + } +} +$export_bets[$last_match_num] = ''; +for($j = 8; $j <= $lastcolumn; $j++) +{ + $export_bets[$last_match_num] .= "\"" . $column[$j] . "\""; + if($j != $lastcolumn) + { + $export_bets[$last_match_num] .= ';'; + } +} +$export_bets[$last_match_num] .= $newline; + +$last_matchday = 0; + +$export= ''; +$export .= 'CSV;'. $league. ';'. $season. $newline; + +$i = 0; +foreach ($rows_results as $row_result) +{ + if ($last_matchday != $row_result['matchday']) + { + if ($last_matchday != 0) + { + $export .= $newline; + $export .= $newline; + $export .= $newline; + $export .= $newline; + $export .= $newline; + $export .= $newline; + $export .= ";;". str_replace("\"", "\"\"", $row_result['match_time']). $newline; + $export .= $newline; + $export .= $newline; + $export .= $newline; + $export .= $newline; + $export .= $newline; + } + else + { + $export .= $newline; + $export .= $newline; + $export .= $newline; + $export .= ";;". str_replace("\"", "\"\"", $row_result['match_time']). $newline; + $export .= $newline; + $export .= $newline; + $export .= $newline; + $export .= $newline; + $export .= $newline; + } + $export .= $export_row_users; + $column = array(); + $last_matchday = $row_result['matchday']; + } + if (0 == $row_result['hid']) + { + $home_info = get_team($season, $league, $row_result['match_no'], 'team_id_home', $row_result['formula_home']); + $home_in_array = explode("#",$home_info); + $homename = $home_in_array[3]; + } + else + { + $homename = $row_result['team_home']; + } + if (0 == $row_result['gid']) + { + $guest_info = get_team($season, $league, $row_result['match_no'], 'team_id_guest', $row_result['formula_guest']); + $guest_in_array = explode("#",$guest_info); + $guestname = $guest_in_array[3]; + } + else + { + $guestname = $row_result['team_guest']; + } + $column[0] = str_replace("\"", "\"\"", $homename); + $column[1] = str_replace("\"", "\"\"", $guestname); + + if ($row_result['status'] == 3) + { + $column[2] = str_replace("\"", "\"\"", $row_result['goals_home']); + $column[4] = str_replace("\"", "\"\"", $row_result['goals_guest']); + } + else + { + $column[2] = ''; + $column[4] = ''; + } + $export .= "\"" . $column[0] . "\";\"" . $column[1] . "\";\"" . $column[2] . "\";\"\";\"" . $column[4] . "\";\"\";\"\";\"\";"; + if ($export_bets[$row_result['match_no']] == '') + { + $export .= $newline; + } + else + { + $export .= $export_bets[$row_result['match_no']]; + } + $column = array(); + $i++; +} + +if (isset($_POST['send'])) +{ + $fp = fopen($path_attachment , "b"); + ftruncate ($fp, 0); + rewind($fp); + fwrite ($fp, $export); + fclose($fp); +} +else +{ + echo utf8_decode($export); + exit; +} +?> diff --git a/includes/functions.php b/includes/functions.php new file mode 100644 index 0000000..a298721 --- /dev/null +++ b/includes/functions.php @@ -0,0 +1,2310 @@ + 0 + $where_status"; + $result = $db->sql_query($sql); + + $result_ary = array(); + $extra_points_error = true; + while($row = $db->sql_fetchrow($result)) + { + $extra_no = $row['extra_no']; + if ($row['result'] <> '') + { + switch($row['question_type']) + { + case '2': + case '4': + // multiple results + { + $bet_points = 'CASE bet '; + $result_ary = explode(';', $row['result']); + foreach($result_ary AS $result_value) + { + if ($result_value <> '') + { + $result_value = (is_numeric($result_value)) ? $result_value : "'" . $result_value . "'"; + $bet_points .= ' WHEN ' . $result_value . ' THEN ' . $row['extra_points'] . ' '; + $extra_points_error = false; + } + } + $bet_points .= ' ELSE 0 END'; + } + break; + case '5': + // difference to result + { + if (is_numeric($row['result'])) + { + $bet_points = 'IF(' . $row['extra_points'] . '- ABS(bet - ' . $row['result'] . ') > 0, ' . $row['extra_points'] . '- ABS(bet - ' . $row['result'] . ')' . ', 0)'; + $extra_points_error = false; + } + else + { + $extra_points_error = true; + } + } + break; + default: + // Case 1 and 3 and other + // correct result + { + $result_value = (is_numeric($row['result'])) ? $row['result'] : "'" . $row['result'] . "'"; + $bet_points = 'CASE bet WHEN ' . $result_value . ' THEN ' . $row['extra_points'] . ' ELSE 0 END'; + $extra_points_error = false; + } + break; + } + if (!$extra_points_error) + { + $sql = 'UPDATE ' . FOOTB_EXTRA_BETS . ' + SET bet_points = ' . $bet_points . " + WHERE season = $season + AND league = $league + AND extra_no = $extra_no"; + $db->sql_query($sql); + } + } + } + $db->sql_freeresult($result); +} + + +/** +* Save matchday-ranking in database (table FOOTB_RANKS). +*/ +function save_ranking_matchday($season, $league, $matchday, $cash = false) +{ + global $db, $config, $lang, $league_info; + $sql = 'SELECT * FROM ' . FOOTB_MATCHDAYS . " WHERE season = $season AND league = $league AND matchday = $matchday"; + $result = $db->sql_query($sql); + + if ( $row = $db->sql_fetchrow($result)) + { + $matchday_status = $row['status']; + if ($row['delivery_date_2'] != '' OR ($league_info['bet_in_time'] AND $matchday_status <> 3)) + // We set status to 2 to skip deleting the ranking + $matchday_status = 2; + $db->sql_freeresult($result); + if ($matchday_status < 2) + { + $sql = 'SELECT * FROM ' . FOOTB_MATCHES . " WHERE season = $season AND league = $league AND matchday = $matchday AND status IN (2,3)"; + $result = $db->sql_query($sql); + if ( $row = $db->sql_fetchrow($result)) + { + $matchday_status = 2; + } + } + + if ($matchday_status == 0 OR $matchday_status == 1) + { + // No matches played, so we can delete the ranking + $sql = 'DELETE FROM ' . FOOTB_RANKS . " WHERE season = $season AND league = $league AND matchday = $matchday"; + $result = $db->sql_query($sql); + } + else + { + $matchday_wins = array(); + $matchday_wins = matchday_wins($season, $league); + $sql = " + SELECT + 1 AS rank, + 0.00 AS win, + u.user_id, + u.username AS username, + SUM(IF(m.match_no > 0, 1, 0)) AS matches, + SUM(IF(b.goals_home = '' OR b.goals_guest = '', 1, 0)) AS nobet, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest) + , 1 + , 0 + ) + , 0 + ) + ) AS direct_hit, + SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) + OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest) + , 0 + , 1 + ) + , 0 + ) + ) AS tendency, + " . select_points('m',true) . ' + FROM ' . FOOTB_MATCHES . ' AS m + INNER JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + INNER JOIN ' . USERS_TABLE . " AS u ON (b.user_id = u.user_id) + WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday AND m.status IN (2,3) + GROUP BY b.user_id + ORDER BY points DESC, nobet ASC, username ASC + "; + + $result = $db->sql_query($sql); + + $ranking_ary = array(); + while( $row = $db->sql_fetchrow($result)) + { + $ranking_ary[$row['user_id']] = $row; + } + $db->sql_freeresult($result); + if ( sizeof($ranking_ary) > 0 ) + { + $sql = ' + SELECT + eb.user_id, + SUM(eb.bet_points) AS points + FROM ' . FOOTB_EXTRA . ' AS e + INNER JOIN ' . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = e.season and eb.league = e.league and eb.extra_no = e.extra_no) + WHERE e.season = $season + AND e.league = $league + AND e.matchday = $matchday + AND e.matchday_eval = $matchday + AND e.extra_status > 1 + GROUP BY eb.user_id"; + + $result = $db->sql_query($sql); + while( $row = $db->sql_fetchrow($result)) + { + $ranking_ary[$row['user_id']]['points'] += $row['points']; + } + $db->sql_freeresult($result); + + // sort the ranking by points + usort($ranking_ary, '_sort_points'); + } + + $last_points = -1; + $last_rank = 1; + $equal_rank = array(); + $money = array(); + $i = 0; + foreach( $ranking_ary AS $curr_user => $curr_rank) + { + if ($curr_rank['nobet'] == $curr_rank['matches'] and $league_info['points_last'] == 1) + { + if ($last_points <> -1) + { + $ranking_ary[$curr_user]['points'] = $last_points; + } + else + { + $ranking_ary[$curr_user]['points'] = 0; + $last_points = 0; + $equal_rank[$last_rank] = 0; + } + } + if ( $ranking_ary[$curr_user]['points'] != $last_points) + { + $ranking_ary[$curr_user]['rank'] = $i + 1; + $last_rank = $i + 1; + $equal_rank[$last_rank] = 1; + if ($last_rank < sizeof($matchday_wins)) + { + $money[$last_rank] = $matchday_wins[$last_rank]; + } + else + { + $money[$last_rank] = 0; + } + $last_points = $ranking_ary[$curr_user]['points']; + } + else + { + $ranking_ary[$curr_user]['rank'] = $last_rank; + $equal_rank[$last_rank] += 1; + if ($i + 1 < sizeof($matchday_wins)) + { + $money[$last_rank] += $matchday_wins[$i + 1]; + } + } + $i++; + } + foreach( $ranking_ary AS $curr_user => $curr_rank) + { + if ( round($money[$curr_rank['rank']] / $equal_rank[$curr_rank['rank']], 2) <> 0 ) + { + $win = round($money[$curr_rank['rank']] / $equal_rank[$curr_rank['rank']], 2); + $ranking_ary[$curr_user]['win'] = $win; + } + else + { + $win = 0; + $ranking_ary[$curr_user]['win'] = 0; + } + $sql = 'REPLACE INTO ' . FOOTB_RANKS . " + VALUES ($season + , $league + , $matchday + , " . $curr_rank['user_id'] . " + , $matchday_status + , " . $curr_rank['rank'] . " + , " . $curr_rank['points'] . " + , $win + , 0 + , " . $curr_rank['tendency'] . " + , " . $curr_rank['direct_hit'] . " + ,0 + ,0 + )"; + $result = $db->sql_query($sql); + } + if ( sizeof($ranking_ary) == 0 ) + { + $sql = 'DELETE FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday = $matchday"; + $result = $db->sql_query($sql); + } + else + { + // Calculate total ranking + $rank_total_ary = array(); + $sql = 'SELECT + user_id , + SUM(points) AS points, + SUM(win) AS wins_total + FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday <= $matchday + GROUP by user_id + ORDER BY points DESC, user_id ASC"; + $result = $db->sql_query($sql); + while( $row = $db->sql_fetchrow($result)) + { + $rank_total_ary[$row['user_id']] = $row; + } + $db->sql_freeresult($result); + + // add extra tipp points total ranking + $league_info = league_info($season, $league); + if ( sizeof($rank_total_ary) > 0 ) + { + if ( $matchday == $league_info['matchdays']) + { + $win_user_most_hits = win_user_most_hits($season, $league, $matchday); + $win_user_most_hits_away = win_user_most_hits_away($season, $league, $matchday); + $season_wins = season_wins($season, $league, $matchday); + } + $sql = 'SELECT + eb.user_id, + SUM(eb.bet_points) AS points + FROM ' . FOOTB_EXTRA . ' AS e + INNER JOIN ' . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = e.season and eb.league = e.league and eb.extra_no = e.extra_no) + WHERE e.season = $season + AND e.league = $league + AND e.matchday <> e.matchday_eval + AND e.matchday_eval <= $matchday + AND e.extra_status > 1 + GROUP BY eb.user_id"; + + $result = $db->sql_query($sql); + while( $row = $db->sql_fetchrow($result)) + { + $rank_total_ary[$row['user_id']]['points'] += $row['points']; + } + $db->sql_freeresult($result); + + // sort the ranking by points + usort($rank_total_ary, '_sort_points'); + } + + $index = 0; + $last_rank = 0; + $last_points = -1; + foreach( $rank_total_ary AS $curr_user => $curr_rank) + { + $index++; + if ( $curr_rank['points'] == $last_points) + { + $rank_total = $last_rank; + } + else + { + $rank_total = $index; + $last_points = $curr_rank['points']; + $last_rank = $rank_total; + } + if ($matchday == $league_info['matchdays']) + { + // if someone didn't bet the hole Season + if (!isset($win_user_most_hits[$curr_rank['user_id']]['win'])) + { + $win_user_most_hits[$curr_rank['user_id']]['win'] = 0; + } + if (!isset($win_user_most_hits_away[$curr_rank['user_id']]['win'])) + { + $win_user_most_hits_away[$curr_rank['user_id']]['win'] = 0; + } + if (!isset($season_wins[$curr_rank['user_id']]['win'])) + { + $season_wins[$curr_rank['user_id']]['win'] = 0; + } + $rank_total_ary[$curr_user]['wins_total'] = sprintf('%01.2f',$curr_rank['wins_total'] + $win_user_most_hits[$curr_rank['user_id']]['win'] + $win_user_most_hits_away[$curr_rank['user_id']]['win'] + $season_wins[$curr_rank['user_id']]['win']); + } + else + { + $rank_total_ary[$curr_user]['wins_total'] = sprintf('%01.2f',$curr_rank['wins_total']); + } + $curr_userid = $curr_rank['user_id']; + $points_total = $curr_rank['points']; + $win_total = $rank_total_ary[$curr_user]['wins_total']; + $sql = 'UPDATE ' . FOOTB_RANKS . " + SET rank_total = $rank_total, + points_total = $points_total, + win_total = $win_total + WHERE season = $season AND league = $league AND matchday = $matchday AND user_id = $curr_userid"; + $result = $db->sql_query($sql); + } + } + } + if ($config['football_bank']) + { + if ($matchday_status < 3) + { + //Delete points + if ($matchday == $league_info['matchdays']) + { + // On last matchday + rollback_points(POINTS_MOST_HITS, $season, $league, $matchday, $cash && ($config['football_ult_points'] == 1)); + rollback_points(POINTS_MOST_HITS_AWAY, $season, $league, $matchday, $cash && ($config['football_ult_points'] == 1)); + rollback_points(POINTS_SEASON, $season, $league, $matchday, $cash && ($config['football_ult_points'] == 1)); + } + rollback_points(POINTS_MATCHDAY, $season, $league, $matchday, $cash && ($config['football_ult_points'] > 0)); + } + else + { + //Set points on played matchday + if ($matchday == $league_info['matchdays'] AND $config['football_bank']) + { + // On last matchday + set_points_most_hits($season, $league, $matchday, $win_user_most_hits, $cash && ($config['football_ult_points'] == 1)); + set_points_most_hits_away($season, $league, $matchday, $win_user_most_hits_away, $cash && ($config['football_ult_points'] == 1)); + set_points_season($season, $league, $matchday, $season_wins, $cash && ($config['football_ult_points'] == 1)); + } + set_points_matchday($season, $league, $matchday, $ranking_ary, $cash && ($config['football_ult_points'] > 0)); + } + } + $sql = 'SELECT matchday FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday > $matchday"; + $result = $db->sql_query($sql); + if ( $next_matchday = (int) $db->sql_fetchfield('matchday')) + { + $db->sql_freeresult($result); + save_ranking_matchday($season, $league, $next_matchday, $cash); + } + } +} + +function set_points_most_hits($season, $league, $matchday, $win_user_most_hits, $cash) +{ + rollback_points(POINTS_MOST_HITS, $season, $league, $matchday, $cash); + set_footb_points(POINTS_MOST_HITS, $season, $league, $matchday, $win_user_most_hits, $cash); +} + +function set_points_most_hits_away($season, $league, $matchday, $win_user_most_hits_away, $cash) +{ + rollback_points(POINTS_MOST_HITS_AWAY, $season, $league, $matchday, $cash); + set_footb_points(POINTS_MOST_HITS_AWAY, $season, $league, $matchday, $win_user_most_hits_away, $cash); +} + +function set_points_season($season, $league, $matchday, $season_wins, $cash) +{ + rollback_points(POINTS_SEASON, $season, $league, $matchday, $cash); + set_footb_points(POINTS_SEASON, $season, $league, $matchday, $season_wins, $cash); +} + +function set_points_matchday($season, $league, $matchday, $ranking_ary, $cash) +{ + rollback_points(POINTS_MATCHDAY, $season, $league, $matchday, $cash); + set_footb_points(POINTS_MATCHDAY, $season, $league, $matchday, $ranking_ary, $cash); +} + +function rollback_points($points_type, $season, $league, $matchday, $cash) +{ + global $db, $functions_points; + if ($cash) + { + $where_matchday = ($matchday) ? " AND matchday = $matchday" : ''; + $sql = 'SELECT * + FROM ' . FOOTB_POINTS . " AS p + WHERE season = $season + AND league = $league + $where_matchday + AND points_type = $points_type + AND cash = 1"; + + $result = $db->sql_query($sql); + while( $row = $db->sql_fetchrow($result)) + { + $functions_points->substract_points($row['user_id'], $row['points']); + } + $db->sql_freeresult($result); + + } + $sql = 'DELETE FROM ' . FOOTB_POINTS . " WHERE season = $season AND league = $league AND matchday = $matchday AND points_type = $points_type"; + $result = $db->sql_query($sql); +} + +function set_footb_points($points_type, $season, $league, $matchday, $wins, $cash) +{ + global $db, $user, $config, $functions_points; + switch($points_type) + { + case 1: + $points_comment = sprintf($user->lang['BET_POINTS']); + break; + case 2: + $points_comment = sprintf($user->lang['DEPOSIT']); + break; + case 3: + $points_comment = ''; + break; + case 4: + $points_comment = ''; + break; + case 5: + $points_comment = sprintf($user->lang['WIN_HITS']); + break; + case 6: + $points_comment = sprintf($user->lang['WIN_HITS02']); + break; + case 7: + $points_comment = sprintf($user->lang['PAYOUT_WIN']); + break; + } + + foreach( $wins AS $curr_user => $curr_ary) + { + if ($config['football_ult_points'] == 2 AND $points_type == 3) + { + // points mode + + if ($curr_ary['points'] > 0 AND $curr_ary['points'] <> NULL) + { + $userid = (!isset($curr_ary['user_id'])) ? $curr_user : $curr_ary['user_id']; + $points_comment = sprintf($user->lang['POINTS']); + $factor_points = round($config['football_ult_points_factor'] * $curr_ary['points'],2); + if ($cash) + { + $functions_points->add_points($userid, $factor_points); + } + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'matchday' => (int) $matchday, + 'points_type' => (int) $points_type, + 'user_id' => (int) $userid, + 'points' => $factor_points, + 'points_comment'=> $points_comment, + 'cash' => $cash, + ); + $sql = 'INSERT INTO ' . FOOTB_POINTS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + } + if ($config['football_ult_points'] <= 1 OR ($config['football_ult_points'] == 2 AND $points_type == 1)) + { + if ($curr_ary['win'] > 0) + { + switch($points_type) + { + case 3: + $points_comment = sprintf($user->lang['WIN_MATCHDAY']) . ' ' . $curr_ary['rank'] . '.' . sprintf($user->lang['PLACE']); + break; + case 4: + $points_comment = sprintf($user->lang['WIN_SEASON']) . ' ' . $curr_ary['rank'] . '.' . sprintf($user->lang['PLACE']); + break; + } + $userid = (!isset($curr_ary['user_id'])) ? $curr_user : $curr_ary['user_id']; + if ($cash) + { + if ($points_type == 1 OR $points_type == 7) + { + // substract bets and payouts + $functions_points->substract_points($userid, round($curr_ary['win'],2)); + } + else + { + $functions_points->add_points($userid, round($curr_ary['win'],2)); + } + } + $sql_ary = array( + 'season' => (int) $season, + 'league' => (int) $league, + 'matchday' => (int) $matchday, + 'points_type' => (int) $points_type, + 'user_id' => (int) $userid, + 'points' => round($curr_ary['win'],2), + 'points_comment'=> $points_comment, + 'cash' => $cash, + ); + $sql = 'INSERT INTO ' . FOOTB_POINTS . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + } + } +} + +function _sort_points($value_a, $value_b) +{ + if ($value_a['points'] > $value_b['points']) + { + return -1; + } + else + { + if ($value_a['points'] == $value_b['points']) + { + if (isset($value_a['nobet'])) + { + if ($value_a['nobet'] < $value_b['nobet']) + { + return -1; + } + else + { + if ($value_a['nobet'] == $value_b['nobet']) + { + return 0; + } + else + { + return 1; + } + } + } + else + { + return 0; + } + } + else + { + return 1; + } + } +} + + +/** +* Return season-array +*/ +function season_info($season) +{ + global $db; + $sql = 'SELECT * FROM ' . FOOTB_SEASONS . " WHERE season = $season"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + return $row; + } + else + { + return array(); + } + $db->sql_freeresult($result); +} + +/** +* Return league-array +*/ +function league_info($season, $league) +{ + global $db; + $sql = 'SELECT * FROM ' . FOOTB_LEAGUES . " + WHERE season = $season AND league = $league + "; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + return $row; + } + else + { + return array(); + } + $db->sql_freeresult($result); +} + +/** +* Return team-array +*/ +function team_info($season, $league, $team_id) +{ + global $db; + $sql = 'SELECT * FROM ' . FOOTB_TEAMS . " + WHERE season = $season AND league = $league AND team_id = $team_id + "; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + return $row; + } + else + { + return array(); + } + $db->sql_freeresult($result); +} + +/** +* Is user member of this league +*/ +function user_is_member($userid, $season, $league) +{ + global $db; + $sql = 'SELECT COUNT(*) AS counter + FROM ' . FOOTB_BETS . " + WHERE season = $season AND league = $league AND user_id = $userid"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + + if ($row['counter'] > 0) + { + return true; + } + else + { + return false; + } + $db->sql_freeresult($result); +} + +/** +* Count existing matches on matchday or league +*/ +function count_existing_matches($season, $league, $matchday) +{ + global $db; + $where_matchday = ($matchday) ? " AND matchday = $matchday" : ''; + $sql = 'SELECT COUNT(*) AS counter + FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league $where_matchday"; + $result = $db->sql_query($sql); + if ($row = $db->sql_fetchrow($result)) + { + return $row['counter']; + $db->sql_freeresult($result); + } + else + { + return 0; + } +} + +/** +* Determinate if join to league is allowed +*/ +function join_allowed($season, $league) +{ + global $db; + $league_info = league_info($season, $league); + if (! $league_info['join_by_user']) + { + return false; + } + else + { + if ($league_info['join_in_season']) + { + return true; + } + else + { + $sql = 'SELECT * FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season AND league = $league AND matchday = 1 AND status = 0 + "; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $db->sql_freeresult($result); + return true; + } + else + { + return false; + } + } + } +} + +/** +* Calculate status or delivery of matchday +*/ +function delivery($season, $league, $matchday) +{ + global $db, $user; + $delivery = ''; + $lang_dates = $user->lang['datetime']; + $sql = "SELECT *, + CONCAT( + CASE DATE_FORMAT(delivery_date,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(delivery_date,' %d.%m.%Y %H:%i') + ) AS deliverytime + FROM " . FOOTB_MATCHDAYS . " + WHERE season = $season AND league = $league AND matchday = $matchday"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + switch($row['status']) + { + case 0: + $delivery = '' . sprintf($user->lang['STATUS_TEXT0']) . $row['deliverytime'] . ''; + break; + case 1: + $delivery = '' . sprintf($user->lang['STATUS_TEXT1']) . ''; + break; + case 2: + $delivery = '' . sprintf($user->lang['STATUS_TEXT2']) . ''; + break; + case 3: + $delivery = '' . sprintf($user->lang['STATUS_TEXT3']) . ''; + break; + } + $db->sql_freeresult($result); + } + return $delivery; +} + +/** +* Calculate next delivery und return delivery string +*/ +function next_delivery($season, $league) +{ + global $db, $user; + $next_delivery = ''; + $lang_dates = $user->lang['datetime']; + $sql = "SELECT + CONCAT( + CASE DATE_FORMAT(delivery_date,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(delivery_date,' %d.%m.%Y %H:%i') + ) AS deliverytime + FROM " . FOOTB_MATCHDAYS . " + WHERE season = $season AND league = $league AND status = 0 + ORDER BY matchday ASC + "; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $next_delivery = "
". sprintf($user->lang['NEXT_DELIVERY_UNTIL']) . ' ' . $row['deliverytime'] . "
"; + $db->sql_freeresult($result); + } + return $next_delivery; +} + +/** +* Calculate first delivery of matchday for bet in time +*/ +function first_delivery($season, $league, $matchday) +{ + global $db, $user; + $sql = "SELECT MIN(match_datetime) AS min_match_datetime + FROM " . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND matchday = $matchday AND status = 0 + ORDER BY min_match_datetime ASC + "; + $result = $db->sql_query($sql); + $first_delivery = ''; + if ($row = $db->sql_fetchrow($result)) + { + $first_delivery = $row['min_match_datetime']; + $db->sql_freeresult($result); + } + return $first_delivery; +} + +/** +* Set matchday delivery to first open match +*/ +function set_bet_in_time_delivery($season, $league) +{ + global $db, $user, $config; + $sql = "SELECT * + FROM " . FOOTB_MATCHDAYS . " + WHERE season = $season AND league = $league AND status < 3 + "; + $result = $db->sql_query($sql); + $first_delivery = ''; + while ($row = $db->sql_fetchrow($result)) + { + $new_status = $row['status']; + + // match-status maybe changed + $sql_ary = array( + 'status' => 0, + 'goals_home' => '', + 'goals_guest' => '', + 'goals_overtime_home' => '', + 'goals_overtime_guest' => '', + ); + $local_board_time = time() + (($config['board_timezone'] - $config['football_host_timezone']) * 3600); + $sql = 'UPDATE ' . FOOTB_MATCHES . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday =" . $row['matchday'] . " AND match_datetime > FROM_UNIXTIME('$local_board_time')"; + $db->sql_query($sql); + + if ($db->sql_affectedrows()) + { + // an open match exist, so set status 0 + $new_status = 0; + } + $first_delivery = first_delivery($season, $league, $row['matchday']); + if ( $first_delivery <> '') + { + // Matchday has open matches so set matchday status = 0 and first delivery + $sql_ary = array( + 'status' => $new_status, + 'delivery_date' => $first_delivery, + 'delivery_date_2' => '', + 'delivery_date_3' => '', + ); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday =" . $row['matchday']; + $db->sql_query($sql); + } + } + $db->sql_freeresult($result); +} + + +/** +* return current season. The minimal seasons value with a open matchday (status = 0). +*/ +function curr_season() +{ + global $db, $lang, $user; + $curr_user = $user->data['user_id']; + $sql = 'SELECT DISTINCT s.season + FROM ' . FOOTB_SEASONS . ' AS s + INNER JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season) + INNER JOIN ' . FOOTB_MATCHDAYS . ' AS m ON (m.season = s.season AND m.league = l.league) + INNER JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.user_id = $curr_user) + WHERE m.status IN (0,1,2) + ORDER BY s.season ASC"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $curr_season = $row['season']; + $db->sql_freeresult($result); + } + else + { + $sql = 'SELECT DISTINCT s.season FROM ' . FOOTB_SEASONS . ' AS s + INNER JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season) + INNER JOIN ' . FOOTB_MATCHDAYS . ' AS m ON (m.season = s.season AND m.league = l.league) + WHERE 1 + ORDER BY s.season DESC'; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $curr_season = $row['season']; + } + else + { + $sql = 'SELECT * FROM ' . FOOTB_SEASONS; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $curr_season = $row['season']; + } + else + { + $curr_season = 0; + } + } + $db->sql_freeresult($result); + } + return $curr_season; +} + +/** +* return first (minmal) league of season +*/ +function first_league($season, $complete = true) +{ + global $db, $lang; + $join_matchday = ''; + if ($complete) + { + $join_matchday = 'INNER JOIN ' . FOOTB_MATCHDAYS . ' AS m ON (m.season = l.season AND m.league = l.league) '; + } + $sql = 'SELECT * + FROM ' . FOOTB_LEAGUES . ' AS l ' . + $join_matchday . " + WHERE l.season = $season + ORDER BY l.league ASC"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $first_league = $row['league']; + } + else + { + $first_league = 0; + } + $db->sql_freeresult($result); + return $first_league; +} + +/** +* return current (wait for results) league of season +*/ +function current_league($season) +{ + global $db, $lang, $user; + $curr_user = $user->data['user_id']; + $sql = 'SELECT m.league + FROM ' . FOOTB_MATCHES . ' AS m + INNER JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.user_id = $curr_user) + WHERE m.season = $season + AND m.status in (0,1,2) + ORDER BY m.match_datetime ASC"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $current_league = $row['league']; + } + else + { + $current_league = first_league($season); + } + $db->sql_freeresult($result); + return $current_league; +} + +/** +* return next free team-id +*/ +function nextfree_teamid() +{ + global $db, $lang; + $sql = 'SELECT Max(team_id) AS lastid FROM ' . FOOTB_TEAMS; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + return ($row['lastid'] + 1); + } + else + { + return 0; + } + $db->sql_freeresult($result); +} + +/** +* return current (in order to play) matchday of league +*/ +function curr_matchday($season, $league) +{ + global $db, $lang; + $sql = 'SELECT * FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season AND league = $league AND status < 3 + ORDER BY status DESC, delivery_date ASC + "; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $curr_matchday = $row['matchday']; + $db->sql_freeresult($result); + } + else + { + $sql = 'SELECT * FROM ' . FOOTB_MATCHDAYS . " + WHERE season = $season AND league = $league AND status = 3 + ORDER BY matchday DESC + "; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $curr_matchday = $row['matchday']; + } + else + { + $curr_matchday = 0; + } + $db->sql_freeresult($result); + } + return $curr_matchday; +} + + +/** +* Initialize user bets. Adds s user to a league. +*/ +function join_league($season, $league, $user_id) +{ + global $db, $lang; + + $league_info = league_info($season, $league); + $matchdays = $league_info['matchdays']; + if ($league_info['league_type'] == LEAGUE_CHAMP) + { + $matches_on_matchdays = $league_info['matches_on_matchday']; + } + else + { + $matches_on_matchdays = 0; + } + + $count_updates = 0; + $matches = $matches_on_matchdays; + $match_id = 1; + for($m_day = 1; $m_day <= $matchdays; $m_day++) + { + if ($matches_on_matchdays == 0) + { + $sql = 'SELECT matches from ' . FOOTB_MATCHDAYS . " WHERE season = $season AND league = $league AND matchday = $m_day"; + $result = $db->sql_query($sql); + if( $row = $db->sql_fetchrow($result)) + { + $matches = $row['matches']; + $db->sql_freeresult($result); + } + else + { + // Matchday doesnt exist + $matches = 0; + } + } + for($i = 1; $i<= $matches; $i++) + { + $sqlup = 'REPLACE INTO ' . FOOTB_BETS . " VALUES($season, $league, $match_id, $user_id, '', '', 0)"; + $resultup = $db->sql_query($sqlup); + $match_id++; + $count_updates++; + } + } + return $count_updates; +} + +// Close matchday +/** +* Close all open matches. +*/ +function close_open_matchdays() +{ + global $db, $lang, $config; + + $local_board_time = time() + (($config['board_timezone'] - $config['football_host_timezone']) * 3600); + $sql = 'SELECT * FROM ' . FOOTB_MATCHDAYS . " WHERE status = 0 AND delivery_date < FROM_UNIXTIME('$local_board_time')"; + $result = $db->sql_query($sql); + $toclose = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + foreach ($toclose as $close) + { + // Matchday to close + $season = $close['season']; + $league = $close['league']; + $matchday = $close['matchday']; + $league_info = league_info($season, $league); + + if ($league_info['bet_in_time'] == 1) + { + $sql_ary = array( + 'status' => 1, + ); + $sql = 'UPDATE ' . FOOTB_MATCHES . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday AND status = 0 AND match_datetime < FROM_UNIXTIME('$local_board_time')"; + $db->sql_query($sql); + + // Check remaining open matches + $first_delivery = first_delivery($season, $league, $close['matchday']); + if ($first_delivery <> '') + { + // Matchday has open matches so set matchday status = 0 and first delivery + $sql_ary = array( + 'status' => 0, + 'delivery_date' => first_delivery($season, $league, $close['matchday']), + ); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday"; + $db->sql_query($sql); + } + else + { + // Matchday has no open match so close the matchday with setting status = 1 + $sql_ary = array( + 'status' => 1, + ); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday"; + $db->sql_query($sql); + } + } + else + { + if ($close['delivery_date_2'] != '') + { + // More open matches exists, so shift delivery and status lower Null + $sql_ary = array( + 'delivery_date' => $close['delivery_date_2'], + 'delivery_date_2' => $close['delivery_date_3'], + 'delivery_date_3' => '', + ); + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE season = $season AND league = $league AND matchday = $matchday"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . FOOTB_MATCHES . " + SET status = status + 1 + WHERE season = $season AND league = $league AND matchday = $matchday AND status <= 0"; + $db->sql_query($sql); + } + else + { + // Close all matches of the matchday and matchday + $sql = 'UPDATE ' . FOOTB_MATCHDAYS . " + SET status = 1 + WHERE season = $season AND league = $league AND matchday = $matchday"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . FOOTB_MATCHES . " + SET status = status + 1 + WHERE season = $season AND league = $league AND matchday = $matchday AND status <= 0"; + $db->sql_query($sql); + } + } + // close extra bets + $sql = 'UPDATE ' . FOOTB_EXTRA . " + SET extra_status = extra_status + 1 + WHERE season = $season AND league = $league AND matchday = $matchday AND extra_status <= 0"; + $db->sql_query($sql); + } +} + +/** +* return matchday wins in array. +*/ +function matchday_wins($season, $league) +{ + global $db, $lang; + $matchday_wins = array(); + + $sql = 'SELECT * FROM ' . FOOTB_LEAGUES . " WHERE season = $season AND league = $league"; + $result = $db->sql_query($sql); + if ($row = $db->sql_fetchrow($result)) + { + $matchday_wins = explode(';',"0;" . $row['win_matchday']); + $db->sql_freeresult($result); + } + return $matchday_wins; +} + +/** +* return season wins in array. +*/ +function season_wins($season, $league, $matchday) +{ + global $db, $lang; + $season_wins = array(); + $season_user_wins = array(); + $league_info = league_info($season, $league); + if (sizeof($league_info)) + { + $season_wins = explode(';',"0;" . $league_info['win_season']); + $maxmatchday = $league_info['matchdays']; + } + else + { + $season_user_wins[0]['win'] = 0; + return $season_user_wins; + } + + $sql = 'SELECT + 1 AS rank, + user_id, + SUM(points) AS points + FROM ' . FOOTB_RANKS . " + WHERE season = $season + AND league = $league + AND matchday <= $matchday + AND status IN (2,3) + GROUP by user_id + ORDER BY points DESC, user_id ASC + "; + $result = $db->sql_query($sql); + $ranking_ary = array(); + while( $row = $db->sql_fetchrow($result)) + { + $ranking_ary[$row['user_id']] = $row; + } + $db->sql_freeresult($result); + + if ( sizeof($ranking_ary) > 0 ) + { + $sql = 'SELECT + eb.user_id, + SUM(eb.bet_points) AS points + FROM ' . FOOTB_EXTRA . ' AS e + INNER JOIN ' . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = e.season and eb.league = e.league and eb.extra_no = e.extra_no) + WHERE e.season = $season + AND e.league = $league + AND e.matchday <> e.matchday_eval + AND e.matchday_eval <= $matchday + AND e.extra_status > 1 + GROUP BY eb.user_id"; + + $result = $db->sql_query($sql); + while( $row = $db->sql_fetchrow($result)) + { + $ranking_ary[$row['user_id']]['points'] += $row['points']; + } + $db->sql_freeresult($result); + // sort the ranking by points + usort($ranking_ary, '_sort_points'); + + $last_points = -1; + $last_rank = 1; + $equal_rank = array(); + $money = array(); + $i = 0; + foreach( $ranking_ary AS $curr_user => $curr_rank) + { + if ( $curr_rank['points'] != $last_points) + { + $ranking_ary[$curr_user]['rank'] = $i + 1; + $last_rank = $i + 1; + $equal_rank[$last_rank] = 1; + $last_points = $curr_rank['points']; + if ($last_rank < sizeof($season_wins)) + { + $money[$last_rank] = $season_wins[$last_rank]; + } + else + { + $money[$last_rank] = 0; + } + } + else + { + $ranking_ary[$curr_user]['rank'] = $last_rank; + $equal_rank[$last_rank] += 1; + if ($i + 1 < sizeof($season_wins)) + { + $money[$last_rank] += $season_wins[$i + 1]; + } + } + $i++; + } + foreach( $ranking_ary AS $curr_rank) + { + if ( round($money[$curr_rank['rank']] / $equal_rank[$curr_rank['rank']], 2) <> 0 ) + { + $season_user_wins[$curr_rank['user_id']]['win'] = round($money[$curr_rank['rank']] / $equal_rank[$curr_rank['rank']], 2); + } + else + { + $season_user_wins[$curr_rank['user_id']]['win'] = 0; + } + $season_user_wins[$curr_rank['user_id']]['rank'] = $curr_rank['rank']; + } + return $season_user_wins; + } + else + { + $season_user_wins[0]['win'] = 0; + return $season_user_wins; + } +} + +/** +* return win most hits in array. +*/ +function win_user_most_hits($season, $league, $matchday) +{ + global $db, $lang; + + $sql = 'SELECT * FROM ' . FOOTB_LEAGUES . " WHERE season = $season AND league = $league"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $win_most_hits = $row['win_result']; + $last_matchday = $row['matchdays']; + $db->sql_freeresult($result); + } + + $sql = 'SELECT + b.user_id AS userid, + COUNT(*) AS hits + FROM ' . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + WHERE m.season = $season AND m.league = $league AND m.matchday <= $matchday AND m.goals_home = b.goals_home AND + m.goals_guest = b.goals_guest AND m.status IN (2,3) + GROUP BY b.user_id + ORDER BY hits DESC + "; + $result = $db->sql_query($sql); + + $last_count_hits = -1; + $count_user = 0; + $userid_ary = array(); + $hits = array(); + $rank = array(); + $equal_rank = array(); + $win_pos_most_hits = array(); + while( $row = $db->sql_fetchrow($result)) + { + $userid_ary[$count_user] = $row['userid']; + $hits[$count_user] = $row['hits']; + if ($count_user == 0) + { + $rank[$count_user] = 1; + $equal_rank[$rank[$count_user]] = 1; + $win_pos_most_hits[$rank[$count_user]] = $win_most_hits; + } + else + { + if ( $row['hits'] != $last_count_hits) + { + $rank[$count_user] = $count_user + 1; + $equal_rank[$rank[$count_user]] = 1; + $win_pos_most_hits[$rank[$count_user]] = 0; + } + else + { + $rank[$count_user] = $rank[$count_user-1]; + $equal_rank[$rank[$count_user]] += 1; + } + } + $last_count_hits = $row['hits']; + $count_user++; + } + $db->sql_freeresult($result); + $win_user_most_hits = array(); + for($i = 0; $i < $count_user; $i++) + { + $win_user_most_hits[$userid_ary[$i]]['direct_hit'] = $hits[$i]; + if ($matchday == $last_matchday) + { + if (round($win_pos_most_hits[$rank[$i]]/$equal_rank[$rank[$i]],2) <> 0) + { + $win_user_most_hits[$userid_ary[$i]]['win'] = round($win_pos_most_hits[$rank[$i]]/$equal_rank[$rank[$i]],2); + } + else + { + $win_user_most_hits[$userid_ary[$i]]['win'] = 0; + } + } + else + { + $win_user_most_hits[$userid_ary[$i]]['win'] = 0; + } + } + if ($count_user > 0) + { + return $win_user_most_hits; + } + else + { + $win_user_most_hits[0]['win'] = 0; + return $win_user_most_hits; + } +} + +/** +* return win most hits away in array. +*/ +function win_user_most_hits_away($season, $league, $matchday) +{ + global $db, $lang; + + $sql = 'SELECT * FROM ' . FOOTB_LEAGUES . " WHERE season = $season AND league = $league"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $win_most_hits_away = $row['win_result_02']; + $last_matchday = $row['matchdays']; + $db->sql_freeresult($result); + } + + $sql = 'SELECT + b.user_id AS userid, + SUM(IF(m.goals_home <= m.goals_guest,1,0)) AS hits_away + FROM ' . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) + WHERE m.season = $season AND m.league = $league AND m.matchday <= $matchday AND m.goals_home = b.goals_home AND + m.goals_guest = b.goals_guest AND m.status IN (2,3) + GROUP BY b.user_id + ORDER BY hits_away DESC + "; + $result = $db->sql_query($sql); + + $last_hits_away = -1; + $count_user = 0; + $userid_ary = array(); + $hits_away = array(); + $rank = array(); + $equal_rank = array(); + $win_pos_most_hits_away = array(); + while( $row = $db->sql_fetchrow($result)) + { + $userid_ary[$count_user] = $row['userid']; + $hits_away[$count_user] = $row['hits_away']; + if ($count_user == 0) + { + $rank[$count_user] = 1; + $equal_rank[$rank[$count_user]] = 1; + $win_pos_most_hits_away[$rank[$count_user]] = $win_most_hits_away; + } + else + { + if ( $row['hits_away'] != $last_hits_away) + { + $rank[$count_user] = $count_user + 1; + $equal_rank[$rank[$count_user]] = 1; + $win_pos_most_hits_away[$rank[$count_user]] = 0; + } + else + { + $rank[$count_user] = $rank[$count_user-1]; + $equal_rank[$rank[$count_user]] += 1; + } + } + $last_hits_away = $row['hits_away']; + $count_user++; + } + $db->sql_freeresult($result); + $win_user_most_hits_away = array(); + for($i = 0; $i < $count_user; $i++) + { + $win_user_most_hits_away[$userid_ary[$i]]['direct_hit'] = $hits_away[$i]; + if ($matchday == $last_matchday) + { + if (round($win_pos_most_hits_away[$rank[$i]]/$equal_rank[$rank[$i]],2) <> 0) + { + $win_user_most_hits_away[$userid_ary[$i]]['win'] = round($win_pos_most_hits_away[$rank[$i]]/$equal_rank[$rank[$i]],2); + } + else + { + $win_user_most_hits_away[$userid_ary[$i]]['win'] = 0; + } + } + else + { + $win_user_most_hits_away[$userid_ary[$i]]['win'] = 0; + } + } + if ($count_user > 0) + { + return $win_user_most_hits_away; + } + else + { + $win_user_most_hits_away[0]['win'] = 0; + return $win_user_most_hits_away; + } +} + +/** +* return colorstyle to status. +*/ +function color_style($status) +{ + switch ($status) + { + case 2: + $colorstyle = 'color_provisionally'; + break; + case 3: + $colorstyle = 'color_finally'; + break; + case 4: + case 5: + case 6: + $colorstyle = 'color_not_rated'; + break; + default: + $colorstyle = ''; + break; + } + return $colorstyle; +} + + +/** +* color text on match status. +*/ +function color_match($text, $status) +{ + switch($status) + { + case 2: + $colormatch = "". $text. ''; + break; + case 3: + $colormatch = "". $text. ''; + break; + case 4: + case 5: + case 6: + $colormatch = "". $text. ''; + break; + default: + $colormatch = $text; + break; + } + return $colormatch; +} + +/** +* color text on points status. +*/ +function color_points($text, $status) +{ + switch($status) + { + case 2: + $color_points = "". $text. ''; + break; + case 3: + $color_points = "". $text. ''; + break; + default: + $color_points = $text; + break; + } + return $color_points; +} + +/** +* determine team items from formula. +*/ +function get_team($season, $league, $matchnumber, $field, $formula) +{ + global $db, $lang, $user; + $first_letter = substr($formula, 0, 1); + $para = substr($formula, 2, 7); + $para_ary = explode(";",$para); + + switch($first_letter) + { + case 'D': + // Drawing + return '#0#' . sprintf($user->lang['DRAWING']) . '#' . sprintf($user->lang['DRAWING']); + break; + case 'G': + // GROUP + $group = substr($para_ary[0], 0, 1); + $place = substr($para_ary[0], 1, 1); + $sql = ' + SELECT + SUM(1) AS matches, + SUM(IF(m.status = 3, 1, 0)) AS played + FROM ' . FOOTB_MATCHES . " AS m + WHERE m.season = $season AND m.league = $league AND m.group_id = '$group' + GROUP BY m.group_id + "; + $result = $db->sql_query($sql); + + if ( $row = $db->sql_fetchrow($result)) + { + if ($row['matches'] == $row['played']) + { + $sql = ' + SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS win, + SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 < goals_guest, 1, 0), IF(goals_home + 0 > goals_guest, 1, 0))) AS lose, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_home + 0 > goals_guest, + 3, + IF(goals_home = goals_guest, + 1, + 0 + ) + ), + IF(goals_home + 0 < goals_guest, + 3, + IF(goals_home = goals_guest, + 1, + 0 + ) + ) + ) + ) AS points, + SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest, goals_guest - goals_home)) AS goal_diff, + SUM(IF(m.team_id_home = t.team_id, goals_home, goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id, goals_guest, goals_home)) AS goals_get + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league AND + (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) + WHERE t.season = $season AND t.league = $league AND m.group_id = '$group' + GROUP BY t.team_id + ORDER BY points DESC, goal_diff DESC, goals DESC + "; + $result = $db->sql_query($sql); + $rowset = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + if (1 == $place) + { + if ($rowset[0]['points'] == $rowset[1]['points'] AND $rowset[0]['goal_diff'] == $rowset[1]['goal_diff'] AND $rowset[0]['goals'] == $rowset[1]['goals']) + { + return '#0#' . $place . '. ' . sprintf($user->lang['GROUP']) . ' ' . $place . '#' . $place . '. ' . sprintf($user->lang['GROUP']) . ' ' . $group; + } + else + { + $new_id = $rowset[0]['team_id']; + $sqlup = 'UPDATE ' . FOOTB_MATCHES . " SET $field = $new_id WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $resultup = $db->sql_query($sqlup); + $sqlup = 'UPDATE ' . FOOTB_TEAMS . ' SET matchday = (SELECT max(matchday) FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND (team_id_home= $new_id OR team_id_guest = $new_id)) + WHERE season = $season AND league = $league AND team_id = $new_id"; + $resultup = $db->sql_query($sqlup); + return $rowset[0]['team_symbol'] . '#' . $new_id . '#' . $rowset[0]['team_name'] . '#' . $rowset[0]['team_name_short']; + } + } + else + { + // second + if (($rowset[0]['points'] == $rowset[1]['points'] AND $rowset[0]['goal_diff'] == $rowset[1]['goal_diff'] AND $rowset[0]['goals'] == $rowset[1]['goals'] ) OR + ($rowset[2]['points'] == $rowset[1]['points'] AND $rowset[2]['goal_diff'] == $rowset[1]['goal_diff'] AND $rowset[2]['goals'] == $rowset[1]['goals'] )) + { + return '#0#' . $place . '. ' . sprintf($user->lang['GROUP']) . ' ' . $group . '#' . $place . '. ' . sprintf($user->lang['GROUP']) . ' ' . $group; + } + else + { + $new_id = $rowset[1]['team_id']; + $sqlup = 'UPDATE ' . FOOTB_MATCHES . " SET $field = $new_id WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $resultup = $db->sql_query($sqlup); + $sqlup = 'UPDATE ' . FOOTB_TEAMS . ' SET matchday = (SELECT max(matchday) FROM ' . FOOTB_MATCHES . " + WHERE season = $season AND league = $league AND (team_id_home= $new_id OR team_id_guest = $new_id)) + WHERE season = $season AND league = $league AND team_id = $new_id"; + $resultup = $db->sql_query($sqlup); + return $rowset[1]['team_symbol'] . '#' . $new_id . '#' . $rowset[1]['team_name'] . '#' . $rowset[1]['team_name_short']; + } + } + } + else + { + return '#0#' . $place . '. ' . sprintf($user->lang['GROUP']) . ' ' . $group . '#' . $place . '. ' . sprintf($user->lang['GROUP']) . ' ' . $group; + } + } + else + { + return '#0#' . $place . '. ' . sprintf($user->lang['GROUP']) . ' ' . $group . '#' . $place . '. ' . sprintf($user->lang['GROUP']) . ' ' . $group; + } + break; + case 'L': + // Looser + switch(sizeof($para_ary)) + { + case 1: + $sql = 'SELECT + m.status, + m.team_id_home AS home_id, + m.team_id_guest AS guest_id, + t1.team_symbol AS home_symbol, + t2.team_symbol AS guest_symbol, + t1.team_name AS home_name, + t2.team_name AS guest_name, + t1.team_name_short AS home_sname, + t2.team_name_short AS guest_sname, + m.goals_overtime_home, + m.goals_overtime_guest, + m.goals_home, + m.goals_guest + FROM ' . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) + WHERE m.season = $season AND m.league = $league AND m.match_no = $para_ary[0]"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + if ((3 == $row['status']) OR (6 == $row['status'])) + { + if ($row['goals_home'] > $row['goals_guest'] OR $row['goals_overtime_home'] > $row['goals_overtime_guest']) + { + $new_id = $row['guest_id']; + $sqlup = 'UPDATE ' . FOOTB_MATCHES . " SET $field = $new_id WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $resultup = $db->sql_query($sqlup); + return $row['guest_symbol'] . '#' . $row['guest_id'] . '#' . $row['guest_name'] . '#' . $row['guest_sname']; + } + if ($row['goals_home'] < $row['goals_guest'] OR $row['goals_overtime_home'] < $row['goals_overtime_guest']) + { + $new_id = $row['home_id']; + $sqlup = 'UPDATE ' . FOOTB_MATCHES . " SET $field = $new_id WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $resultup = $db->sql_query($sqlup); + return $row['home_symbol'] . '#' . $row['home_id'] . '#' . $row['home_name'] . '#' . $row['home_sname']; + } + } + else + { + return '#0#' . sprintf($user->lang['LOOSER_MATCH_NO']) . $para_ary[0] . '#' . sprintf($user->lang['LOOSER']) . ' ' . $para_ary[0]; + } + } + break; + default: + return '#0#' . sprintf($user->lang['DRAWING']) . '#' . sprintf($user->lang['DRAWING']); + break; + } + break; + case 'W': + // Winner + switch(sizeof($para_ary)) + { + case 1: + $sql = 'SELECT + m.status, + m.team_id_home AS home_id, + m.team_id_guest AS guest_id, + t1.team_symbol AS home_symbol, + t2.team_symbol AS guest_symbol, + t1.team_name AS home_name, + t2.team_name AS guest_name, + t1.team_name_short AS home_sname, + t2.team_name_short AS guest_sname, + m.goals_overtime_home, + m.goals_overtime_guest, + m.goals_home, + m.goals_guest + FROM ' . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) + WHERE m.season = $season AND m.league = $league AND m.match_no = $para_ary[0]"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + if ((3 == $row['status']) OR (6 == $row['status'])) + { + if ($row['goals_home'] > $row['goals_guest'] OR $row['goals_overtime_home'] > $row['goals_overtime_guest']) + { + $new_id = $row['home_id']; + $sqlup = 'UPDATE ' . FOOTB_MATCHES . " SET $field = $new_id WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $resultup = $db->sql_query($sqlup); + return $row['home_symbol'] . '#' . $row['home_id'] . '#' . $row['home_name'] . '#' . $row['home_sname']; + } + if ($row['goals_home'] < $row['goals_guest'] OR $row['goals_overtime_home'] < $row['goals_overtime_guest']) + { + $new_id = $row['guest_id']; + $sqlup = 'UPDATE ' . FOOTB_MATCHES . " SET $field = $new_id WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $resultup = $db->sql_query($sqlup); + return $row['guest_symbol'] . '#' . $row['guest_id'] . '#' . $row['guest_name'] . '#' . $row['guest_sname']; + } + } + else + { + if ($row['home_sname'] != '' AND $row['guest_sname'] != '') + { + return '#0#' . $row['home_sname'] . ' / ' . $row['guest_sname'] . '#' . $row['home_sname'] . '+' . $row['guest_sname']; + } + else + { + return '#0#' . sprintf($user->lang['WINNER_MATCH_NO']) . $para_ary[0] . '#' . sprintf($user->lang['WINNER']) . ' ' . $para_ary[0]; + } + } + } + break; + case 2: + + $sql = 'SELECT + m.status, + m.team_id_home AS home_id, + m.team_id_guest AS guest_id, + t1.team_symbol AS home_symbol, + t2.team_symbol AS guest_symbol, + t1.team_name AS home_name, + t2.team_name AS guest_name, + t1.team_name_short AS home_sname, + t2.team_name_short AS guest_sname, + m.goals_overtime_home, + m.goals_overtime_guest, + m.goals_home, + m.goals_guest + FROM ' . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) + LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) + WHERE m.season = $season AND m.league = $league AND (m.match_no = $para_ary[0] OR m.match_no = $para_ary[1]) + ORDER BY m.match_no ASC"; + $result = $db->sql_query($sql); + + if ($firstleg = $db->sql_fetchrow($result)) + { + if ($replay = $db->sql_fetchrow($result)) + { + if (((3 == $firstleg['status']) OR (6 == $firstleg['status'])) AND ((3 == $replay['status']) OR (6 == $replay['status']))) + { + if ($firstleg['home_id'] == $replay['guest_id'] AND $firstleg['guest_id'] == $replay['home_id']) + { + if ($firstleg['goals_home'] + $replay['goals_guest'] > $firstleg['goals_guest'] + $replay['goals_home'] OR $replay['goals_overtime_guest'] > $replay['goals_overtime_home'] OR + ($firstleg['goals_home'] + $replay['goals_guest'] == $firstleg['goals_guest'] + $replay['goals_home'] AND $replay['goals_guest'] > $firstleg['goals_guest'])) + { + $new_id = $firstleg['home_id']; + $sqlup = 'UPDATE ' . FOOTB_MATCHES . " SET $field = $new_id WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $resultup = $db->sql_query($sqlup); + return $firstleg['home_symbol'] . '#' . $firstleg['home_id'] . '#' . $firstleg['home_name'] . '#' . $firstleg['home_sname']; + } + if ($firstleg['goals_home'] + $replay['goals_guest'] < $firstleg['goals_guest'] + $replay['goals_home'] OR $replay['goals_overtime_guest'] < $replay['goals_overtime_home'] OR + ($firstleg['goals_home'] + $replay['goals_guest'] == $firstleg['goals_guest'] + $replay['goals_home'] AND $firstleg['goals_guest'] > $replay['goals_guest'])) + { + $new_id = $firstleg['guest_id']; + $sqlup = 'UPDATE ' . FOOTB_MATCHES . " SET $field = $new_id WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $resultup = $db->sql_query($sqlup); + return $firstleg['guest_symbol'] . '#' . $firstleg['guest_id'] . '#' . $firstleg['guest_name'] . '#' . $firstleg['guest_sname']; + } + } + else if ($firstleg['home_id'] == $replay['home_id'] AND $firstleg['guest_id'] == $replay['guest_id']) + { + if ($firstleg['goals_home'] + $replay['goals_home'] <= $firstleg['goals_guest'] + $replay['goals_guest'] OR $replay['goals_overtime_home'] < $replay['goals_overtime_guest']) + { + $new_id = $firstleg['guest_id']; + $sqlup = 'UPDATE ' . FOOTB_MATCHES . " SET $field = $new_id WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $resultup = $db->sql_query($sqlup); + return $firstleg['guest_symbol'] . '#' . $firstleg['guest_id'] . '#' . $firstleg['guest_name'] . '#' . $firstleg['guest_sname']; + } + else + { + $new_id = $firstleg['home_id']; + $sqlup = 'UPDATE ' . FOOTB_MATCHES . " SET $field = $new_id WHERE season = $season AND league = $league AND match_no = $matchnumber"; + $resultup = $db->sql_query($sqlup); + return $firstleg['home_symbol'] . '#' . $firstleg['home_id'] . '#' . $firstleg['home_name'] . '#' . $firstleg['home_sname']; + } + } + else + { + return '#0#' . sprintf($user->lang['MATCH_ERROR']) . '#' . sprintf($user->lang['FORMULA']) . '!'; + } + } + else + { + if ($firstleg['home_sname'] != '' AND $firstleg['guest_sname'] != '') + { + return '#0#' . $firstleg['home_sname'] . ' / ' . $firstleg['guest_sname'] . '#' . $firstleg['home_sname'] . '+' . $firstleg['guest_sname']; + } + else + { + return '#0#' . sprintf($user->lang['WINNER_MATCH_NO']) . ' ' . $para_ary[0] . '+' . $para_ary[1] . '#S. ' . $para_ary[0] . '+' . $para_ary[1]; + } + } + } + else + { + return '#0#' . sprintf($user->lang['SEC_LEG_ERROR']) . '#' . sprintf($user->lang['FORMULA']) . '!'; + } + } + else + { + return '#0#' . sprintf($user->lang['FIRSTLEG_ERROR']) . '#' . sprintf($user->lang['FORMULA']) . '!'; + } + break; + default: + return '#0#Los#Los'; + break; + } + break; + default: + return '#0#' . sprintf($user->lang['DRAWING']) . '#' . sprintf($user->lang['DRAWING']); + break; + } +} + +/** +* KO-matches: Set team to next round. +*/ +function ko_next_round($season, $league, $matchday_from, $matchday_to, $matchday_new) +{ + global $db, $user; + $sql = 'SELECT + t.team_id, + t.team_name, + SUM(1) AS matches, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_overtime_home + goals_overtime_guest > 0, + goals_overtime_home, + goals_home + ), + IF(goals_overtime_home + goals_overtime_guest > 0, + goals_overtime_guest, + goals_guest + ) + ) + ) AS goals, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_overtime_home + goals_overtime_guest > 0, + goals_overtime_guest, + goals_guest + ), + IF(goals_overtime_home + goals_overtime_guest > 0, + goals_overtime_home, + goals_home + ) + ) + ) AS goals_get, + SUM(IF(m.team_id_home = t.team_id, + 0, + IF(goals_overtime_home + goals_overtime_guest > 0, + goals_overtime_guest, + goals_guest + ) + ) + ) AS goals_away, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_overtime_home + goals_overtime_guest > 0, + goals_overtime_guest, + goals_guest + ), + 0 + ) + ) AS goals_away_opp + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.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 AND m.matchday >= $matchday_from AND m.matchday <= $matchday_to AND m.status IN (3,6) + GROUP BY t.team_id"; + $result = $db->sql_query($sql); + + $message = sprintf($user->lang['KO_NEXT']) . ':

'; + while ($row = $db->sql_fetchrow($result)) + { + if (($matchday_to == $matchday_from AND $row['matches'] == 1) OR ($matchday_to != 0 AND $row['matches'] == 2)) + { + if (($row['goals'] > $row['goals_get']) OR + (($row['goals'] == $row['goals_get']) AND ($row['goals_away'] > $row['goals_away_opp']))) + { + $team_id = $row['team_id']; + $sqlup = 'UPDATE ' . FOOTB_TEAMS . " SET matchday = $matchday_new WHERE season = $season AND league = $league AND team_id = $team_id"; + $resultup = $db->sql_query($sqlup); + $message .= $row['team_name'] . '
'; + } + } + } + $db->sql_freeresult($result); + + $message .= '
'; + return $message; +} + +/** +* KO-matches: Set groupleaders next round. +*/ +function ko_group_next_round($season, $league, $matchday_from, $matchday_to, $matchday_new, $rank, $move_rank, $move_league, $move_matchday) +{ + global $db, $user; + $sql = ' + SELECT + t.*, + SUM(1) AS matches + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) + WHERE t.season = $season AND t.league = $league AND m.matchday >= $matchday_from AND m.matchday <= $matchday_to AND m.status NOT IN (3,6) + GROUP BY t.team_id + "; + $result = $db->sql_query($sql); + $rowset = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + if (sizeof($rowset) > 0) + { + $message = sprintf($user->lang['NO_KO_NEXT']); + $messag_moved = ''; + } + else + { + $sql = ' + SELECT + t.*, + SUM(1) AS matches, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS win, + SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, + SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 < goals_guest, 1, 0), IF(goals_home + 0 > goals_guest, 1, 0))) AS lose, + SUM(IF(m.team_id_home = t.team_id, + IF(goals_home + 0 > goals_guest, + 3, + IF(goals_home = goals_guest, + 1, + 0 + ) + ), + IF(goals_home + 0 < goals_guest, + 3, + IF(goals_home = goals_guest, + 1, + 0 + ) + ) + ) + ) AS points, + SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest, goals_guest - goals_home)) AS goal_diff, + SUM(IF(m.team_id_home = t.team_id, goals_home, goals_guest)) AS goals, + SUM(IF(m.team_id_home = t.team_id, goals_guest, goals_home)) AS goals_get + FROM ' . FOOTB_TEAMS . ' AS t + LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) + WHERE t.season = $season AND t.league = $league AND m.matchday >= $matchday_from AND m.matchday <= $matchday_to AND m.status IN (3,6) + GROUP BY t.team_id + ORDER BY group_id ASC,points DESC, goal_diff DESC, goals DESC + "; + $result = $db->sql_query($sql); + + $message = sprintf($user->lang['KO_NEXT_CHECK']) . ':

'; + $message .= sprintf($user->lang['KO_NEXT']) . ':

'; + $messag_moved = '

' . sprintf($user->lang['KO_MOVED']) . ':
'; + $group_id = 'XX'; + while ($row = $db->sql_fetchrow($result)) + { + if ($group_id != $row['group_id']) + { + $place = 1; + $group_id = $row['group_id']; + } + + if ($place <= $rank) + { + $team_id = $row['team_id']; + $sqlup = 'UPDATE ' . FOOTB_TEAMS . " SET matchday = $matchday_new WHERE season = $season AND league = $league AND team_id = $team_id"; + $resultup = $db->sql_query($sqlup); + $message .= $row['team_name'] . '
'; + } + if ($move_rank > 0 AND $move_league > 0 AND $place == $move_rank) + { + $team_id = $row['team_id']; + $team_name = $row['team_name']; + $short_name = $row['team_name_short']; + $team_sign = $row['team_symbol']; + $sqlinsert = 'INSERT INTO ' . FOOTB_TEAMS . " VALUES($season, $move_league, $team_id, '$team_name', '$short_name', '$team_sign', '', $move_matchday)"; + $resultinsert = $db->sql_query($sqlinsert); + $messag_moved .= $row['team_name'] . '
'; + } + $place++; + } + } + $db->sql_freeresult($result); + + $message .= '

'; + return $message. $messag_moved; +} + +/** +* return SQL statement part to calculate points depending to mode. +*/ +function select_points($creator = 'm', $sum = false) +{ + global $league_info; + + $points_result = $league_info['points_result']; + $points_tendency = $league_info['points_tendency']; + $points_diff = $league_info['points_diff']; + + switch ($league_info['points_mode']) + { + // hit = points_result + // right tendency (not draw) = points_result - difference between bet und result but minimal points_tendency + // right tendency (draw) = points_result - difference between bet goals home und result goals home + case 1: + $select_part = ($sum ? "SUM(IF(b.goals_home <> '' AND b.goals_guest <> ''," : 'IF(((m.status = 2) OR (m.status = 3)),') . + "IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> ($creator.goals_home + 0 < $creator.goals_guest) + OR (b.goals_home = b.goals_guest) <> ($creator.goals_home = $creator.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> ($creator.goals_home + 0 > $creator.goals_guest), + " .($sum ? '0' : "''") . ", + IF((b.goals_home = $creator.goals_home) AND (b.goals_guest = $creator.goals_guest), + $points_result, + IF((b.goals_home = b.goals_guest), + $points_result - ABS(b.goals_home - $creator.goals_home), + IF((($points_result - ABS(b.goals_home - $creator.goals_home) - ABS(b.goals_guest - $creator.goals_guest)) < $points_tendency), + $points_tendency, + $points_result - ABS(b.goals_home - $creator.goals_home) - ABS(b.goals_guest - $creator.goals_guest) + ) + ) + ) + ), + " .($sum ? '0' : "''") . ' + ), + ' .($sum ? '0' : "''") . " + ) " .($sum ? ')' : '') . 'AS points'; + break; + // hit = points_result, + // right tendency = points_result - difference between bet und result but minimal points_tendency + case 2: + $select_part = ($sum ? "SUM(IF(b.goals_home <> '' AND b.goals_guest <> ''," : 'IF(((m.status = 2) OR (m.status = 3)),') . + "IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> ($creator.goals_home + 0 < $creator.goals_guest) + OR (b.goals_home = b.goals_guest) <> ($creator.goals_home = $creator.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> ($creator.goals_home + 0 > $creator.goals_guest), + " .($sum ? '0' : "''") . ", + IF((b.goals_home = $creator.goals_home) AND (b.goals_guest = $creator.goals_guest), + $points_result, + IF((b.goals_home = b.goals_guest), + $points_result - ABS(b.goals_home - $creator.goals_home) - ABS(b.goals_guest - $creator.goals_guest), + IF((($points_result - ABS(b.goals_home - $creator.goals_home) - ABS(b.goals_guest - $creator.goals_guest)) < $points_tendency), + $points_tendency, + $points_result - ABS(b.goals_home - $creator.goals_home) - ABS(b.goals_guest - $creator.goals_guest) + ) + ) + ) + ), + " .($sum ? '0' : "''") . ' + ), + ' .($sum ? '0' : "''") . " + ) " .($sum ? ')' : '') . 'AS points'; + break; + // hit = points_result, + // right tendency = points_tendency + case 3: + $select_part = ($sum ? "SUM(IF(b.goals_home <> '' AND b.goals_guest <> ''," : 'IF(((m.status = 2) OR (m.status = 3)),') . + "IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> ($creator.goals_home + 0 < $creator.goals_guest) + OR (b.goals_home = b.goals_guest) <> ($creator.goals_home = $creator.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> ($creator.goals_home + 0 > $creator.goals_guest), + " .($sum ? '0' : "''") . ", + IF((b.goals_home = $creator.goals_home) AND (b.goals_guest = $creator.goals_guest), + $points_result, + $points_tendency + ) + ), + " .($sum ? '0' : "''") . ' + ), + ' .($sum ? '0' : "''") . " + ) " .($sum ? ')' : '') . 'AS points'; + break; + // hit = points_result, + // right goal-difference = points_diff, + // right tendency = points_tendency + case 4: + $select_part = ($sum ? "SUM(IF(b.goals_home <> '' AND b.goals_guest <> ''," : 'IF(((m.status = 2) OR (m.status = 3)),') . + "IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> ($creator.goals_home + 0 < $creator.goals_guest) + OR (b.goals_home = b.goals_guest) <> ($creator.goals_home = $creator.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> ($creator.goals_home + 0 > $creator.goals_guest), + " .($sum ? '0' : "''") . ", + IF((b.goals_home = $creator.goals_home) AND (b.goals_guest = $creator.goals_guest), + $points_result, + IF((b.goals_home - b.goals_guest = $creator.goals_home - $creator.goals_guest), + $points_diff, + $points_tendency + ) + ) + ), + " .($sum ? '0' : "''") . ' + ), + ' .($sum ? '0' : "''") . " + ) " .($sum ? ')' : '') . 'AS points'; + break; + // hit = points_result, + // right goal-difference (not draw) = points_diff, + // right tendency = points_tendency + case 5: + $select_part = ($sum ? "SUM(IF(b.goals_home <> '' AND b.goals_guest <> ''," : 'IF(((m.status = 2) OR (m.status = 3)),') . + "IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> ($creator.goals_home + 0 < $creator.goals_guest) + OR (b.goals_home = b.goals_guest) <> ($creator.goals_home = $creator.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> ($creator.goals_home + 0 > $creator.goals_guest), + " .($sum ? '0' : "''") . ", + IF((b.goals_home = $creator.goals_home) AND (b.goals_guest = $creator.goals_guest), + $points_result, + IF(((b.goals_home - b.goals_guest = $creator.goals_home - $creator.goals_guest) + AND ($creator.goals_home <> $creator.goals_guest)) , + $points_diff, + $points_tendency + ) + ) + ), + " .($sum ? '0' : "''") . ' + ), + ' .($sum ? '0' : "''") . " + ) " .($sum ? ')' : '') . 'AS points'; + break; + // hit = points_result, + // right tendency draw = points_diff, + // right tendency (not draw) = points_tendency + case 6: + $select_part = ($sum ? "SUM(IF(b.goals_home <> '' AND b.goals_guest <> ''," : 'IF(((m.status = 2) OR (m.status = 3)),') . + "IF(b.goals_home <> '' AND b.goals_guest <> '', + IF((b.goals_home + 0 < b.goals_guest) <> ($creator.goals_home + 0 < $creator.goals_guest) + OR (b.goals_home = b.goals_guest) <> ($creator.goals_home = $creator.goals_guest) + OR (b.goals_home + 0 > b.goals_guest) <> ($creator.goals_home + 0 > $creator.goals_guest), + " .($sum ? '0' : "''") . ", + IF((b.goals_home = $creator.goals_home) AND (b.goals_guest = $creator.goals_guest), + $points_result, + IF(((b.goals_home = b.goals_guest) AND ($creator.goals_home = $creator.goals_guest) ) , + $points_diff, + $points_tendency + ) + ) + ), + " .($sum ? '0' : "''") . ' + ), + ' .($sum ? '0' : "''") . " + ) " .($sum ? ')' : '') . 'AS points'; + break; + } + return $select_part; +} +?> \ No newline at end of file diff --git a/includes/version_check.php b/includes/version_check.php new file mode 100644 index 0000000..0852ace --- /dev/null +++ b/includes/version_check.php @@ -0,0 +1,115 @@ +version_data = $version_data; + $this->config = $config; + $this->version_helper = $version_helper; + $this->template = $template; + $this->user = $user; + $this->current_version = $this->config[str_replace(' ', '', $this->version_data['version'])]; + } + + /** + * Check Extension version and assign template variables for version info if not + * returning current version + * + * @param bool $return_version Yes if current version should be returned + * @return string Current version if $return_version is set to true + */ + public function check($return_version = false) + { + $allow_url_fopen = (int) @ini_get('allow_url_fopen'); + if ($allow_url_fopen) + { + + // Set file location + $this->version_helper->set_file_location($this->version_data['file'][0], $this->version_data['file'][1], $this->version_data['file'][2]); + // Set current version + $this->version_helper->set_current_version($this->current_version); + + $this->version_helper->force_stability(($this->config['extension_force_unstable'] || !$this->version_helper->is_stable($this->current_version)) ? 'unstable' : null); + + $updates = $this->version_helper->get_suggested_updates(true); + + // Return version if $return_version is set to true + if ($return_version) + { + return $this->current_version; + } + + $version_up_to_date = empty($updates); + + $template_data = array( + 'AUTHOR' => $this->version_data['author'], + 'CURRENT_VERSION' => $this->current_version, + 'UP_TO_DATE' => sprintf((!$version_up_to_date) ? $this->user->lang['NOT_UP_TO_DATE'] : $this->user->lang['UP_TO_DATE'], $this->version_data['title']), + 'S_UP_TO_DATE' => $version_up_to_date, + 'U_AUTHOR' => 'http://www.phpbb.com/community/memberlist.php?mode=viewprofile&un=' . $this->version_data['author'], + 'TITLE' => (string) $this->version_data['title'], + 'LATEST_VERSION' => $this->current_version, + ); + + if (!$version_up_to_date) + { + $updates = array_shift($updates); + $template_data = array_merge($template_data, array( + 'ANNOUNCEMENT' => (string) $updates['announcement'], + 'DOWNLOAD' => (string) $updates['download'], + 'LATEST_VERSION' => $updates['current'], + )); + } + $this->template->assign_block_vars('mods', $template_data); + } + } +} diff --git a/language/de/email/footb_board_remember.txt b/language/de/email/footb_board_remember.txt new file mode 100644 index 0000000..b68d9c1 --- /dev/null +++ b/language/de/email/footb_board_remember.txt @@ -0,0 +1,10 @@ + +Hallo {SITENAME}, +Folgende Tipper haben eine Erinnerungs-Mail erhalten: + +{REMEMBER_LIST} + + +Hier geht es zur {SITENAME}: {U_BOARD}. + +{EMAIL_SIG} diff --git a/language/de/email/footb_send_remember.txt b/language/de/email/footb_send_remember.txt new file mode 100644 index 0000000..5b6675c --- /dev/null +++ b/language/de/email/footb_send_remember.txt @@ -0,0 +1,10 @@ + +Hallo Tipper {USERNAME}, +Du hast bislang noch nicht den {MATCHDAY}. Spieltag getippt. +Bitte tipp bis zum {LEAGUE} Abgabetermin {DELIVERY} Uhr. + + +Hier geht es zur {SITENAME}: {U_BOARD}. + + +{EMAIL_SIG} diff --git a/language/de/football.php b/language/de/football.php new file mode 100644 index 0000000..1a96cb7 --- /dev/null +++ b/language/de/football.php @@ -0,0 +1,506 @@ + '2. E-Mail-Adresse', + 'FOOTB_EMAIL_EXPLAIN' => 'Sollen Erinnerungs-Mails an die Haupt E-Mail-Adresse versendet werden, falls Du vergessen hast zu tippen?', + 'FOOTB_REM_F' => 'Erinnerungs-Mail an die Haupt E-Mail-Adresse', + 'FOOTB_REM_F_EXPLAIN' => 'Erinnerungs-Mail an die Haupt E-Mail-Adresse', + 'FOOTB_REM_S' => 'Erinnerungs-Mail an die 2. E-Mail-Adresse', + 'FOOTB_REM_S_EXPLAIN' => 'Erinnerungs-Mail an die 2. E-Mail-Adresse', + + + 'ADD_NEW_TEAM' => 'Das Team wurde zur Liga hinzugefügt. ', + 'ALL_BETS' => 'Alle Tipps', + 'ALL_BETS_MATCHDAY' => 'Alle Tipps des %d. Spieltags', + 'ALL_LEAGUES' => 'Alle Ligen', + 'ALL_MATCHES' => 'Alle Spiele', + 'AWAY' => 'Auswärts', + 'AWAY_MATCHES' => 'Auswärtsspiele', + + 'BANDWIDTH' => 'Bandbreite', + 'BANK_OF' => 'Kontoauszug von', + 'BET' => 'Tippen', + 'BET_IN_TIME' => 'Die Spiele eines Spieltags können jeweils bis zum Spielbeginn getippt werden. Nach Spielbeginn werden die Tipps der anderen Tipper für alle sichtbar. ', + 'BET_KOEFF' => 'Tippkoeffizient ', + 'BET_OF' => 'Tipp', + 'BET_POINTS' => 'Einsatz', + 'BET_UNTIL_DELIVERY' => 'Die Spiele eines Spieltags können nur bis zum Abgabetermin des Spieltags getippt werden. Danach werden die Tipps der anderen Tipper für alle sichtbar. ', + 'BETS' => 'Tipps', + 'BETS_AND_RANKS' => 'Tipps und Ranglisten der', + 'BETS_OF' => 'Die Tipps von', + 'BETS_OF_ALL' => 'Die Tipps aller Tipper', + 'BETSAVED' => 'Dein Tipp wurde erfolgreich gespeichert. ', + 'BETSSAVED' => 'Deine %d Tipps wurden erfolgreich gespeichert. ', + 'BOOK_TYPE' => 'Buchungstyp', + + 'CASH_POINTS' => 'Verrechnung in Ultimate Points', + 'CHART_MATCHDAY' => 'Chart Platzierungen Spieltag', + 'CHART_OF' => 'Charts von', + 'CHART_POINTS' => 'Chart Punkte Spieltag', + 'CHART_TOTAL' => 'Chart Platzierungen Gesamt', + 'CNT_BET' => 'Anzahl der Spiele mit Tipp', + 'CNT_HIT' => 'Anzahl der Tipps mit richtigem Ergebnis', + 'CNT_HIT02' => 'Anzahl der Tipps mit richtigem Ergebnis, bei dem die Gastmannschaft gepunktet hat', + 'CNT_NO_BET' => 'Anzahl der Spiele ohne Tipp', + 'CNT_TEND' => 'Anzahl der Tipps mit richtiger Tendenz (ohne Volltreffer)', + 'CURR' => 'akt', + 'CURRENT_RESULT' => 'vorläufiges Ergebnis', + + 'DATE' => 'Datum', + 'DATES' => 'Termine', + 'DAY_POINTS_OF_ALL' => 'Die Spieltagspunkte der Tipper', + 'DAY_RANKS_OF_ALL' => 'Die Spieltagsplatzierungen der Tipper', + 'DELETE' => 'Löschen', + 'DELETE_TEAM' => 'Team löschen', + 'DELETE_TEAM_CHECK' => 'Dieses Team aus der Liga löschen', + 'DELETED_TEAM' => 'Das Team wurde aus der Liga gelöscht. ', + 'DELIVERY' => 'Tippabgabe', + 'DELIVERY_LIST' => 'Termine Tippabgabe', + 'DELIVERY_NOT_READY' => 'Zur Tippabgabe (Du hast noch nicht alle Spiele getippt)', + 'DELIVERY_READY' => 'Zur Tippabgabe (Du hast bereits alle Spiele getippt)', + 'DELIVERY_UNTIL' => 'Tippabgabe bis', + 'DEPOSIT' => 'Einzahlung', + 'DIFF_COUNT' => 'Häufigkeiten der Tordifferenzen', + 'DIRECTHITS' => 'Volltreffer', + 'DIRECTHITS_SHORT' => 'VT', + 'DIRECTHITS02' => 'Volltreffer 02', + 'DOWNLOAD' => 'Download', + 'DRAW' => 'Unentschieden', + 'DRAW_SHORT' => 'U', + 'DRAWING' => 'Auslosung', + + 'EUR' => 'EUR', + 'EVALUATION' => 'Wertung', + 'EXCEL_FILE' => 'Excel Datei', + 'EXPORT' => 'Export', + 'EXTRA_BET' => 'Sondertipp', + 'EXTRA_BET_SAVED' => '%d Sondertipp gespeichert. ', + 'EXTRA_BETS' => 'Sondertipps', + 'EXTRA_BETS_SAVED' => '%d Sondertipps gespeichert. ', + 'EXTRA_DIFFERENCE' => 'Volle Punktzahl abzgl. absoluter Differenz zwischen Ergebnis und Tipp', + 'EXTRA_HIT' => 'Volle Punktzahl bei korrektem Tipp, sonst 0 Punkte', + 'EXTRA_MULTI_HIT' => 'Volle Punktzahl bei Übereinstimmung mit einem Ergebnis, sonst 0 Punkte', + 'EXTRA_RESULT_DELETED' => '%d Sondertipp-Ergebnis gelöscht. ', + 'EXTRA_RESULT_SAVED' => '%d Sondertipp-Ergebnis gespeichert. ', + 'EXTRA_RESULTS_DELETED' => '%d Sondertipp-Ergebnisse gelöscht. ', + 'EXTRA_RESULTS_SAVED' => '%d Sondertipp-Ergebnisse gespeichert. ', + 'EXTRATIME' => 'Verlängerung', + 'EXTRATIME_SHORT' => 'n. Verl. ', + + 'FAN_OF' => 'Fan von', + 'FINAL_RESULT' => 'endgültiges Ergebnis', + 'FINALLY' => 'endgültig', + 'FIRSTLEG_ERROR' => 'Hinspiel existiert nicht', + 'FLOP20_POINTS' => 'Flop 20 Punkte Saison', + 'FLOP20_POINTS_ALL' => 'All time Flop 20 Punkte ', + 'FOOTBALL_ALL_LEAGUES' => 'Alle Ligen', + 'FOOTBALL_BALANCE' => 'Aktueller Saldo dieser Liga', + 'FOOTBALL_BALANCES' => 'Aktueller Gesamt-Saldo aller Ligen', + 'FOOTBALL_BANK' => 'Kontoauszug', + 'FOOTBALL_BET_POINTS' => 'Einsatz', + 'FOOTBALL_BOOK_TOTAL' => 'Buchungen', + 'FOOTBALL_DEPOSIT' => 'Einzahlung', + 'FOOTBALL_DESCRIPTION' => 'Hier ist dein Tipprunden Kontoauszug.

Es werden alle Einsätze, Gewinne, Ein- und Auszahlungen der gewählten Saison und Liga angezeigt.

', + 'FOOTBALL_DISABLED' => 'Diese Tipprunde ist derzeit wegen Wartungsarbeiten deaktiviert. ', + 'FOOTBALL_MATCHDAY' => 'Spieltag', + 'FOOTBALL_MENU' => 'Tipprunden Menü anzeigen', + 'FOOTBALL_NO_BOOKS' => 'Es sind keine Buchungen vorhanden. ', + 'FOOTBALL_PAYOUT' => 'Auszahlung', + 'FOOTBALL_RECORD' => 'Eintrag', + 'FOOTBALL_RECORDS' => 'Einträge', + 'FOOTBALL_REMOVE_INSTALL' => 'Du musst erst den Ordner install_football von deinem Webspace entfernen. Solange der Ordner vorhanden ist, bleibt die Football Extension deaktiviert!', + 'FOOTBALL_RULES' => 'Tipprunden-Regeln', + 'FOOTBALL_SEPARATOR_DECIMAL' => ',', + 'FOOTBALL_SEPARATOR_THOUSANDS' => '.', + 'FOOTBALL_TITLE' => 'BL Tipprunde', + 'FOOTBALL_WIN' => 'Gewinn', + 'FORECAST_PTS' => 'Vorhersagepunkte', + 'FORM' => 'Form', + 'FORMULA' => 'Formel', + 'FROM' => 'vom', + 'FROM_DAY_SEASON' => 'vom %1$d. Spieltag Saison %2$d', + + 'GAME_NOT_PLAYED' => '%d Spiel wurde noch nicht gespielt. ', + 'GAME_RESULTS' => 'Spielergebnisse', + 'GAMES_SHORT' => 'Sp', + 'GET_TEAM' => 'Vorhandenes Team übernehmen', + 'GOALS' => 'Tore', + 'GOALS_GUEST' => 'Tore Gast', + 'GOALS_HOME' => 'Tore Heim', + 'GOALS_AGAINST' => 'Gegentore', + 'GOALS_DIFF' => 'Tordifferenz', + 'GOALS_DIFF_SHORT' => 'TD', + 'GR' => 'Gr', + 'GROUP_GAMES' => 'Gruppenspiele in Gruppe', + 'GUESSED' => 'Getippt', + 'GUEST' => 'Gast', + + 'HIST_CHART' => 'Chart Verlauf Spieltage', + 'HITS' => 'Volltreffer', + 'HITS_SHORT' => 'VT', + 'HITS_SHORT2' => 'VT02', + 'HOME' => 'Heim', + 'HOME_MATCHES' => 'Heimspiele', + + 'IMPROVED' => 'verbessert', + + 'JOIN' => 'Dieser Tipprunde beitreten', + 'JOIN_BY_ADMIN' => 'Nur Administratoren können neue Tipper in diese Tipprunde aufnehmen. ', + 'JOIN_BY_USER' => 'Boardmitglieder können vor Beginn selbständig der Tipprunde beitreten. ', + 'JOIN_IN_SEASON' => 'Boardmitglieder können selbständig der laufenden Tipprunde beitreten. ', + 'JOIN_LEAGUE' => 'Willst du dieser Tipprunde beitreten?

Mit deinem Beitritt akzeptierst du die Teilnahmebedingungen dieser Tipprunde. ', + 'JOIN_MODE' => 'Beitritt in diese Tipprunde', + + 'KICK' => 'Anstoß', + 'KOEFF_OF' => 'Der Tippkoeffizient von ', + 'KOEFF_TEXT' => 'gibt an wieviel Punkte die anderen Tipper im Schnitt hätten, wenn dieser alle Spiele richtig haben würde. ', + + 'LAST_GAMES' => 'Die letzten Spiele', + 'LAST_GAMES_AWAY' => 'Die letzten Auswärtsspiele', + 'LAST_GAMES_HOME' => 'Die letzten Heimspiele', + 'LAST_VISITORS' => 'Die letzten %s Besuche', + 'LEAGUE' => 'Liga', + 'LINK_PREDICTION_LEAGUE' => 'Zur Tipprunde', + 'LINK_RULES' => 'Die genauen Teilnahmebedingungen stehen im Forum. ', + 'LOGIN_EXPLAIN_EXPORT' => 'Um Tipps herunter zu laden, musst du registriert und angemeldet sein. ', + 'LOGIN_EXPLAIN_FOOTBALL' => 'Du musst registriert und angemeldet sein, um auf die Tipprunde zuzugreifen. ', + 'LOGS_COMMENT' => 'Kommentar', + 'LOOSER' => 'Verlierer', + 'LOOSER_MATCH_NO' => 'Verlierer Spiel Nr. ', + 'LOST' => 'Verloren', + 'LOST_SHORT' => 'N', + + 'MATCH_ERROR' => 'Spielpaarung nicht passend', + 'MATCH_STATS' => 'Statistiken zum Spiel', + 'MATCHDAY' => 'Spieltag', + 'MATCHDAY_FROM' => 'Spieltag von ', + 'MATCHDAY_SHORT' => 'SpTag', + 'MATCHDAY_TINY' => 'SpT', + 'MATCHDAY_TO' => 'Spieltag bis ', + 'MD_MAX_POINTS' => 'Spieltage mit den höchsten Durchschnittspunkten', + 'MD_MIN_POINTS' => 'Spieltage mit den geringsten Durchschnittspunkten', + 'MEMBER' => 'Tipper', + 'MIN90' => '90 Min. ', + 'MY_BETS' => 'Meine Tipps', + 'MY_CHART' => 'Mein Chart', + 'MY_KOEFF' => 'Mein Tippkoeffizient', + 'MY_POINTS' => 'Meine Punkte', + 'MY_RANK' => 'Meine Platzierungen', + 'MY_TABLE' => 'Meine Tabelle', + 'MYCHART_TEXT' => 'Eingangs werden neben den eigenen Daten, der Gesamtführende, ein Tipper aus dem Mittelfeld und der Letzte angezeigt. ', + + 'NAME' => 'Name', + 'NEXT_DELIVERY' => 'nächste Tippabgabe', + 'NEXT_DELIVERY_UNTIL' => 'Nächste Tippabgabe bis', + 'NO_AUTH_VIEW' => 'Du bist nicht berechtigt, die Tipprunden-Seiten anzusehen. ', + 'NO_AWAYMATCHES_TEAM' => 'Dieses Team hat in dieser Saison noch nicht auswärts gespielt. ', + 'NO_BET' => 'ohne Tipp', + 'NO_BETS' => 'Keine Tipps vorhanden!', + 'NO_BETS_SAVED' => 'Keine Tipps gespeichert!', + 'NO_CHANGES' => 'unverändert', + 'NO_DATA' => 'Keine Daten vorhanden!', + 'NO_GUEST_VIEW' => 'Gäste sind nicht berechtigt, die Tipprunden-Seiten anzusehen. ', + 'NO_GUESTTEAM' => 'Die von dir ausgewählte Gastmannschaft existiert nicht. ', + 'NO_HIST' => 'Zu diesen beiden Mannschaften existieren keine vorherigen Vergleiche in der Datenbank. ', + 'NO_HOMEMATCHES_TEAM' => 'Dieses Team hat in dieser Saison noch nicht zu Hause gespielt. ', + 'NO_HOMETEAM' => 'Die von dir ausgewählte Heimmannschaft existiert nicht. ', + 'NO_LEAGUE' => 'Die von dir ausgewählte Liga existiert nicht. ', + 'NO_LINK_RULES' => 'Die genauen Regeln und Teilnahmebedingungen wurden bislang noch nicht im Forum hinterlegt. ', + 'NO_MATCH' => 'Das von dir ausgewählte Spiel existiert nicht. ', + 'NO_MATCHDAY' => 'Der von dir ausgewählte Spieltag existiert nicht. ', + 'NO_MATCHES' => 'Keine Spiele vorhanden!', + 'NO_MATCHES_ON_MATCHDAY' => 'Der Spielplan wurde noch nicht erstellt. ', + 'NO_MATCHES_TEAM' => 'Dieses Team hat in dieser Saison noch keine Spiele bestritten. ', + 'NO_MEMBER' => 'Du bist kein Mitglied dieser Tipprunde!', + 'NO_MYBETS_ME' => 'Du bist kein Mitglied dieser Tipprunde!', + 'NO_PLAN' => 'Für diesen Spieltag wurden noch keine Spielpaarungen hinterlegt!', + 'NO_POINTS' => 'o. Wertung', + 'NO_RESULT' => 'Es gibt noch kein Spielergebnis. ', + 'NO_RESULT_SAVE' => 'Kein neues Spielergebnis gespeichert. ', + 'NO_RESULTS' => 'Es gibt noch keine Spielergebnisse. ', + 'NO_SEAS_PROFIT' => 'Es werden nur Spieltagsgewinne und keine Saisongewinne berücksichtigt (ab Saison 2003). ', + 'NO_SEASON' => 'Die von dir ausgewählte Saison existiert nicht. ', + 'NO_TABLE' => 'Es liegen noch keine Spielergebnisse vor oder diese Liga hat nur KO-Runden. ', + 'NO_TABLEFORM' => 'Seit diesem Spieltag wurden keine oder nur KO-Spiele gespielt, daher wird keine Formtabelle erstellt. ', + 'NO_TEAM_ID' => 'Das von dir ausgewählte Team existiert nicht. ', + 'NO_TEAM_NAME' => 'Teamname fehlt. Bitte einen Teamnamen angeben. ', + 'NO_TEAM_SHORTNAME' => 'Kurzbezeichnung des Teams fehlt. Bitte einen Kurznamen angeben. ', + 'NO_USER' => 'Du bist kein Teilnehmer dieser Tipprunde!', + 'NO_USERID' => 'Der von dir ausgewählte Tipper existiert nicht. ', + 'NO_USERS' => 'Diese Tipprunde hat keine Teilnehmer!', + 'NO_WIN_MATCHDAYS' => 'In dieser Tipprunde gibt es keine Spieltagsgewinne. ', + 'NO_WIN_SEASON' => 'In dieser Tipprunde gibt es keine Saisongewinne. ', + 'NOT_CLOSED' => 'Dieser Spieltag wurde noch nicht geschlossen. ', + 'NOT_PLANNED' => 'Dieser Spieltag wurde noch nicht ausgelost. ', + 'NOT_RATED' => 'nicht gewertet', + 'NR' => 'Nr', + 'NUMBER' => 'Anzahl', + + 'OPTION_LEAGUE' => 'Wähle eine Liga', + 'OPTION_MATCHDAY' => 'Wähle einen Spieltag', + 'OPTION_SEASON' => 'Wähle eine Saison', + 'OPTION_TEAM' => 'Wähle ein Team', + 'OPTION_USER' => 'Wähle einen Tipper', + 'OVERTIME' => 'Verlängerung', + 'ODDS' => 'Quoten', + + 'PARTICIPANTS_SHORT' => 'Teiln. ', + 'PAYOUT' => 'Auszahlung', + 'PAYOUT_WIN' => 'Gewinnauszahlung', + 'PENALTY' => 'n. Elfmeter', + 'PENALTY_SHORT' => 'EMS', + 'PLACE' => 'Platz', + 'PLAN' => 'Spielplan', + 'PLAYED' => 'Gespielt', + 'PLAYED_MATCHES' => 'Bisherige Spiele', + 'POINTS' => 'Punkte', + 'POINTS_DIFF' => 'Punktedifferenz', + 'POINTS_DIFFERENCE' => 'Punkte für die richtige Tordifferenz: %s', + 'POINTS_DOT' => 'Pk. ', + 'POINTS_HIT' => 'Für die Vorhersage des richtigen Ergebnisses (Volltreffer) gibt es %s Punkte. ', + 'POINTS_LAST' => 'Punkte des letzten für Nichttipper', + 'POINTS_NO_BET' => 'Sollte jemand vergessen zu tippen, erhält er automatisch die Punkte des Spieltagletzten. Dies können unter Umständen auch 0 Punkte sein. ', + 'POINTS_OF' => 'Die Punkte von', + 'POINTS_OF_ALL' => 'Die Punkte aller Tipper', + 'POINTS_SHORT' => 'Pkt', + 'POINTS_SHORT_DOT' => 'Pkt. ', + 'POINTS_TENDENCY' => 'Punkte für eine richtige Tendenz: %s', + 'POINTS_TENDENCY1' => 'Bei richtiger Tendenz wird je abweichendem Tor ein Punkt von der Volltreffer-Punktzahl abgezogen, aber mind. %s Punkte vergeben. Bei Unentschieden erfolgt der Abzug nur für die Differenz bei einer Mannschaft. ', + 'POINTS_TENDENCY2' => 'Bei richtiger Tendenz wird je abweichendem Tor ein Punkt von der Volltreffer-Punktzahl abgezogen, aber mind. %s Punkte vergeben. ', + 'POINTS_TOTAL' => 'Summe der Punkte der angezeigten Tipper', + 'POSSIBLE_POINTS' => 'mögl. Punkte', + 'PREDICTION_LEAGUE' => 'Tipprunde', + 'PREV_DELIVERY' => 'vorherige Tippabgabe', + 'PRINT' => 'Drucken', + 'PRINT_ALL' => 'Alle Tipps drucken', + 'PRINT_FOOTBALL' => 'Druckansicht', + 'PROVISIONALLY' => 'vorläufig', + + 'QUESTION' => 'Frage', + + 'RANK_FORECAST' => 'Pl.(VP)', + 'RANK_MATCHDAY' => 'Rangliste Spieltag', + 'RANK_SHORT' => 'Pl', + 'RANK_SHORT_DOT' => 'Pl. ', + 'RANK_TOTAL' => 'Gesamtrangliste', + 'RANK_TOTAL_MATCHDAY' => 'Gesamtrangliste %d. Spieltag', + 'RANK1' => '1.Pl. ', + 'RANK2' => '2.Pl. ', + 'RANK3' => '3.Pl. ', + 'RANKING' => 'Rangliste', + 'RANKING_ALL_TIME' => 'Ewige Rangliste', + 'RANKING_COMPARE' => 'Ranglistenvergleich', + 'RANKING_MATCHDAY' => 'Rangliste %d. Spieltag', + 'RANKS_OF' => 'Die Platzierungen von', + 'RANKS_OF_ALL' => 'Die Platzierungen der Tipper', + 'RANKS_SEASON' => 'Die Platzierungen pro Saison', + 'RESET' => 'Zurücksetzen', + 'REST_MATCHES' => 'Restprogramm', + 'RESULT' => 'Ergebnis', + 'RESULT_CLEARED' => '%d Ergebnis wurde erfolgreich zurückgesetzt. ', + 'RESULT_EXPLAIN' => 'Spielergebnisse (nach 90 Minuten)', + 'RESULT_SAVE' => '%d neuer Spielstand gespeichert. ', + 'RESULTS' => 'Ergebnisse', + 'RESULTS_CLEARED' => '%d Ergebnisse wurden erfolgreich zurückgesetzt. ', + 'RESULTS_SAVE' => '%d neue Spielstände gespeichert. ', + 'RESULTS_SHORT_DOT' => 'Erg. ', + 'RULES' => 'Regeln', + 'RULES_EXPLAIN' => 'Hier sind nur die technischen Rahmenbedingungen dieser Tipprunde aufgelistet. ', + + 'SAMESAVED' => 'Deine %d OMA-Tipps wurden erfolgreich gespeichert. Ein Tipp wurde automatisch modifiziert. ', + 'SAVE' => 'Speichern', + 'SCORED' => 'Gepunktet', + 'SEASON' => 'Saison', + 'SEC_LEG_ERROR' => 'Rückspiel existiert nicht', + 'SHOW_BETS' => 'Tipps anzeigen', + 'SHOW_CURRENT' => 'Zum aktuellen Spieltag', + 'SHOW_NEXT' => 'Zum nächsten Spieltag', + 'SHOW_PLAN' => 'Spielplan', + 'SHOW_PLAYED' => 'bisherige Spiele', + 'SHOW_PLAYED_AWAY' => 'bisherige Auswärtsspiele', + 'SHOW_PLAYED_HOME' => 'bisherige Heimspiele', + 'SHOW_PREV' => 'Zum vorherigen Spieltag', + 'SHOW_PROFILE' => 'Profil anzeigen', + 'SHOW_REST' => 'Restprogramm', + 'STAT_BET' => 'Stat. Tipps', + 'STAT_GAME_RESULTS' => 'Statistik zu den Spielergebnissen', + 'STAT_POINTS' => 'Stat. Punkte', + 'STAT_RESULTS' => 'Stat. Ergebnisse', + 'STATISTIC' => 'Statistik', + 'STATISTICS' => 'Statistiken', + 'STATS' => 'Status', + 'STATUS_BET_TEXT0' => 'Du hast folgenden Tipp für diesen Spieltag abgegeben:', + 'STATUS_TEXT0' => 'Tippabgabe bis ', + 'STATUS_TEXT1' => 'Die Abgabefrist für diesen Spieltag ist abgelaufen. ', + 'STATUS_TEXT2' => 'Einige Spiele haben an diesem Spieltag schon stattgefunden. ', + 'STATUS_TEXT3' => 'Alle Spiele dieses Spieltags wurden durchgeführt. ', + 'SWITCH_DESKTOP' => 'Zum Desktop-Style wechseln', + 'SWITCH_MOBILE' => 'Zum Mobile-Style wechseln', + + 'TABLE' => 'Tabelle', + 'TABLE_AWAY' => 'Auswärtstabelle', + 'TABLE_FORM' => 'Formtabelle', + 'TABLE_FORM_FROM' => '(Alle Spiele seit dem %d. Spieltag)', + 'TABLE_HOME' => 'Heimtabelle', + 'TABLE_TOTAL' => 'Gesamttabelle', + 'TEAM' => 'Team', + 'TEAM_FLAG' => 'Team-Wappen / Flagge ', + 'TEAM_ID' => 'Team-ID', + 'TEAM_ID_EXIST' => 'Diese Team-ID ist bereits vergeben und einem anderen Team zugeordnet!', + 'TEAM_IN_PLAN' => 'Das Team kann nicht gelöscht werden, da er sich noch im aktuellen Spielplan befindet!', + 'TEAM_IN_ROUND' => 'Das Team ist in Runde', + 'TEAM_NAME' => 'Teamname', + 'TEAM_NOT_EXIST' => 'Dieses Team existiert nicht!', + 'TEAM_SHORT' => 'Kurzbezeichnung des Teams', + 'TEND_RANK' => 'Veränderung gegenüber dem letzten Spieltag', + 'TEND_TEXT' => 'Tipp-Tendenz aller Tipper: Heimsieg-Unentschieden-Auswärtssieg', + 'TENDENCIES' => 'Tendenzen', + 'TENDENCY' => 'Tendenz', + 'TENDENCY_SHORT' => 'Tz', + 'THIS_MATCH' => 'Diese Begegnung', + 'TITLE_ALL_BETS' => 'Zu den Tipps der anderen Tipper', + 'TITLE_BET' => 'Zur Tippabgabe', + 'TITLE_FOOTBALL_BANK' => 'Zum Kontoauszug dieser Liga', + 'TITLE_MY_BETS' => 'Zur Statistik der Tipps', + 'TITLE_MY_CHART' => 'Zu den Platzierungverläufen', + 'TITLE_MY_KOEFF' => 'Punkte der anderen wenn meine Tipps korrekt sind', + 'TITLE_MY_POINTS' => 'Zur Statistik Punkte je Verein', + 'TITLE_MY_RANKS' => 'Zur Statistik der Saisonplatzierungen', + 'TITLE_MY_TABLE' => 'Zur Liga-Tabelle anhand der Tipps', + 'TITLE_RANK_MATCHDAY' => 'Zur Spieltagsrangliste dieser Liga', + 'TITLE_RANK_TOTAL' => 'Zur Gesamtrangliste dieser Liga', + 'TITLE_RANKING_All_TIME' => 'Zur ewigen Rangliste über alle Saisons', + 'TITLE_RANKING_COMPARE' => 'Zum Ranglistenvergleich mit den vorangehenden Saisons', + 'TITLE_RESULTS' => 'Spielergebnisse eingeben', + 'TITLE_STAT_POINTS' => 'Zur Statistik Punkte je Spieltag', + 'TITLE_STAT_RESULTS' => 'Zur Statistik der Spielergebnisse', + 'TITLE_TABLE' => 'Zur Tabelle der Liga', + 'TO_MATCHDAY' => 'Die Mannschaft bleibt bis zu diesem Spieltag im Wettbewerb ', + 'TOP20_POINTS' => 'Top 20 Punkte Saison', + 'TOP20_POINTS_ALL' => 'All time Top 20 Punkte', + 'TOTAL' => 'Total', + 'TOTAL_EXPLAIN' => 'Gesamtpunktzahl des Tippers zu den angezeigten Spielen', + 'TOTAL_RANK' => 'Gesamtrang', + 'TOTAL_RANKING' => 'Gesamtrangliste', + 'TOTAL_RANKS_OF_ALL' => 'Die Gesamtplatzierungen der Tipper', + 'TOTAL_SHORT' => 'Tt', + + 'UNDER_CONSTRUCTION' => 'Diese Tipprunde wurde noch nicht komplett eingerichtet', + 'UNDER_CONSTRUCTION_EXPLAIN' => 'Bitte warten Sie bis der Administrator alle Daten erfasst hat. ', + 'UPDATE_TEAM' => 'Die Teamdaten wurden in der Liga abgeändert. ', + 'USER_TABLE' => 'Die Tabelle nach den Tipps von', + + 'VIC_MAX_POINTS' => 'Spieltagssiege mit den höchsten Punktzahlen', + 'VIC_MIN_POINTS' => 'Spieltagssiege mit den geringsten Punktzahlen', + 'VICT_AWAY' => 'Auswärtssiege', + 'VICT_HOME' => 'Heimsiege', + 'VICTORY' => 'Sieg', + 'VIEW_BET_USER' => '1 Tipper', + 'VIEW_BET_USERS' => '%d Tipper', + 'VIEWING_LEAGUE' => 'Betrachtet die %s in der Tipprunde', + 'VIEWING_LEAGUE_BET' => 'Betrachtet seine %s Tipps in der Tipprunde', + 'VIEWING_LEAGUE_BET_POPUP' => 'Betrachtet die %s Tipps eines anderen', + 'VIEWING_LEAGUE_ALL_BETS' => 'Betrachtet "Alle Tipps" der %s in der Tipprunde', + 'VIEWING_LEAGUE_RESULTS' => 'Betrachtet die Ergebnisse der %s in der Tipprunde', + 'VIEWING_LEAGUE_TABLE' => 'Betrachtet die Tabelle der %s in der Tipprunde', + 'VIEWING_LEAGUE_RANKS_TOTAL' => 'Betrachtet die Gesamtrangliste der %s in der Tipprunde', + 'VIEWING_LEAGUE_RANKS_MATCHDAY' => 'Betrachtet die Rangliste des Spieltags der %s in der Tipprunde', + 'VIEWING_LEAGUE_BANK' => 'Betrachtet Kontoauszüge der %s in der Tipprunde', + 'VIEWING_LEAGUE_RULES_POPUP' => 'Betrachtet die Regeln der %s in der Tipprunde', + 'VIEWING_LEAGUE_DLOAD_EXPORT' => 'Exportiert Daten der %s aus der Tipprunde', + 'VIEWING_LEAGUE_ODDS' => 'Betrachtet die Quoten der %s in der Tipprunde', + 'VIEWING_LEAGUE_MY_BETS' => 'Betrachtet "Meine Tipps" der %s in der Tipprunde', + 'VIEWING_LEAGUE_MY_POINTS' => 'Betrachtet "Meine Punkte" der %s in der Tipprunde', + 'VIEWING_LEAGUE_MY_TABLE' => 'Betrachtet "Meine Tabelle" der %s in der Tipprunde', + 'VIEWING_LEAGUE_MY_RANK' => 'Betrachtet "Meine Platzierungen" der %s in der Tipprunde', + 'VIEWING_LEAGUE_MY_CHART' => 'Betrachtet "Mein Chart" der %s in der Tipprunde', + 'VIEWING_LEAGUE_MY_KOEFF' => 'Betrachtet "Mein Tippkoeffizient" der %s in der Tipprunde', + 'VIEWING_LEAGUE_HIST_POPUP' => 'Betrachtet Statistik einer Begegnung in der %s', + 'VIEWING_LEAGUE_VIEWPLAN_POPUP' => 'Betrachtet den %s Spielplan eines Vereins', + 'VIEWING_LEAGUE_STAT_RESULTS' => 'Betrachtet "Stat. Ergebnisse" der %s in der Tipprunde', + 'VIEWING_LEAGUE_STAT_POINTS' => 'Betrachtet "Stat. Punkte" der %s in der Tipprunde', + 'VIEWING_FOOTBALL' => 'Betrachtet die Tipprunde', + 'VIEWING_FOOTBALL_BET' => 'Betrachtet seine Tipps in der Tipprunde', + 'VIEWING_FOOTBALL_BET_POPUP' => 'Betrachtet die Tipps eines anderen in der Tipprunde', + 'VIEWING_FOOTBALL_ALL_BETS' => 'Betrachtet "Alle Tipps" in der Tipprunde', + 'VIEWING_FOOTBALL_RESULTS' => 'Betrachtet die Ergebnisse in der Tipprunde', + 'VIEWING_FOOTBALL_TABLE' => 'Betrachtet die Tabelle in der Tipprunde', + 'VIEWING_FOOTBALL_RANKS_TOTAL' => 'Betrachtet die Gesamtrangliste in der Tipprunde', + 'VIEWING_FOOTBALL_RANKS_MATCHDAY' => 'Betrachtet die Rangliste des Spieltags in der Tipprunde', + 'VIEWING_FOOTBALL_BANK' => 'Betrachtet Kontoauszüge in der Tipprunde', + 'VIEWING_FOOTBALL_RULES_POPUP' => 'Betrachtet die Regeln in der Tipprunde', + 'VIEWING_FOOTBALL_DLOAD_EXPORT' => 'Exportiert Daten aus der Tipprunde', + 'VIEWING_FOOTBALL_ODDS' => 'Betrachtet die Quoten in der Tipprunde', + 'VIEWING_FOOTBALL_MY_BETS' => 'Betrachtet "Meine Tipps" in der Tipprunde', + 'VIEWING_FOOTBALL_MY_POINTS' => 'Betrachtet "Meine Punkte" in der Tipprunde', + 'VIEWING_FOOTBALL_MY_TABLE' => 'Betrachtet "Meine Tabelle" in der Tipprunde', + 'VIEWING_FOOTBALL_MY_RANK' => 'Betrachtet "Meine Platzierungen" in der Tipprunde', + 'VIEWING_FOOTBALL_MY_CHART' => 'Betrachtet "Mein Chart" in der Tipprunde', + 'VIEWING_FOOTBALL_MY_KOEFF' => 'Betrachtet "Mein Tippkoeffizient" in der Tipprunde', + 'VIEWING_FOOTBALL_HIST_POPUP' => 'Betrachtet die Statistik einer Begegnung in der Tipprunde', + 'VIEWING_FOOTBALL_VIEWPLAN_POPUP' => 'Betrachtet den Spielplan eines Vereins in der Tipprunde', + 'VIEWING_FOOTBALL_STAT_RESULTS' => 'Betrachtet "Stat. Ergebnisse" in der Tipprunde', + 'VIEWING_FOOTBALL_STAT_POINTS' => 'Betrachtet "Stat. Punkte" in der Tipprunde', + 'VS' => 'Begegnungen', + + 'WIN' => 'Gewinn', + 'WIN_FOR' => 'Sieg für', + 'WIN_HITS' => 'Gewinn Volltreffer-Wertung', + 'WIN_HITS02' => 'Gewinn Volltreffer-Wertung mit Auswärtspunkten', + 'WIN_MATCHDAY' => 'Spieltagsgewinn', + 'WIN_SEASON' => 'Gewinn Saisonwertung', + 'WIN_SHORT' => 'S', + 'WINNER' => 'Sieger', + 'WINNER_MATCH_NO' => 'Sieger Spiel Nr. ', + 'WINS_MATCHDAY' => 'Gewinne Spieltag', + 'WINS_SEASON' => 'Gewinne Saison', + 'WITH_TEAM' => 'mit den Mannschaften', + 'WON' => 'Gewonnen', + 'WORSENED' => 'verschlechtert', + 'WRONG_GROUP' => 'Gruppenspiel zwischen Teams unterschiedlicher Gruppen. ', + + 'YEAR' => 'Jahr', + + 'ZERO_POINTS' => 'Nuller', + + /** + * DO NOT REMOVE or CHANGE + */ + 'FOOTBALL_COPY' => 'phpBB Extension - Football Prediction League Version %1s' +)); + +?> \ No newline at end of file diff --git a/language/de/help_football.php b/language/de/help_football.php new file mode 100644 index 0000000..511d964 --- /dev/null +++ b/language/de/help_football.php @@ -0,0 +1,530 @@ + '--', + 1 => 'Erste Schritte' + ), + array( + 0 => 'Wie installiere ich eine Liga?', + 1 => 'Bei der Installation werden keine Spielpläne mitgeliefert. Spielpläne können über "Spielplan aktualisieren" in die Datenbank geladen werden. +Näheres dazu siehe unter diesem Stichwort. +Nach dem Einspielen eines Spielplans sollten die Einstellungen der Liga bearbeitet werden und die Abgabetermine der Spieltage überprüft und ggf. angepasst +werden. Unter Liga verwalten können anschließend einzelne Tipper oder Mitglieder einer bestehenden Gruppe in die Tipprunde aufgenommen werden. ' + ), + array( + 0 => 'Weitere Einstellungen?', + 1 => 'Für den laufenden Betrieb der Tipprunde(n) sollten die administrativen Berechtigungen überprüft bzw. entsprechenden Mitgliedern zugeordnet +werden. Zum automatischen Versand von Erinnerungs-Mails kann man einen externen Cornjob einrichten. Näheres dazu in den einzelnen Punkten dieser Hilfe. ' + ), + array( + 0 => '--', + 1 => 'Allgemeines' + ), + array( + 0 => 'Welche Tipprunden werden unterstützt?', + 1 => 'Alle Tipprunden, die auf eine Meisterschafts- oder KO-Runde beruhen. Also Fußball-Ligen, Pokal-Wettbewerbe, Europa League, Champions League, +EM oder WM. Auch ein Mix aus unterschiedlichen Wettbewerben wird unterstützt, dabei zeigen jedoch die Tabelle und die Statistiken nichts sinnvolles an. +Lediglich durch den Punkte-Modus ist die Extension für Handball und andere Ligen nicht geeignet.' + ), + array( + 0 => 'Welche Rechte existieren in diesem Extension', + 1 => 'a_football_results = Kann endgültige Spielergebnisse eingeben, ändern und löschen
+a_football_editbets = Kann im Adminbereich alle Tipps ansehen, eingeben und ändern
+a_football_plan = Kann Spielpläne erstellen und ändern. Spielplan verwalten (ohne löschen) und KO-Runden Gewinner ermitteln
+a_football_delete = Kann Spielpläne und Teile davon löschen. Löschberechtigung in der Spielplan-Verwaltung
+a_football_config = Kann Tipprundeneinstellung ändern: Tipprunden-Konfiguration
+a_football_points = Kann Punkte für Ultimate Points eingeben, ändern und löschen
+u_use_football = Kann Football Extension verwenden.' + ), + array( + 0 => 'Welche Rollen existieren in diesem Extension?', + 1 => 'Der Football-Administrator besitzt nur das Recht endgültige Spielergebnisse einzugeben, sonst keinerlei Adminrechte. ' + ), + array( + 0 => 'Welche Rechte wurden bestehenden Rollen zugewiesen?', + 1 => 'Der Standard-Administrator Kann endgültige Spielergebnisse eingeben, ändern und löschen. +Der Umfassende Administrator hat sämtliche Rechte des MODS.' + ), + array( + 0 => 'Welche Benutzerdefinierten Profilfelder wurden vom Extension erzeugt?', + 1 => 'footb_email = zusätzliche 2. E-Mail-Adresse für Erinnerungsmails
+footb_rem_f = Schalter für Versand der Erinnerungsmail an die Haupt-E-Mail-Adresse.
+footb_rem_s = Schalter für Versand der Erinnerungsmail an die 2. E-Mail-Adresse.' + ), + array( + 0 => 'Wie aktiviere ich die Erinnerungs-Mail Funktion?', + 1 => 'Im Adminbereich muss unter den Tipprunden-Funktionalitäten der Cronjob für die Tipp-Erinnerungsmail aktiviert und der Termin der nächsten Ausführung gesetzt werden.
+Der Cron-Job wird beim ersten Zugriff nach diesem Termin ausgeführt und sendet eine Erinnerungs-Mail für die fehlenden Tippabgaben, die im Zeitraum 24-48 Stunden nach dem Cron-Termin liegen. +Falls nicht ausreichend Zugriffe auf die Seite erfolgen, sollte der Cronjob automatisch z.B. von www.cronjob.de durch das Script "cron.php?cron_type=football_remember" gestartet werden.
+Das versenden der Email erfolgt nur einmalig. Nach Aufruf des Cronjobs wird der nächste automatisch für den Folgetag eingeplant. +Mit den angehängten parametern "&mode=test&days=n" kann der Versand für die um n Tage versetzte Tippabgabe getestet werden. Dabei werden nur Mails an Board-Email-Adresse versendet.' + ), + array( + 0 => 'Wer bekommt eine Erinnerungsmail', + 1 => 'Bei aktivierter Erinnerungsmail-Funktion, bekommen alle Tipper, die am abzugebenden Spieltag ein Spiel mit Status 0 nicht vollständig getippt +haben eine Erinnerungsmail an die dazu freigegebene(n) E-Mail-Adresse(n).
+Zusätzlich wird eine E-Mail mit der Empfängerliste an die Board-E-Mail-Adresse versendet (aber nur wenn auch mindestens eine Erinnerungsmail versendet +wurde).
+Der Vorgang wird zur Dokumentation im Log protokolliert.' + ), + array( + 0 => '--', + 1 => 'Tippabgabefrist' + ), + array( + 0 => 'Wann wird die Tippabgabe gesperrt?', + 1 => 'Sobald jemand Daten aus den Tipprunden abruft wird überprüft, ob Spieltage mit Status 0 und abgelaufener Abgabezeit existieren. Die zu +schließenden Spiele werden mit Status 1 versehen und sind somit nicht mehr tippbar.' + ), + array( + 0 => 'Die Spieltage bzw. Spiele werden nicht zum Abgabezeitpunkt geschlossen', + 1 => 'Der Abgabezeitpunkt wird mit der aktuellen Host Zeit + Zeitverschiebung zwischen Board- und Host-Zeitzone verglichen. Wenn dein Hoster sich +in der eingestellten Board-Zeitzone befindet, muss diese Zeitzone auch in den Tipprunden-Einstellungen hinterlegt sein. Wenn nicht ist hier die +entsprechende Zeitzone zu wählen.' + ), + array( + 0 => 'Ich kann den Abgabezeitpunkt eines Spieltags nicht bearbeiten', + 1 => 'Du hast bei den Liga-Einstellungen "Tippabgabe bis zum jeweiligen Spielbeginn" gewählt. Dadurch wird die Abgabezeit automatisch anhand der +Spiele verwaltet. Wenn du noch bei der Spielplanerstellung bist, solltest "Tippabgabe bis zum jeweiligen Spielbeginn" erst nach Erfassung des gesamten +Spielplans einstellen. Dann werden die Abgabezeiten automatisch korrigiert.' + ), + array( + 0 => 'Das Spiel hat schon begonnen, aber ich kann noch tippen', + 1 => 'Der Spieltag wurde noch nicht geschlossen, da der Abgabezeitpunkt noch in der Zukunft liegt; das erste Spiel hat aber bereits begonnen. Beim +Speichern der Abgabezeit im Spieltag wird momentan die Zeit nicht mit den Spielzeiten abgeglichen und überprüft.' + ), + array( + 0 => 'Überprüfungen beim Speichern der Spieltags-Einstellungen', + 1 => 'Beim Abspeichern eines Spieltags wird überprüft, ob der Status des Spieltags korrigiert werden muss. Liegt der 1. Abgabetermin in der +Zukunft wird der Status des Spieltags auf 0 gesetzt, liegt er in der Vergangenheit, wird der Status je nach Status der dazugehörigen Spiele auf 1, 2 +oder 3 gesetzt.' + ), + array( + 0 => 'Wie stelle ich weitere Abgabetermine bei einem Spieltag ein?', + 1 => 'Dies geht nur, wenn "Tippabgabe bis zum jeweiligen Spielbeginn" bei den Liga-Einstellungen auf Nein steht. Dann können zwei weitere +Abgabetermine beim Spieltag hinterlegt werden. Die Spiele, die zum 2. Abgabetermin geschlossen werden sollen, müssen im Spielplan manuell auf Status -1 +gesetzt werden. Für den 3. Abgabetermin ist der Status der Spiele manuell auf -2 zu setzen.' + ), + array( + 0 => 'Was bedeutet "Tippabgabe bis zum jeweiligen Spielbeginn"', + 1 => 'In diesem Modus kann jedes Spiel einzeln bis zum Spielbeginn getippt werden. Beim Schließen der Tippabgabe eines Spiels wird ermittelt, ob +noch "offene" Spiele im Spieltag existieren. Wenn ja, wird die Abgabezeit des Spieltags auf den nächsten Spielbeginn gesetzt, sonst bleibt sie auf dem +letzten Spielbeginn stehen und der Spieltag bekommt den Staus 1. Die Tippabgabe zu einer festen Zeit vor jedem Spiel wird derzeit nicht unterstützt.' + ), + array( + 0 => '--', + 1 => 'Spielbetrieb' + ), + array( + 0 => 'Wie speichere ich endgültige Spielergebnisse?', + 1 => 'Endgültige Spielergebnisse können nur im Adminbereich eingegeben bzw. bestätigt werden. Dabei werden nur die Ergebnisse der ausgewählten +Spiele abgespeichert.' + ), + array( + 0 => 'Warum kann ich keine Spielergebnisse eingeben?', + 1 => 'Wenn bei den Tipprunden Funktionalitäten "Eingabe endgültiger Spielergebnisse erst nach Spielende" auf Ja gesetzt wurde, können die +Spielergebnisse erst nach Spielende (90 Minuten) eingegeben werden.
+Für Spiele mit Status 0 können keine Ergebnisse eingegeben werden. Hier ist zuerst der Abgabetermin des Spieltags oder der Spielbeginn des Spiels +zu kontrollieren und gegebenenfalls anzupassen, damit die Tippabgabe zu diesem Spiel automatisch gesperrt wird und das Spiel den Status 1 zur +Ergebniseingabe erhält.' + ), + array( + 0 => 'Ich möchte einen Spielzwischenstand speichern', + 1 => 'Spielzwischenstände können nur im Userbereich eingegeben werden. Im Adminbereich werden alle Ergebnisse als endgültige oder nicht +gewertete Ergebnisse nach 90 Minuten abgespeichert. ' + ), + array( + 0 => 'Warum bekomme ich beim Aufruf manchmal eine andere Liga angezeigt?', + 1 => 'Beim Aufruf der Seite "Spielergebnisse eingeben" wird automatisch die Liga angezeigt, die am längsten auf eine Ergebniseingabe wartet +bzw. deren Spiele als nächstes enden. Warten Spiele aus unterschiedlichen Ligen auf eine Ergebniseingabe bzw. -bestätigung, so gelangt man nach +Ergebniseingabe durch erneutes Aufrufen der Seite zu den nächsten "wartenden" Spielen.' + ), + array( + 0 => 'Wie wird der Spieltagsstatus beim Speichern der Ergebnisse gesetzt?', + 1 => 'Nach abspeichern der Ergebnisse wird der Status des Spieltags entsprechend der Spiele gesetzt. Haben alle Spiele einen Status > 2, wird der +Spieltagsstatus auf 3 gesetzt und der Spieltag somit abgeschlossen. Sonst wird der Spieltagsstatus auf den minimalen Status >= 0 der dazugehörigen +Spiele gesetzt.' + ), + array( + 0 => 'Wann werden die Ranglisten aktualisiert?', + 1 => 'Nach abspeichern der Ergebnisse und setzen des Spieltagsstatus im User- oder Adminbereich wird die Spieltagsrangliste des entsprechenden +Spieltags abgespeichert. Anschließend wird die Platzierung in der Gesamtrangliste berechnet und ebenfalls im aktuelle Spieltag abgespeichert. +Die restlichen Daten der Gesamtrangliste werden nicht abgespeichert, sondern immer aktuell berechnet.
+Bei Spieltagen mit Status 0 oder 1 wird die Rangliste zu diesem Spieltag gelöscht. Sonst wird der Status der Rangliste analog zum Status des Spieltages +gesetzt.' + ), + array( + 0 => 'Wie lösche ich Spielergebnisse?', + 1 => 'Einfach ein Ergebnisfeld löschen oder die Löschen Option wählen und schon werden alle Ergebnisfelder gelöscht. Der Status des Spiels wird +dabei auf 1 zurückgesetzt.' + ), + array( + 0 => 'Wie nehme ich einzelne Spiele aus der Wertung?', + 1 => 'Durch setzten des Optionsschalters "O. Wertung" vor dem Speichern, wird das Spiel aus der Wertung genommen, so dass niemand Punkte dafür +erhält. Liegt noch kein Ergebnis vor, wird das Spiel mit Status 4 gespeichert, sonst mit Status 6. Wird im Userbereich ein Ergebnis zu einem Spiel mit +Status 4 eingegeben, wird der Status 5 gesetzt. ' + ), + array( + 0 => 'Wer kann alle Tipps sehen?', + 1 => 'Benutzer mit Adminrecht a_football_editbets = "Kann im Adminbereich alle Tipps ansehen, eingeben und ändern" können im Adminbereich alle +Tipps sehen und auch editieren.' + ), + array( + 0 => 'Was ist bei der Tippeingabe im Adminbereich zu beachten?', + 1 => 'Werden Tipps zu Spielen mit bereits vorliegenden Ergebnissen abgespeichert, wird die Rangliste nicht automatisch aktualisiert. Die +Ranglisten berücksichtigen den neuen Tipp nicht. In der Anzeige der Einzeltipps und "Alle Tipps" werden die geänderten Tipps und die daraus +resultierenden Punkte angezeigt. Wenn die geänderten Tipps in die Rangliste einfließen sollen, sind die Ergebnisse des Spieltags und der nachfolgenden +Spieltage erneut abzuspeichern, so dass die Ranglisten neu berechnet werden. Spiele müssen dabei nicht ausgewählt oder verändert werden. ' + ), + array( + 0 => 'Wozu dient "KO-Runden Gewinner ermitteln"?', + 1 => 'Damit in der Spielplanverwaltung nur Teams zur Auswahl stehen, die auch die entsprechende Runde erreicht haben, muss der Spieltag beim Team +eingetragen werden, bis zu dem das Team im Wettbewerb verbleibt. Dies, und die Überleitung der 3. Platzierten Teams der Champions League Gruppenphase in +die Europa League, kann auf dieser Seite automatisch durchgeführt werden. Da insbesondere bei der Berechnung der Gruppen-Platzierung nicht alle Regeln im +System berücksichtigt wurden, sind eventuelle Fehler manuell zu korrigieren. Dazu werden die betroffenen Mannschaften in der Statusmeldung protokolliert.' + ), + array( + 0 => 'Wie ermittle ich die Gewinner einer KO-Runde?', + 1 => 'Bei einzelnen KO-Spielen oder KO-Runden mit Hin- und Rückspiel reicht es die Spieltage zur Ermittlung auszuwählen, an denen diese Spiele +stattgefunden haben. Als Zielspieltag ist der letzte Spieltag zu wählen bis zu dem das Team mindestens im Wettbewerb bleibt.' + ), + array( + 0 => 'Wie ermittle ich die Gruppengewinner und -zweiten einer Gruppe', + 1 => 'Bei Gruppenspielen sind alle Gruppenspieltage zur Ermittlung auszuwählen und der letzte Spieltag der nächsten Runde als Zielspieltag zu +hinterlegen. Die Option "Ermittlung anhand des Tabellenplatzes bei Gruppenspielen" ist zu wählen und der Platz bis zu dem die Teams sich qualifizieren. +Sollen Teams in eine andere Liga überführt werden, ist die entsprechende Liga auszuwählen, sonst nicht. Wurde keine Liga gewählt, werden Platz und +Spieltag ignoriert und kein Team transferiert.' + ), + array( + 0 => 'Die Teams sind schon in der nächsten Runde eingetragen', + 1 => 'Wurden im Spielplan die Formeln W (Winner) oder L (Looser) hinterlegt, wird schon bei der Anzeige der Begegnung der Sieger bzw. Verlierer +der in der Formel hinterlegten Partie(n) ermittelt und im Spielplan eingetragen. Trotzdem sollte "KO-Runden Gewinner ermitteln" aufgerufen werden, da +sonst beim Speichern der Spielbegegnung im Spielplan (bei Spielverlegung oder sonstigen Änderungen), die Teams nicht zur Auswahl stehen und somit wieder +gelöscht werden.
+Die Formel G führt nicht zu einer automatischen Ermittlung, da derzeit bei der Ermittlung der Gruppenplatzierungen nicht alle Sonderregeln bis ins +kleinste berücksichtigt werden. Die Ermittlung muss im Adminbereich über "KO-Runden Gewinner ermitteln" durchgeführt und kontrolliert werden. ' + ), + array( + 0 => 'Tipper ohne Tipps bekommen trotzdem Punkte', + 1 => 'Du hast in den Liga-Einstellungen hinterlegt, dass Nichttipper automatisch die Punkte des letzten bekommen sollen.' + ), + array( + 0 => '--', + 1 => 'Spielplan Verwaltung' + ), + array( + 0 => 'Wie erstelle ich einen neuen Spielplan?', + 1 => 'Zur Spielplanerstellung sind die einzelnen Seiten zwingend von oben nach unten abzuarbeiten. Insbesondere ist die korrekte Hinterlegung +der Anzahl der Spieltage und Spiele zu beachten, damit die Generierung im Verlauf der Spielplanerstellung funktioniert. Erst nach Generierung der +Spiele im Spielplan können Tipper aufgenommen werden, da vorher Informationen zu der Anzahl der Spiele fehlen. Ebenso wird der Schalter "Tippabgabe +bis zum jeweiligen Spielbeginn" erst nach Generierung der Spiele im Spielplan sichtbar. Dieser Schalter sollte erst nach Hinterlegung der +Spielpaarungen und aller Spieltermine auf Ja gesetzt werden, damit alle Abgabetermine in den Spieltagen automatisch gesetzt werden können.' + ), + array( + 0 => 'Wie richte ich eine neue Saison ein?', + 1 => 'Unter "Saisons verwalten" erstellst du eine neue Saison mit der Jahreszahl, in der die Saison endet. Die Spielzeit 2010/2011 ist also als +Saison 2011 zu erstellen. Auf der folgenden Seite werden dann entsprechende Standardwerte gesetzt. ' + ), + array( + 0 => 'Wie richte ich eine neue Liga ein?', + 1 => 'Unter "Ligen verwalten" erstellst du eine neue Liga mit Angabe einer Liganummer. Die Liganummer sollte für eine Liga über die Saisons +identisch vergeben werden und muss nicht fortlaufen innerhalb der Saison sein. Die 1. Liga sollte also immer die Liganummer 1, die 2. Liga immer +die Liganummer 2 bekommen.' + ), + array( + 0 => 'Wie richte ich die Spieltage ein?', + 1 => 'Bei einer neuen Liga müssen zuerst die fehlenden Spieltage über den Button generiert werden. Wenn der Spieltag eine abweichende +Bezeichnung vom Standard "#. Spieltag" bekommen soll, so ist das entsprechende Feld zu füllen, sonst nicht. Wird ein Abgabetermin hinterlegt, wird +dieser Abgabetemin bei der Generierung der Spielpaarungen als Spielbeginn eingesetzt.' + ), + array( + 0 => 'Wie nehme ich Teams in einer Liga auf?', + 1 => 'Bei KO-Runden müssen vorher zwingend die Spieltage erfasst werden, damit dem Team ein Spieltag zugeordnet werden kann, bis zu dem das +Team im Wettbewerb verbleibt. Die Team-ID einer Mannschaft sollte über alle Saisons und Ligen hinweg identisch gewählt werden, damit historische +Vergleiche in den Statistiken funktionieren. Alle Gif-Dateien im Verzeichnis /images/flags werden zur Auswahl eines Team Wappens bzw. +einer Flagge angezeigt. Die Wappen sollten das Format 28px x 28px haben. Es wird ausdrücklich darauf hingewiesen, das Vereinswappen dem Urheberrecht +unterliegen und nicht ohne Zustimmung des Rechteinhabers verwendet werden dürfen.' + ), + array( + 0 => 'Wie erstelle ich die Spielpaarungen im Spielplan?', + 1 => 'Nachdem alle Spieltage und Mannschaften erfasst wurden, können die Datenbankeinträge für die Spielpaarungen generiert werden. Wurde +vorher bei den Spieltagen ein Abgabetermin hinterlegt, wird dieser bei allen Spielen des Spieltags als Spielbeginn hinterlegt. Wurden noch keine Teams +in einer Spielpaarung hinterlegt, so wird in der Übersicht statt des Teamnamens eine eventuell hinterlegte Berechnungsformel angezeigt. + ' + ), + array( + 0 => 'Kann ich einen Spielplan sukzessiv aufbauen?', + 1 => 'Ja, man kann im Verlauf der Saison weitere Spieltage in der Liga hinzufügen. Dazu trägt man unter "Ligen verwalten" die geänderte Anzahl +der Spieltage ein und geht anschließend auf "Spieltage verwalten". Dort kann man die neuen Spieltagseinträge generieren lassen und anschließend +editieren. Nach Eingabe der Abgabetermine und Anzahl der Spiele bei KO-Runden, müssen die Spiele im Spielplan noch generiert werden. Dazu wählt man den +neue hinzugefügten Spieltag aus und klickt auf den Generierungs-Button. Die fehlenden Spiele werden generiert und ebenso fehlende Leereinträge aller +Tipper in der Tipptabelle.' + ), + array( + 0 => 'Wann kann ich in einer Liga Tipper aufnehmen?', + 1 => 'Tipper können erst nach Erstellung der Spiele im Spielplan hinzugefügt werden. Erst dann ist die Funktion in "Ligen verwalten" freigegeben.' + ), + array( + 0 => 'Kann ich Spieltage auch wieder löschen?', + 1 => 'Ja, entweder ausgewählte Spieltage unter "Spieltage verwalten" über die Schaltfläche "Löschen" oder die letzten Spieltage, indem man die +Anzahl der Spieltage in der Liga reduziert und anschließend auf "Spieltage verwalten" geht und dort den dann angezeigten Button betätigt. Gelöscht wird +dabei immer der Spieltag mit allen Spielen und allen Tipps.' + ), + array( + 0 => 'Ich kann keine Spiele bzw. Begenungen erfassen?', + 1 => 'Wenn du eine KO-Runde angelegt hast, musst du die Anzahl der Spiele bei den einzelnen Spieltagen hinterlegen. Erst dann erscheint der +Button zum Vervollständigen des Spielplans unter Spielplan verwalten.' + ), + array( + 0 => 'Was passiert bei einer Spielverlegung?', + 1 => 'Nach Änderung eines Spieltermins wird bei "Tippabgabe bis zum jeweiligen Spielbeginn" ggf. der Status des Spiels und des Spieltages sowie +der dort hinterlegte Abgabetermin angepasst. ' + ), + array( + 0 => 'Was sind Sondertipps?', + 1 => 'Sondertipps sind Einzeltipps mit gesonderter Punktevergabe. Sie können zu einem Spieltag oder zu einer Liga-Saison definiert werden und +fließen somit entweder in die Wertung zum Spieltag oder in die Gesamtwertung ein. Die Frage zu einem Sondertipp kann individuell hinterlegt werden, +sollte aber unmissverständlich sein.' + ), + array( + 0 => 'Welche Antwort- und Ergebnis-Möglichkeiten stehen zur Verfügung?', + 1 => 'Je nach Fragetyp steht als Antwort die Auswahl eines Teams der Liga, eine Zahl oder ein Text zur Verfügung. Das Ergebnis kann zusätzlich +noch aus mehreren Werten bestehen, die jeweils durch ";" getrennt werden. So können Multiple Choice Fragen mit einer Antwort-Möglichkeit hinterlegt werden. +Wenn beim Fragetyp 3 oder 4 in der Frage die Auswahlmöglichkeiten durch A: B: C: ... H: gekennzeichnet werden, erscheinen bei der Tipp- und Ergebniseingabe +automatisch entsprechende Werte in einer Dropdown-Box.' + ), + array( + 0 => 'Welche Frage- und Antwort-Möglichkeit bietet Fragetyp 1?', + 1 => 'Mit Fragetyp 1 kann bei Antwort und Ergebnis jeweils nur eine Mannschaft aus der Teamliste der Liga ausgewählt werden. Die Maximalpunktzahl +wird nur bei völliger Übereinstimmung vergeben, sonst erhält der Tipper 0 Punkte.
+Beispiel-Frage: Wer wird Meister?' + ), + array( + 0 => 'Welche Frage- und Antwort-Möglichkeit bietet Fragetyp 2?', + 1 => 'Fragetyp 2 ist wie Fragetyp 1, jedoch wird das Ergebnis in Textform (eine oder mehrere Team-IDs durch ";" getrennt) eingegeben. Die +Maximalpunktzahl wird vergeben, wenn die zur Antwortauswahl zugehörige Team-ID mit einem Wert aus dem Ergebnis übereinstimmt.
+Beispiel-Frage: Nenne einen Absteiger (Platz 16-18 am Saisonende)' + ), + array( + 0 => 'Welche Frage- und Antwort-Möglichkeit bietet Fragetyp 3?', + 1 => 'Bei Fragetyp 3 kann als Antwort und Ergebnis nur ein Wert (Text oder Zahl) hinterlegt werden. Die Maximalpunktzahl wird vergeben, wenn die +Antwort mit dem Ergebnis übereinstimmt, sonst erhält der Tipper 0 Punkte.
+Beispiel-Frage: Wie viel rote (ohne gelb-rote) Karten werden an diesem Spieltag vergeben? A=0 B=1 C=2 D=mehr als 2' + ), + array( + 0 => 'Welche Frage- und Antwort-Möglichkeit bietet Fragetyp 4?', + 1 => 'Bei Fragetyp 4 kann als Antwort eine Zahl oder ein Text und als Ergebnis mehrere Zahlen oder mehrere Texte (aber keine Kombination aus Zahlen +und Texten) durch ";" getrennt eingegeben werden. Die Maximalpunktzahl wird vergeben, wenn die Zahl oder der Text in der Antwort mit einem Wert aus dem +Ergebnis übereinstimmt.
+Beispiel-Frage: Hannover 96 A=steigt ab B=holt den Pokal C=spielt nicht international C=wird Deutscher Meister' + ), + array( + 0 => 'Welche Frage- und Antwort-Möglichkeit bietet Fragetyp 5?', + 1 => 'Bei Fragetyp 5 kann als Antwort und Ergebnis nur eine Zahl hinterlegt werden. Die Maximalpunktzahl wird vergeben, wenn die Antwort mit dem +Ergebnis übereinstimmt, sonst erhält der Tipper die Maximalpunktzahl abzüglich der absoluten Differenz zwischen Antwort und Ergebnis, jedoch keine negativen +Punkte.
+Beispiel-Frage: Wie viel Tore fallen an diesem Spieltag?' + ), + array( + 0 => 'In welche Wertung fließt ein Sondertipp ein?', + 1 => 'Wenn Abgabe- und Auswertungsspieltag identisch gewählt werden, fließt die Wertung in die Spieltagswertung und -rangliste ein. Wird der +Auswertungsspieltag abweichend gewählt, fließt der Sondertipp in die Gesamtwertung und -rangliste ein.' + ), + array( + 0 => 'Kann ich während der Saison Sondertipps anlegen?', + 1 => 'Ja, allerdings nur an Spieltagen die noch getippt werden können. Abgespeicherte Sondertipps können anschließend noch verschoben werden. Dabei +ist jedoch der Status des Sondertipps gesondert zu prüfen und gegebenenfalls zu korrigieren, da mit Verschiebung auf einen nicht mehr tippbaren Spieltag der +Status des Sondertipps nicht automatisch angepasst wird.' + ), + array( + 0 => 'Wann wird ein Sondertipp für die Tippabgabe gesperrt?', + 1 => 'Die Sondertipps werden mit dem ersten Abgabetermin eines Spieltags für die Tippabgabe geschlossen. Will man z.B. einen Meistertipp bis zum +3.Spieltag ermöglichen, so legt man die Abgabe auf den 3 Spieltag und die Auswertung auf den letzten Spieltag.' + ), + array( + 0 => '--', + 1 => 'Tipprunden Konfiguration' + ), + array( + 0 => 'Welche Zeitzone muss ich für die Tipprunde einstellen?', + 1 => 'Wenn der Hoster in der gleichen Zeitzone des Forums liegt, ist in der Tipprunde dieselbe Zeitzone wie im Forum zu wählen. Liegt der Hoster in +einer anderen Zeitzone, so ist die Zeitzone der Tipprunde entsprechend der Differenz zu setzen. Dies ist notwendig, da für die Abgabe und Ergebniseingabe +der Spiele System-Zeitfunktionen verwendet werden.' + ), + array( + 0 => 'Wozu wird der Tipprunde Code verwendet?', + 1 => 'Damit die Erinnerungsfunktion über cron_remember.php nicht von Außenstehenden missbräuchlich verwendet werden kann, wird beim Aufruf der +Parameter Code mit dem in der Tipprunde hinterlegten Code verglichen. Wenn man z.B. den Code 19032038 im Adminbereich hinterlegt, so sollte der Cronjob +cron_remember.php?code=19032038 für die Erinnerungsmail aufrufen.' + ), + array( + 0 => 'Wie kann ich die Anzeige der Ranglisten in der Hauptansicht übersichtlich gestalten?', + 1 => 'Über den Schalter "Anzahl angezeigter Tipper in den Übersichts-Ranglisten" können die Spieltags- Gesamtrangliste eingeschränkt werden. Sollte +der Ranglistenplatz des angemeldeten nicht zu einer Anzeige führen, so wird die Platzierung unterhalb der Rangliste angefügt. ' + ), + array( + 0 => '--', + 1 => 'Kontoübersicht / Ultimate Points (UP)' + ), + array( + 0 => 'Ist der Ultimate Points Extension erforderlich?', + 1 => 'Nein, wenn du jedoch den Tippern deiner Tipprunde einen Gesamtstand anzeigen möchtest, solltest du den Ultimate Points Extension installieren.
+Unabhängig vom Ultimate Points Extension werden Ligagewinne dem Konto im phpBB3 football Extension gutgeschrieben und der Admin kann Einsätze, Ein- und Auszahlungen +verbuchen.' + ), + array( + 0 => 'Was bewirkt der Schalter "Ultimate Points einbinden" in den Tipprunden-Funktionalitäten im Adminbereich?', + 1 => 'Dieser Schalter hat nur Auswirkungen auf die automatische Verrechnung der Gewinne im Gesamtsaldo von Ultimate Points. Hier kann man wählen, +ob Gewinne, Punkte oder nichts aus dem phpBB3 football Extension in den Ultimate Points Saldo einfließen sollen. Die Verrechnung der erzielten Tipprundenpunkte +kann zusätzlich noch über einen Faktor gesteuert werden. ' + ), + array( + 0 => 'Können andere meine Kontoübersicht sehen?', + 1 => 'Nur wer entsprechende Admin-Rechte besitzt, kann im Tipprundenbereich die Kontoübersicht eines anderen Tippers abfragen.' + ), + array( + 0 => 'Wie werden Einsätze, Ein- und Auszahlungen und Gewinne verbucht?', + 1 => 'Einsätze belasten das Tipperkonto und den Gesamtsaldo von UP und können durch Einzahlungen wieder ausgeglichen werden. In der Saison +gutgeschriebene Gewinne können vom Tipperkonto ausgezahlt werden, wobei die Auszahlung ebenfalls den Gesamtsaldo in UP belastet. Gewinne werden automatisch +über die Gewinnverteilung der Tipprunde beim Speichern der Spielergebnisse mit dem Tipperkonto und UP (bei gesetztem Schalter) verbucht. Beim erneuten +Abspeichern von Ergebnissen werden die alten Buchungen storniert und neu gebucht. Sollten an den nachfolgenden Spieltagen bereits Ergebnisse vorhanden sein, +werden die dazugehörigen Ranglisten und Buchungen korrigiert. Ein- und Auszahlungen sind nur für reale Zahlungen gedacht.' + ), + array( + 0 => 'Einsatz buchen', + 1 => 'Wenn UP installiert und beim Buchen aktiviert ist, wird der Einsatz vom UP Saldo abgezogen. Die Einsätze können für eine komplette Liga abgebucht +werden oder für einzelne Tipper. Bei der Buchung für die gesamte Liga werden bereits vorher schon gebuchte Einsätze berücksichtigt, so dass insgesamt +maximal der in der Liga hinterlegte Einsatz abgebucht wird. Bei Einzelabbuchung je ausgewählten Tipper werden die ausstehenden Einsätze als Vorgabe +in die jeweiligen Eingabefelder eingetragen. Werden diese Werte verändert erfolgt keine Überprüfung auf Unter- bzw. Überzahlung.' + ), + array( + 0 => 'Einzahlung buchen', + 1 => 'Wenn UP installiert und beim Buchen aktiviert ist, wird die Einzahlung dem Saldo gutgeschrieben. Somit können durch Einsatzbuchungen entstandene +negative Kontostände wieder ausgeglichen werden. Einzahlungen können für eine komplette Liga gebucht werden oder für einzelne Tipper. Bei der Buchung für die +gesamte Liga werden bereits vorher gebuchte Einzahlungen berücksichtigt, so dass insgesamt maximal der in der Liga hinterlegte Einsatz gebucht wird. +Bei Einzelbuchung je ausgewählten Tipper werden die ausstehenden Einzahlungen als Vorgabe in die jeweiligen Eingabefelder eingetragen. Werden diese Werte +verändert erfolgt keine Überprüfung auf Unter- bzw. Überzahlung.' + ), + array( + 0 => 'Auszahlung buchen', + 1 => 'Wenn UP installiert und beim Buchen aktiviert ist, belastet die Auszahlung den Saldo. Somit können in der Saison erzielte Gewinne ausgezahlt werden +und der Saldo ausgeglichen werden. Auszahlungen können für eine komplette Liga gebucht werden oder für einzelne Tipper. Bei der Buchung für die +gesamte Liga werden bereits vorher gebuchte Auszahlungen berücksichtigt, so dass insgesamt maximal der in der Liga erzielte Gewinn ausgebucht wird. +Bei Einzelbuchung je ausgewählten Tipper werden die ausstehenden Auszahlungen als Vorgabe in die jeweiligen Eingabefelder eingetragen. Werden diese Werte +verändert erfolgt keine Überprüfung auf Über- bzw. Unterzahlung.' + ), + array( + 0 => 'Vorgehensweise nach dem Update auf Version 0.9.2 ', + 1 => 'Beim Update des phpBB3 Football MODs auf Version 0.92 werden alle vorhanden Ranglisten (auch aus den Vorjahren) neu berechnet und die Gewinne +dabei automatisch im Tipperkonto verbucht. Eine Verrechnung mit dem UP-Saldo wird dabei nicht vorgenommen. Ist dies erwünscht, so muss der Schalter +"Ultimate Points einbinden" entsprechend gesetzt werden und die Spielergebnisse des ersten Spieltags je Liga erneut abgespeichert werden. Einsätze, +Ein- und Auszahlungen müssen manuell im Adminbereich je Saison nachverrechnet werden. Vorher sollte man entscheiden, ob diese Buchungen auch im UP-Saldo +berücksichtigt werden sollen und dementsprechend den Schalter für UP setzen.' + ), + array( + 0 => '--', + 1 => 'Spielplan Update' + ), + array( + 0 => 'Vorgehensweise beim Spielplan-Update', + 1 => 'Ein Update des Spielplans kann man nur mit Daten einer anderen Tipprunde-Seite durchführen. Eine Übersicht der zur Verfügung gestellten Saisons +und Ligen einer Seite kann über /football/xml/football_xml_season.php ausgehend vom phpbb-Rootverzeichnis abgerufen werden. Wird diese komplette Adresse +im Browser direkt eingegeben, werden die XML-Daten der Übersicht angezeigt und mit Klick auf einen Liganamen werden die aktuellen Daten der Liga aus +der Datenbank angezeigt. Klickt man in dieser Ansicht auf das Diskettensymbol, so kann man die Daten der Liga als XML-File downloaden.
+Beim Starten des Updates im Adminbereich unter Spielplan-Update wird die unter Einstellungen abgespeicherte Saisonübersicht als Updatequelle eingetragen. +Ist in den Extension-Einstellungen keine Updatequelle hinterlegt, wird die Football Extension Demoseite als Quelle eingetragen. Nach dem Laden der Saisonübersicht +werden die verfügbaren Ligen zur Auswahl angeboten. Wird der Zugriff auf eine andere URL vom eigenen Hoster nicht unterstützt bzw. ist dieser nicht frei- +geschaltet, muss man die gewünschten Ligen als XML-File downloaden und unter root/store ablegen. In diesem Fall muss localhost als Updatequelle eingetragen +werden und am Besten auch in den Einstellungen für zukünftige Aufrufe abgespeichert werden.
+Der Zugriff auf die Saisonübersicht und die Ligadaten kann über einen Code geschützt werden. Nutzer des Updates müssen dann den Code xxxx beim Aufruf der +Saisonübersicht mit ?code=xxxx anhängen; also /football/xml/football_xml_season.php?code=xxxx aufrufen. Beim anschließenden Aufruf der Ligadaten wird dann +der Code weitergereicht.
+Als Zielliga kann man eine bestehende Liga oder eine neue Liga durch Eingabe der neuen Liga-ID wählen. Um eine neue Liga einzurichten, muss vorher +zumindest die Saison existieren bzw. im Adminbereich angelegt werden. In diesem Fall werden alle Daten der Update-Datei nach ersetzen der Saison und Liga-ID +angezeigt und nach Bestätigung in die Datenbank übernommen.
+Wird eine bestehende Liga gewählt, werden zunächst Saison und Liga-ID im Update ersetzt und die Teams mit der Datenbank verglichen. Bei abweichenden Team-IDs +oder unterschiedlicher Teamanzahl, ist im nächsten Schritt ein Team-Mapping durchzuführen. Anschließend werden alle Abweichungen zwischen Update und Datenbank +angezeigt und man kann satz- und spaltenweise wählen welche Daten übernommen werden sollen. Unterschiedlich Vorbelegungen bei der Spaltenauswahl ist dabei zu +beachten und ggf. anzupassen. Nach der Übernahme der abweichenden Daten aus dem Updaten werden Abgabetermine und Status im Spieltag automatisch korrigiert und die +die Rangliste der Liga ab dem ersten Spieltag neu berechnet.
+Im Admin-Log wird eine Übersicht der durchgeführten Änderungen protokolliert.' + ), + array( + 0 => 'Team Mapping', + 1 => 'Das Team Mapping ist notwendig, wenn die Team-IDs nicht identisch sind oder die Anzahl der Teams abweichend ist. Neue hinzugekommene Teams, +wie z.B. in der EL die Gruppendritten der CL, werden in der Datenbank eingefügt. Nach dem Mapping wird überprüft, ob alle bestehenden Teams der Datenbank +zugeordnet sind. Die Team-IDs werden anhand des Mappings in den Update-Daten ausgetauscht. Neue Teams werden erst beim eigentlichen Update eingefügt.' + ), + array( + 0 => 'Status-Behandlung bei den Spielen', + 1 => 'Beim Erzeugen der XML-Daten werden die Status 4-6 auf die Status 1-3 geändert, d.h. im Update gibt es keine Spiele die aus der Wertung +genommen wurden. Für die Spiele mit Spielstatus < 2 werden die Tor-Felder als auch der Status selbst nicht übernommen. Steht in der Datenbank ein Status +größer als 3, so bleibt dieser Status erhalten und das Update-Programm behandelt den Datensatz wie mit dem korrespondierenden Status 1-3. Grundvoraussetzung +für die Datenübernahme unter Betrachtung des Status bleibt jedoch die Selektion der entsprechenden Spalten und Datensätzen innerhalb der Spiele.' + ), + array( + 0 => 'Negative Status übernehmen', + 1 => 'Ist diese Option gesetzt, werden die negativen Status, aber nicht die Tore, übernommen. Dadurch ist es möglich die gestaffelten Abgabetermine +aus dem Update zu übernehmen. Die Abgabetermine sind entweder aus dem Update zu übernehmen (Spaltenoptionen im Spieltag) oder manuell im Adminbereich zu +erfassen. Bei einer Ziel-Liga mit "Tippabgabe bis zum jeweiligen Spielbeginn" darf die Option "Negative Status übernehmen" nicht gewählt werden.' + ), + array( + 0 => 'Ergebnisse mit gleichem Status aktualisieren', + 1 => 'Nur wenn diese Option gesetzt ist, werden die Tor-Felder aus dem Update bei gleichem Status in Update und Datenbank übernommen. Dadurch +überschreibt das Update bereits erfasst (vorläufige) Ergebnisse in der Datenbank. Dies gilt auch für Spiele die in der Datenbank aus der Wertung genommen +wurden. Status 3 im Update überschreibt also die endgültigen Ergebnisse mit Status 6 in der Datenbank. Analog überschreibt Status 2 im Update die +vorläufigen, aus der Wertung genommen Ergebnisse mit Status 4, dies aber nur wenn die Option "Nur endgültige Ergebnisse übernehmen" nicht gewählt ist.' + ), + array( + 0 => 'Nur endgültige Ergebnisse übernehmen', + 1 => 'Wenn diese Option gesetzt ist, werden nur die Tor-Felder aus dem Update-Datensatz übernommen, wenn der Status des Spiels im Update gleich +3 ist. Vorläufige Ergebnisse aus dem Update werden somit nicht berücksichtigt. Sollen diese berücksichtigt werden, so ist diese Option explizit +auszuschalten. Sollen die vorläufigen Ergebnisse aus dem Update vorläufige Ergebnisse in der Datenbank überschreiben, ist zusätzlich die Option "Ergebnisse +mit gleichem Status aktualisieren" zu wählen.' + ), + array( + 0 => 'Zwischenspeicherung im Cache', + 1 => 'Die Daten der Saisonübersicht und der Ligen werden für 5 Minuten im Cache zwischengespeichert, damit keine doppelten Zugriffe auf die +Datenquelle erfolgen. Benötigt man innerhalb dieser Zeit trotzdem aktualisierte Daten, so muss man den Cache löschen um einen erneuten Download von der +Datenquelle zu erzwingen.' + ), +); +?> \ No newline at end of file diff --git a/language/de/info_acp_all_bets.php b/language/de/info_acp_all_bets.php new file mode 100644 index 0000000..f324c8e --- /dev/null +++ b/language/de/info_acp_all_bets.php @@ -0,0 +1,47 @@ + 'Alle Tipps', + 'ACP_FOOTBALL_ALL_BETS_MANAGEMENT' => 'Tipprunde-Alle Tipps ansehen', + 'ACP_FOOTBALL_ALL_BETS_VIEW' => 'Alle Tipps ansehen', + 'ACP_FOOTBALL_ALL_BETS_VIEW_EXPLAIN' => 'Hier kannst du alle Tipps der Tipper einsehen.', + + 'SELECT_MATCHDAY' => 'Spieltag wählen', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_bank.php b/language/de/info_acp_bank.php new file mode 100644 index 0000000..e3af3e6 --- /dev/null +++ b/language/de/info_acp_bank.php @@ -0,0 +1,114 @@ + 'Konten', + 'ACP_FOOTBALL_BANK_MANAGE' => 'Konten verwalten', + 'ACP_FOOTBALL_BANK_MANAGE_EXPLAIN' => 'Hier kannst du alle Tipprunden Konten verwalten. Du kannst Einsätze einziehen, Ein- und Auszahlungen verwalten und kontrollieren.', + 'ACP_FOOTBALL_BANK_MANAGEMENT' => 'Tipprunde-Konten-Verwaltung', + + 'BET_DEPOSIT' => 'Einsatz einzahlen', + 'BET_DEPOSIT_EXPLAIN' => 'Hier kannst du Einzahlungen der Teilnehmer verbuchen. Bei Verrechnung in Ultimate Points, wird der UP Saldo entsprechend erhöht bzw. ausgeglichen. Ohne Verrechnung werden nur die jeweiligen Protokollsätze zum gewählten Spieltag erfasst.', + 'BOOK' => 'buchen', + 'BOOKED' => 'Gebucht', + + 'CARRYOVER_NEW_SEASON' => 'Übertrag in die nächste Saison', + 'CARRYOVER_OLD_SEASON' => 'Übertrag aus der letzten Saison', + 'CONFIRM_BET' => 'Bist du sicher, dass du bei den gewählten Tippern die Einsätze abbuchen möchtest?', + 'CONFIRM_CANCEL_BET' => 'Bist du sicher, dass du bei den gewählten Tippern die Einsätze stornieren möchtest?', + 'CONFIRM_CANCEL_DEPOSIT' => 'Bist du sicher, dass du bei den gewählten Tippern die Einzahlungen stornieren möchtest?', + 'CONFIRM_CANCEL_PAY' => 'Bist du sicher, dass du bei den gewählten Tippern die Auszahlungen stornieren möchtest?', + 'CONFIRM_CARRYOVER_PAY' => 'Bist du sicher, dass du bei den gewählten Tippern ein Teil der Gewinne in die neue Saison einzahlen möchtest?', + 'CONFIRM_DEPOSIT' => 'Bist du sicher, dass du bei den gewählten Tippern die Einzahlungen buchen möchtest?', + 'CONFIRM_LEAGUE_BET' => 'Bist du sicher, dass du bei den gewählten Ligen die Einsätze abbuchen möchtest?', + 'CONFIRM_LEAGUE_DELETE_WIN' => 'Bist du sicher, dass du bei den gewählten Ligen alle Gewinne löschen möchtest?', + 'CONFIRM_LEAGUE_DEPOSIT' => 'Bist du sicher, dass du bei den gewählten Ligen die Einzahlungen buchen möchtest?', + 'CONFIRM_LEAGUE_PAY' => 'Bist du sicher, dass du bei den gewählten Ligen die Auszahlungen buchen möchtest?', + 'CONFIRM_PAY' => 'Bist du sicher, dass du bei den gewählten Tippern die Auszahlungen buchen möchtest?', + + 'DEBIT_BET' => 'Einsatz abbuchen', + 'DEBIT_BET_EXPLAIN' => 'Hier kannst du Einsätze der Teilnehmer einfordern oder stornieren. Bei Verrechnung in Ultimate Points, wird der UP Saldo entsprechend belastet.', + 'DEPOSITED' => 'Eingezahlt', + + 'FOOTBALL_BANK_OFF' => 'Die Tipprunden Konten-Verwaltung wurde in den Tipprunden-Funktionalitäten deaktiviert.', + + 'LEAGUE_BANK' => 'Konten', + 'LEAGUE_BANK_EXPLAIN' => 'Dies sind die aktuellen Kontenbuchungen der jeweiligen Ligen. Am Ende der Saison sollten zumindest Einsatz/Gewinn und Ein-/Auszahlungen paarweise identisch sein. Aktionen auf dieser Seite werden für alle Teilnehmer ausgeführt. Einsätze und Einzahlungen werden für den 1. Spieltag, Auszahlung für den aktuellen Spieltag gebucht. Buchungen für einzelne Teilnehmer kannst du vernehmen, indem du auf den entsprechenden Betrag klickst. Mit Klick auf den Liganamen kannst du eine Übersicht als CSV-Datei downloaden.', + 'LEAGUE_BET' => '%s Einsatz wurde abgebucht.', + 'LEAGUE_BETS' => '%s Einsätze wurden abgebucht.', + 'LEAGUE_CANCEL_BET' => '%s Einsatzbuchung wurde storniert.', + 'LEAGUE_CANCEL_BETS' => '%s Einsatzbuchungen wurden storniert.', + 'LEAGUE_CANCEL_DEPOSIT' => '%s Einsatzzahlung wurde storniert.', + 'LEAGUE_CANCEL_DEPOSITS' => '%s Einsatzzahlungen wurden storniert.', + 'LEAGUE_CANCEL_PAY' => '%s Gewinnauszahlung wurde storniert.', + 'LEAGUE_CANCEL_PAYS' => '%s Gewinnauszahlungen wurden storniert.', + 'LEAGUE_CARRYOVER_PAY' => '%s Gewinnanteil wurde als Einzahlung in die neue Saison übertragen.', + 'LEAGUE_CARRYOVER_PAYS' => '%s Gewinnanteile wurden als Einzahlung in die neue Saison übertragen.', + 'LEAGUE_DELETE_WIN' => '%s Gewinn wurde gelöscht.', + 'LEAGUE_DELETE_WINS' => '%s Gewinne wurden gelöscht.', + 'LEAGUE_DEPOSIT' => '%s Einsatz wurde eingezahlt.', + 'LEAGUE_DEPOSITS' => '%s Einsätze wurden eingezahlt.', + 'LEAGUE_NAME' => 'Liganame', + 'LEAGUE_PAY' => '%s Gewinn wurde ausgezahlt.', + 'LEAGUE_PAYS' => '%s Gewinne wurden ausgezahlt.', + + 'MEMBER_BET' => 'Einsätze buchen', + 'MEMBER_CANCEL_BET' => 'Einsätze stornieren', + 'MEMBER_CANCEL_DEPOSITED' => 'Einzahlungen stornieren', + 'MEMBER_CANCEL_PAID' => 'Auszahlungen stornieren', + 'MEMBER_CARRYOVER_PAID' => 'Einzahlung in nächste Saison', + 'MEMBER_DELETE_WINS' => 'Gewinne löschen', + 'MEMBER_DEPOSITED' => 'Einzahlungen buchen', + 'MEMBER_PAID' => 'Auszahlungen buchen', + + 'NO_LEAGUE' => 'Keine Liga angegeben.', + 'NO_LEAGUES_SELECTED' => 'Es wurde keine Liga gewählt.', + 'NO_MEMBERS_SELECTED' => 'Es wurde kein Mitglied ausgewählt, bzw. das gewählte Mitglied ist nicht bekannt.', + 'NO_SEASON' => 'Es existiert keine Saison. Bitte zuerst eine Saison erstellen.', + 'NO_VALID_CALL' => 'Unzulässiger Aufruf! Die Aktion wird abgebrochen.', + + 'PAID' => 'Ausgezahlt', + 'PAY_WINS' => 'Gewinne auszahlen', + 'PAY_WINS_EXPLAIN' => 'Hier kannst du Gewinne oder Teilgewinne auszahlen oder als Einsatz in die nächste Saison übertragen. Bei Verrechnung in Ultimate Points, wird der UP Saldo entsprechend belastet.', + + 'SELECT_SEASON' => 'Saison auswählen', + 'SET_DEPOSITS' => 'Einzahlungen berechnen', + + 'WINS' => 'Gewinne', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_bets.php b/language/de/info_acp_bets.php new file mode 100644 index 0000000..f28e037 --- /dev/null +++ b/language/de/info_acp_bets.php @@ -0,0 +1,47 @@ + 'Tipps', + 'ACP_FOOTBALL_BETS_MANAGE' => 'Tipps editieren', + 'ACP_FOOTBALL_BETS_MANAGE_EXPLAIN' => 'Hier kannst du alle Tipps der Tipper editieren.', + 'ACP_FOOTBALL_BETS_MANAGEMENT' => 'Tipprunde-Tipps editieren', + + 'SELECT_MATCHDAY' => 'Spieltag wählen', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_extra.php b/language/de/info_acp_extra.php new file mode 100644 index 0000000..0e9e1c1 --- /dev/null +++ b/language/de/info_acp_extra.php @@ -0,0 +1,93 @@ + 'Sondertipps', + 'ACP_FOOTBALL_EXTRA_MANAGE' => 'Sondertipps verwalten', + 'ACP_FOOTBALL_EXTRA_MANAGE_EXPLAIN' => 'Hier kannst du Sondertipps zu Spieltagen einer Liga zuordnen. Du kannst bestehende löschen oder ändern oder einen neuen Sondertipp erstellen, sowie Typ, Wertung, Punkte und den Endzeitpunkt der Sondertipps einstellen.', + 'ACP_FOOTBALL_EXTRA_MANAGEMENT' => 'Tipprunde-Sondertipp-Verwaltung', + + 'EVAL_BEFORE_DELIVERY' => 'Der Auswertungs-Spieltag darf nicht vor dem Abgabe-Spieltag liegen.', + 'EXTRA_ADD' => 'Sondertipp hinzufügen', + 'EXTRA_ADDED' => 'Sondertipp erfolgreich hinzugefügt.', + 'EXTRA_CONFIRM_DELETE' => 'Bist du sicher, dass du den Sondertipp "%1$s" in der %2$s. Liga aus der Saison %3$s mit allen Tipps löschen willst?', + 'EXTRA_CREATE_FAILED' => 'Sondertipp konnte nicht erstellt werden.', + 'EXTRA_DEF' => 'Bestehende Sondertipps', + 'EXTRA_DEF_EXPLAIN' => 'Dies sind Sondertipps, die von dir oder einem anderen Administrator erstellt wurden. Du kannst Sondertippeinstellungen ändern oder Sondertipps löschen.', + 'EXTRA_DELETED' => 'Sondertipp gelöscht', + 'EXTRA_DETAILS' => 'Sondertippdaten', + 'EXTRA_MATCHDAY' => 'Abgabe', + 'EXTRA_MATCHDAY_EVAL' => 'Auswertung', + 'EXTRA_MATCHDAY_EVAL_EXPLAIN' => 'Das Ergebnis des Sondertipps wird an diesem Spieltag eingegeben. Bei unterschiedlichen Spieltagen für Abgabe und Ergebnis werden die Punkte der Gesamtwertung zugerechnet, sonst fließen sie in die Spieltagswertung mit ein.', + 'EXTRA_MATCHDAY_EXPLAIN' => 'Die Tippabgabe des Sondertipps wird mit dem ersten Abgabetermin dieses Spieltags gesperrt.', + 'EXTRA_NO' => 'Nummer', + 'EXTRA_NO_DELETE' => 'Du darfst keine Sondertipps löschen. Dies dürfen nur Gründungsmitglieder', + 'EXTRA_POINTS' => 'Mögl. Punkte', + 'EXTRA_POINTS_EXPLAIN' => 'Maximal zu erreichende Punkte in Abhängigkeit zum Punktemodus.', + 'EXTRA_QUESTION' => 'Sondertipp Frage', + 'EXTRA_QUESTION_EXPLAIN' => 'Freier Fragetext. Bitte eine präzise, unmissverständliche Frage zum hinterlegten Fragetyp formulieren.', + 'EXTRA_QUESTION_TYPE' => 'Frage- bzw. Wertungs-Typ.', + 'EXTRA_QUESTION_TYPE_EXPLAIN' => '1 = Auswahl eines Teams, Punkte nur bei Übereinstimmung
2 = Auswahl eines Teams mehrere Ergebnisse, Punkte bei einem Treffer
3 = Texteingabe, Punkte bei Übereinstimmung
4 = Texteingabe aber mehrere Ergebnisse, Punkte bei einem Treffer
5 = Zahl, Punkte abzgl. der Differenz zwischen Tipp und Ergebnis', + 'EXTRA_STATUS' => 'Status', + 'EXTRA_STATUS_EXPLAIN' => '0 = offen (Tippabgabe möglich)
1 = keine Tippabgabe mehr möglich und noch keine Ergebnisse
2 = vorläufige Ergebnisse liegen vor
3 = abgeschlossen, endgültige Ergebnisse liegen vor.', + 'EXTRA_UPDATE_FAILED' => 'Die Sondertippeinstellungen konnten nicht aktualisiert werden.', + 'EXTRA_UPDATED' => 'Sondertippeinstellungen erfolgreich aktualisiert.', + + 'LEAGUE' => 'Liga', + + 'MATCHDAY' => 'Spieltag', + + 'NO_EXTRA' => 'Der gewählte Sondertipp existiert nicht. Bitte zuerst einen Sondertipp in dieser Liga der Saison erstellen.', + 'NO_EXTRA_CREATED' => 'Es wurden bislang keine Sondertipps erstellt.', + 'NO_LEAGUE' => 'Die gewählte Liga existiert nicht in der Saison %1$s. Bitte zuerst eine Liga in der Saison %1$s erstellen.', + 'NO_SEASON' => 'Die gewählte Saison existiert nicht. Bitte zuerst eine Saison erstellen.', + + 'QUESTION_TYPE' => 'Frage-Typ', + + 'SEASON' => 'Saison', + 'SELECT_LEAGUE' => 'Liga auswählen', + 'SELECT_MATCHDAY' => 'Wähle einen Spieltag', + + 'TOO_LARGE_EXTRA_POINTS' => 'Die Punktzahl für den Sondertipp ist zu groß. Erlaubt: 0-99', + 'TOO_LARGE_MATCHDAY' => 'Du musst einen Abgabe-Spieltag wählen.', + 'TOO_LARGE_MATCHDAY_EVAL' => 'Du musst einen Auswertungs-Spieltag wählen.', + 'TOO_SMALL_EXTRA_POINTS' => 'Die Punktzahl für den Sondertipp ist zu klein. Erlaubt: 0-99', + 'TOO_SMALL_MATCHDAY' => 'Du musst einen Abgabe-Spieltag wählen.', + 'TOO_SMALL_MATCHDAY_EVAL' => 'Du musst einen Auswertungs-Spieltag wählen.', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_football.php b/language/de/info_acp_football.php new file mode 100644 index 0000000..73a7b29 --- /dev/null +++ b/language/de/info_acp_football.php @@ -0,0 +1,205 @@ + 'Fussball', + 'ACP_FOOTBALL_MANAGEMENT' => 'Tipprunde-Verwalten', + 'ACP_FOOTBALL_OPERATION' => 'Spielbetrieb', + 'ACP_FOOTBALL_MANAGE' => 'Spielplan Verwaltung', + + 'ACP_FOOTBALL_CONFIGURATION' => 'Tipprunden-Konfiguration', + 'ACP_FOOTBALL_SETTINGS' => 'Tipprunden-Einstellungen', + 'ACP_FOOTBALL_SETTINGS_EXPLAIN' => 'Hier kannst du einige grundlegende Einstellungen der Tipprunde vornehmen, ihr einen passenden Namen und eine Beschreibung geben und, neben anderen Werten, die Standard-Einstellungen für die Anzeige anpassen. ', + + 'DISABLE_FOOTBALL' => 'Tipprunde deaktivieren', + 'DISABLE_FOOTBALL_EXPLAIN' => 'Hiermit sperrst du die Tipprunde für alle Benutzer. Wenn du möchtest, kannst du eine kurze Nachricht (bis zu 255 Zeichen) angeben. ', + 'DISPLAY_RANKS' => 'Anzahl angezeigter Tipper in den Übersichts-Ranglisten', + 'DISPLAY_RANKS_EXPLAIN' => 'Limitiert die Anzeige der Spieltags- und Gesamtrangliste in der Hauptansicht. Die eigene Platzierung wird ggf. unten angehängt. ', + + 'FOOTBALL_CODE' => 'Tipprunden Code', + 'FOOTBALL_CODE_EXPLAIN' => 'Zugangscode zur Tipprunde z.B. für Cronjobs. ', + 'FOOTBALL_FULLSCREEN' => 'Tipprunden-Seiten im Fullscreen-Modus', + 'FOOTBALL_FULLSCREEN_EXPLAIN' => 'Hiermit kannst Du, abweichend vom Forum, die Tipprundenseiten mit minimalen Seitenrändern anzeigen lassen. ', + 'FOOTBALL_HEADER_ENABLE' => 'Header-Bild je Liga verwenden', + 'FOOTBALL_HEADER_ENABLE_EXPLAIN' => 'Hiermit kannst Du festlegen, ob je Liga die zugehöriges Bild im Header angezeigt werden soll. ', + 'FOOTBALL_INFO' => 'Tipprunden Information anzeigen', + 'FOOTBALL_INFO_EXPLAIN' => 'Hiermit kannst Du eine kurze Information (bis zu 255 Zeichen) oberhalb der Tippdaten anzeigen lassen. ', + 'FOOTBALL_NAME' => 'Name der Tipprunde', + 'FOOTBALL_NAME_EXPLAIN' => 'Name der im Tipprunden-Menu verwendet wird, um zur Hauptseite zu gelangen. ', + 'FOOTBALL_OVERRIDE_STYLE' => 'Style überschreiben', + 'FOOTBALL_OVERRIDE_STYLE_EXPLAIN' => 'Verwendet für die Tipprunde immer den Standard-Tipprunden-Style. ', + 'FOOTBALL_STYLE' => 'Standard Tipprunden Style', + 'FOOTBALL_UPDATE_SOURCE' => 'Update Quelle', + 'FOOTBALL_UPDATE_SOURCE_EXPLAIN' => 'Link zur Quelle des Updates. Falls leer, wird automatisch http://football.bplaced.net/football/xml/football_xml_season.php gewählt. ', + 'FOOTBALL_UPDATE_CODE' => 'Update Code', + 'FOOTBALL_UPDATE_CODE_EXPLAIN' => 'Nur mit diesem Code können Updates von dieser Seite heruntergeladen werden. ', + + 'GUEST_VIEW' => 'Tipprunde für Gäste sichtbar', + 'GUEST_VIEW_EXPLAIN' => 'Soll die Tipprunde für Gäste sichtbar sein?', + + 'USER_VIEW' => 'Tipprunde nur für Teilnehmer sichtbar', + 'USER_VIEW_EXPLAIN' => 'Soll die Tipprunde nur für Tipprunden-Teilnehmer sichtbar sein?', + + 'HOST_TIMEZONE' => 'Host Zeitzone', + 'HOST_TIMEZONE_EXPLAIN' => 'Differenz zur Board Zeitzone wenn dein Host in einer anderen Zeitzone steht, damit die Tippabgabe korrekt funktioniert. ', + + 'LEFT_COLUMN' => 'Spaltenbreite Links in Pixeln', + 'LEFT_COLUMN_EXPLAIN' => 'Optimale Breite 180 Pixel. Dieser Wert sollte nicht unterschritten werden. ', + + 'PREDICTION_LEAGUE' => 'Tipprunde', + + 'RIGHT_COLUMN' => 'Spaltenbreite Rechts in Pixeln', + 'RIGHT_COLUMN_EXPLAIN' => 'Optimal 180 Pixel. Dieser Wert wird durch externe Einblendungen ggf. übersteuert. ', + + 'USERS_PAGE' => 'Tipper pro Seite', + 'USERS_PAGE_EXPLAIN' => 'Anzahl der Tipper je Seite in der Hauptrangliste und Alle Tipps. ', + + 'WIN_NAME' => 'Gewinn Name (oder Währung)', + 'WIN_NAME_EXPLAIN' => 'Der Name, der für die Gewinne in der Tipprunde angezeigt werden soll', + + 'ANNOUNCEMENT_TOPIC' => 'Release Ankündigung', + 'CURRENT_VERSION' => 'Derzeitige Version', + 'DOWNLOAD_LATEST' => 'Neueste Version herunterladen', + 'LATEST_VERSION' => 'Neueste Version', + 'NOT_UP_TO_DATE' => '%s ist nicht aktuell', + 'RELEASE_ANNOUNCEMENT' => 'Ankündigungsthema', + 'UP_TO_DATE' => '%s ist aktuell', + 'FOOTBALL_VERSION_CHECK' => 'Football Prediction League Extension Version Check', + +)); + +// Football Features +$lang = array_merge($lang, array( + 'ACP_FOOTBALL_FEATURES' => 'Tipprunden-Funktionalitäten', + 'ACP_FOOTBALL_FEATURES_EXPLAIN' => 'Hier kannst du einige Funktionen der Tipprunde aktivieren bzw. deaktivieren', + + 'AUTO' => 'Auto', + + 'BANK' => 'Tipprunden Konto verwalten', + 'BANK_EXPLAIN' => 'Sollen Tipprunden Konten mit Einsätzen und Gewinnen gepflegt werden?', + + 'FOOTBALL_SEASON_START' => 'Starte in Saison', + 'FOOTBALL_SEASON_START_EXPLAIN' => 'Starte in dieser oder in der automatisch ermittelten Saison, wenn noch keine ausgewählt wurde. ', + + 'FOOTBALL_REMEMBER_ENABLE' => 'Cronjob für die Tipp-Erinnerungsmail aktivieren', + 'FOOTBALL_REMEMBER_ENABLE_EXPLAIN' => 'Hier kannst Du angeben, ob 1 Tag vor Tippabgabe eine Erinnerungsmail versendet werden soll.', + + 'FOOTBALL_REMEMBER_NEXT_RUN' => 'Nächster Cronjoblauf für die Tipp-Erinnerungsmail', + 'FOOTBALL_REMEMBER_NEXT_RUN_EXPLAIN'=> 'Hier kannst Du einstellen, wann der Cronjob für die Tipp-Erinnerungsmail frühestens wieder aufgerufen wird. Nach Ausführung wird der Cronjob für den Folgetag zur geichen Uhrzeit neu eingeplant.', + + 'FOUNDER_DELETE' => 'Nur Gründungsmitglieder dürfen löschen', + 'FOUNDER_DELETE_EXPLAIN' => 'Löschung von Spielplandaten wie Saisons, Ligen, Teams, Spieltage und Spielpläne nur auf Gründungsmitglieder beschränken. ', + + 'RESULTS_AT_TIME' => 'Eingabe endgültiger Spielergebnisse erst nach Spielende', + 'RESULTS_AT_TIME_EXPLAIN' => 'Eingabe der endgültigen Spielergebnisse im Adminbereich erst nach Spielende freigeben. Die Eingabe von vorläufigen Spielergebnissen durch die Tipper ist hiervon unabhängig. ', + + 'SAME_ALLOWED' => 'Alle Tipps an einem Spieltag gleich', + 'SAME_ALLOWED_EXPLAIN' => 'Identische Tipps (Oma-Tipps) bei allen Spielen eines Spieltags erlauben bzw. verbieten. ', + + 'ULT_POINTS' => 'Ultimate Points einbinden', + 'ULT_POINTS_EXPLAIN' => 'Soll es möglich sein, die Punkte oder Gewinne in Ultimate Points verrechnen zu lassen? Dazu muss Ultimate Points installiert sein. ', + 'ULT_POINTS_FACTOR' => 'Ultimate Points Faktor', + 'ULT_POINTS_FACTOR_EXPLAIN' => 'Faktor mit dem die Punkte je Spieltag in Ultimate Points gutgeschrieben werden. ', + 'UP_NONE' => 'Keine', + 'UP_POINTS' => 'Punkte', + 'UP_WINS' => 'Gewinne', + + 'VIEW_BETS' => 'Tipps immer Anzeigen', + 'VIEW_BETS_EXPLAIN' => 'Sollen alle Tipps sofort angezeigt werden? Wenn Nein, dann werden sie erst nach Tippabgabeschluss angezeigt. ', + 'VIEW_CURRENT' => 'Anzeige startet in aktueller Liga', + 'VIEW_CURRENT_EXPLAIN' => 'Soll beim ersten Aufruf die Liga angezeigt werden, in der die nächsten Spiele stattfinden? Sonst wird immer die erste Liga angezeigt', + 'VIEW_TENDENCIES' => 'Tipp-Tendenzen immer Anzeigen', + 'VIEW_TENDENCIES_EXPLAIN' => 'Sollen alle Tipp-Tendenzen sofort angezeigt werden? Wenn Nein, dann werden sie erst nach Tippabgabeschluss angezeigt. ', + + 'WIN_HITS02' => 'Gewinne Volltreffer-Wertung mit Auswärtspunkten', + 'WIN_HITS02_EXPLAIN' => 'Sollen Gewinne der Volltreffer-Wertung mit Auswärtspunkten angezeigt werden? Wenn Nein, muss sichergestellt werden, dass dazu keine Gewinne in den bestehenden Ligen hinterlegt wurden. ', +)); + +// Football Menu +$lang = array_merge($lang, array( + 'ACP_FOOTBALL_MENU' => 'Tipprunden-Menu', + 'ACP_FOOTBALL_MENU_EXPLAIN' => 'Hier kannst du Links für das Tipprunden-Menu hinterlegen. Die Linkbeschriftung kannst du frei wählen. ', + + 'FOOTBALL_BREADCRUMB' => 'Tipprunden breadcrumb anzeigen', + 'FOOTBALL_BREADCRUMB_EXPLAIN' => 'Soll ein Breadcrumb-Link für die Tipprunden angezeigt werden? ', + 'FOOTBALL_SIDE' => 'Tipprunden Sidebar anzeigen', + 'FOOTBALL_SIDE_EXPLAIN' => 'Soll die Tipprunden Sidebar mit den Menüeinträgen angezeigt werden? ', + 'FOOTBALL_MENU' => 'Tipprunden Menu anzeigen', + 'FOOTBALL_MENU_EXPLAIN' => 'Soll das Tipprunden Dropdown Menü in der Navigationsleiste angezeigt werden? ', + 'MENU_DESC1' => 'Beschriftung http-Link 1', + 'MENU_DESC1_EXPLAIN' => 'Die Beschriftung des Links darf keine unzulässigen Sonderzeichen enthalten und höchsten 20 Zeichen lang sein. ', + 'MENU_DESC2' => 'Beschriftung http-Link 2', + 'MENU_DESC3' => 'Beschriftung http-Link 3', + 'MENU_LINK1' => 'Http-Link 1', + 'MENU_LINK1_EXPLAIN' => 'Bitte hier nur http Links eingeben. ', + 'MENU_LINK2' => 'Http-Link 2', + 'MENU_LINK3' => 'Http-Link 3', + 'MENU_NO_LINK' => 'Kein Link hinterlegt', +)); + + +// Football Help +$lang = array_merge($lang, array( + 'ACP_FOOTBALL_USERGUIDE' => 'Benutzerhilfe', + 'ACP_FOOTBALL_USERGUIDE_EXPLAIN' => 'Hier findest du Hilfe für die Einstellungen des phpBB3 Football MODs.
Wenn du Fragen hast, dann schaue bitte immer zuerst hier!', +)); + + +#// Football Logs +$lang = array_merge($lang, array( + 'LOG_FOOTBALL_FEATURES' => 'Tipprunden-Funktionalitäten geändert', + 'LOG_FOOTBALL_MENU' => 'Tipprunden-Menu geändert', + 'LOG_FOOTBALL_SETTINGS' => 'Tipprunde-Einstellungen geändert', + + 'LOG_FOOTBALL_MSG_TEST' => 'Aufruf am %s.', + 'LOG_FOOTBALL_MSG_TEST_TRAVEL' => 'Aufruf mit Zeitreise zum %s.', + + 'LOG_FOOTBALL_REMEMBER_CRON' => 'Cronjob Football remember ausgeführt
» %s', + 'LOG_FOOTBALL_REMEMBER_CRON_TEST' => 'Cronjob Football remember Testaufruf
» %s', + + 'FOOTBALL_REMEMBER_SUBJECT' => 'Bitte %1$s %2$d. Spieltag tippen', + 'FOOTBALL_REMEMBER_SUBJECT_BOARD' => 'Versendete Erinnerungs-Mails %1$s %2$d', + 'FOOTBALL_REMEMBER_ERROR_EMAIL' => '%1$s Erinnerungs-Mail an: %2$s gescheitert', + 'FOOTBALL_REMEMBER_ERROR_EMAIL_BOARD'=> '%1$s Versandliste Erinnerungs-Mail an: %2$s gescheitert', + 'FOOTBALL_REMEMBER_NOBODY' => 'Es muss niemand erinnert werden.', + 'FOOTBALL_REMEMBER_NO_DELIVERY' => 'Keine anstehende Tippabgabe im Zeitraum.', + 'FOOTBALL_REMEMBER_SEND' => '%1$s Erinnerungs-Mail an: %2$s', + +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_ko.php b/language/de/info_acp_ko.php new file mode 100644 index 0000000..8f23168 --- /dev/null +++ b/language/de/info_acp_ko.php @@ -0,0 +1,70 @@ + 'KO-Runden Gewinner', + 'ACP_FOOTBALL_KO_MANAGE' => 'KO-Runden Gewinner ermitteln', + 'ACP_FOOTBALL_KO_MANAGE_EXPLAIN' => 'Hier kannst du zu einer KO-Runde die Gewinner anhand der Begegnung(en) oder des Tabellenplatzes ermitteln und für kommende Spieltage freischalten. Bei der Spielplanerstellung werden nur diese Mannschaften für die Spieltage zur Auswahl angeboten. Ebenso ist es möglich Mannschaften anhand des Tabellenplatzes in eine andere KO-Liga zu überführen.', + 'ACP_FOOTBALL_KO_MANAGEMENT' => 'Tipprunde-KO-Runden abschliessen', + + 'CHOOSE_LEAGUE' => 'Liga wählen', + + 'ERROR_FROM_TO' => 'Fehler bei der Spieltagswahl. "Von" darf nicht nach "bis" liegen.', + 'ERROR_TARGET' => 'Fehler bei der Spieltagswahl. Der Ziel-Spieltag liegt nicht nach den Spieltagen zur Ermittlung.', + + 'GROUP_RANK' => 'Qualifiziert bis Tabellenplatz', + 'GROUP_RANK_EXPLAIN' => 'Alle Mannschaften bis zu diesem Tabellenplatz qualifizieren sich.', + + 'KO_GROUP' => 'Qualifikation anhand des Tabellenplatzes', + 'KO_MATCHDAYS' => 'Spieltage zur Ermittlung wählen', + 'KO_MOVED' => 'Folgende Teams wurden in eine andere Liga kopiert', + 'KO_NEXT' => 'Folgende Teams haben die nächste Runde erreicht', + 'KO_NEXT_CHECK' => 'Bitte die Teams prüfen, da bei Punktgleichheit der direkte Vergleich zählen kann, hier aber nicht berücksichtigt wird. ', + + 'MANAGE_GROUP' => 'Ermittlung anhand des Tabellenplatzes bei Gruppenpielen', + 'MATCHDAY_NEW' => 'Die Mannschaften qualifizieren sich bis Spieltag', + 'MATCHDAY_TARGET' => 'Ziel-Spieltag wählen', + 'MOVE_LEAGUE' => 'in Liga', + 'MOVE_RANK' => 'Transfer des Tabellenplatzes', + 'MOVE_RANK_EXPLAIN' => 'Die Mannschaften auf diesem Tabellenplatz werden in die hinterlegte Liga kopiert und sind bis zum angegeben Spieltag qualifiziert.', + + 'NO_KO_NEXT' => 'Es wurde kein Team in die nächste Runde gesetzt, da noch nicht alle Spiele gespielt sind!', + + 'PREDICTION_LEAGUE' => 'Tipprunde', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_leagues.php b/language/de/info_acp_leagues.php new file mode 100644 index 0000000..891d189 --- /dev/null +++ b/language/de/info_acp_leagues.php @@ -0,0 +1,149 @@ + 'Ligen', + 'ACP_FOOTBALL_LEAGUES_MANAGE' => 'Ligen verwalten', + 'ACP_FOOTBALL_LEAGUES_MANAGE_EXPLAIN' => 'Hier kannst du alle Ligen verwalten. Du kannst bestehende löschen oder ändern oder eine neue Liga erstellen, sowie Typ, Anzahl der Spieltage, Gewinne, Name und Kurzbezeichnug der Liga einstellen. ', + 'ACP_FOOTBALL_LEAGUES_MANAGEMENT' => 'Tipprunde-Liga-Verwaltung', + 'ADD_GROUP' => 'Gruppe hinzufügen', + 'ADD_USERS' => 'Benutzer hinzufügen', + 'ADD_USERS_EXPLAIN' => 'Hier kannst du neue Tipper zur Liga-Tipprunde hinzufügen. Bitte gib je einen Benutzernamen pro Zeile ein. ', + 'ALL_USERS' => 'Alle Mitglieder', + + 'BET_POINTS' => 'Einsatz', + 'BET_POINTS_EXPLAIN' => 'Einsatz zur Teilnahme am Saisonanfang', + 'BET_TYPE_KO' => 'Tipp bei KO-Spielen', + 'BET_TYPE_KO_EXPLAIN' => 'Auf welches Ergebnis soll bei KO-Spielen getippt werden?', + + 'CHECK_HIT_WINS' => 'Gewinn Volltreffer-Wertung fehlerhaft. Bitte korrigieren. ', + 'CHECK_HITS02_WINS' => 'Gewinn Volltreffer-Wertung mit Auswärtspunkten fehlerhaft. Bitte korrigieren. ', + 'CHECK_MATCHDAY_WINS' => 'Gewinne je Spieltag fehlerhaft. Bitte korrigieren. ', + 'CHECK_RULES_POST_ID' => 'Bei Beitritt durch den User muss die Beitragsnummer mit den Regeln hinterlegt werden. ', + 'CHECK_SEASON_WINS' => 'Saisongewinne fehlerhaft. Bitte korrigieren. ', + 'CREATE_LEAGUE' => 'Neue Liga erstellen', + + 'LEAGUE_BET_IN_TIME' => 'Tippabgabe bis zum jeweiligen Spielbeginn', + 'LEAGUE_BET_IN_TIME_EXPLAIN' => 'Dürfen die Tipper bis zum jeweiligen Spielbeginn tippen, oder soll die Tippabgabe der Spiele eines Spieltags nur bis zu einem (maximal drei) Termin(en) möglich sein?', + 'LEAGUE_CHAMP' => 'Meisterschaft', + 'LEAGUE_CONFIRM_DELETE' => 'Bist du sicher, dass du die %1$s aus der Saison %2$s mit allen Daten (Spieltage, Spielplänen, Tipps und Ranglisten) löschen willst?', + 'LEAGUE_CREATE_FAILED' => 'Liga konnte nicht erstellt werden. ', + 'LEAGUE_CREATED' => 'Liga erfolgreich erstellt. ', + 'LEAGUE_CURRENT' => 'Aktuelle Liga', + 'LEAGUE_DEF' => 'Bestehende Ligen', + 'LEAGUE_DEF_EXPLAIN' => 'Dies sind Ligen, die von dir oder einem anderen Administrator erstellt wurden. Du kannst Ligaeinstellungen ändern oder Ligen löschen. ', + 'LEAGUE_DELETE' => 'Liga entfernen', + 'LEAGUE_DELETED' => 'Liga gelöscht', + 'LEAGUE_DETAILS' => 'Ligadetails', + 'LEAGUE_EDIT_EXPLAIN' => 'Hier kannst du eine bestehende Liga bearbeiten. Du kannst Typ, Anzahl der Spieltage, Gewinne, Namen und die Kurzbezeichnung ändern. ', + 'LEAGUE_JOIN_BY_USER' => 'Beitritt in diese Tipprunde durch User', + 'LEAGUE_JOIN_BY_USER_EXPLAIN' => 'Sollen die Forum-User selbst dieser Tipprunde beitreten können, oder soll die Aufnahme in diese Tipprunde nur durch den Admin erfolgen?', + 'LEAGUE_JOIN_IN_SEASON' => 'Beitritt in diese Tipprunde während der Saison', + 'LEAGUE_JOIN_IN_SEASON_EXPLAIN' => 'Dürfen die Forum-User während der laufenden Saison dieser Tipprunde beitreten?', + 'LEAGUE_KO' => 'KO-Runde', + 'LEAGUE_MATCHDAYS' => 'Anzahl der Spieltage', + 'LEAGUE_MATCHDAYS_EMPTY' => 'Die Anzahl der Spieltage fehlt. ', + 'LEAGUE_MATCHDAYS_EXPLAIN' => 'Bei der Berechnung der Anzahl der Spieltage ist zu berücksichtigen, dass Spiele unterschiedlicher Runden zu einem Spieltag zusammengefasst werden können, damit nicht auf einzelne oder wenige Spiele getippt werden muss. ', + 'LEAGUE_MATCHES' => 'Anzahl der Spiele je Spieltag', + 'LEAGUE_MATCHES_EXPLAIN' => 'Bei KO-Runden mit unterschiedlicher Anzahl von Spielen an den Spieltagen, ist hier 0 einzutragen und die Anzahl der Spiele beim Spieltag zu erfassen. ', + 'LEAGUE_MEMBERS' => 'Tipprunden-Teilnehmer', + 'LEAGUE_NAME' => 'Liganame', + 'LEAGUE_NAME_EMPTY' => 'Der Liganame muss mindesten 3 Buchstaben lang sein. ', + 'LEAGUE_NO_MEMBER' => 'Die Liga hat zur Zeit keine Tipper', + 'LEAGUE_NUMBER' => 'Die angegebene Liga muss numerisch sein. Bitte eine Liganummer von 1-99 eingeben. ', + 'LEAGUE_POINTS' => 'Punkte Modus dieser Liga-Tipprunde', + 'LEAGUE_POINTS_DIFF' => 'Punkte bei richtiger Tordifferenz', + 'LEAGUE_POINTS_DIFF_EXPLAIN' => 'Punkte für richtige Tordifferenz. ', + 'LEAGUE_POINTS_HIT' => 'Punkte für einen Volltreffer', + 'LEAGUE_POINTS_HIT_EXPLAIN' => 'Punkte, wenn der Tipp mit dem Ergebnis übereinstimmt. ', + 'LEAGUE_POINTS_LAST' => 'Punkte des letzten für Nichttipper', + 'LEAGUE_POINTS_LAST_EXPLAIN' => 'Sollen die Nichttipper automatisch die Punkte des schlechtesten Tippers erhalten? Dies können eventuell auch 0 Punkte sein. ', + 'LEAGUE_POINTS_MODE' => 'Punkte Modus', + 'LEAGUE_POINTS_MODE_EXPLAIN' => '1 = Volltrefferpunkte und bei richtiger Tendenz je abweichendem Tor ein Punkt weniger aber mind. Tendenzpunkte. Bei Unentschieden nur einfacher Abzug bei abweichendem Tor.
2 = wie 1 jedoch bei Unentschieden voller Abzug je Torabweichung.
3 = Volltreffer- oder Tendenzpunkte.
4 = Volltreffer-, Differenz- oder Tendenzpunkte.
5 = wie 4 aber bei Remis keine Diffenzpunkte.
6 = Volltreffer- oder Tendenzpunkte; Differenzpunkte bei Unentschieden-Tendenz. ', + 'LEAGUE_POINTS_TENDENCY' => 'Punkte bei richtiger Tendenz', + 'LEAGUE_POINTS_TENDENCY_EXPLAIN' => 'Punkte bzw. Mindestpunkte bei richtiger Tendenz. ', + 'LEAGUE_RULES_POST_ID' => 'Beitragsnummer mit den Regeln', + 'LEAGUE_RULES_POST_ID_EXPLAIN' => 'Post-ID mit den Regeln zu dieser Liga-Tipprunde. Die Post-Id wird beim Button Beitrag melden angezeigt. ', + 'LEAGUE_SHORT' => 'Liga Kurzbezeichnung', + 'LEAGUE_SHORT_EMPTY' => 'Die Kurzbezeichnung fehlt. ', + 'LEAGUE_SHORT_EXPLAIN' => 'Dreistelliges Kürzel z.B. 1BL, 2BL, DFB, CL oder EL zur Identifizierung der Liga in der Download-Datei. ', + 'LEAGUE_TAKEN' => 'Diese Liga existiert bereits in dieser Saison. Bitte wähle eine andere Liganummer aus. ', + 'LEAGUE_TYPE' => 'Ligatyp', + 'LEAGUE_TYPE_EXPLAIN' => 'Bei Spielrunden mit Spielen, die über eine Verlängerung entschieden werden können ist hier KO-Runde zu wählen, auch wenn einzelne Spiele dieser Runde nach 90 Minuten enden. ', + 'LEAGUE_UPDATE_FAILED' => 'Ligaeinstellungen konnten nicht aktualisiert werden. ', + 'LEAGUE_UPDATED' => 'Ligaeinstellungen erfolgreich aktualisiert. ', + 'LEAGUE_USERS_ADD' => 'Tipper zur Liga hinzugefügt. ', + 'LEAGUE_USERS_REMOVE' => 'Tipper aus der Liga entfernt. ', + 'LEAGUE_WIN_EXPLAIN' => 'Bei den folgenden Gewinnfeldern sind die Gewinne je Platz durch ; getrennt einzugeben. Also 10.50;5 für Platz 1 = 10,50 Euro und Platz 2 = 5 Euro', + 'LEAGUE_WIN_HITS' => 'Gewinn Volltreffer-Wertung', + 'LEAGUE_WIN_HITS_AWAY' => 'Gewinn Volltreffer-Wertung mit Auswärtspunkten', + 'LEAGUE_WIN_HITS_AWAY_EXPLAIN' => 'Gewinn in Euro für den Erstplatzierten der Volltreffer-Wertung bei denen die Auswärtsmannschaft gepunktet hat. ', + 'LEAGUE_WIN_HITS_EXPLAIN' => 'Gewinn in Euro für den Erstplatzierten der Volltreffer-Wertung. ', + 'LEAGUE_WIN_MATCHDAYS' => 'Gewinne je Spieltag', + 'LEAGUE_WIN_MATCHDAYS_EXPLAIN' => 'Platzierungsgewinne je Spieltag. ', + 'LEAGUE_WIN_SEASON' => 'Gewinne Saison', + 'LEAGUE_WIN_SEASON_EXPLAIN' => 'Einmalige Platzierungsgewinne am Ende der Saison. ', + 'LEAGUE_WINS' => 'Liga Gewinne', + 'LEAGUES_NO_DELETE' => 'Du darfst keine Liga löschen. Dies dürfen nur Gründungsmitglieder', + 'LEAGUES_NO_TEAM' => 'Diese Liga hat keine Teams', + + 'MEMBER' => 'Tipper', + 'MEMBER_ALL' => 'Alle aktive Boardmitglieder aufnehmen', + 'MEMBER_CONFIRM_DELETE' => 'Bist du sicher, dass du die gewählten Tipper aus der Tipprunde %1$s der Saison %2$s mit allen Daten (Tipps, Ranglistenplätze und Kontoauszug) löschen willst?', + 'MEMBER_DELETE' => 'Tipper aus Liga entfernen', + 'MEMBER_EXISTS' => 'Dieser Tipper ist bereits Teilnehmer dieser Liga-Tipprunde. ', + 'MEMBER_EXPLAIN' => 'Dies ist eine Liste aller Tipper dieser Liga. Von hier aus kannst du einstellen, wer Tipper dieser Liga sein soll. ', + + 'NO_LEAGUE' => 'Keine Liga angegeben. ', + 'NO_LEAGUES_CREATED' => 'Es wurden bislang keine Ligen erstellt. ', + 'NO_MATCHDAYS_KO' => 'Bei einer KO-Runde müssen erst die Spieltage erfasst werden bevor User der Tipprunde beitreten können. ', + 'NO_MEMBERS_SELECTED' => 'Es wurde kein Mitglied ausgewählt, bzw. das gewählte Mitglied ist nicht bekannt. ', + 'NO_SEASON' => 'Es existiert keine Saison. Bitte zuerst eine Saison erstellen. ', + + 'SELECT_SEASON' => 'Saison auswählen', + + 'TOO_LARGE_LEAGUE' => 'Der Wert für die Liga ist zu groß. Es sind nur Ligen zwischen 1 und 99 möglich. ', + 'TOO_LARGE_LEAGUE_MATCHDAYS' => 'Die Anzahl der Spieltage ist zu groß. Sie muss zwischen 1 und 99 liegen. ', + 'TOO_LARGE_LEAGUE_MATCHES' => 'Die Anzahl der Spiele je Spieltag ist zu groß. Sie muss zwischen 0 und 99 liegen. ', + 'TOO_SHORT_LEAGUE_SHORT' => 'Die Kurzbezeichnung der Liga muss mindesten 1 Zeichen lang sein. ', + 'TOO_SHORT_SEASON' => 'Der Liganame muss mindesten 2 Zeichen lang sein. ', + 'TOO_SMALL_LEAGUE' => 'Der Wert für die Liga ist zu klein. Es sind nur Ligen zwischen 1 und 99 möglich. ', + 'TOO_SMALL_LEAGUE_MATCHDAYS' => 'Die Anzahl der Spieltage ist zu klein. Sie muss zwischen 1 und 99 liegen. ', + 'TOO_SMALL_LEAGUE_MATCHES' => 'Die Anzahl der Spiele je Spieltag ist zu klein. Sie muss zwischen 0 und 99 liegen. ', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_matchdays.php b/language/de/info_acp_matchdays.php new file mode 100644 index 0000000..77bbaa9 --- /dev/null +++ b/language/de/info_acp_matchdays.php @@ -0,0 +1,127 @@ + 'Spieltage', + 'ACP_FOOTBALL_MATCHDAYS_MANAGE' => 'Spieltage verwalten', + 'ACP_FOOTBALL_MATCHDAYS_MANAGE_EXPLAIN' => 'Hier kannst du je Liga Spieltage einer Saison zuordnen. Du kannst bestehende löschen oder ändern oder einen neuen Spieltag erstellen, sowie Typ, Anzahl der Spieltage, Gewinne, Name und Kurzbezeichnug der Spieltag einstellen.', + 'ACP_FOOTBALL_MATCHDAYS_MANAGEMENT' => 'Tipprunde-Spieltags-Verwaltung', + 'ADD_MATCHDAY' => 'Spieltag zur Liga hinzufügen', + + 'BACKWARD_DELIVERY' => 'Zeitspanne wählen', + 'BACKWARD_DELIVERY_EXPLAIN' => 'Zeitspanne der Abgabe vor dem ersten Spielbeginn.', + + 'CHANGE_DELIVERY' => 'Abgabetermine ändern', + 'CHANGE_DELIVERY_EXPLAIN' => 'Hier kannst du einmalig die zukünftigen Abgabetermine der Spieltage in Abhängigkeit zum ersten Spielbeginn neu festlegen. Hierdurch wird jedoch kein Automatismus bei zukünftigen Spielverlegungen eingerichtet. Mit Zeitspanne 0 kannst du überprüfen, ob ein Abgabetermin nach dem ersten Spielbeginn liegt und diesen entsprechend korrigieren. Soll ein einheitlicher Abgabetermin gesetzt werden, muss diese Funktion eventuell mehrfach mit unterschiedlichen Zeitspannen passend zu den Anstoßzeiten aufgerufen werden.', + + 'DELIVERY' => 'Abgabezeit', + 'DELIVERY_SET_TIME' => 'Abgabezeit vor dem ersten Spielbeginn', + 'DELIVERY_NUMBER' => 'Abgabe Nr.', + + 'GENERATE_MATCHDAY' => 'Fehlende Spieltage generieren', + + 'INVALID_DDAY1_DATE' => 'Kein gültiger Abgabetermin.', + 'INVALID_DDAY2_DATE' => 'Kein gültiger 2. Abgabetermin.', + 'INVALID_DDAY3_DATE' => 'Kein gültiger 3. Abgabetermin.', + + 'LEAGUE' => 'Liga', + + 'MATCHDAY' => 'Spieltag', + 'MATCHDAY_ADDED' => 'Spieltag erfolgreich hinzugefügt.', + 'MATCHDAY_CONFIRM_DELETE' => 'Bist du sicher, dass du den %1$s. Spieltag aus der Saison %2$s mit allen Daten (Spielplan und Tipps) löschen willst?', + 'MATCHDAY_CONFIRM_REMOVE' => 'Bist du sicher, dass du alle überflüssigen Spieltage aus der Saison %1$s mit allen Daten (Spielplan und Tipps) löschen willst?', + 'MATCHDAY_CREATE_FAILED' => 'Spieltag konnte nicht erstellt werden.', + 'MATCHDAY_CREATED' => '%1$s Spieltag wurde erfolgreich erstellt.', + 'MATCHDAY_CURRENT' => 'Aktuelle Spieltag', + 'MATCHDAY_DEF' => 'Bestehende Spieltage', + 'MATCHDAY_DEF_EXPLAIN' => 'Dies sind Spieltage, die von dir oder einem anderen Administrator erstellt wurden. Du kannst Spieltageinstellungen ändern oder Spieltage löschen.', + 'MATCHDAY_DELETE' => 'Spieltag entfernen', + 'MATCHDAY_DELETED' => 'Spieltag gelöscht', + 'MATCHDAY_DELIVERY' => 'Abgabetermin', + 'MATCHDAY_DELIVERY_EXPLAIN' => 'Termin an dem der Spieltag bzw. die nächsten Spiele geschlossen werden und somit keine Tippabgabe mehr möglich ist. Wurde der Spieltag bereits geschlossen (Status 1), kann dieser durch ein zukünftigen Abgabetermin wieder geöffnet werden. Andere Statusübergänge sind nur durch Eingabe bzw. Löschen der Spielergebnisse dieses Spieltags möglich.', + 'MATCHDAY_DELIVERY2' => '2. Abgabetermin ', + 'MATCHDAY_DELIVERY2_EXPLAIN' => 'Beim Erreichen des ersten Abgabetermins wird dieser Termin als nächster Abgabetermin für die nächsten Spiele gesetzt.', + 'MATCHDAY_DELIVERY3' => '3. Abgabetermin', + 'MATCHDAY_DELIVERY3_EXPLAIN' => 'Beim Erreichen des 2. Abgabetermins wird dieser Termin als nächster Abgabetermin für die nächsten Spiele gesetzt.', + 'MATCHDAY_DETAILS' => 'Spieltagsdaten', + 'MATCHDAY_EDIT_EXPLAIN' => 'Hier kannst du einen bestehenden Spieltag bearbeiten. Du kannst Typ, Anzahl der Spieltage, Gewinne, Namen und die Kurzbezeichnung ändern.', + 'MATCHDAY_MATCHES' => 'Anzahl der Spiele an diesem Spieltag', + 'MATCHDAY_MATCHES_EXPLAIN' => 'Bei KO-Runden ist die Angabe der Anzahl der Spiele je Spieltag zwingend erforderlich.', + 'MATCHDAY_NAME' => 'Spieltagsbezeichnung', + 'MATCHDAY_NAME_DOUBLE' => 'Die Spieltagsbezeichnung wird schon benutzt bzw. wurde doppelt vergeben.', + 'MATCHDAY_NAME_EMPTY' => 'Die Spieltagsbezeichnung muss mindesten 3 Buchstaben lang sein.', + 'MATCHDAY_NUMBER' => 'Die angegebene Spieltag muss numerisch (1-99) sein. Bitte eine Spieltagnummer eingeben.', + 'MATCHDAY_STATUS' => 'Status', + 'MATCHDAY_STATUS_EXPLAIN' => '0 = offen (Tippabgabe möglich)
1 = keine Tippabgabe mehr möglich und noch keine Ergebnisse
2 = vorläufige Ergebnisse liegen vor
3 = abgeschlossen, endgültige Ergebnisse liegen vor.', + 'MATCHDAY_UPDATE_FAILED' => 'Spieltageinstellungen konnten nicht aktualisiert werden.', + 'MATCHDAY_UPDATED' => 'Spieltageinstellungen erfolgreich aktualisiert.', + 'MATCHDAYS_CREATED' => '%1$s Spieltage wurden erfolgreich erstellt.', + 'MATCHDAYS_NO_DELETE' => 'Du darfst keine Spieltag löschen. Dies dürfen nur Gründungsmitglieder', + 'MATCHDAYS_REMOVED' => 'Überflüssige Spieltage gelöscht', + + 'NEW_DELIVERY' => 'Neue Abgabezeit', + 'NO_DELIVERIES_UPDATED' => 'Es wurden keine Abgabetermine geändert.', + 'NO_DELIVERY' => 'Der Abgabetermin fehlt.', + 'NO_DELIVERY2' => 'Der 2. Abgabetermin fehlt oder der 3. Abgabetermin muss gelöscht werden.', + 'NO_LEAGUE' => 'Es existiert keine Liga in der Saison %1$s. Bitte zuerst eine Liga in der Saison %1$s erstellen.', + 'NO_MATCHDAYS_CREATED' => 'Es wurden bislang keine Spieltage erstellt.', + 'NO_MORE_MATCHDAYS' => 'Es wurde keine weiteren Spieltage hinzugefügt.', + 'NO_SEASON' => 'Es existiert keine Saison. Bitte zuerst eine Saison erstellen.', + + 'OPEN_MATCH' => 'Das Spiel Nr. %s liegt vor dem gewählten Abgabetermin. Der Abgabetermin ist daher nicht zulässig.', + 'OPEN_MATCHES' => 'Die Spiele Nr. %s liegen vor dem gewählten Abgabetermin. Der Abgabetermin ist daher nicht zulässig.', + + 'PREDICTION_LEAGUE' => 'Tipprunde', + + 'REMOVE_MATCHDAYS' => 'Überflüssige Spieltage entfernen', + + 'SEASON' => 'Saison', + 'SELECT_LEAGUE' => 'Liga auswählen', + 'SHOW_DELIVERY' => 'Abgabezeiten anzeigen', + + 'TOO_LARGE_MATCHES' => 'Die Anzahl der Spiele je Spieltag ist zu groß.', + 'TOO_SMALL_DELIVERY2' => 'Der 2. Abgabetermin darf nicht vor dem 1. Abgabetermin liegen.', + 'TOO_SMALL_DELIVERY3' => 'Der 3. Abgabetermin darf nicht vor dem 2. Abgabetermin liegen.', + 'TOO_SMALL_MATCHES' => 'Die Anzahl der Spiele je Spieltag ist zu klein.', + + 'UPDATE_DELIVER' => '%s Abgabetermin geändert.', + 'UPDATE_DELIVERIES' => '%s Abgabetermine geändert.', + 'UPDATE_DELIVERY' => 'Neue Abgabezeiten', + 'UPDATE_DELIVERY_EXPLAIN' => 'Wähle die Datensätze aus, deren Abgabezeit neu gesetzt werden soll. Rot markierte Abgabezeiten liegen nach dem neu berechneten Abgabetermin.', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_matches.php b/language/de/info_acp_matches.php new file mode 100644 index 0000000..d3912ad --- /dev/null +++ b/language/de/info_acp_matches.php @@ -0,0 +1,113 @@ + 'Spielpläne', + 'ACP_FOOTBALL_MATCHES_MANAGE' => 'Spielpläne verwalten', + 'ACP_FOOTBALL_MATCHES_MANAGE_EXPLAIN' => 'Hier kannst du je Saison und Liga Spielpläne verwalten. Du kannst fehlende Spielpaarung zum Spielplan hinzufügen und die Spieldaten eines Spieltags verwalten.', + 'ACP_FOOTBALL_MATCHES_MANAGEMENT' => 'Tipprunde-Spielplan-Verwaltung', + + 'DAY' => 'Tag', + + 'FORMULA_GUEST' => 'Formel Gastmannschaft', + 'FORMULA_GUEST_EXPLAIN' => 'Siehe Erläuterungen Formel Heimmannschaft', + 'FORMULA_HOME' => 'Formel Heimmannschaft', + 'FORMULA_HOME_EXPLAIN' => 'D = wird noch ausgelost
L 100 = Verlierer Spiel 100
W 100 = Sieger Spiel 100
W 100;101 = Sieger Spiele 100 und 101
G A1 = 1. Gruppe A', + + 'GENERATE_MATCHES' => 'Spielplan-Gerüst vervollständigen', + + 'INVALID_MDAY_DATE' => 'Kein gültiges Spieldatum.', + + 'KO' => 'KO', + + 'LEAGUE' => 'Liga', + + 'MATCH_BEFORE_DELIVERY' => 'Der Spielbeginn liegt vor der Tippabgabe des Spieltags. Dies ist nicht zulässig.', + 'MATCH_BEGIN' => 'Spielbeginn', + 'MATCH_CONFIRM_DELETE' => 'Bist du sicher, dass du das %1$s. Spiel aus %2$s Saison %3$s mit allen Daten (Spielplan und Tipps) löschen willst?', + 'MATCH_CREATED' => '%1$s Spielpaarung wurde erfolgreich erstellt.', + 'MATCH_DELETED' => 'Spiel wurde erfolgreich gelöscht', + 'MATCH_DETAILS' => 'Spieldaten', + 'MATCH_EDIT_EXPLAIN' => 'Hier kannst du eine bestehende Spielpaarung bearbeiten. Du kannst den Termin, die Paarung und eine Formel festlegen.', + 'MATCH_GROUP' => 'Gruppenspiel der Gruppe', + 'MATCH_GUEST' => 'Gast', + 'MATCH_HOME' => 'Heim', + 'MATCH_KO' => 'KO-Spiel', + 'MATCH_KO_EXPLAIN' => 'Dieses Spiel kann zu einer Verlägerung bzw. einem Elfmeterschießen führen.', + 'MATCH_NUMBER' => 'Spiel Nr', + 'MATCH_ODDS' => 'Quoten', + 'MATCH_RATING' => 'Gewichtung', + 'MATCH_STATUS' => 'Status', + 'MATCH_STATUS_EXPLAIN' => ' -2=Spiel wird am 3. Abgabetermin geschlossen
 -1=Spiel wird am 2. Abgabetermin geschlossen
  0=offen (Tippabgabe möglich), wird am Abgabetermin geschlossen
  1=keine Tippabgabe mehr möglich und noch kein Ergebnis
  2=vorläufiges Ergebnis liegt vor
  3=endgültiges Ergebnis liegt vor
4-6= wie 1-3 jedoch ohne Wertung.', + 'MATCH_UPDATE_FAILED' => 'Spielpaarung konnte nicht aktualisiert werden.', + 'MATCH_UPDATED' => 'Spielpaarung erfolgreich aktualisiert.', + 'MATCHDAY' => 'Spieltag', + 'MATCHDAY_MISSED' => 'Bevor dies Aktion durchgeführt werden kann, müssen die fehlenden Spieltag erfasst werden.', + 'MATCHES_CREATE_FAILED' => 'Spielplan konnte nicht vervollständigt werden.', + 'MATCHES_CREATED' => '%1$s Spielpaarungen wurden erfolgreich erstellt.', + 'MATCHES_DEF' => 'Vorhandene Spielpaarungen', + 'MATCHES_DEF_EXPLAIN' => 'Dies sind Spielpaarungen, die von dir oder einem anderen Administrator erstellt wurden. Du kannst die Spielpaarungen ändern oder löschen.', + 'MATCHES_NO_DELETE' => 'Du darfst keine Spiele löschen. Dies dürfen nur Gründungsmitglieder', + 'MONTH' => 'Monat', + + 'NO_LEAGUE' => 'Es existiert keine Liga in der Saison %1$s. Bitte zuerst eine Liga in der Saison %1$s erstellen.', + 'NO_MATCH' => 'Diese Spielpaarung existiert nicht.', + 'NO_MATCH_BEGIN' => 'Der Spielbeginn fehlt.', + 'NO_MATCHDAY' => 'Es existiert kein Spieltag in %1$s Saison %2$s. Bitte zuerst Spieltage erstellen.', + 'NO_MATCHES_CREATED' => 'Es wurden bislang keine Spielpaarungen hinterlegt.', + 'NO_SEASON' => 'Es existiert keine Saison. Bitte zuerst eine Saison erstellen.', + + 'ODD_1' => 'Heimsieg', + 'ODD_x' => 'Unentschieden', + 'ODD_2' => 'Auswärtssieg', + + 'PREDICTION_LEAGUE' => 'Tipprunde', + + 'SEASON' => 'Saison', + 'SELECT_MATCHDAY' => 'Spieltag wählen', + + 'TOO_LARGE_MATCH_BEGIN_H' => 'Stundenangabe beim Spielbeginn zu groß.', + 'TOO_LARGE_MATCH_BEGIN_MIN' => 'Minutenangabe beim Spielbeginn zu groß.', + 'TOO_SMALL_MATCH_BEGIN_H' => 'Stundenangabe beim Spielbeginn zu klein.', + 'TOO_SMALL_MATCH_BEGIN_MIN' => 'Minutenangabe beim Spielbeginn zu klein.', + + 'UNKNOWN' => 'noch nicht bekannt', + + 'YEAR' => 'Jahr', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_results.php b/language/de/info_acp_results.php new file mode 100644 index 0000000..d4ad1e7 --- /dev/null +++ b/language/de/info_acp_results.php @@ -0,0 +1,100 @@ + 'Spielergebnisse', + 'ACP_FOOTBALL_RESULTS_MANAGE' => 'Spielergebnisse eingeben', + 'ACP_FOOTBALL_RESULTS_MANAGE_EXPLAIN' => 'Hier kannst du Spielergebnisse bestätigen, eingeben, löschen oder aus der Wertung nehmen.', + 'ACP_FOOTBALL_RESULTS_MANAGEMENT' => 'Tipprunde-Spielergebnis-Verwaltung', + 'ADVICE' => 'Hinweis', + + 'BETS_AND_RANKS' => 'Tipps und Ranglisten der', + + 'DAY' => 'Tag', + 'DELETE' => 'Löschen', + 'DELETE_EXPLAIN' => 'Spielergebnis löschen und Status auf 1 setzen.', + + 'GUEST' => 'Gast', + + 'HOME' => 'Heim', + + 'LEAGUE' => 'Liga', + + 'MATCH_BEGIN' => 'Spielbeginn', + 'MATCH_STATUS_TITLE' => '-2=Spiel wird am 3. Abgabetermin geschlossen -1=Spiel wird am 2. Abgabetermin geschlossen 0=offen (Tippabgabe möglich), wird am Abgabetermin geschlossen 1=keine Tippabgabe mehr möglich und noch kein Ergebnis 2=vorläufiges Ergebnis liegt vor 3=endgültiges Ergebnis liegt vor 4-6= wie 1-3 jedoch ohne Wertung.', + 'MATCHDAY' => 'Spieltag', + 'MONTH' => 'Monat', + + 'NO_LEAGUE' => 'Es existiert keine Liga in der Saison %1$s. Bitte zuerst eine Liga in der Saison %1$s erstellen.', + 'NO_MATCHDAY' => 'Es existiert kein Spieltag in %1$s Saison %2$s. Bitte zuerst Spieltage erstellen.', + 'NO_MATCHES_CREATED' => 'Es wurden bislang keine Spielpaarungen hinterlegt.', + 'NO_SEASON' => 'Es existiert keine Saison. Bitte zuerst eine Saison erstellen.', + 'NO_VALUATION' => 'o. Wertung', + 'NO_VALUATION_EXPLAIN' => 'Spiel aus der Wertung nehmen, da dieses verschoben oder manipuliert wurde.', + 'NUMBER' => 'Nr', + + 'OVERTIME' => 'Verlängerung', + 'OVERTIME_EXPLAIN' => 'Spielergebnis inkl. Verlängerung und Elfmeterschiessen.', + + 'PREDICTION_LEAGUE' => 'Tipprunde', + + 'RANKING' => 'Rangliste', + 'RESULT' => 'Ergebnis', + 'RESULT_DELETED' => '%1$s Spielergebnis wurde gelöscht.', + 'RESULT_DETAILS' => 'Spielergebnisse', + 'RESULT_EXPLAIN' => 'Spielergebnis nach 90 Minuten oder Spielzwischenstand', + 'RESULT_NO_VALUATION' => '%1$s Spiel wurde aus der Wertung genommen.', + 'RESULT_SAVED' => '%1$s Spielergebnis wurde gespeichert.', + 'RESULTS_DELETED' => '%1$s Spielergebnisse wurden gelöscht.', + 'RESULTS_NO_VALUATION' => '%1$s Spiele wurden aus der Wertung genommen.', + 'RESULTS_SAVED' => '%1$s Spielergebnisse wurden gespeichert.', + + 'SAVE' => 'Speichern', + 'SAVE_FAILED' => 'Die Spielergebnisse konnten nicht gespeichert werden.', + 'SEASON' => 'Saison', + 'SELECT' => 'Auswahl', + 'SELECT_EXPLAIN' => 'Nur die hier markierten Spiele werden gespeichert/nicht gewertet/gelöscht.', + 'SELECT_MATCHDAY' => 'Spieltag wählen', + 'SET_STATUS_TO' => 'Der Status des Spieltages wurde auf %1$s gesetzt', + 'STATUS' => 'Status', + + 'VS' => 'Begegnung', + + 'YEAR' => 'Jahr', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_seasons.php b/language/de/info_acp_seasons.php new file mode 100644 index 0000000..578ec04 --- /dev/null +++ b/language/de/info_acp_seasons.php @@ -0,0 +1,86 @@ + 'Saisons', + 'ACP_FOOTBALL_SEASONS_MANAGE' => 'Saisons verwalten', + 'ACP_FOOTBALL_SEASONS_MANAGE_EXPLAIN' => 'Hier kannst du alle Saisons verwalten. Du kannst bestehende löschen oder ändern oder eine neue Saison erstellen, sowie Name und Kurzbezeichnug der Saison einstellen.', + 'ACP_FOOTBALL_SEASONS_MANAGEMENT' => 'Tipprunde-Saison-Verwaltung', + + 'CREATE_SEASON' => 'Neue Saison erstellen', + + 'LEAGUES' => 'Ligen', + + 'NO_SEASON' => 'Keine Saison angegeben.', + 'NO_SEASONS_CREATED' => 'Es wurden bislang keine Saisons erstellt.', + + 'PREDICTION_LEAGUE' => 'Tipprunde', + + 'SEASON' => 'Saison', + 'SEASON_CLOSED' => 'Geschlossen', + 'SEASON_CONFIRM_DELETE' => 'Bist du sicher, dass du die Saison %1$s mit allen Daten (Ligen, Spieltage, Spielplänen, Tipps und Ranglisten) löschen willst?', + 'SEASON_CREATE_FAILED' => 'Saison konnte nicht erstellt werden.', + 'SEASON_CREATED' => 'Saison erfolgreich erstellt.', + 'SEASON_CURRENT' => 'Aktuelle Saison', + 'SEASON_DEF' => 'Bestehende Saisons', + 'SEASON_DEF_EXPLAIN' => 'Dies sind Saisons, die von dir oder einem anderen Administrator erstellt wurden. Du kannst Saisoneinstellungen ändern oder Saisons löschen.', + 'SEASON_DELETE' => 'Saison entfernen', + 'SEASON_DELETED' => 'Saison gelöscht', + 'SEASON_DETAILS' => 'Saisondetails', + 'SEASON_EDIT_EXPLAIN' => 'Hier kannst du eine bestehende Saison bearbeiten. Du kannst ihren Namen und die Kurzbezeichnung ändern.', + 'SEASON_NAME' => 'Saisonname', + 'SEASON_NAME_EMPTY' => 'Der Saisonname fehlt. Er muss mindesten 4 Zeichen lang sein.', + 'SEASON_NAME_EXPLAIN' => 'Langbezeichnung der Saison z.B. "Saison 2010/2011"', + 'SEASON_NAME_TAKEN' => 'Der angegebene Saisonname wird bereits benutzt. Bitte wähle einen anderen aus.', + 'SEASON_NUMBER' => 'Die angegebene Saison muss numerisch (1963-2099) sein. Bitte die Jahreszahl, in der die Saison endet eingeben.', + 'SEASON_SHORT' => 'Saison Kurzbezeichnung', + 'SEASON_SHORT_EMPTY' => 'Die Saison Kurzbezeichnung fehlt, sie muss mindesten 2 Zeichen lang sein.', + 'SEASON_SHORT_EXPLAIN' => 'Kurzbezeichnung der Saison, die in der Auswahlbox angezeigt wird.', + 'SEASON_SHORT_TAKEN' => 'Die angegebene Kurzbezeichnung der Saison wird bereits benutzt. Bitte wähle eine andere aus.', + 'SEASON_TAKEN' => 'Diese Saison existiert bereits. Bitte wähle eine andere Saison aus.', + 'SEASON_UPDATE_FAILED' => 'Saisoneinstellungen konnten nicht aktualisiert werden.', + 'SEASON_UPDATED' => 'Saisoneinstellungen erfolgreich aktualisiert.', + 'SEASONS_NO_DELETE' => 'Du darfst keine Saison löschen. Dies dürfen nur Gründungsmitglieder', + 'SEASONS_NO_LEAGUE' => 'Diese Saison hat keine Liga', + + 'TOO_LARGE_SEASON' => 'Der Wert für die Saison ist zu groß. Saison von 1963 - 2099 möglich.', + 'TOO_SHORT_SEASON' => 'Der Saisonname muss mindesten 4 Zeichen lang sein.', + 'TOO_SHORT_SEASON_SHORT' => 'Die Saison Kurzbezeichnung muss mindesten 2 Zeichen lang sein.', + 'TOO_SMALL_SEASON' => 'Der Wert für die Saison ist zu klein. Saison von 1963 - 2099 möglich.', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_teams.php b/language/de/info_acp_teams.php new file mode 100644 index 0000000..53c9eee --- /dev/null +++ b/language/de/info_acp_teams.php @@ -0,0 +1,100 @@ + 'Teams', + 'ACP_FOOTBALL_TEAMS_MANAGE' => 'Teams verwalten', + 'ACP_FOOTBALL_TEAMS_MANAGE_EXPLAIN' => 'Hier kannst du je Saison Teams einer Liga zuordnen. Du kannst bestehende löschen oder ändern oder eine neues Team erstellen, sowie Typ, Anzahl der Spieltage, Gewinne, Name und Kurzbezeichnug des Teams einstellen.', + 'ACP_FOOTBALL_TEAMS_MANAGEMENT' => 'Tipprunde-Team-Verwaltung', + 'ADD_TEAM' => 'Team zur Liga hinzufügen', + + 'LEAGUE' => 'Liga', + + 'MATCHDAY' => 'Spieltag', + + 'NEW_TEAM' => 'Neues Team', + 'NO_LEAGUE' => 'Es existiert keine Liga in der Saison %1$s. Bitte zuerst eine Liga in der Saison %1$s erstellen.', + 'NO_MATCHDAYS' => 'Bitte zuerst Spieltage anlegen, da die Mannschaften bei KO-Runden einem Spieltag zugeordnet werden müssen.', + 'NO_SEASON' => 'Es existiert keine Saison. Bitte zuerst eine Saison erstellen.', + 'NO_TEAM' => 'Kein Team angegeben.', + 'NO_TEAMS_CREATED' => 'Es wurden bislang keine Teams erstellt.', + 'NO_TEAMSYMBOL' => 'Kein Logo', + + 'PREDICTION_LEAGUE' => 'Tipprunde', + + 'SEASON' => 'Saison', + 'SELECT_LEAGUE' => 'Liga auswählen', + + 'TEAM' => 'Team', + 'TEAM_ADDED' => 'Team erfolgreich hinzugefügt.', + 'TEAM_AWAY' => 'Auswärts', + 'TEAM_CONFIRM_DELETE' => 'Bist du sicher, dass du %1$s aus Saison: %2$s Liga: %3$s mit allen Daten (Spieltage, Spielplänen und Tipps) löschen möchtest?', + 'TEAM_CREATE_FAILED' => 'Team konnte nicht erstellt werden.', + 'TEAM_CREATED' => 'Team erfolgreich erstellt.', + 'TEAM_CURRENT' => 'Aktuelles Team', + 'TEAM_DEF' => 'Bestehende Teams', + 'TEAM_DEF_EXPLAIN' => 'Dies sind Teams, die von dir oder einem anderen Administrator erstellt wurden. Du kannst Teameinstellungen ändern oder Teams löschen.', + 'TEAM_DELETE' => 'Team entfernen', + 'TEAM_DELETED' => 'Team gelöscht', + 'TEAM_DETAILS' => 'Teamdaten', + 'TEAM_EDIT_EXPLAIN' => 'Hier kannst du ein bestehendes Team bearbeiten. Du kannst den Namen, die Team-Kurzbezeichnung sowie das Team-Wappen ändern.', + 'TEAM_GROUP' => 'Gruppenspiele in Gruppe', + 'TEAM_GROUP_EXPLAIN' => 'Buchstabe der Gruppe, in der die Gruppenspiele bestritten werden.', + 'TEAM_MATCHES' => 'Spiele', + 'TEAM_NAME' => 'Teamname', + 'TEAM_NAME_DOUBLE' => 'Der Teamname wird schon benutzt bzw. wurde doppelt vergeben.', + 'TEAM_NUMBER' => 'Dies ist keine gültige Teamnummer. Die Teamnummer muss zwischen 0 und 65535 liegen.', + 'TEAM_ROUND' => 'Qualifiziert bis Spieltag', + 'TEAM_ROUND_EXPLAIN' => 'Spieltag bis zu dem sich das Team vorerst qualifiziert hat. Über diesen Parameter werden bei der Spielplanerstellung nur Mannschaften zur Auswahl angeboten, die sich auch für die netsprechende Runde qualifiziert haben. Über den Menüpunkt Qualifikation kann dieser Wert automatisch nach Beendigung der Runde automatisch für alle qualifizierten Mannschaften gesetzt werden.', + 'TEAM_SHORT' => 'Team Kurzbezeichnung', + 'TEAM_SHORT_DOUBLE' => 'Die Kurzbezeichnung wird schon benutzt bzw. wurde doppelt vergeben.', + 'TEAM_SHORT_EXPLAIN' => 'Maximal 10 stellige Kurzbezeichnung des Teams. Diese wird z.B. beim Export und unter Alle Tipps verwendet.', + 'TEAM_SYMBOL' => 'Teamwappen', + 'TEAM_SYMBOL_EXPLAIN' => 'Das optionale Teamwappen muss 28x28 Pixel groß sein.', + 'TEAM_TAKEN' => 'Dieses Team existiert bereits in dieser Liga. Bitte wähle eine andere Teamnummer aus.', + 'TEAM_UPDATE_FAILED' => 'Teameinstellungen konnten nicht aktualisiert werden.', + 'TEAM_UPDATED' => 'Teameinstellungen erfolgreich aktualisiert.', + 'TEAMS_NO_DELETE' => 'Du darfst kein Team löschen. Dies dürfen nur Gründungsmitglieder', + 'TOO_LARGE_TEAM' => 'Die angegebene Team-ID muss numerisch (1-9999) sein. Bitte eine kleinere Teamnummer eingeben.', + 'TOO_SHORT_TEAM_NAME' => 'Der Teamname muss mindesten 3 Zeichen lang sein.', + 'TOO_SHORT_TEAM_SHORT' => 'Die Kurzbezeichnung muss mindesten 1 Zeichen lang sein.', + 'TOO_SMALL_TEAM' => 'Die angegebene Team-ID muss numerisch (1-9999) sein. Bitte eine größere Teamnummer eingeben.', + + 'WRONG_DATA_TEAM_GROUP' => 'Keine gültige Gruppe für die Gruppenspiele. Gültige Gruppen sind A-Z.', +)); + +?> \ No newline at end of file diff --git a/language/de/info_acp_update.php b/language/de/info_acp_update.php new file mode 100644 index 0000000..cc9e9a7 --- /dev/null +++ b/language/de/info_acp_update.php @@ -0,0 +1,138 @@ + 'Spielplan aktualisieren', + 'ACP_FOOTBALL_UPDATE_MANAGE' => 'Spielplan aktualisieren', + 'ACP_FOOTBALL_UPDATE_MANAGE_EXPLAIN' => 'Hier kannst du deine Spielpläne, mit Daten von der Demoseite oder einer anderen Tipprunden-Seite aktualisieren oder neu erstellen. Wähle zuerst eine Tipprunden-Seite und Liga aus, von der das Update stammt. Nach Auswahl der Ziel-Liga bekommst du Abweichungen zwischen dieser Liga und dem Update angezeigt und kannst wählen welche Änderungen du übernehmen möchtest. Falls du eine neue Liga erstellen möchtest, werden alle Daten übernommen. ', + 'ACP_FOOTBALL_UPDATE_MANAGEMENT' => 'Tipprunde-Spielplan aktualisieren', + + 'ALLOW_URL_FOPEN' => 'Die PHP-Einstellung allow_url_fopen erlaubt keinen Zugriff auf andere Seiten.
Du musst die Updateidatei(en) downloaden und im Verzeichnis root/store speichern. ', + 'CHOOSE_LEAGUES' => 'Quell- und Ziel-Spielplan wählen', + 'CHOOSE_OTHER_LEAGUE' => 'Anderen Spielplan wählen', + 'COMPARE_UPDATE' => 'Vergleichen mit Datenbank', + 'CURRENT_VALUE' => 'Aktueller Wert', + + 'DB_INSERT_SEASON' => '%s Saison eingefügt. ', + 'DB_INSERT_LEAGUE' => '%s Liga eingefügt. ', + 'DB_INSERT_MATCHDAY' => '%s Spieltag eingefügt. ', + 'DB_INSERT_MATCHDAYS' => '%s Spieltage eingefügt. ', + 'DB_INSERT_TEAM' => '%s Mannschaft eingefügt. ', + 'DB_INSERT_TEAMS' => '%s Mannschaften eingefügt. ', + 'DB_INSERT_MATCH' => '%s Spiel eingefügt. ', + 'DB_INSERT_MATCHES' => '%s Spiele eingefügt. ', + 'DB_UPDATE_BIT_DELIVER' => '%s Spieltags-Abgabetermin mit Tippabgabe bis zum Spielbeginn korrigiert. ', + 'DB_UPDATE_BIT_DELIVERIES' => '%s Spieltags-Abgabetermine mit Tippabgabe bis zum Spielbeginn korrigiert. ', + 'DB_UPDATE_DELIVER' => 'Abgabetermin des Spieltags %s korrigiert. ', + 'DB_UPDATE_DELIVERIES' => 'Abgabetermine des Spieltage %s korrigiert. ', + 'DB_UPDATE_MATCHDAY' => '%s Spieltag aktualisiert. ', + 'DB_UPDATE_MATCHDAYS' => '%s Spieltage aktualisiert. ', + 'DB_UPDATE_TEAM' => '%s Mannschaft aktualisiert. ', + 'DB_UPDATE_TEAMS' => '%s Mannschaften aktualisiert. ', + 'DB_UPDATE_MATCH' => '%s Spiel aktualisiert. ', + 'DB_UPDATE_MATCHES' => '%s Spiele aktualisiert. ', + 'DB_UPDATE_STATUS_MATCHDAY' => 'An %s Spieltag wurde der Status angepasst. ', + 'DB_UPDATE_STATUS_MATCHDAYS' => 'An %s Spieltagen wurde der Status angepasst. ', + 'DUPLICATE_TEAM' => 'Diese Team-ID wurde doppelt zugeordnet. ', + + 'ERROR_OPEN_LEAGUE_XML' => 'Fehler! Die Liga XML-Datei konnte nicht geöffnet werden. Bitte den Link überprüfen. ', + 'ERROR_OPEN_SEASON_XML' => 'Fehler! Die Saison XML-Datei konnte nicht geöffnet werden. Bitte den Link überprüfen. ', + 'ERROR_READ_LEAGUE_XML' => 'Fehler! Die Liga XML-Datei konnte nicht gelesen werden. Bitte den Code oder die XML-Datei überprüfen. ', + 'ERROR_READ_SEASON_XML' => 'Fehler! Die Saison XML-Datei konnte nicht gelesen werden. Bitte den Code überprüfen. ', + 'ERROR_LOAD_LEAGUE_XML' => 'Fehler! Die Liga XML-Datei konnte nicht gelesen werden. Bitte die Datei %s überprüfen. ', + 'ERROR_XML_CODE' => 'Fehlerhafter Code! Um die XML-Datei anzuzeigen, muss der korrekte Code beim Aufruf übergeben werden. ', + 'ERROR_XML_CREATE' => 'Fehler! Die XML-Datei konnte nicht erzeugt werden. ', + + 'INSERT_LEAGUE' => 'Neue Liga anlegen', + 'INSERT_MATCHDAYS' => 'Spieltage anlegen', + 'INSERT_MATCHES' => 'Spielbegegnungen anlegen', + 'INSERT_SEASON' => 'Neue Saison anlegen', + 'INSERT_TEAMS' => 'Mannschaften anlegen', + + 'LEAGUE_SHORTCUT' => 'Liga Kürzel', + 'LOAD' => 'Laden', + 'LOG_FOOTB_UPDATE' => 'Football Prediction League Spielplan-Update
» %s', + + 'MAP_TEAMS' => 'Teams zuordnen', + 'MATCH_OF_GROUP' => 'Spiel in Gruppe', + 'MATCHES' => 'Spiele', + 'MISMATCH_LEAGUE_TYPE' => 'Der Ligatyp (%s) des Quell-Spielplans passt nicht zur vorhandenen Liga.', + 'MISMATCH_MATCHDAYS' => 'Die Anzahl der Spieltage (%s) des Quell-Spielplans passt nicht zur vorhandenen Liga.', + 'MISMATCH_DB_MATCHDAYS' => 'Die Anzahl der Spieltage (%s) in der Datenbank passt nicht zur vorhandenen Liga.', + 'MISMATCH_MATCHES' => 'Die Anzahl der Spiele (%s) an einem Spieltag des Quell-Spielplans passt nicht zur vorhandenen Liga.', + 'MISMATCH_DB_MATCHES' => 'Die Anzahl der Spiele (%s) in der Datenbank passt nicht zum Quell-Spielplan.', + 'MISMATCH_MOM' => 'Die Anzahl der Spiele je Spieltag (%s) des Quell-Spielplans passt nicht zur vorhandenen Liga.', + 'MISSING_TEAMS' => 'Folgende Team IDs müssen noch zugeordnet werden: %s', + + 'NEW_LEAGUE' => 'Neue Liga', + 'NEW_LEAGUE_EXIST' => 'Die neue Liga %s existiert bereits. ', + 'NEW_LEAGUE_EXPLAIN' => 'Bei einer neuen Liga bitte hier die Liganummer angeben. Bei einer bestehenden Liga darf diese Liganummer nicht überschrieben werden, da sonst eine eventuell bestehende Liga aktualisiert wird. ', + 'NEW_TEAM' => 'Neues Team wird eingefügt', + 'NO_DB_CHANGES' => 'Es wurden keine Änderungen durchgeführt. ', + 'NO_DIFFERENCES' => 'Keine Unterschiede gefunden. Die Spielpläne sind identisch. ', + 'NO_XML_LEAGUE' => 'Im Verzeichnis root/store konnte keine Update-Dateien gefunden werden. ', + 'NO_XML_SEASON' => 'Es wurde keine Quell-Daten zum aktualisieren gefunden. ', + 'NO_XML_ARRAY' => 'Fehler! Daten nicht mehr vorhanden. Bitte wiederhole die Aktion von vorne. ', + + 'OTHER_FIELDS' => 'Andere Felder', + + 'PREDICTION_LEAGUE' => 'Tipprunde', + + 'SEASON' => 'Saison', + 'SELECT_EXPLAIN' => 'Nur die hier markierten Datensätze werden übernommen', + 'SHOW_UPDATE' => 'Neue Liga anzeigen', + 'SOURCE' => 'Quelle', + + 'TARGET' => 'Ziel', + 'TEAM_MAPPING' => 'Teamzuordnung', + 'TEAM_NAME_SHORT' => 'Kurzname', + 'TRANSFER_TEAM' => 'Team übernehmen', + + 'UPDATE_LEAGUE' => 'Ligadaten aktualisieren', + 'UPDATE_MATCHDAYS' => 'Spieltagsdaten aktualisieren', + 'UPDATE_MATCHES' => 'Spielbegegnungen aktualisieren', + 'UPDATE_ONLY_FINAL' => 'Nur endgültige Ergebnisse übernehmen', + 'UPDATE_SAME_STATUS' => 'Ergebnisse mit gleichem Status aktualisieren', + 'UPDATE_NEG_STATUS' => 'Negative Status übernehmen', + 'UPDATE_TEAMS' => 'Mannschaftsdaten aktualisieren', + 'UPDATE_THIS' => 'Änderungen in diesem Feld übernehmen', + + 'XML_SEASON_URL' => 'URL Quelle für das Update', + 'XML_SEASON_URL_EXPLAIN' => 'URL zu football_xml_season.php oder localhost. Bei localhost wird nach league_* Datei in root/store gesucht. ', +)); + +?> \ No newline at end of file diff --git a/language/de/permissions_football.php b/language/de/permissions_football.php new file mode 100644 index 0000000..bbc2b49 --- /dev/null +++ b/language/de/permissions_football.php @@ -0,0 +1,39 @@ + 'Fussball', + 'ACL_U_USE_FOOTBALL' => 'Kann Football Extension verwenden', + 'ACL_A_FOOTBALL_CONFIG' => 'Kann Tipprundeneinstellung ändern', + 'ACL_A_FOOTBALL_DELETE' => 'Kann Spielpläne löschen', + 'ACL_A_FOOTBALL_EDITBETS' => 'Kann alle Tipps ansehen, eingeben und ändern', + 'ACL_A_FOOTBALL_PLAN' => 'Kann Spielpläne erstellen und ändern', + 'ACL_A_FOOTBALL_RESULTS' => 'Kann endgültige Spielergebnisse eingeben, ändern und löschen', + 'ACL_A_FOOTBALL_POINTS' => 'Kann Kontodaten eingeben, ändern und löschen', + + 'ROLE_ADMIN_FOOTBALL' => 'Tipprunden Administrator', + 'ROLE_DESCRIPTION_ADMIN_FOOTBALL' => 'Kann endgültige Spielergebnisse eingeben und ändern.', +)); + +?> \ No newline at end of file diff --git a/language/en/email/footb_board_remember.txt b/language/en/email/footb_board_remember.txt new file mode 100644 index 0000000..9c0f64e --- /dev/null +++ b/language/en/email/footb_board_remember.txt @@ -0,0 +1,10 @@ + +Hallo {SITENAME}, +the following users have received a reminder e-mail: + +{REMEMBER_LIST} + + +Link to {SITENAME}: {U_BOARD}. + +{EMAIL_SIG} diff --git a/language/en/email/footb_send_remember.txt b/language/en/email/footb_send_remember.txt new file mode 100644 index 0000000..bdd32cf --- /dev/null +++ b/language/en/email/footb_send_remember.txt @@ -0,0 +1,10 @@ + +Hallo {USERNAME}, +you have not yet bet {MATCHDAY}. matchday. +Please bet until {LEAGUE} delivery {DELIVERY}. + + +Link to {SITENAME}: {U_BOARD}. + + +{EMAIL_SIG} diff --git a/language/en/football.php b/language/en/football.php new file mode 100644 index 0000000..4d8ada8 --- /dev/null +++ b/language/en/football.php @@ -0,0 +1,478 @@ + '2. email adress', + 'FOOTB_EMAIL_EXPLAIN' => '2. email adress for the automatic Prediction League reminder.', + 'FOOTB_REM_F' => 'Send Prediction League reminder to first email adress', + 'FOOTB_REM_F_EXPLAIN' => 'Send reminder to your first email address, if you should not have bet?', + 'FOOTB_REM_S' => 'Send Prediction League reminder to second email adress', + 'FOOTB_REM_S_EXPLAIN' => 'Send reminder to your second email address, if you should not have bet?', + 'YES' => 'Ja', + 'NO' => 'Nein', + + 'ADD_NEW_TEAM' => 'The team was added to the WebTip. ', + 'ALL_BETS' => 'All bets', + 'ALL_BETS_MATCHDAY' => 'All bets %d. matchday', + 'ALL_LEAGUES' => 'All leagues', + 'ALL_MATCHES' => 'All matches', + 'AWAY' => 'Away', + 'AWAY_MATCHES' => 'Away matches', + 'BANDWIDTH' => 'Bandwidth', + 'BANK_OF' => 'Bet account of', + 'BET' => 'Bet', + 'BET_IN_TIME' => 'The matches of a matchday can be entered up to the kick off respectively. After the kick off the bets of other Users become visible for everybody. ', + 'BET_KOEFF' => 'Bet coefficient', + 'BET_OF' => 'Bet', + 'BET_POINTS' => 'Bet', + 'BET_UNTIL_DELIVERY' => 'The matches of a matchday can be entered only up to the deadline of the matchday. Then the bets of others Users become visible for everybody. ', + 'BETS' => 'Bets', + 'BETS_AND_RANKS' => 'Bets and ranking of', + 'BETS_OF' => 'The bets of', + 'BETS_OF_ALL' => 'The bets of all Users', + 'BETSAVED' => 'Your bet was saved successfully!', + 'BETSSAVED' => 'Your %d bets were saved successfully!', + 'BOOK_TYPE' => 'Book type', + 'CASH_POINTS' => 'Settlement in Ultimate Points', + 'CHART_MATCHDAY' => 'Chart matchday', + 'CHART_OF' => 'Charts Of', + 'CHART_POINTS' => 'Chart points', + 'CHART_TOTAL' => 'Chart total', + 'CNT_BET' => 'Number of matches with bet', + 'CNT_HIT' => 'Number of bets with correct result', + 'CNT_HIT02' => 'Number of bets with the correct result with which the guest team has scored', + 'CNT_NO_BET' => 'Number of matches without bet', + 'CNT_TEND' => 'Number of bets with right trend (without direct hit)', + 'CURR' => 'cur', + 'CURRENT_RESULT' => 'Temporary result', + 'DATE' => 'Date', + 'DATES' => 'Dates', + 'DAY_POINTS_OF_ALL' => 'The matchday points of all Users', + 'DAY_RANKS_OF_ALL' => 'The matchday ranks of all User', + 'DELETE' => 'Remove', + 'DELETE_TEAM' => 'Remove team', + 'DELETE_TEAM_CHECK' => 'Remove this team from the WebTip', + 'DELETED_TEAM' => 'The team was removed from the WebTip. ', + 'DELIVERY' => 'Bet delivery', + 'DELIVERY_LIST' => 'Due dates of bet deliveries', + 'DELIVERY_NOT_READY' => 'To the bet delivery (you have not bet on all matches yet)', + 'DELIVERY_READY' => 'To the bet delivery (you have already bet on all matches)', + 'DELIVERY_UNTIL' => 'Bet delivery until', + 'DEPOSIT' => 'Deposit', + 'DIFF_COUNT' => 'Frequencies of the goal differences', + 'DIRECTHITS' => 'Direct hit', + 'DIRECTHITS_SHORT' => 'DH', + 'DIRECTHITS02' => 'Direct hit 02', + 'DOWNLOAD' => 'Download', + 'DRAW' => 'Draw', + 'DRAW_SHORT' => 'D', + 'DRAWING' => 'Drawing', + 'EUR' => 'EUR', + 'EVALUATION' => 'Evaluation', + 'EXCEL_FILE' => 'Excel file', + 'EXPORT' => 'Export', + 'EXTRA_BET' => 'Extra bet', + 'EXTRA_BET_SAVED' => '%d Extra bet saved. ', + 'EXTRA_BETS' => 'Extra bets', + 'EXTRA_BETS_SAVED' => '%d Extra bets saved. ', + 'EXTRA_DIFFERENCE' => 'Maximum points minus absolute difference between result and bet', + 'EXTRA_HIT' => 'Maximum points with a correct bet, otherwise 0 points', + 'EXTRA_MULTI_HIT' => 'Maximum points with a matching result, otherwise 0 points', + 'EXTRA_RESULT_DELETED' => '%d Extra bet result deleted. ', + 'EXTRA_RESULT_SAVED' => '%d Extra bet result saved. ', + 'EXTRA_RESULTS_DELETED' => '%d Extra bet results deleted. ', + 'EXTRA_RESULTS_SAVED' => '%d Extra bet results saved. ', + 'EXTRATIME' => 'Extra time', + 'EXTRATIME_SHORT' => 'Extra', + 'FAN_OF' => 'Fan of', + 'FINAL_RESULT' => 'Final result', + 'FINALLY' => 'Finally', + 'FIRSTLEG_ERROR' => 'First leg does not exist', + 'FLOP20_POINTS' => 'Flop 20 points season', + 'FLOP20_POINTS_ALL' => 'All time flop 20 points ', + 'FOOTBALL_ALL_LEAGUES' => 'All Prediction Leagues', + 'FOOTBALL_BALANCE' => 'Present account balance for this league', + 'FOOTBALL_BALANCES' => 'Present account balance for all leagues', + 'FOOTBALL_BANK' => 'Account', + 'FOOTBALL_BET_POINTS' => 'Bet', + 'FOOTBALL_BOOK_TOTAL' => 'Accounting entries', + 'FOOTBALL_DEPOSIT' => 'Deposit', + 'FOOTBALL_DESCRIPTION' => 'This is your Prediction League bank statement.

All bets, profits, payments and payment of the elective season and league are indicated .

', + 'FOOTBALL_DISABLED' => 'This WebTip is currently deactivated because of maintenance. ', + 'FOOTBALL_MATCHDAY' => 'Matchday', + 'FOOTBALL_MENU' => 'Show Prediction League menu', + 'FOOTBALL_NO_BOOKS' => 'No books exist. ', + 'FOOTBALL_PAYOUT' => 'Payment', + 'FOOTBALL_RECORD' => 'Record', + 'FOOTBALL_RECORDS' => 'Records', + 'FOOTBALL_REMOVE_INSTALL' => 'You first need to delete the folder install_football from you web space. Otherwise Football Extension remains inactive!', + 'FOOTBALL_RULES' => 'WebTip Rules', + 'FOOTBALL_SEPARATOR_DECIMAL' => ',', + 'FOOTBALL_SEPARATOR_THOUSANDS' => '.', + 'FOOTBALL_TITLE' => '%1$s Prediction League', + 'FOOTBALL_WIN' => 'Win', + 'FORECAST_PTS' => 'Predicted points', + 'FORM' => 'Form', + 'FORMULA' => 'Formula', + 'FROM' => 'From', + 'FROM_DAY_SEASON' => 'From %1$d. Matchday season of %2$d', + 'GAME_NOT_PLAYED' => '%d Match was not played yet! ', + 'GAME_RESULTS' => 'Match results', + 'GAMES_SHORT' => 'MR', + 'GET_TEAM' => 'Get existing team', + 'GOALS' => 'Goals', + 'GOALS_GUEST' => 'Goals guest', + 'GOALS_HOME' => 'Goals home', + 'GOALS_AGAINST' => 'Goals against', + 'GOALS_DIFF' => 'Goals difference', + 'GOALS_DIFF_SHORT' => 'GD', + 'GR' => 'GR', + 'GROUP_GAMES' => 'Group matches in group', + 'GUESSED' => 'Bet', + 'GUEST' => 'Guest', + 'HIST_CHART' => 'Chart progress matchdays', + 'HITS' => 'Direct hit', + 'HITS_SHORT' => 'DH', + 'HITS_SHORT2' => 'DH02', + 'HOME' => 'Home', + 'HOME_MATCHES' => 'Home matches', + 'IMPROVED' => 'Improved', + 'JOIN' => 'Join this WebTip', + 'JOIN_BY_ADMIN' => 'Only administrators can accept new Users to this WebTip. ', + 'JOIN_BY_USER' => 'Board members can join independently to the WebTip before the beginning. ', + 'JOIN_IN_SEASON' => 'Board members can join independently to the running WebTip. ', + 'JOIN_LEAGUE' => 'Want to join this WebTip?

with your entry you accept conditions of participation of this WebTip. ', + 'JOIN_MODE' => 'Entry to this WebTip', + 'KICK' => 'Kick off', + 'KOEFF_OF' => 'The bet coefficient of ', + 'KOEFF_TEXT' => 'Shows how many points on average other Users would have if they had all matches correctly. ', + 'LAST_GAMES' => 'The last matches', + 'LAST_GAMES_AWAY' => 'The last away matches', + 'LAST_GAMES_HOME' => 'The last home matches', + 'LAST_VISITORS' => 'Last %s visitors', + 'LEAGUE' => 'League', + 'LINK_PREDICTION_LEAGUE' => 'To the WebtTip', + 'LINK_RULES' => 'Exact conditions of participation are in the forum. ', + 'LOGIN_EXPLAIN_EXPORT' => 'To export bets, you must be registered and logged in. ', + 'LOGIN_EXPLAIN_FOOTBALL' => 'You must be registered and logged in to access the WebTip. ', + 'LOGS_COMMENT' => 'Comment', + 'LOOSER' => 'Loser', + 'LOOSER_MATCH_NO' => 'Loser match No. ', + 'LOST' => 'Lost', + 'LOST_SHORT' => 'L. ', + 'MATCH_ERROR' => 'Fixture not compatible', + 'MATCH_STATS' => 'MAtch statistics', + 'MATCHDAY' => 'Matchday', + 'MATCHDAY_FROM' => 'Matchday from ', + 'MATCHDAY_SHORT' => 'MDay', + 'MATCHDAY_TINY' => 'MD', + 'MATCHDAY_TO' => 'Matchday to ', + 'MD_MAX_POINTS' => 'Matchdays with the highest average points', + 'MD_MIN_POINTS' => 'Matchdays with the lowest average points', + 'MEMBER' => 'User', + 'MIN90' => '90 min. ', + 'MY_BETS' => 'My Bets', + 'MY_CHART' => 'My Chart', + 'MY_KOEFF' => 'My Bet Coefficient', + 'MY_POINTS' => 'My Points', + 'MY_RANK' => 'My Rank', + 'MY_TABLE' => 'My Table', + 'MYCHART_TEXT' => 'Initially - beside own data - the leading user, a user from the midrange and the last one will be displayed. ', + 'NAME' => 'Name', + 'NEXT_DELIVERY' => 'Next bet delivery', + 'NEXT_DELIVERY_UNTIL' => 'Next bet delivery until', + 'NO_AUTH_VIEW' => 'You are not authorised to view Prediction League pages. ', + 'NO_AWAYMATCHES_TEAM' => 'This team has not played away this season yet. ', + 'NO_BET' => 'Without bet', + 'NO_BETS' => 'No bets available!', + 'NO_BETS_SAVED' => 'No bets saved!', + 'NO_CHANGES' => 'No changes', + 'NO_DATA' => 'No data available!', + 'NO_GUESTTEAM' => 'The guest team chosen by you does not exist. ', + 'NO_HIST' => 'No previous comparisons exist for these two teams in the database. ', + 'NO_HOMEMATCHES_TEAM' => 'This team has not played at home this season yet. ', + 'NO_HOMETEAM' => 'The home team chosen by you does not exist. ', + 'NO_LEAGUE' => 'The league chosen by you does not exist. ', + 'NO_LINK_RULES' => 'The exact rules and conditions of participation have not been saved in the forum up until now yet. ', + 'NO_MATCH' => 'The match chosen by you does not exist. ', + 'NO_MATCHDAY' => 'The matchday chosen by you does not exist. ', + 'NO_MATCHES' => 'No matches available!', + 'NO_MATCHES_ON_MATCHDAY' => 'The fixture list was not created yet. ', + 'NO_MATCHES_TEAM' => 'This team has not played any matches this season yet . ', + 'NO_MEMBER' => 'You are not a member of this Webtip!', + 'NO_MYBETS_ME' => 'You are not a member of this Webtip!', + 'NO_PLAN' => 'For this matchday no fixtures were entered yet!', + 'NO_POINTS' => 'No points', + 'NO_RESULT' => 'There is no match result yet!', + 'NO_RESULT_SAVE' => 'No new match result saved! ', + 'NO_RESULTS' => 'There are no match results yet!', + 'NO_SEAS_PROFIT' => 'Only matchday wins, no seasonal wins are considered (from season 2003). ', + 'NO_SEASON' => 'The season chosen by you does not exist. ', + 'NO_TABLE' => 'No match results are available yet or this league consists only out of KO rounds!', + 'NO_TABLEFORM' => 'Since this matchday no matches or only KO matches were played, hence, no form table is created. ', + 'NO_TEAM_ID' => 'The team chosen by you does not exist. ', + 'NO_TEAM_NAME' => 'Team name is missing! Please enter a team name!', + 'NO_TEAM_SHORTNAME' => 'Short name of the team is missing! Please enter a short name!', + 'NO_USER' => 'You are not a member of this WebTip!', + 'NO_USERID' => 'The User chosen by you does not exist. ', + 'NO_USERS' => 'This WebTip has no users!', + 'NO_WIN_MATCHDAYS' => 'This WebTip does not contain any matchday winnings!', + 'NO_WIN_SEASON' => 'This WebTip does not contain any seasonal winnings!', + 'NOT_CLOSED' => 'This matchday was not closed yet!', + 'NOT_PLANNED' => 'This matchday was not drawn yet!', + 'NOT_RATED' => 'Not rated', + 'NR' => 'NR. ', + 'NUMBER' => 'Number', + 'OPTION_LEAGUE' => 'Select league', + 'OPTION_MATCHDAY' => 'Select matchday', + 'OPTION_SEASON' => 'Select season', + 'OPTION_TEAM' => 'Select team', + 'OPTION_USER' => 'Select user', + 'OVERTIME' => 'Overtime', + 'ODDS' => 'odds', + 'PARTICIPANTS_SHORT' => 'Part. ', + 'PAYOUT' => 'Payout', + 'PAYOUT_WIN' => 'Payout wins', + 'PENALTY' => 'Penalty', + 'PENALTY_SHORT' => 'Pen. ', + 'PLACE' => 'Place', + 'PLAN' => 'Plan', + 'PLAYED' => 'Played', + 'PLAYED_MATCHES' => 'Played matches', + 'POINTS' => 'Points', + 'POINTS_DIFF' => 'Point difference', + 'POINTS_DIFFERENCE' => 'Points for the correct Goal difference: %s', + 'POINTS_DOT' => 'Pt. ', + 'POINTS_HIT' => 'For the prediction of the correct result (direct hit) there is %s points. ', + 'POINTS_LAST' => 'Points of the last one for non-betting members', + 'POINTS_NO_BET' => 'In case somebody forgets to bet, then he automatically receives the points of the matchday-last. Under certain circumstances this can be even 0 points. ', + 'POINTS_OF' => 'The points of', + 'POINTS_OF_ALL' => 'The points of all users', + 'POINTS_SHORT' => 'Pt', + 'POINTS_SHORT_DOT' => 'Pt. ', + 'POINTS_TENDENCY' => 'Points for a right trend: %s', + 'POINTS_TENDENCY1' => 'With the right tendency one point is taken off the direct hit score for every divergent goal, but minimum %s points are given. At a draw the deduction occurs only for the difference of one team. ', + 'POINTS_TENDENCY2' => 'With the right tendency one point is taken off the direct hit score for every divergent goal, but minimum %s points are given. ', + 'POINTS_TOTAL' => 'Sum of the points of the displayed users', + 'POSSIBLE_POINTS' => 'Possible points', + 'PREDICTION_LEAGUE' => 'WebTip', + 'PREV_DELIVERY' => 'Previous bet delivery', + 'PRINT' => 'Print', + 'PRINT_ALL' => 'Print All', + 'PRINT_FOOTBALL' => 'Print view', + 'PROVISIONALLY' => 'Provisionally', + 'QUESTION' => 'Question', + 'RANK_FORECAST' => 'Pl. %d (FP)', + 'RANK_MATCHDAY' => 'Ranking matchday', + 'RANK_SHORT' => 'Pl', + 'RANK_SHORT_DOT' => 'Pl. ', + 'RANK_TOTAL' => 'Total ranking', + 'RANK_TOTAL_MATCHDAY' => 'Total ranking %d. Matchday', + 'RANK1' => '1. Pl. ', + 'RANK2' => '2. Pl. ', + 'RANK3' => '3. Pl. ', + 'RANKING' => 'Ranking', + 'RANKING_ALL_TIME' => 'All time ranking', + 'RANKING_COMPARE' => 'Compare Ranking', + 'RANKING_MATCHDAY' => 'Ranking %d. Matchday', + 'RANKS_OF' => 'The ranks of', + 'RANKS_OF_ALL' => 'The ranks of all users', + 'RANKS_SEASON' => 'The ranks per season', + 'RESET' => 'Reset', + 'REST_MATCHES' => 'Rest matches', + 'RESULT' => 'Result', + 'RESULT_CLEARED' => '%d result was cleared successfully! ', + 'RESULT_EXPLAIN' => 'Match results (after 90 minutes)', + 'RESULT_SAVE' => '%d new score saved! ', + 'RESULTS' => 'Results', + 'RESULTS_CLEARED' => '%d results were cleared successfully! ', + 'RESULTS_SAVE' => '%d new scores saved! ', + 'RESULTS_SHORT_DOT' => 'Res. ', + 'RULES' => 'Rules', + 'RULES_EXPLAIN' => 'Here are only the technical basic conditions of this WebTip listed. ', + 'SAMESAVED' => 'Your %d Granny-bets were saved successfully! A bet was automatically modified. ', + 'SAVE' => 'Save', + 'SCORED' => 'Scored', + 'SEASON' => 'Season', + 'SEC_LEG_ERROR' => 'Second leg does not exist', + 'SHOW_BETS' => 'Show bets', + 'SHOW_CURRENT' => 'Show current matchday', + 'SHOW_NEXT' => 'Show next matchday', + 'SHOW_PLAN' => 'Show fixture list', + 'SHOW_PLAYED' => 'Show played matches', + 'SHOW_PLAYED_AWAY' => 'Show played away matches', + 'SHOW_PLAYED_HOME' => 'Show played home matches', + 'SHOW_PREV' => 'Show previous matchday', + 'SHOW_PROFILE' => 'Show profile', + 'SHOW_REST' => 'Show rest program', + 'STAT_BET' => 'Stat. bet', + 'STAT_GAME_RESULTS' => 'Statistics to the match results', + 'STAT_POINTS' => 'Stat. Points', + 'STAT_RESULTS' => 'Stat. Results', + 'STATISTIC' => 'Statistic', + 'STATISTICS' => 'Statistics', + 'STATS' => 'Stats', + 'STATUS_BET_TEXT0' => 'You have entered the following bet for this matchday: ', + 'STATUS_TEXT0' => 'Bet delivery until ', + 'STATUS_TEXT1' => 'The delivery deadline for this matchday has expired!', + 'STATUS_TEXT2' => 'Some matches have already taken place this matchday!', + 'STATUS_TEXT3' => 'All matches of this matchday were carried out!', + 'SWITCH_DESKTOP' => 'Switch to desktop-style', + 'SWITCH_MOBILE' => 'Switch to mobile-style', + 'TABLE' => 'Table', + 'TABLE_AWAY' => 'Away table', + 'TABLE_FORM' => 'Form table', + 'TABLE_FORM_FROM' => '(All matches since %d. Matchday)', + 'TABLE_HOME' => 'Home table', + 'TABLE_TOTAL' => 'Total table', + 'TEAM' => 'Team', + 'TEAM_FLAG' => 'Team emblem / flag ', + 'TEAM_ID' => 'Team-ID', + 'TEAM_ID_EXIST' => 'This Team-ID is already taken and assigned to another team!', + 'TEAM_IN_PLAN' => 'The team cannot be removed, because it is still in the current fixtures list!', + 'TEAM_IN_ROUND' => 'The team is in round', + 'TEAM_NAME' => 'Team name', + 'TEAM_NOT_EXIST' => 'This team does not exist!', + 'TEAM_SHORT' => 'Short name of the Teams', + 'TEND_RANK' => 'Change compared to the last matchday', + 'TEND_TEXT' => 'Bet tendency of all users: Home victory - Draw - Away victory', + 'TENDENCIES' => 'Tendencies', + 'TENDENCY' => 'Tendency', + 'TENDENCY_SHORT' => 'Ty', + 'THIS_MATCH' => 'This match', + 'TITLE_ALL_BETS' => 'Show bets of other users', + 'TITLE_BET' => 'Show bet delivery', + 'TITLE_FOOTBALL_BANK' => 'Show account', + 'TITLE_MY_BETS' => 'Show statistics of the bets', + 'TITLE_MY_CHART' => 'Show ranking chart', + 'TITLE_MY_KOEFF' => 'Points of other users when my bets are correct', + 'TITLE_MY_POINTS' => 'Show statistics points of each team', + 'TITLE_MY_RANKS' => 'Show statistics of the seasonal ranks', + 'TITLE_MY_TABLE' => 'Show league table via the bets', + 'TITLE_RANK_MATCHDAY' => 'Show matchday ranking of this league', + 'TITLE_RANK_TOTAL' => 'Show total ranking of this league', + 'TITLE_RANKING_All_TIME' => 'Show all-time ranking over all seasons', + 'TITLE_RANKING_COMPARE' => 'Show ranking list comparison with the preliminary seasons', + 'TITLE_RESULTS' => 'Enter match results', + 'TITLE_STAT_POINTS' => 'Show statistics points per matchday', + 'TITLE_STAT_RESULTS' => 'Show statistics of the match results', + 'TITLE_TABLE' => 'Show league table', + 'TO_MATCHDAY' => 'The team remains in the competition up to this matchday', + 'TOP20_POINTS' => 'Top 20 points season', + 'TOP20_POINTS_ALL' => 'All time top 20 points', + 'TOTAL' => 'Total', + 'TOTAL_EXPLAIN' => 'Total score of users for the displayed matches', + 'TOTAL_RANK' => 'Total rank', + 'TOTAL_RANKING' => 'Total ranking', + 'TOTAL_RANKS_OF_ALL' => 'Total ranks of all users', + 'TOTAL_SHORT' => 'Tt', + 'UNDER_CONSTRUCTION' => 'This WebTip was not completely set up yet', + 'UNDER_CONSTRUCTION_EXPLAIN' => 'Please wait for the administrator to have all data collected. ', + 'UPDATE_TEAM' => 'The team data was changed in the league. ', + 'USER_TABLE' => 'The table after the bets of', + 'VIC_MAX_POINTS' => 'Matchday victories with the highest scores', + 'VIC_MIN_POINTS' => 'Matchday victories with the lowest scores', + 'VICT_AWAY' => 'Away victories', + 'VICT_HOME' => 'Home victories', + 'VICTORY' => 'Victory', + 'VIEW_BET_USER' => '1 User', + 'VIEW_BET_USERS' => '%d User', + 'VIEWING_LEAGUE' => 'Viewing the %s in Prediction League', + 'VIEWING_LEAGUE_BET' => 'Viewing ist %s bets to the Prediction League', + 'VIEWING_LEAGUE_BET_POPUP' => 'Viewing the %s advice of another', + 'VIEWING_LEAGUE_ALL_BETS' => 'Viewing "all tips" of %s to the Prediction League', + 'VIEWING_LEAGUE_RESULTS' => 'Looking at the results of the %s in Prediction League', + 'VIEWING_LEAGUE_TABLE' => 'Consider the table of %s to the Prediction League', + 'VIEWING_LEAGUE_RANKS_TOTAL' => 'Viewing the overall ranking of %s to the Prediction League', + 'VIEWING_LEAGUE_RANKS_MATCHDAY' => 'Consider the ranking of the match the %s in Prediction League', + 'VIEWING_LEAGUE_BANK' => 'Looking statements the %s in Prediction League', + 'VIEWING_LEAGUE_RULES_POPUP' => 'Viewing the rules of %s to the Prediction League', + 'VIEWING_LEAGUE_DLOAD_EXPORT' => 'Exports data of %s from the Prediction League', + 'VIEWING_LEAGUE_ODDS' => 'Viewing the odds of %s to the Prediction League', + 'VIEWING_LEAGUE_MY_BETS' => 'Viewing "My bets" of %s to the Prediction League', + 'VIEWING_LEAGUE_MY_POINTS' => 'Viewing "My points" %s to the Prediction League', + 'VIEWING_LEAGUE_MY_TABLE' => 'Viewing "My table" %s to the Prediction League', + 'VIEWING_LEAGUE_MY_RANK' => 'Viewing "My rankings" of %s to the Prediction League', + 'VIEWING_LEAGUE_MY_CHART' => 'Viewing "My chart" %s to the Prediction League', + 'VIEWING_LEAGUE_MY_KOEFF' => 'Viewing "My tip coefficient" of %s to the Prediction League', + 'VIEWING_LEAGUE_HIST_POPUP' => 'Viewing statistics of an encounter in the %s', + 'VIEWING_LEAGUE_VIEWPLAN_POPUP' => 'Viewing the %s Schedule an association', + 'VIEWING_LEAGUE_STAT_RESULTS' => 'Viewing "Stat. Results" %s to the Prediction League', + 'VIEWING_LEAGUE_STAT_POINTS' => 'Viewing "Stat. Points" of %s to the Prediction League', + 'VIEWING_FOOTBALL' => 'Viewing the Prediction League community', + 'VIEWING_FOOTBALL_BET' => 'Viewing his advice to the Prediction League', + 'VIEWING_FOOTBALL_BET_POPUP' => 'Consider the advice of another in Prediction League', + 'VIEWING_FOOTBALL_ALL_BETS' => 'Viewing "all advice" to the Prediction League', + 'VIEWING_FOOTBALL_RESULTS' => 'Looking at the results of the Prediction League', + 'VIEWING_FOOTBALL_TABLE' => 'Consider the table in Prediction League', + 'VIEWING_FOOTBALL_RANKS_TOTAL' => 'Viewing the overall ranking in Prediction League', + 'VIEWING_FOOTBALL_RANKS_MATCHDAY' => 'Consider the ranking of the match in Prediction League', + 'VIEWING_FOOTBALL_BANK' => 'Viewing bank statements to the Prediction League', + 'VIEWING_FOOTBALL_RULES_POPUP' => 'Viewing the rules of the Prediction League', + 'VIEWING_FOOTBALL_DLOAD_EXPORT' => 'Exports data from the Prediction League', + 'VIEWING_FOOTBALL_ODDS' => 'Viewing the odds in Prediction League', + 'VIEWING_FOOTBALL_MY_BETS' => 'Viewing "My advice" to the Prediction League', + 'VIEWING_FOOTBALL_MY_POINTS' => 'Viewing "My Points" in Prediction League', + 'VIEWING_FOOTBALL_MY_TABLE' => 'Viewing "My Table" in Prediction League', + 'VIEWING_FOOTBALL_MY_RANK' => 'Viewing "My rankings" of the Prediction League community', + 'VIEWING_FOOTBALL_MY_CHART' => 'Viewing "My Chart" in Prediction League', + 'VIEWING_FOOTBALL_MY_KOEFF' => 'Viewing "My tip coefficient" to the Prediction League', + 'VIEWING_FOOTBALL_HIST_POPUP' => 'Viewing the statistics of an encounter in Prediction League', + 'VIEWING_FOOTBALL_VIEWPLAN_POPUP' => 'Viewing the Schedule an association to the Prediction League', + 'VIEWING_FOOTBALL_STAT_RESULTS' => 'Viewing "Stat. Results" in Prediction League', + 'VIEWING_FOOTBALL_STAT_POINTS' => 'Viewing "Stat. Points" to the Prediction League', + 'VS' => 'Fixtures', + 'WIN' => 'Win', + 'WIN_FOR' => 'Victory for', + 'WIN_HITS' => 'Winning direct hit evaluation', + 'WIN_HITS02' => 'Winning direct hit evaluation with away points', + 'WIN_MATCHDAY' => 'Win of matchday', + 'WIN_SEASON' => 'Win of season-ranking', + 'WIN_SHORT' => 'W', + 'WINNER' => 'Winner', + 'WINNER_MATCH_NO' => 'Winner match No. ', + 'WINS_MATCHDAY' => 'Winnings of matchday', + 'WINS_SEASON' => 'Winnings of season', + 'WITH_TEAM' => 'With the teams', + 'WON' => 'Won', + 'WORSENED' => 'Worsened', + 'WRONG_GROUP' => 'Group match between teams of different groups. ', + 'YEAR' => 'Year', + 'ZERO_POINTS' => 'Zero Points', + 'FOOTBALL_COPY' => 'phpBB Extension - Football Prediction League Version %1s', +)); diff --git a/language/en/help_football.php b/language/en/help_football.php new file mode 100644 index 0000000..c36c157 --- /dev/null +++ b/language/en/help_football.php @@ -0,0 +1,503 @@ + '--', + 1 => 'First steps' + ), + array( + 0 => 'How do I install a league?', + 1 => 'When you install this Extension any fixtures are included. Fixture lists can be loaded by "update fixture lists" into the database. +For details, see under this heading. +After installing a fixture list, the settings of the league should be processed and the delivery dates of the match days checked and adjusted if necessary. +Select manage league to put single users or group members to the prediction league. ' + ), + array( + 0 => 'Other settings?', + 1 => 'For handle the prediction league(s) you should review and assigned administrative privileges to the members. For automatic sending of +reminder emails you can set up an external Cornjob. Look that up in the various elements of this help.' + ), + array( + 0 => '--', + 1 => 'General' + ), + array( + 0 => 'Which prediction leagues are supported?', + 1 => 'All prediction leagues on a championship or KO Round aim. So, soccer leagues, cup competitions, Champions League, Champions League, +European Championship or World Cup. Even a mix of different competitions is supported, to this table and the statistics show, however, nothing meaningful. +Only through the point mode Handball is the Extension and other leagues are not suitable for. ' + ), + array( + 0 => 'What rights exist in the Extension ', + 1 => 'a_football_results = Can enter, modify and delete final game results
+a_football_editbets = Can See in the admin area to enter all the tips, and change it
+a_football_plan = Unable to create change game plans. Schedule and manage delete (without) and knockout rounds to determine winners
+a_football_delete = Can Fixtures and delete parts of it. Delete permission in the schedule management
+a_football_config = Can change prediction league settings: prediction league configuration
+a_football_points = Can set, change and delete points for Ultimate Points
+u_use_football = Can use Prediction League.' + ), + array( + 0 => 'What roles exist in this Extension? ', + 1 => 'The football Administrator has just the right match results enter final, otherwise no admin rights. ' + ), + array( + 0 => 'Which rights were roles assigned to existing ones? ', + 1 => 'The default administrator can enter final Scores, change and delete them. +The Global Administrator has all the rights of MODS. ' + ), + array( + 0 => 'Which custom profile fields have been generated by the Extension? ', + 1 => 'footb_email = additional second email address for email alerts
+footb_rem_f = switch for sending the reminder email to the primary e-mail address.
+footb_rem_s = switch for sending the reminder email to the second E-mail address. ' + ), + array( + 0 => 'How do I activate the reminder e-mail function? ', + 1 => 'In the admin area in the Prediction League functionality the mail reminder cron job and the next run must be activated.
+The cron job is run on the first access after this date and sends an e-mail reminder for the missing tip duties that lie in the period 24-48 hours after cron date . +If not sufficient accesses the page, the cron job should automatically run on script "cron.php?cron_type=football_remember".
+The ship of the email takes place only once . After calling up the cron job, the next scheduled is automatically planned for the following day . +With the appended parameters " & mode = test & days = n " can be tested the shipment for the offset to n days predictions . Only mails to board email address will be shipped . + In ACP a user defined prediction leagues code is to define.
+This code XXX must be a cronjob as www.cronjob.de by calling the script "/ football / cron_remember.php? Code = XXX" start.
+The call must be at least 24 hours and maximum 33 hours before the final matchday of the place. When multiple calls during the period reminder email will +be sent again. +Is the Tip levy as of Friday 20:00 clock must call on Thursday between Thu 11 and 20 clock made.
+If the cron job running daily at 13:00 clock, all the deadlines on the following day zwischen 13:00 und 22 clock and no one considered twice. ' + ), + array( + 0 => 'Who gets a reminder ', + 1 => 'If enabled, reminder function get all the tipsters who play a match with status 0 not fully tapped have to hand +in on a reminder to the shared (n) e-mail address (es).
+In addition, an e-mail with the recipient list to the Board e-mail sent (but only if at least one reminder was sent).
+The documentation process is logged to the log. ' + ), + array( + 0 => '--', + 1 => 'Tip Deadline ' + ), + array( + 0 => 'Tip When the tax is suspended? ', + 1 => 'As soon as someone Data from the prediction leagues will retrieve checks that match status 0 and expired tax time exist with. The to closing +matches will state 1 and suspend for bet. ' + ), + array( + 0 => 'The match or matches are not delivery date closed to ', + 1 => 'The tax date is the current host time + time difference between board and host time zone compared. If your host in the set board zone is +located, it must be time zone in the prediction leagues settings also deposited be. ' + ), + array( + 0 => 'I can a matchday not edit the submission date ', + 1 => 'You have the league settings "tip submit on each game start" is selected with. This automatically submitting time based games managed. the if +you remember the game plan preparation, are in should "tip tax until their game starts" only after recognition of the entire game board set is. Then, the +delivery time is automatically corrected. ' + ), + array( + 0 => 'The game has already begun, but I can not type yet ', + 1 => 'The match was not yet closed, since the charge time or in the future, and the first game but has already started. Saving the charge time in +the match day is currently the Time synchronized with the seasons and not reviewed. ' + ), + array( + 0 => 'checks to save the match day settings ', + 1 => 'When saving a match day, the system checks whether the status of the game day must be corrected. If the 1 . release date in the future, +the status of the match day 0 set to, he is in the past, 3 the status depending on the status of its games to 1, 2 or Set. ' + ), + array( + 0 => 'How do I make further deadlines in a game day one? ', + 1 => 'This is only possible if "tip tax until their game starts" in the league settings to "no". Then, two more deadlines deposited will match the. +The games to 2 deadline to be closed must schedule manual status -1 set to be on the. For the third Deadline Games is the status of the manually set to -2. ' + ), + array( + 0 => 'What does tip tax until their game starts', + 1 => 'In this mode, each game for the start of the game, typed up by one. When you close the tip submit a game is determined whether any" open +"games Matchday exist in the. If so, the charge time of the match day to the next start of the game is set, otherwise it remains on the last game and the +match began with the congestion gets first Predictions for a fixed time before each game is not currently supported. ' + ), + array( + 0 => '--', + 1 => 'Operating ' + ), + array( + 0 => 'How to save final scores? ', + 1 => 'Final scores can only be stored in the admin area. Only the results of the selected matches are saved. ' + ), + array( + 0 => 'I can not enter final scores ', + 1 => 'On prediction leagues functionalities "enter final scores only after match" final scores could entered only after the match (90 minutes).
+It is not possibleto enter final scores for matches with status 0. For these matches with status 0, please check delivery time. ' + ), + array( + 0 => 'I want to save a preliminary results', + 1 => 'Preliminary results can be entered only in the User area. ' + ), + array( + 0 => 'Why do I get different leagues after calling score page? ', + 1 => 'Calling the page "scores" the league which longest waits for a scores is automatically displayed. ' + ), + array( + 0 => 'Which stage status is set after saving final scores? ', + 1 => 'After saving final scores, the stage status according to the matches is set. +When all the matches have a status greater than 2, the stage status 3 is set up. Otherwise, stage status ist set to the minimum match status> = 0. ' + ), + array( + 0 => 'When rankings are updated?', + 1 => 'After saving final or preliminary scores in the user or admin area, the stage ranking is updated. Then, the +overall ranking is calculated and the places are stored in stage data. The remaining data in the overall ranking are not stored, they are currently calculated.
+For stage status 0 or 1, the ranking will be deleted for this stage. The ranking status is set identical to stage status. ' + ), + array( + 0 => 'How do I delete final scores? ', + 1 => 'Clear final score field(s) or choose delete option and final score ist deleted for this match. The match state will be set to 1. ' + ), + array( + 0 => 'How do I get games from rating? ', + 1 => 'Set switch "without rating" before saving the match. no one will receive points for that match. If there is +no result yet, the game will be saved with state 4, preliminary scores will be state 5, final scores without rating will be state 6. ' + ), + array( + 0 => 'Who can see all tips?', + 1 => 'User with admin rights a_football_editbets = "Can the admin section view, enter all tips and change" can see and edit all tips of all users in the admin area. ' + ), + array( + 0 => 'What is Tip entry in the admin area to observe the case?', + 1 => 'Will to games already available results stored Tips is ranked does not automatically update the. The rankings take into account new tip not. +The display the individual tips and "All Reviews" will be amended tips and the resulting points displayed. If the modified tips rankings included are the in, +match the results of the match day and the subsequent store again, the rankings newly calculated that. games must not selected or altered it. ' + ), + array( + 0 => 'What is "KO-round winners identify"? ', + 1 => 'order for the schedule management only teams to choose from in the corresponding round reaches have also must match the team will be registered +to the team to remain competitive. That, and the transfer to third runners-up teams in the Champions League group stage in the Champions League can be +performed automatically on this page. As in particular in the calculation of group placement, not all rules were taken into account in the system, +any errors are corrected manually. This will involve teams of the status message is logged in. +If ' + ), + array( + 0 => 'How to determine the winner of a knock-out round? ', + 1 => 'For each knockout games, or knock-out rounds with a return game, it is sufficient to match the determination to select where these games have +taken place as the target game day. Matchday to choose the last to which the team at least competition remains. ' + ), + array( + 0 => 'How do I determine the group winner and second group ', + 1 => 'In Group Play are all group match to determine select and the last match day round as the target match day to be deposited next to the. The +"determination on the basis of table space for group games" to choose and the place to which the teams qualify. If teams other league transferred to one in , +League is the corresponding selected, otherwise not. If no league selected, place and match ignored and not transferred Team. ' + ), + array( + 0 => 'The teams are already entered in the next round ', + 1 => 'Have Schedule the formulas W (Winner) or L (Looser) deposited in, is already in the display of the encounter between the winners and losers of +the formula stored in lot (s) are determined and entered in the schedule. Nevertheless, you should "round KO winner determined "called to be, otherwise when +you saved the game encounter in the game schedule (in game transfer or other change), the teams to choose from and are not therefore be deleted.
+The formula G does not lead to an automatic identification, as currently used in the determination of group placement, not all special rules are included in +the smallest up. The determination must be in the admin section on "knock-out rounds to determine winners" will be implemented and monitored. ' + ), + array( + 0 => 'without Tipster Tips still get points ', + 1 => 'You have the league settings stored in that Nichttipper the last of the points to get automatically. ' + ), + array( + 0 => '--', + 1 => 'Schedule Administration ' + ), + array( + 0 => 'How do I create a new Schedule? ', + 1 => 'To Schedule creation is each page compulsory for bottom-up work off of. In particular Games is the correct filing of the number of match days +and observed, so the generation process of schedule creation works in the. It was only after generation of the games in Fixtures can Tipper be included as +previously to the number of games are missing information. Just schedule the switch "tip tax until their game starts" only after generation of the games in +the visible. This switch should be made only after the deposit of the participating teams and all game dates Yes set to be to ensure that all deadlines set +will be able to automatically match the in. ' + ), + array( + 0 => 'How do I set a new season? ', + 1 => 'Under "Seasons Manage" you create a new season with the year, in the season ends. The season +2010/2011 at the season 2011 so as to create. On the following page will then set appropriate default values. ' + ), + array( + 0 => 'How do I set up a new league? ', + 1 => 'Under "leagues manage" you create a new league with an indication of a league point. The league number +should apply to the seasons the same award and are over league one must run away within the season to be>. The first league so should always be the League +number one, the second league, the league number two always get. ' + ), + array( + 0 => 'How do I set up a match that? ', + 1 => 'button to generate. In a new league must match the first the missing when the match day one from the standard ". Matchday" get to name +different, so the field is the appropriate fill, otherwise not. If a submission date filed, participating teams, this Abgabetemin in the generation of the +start of the game used as. ' + ), + array( + 0 => 'How I am in a league team? ', + 1 => 'knockout rounds before the case must necessarily match days are recorded, so the team can be assigned to a match, to which the team will remain +in the competition. The team ID of a team leagues and should be chosen identical across all seasons over so that the statistics work in historical +comparisons. +All gif files in the directory / football / images flags / are selecting a team emblem or a flag to display. The arms should be the size 28px x 28px have. +It is pointed out, the club crest copyrights are subject to, and not the rights holder used to be allowed the consent without. ' + ), + array( + 0 => 'How do I create the teams participating in the game schedule? ', + 1 => 'After all match days and men were recorded, the database entries for the participating teams will be generated. was before the match a deadline +deposited with, this is all the games of the match day as the game begins deposited with. Did not have any team a game pairing deposited in, then in the +summary instead of the Team name a possibly deposited calculation formula. ' + ), + array( + 0 => 'Can a game plan gradually build me? ', + 1 => 'Yes, you can use during the season more match in the league to add. This one carries the "Leagues Manage the change in the number of match days, +and then goes to "match" manage where you can to match messages generate new ones. and then edit. After entering the deadlines and number of games in +knockout rounds, have the games still be generated schedule in . To do this select new added match from and click on the generation button. The lack of +games will be generated and also missing empty entry all tipsters in the tip table. ' + ), + array( + 0 => 'When can a league Tipper take in? ', + 1 => 'games on the schedule Tipper can be added after creating the first place. Only then is the function "Manage Leagues" released. ' + ), + array( + 0 => 'Can I also delete match? ', + 1 => 'Yes, chosen either match "match Manage" on the "Delete" or the last match by the number of match days in the +league, and then reduces the "match on" Manage and there is then pressed the button displayed. Deleted is always the match with all the games and all tips. ' + ), + array( + 0 => 'can not play games or nobles I collect? ', + 1 => 'If you have created a knock-out round, you have the number of games at each match deposit. Only then Button appears to complete the game board +game board Manage. ' + ), + array( + 0 => 'What’s in a game installation? ', + 1 => 'change a game date is after in "tip-out to each start of the game " back to the status of the game and the match day and there deposited +deadline adapted to. ' + ), + array( + 0 => 'What are special tips? ', + 1 => 'special tips are single tips with separate scoring. You can be a to a league season to be defined and / or flow thus either in the scoring at +or in the overall standings one. Matchday the issue to a special tip can match are stored individually, but it should be clear. ' + ), + array( + 0 => 'What answer - and profit opportunities are available? ', + 1 => 'on the question type is more in response to the selection of a team in the league, a number or text available. The result is still a number of +values are in addition, each by " ; be separated. "Thus, with a multiple-answer questions can be deposited Choice. If question type 3 or 4 in question, +the choice of A: B: C: ... H: be marked with the appear in the typing and Score input automatically corresponding values in a dropdown box. ' + ), + array( + 0 => 'What a question and answer opportunity question type 1? ', + 1 => 'By type of question one can in response and outcome, only one team from the League team list will be selected. The maximum score is only +awarded in full compliance, otherwise gives the Tipper 0 points.
+Sample question: Who will be the Champion ' + ), + array( + 0 => 'What a question and answer opportunity type of question 2? ', + 1 => 'type of question 2, the question type 1, but the result in writing (or a more team-IDs separated by ";" separately entered). The maximum score +is awarded if the answer to the selection team associated ID value from the result of a match.
+Sample question: Name a relegated team (ranked 16-18 on the seasons end) ' + ), + array( + 0 => 'What a question and answer opportunity type of question 3? ', + 1 => 'type of question 3 In response and result only value (text or numbers) are stored one. The maximum score is awarded if the answer agrees with +the result, otherwise gives the Tipper 0 points.
+Sample question: How much red (no yellow-red) cards are given to this match? A = 0 B = 1 C = 2 D = more than 2 ' + ), + array( + 0 => 'What a question and answer opportunity> type of question 4? ', + 1 => 'type of question 4, In response a number or a text and as a result of more numbers or more texts (but not a combination of numbers and text) +by ";" to be entered separately. The maximum score is awarded if the number or the text in the response with a value of the outcome of matches.
+Sample question: Hannover 96 = B = A rises from the cup gets C = C = is not playing international German champions' + ), + array( + 0 => 'What a question and answer opportunity type of question 5?', + 1 => 'If question type 5 can result in response and only one number can be stored. The maximum points will be awarded if the answer to the outcome +is in accordance with, or receives maximum number of tipsters, the less the absolute difference between the response and result, no negative points.
+Sample question: How many goals are in this match? ' + ), + array( + 0 => 'Which ranking is flowing Special Tip a one?', + 1 => 'If delivery and evaluation Matchday be identical, scoring runs in the match score and a ranking. If the evaluation Matchday chosen different, +special tip flows in the overall classification and ranking one. ' + ), + array( + 0 => 'I Can Seasonal Tips Creating while? ', + 1 => 'Yes, but only to match which can still be typed. Stored special tips can be moved even then. However, the status of special tips examined +separately and corrected, if necessary, as with a shift to a no longer tippbaren match the status of the Special tips will automatically be adjusted not.' + ), + array( + 0 => 'When special tip is one of the tip release blocked?', + 1 => 'Special tips will be the first delivery date of a match day for the tip tax agreements with. If we want such a Champion tip on 3.Spieltag make +up, it sets If the levy on Matchday 3 and evaluation on the final day. ' + ), + array( + 0 => '--', + 1 => 'prediction leagues configuration ' + ), + array( + 0 => 'What time zone do I have to tip round set? ', + 1 => 'If the host the same time zone of the forum is, is betting the same time zone as the forum to vote in the. If the host in a different time +zone, then the time zone of the betting difference to set according to the . This is necessary because of supply and result input of the games system time +functions are used. ' + ), + array( + 0 => 'Why is betting code uses the? ', + 1 => 'To the memory function via cron_remember.php not outsiders can be misused, is the call of the parameters with the betting deposit code compared +code. Take for instance the code in the admin area deposited 19032038, so should the cronjob cron_remember.php? code = for the reminder call 19,032,038th ' + ), + array( + 0 => 'How do I show the rankings in the main view, clearly shape the?', + 1 => 'With the switch "Table Tipper in the overview Rankings", the match day overall list will be limited. If the rank by the not notified of an ad +to run, so the placement will be added to the rankings below. ' + ), + array( + 0 => '--', + 1 => 'Account overview / Ultimate Points (UP)' + ), + array( + 0 => 'It is necessary of the Ultimate Points Extension?', + 1 => 'No if you liked to indicate a balance, nevertheless, the Tippern of your tip round, you should instal the Ultimate Points Extension.
+Independent of Ultimate Points Extension league profits are credited to the account in phpBB3 football Extension and the Admin can register applications, payments +and payment.' + ), + array( + 0 => 'What does cause the setting "Ultimate Points integrate" in the prediction league functionalities in the Administration?', + 1 => 'This setting has only consequences on the automatic settlement of the profits in the balance of Ultimate Points. Here one can choose +whether profits, points or nothing from phpBB3 football Extension should flow in onto the Ultimate Points balance. The settlement of the achieved prediction +league points can be steered, in addition, still about a factor. ' + ), + array( + 0 => 'Can see other my account overview?', + 1 => 'Only who owns suitable rights, the account overview of another Tippers can question in the prediction league area.' + ), + array( + 0 => 'How are wagers, deposits and payment and profits registered?', + 1 => 'Wagers charge the account and the balance of UP and can be compensated by payments again. In the season credited profits can be paid by the + account and the payment likewise charge the balance in UP. Profits are registered automatically about the profit distribution of the prediction + league with the memory of the play results with the account and UP (with sedate counter). With renewed storing away of results the old reservations + are cancelled and booked anew. Should results already exist in the following matchdays, the matching ranking lists and reservations are corrected. + Deposits and payments-out are only for real payments.' + ), + array( + 0 => 'booking wagers', + 1 => 'If UP is installed and is activated with the beech, the wager is drawn off from the balance UP. The wager can be debited a sum to an account + for a complete league or for single user. With the reservation for the whole league quite booked wagers are already taken into consideration before, + so that all together at most the wager deposited in the league is debited a sum to an account. With single debit ever well-chosen user the back + wager are put down as a default on the respective input fields. If these values are changed no examination on under or over charging occurs.' + ), + array( + 0 => 'booking deposits', + 1 => 'If UP is installed and is activated with the beech, the deposit is credited to the balance. Therefore resulted negative account balances can +be compensated by deposits again. Deposits can be booked for a complete league or for single user. With the reservation for the whole league booked +deposits are already taken into consideration before, so that all together at most the application deposited in the league is booked. With single +reservation ever well-chosen user the final deposits are put down as a default on the respective input fields. If these values are changed no examination +on under or over charging occurs.' + ), + array( + 0 => 'booking payments', + 1 => 'If UP is installed and is activated with the beech, the payment loads the balance. Therefore achieved profits can be paid in the season and +the balance be equalised. Payments can be booked for a complete league or for single user. With the reservation for the whole league booked payment is +already taken into consideration before, so that all together at most the profit get in the league is booked up. With single reservation ever well-chosen +user the back payment is put down as a default on the respective input fields. If these values are changed no examination on under or over charging occurs.' + ), + array( + 0 => 'Approach after the update on version 0.9.2', + 1 => 'With the update phpBB3 football MODs on version 0.9.2 ranking lists are anew calculated (also from the years before) and the profits are +registered automatically in the account. Besides, a settlement with the UP balance is not carried out. If this is welcome, the +option "integrate Ultimate Points" are put accordingly and the match results of the first matchday league once more are stored away. Wagers, +deposits and payment must be postsettled by hand in the Administration for each season. Before one should decide whether these reservations should be +also taken into consideration in the UP balance and put accordingly the option for UP.' + ), + array( + 0 => '--', + 1 => 'Fixture list Update' + ), + array( + 0 => 'How to Schedule Update', + 1 => 'An update on the fixture list can be carried out only with data from another Football Extension site. An overview of the available seasons +and leagues is seen on /football/xml/football_xml_season.php starting from the phpbb root directory. If this complete address entered directly +in the browser, the XML data will be displayed. After click on a league the current data from the League shown here. If you click in this view on +disk icon, you can download the data of the league as an XML file.
+When you start the update in the admin area under Fixture List update the saved settings for season overview is listed as an update source. If no +Source is stored, the Football Extension Demo site is registered as a source. After loading the season overview the available leagues are offered for selection. +If access is not supported on a different URL from your hoster you must take to download from desired leagues as an XML file and store it under root/store. +In this case, save localhost in football settings for future calls.
+Access to the season and the league data can be protected by a code. Users of the updates must use the code xxxx when calling the Season overview by +appending ?code=xxxx. So call /football/xml/football_xml_season.php?code=xxxx. During the subsequent call to the League data the code will be passed. +As target, you can choose an existing league or a league by entering the new league ID. To set up a new league, the target season must exist. +In this case, all data of the update file transferred to database after switching season and league ID.
+If an existing league is selected, first season and league-ID will be replaced and the teams compared with the database. For differing Team IDs +or different number of teams is to do in the next step, a team mapping. Then, any deviations between update and database is displayed and you can select +rows and columns the data to be transferred. Note different defaults for the column selection. After updating the database deadlines and status +are automatically corrected on matchdays and the the ranking of the league is recalculated.
+In the admin log a summary of the changes are logged.' + ), + array( + 0 => 'Team Mapping', + 1 => 'The team mapping is necessary if the team IDs are not identical or the number of teams is different. Recently added teams +e.g. in the EL the third of CL, are inserted in the database. After the mapping the program check whether all the existing teams are +assigned. The Team IDs are exchanged on the basis of the mapping in the update data. New teams are added only during the actual update.' + ), + array( + 0 => 'Match Status', + 1 => 'When generating the XML data, the status 4-6 will be changed to 1-3, ie in the update, there are no games without evaluation. +For games with game status < 2, the goal Fields and the state itself is not accepted. Is database sttaus larger than 3, this status is maintained +and the update program treats the data as with the corresponding status 1-3. Prerequisite for data acquisition under consideration of the status, however, +remains the selection of appropriate columns and records on matches.' + ), + array( + 0 => 'Take over negative status', + 1 => 'If this option is set, the negative status, but not the goals will be taken. This enables the staggered deadlines +to take on the update. The deadlines are to take either of the update (column options in matchdays) or manually in the admin area. +In a league with "Bet in time" the option "Take over negative status" can not be selected.' + ), + array( + 0 => 'Update results with same status', + 1 => 'Only if this option is set, the goal fields from the update with the same status in update and database will be updated. This +overwrites already recorded (preliminary) results in the database. This also applies to games in the database without evaluation. +Status 3 overwrites the final results with status 6 in the database. Analog overrides status 2 in the update +preliminary results from the classification made by state 4, but only if "Take over only final results" option is not selected.' + ), + array( + 0 => 'Take over only final results', + 1 => 'If this option is set, only the goal-fields from the update record must be taken when the status of the match in the update is 3. +Preliminary results from the update are not used. If these should be taken, this option is explicitly set off. ' + ), + array( + 0 => 'Using the Cache', + 1 => 'The seasons- and the leagues-data are stored for 5 minutes in the cache, so that the data are downloaded from Source only once. If you need +updated data within that time anyway, you have to delete the cache to force a new download from the Source.' + ), +); +?> \ No newline at end of file diff --git a/language/en/info_acp_all_bets.php b/language/en/info_acp_all_bets.php new file mode 100644 index 0000000..eb70b11 --- /dev/null +++ b/language/en/info_acp_all_bets.php @@ -0,0 +1,45 @@ + 'All bets', + 'ACP_FOOTBALL_ALL_BETS_MANAGEMENT' => 'See betting-all bets', + 'ACP_FOOTBALL_ALL_BETS_VIEW' => 'View all bets', + 'ACP_FOOTBALL_ALL_BETS_VIEW_EXPLAIN' => 'Here you can view all bets of all users.', + 'SELECT_MATCHDAY' => 'Select matchday', +)); diff --git a/language/en/info_acp_bank.php b/language/en/info_acp_bank.php new file mode 100644 index 0000000..12a7728 --- /dev/null +++ b/language/en/info_acp_bank.php @@ -0,0 +1,103 @@ + 'Accounts ', + 'ACP_FOOTBALL_BANK_MANAGE' => 'Manage Accounts', + 'ACP_FOOTBALL_BANK_MANAGE_EXPLAIN' => 'Here you can manage all Prediction League accounts. You can draw bets, administer payments and payment and control.', + 'ACP_FOOTBALL_BANK_MANAGEMENT' => 'Accounts Management', + 'BET_DEPOSIT' => 'Deposit Prediction League bets', + 'BET_DEPOSIT_EXPLAIN' => 'Here you can register payments of the users. By settlement in Ultimate Points, the balance UP is raised accordingly or compensated. Without settlement only the respective protocol sentences are grasped to the elective matchday.', + 'BOOK' => 'book', + 'BOOKED' => 'booked', + 'CARRYOVER_NEW_SEASON' => 'Carrzover to new season', + 'CARRYOVER_OLD_SEASON' => 'Amount carried over from the last season', + 'CONFIRM_BET' => 'Are you sure that you would like to debit the bet from the elective users', + 'CONFIRM_CANCEL_BET' => 'Are you sure that you would like to cancel the bets with the elective users?', + 'CONFIRM_CANCEL_DEPOSIT' => 'Are you sure that you would like to cancel the payments with the elective users?', + 'CONFIRM_CANCEL_PAY' => 'Are you sure that you would like to cancel the payment with the elective users?', + 'CONFIRM_CARRYOVER_PAY' => 'Are you sure that you would like to deposit with the elective users a part of the profits at the new season?', + 'CONFIRM_DEPOSIT' => 'Are you sure that you would like to book the payments with the elective users?', + 'CONFIRM_LEAGUE_BET' => 'Are you sure that you would like to debit the bets from the elective leagues?', + 'CONFIRM_LEAGUE_DELETE_WIN' => 'Are you sure that you would like to delete all wins with the elective leagues?', + 'CONFIRM_LEAGUE_DEPOSIT' => 'Are you sure that you would like to book the payments with the elective leagues?', + 'CONFIRM_LEAGUE_PAY' => 'Are you sure that you would like to book the payment with the elective leagues?', + 'CONFIRM_PAY' => 'Are you sure that you would like to book the payment with the elective users?', + 'DEBIT_BET' => 'Debit bet', + 'DEBIT_BET_EXPLAIN' => 'Here you can call bets of the participants or cancel bets. By settlement in Ultimate Points, the balance UP is loaded accordingly.', + 'DEPOSITED' => 'Deposited', + 'FOOTBALL_BANK_OFF' => 'The tip rounds account management was deactivated in the tip rounds functionalities.', + 'LEAGUE_BANK' => 'Accounts', + 'LEAGUE_BANK_EXPLAIN' => 'This are the topical account reservations of the respective leagues. At the end of the season bets/wins and deposits/payments should be identical in pairs. Actions on this side are explained for all participants. Bets and payments become for the 1-st matchday, booked payment for the topical matchday. You can hear reservations for single participants, while you click on the suitable amount. With click on the league name you can download an overview as CSV file.', + 'LEAGUE_BET' => '%s bet was debited.', + 'LEAGUE_BETS' => '%s bets were debited.', + 'LEAGUE_CANCEL_BET' => '%s bet was cancelled.', + 'LEAGUE_CANCEL_BETS' => '%s bets were cancelled.', + 'LEAGUE_CANCEL_DEPOSIT' => '%s bet payment was cancelled.', + 'LEAGUE_CANCEL_DEPOSITS' => '%s bet payments were cancelled.', + 'LEAGUE_CANCEL_PAY' => '%s profit payment was cancelled.', + 'LEAGUE_CANCEL_PAYS' => '%s profit payments were cancelled.', + 'LEAGUE_CARRYOVER_PAY' => '%s share in the profits was transferred as a payment into the new season.', + 'LEAGUE_CARRYOVER_PAYS' => '%s Shares in the profits were transferred as a payment into the new season.', + 'LEAGUE_DELETE_WIN' => '%s win was deleted.', + 'LEAGUE_DELETE_WINS' => '%s wins were deleted.', + 'LEAGUE_DEPOSIT' => '%s bet was booked.', + 'LEAGUE_DEPOSITS' => '%s bets were booked.', + 'LEAGUE_NAME' => 'Leaguename', + 'LEAGUE_PAY' => '%s profit was paid.', + 'LEAGUE_PAYS' => '%s profits were paid.', + 'MEMBER_BET' => 'Bet book', + 'MEMBER_CANCEL_BET' => 'Bet cancel', + 'MEMBER_CANCEL_DEPOSITED' => 'Bet payments cancel', + 'MEMBER_CANCEL_PAID' => 'Profit payments cancel', + 'MEMBER_CARRYOVER_PAID' => 'Payment in the next season', + 'MEMBER_DELETE_WINS' => 'Delete wins', + 'MEMBER_DEPOSITED' => 'Bet payment book', + 'MEMBER_PAID' => 'Profit payment book', + 'NO_LEAGUE' => 'No league given.', + 'NO_LEAGUES_SELECTED' => 'No league was chosen.', + 'NO_MEMBERS_SELECTED' => 'No member was selected, or the elective member is not known.', + 'NO_SEASON' => 'There exists no season. Please, first a season provide.', + 'NO_VALID_CALL' => 'Illegal call! The action is canceled.', + 'PAID' => 'Paid', + 'PAY_WINS' => 'Pay profits', + 'PAY_WINS_EXPLAIN' => 'Here you can pay profits or partial profits or transfer as an application into the next season. By settlement in Ultimate Points, the balance UP is loaded accordingly.', + 'SELECT_SEASON' => 'Select season', + 'SET_DEPOSITS' => 'Calculate deposits', + 'WINS' => 'Wins', +)); diff --git a/language/en/info_acp_bets.php b/language/en/info_acp_bets.php new file mode 100644 index 0000000..3fb1282 --- /dev/null +++ b/language/en/info_acp_bets.php @@ -0,0 +1,45 @@ + 'Bets', + 'ACP_FOOTBALL_BETS_MANAGE' => 'Edit bets', + 'ACP_FOOTBALL_BETS_MANAGE_EXPLAIN' => 'Here you can edit all bets of all users.', + 'ACP_FOOTBALL_BETS_MANAGEMENT' => 'Bets management', + 'SELECT_MATCHDAY' => 'Select matchday', +)); diff --git a/language/en/info_acp_extra.php b/language/en/info_acp_extra.php new file mode 100644 index 0000000..3056849 --- /dev/null +++ b/language/en/info_acp_extra.php @@ -0,0 +1,85 @@ + 'Special tips', + 'ACP_FOOTBALL_EXTRA_MANAGE' => 'Manage special tips', + 'ACP_FOOTBALL_EXTRA_MANAGE_EXPLAIN' => 'Here you can assign special tips to matchdays of a league. You can extinguish passing ones or change or provide a new special tip, as well as type, evaluation, points and the end time point of the special tips put.', + 'ACP_FOOTBALL_EXTRA_MANAGEMENT' => 'Special tips', + 'EVAL_BEFORE_DELIVERY' => 'The evaluation matchday may not lie before the delivery matchday.', + 'EXTRA_ADD' => 'Add Special tip', + 'EXTRA_ADDED' => 'Special tip successfully added.', + 'EXTRA_CONFIRM_DELETE' => 'Are you certainly, that you the special tip "%1$s" in %2$s. League from the season %3$s with all tips wants to extinguish?', + 'EXTRA_CREATE_FAILED' => 'Special tips could not be provided.', + 'EXTRA_DEF' => 'Existing Special tips', + 'EXTRA_DEF_EXPLAIN' => 'These are special tips which were provided by you or another administrator. You can change or delete them.', + 'EXTRA_DELETED' => 'Special tips deleted', + 'EXTRA_DETAILS' => 'Special tips data', + 'EXTRA_MATCHDAY' => 'Delivery', + 'EXTRA_MATCHDAY_EVAL' => 'Evaluation', + 'EXTRA_MATCHDAY_EVAL_EXPLAIN' => 'The result of the special tip is given in this matchday. With different matchdays for delivery and result the points of the whole evaluation are added, but they flow in onto the matchday evaluation with.', + 'EXTRA_MATCHDAY_EXPLAIN' => 'The tip delivery of the special tip is closed with the first term for filing of this matchday.', + 'EXTRA_NO' => 'Number', + 'EXTRA_NO_DELETE' => 'You may extinguish no special tips. Only foundation members are allowed to do this', + 'EXTRA_POINTS' => 'Possible points', + 'EXTRA_POINTS_EXPLAIN' => 'At most points to be reached in dependence to the point mode.', + 'EXTRA_QUESTION' => 'Special tip question', + 'EXTRA_QUESTION_EXPLAIN' => 'More freely interrogative text. Please, formulate an exact, unequivocal question to the deposited interrogative type.', + 'EXTRA_QUESTION_TYPE' => 'Questiontype.', + 'EXTRA_QUESTION_TYPE_EXPLAIN' => '1 = choice of a team, points only with correspondence
2 = choice of a team several results, points with a hit
3 = text input, points with correspondence
4 = text input, however, several results, points with a hit
5 = number, points abzgl. of the difference between tip and result', + 'EXTRA_STATUS' => 'Status', + 'EXTRA_STATUS_EXPLAIN' => '0 = openly (tip delivery possibly)
1 = no more tip delivery possibly and still no results
2 = temporary results lie before
3 = concluded, final results are.', + 'EXTRA_UPDATE_FAILED' => 'The special tip settings could not be updated.', + 'EXTRA_UPDATED' => 'Special tip settings updates successfully.', + 'LEAGUE' => 'League', + 'MATCHDAY' => 'Matchday', + 'NO_EXTRA' => 'The selected special tip does not exist. Please, provide first a special tip in this league of the season.', + 'NO_EXTRA_CREATED' => 'No special tips were provided up to now.', + 'NO_LEAGUE' => 'The se楣ted league does not exist in the season %1$s. Please, provide first a league in the season %1$s.', + 'NO_SEASON' => 'The selected season does not exist. Please, first a season provide.', + 'QUESTION_TYPE' => 'Questiontype', + 'SEASON' => 'Season', + 'SELECT_LEAGUE' => 'Select League', + 'SELECT_MATCHDAY' => 'Select Matchday', + 'TOO_LARGE_EXTRA_POINTS' => 'The score for the special tip is too large. Permits: 0-99', + 'TOO_LARGE_MATCHDAY' => 'You must choose a delivery matchday.', + 'TOO_LARGE_MATCHDAY_EVAL' => 'You must choose an evaluation matchday.', + 'TOO_SMALL_EXTRA_POINTS' => 'The score for the special tip is too small. Permits: 0-99', + 'TOO_SMALL_MATCHDAY' => 'You must choose a delivery matchday.', + 'TOO_SMALL_MATCHDAY_EVAL' => 'You must choose an evaluation matchday.', +)); diff --git a/language/en/info_acp_football.php b/language/en/info_acp_football.php new file mode 100644 index 0000000..802e8f2 --- /dev/null +++ b/language/en/info_acp_football.php @@ -0,0 +1,156 @@ + 'Football', + 'ACP_FOOTBALL_MANAGEMENT' => 'Manage Prediction League', + 'ACP_FOOTBALL_OPERATION' => 'Match operations', + 'ACP_FOOTBALL_MANAGE' => 'Manage fixture list', + 'ACP_FOOTBALL_CONFIGURATION' => 'Prediction League configuration', + 'ACP_FOOTBALL_SETTINGS' => 'Prediction League settings', + 'ACP_FOOTBALL_SETTINGS_EXPLAIN' => 'Here you can carry out some basic settings of the Prediction League, give it a suitable name and description and define a football side announcement and other values. ', + 'DISABLE_FOOTBALL' => 'Deactivate Prediction League', + 'DISABLE_FOOTBALL_EXPLAIN' => 'You can disable the Prediction League for all users. If you wanted, you can display a short message (up to 255 signs). ', + 'DISPLAY_RANKS' => 'Number of indicated User in total ranking', + 'DISPLAY_RANKS_EXPLAIN' => 'Announcement of users in the ranking lists. The ownrank is suspended if necessary below. ', + 'FOOTBALL_CODE' => 'Prediction League Code', + 'FOOTBALL_CODE_EXPLAIN' => 'Access code to the Prediction League, e.g., for cronjobs. ', + 'FOOTBALL_FULLSCREEN' => 'Prediction League pages in fullscreen mode', + 'FOOTBALL_FULLSCREEN_EXPLAIN' => 'Herewith you can, unlike the forum, display Prediction League pages with minimal margins. ', + 'FOOTBALL_HEADER_ENABLE' => 'Use header image per league', + 'FOOTBALL_HEADER_ENABLE_EXPLAIN' => 'Hereby you can define whether each league the associated image to be displayed in the header. ', + 'FOOTBALL_INFO' => 'Show Prediction Leagues information', + 'FOOTBALL_INFO_EXPLAIN' => 'Here you can switch on short information (up to 255 signs) above the phpBB3 Football sides. ', + 'FOOTBALL_NAME' => 'Name of the Prediction League', + 'FOOTBALL_NAME_EXPLAIN' => 'Name used in the Prediction League-menu, as link to Prediction League home side. ', + 'FOOTBALL_OVERRIDE_STYLE' => 'Override style', + 'FOOTBALL_OVERRIDE_STYLE_EXPLAIN' => 'Replaces style in Prediction League with the default Prediction League style. ', + 'FOOTBALL_MENU' => ' Show Prediction League menu', + 'FOOTBALL_MENU_EXPLAIN' => 'Display the Prediction League dropdown menu in the navigation bar? ', + 'FOOTBALL_STYLE' => 'Default Prediction League style', + 'FOOTBALL_UPDATE_SOURCE' => 'Link to the update source', + 'FOOTBALL_UPDATE_SOURCE_EXPLAIN' => 'Update link. If empty, http://football.bplaced.net/football/xml/football_xml_season.php is automatically selected. ', + 'FOOTBALL_UPDATE_CODE' => 'Update Code', + 'FOOTBALL_UPDATE_CODE_EXPLAIN' => 'Only with this code, updates can be downloaded from this page. ', + 'GUEST_VIEW' => 'Prediction League for guests visible', + 'GUEST_VIEW_EXPLAIN' => 'Should guests be able to see the Prediction League?', + 'USER_VIEW' => 'Prediction League only for participants visible', + 'USER_VIEW_EXPLAIN' => 'Should the Prediction League only to participants be visible?', + 'HOST_TIMEZONE' => 'Host Timezone', + 'HOST_TIMEZONE_EXPLAIN' => 'Difference to the Board time zone if your Host in another time zone stands, so that the tip delivery correctly functions. ', + 'LEFT_COLUMN' => 'Left column width in pixels', + 'LEFT_COLUMN_EXPLAIN' => 'Optimum width 180 pixels. This value should not be fell short. ', + 'PREDICTION_LEAGUE' => 'Prediction League', + 'RIGHT_COLUMN' => 'Right column width in pixels', + 'RIGHT_COLUMN_EXPLAIN' => 'Optimally 180 pixels. This value is redifined by external insertions if necessary. ', + 'USERS_PAGE' => 'User per side', + 'USERS_PAGE_EXPLAIN' => 'Number of Users displayed in ranking list and all bets. ', + 'WIN_NAME' => 'Win', + 'WIN_NAME_EXPLAIN' => 'The name or currency you want to disaply for the wins in the Prediction League', + 'ANNOUNCEMENT_TOPIC' => 'Release Announcement', + 'CURRENT_VERSION' => 'Current Version', + 'DOWNLOAD_LATEST' => 'Download Latest Version', + 'LATEST_VERSION' => 'Latest Version', + 'NOT_UP_TO_DATE' => '%s is not up to date', + 'RELEASE_ANNOUNCEMENT' => 'Annoucement Topic', + 'UP_TO_DATE' => '%s is up to date', + 'FOOTBALL_VERSION_CHECK' => 'Prediction League Extension Version Check', + 'ACP_FOOTBALL_FEATURES' => 'Prediction League features', + 'ACP_FOOTBALL_FEATURES_EXPLAIN' => 'Here you can activate some functions of the Prediction League or deactivate', + 'AUTO' => 'Automatic', + 'BANK' => 'Manage Prediction League account', + 'BANK_EXPLAIN' => 'Should Prediction League accounts be maintained with bets and profits?', + 'FOOTBALL_BREADCRUMB' => 'Show Prediction League breadcrumb', + 'FOOTBALL_BREADCRUMB_EXPLAIN' => 'Display a Breadcrumb-Link to Prediction League? ', + 'FOOTBALL_SEASON_START' => 'Start in season', + 'FOOTBALL_SEASON_START_EXPLAIN' => 'Start in this or in the auto-detected season if one is not already selected. ', + 'FOOTBALL_REMEMBER_ENABLE' => 'Enable cron job for Email reminder', + 'FOOTBALL_REMEMBER_ENABLE_EXPLAIN' => 'Here you can specify whether a reminder should be sent 1 day ago predictions.', + 'FOOTBALL_REMEMBER_NEXT_RUN' => 'Next Cronjoblauf for Email reminder', + 'FOOTBALL_REMEMBER_NEXT_RUN_EXPLAIN' => ' Here you can specify when the cron job for the Email reminder will be recalled. After running the cron job for the following day will be rescheduled on same hour.', + 'FOOTBALL_SIDE' => 'Display Prediction league sidebar', + 'FOOTBALL_SIDE_EXPLAIN' => 'Display the Prediction league side bar with the menu items? ', + 'FOUNDER_DELETE' => 'Only foundation members may remove', + 'FOUNDER_DELETE_EXPLAIN' => 'Remove of Prediction League data like seasons, leagues, teams, matchdays and schedules only to foundation members limit. ', + 'RESULTS_AT_TIME' => 'Input of final match results only after playing', + 'RESULTS_AT_TIME_EXPLAIN' => 'Release input of the final match results in the Adminbereich only after playing. The input of temporary match results by the users is independent from this. ', + 'SAME_ALLOWED' => 'All bets on a matchday immediately', + 'SAME_ALLOWED_EXPLAIN' => 'Identical bets (grannys tip) with all matches of a matchday permit or forbid. ', + 'ULT_POINTS' => 'Integrate Ultimate Points', + 'ULT_POINTS_EXPLAIN' => 'Should it be possible to let settle the points or profits in Ultimate Points? In addition Ultimate Points must be installed. ', + 'ULT_POINTS_FACTOR' => 'Ultimate Points Factor', + 'ULT_POINTS_FACTOR_EXPLAIN' => 'Factor on matchday points to be credit in Ultimate Points. ', + 'UP_NONE' => 'None', + 'UP_POINTS' => 'Points', + 'UP_WINS' => 'Wins', + 'VIEW_BETS' => 'Display bets immediately', + 'VIEW_BETS_EXPLAIN' => 'Should all bets be indicated immediately? If no, then they are indicated only after delivery end. ', + 'VIEW_CURRENT' => 'Display current league on start', + 'VIEW_CURRENT_EXPLAIN' => 'Display league with next game when no league selected? Otherwise starts on first league', + 'VIEW_TENDENCIES' => 'Display tendencies immediately', + 'VIEW_TENDENCIES_EXPLAIN' => 'Should alltendencies be indicated immediately? If no, then they are indicated only after delivery end. ', + 'WIN_HITS02' => 'Winnings direct hit evaluation with away points', + 'WIN_HITS02_EXPLAIN' => 'Should winnings of the direct hit evaluation with away points be indicated? If no, must be made sure that in addition no winnings were deposited in the existing leagues. ', + 'ACP_FOOTBALL_MENU' => 'Menu settings', + 'ACP_FOOTBALL_MENU_EXPLAIN' => 'Here you can deposit community references as a Menueinträge for the Prediction League menu. You can choose the Menutext, besides, freely, give another name aslo to the link to the community. ', + 'MENU_DESC1' => 'Caption Link 1', + 'MENU_DESC1_EXPLAIN' => 'The caption of the links may no impermissible special characters and be no greater than 20 characters long. ', + 'MENU_DESC2' => 'Caption Link 2', + 'MENU_DESC3' => 'Caption Link 3', + 'MENU_LINK1' => 'Http-Link 1', + 'MENU_LINK1_EXPLAIN' => 'Please enter http links here. ', + 'MENU_LINK2' => 'Http-Link 2', + 'MENU_LINK3' => 'Http-Link 3', + 'MENU_NO_LINK' => 'No community link deposits', + 'ACP_FOOTBALL_USERGUIDE' => 'Football guide', + 'ACP_FOOTBALL_USERGUIDE_EXPLAIN' => 'Hier findest du Hilfe für die Einstellungen des phpBB3 Football MODs.
Wenn du Fragen hast, dann schaue bitte immer zuerst hier!', + 'LOG_FOOTBALL_FEATURES' => 'Prediction League features changed', + 'LOG_FOOTBALL_MENU' => 'Prediction League menu changed', + 'LOG_FOOTBALL_SETTINGS' => 'Prediction League settings changed', + 'LOG_FOOTBALL_MSG_TEST' => 'Call on %s.', + 'LOG_FOOTBALL_MSG_TEST_TRAVEL' => 'Call with time travel to %s.', + 'LOG_FOOTBALL_REMEMBER_CRON' => 'Cronjob Football remember running %s', + 'LOG_FOOTBALL_REMEMBER_CRON_TEST' => 'Cronjob Football remember test call %s', + 'FOOTBALL_REMEMBER_SUBJECT' => 'Please bet %1$s %2$d. matchday', + 'FOOTBALL_REMEMBER_SUBJECT_BOARD' => 'Sent reminder mails %1$s %2$d', + 'FOOTBALL_REMEMBER_ERROR_EMAIL' => '%1$s reminder email to: %2$d failed', + 'FOOTBALL_REMEMBER_ERROR_EMAIL_BOARD' => '%1$s packing list reminder email to: %2$d failed', + 'FOOTBALL_REMEMBER_NOBODY' => ' Nobody needs to be reminded.', + 'FOOTBALL_REMEMBER_NO_DELIVERY' => 'No forthcoming predictions in the period.', + 'FOOTBALL_REMEMBER_SEND' => '%1$s reminder email to: %2$d', +)); diff --git a/language/en/info_acp_ko.php b/language/en/info_acp_ko.php new file mode 100644 index 0000000..568642d --- /dev/null +++ b/language/en/info_acp_ko.php @@ -0,0 +1,62 @@ + 'KO-winner', + 'ACP_FOOTBALL_KO_MANAGE' => 'Calculate KO-winner', + 'ACP_FOOTBALL_KO_MANAGE_EXPLAIN' => 'Here you can determine KO-round winners on matches or on table ranking and enable them for the next matchdays. Only these teams are selectable on next rounds. Also it is possibly to transferr teams depending on table ranks in another KO league.', + 'ACP_FOOTBALL_KO_MANAGEMENT' => 'KO-round management', + 'CHOOSE_LEAGUE' => 'Select league', + 'ERROR_FROM_TO' => 'Error selecting from matchday. "From" may not lie after "to". ', + 'ERROR_TARGET' => 'Error selecting to matchday. The target matchday does not lie after the considered matchdays. ', + 'GROUP_RANK' => 'Qualifies up to table rank', + 'GROUP_RANK_EXPLAIN' => 'All teams up to this table rank qualify. ', + 'KO_GROUP' => 'Qualification on table rank', + 'KO_MATCHDAYS' => 'Considered Matchdays', + 'KO_MOVED' => 'The following teams were copied in another league', + 'KO_NEXT' => 'The following teams have reached the next round', + 'KO_NEXT_CHECK' => 'Please, check this teams, because not all rules are considered here. ', + 'MANAGE_GROUP' => 'Consider group ranking', + 'MATCHDAY_NEW' => 'The teams qualify till matchday', + 'MATCHDAY_TARGET' => 'Select target matchday', + 'MOVE_LEAGUE' => 'in league', + 'MOVE_RANK' => 'Transfer team on rank', + 'MOVE_RANK_EXPLAIN' => 'The teams on this rank are copied in the deposited league and are qualified up to given matchday. ', + 'NO_KO_NEXT' => 'No team was set to next round, because yet not all matches are played!', + 'PREDICTION_LEAGUE' => 'Prediction League', +)); diff --git a/language/en/info_acp_leagues.php b/language/en/info_acp_leagues.php new file mode 100644 index 0000000..b26a77e --- /dev/null +++ b/language/en/info_acp_leagues.php @@ -0,0 +1,141 @@ + 'Leagues', + 'ACP_FOOTBALL_LEAGUES_MANAGE' => 'Manage leagues', + 'ACP_FOOTBALL_LEAGUES_MANAGE_EXPLAIN' => 'Here you can administer all leagues. You can remove passing ones, change or create a new league, as well as edit type, number of the matchdays, wins, name and shortname of the league. ', + 'ACP_FOOTBALL_LEAGUES_MANAGEMENT' => 'Leagues management', + 'ADD_GROUP' => 'Add Group', + 'ADD_USERS' => 'Users add', + 'ADD_USERS_EXPLAIN' => 'Here you can add new User to the Prediction League. Please, give user names per line. ', + 'ALL_USERS' => 'All users', + 'BET_POINTS' => 'Bet', + 'BET_POINTS_EXPLAIN' => 'bet amount before season starts', + 'BET_TYPE_KO' => 'Bet on KO-Matches', + 'BET_TYPE_KO_EXPLAIN' => 'On which result should be bet with KO matches?', + 'CHECK_HIT_WINS' => 'Error win direct hit. Please, correct. ', + 'CHECK_HITS02_WINS' => 'Error win direct hit with away points. Please, correct. ', + 'CHECK_MATCHDAY_WINS' => 'Error wins matchday. Please, correct. ', + 'CHECK_RULES_POST_ID' => 'The contribution number with the rules must be deposited on entry by the user. ', + 'CHECK_SEASON_WINS' => 'Error seasonal wins. Please, correct. ', + 'CREATE_LEAGUE' => 'Create new league', + 'LEAGUE_BET_IN_TIME' => 'Bet delivery up to the respective match beginning', + 'LEAGUE_BET_IN_TIME_EXPLAIN' => 'May the User bet up to the respective match beginning, or should the bet delivery of all matches on a matchday be possible only up to (maximum three) appointments?', + 'LEAGUE_CHAMP' => 'Championship', + 'LEAGUE_CONFIRM_DELETE' => 'Are you sure that you want to remove %1$s from the season %2$s with all data (matchdays, match schedules, bets and rankings)?', + 'LEAGUE_CREATE_FAILED' => 'League could not be created. ', + 'LEAGUE_CREATED' => 'League successfully created. ', + 'LEAGUE_CURRENT' => 'Current league', + 'LEAGUE_DEF' => 'Existing leagues', + 'LEAGUE_DEF_EXPLAIN' => 'This are leagues which were created by you or another administrator. You can change league settings or remove leagues. ', + 'LEAGUE_DELETE' => 'Remove league', + 'LEAGUE_DELETED' => 'League removed', + 'LEAGUE_DETAILS' => 'League details', + 'LEAGUE_EDIT_EXPLAIN' => 'Here you can edit on an existing league. You can change type, number of the matchdays, wins, name and the short name. ', + 'LEAGUE_JOIN_BY_USER' => 'Register to this Prediction League by users', + 'LEAGUE_JOIN_BY_USER_EXPLAIN' => 'Should the forum users themselves be able to join to this Prediction League, or only administrators are allowed to do this?', + 'LEAGUE_JOIN_IN_SEASON' => 'Register to this Prediction League during the season', + 'LEAGUE_JOIN_IN_SEASON_EXPLAIN' => 'May the forum users join during the running season?', + 'LEAGUE_KO' => 'KO round', + 'LEAGUE_MATCHDAYS' => 'Number of the matchdays', + 'LEAGUE_MATCHDAYS_EMPTY' => 'The number of the matchdays is absent. ', + 'LEAGUE_MATCHDAYS_EXPLAIN' => 'With the calculation of the number of matchdays is to be considered that matches of different rounds can be summarised to a matchday, so that must not be typed on single or few matches. ', + 'LEAGUE_MATCHES' => 'Number of matches on matchday', + 'LEAGUE_MATCHES_EXPLAIN' => 'KO rounds with different number of matches on matchdays, is to be set here 0. ', + 'LEAGUE_MEMBERS' => 'Prediction League participant', + 'LEAGUE_NAME' => 'League name', + 'LEAGUE_NAME_EMPTY' => 'The league name must be long least 3 letters. ', + 'LEAGUE_NO_MEMBER' => 'The league has no Users', + 'LEAGUE_NUMBER' => 'The given league must be numerical. Please, give a league number from 1-99. ', + 'LEAGUE_POINTS' => 'Points Mode of this Prediction League', + 'LEAGUE_POINTS_DIFF' => 'Points correct goal difference', + 'LEAGUE_POINTS_DIFF_EXPLAIN' => 'Points for the correct goal difference. ', + 'LEAGUE_POINTS_HIT' => 'Points for a coorect result', + 'LEAGUE_POINTS_HIT_EXPLAIN' => 'Points if the bet with the result agrees. ', + 'LEAGUE_POINTS_LAST' => 'Points from last on if somebody did not bet', + 'LEAGUE_POINTS_LAST_EXPLAIN' => 'Should the user without bet automatically receive the points of the worst user? This can be, perhaps, also 0 points. ', + 'LEAGUE_POINTS_MODE' => 'Points Modus', + 'LEAGUE_POINTS_MODE_EXPLAIN' => '1 = direct hit points and with right trend ever to divergent gate a point less, however, mind. Trend points. With draw an only easy deduction with divergent gate.
2 = like 1 deduction nevertheless full with draw gate divergence.
3 = direct hit or trend points.
4 = direct hit points, difference points or trend points.
5 = like 4 without difference points on draw.
6 = direct hit and trend points; difference points on right draw trend. ', + 'LEAGUE_POINTS_TENDENCY' => 'Points with right trend', + 'LEAGUE_POINTS_TENDENCY_EXPLAIN' => 'Points or least points with right trend. ', + 'LEAGUE_RULES_POST_ID' => 'Contribution number with the rules', + 'LEAGUE_RULES_POST_ID_EXPLAIN' => 'Post-ID with the rules to this league-Prediction League. Contribution indicated will announce to the badge the Post-Id. ', + 'LEAGUE_SHORT' => 'League of short name', + 'LEAGUE_SHORT_EMPTY' => 'The short name is absent. ', + 'LEAGUE_SHORT_EXPLAIN' => '3-figure abbreviation, e.g., 1SHEET, 2SHEET, German Football Association, CENTILITRE or tablespoon to the identification of the league in the download file. ', + 'LEAGUE_TAKEN' => 'This league already exists in this season. Please, another league number selects. ', + 'LEAGUE_TYPE' => 'League type', + 'LEAGUE_TYPE_EXPLAIN' => 'With match rounds with the matches which are able to be decided on a lengthening KO round is to be chosen here, even if single matches of this round end after 90 minutes. ', + 'LEAGUE_UPDATE_FAILED' => 'League settings could not be updated. ', + 'LEAGUE_UPDATED' => 'Updates league settings successfully. ', + 'LEAGUE_USERS_ADD' => 'User to the league added. ', + 'LEAGUE_USERS_REMOVE' => 'User from the league remotely. ', + 'LEAGUE_WIN_EXPLAIN' => 'With the following profit fields the wins are rank by; to give apart. So 10.50; 5 for rank 1 = 10.50 euros and rank 2 = 5 euros', + 'LEAGUE_WIN_HITS' => 'Win of direct hit evaluation', + 'LEAGUE_WIN_HITS_AWAY' => 'Win direct hit evaluation with away points', + 'LEAGUE_WIN_HITS_AWAY_EXPLAIN' => 'Win in euro for the first-placed of the direct hit evaluation with those the away team has dotted. ', + 'LEAGUE_WIN_HITS_EXPLAIN' => 'Win in euro for the first-placed of the direct hit evaluation. ', + 'LEAGUE_WIN_MATCHDAYS' => 'Profits matchday', + 'LEAGUE_WIN_MATCHDAYS_EXPLAIN' => 'Order wins matchday. ', + 'LEAGUE_WIN_SEASON' => 'Profits of season', + 'LEAGUE_WIN_SEASON_EXPLAIN' => 'Unique order wins at the end of the season. ', + 'LEAGUE_WINS' => 'League of wins', + 'LEAGUES_NO_DELETE' => 'You may remove no league. Only foundation members are allowed to do this', + 'LEAGUES_NO_TEAM' => 'This league has no Teams', + 'MEMBER' => 'User', + 'MEMBER_ALL' => 'All active Boardmitglieder take up', + 'MEMBER_CONFIRM_DELETE' => 'Are you sure that you want to remove the elective User from the Prediction League %1$s of the season %2$s with all data (bet and rank places)?', + 'MEMBER_DELETE' => 'User from league remove', + 'MEMBER_EXISTS' => 'This User is already a participant of this league-Prediction League. ', + 'MEMBER_EXPLAIN' => 'This is a list all User of this league. From here you can put who should be User of this league. ', + 'NO_LEAGUE' => 'No league given. ', + 'NO_LEAGUES_CREATED' => 'No leagues were created up to now. ', + 'NO_MATCHDAYS_KO' => 'With a KO round only the matchdays must be grasped before users of the Prediction League can join. ', + 'NO_MEMBERS_SELECTED' => 'No member was selected, or the elective member is not known. ', + 'NO_SEASON' => 'There exists no season. Please, first a season create. ', + 'SELECT_SEASON' => 'Season select', + 'TOO_LARGE_LEAGUE' => 'The value of the league is too big. These are only leagues between 1 - 99 possibly. ', + 'TOO_LARGE_LEAGUE_MATCHDAYS' => 'The number of the matchdays is too big. She must lie between 1 and 99. ', + 'TOO_LARGE_LEAGUE_MATCHES' => 'The number of the matches matchday is too big. She must lie between 0 and 99. ', + 'TOO_SHORT_LEAGUE_SHORT' => 'The short name of the league must be long to least 1 signs. ', + 'TOO_SHORT_SEASON' => 'The league name must be long to least 2 signs. ', + 'TOO_SMALL_LEAGUE' => 'The value of the league is too small. These are only leagues between 1 - 99 possibly. ', + 'TOO_SMALL_LEAGUE_MATCHDAYS' => 'The number of the matchdays is too small. She must lie between 1 and 99. ', + 'TOO_SMALL_LEAGUE_MATCHES' => 'The number of the matches matchday is too small. She must lie between 0 and 99. ', +)); diff --git a/language/en/info_acp_matchdays.php b/language/en/info_acp_matchdays.php new file mode 100644 index 0000000..131956b --- /dev/null +++ b/language/en/info_acp_matchdays.php @@ -0,0 +1,112 @@ + 'Matchdays', + 'ACP_FOOTBALL_MATCHDAYS_MANAGE' => 'Manage matchdays', + 'ACP_FOOTBALL_MATCHDAYS_MANAGE_EXPLAIN' => 'Here you can assign league matchdays of a season. You can remove passing ones or change or create a new matchday, as well as type, number of the matchdays, wins, name and Kurzbezeichnug the matchday put.', + 'ACP_FOOTBALL_MATCHDAYS_MANAGEMENT' => 'Matchdays management', + 'ADD_MATCHDAY' => 'Matchday to the league add', + 'BACKWARD_DELIVERY' => 'Select Period', + 'BACKWARD_DELIVERY_EXPLAIN' => 'Period of delivery before the first game starts.', + 'CHANGE_DELIVERY' => 'Change Delivery', + 'CHANGE_DELIVERY_EXPLAIN' => 'Here you can set new delivery dates for future matchdays according to the first kick off. However, this is no automatic transfer for future matches. With Period 0 you can check whether a deadline is after the first kick off, and correct it accordingly. If a uniform deadline be set, this function must be called multiple times with possibly different time periods to match the kick-off times.', + 'DELIVERY' => 'Abgabezeit', + 'DELIVERY_SET_TIME' => 'Abgabezeit vor dem ersten Spielbeginn', + 'DELIVERY_NUMBER' => 'Abgabe Nr.', + 'GENERATE_MATCHDAY' => 'Missing matchdays generate', + 'INVALID_DDAY1_DATE' => 'No valid deadline. ', + 'INVALID_DDAY2_DATE' => 'No valid 2nd deadline. ', + 'INVALID_DDAY3_DATE' => 'No valid 3rd deadline. ', + 'LEAGUE' => 'League', + 'MATCHDAY' => 'Matchday', + 'MATCHDAY_ADDED' => 'Matchday successfully added. ', + 'MATCHDAY_CONFIRM_DELETE' => 'If you are sure, that you %1$s. Matchday from the season %2$s with all data (programme and bets) wants to remove?', + 'MATCHDAY_CONFIRM_REMOVE' => 'Are you sure that you want to extinguish all superfluous matchdays from the season %1$s with all data (program and tips)?', + 'MATCHDAY_CREATE_FAILED' => 'Matchday could not be created. ', + 'MATCHDAY_CREATED' => '%1$s matchday was created successfully. ', + 'MATCHDAY_CURRENT' => 'Topical matchday', + 'MATCHDAY_DEF' => 'Existing matchdays', + 'MATCHDAY_DEF_EXPLAIN' => 'This are matchdays which were created by you or another administrator. You can change matchday settings or remove matchdays. ', + 'MATCHDAY_DELETE' => 'Matchday remove', + 'MATCHDAY_DELETED' => 'Matchday removed', + 'MATCHDAY_DELIVERY' => 'Deadline', + 'MATCHDAY_DELIVERY_EXPLAIN' => 'Appointment in him the matchday or the next matches are closed and therefore no more bet delivery is possible. If the matchday was already closed (status 1), this can become by a future deadline again open. Other status crossings are possible only by input or extinguishing of the match results of this matchday.', + 'MATCHDAY_DELIVERY2' => '2nd deadline ', + 'MATCHDAY_DELIVERY2_EXPLAIN' => 'With the achievement of the first deadline this date is set as the next deadline for the next matches. ', + 'MATCHDAY_DELIVERY3' => '3rd deadline', + 'MATCHDAY_DELIVERY3_EXPLAIN' => 'With the achievement of the 2nd deadline this date is set as the next deadline for the next matches. ', + 'MATCHDAY_DETAILS' => 'Matchday data', + 'MATCHDAY_EDIT_EXPLAIN' => 'Here you can work on an existing matchday. You can change type, number of the matchdays, wins, name and the short name. ', + 'MATCHDAY_MATCHES' => 'Number of the matches on this matchday', + 'MATCHDAY_MATCHES_EXPLAIN' => 'With KO rounds the information of the number of the matches is necessary matchday compelling. ', + 'MATCHDAY_NAME' => 'Matchday name', + 'MATCHDAY_NAME_DOUBLE' => 'The matchday name is already used or was twice awarded. ', + 'MATCHDAY_NAME_EMPTY' => 'The matchday name must be long least 3 letters. ', + 'MATCHDAY_NUMBER' => 'The given matchday must be numerically (1-99). Please, give a matchday number. ', + 'MATCHDAY_STATUS' => 'Status', + 'MATCHDAY_STATUS_EXPLAIN' => '0 = openly (bet delivery possibly)
1 = no more bet delivery possibly and still no results
2 = temporary results lie before
3 = concluded, final results are given. ', + 'MATCHDAY_UPDATE_FAILED' => 'Matchday settings could not be updated. ', + 'MATCHDAY_UPDATED' => 'Updates matchday settings successfully. ', + 'MATCHDAYS_CREATED' => '%1$s matchdays were created successfully. ', + 'MATCHDAYS_NO_DELETE' => 'You may remove no matchday. Only foundation members are allowed to do this', + 'MATCHDAYS_REMOVED' => 'Superfluous matchdays extinguished', + 'NEW_DELIVERY' => 'New delivery', + 'NO_DELIVERIES_UPDATED' => 'There are no deliveries updated.', + 'NO_DELIVERY' => 'The deadline is absent. ', + 'NO_DELIVERY2' => 'The 2nd deadline is absent or the 3rd deadline must be removed. ', + 'NO_LEAGUE' => 'No league exists in the season %1$s. Please, create first a league in the season %1$s.', + 'NO_MATCHDAYS_CREATED' => 'No matchdays were created up to now. ', + 'NO_MORE_MATCHDAYS' => 'It was added no other matchdays.', + 'NO_SEASON' => 'There exists no season. Please, first a season create.', + 'OPEN_MATCH' => 'The match No. %s lies before the elective term for filing. Hence, the term for filing is not allowed.', + 'OPEN_MATCHES' => 'The matches No. %s lies before the elective term for filing. Hence, the term for filing is not allowed.', + 'PREDICTION_LEAGUE' => 'Prediction League', + 'REMOVE_MATCHDAYS' => 'Delete superfluous matchdays', + 'SEASON' => 'Season', + 'SELECT_LEAGUE' => 'Select league', + 'SHOW_DELIVERY' => 'Show deliveries', + 'TOO_LARGE_MATCHES' => 'The number of the matches matchday is too big. ', + 'TOO_SMALL_DELIVERY2' => 'The 2nd deadline may not lie before the 1st deadline. ', + 'TOO_SMALL_DELIVERY3' => 'The 3rd deadline may not lie before the 2nd deadline.', + 'TOO_SMALL_MATCHES' => 'The number of the matches matchday is too small. ', + 'UPDATE_DELIVER' => '%s delivery updated.', + 'UPDATE_DELIVERIES' => '%s deliveries updated.', + 'UPDATE_DELIVERY' => 'New deliveries', + 'UPDATE_DELIVERY_EXPLAIN' => 'Wähle die Datensätze aus, deren Abgabezeit neu gesetzt werden soll. Rot markierte Abgabezeiten liegen nach dem neu berechneten Abgabetermin.', +)); diff --git a/language/en/info_acp_matches.php b/language/en/info_acp_matches.php new file mode 100644 index 0000000..736e6b1 --- /dev/null +++ b/language/en/info_acp_matches.php @@ -0,0 +1,98 @@ + 'Match schedules', + 'ACP_FOOTBALL_MATCHES_MANAGE' => 'Manage match schedules', + 'ACP_FOOTBALL_MATCHES_MANAGE_EXPLAIN' => 'Here you can administer season and league programmes. You can add missing match mating to the programme and administer the match data of a matchday.', + 'ACP_FOOTBALL_MATCHES_MANAGEMENT' => 'Match schedules management', + 'DAY' => 'Day', + 'FORMULA_GUEST' => 'Formula Guest team', + 'FORMULA_GUEST_EXPLAIN' => 'See explanations formula Home team', + 'FORMULA_HOME' => 'Formula Home team', + 'FORMULA_HOME_EXPLAIN' => 'D = is still drawn lots
L 100 = loser match 100
W 100 = winner match 100
W 100; 101 = winner matches 100 and 101
G A1 = 1st group A', + 'GENERATE_MATCHES' => 'Complete match scaffolding', + 'INVALID_MDAY_DATE' => 'No valid match date. ', + 'KO' => 'KO', + 'LEAGUE' => 'League', + 'MATCH_BEFORE_DELIVERY' => 'The match beginning lies before the tip delivery of the matchday. This is not allowed.', + 'MATCH_BEGIN' => 'match beginning', + 'MATCH_CONFIRM_DELETE' => 'If you are sure, that you %1$s. match from %2$s season %3$s with all data (programme and bets) wants to remove?', + 'MATCH_CREATED' => '%1$s match mating was created successfully. ', + 'MATCH_DELETED' => 'match was removed successfully', + 'MATCH_DETAILS' => 'match data', + 'MATCH_EDIT_EXPLAIN' => 'Here you can work on an existing match mating. You can fix the appointment, the mating and a formula. ', + 'MATCH_GROUP' => 'Group match of the group', + 'MATCH_GUEST' => 'Guest', + 'MATCH_HOME' => 'Home', + 'MATCH_KO' => 'KO match', + 'MATCH_KO_EXPLAIN' => 'This match can lead to a Verlägerung or a overtime shoot-out. ', + 'MATCH_NUMBER' => 'match of No.', + 'MATCH_ODDS' => 'Odds', + 'MATCH_RATING' => 'Rating', + 'MATCH_STATUS' => 'Status', + 'MATCH_STATUS_EXPLAIN' => '-2 = match is closed in the 3rd deadline
-1 = match is closed in the 2nd deadline
0 = openly (bet delivery possibly), is closed in the deadline
1 = no more bet delivery possibly and still no result
2 = temporary result lies before
3 = final result is given.', + 'MATCH_UPDATE_FAILED' => 'match mating could not be updated. ', + 'MATCH_UPDATED' => 'match mating successfully updates. ', + 'MATCHDAY' => 'Matchday', + 'MATCHDAY_MISSED' => 'Before this action can be carried out, must be grasped the missing matchday. ', + 'MATCHES_CREATE_FAILED' => 'Programme could not be completed. ', + 'MATCHES_CREATED' => '%1$s match matings were created successfully. ', + 'MATCHES_DEF' => 'Available match matings', + 'MATCHES_DEF_EXPLAIN' => 'This are match matings which were created by you or another administrator. You can change the match matings or remove. ', + 'MATCHES_NO_DELETE' => 'You may remove no matches. Only foundation members are allowed to do this', + 'MONTH' => 'Month', + 'NO_LEAGUE' => 'No league exists in the season %1$s. Please, create first a league in the season %1$s. ', + 'NO_MATCH' => 'This match mating does not exist. ', + 'NO_MATCH_BEGIN' => 'The match beginning is absent. ', + 'NO_MATCHDAY' => 'No matchday exists in %1$s season %2$s. Please, first matchdays create. ', + 'NO_MATCHES_CREATED' => 'No match matings were deposited up to now. ', + 'NO_SEASON' => 'There exists no season. Please, first a season create. ', + 'ODD_1' => 'Home', + 'ODD_x' => 'Draw', + 'ODD_2' => 'Away', + 'PREDICTION_LEAGUE' => 'Prediction League', + 'SEASON' => 'Season', + 'SELECT_MATCHDAY' => 'Matchday choose', + 'TOO_LARGE_MATCH_BEGIN_H' => 'Hourly information with the match beginning too largely. ', + 'TOO_LARGE_MATCH_BEGIN_MIN' => 'Minute information with the match beginning too largely. ', + 'TOO_SMALL_MATCH_BEGIN_H' => 'Hourly information with the match beginning too small. ', + 'TOO_SMALL_MATCH_BEGIN_MIN' => 'Minute information with the match beginning too small. ', + 'UNKNOWN' => 'not yet famously', + 'YEAR' => 'Year', +)); diff --git a/language/en/info_acp_results.php b/language/en/info_acp_results.php new file mode 100644 index 0000000..f8ee555 --- /dev/null +++ b/language/en/info_acp_results.php @@ -0,0 +1,86 @@ + 'Match results', + 'ACP_FOOTBALL_RESULTS_MANAGE' => 'Manage match results', + 'ACP_FOOTBALL_RESULTS_MANAGE_EXPLAIN' => 'Here you can confirm match results, give, remove or take from the evaluation.', + 'ACP_FOOTBALL_RESULTS_MANAGEMENT' => 'Matcht results management', + 'ADVICE' => 'Advice', + 'BETS_AND_RANKS' => 'Bets and ranking lists', + 'DAY' => 'Day', + 'DELETE' => 'Remove', + 'DELETE_EXPLAIN' => 'Remove match result and status on 1 rank. ', + 'GUEST' => 'Guest', + 'HOME' => 'Home', + 'LEAGUE' => 'League', + 'MATCH_BEGIN' => 'match beginning', + 'MATCH_STATUS_TITLE' => '-2=match is closed in the 3rd deadline -1=match is closed in the 2nd deadline 0=open (bet delivery possibly), is closed in the deadline 1=keine bet delivery more possibly and still no result 2=vorläufiges result lies before 3=endgültiges result lies before 4-6 = like 1-3, nevertheless, without evaluation. ', + 'MATCHDAY' => 'Matchday', + 'MONTH' => 'Month', + 'NO_LEAGUE' => 'No league exists in the season %1$s. Please, create first a league in the season %1$s. ', + 'NO_MATCHDAY' => 'No matchday exists in %1$s season %2$s. Please, first matchdays create. ', + 'NO_MATCHES_CREATED' => 'No match matings were deposited up to now. ', + 'NO_SEASON' => 'There exists no season. Please, first a season create. ', + 'NO_VALUATION' => 'no evaluation', + 'NO_VALUATION_EXPLAIN' => 'Take match from the evaluation, because this was shifted or was manipulated. ', + 'NUMBER' => 'No.', + 'OVERTIME' => 'Overtime', + 'OVERTIME_EXPLAIN' => 'match result incl. overtime shoot-out. ', + 'PREDICTION_LEAGUE' => 'Prediction League', + 'RANKING' => 'Ranking list', + 'RESULT' => 'Ergebnis', + 'RESULT_DELETED' => '%1$s match result was removed. ', + 'RESULT_DETAILS' => 'match results', + 'RESULT_EXPLAIN' => 'match result after 90 minutes', + 'RESULT_NO_VALUATION' => '%1$s match was taken from the evaluation. ', + 'RESULT_SAVED' => '%1$s match result was stored. ', + 'RESULTS_DELETED' => '%1$s match results were removed. ', + 'RESULTS_NO_VALUATION' => '%1$s matches were taken from the evaluation. ', + 'RESULTS_SAVED' => '%1$s match results were stored. ', + 'SAVE' => 'Store', + 'SAVE_FAILED' => 'The match results could not be stored. ', + 'SEASON' => 'Season', + 'SELECT' => 'Choice', + 'SELECT_EXPLAIN' => 'Only the matches marked here are not evaluated / removed stored/. ', + 'SELECT_MATCHDAY' => 'Matchday choose', + 'SET_STATUS_TO' => 'The status of the matchday was put on %1$s', + 'STATUS' => 'Status', + 'VS' => 'Meeting', + 'YEAR' => 'Year', +)); diff --git a/language/en/info_acp_seasons.php b/language/en/info_acp_seasons.php new file mode 100644 index 0000000..d8a124a --- /dev/null +++ b/language/en/info_acp_seasons.php @@ -0,0 +1,79 @@ + 'Seasons', + 'ACP_FOOTBALL_SEASONS_MANAGE' => 'Manage Seasons', + 'ACP_FOOTBALL_SEASONS_MANAGE_EXPLAIN' => 'Here you can administer all seasons. You can remove passing ones or change or create a new season, as well as edit name and shortname of the season.', + 'ACP_FOOTBALL_SEASONS_MANAGEMENT' => 'Seasons management', + 'CREATE_SEASON' => 'Create new season', + 'LEAGUES' => 'Leagues', + 'NO_SEASON' => 'No season given.', + 'NO_SEASONS_CREATED' => 'No seasons were created up to now. ', + 'PREDICTION_LEAGUE' => 'Prediction League', + 'SEASON' => 'Season', + 'SEASON_CLOSED' => 'Unanimously', + 'SEASON_CONFIRM_DELETE' => 'Are you sure that you want to remove the season %1$s with all data (leagues, matchdays, match schedules, bets and ranking lists)?', + 'SEASON_CREATE_FAILED' => 'Season could not be created. ', + 'SEASON_CREATED' => 'Season successfully creates. ', + 'SEASON_CURRENT' => 'Topical season', + 'SEASON_DEF' => 'Existing seasons', + 'SEASON_DEF_EXPLAIN' => 'This are seasons which were created by you or another administrator. You can change seasonal settings or remove seasons. ', + 'SEASON_DELETE' => 'Season remove', + 'SEASON_DELETED' => 'Season removed', + 'SEASON_DETAILS' => 'Season details', + 'SEASON_EDIT_EXPLAIN' => 'Here you can work on an existing season. You can change her name and the short name. ', + 'SEASON_NAME' => 'Seasonal name', + 'SEASON_NAME_EMPTY' => 'The seasonal name is absent. He must be long to least 4 signs. ', + 'SEASON_NAME_EXPLAIN' => 'Long name of the season, e.g., "season 2010/2011"', + 'SEASON_NAME_TAKEN' => 'The given seasonal name is already used. Please, selects another. ', + 'SEASON_NUMBER' => 'The given season must be numerically (in 1963-2099). Please, the annual number, in that the season ends give. ', + 'SEASON_SHORT' => 'Season short name', + 'SEASON_SHORT_EMPTY' => 'The season short name is absent, she must be long to least 2 signs. ', + 'SEASON_SHORT_EXPLAIN' => 'Short name of the season which is indicated in the choice box. ', + 'SEASON_SHORT_TAKEN' => 'The given short name of the season is already used. Please, another selects. ', + 'SEASON_TAKEN' => 'This season already it exists. Please, another season selects. ', + 'SEASON_UPDATE_FAILED' => 'Seasonal settings could not be updated. ', + 'SEASON_UPDATED' => 'Updates seasonal settings successfully. ', + 'SEASONS_NO_DELETE' => 'You may remove no season. Only foundation members are allowed to do this', + 'SEASONS_NO_LEAGUE' => 'This season has no league', + 'TOO_LARGE_SEASON' => 'The value of the season is too big. Season of 1963 - in 2099 possibly. ', + 'TOO_SHORT_SEASON' => 'The seasonal name must be long to least 4 signs. ', + 'TOO_SHORT_SEASON_SHORT' => 'The season Short name must be long to least 2 signs. ', + 'TOO_SMALL_SEASON' => 'The value of the season is too small. Season of 1963 - in 2099 possibly.', +)); diff --git a/language/en/info_acp_teams.php b/language/en/info_acp_teams.php new file mode 100644 index 0000000..1b6d838 --- /dev/null +++ b/language/en/info_acp_teams.php @@ -0,0 +1,92 @@ + 'Teams', + 'ACP_FOOTBALL_TEAMS_MANAGE' => 'Manage teams', + 'ACP_FOOTBALL_TEAMS_MANAGE_EXPLAIN' => 'Here you can assign season teams of a league. You can remove passing ones or change or create a new team, as well as type, number of the matchdays, wins, name and Kurzbezeichnug of the team put. ', + 'ACP_FOOTBALL_TEAMS_MANAGEMENT' => 'Team management', + 'ADD_TEAM' => 'Add team to the league', + 'LEAGUE' => 'League', + 'MATCHDAY' => 'Matchday', + 'NEW_TEAM' => 'New team', + 'NO_LEAGUE' => 'No league exists in the season %1$s. Please, create first a league in the season %1$s. ', + 'NO_MATCHDAYS' => 'Please, first matchdays put in, because the teams must be assigned with KO rounds a matchday. ', + 'NO_SEASON' => 'There exists no season. Please, first a season create. ', + 'NO_TEAM' => 'No team given. ', + 'NO_TEAMS_CREATED' => 'No teams were created up to now. ', + 'NO_TEAMSYMBOL' => 'No logo', + 'PREDICTION_LEAGUE' => 'Prediction League', + 'SEASON' => 'Season', + 'SELECT_LEAGUE' => 'Select league', + 'TEAM' => 'Team', + 'TEAM_ADDED' => 'Team successfully added. ', + 'TEAM_AWAY' => 'Away', + 'TEAM_CONFIRM_DELETE' => 'If you are sure, that you %1$s from season: %2$s league: %3$s with all data (matchdays, match schedules and bets) would like to remove?', + 'TEAM_CREATE_FAILED' => 'Team could not be created. ', + 'TEAM_CREATED' => 'Team successfully creates. ', + 'TEAM_CURRENT' => 'Topical team', + 'TEAM_DEF' => 'Existing Teams', + 'TEAM_DEF_EXPLAIN' => 'This are teams which were created by you or another administrator. You can change team settings or remove teams. ', + 'TEAM_DELETE' => 'Remove team', + 'TEAM_DELETED' => 'Team removed', + 'TEAM_DETAILS' => 'Team data', + 'TEAM_EDIT_EXPLAIN' => 'Here you can work on an existing team. You can change the name, the team-short name as well as the team coat of arms. ', + 'TEAM_GROUP' => 'Group matches in group', + 'TEAM_GROUP_EXPLAIN' => 'Letter of the group in which the group matches are denied. ', + 'TEAM_MATCHES' => 'Matches', + 'TEAM_NAME' => 'Team name', + 'TEAM_NAME_DOUBLE' => 'The team name is already used or was twice awarded. ', + 'TEAM_NUMBER' => 'This is no valid team number. The team number must lie between 0 and 65535. ', + 'TEAM_ROUND' => 'Qualifies till matchday', + 'TEAM_ROUND_EXPLAIN' => 'Matchday up to itself the team for the time being has qualified. About this parametre only the teams are offered by the programme production for the choice who have also qualified for the net-speaking round. About the menu point Qualification this value can be automatically put after ending of the round automatically for all certified teams. ', + 'TEAM_SHORT' => 'Team short name', + 'TEAM_SHORT_DOUBLE' => 'The short name is already used or was twice awarded. ', + 'TEAM_SHORT_EXPLAIN' => 'Maximum 10 figure short name of the team. This is used, e.g., with the export and under all bets. ', + 'TEAM_SYMBOL' => 'Team coats of arms', + 'TEAM_SYMBOL_EXPLAIN' => 'The optional team coat of arms must be 28x28 pixels. ', + 'TEAM_TAKEN' => 'This team already exists in this league. Please, another team number selects. ', + 'TEAM_UPDATE_FAILED' => 'Team settings could not be updated. ', + 'TEAM_UPDATED' => 'Updates team settings successfully. ', + 'TEAMS_NO_DELETE' => 'You may remove no team. Only foundation members are allowed to do this', + 'TOO_LARGE_TEAM' => 'The given Team-ID must be numerically (1-9999). Please, give a smaller team number. ', + 'TOO_SHORT_TEAM_NAME' => 'The team name must be long to least 3 signs. ', + 'TOO_SHORT_TEAM_SHORT' => 'The short name must be long to least 1 signs. ', + 'TOO_SMALL_TEAM' => 'The given Team-ID must be numerically (1-9999). Please, give a bigger team number. ', + 'WRONG_DATA_TEAM_GROUP' => 'No valid group for the group matches. Valid groups are A-Z.', +)); diff --git a/language/en/info_acp_update.php b/language/en/info_acp_update.php new file mode 100644 index 0000000..b0c3f15 --- /dev/null +++ b/language/en/info_acp_update.php @@ -0,0 +1,123 @@ + 'Update fixture lists', + 'ACP_FOOTBALL_UPDATE_MANAGE' => 'Update fixture lists', + 'ACP_FOOTBALL_UPDATE_MANAGE_EXPLAIN' => 'Here you can update fixture lists with data from the demo page or another Football Extension site. First, choose a league of the source site that sent the update. After selecting the destination league you get differences between this league and the update displayed and can choose the changes you want to be updated. If you want to create a new league, all data is transferred. ', + 'ACP_FOOTBALL_UPDATE_MANAGEMENT' => 'Update fixture lists', + 'ALLOW_URL_FOPEN' => 'The PHP-setting allow_url_fopen does not allow access to other sites.
You have to download xml update-files and save them in root/store. ', + 'CHOOSE_LEAGUES' => 'Select source and target fixture list', + 'CHOOSE_OTHER_LEAGUE' => 'Select other fixture list', + 'COMPARE_UPDATE' => 'Compare with database', + 'CURRENT_VALUE' => 'Current database value', + 'DB_INSERT_SEASON' => '%s season inserted. ', + 'DB_INSERT_LEAGUE' => '%s league inserted. ', + 'DB_INSERT_MATCHDAY' => '%s matchday inserted. ', + 'DB_INSERT_MATCHDAYS' => '%s matchdays inserted. ', + 'DB_INSERT_TEAM' => '%s team inserted. ', + 'DB_INSERT_TEAMS' => '%s teams inserted. ', + 'DB_INSERT_MATCH' => '%s match inserted. ', + 'DB_INSERT_MATCHES' => '%s matches inserted. ', + 'DB_UPDATE_BIT_DELIVER' => '%s matchday delivery in league with bet in time is set. ', + 'DB_UPDATE_BIT_DELIVERIES' => '%s matchday deliveries in league with bet in time is set. ', + 'DB_UPDATE_DELIVER' => 'Matchday delivery on matchday %s is newly set. ', + 'DB_UPDATE_DELIVERIES' => 'Matchday deliveries on matchdays %s were newly set. ', + 'DB_UPDATE_MATCHDAY' => '%s matchday updated. ', + 'DB_UPDATE_MATCHDAYS' => '%s matchdays updated. ', + 'DB_UPDATE_TEAM' => '%s team updated. ', + 'DB_UPDATE_TEAMS' => '%s teams updated. ', + 'DB_UPDATE_MATCH' => '%s match updated. ', + 'DB_UPDATE_MATCHES' => '%s matches updated. ', + 'DB_UPDATE_STATUS_MATCHDAY' => 'New status is set on %s matchday. ', + 'DB_UPDATE_STATUS_MATCHDAYS' => 'New status were set on %s matchdays. ', + 'DUPLICATE_TEAM' => 'This Team-ID is set twice. ', + 'ERROR_OPEN_LEAGUE_XML' => 'Error! The league XML-file could not be opened. Please check the link. ', + 'ERROR_OPEN_SEASON_XML' => 'Error! The season XML-file could not be opened. Please check the link. ', + 'ERROR_READ_LEAGUE_XML' => 'Error! The league XML-file could not be read. Bitte den Code oder die XML-Datei überprüfen', + 'ERROR_READ_SEASON_XML' => 'Error! The season XML-file could not be read. Please check the code. ', + 'ERROR_LOAD_LEAGUE_XML' => 'Error! The league XML-file could not be read. Please check the file %s. ', + 'ERROR_XML_CODE' => 'Wrong Code! To display the XML-file, you have to append the correct code. ', + 'ERROR_XML_CREATE' => 'Error! Unable to create the XML-file. ', + 'INSERT_LEAGUE' => 'Insert new league', + 'INSERT_MATCHDAYS' => 'Insert matchdays', + 'INSERT_MATCHES' => 'Insert matches', + 'INSERT_SEASON' => 'Insert new season', + 'INSERT_TEAMS' => 'Insert new teams', + 'LEAGUE_SHORTCUT' => 'League shortcut', + 'LOAD' => 'load', + 'MAP_TEAMS' => 'Map teams', + 'MATCH_OF_GROUP' => 'Match on group', + 'MATCHES' => 'Matches', + 'MISMATCH_LEAGUE_TYPE' => 'Leaguetype (%s) source fixture list does not fit the existing league.', + 'MISMATCH_MATCHDAYS' => 'The number of rounds (%s) of the source fixture list does not fit the existing league.', + 'MISMATCH_DB_MATCHDAYS' => 'The number of rounds (%s) in the database does not fit the existing league.', + 'MISMATCH_MATCHES' => 'The number of matches (%s) of the source fixture list does not fit the existing league.', + 'MISMATCH_DB_MATCHES' => 'The number of matches (%s) in the database does not fit the existing league.', + 'MISMATCH_MOM' => 'The number of matchday-matches (%s) of the source fixture list does not fit the existing league.', + 'MISSING_TEAMS' => 'The following team IDs must still be assigned: %s', + 'NEW_LEAGUE' => 'New league', + 'NEW_LEAGUE_EXIST' => 'The new league %s already exists. ', + 'NEW_LEAGUE_EXPLAIN' => 'For a new league please indicate here the league number. For an existing league this league number may not be overwritten, otherwise any existing league will be updated. ', + 'NEW_TEAM' => 'New team to be inserted', + 'NO_DB_CHANGES' => 'There have been no changes. ', + 'NO_DIFFERENCES' => 'No differences found. The fixture lists are identical. ', + 'NO_XML_LEAGUE' => 'No update-files found on root/store. ', + 'NO_XML_SEASON' => 'No update-source found. ', + 'NO_XML_ARRAY' => 'Error! Data not available. Please repeat the action again. ', + 'OTHER_FIELDS' => 'Other fields', + 'PREDICTION_LEAGUE' => 'Prediction League', + 'SEASON' => 'Season', + 'SELECT_EXPLAIN' => 'Only the selected records will be taken over here', + 'SHOW_UPDATE' => 'Show new league', + 'SOURCE' => 'Source', + 'TARGET' => 'Target', + 'TEAM_MAPPING' => 'Team mapping', + 'TEAM_NAME_SHORT' => 'Shortname', + 'TRANSFER_TEAM' => 'Transfer team', + 'UPDATE_LEAGUE' => 'Update league', + 'UPDATE_MATCHDAYS' => 'Update matchdays', + 'UPDATE_MATCHES' => 'Update matches', + 'UPDATE_ONLY_FINAL' => 'Take over only final results', + 'UPDATE_SAME_STATUS' => 'Update results with same status', + 'UPDATE_NEG_STATUS' => 'Take over negative status', + 'UPDATE_TEAMS' => 'Update teams', + 'UPDATE_THIS' => 'Take over changes in this field', + 'XML_SEASON_URL' => 'URL for the update source', + 'XML_SEASON_URL_EXPLAIN' => 'URL to football_xml_season.php or localhost. In case of localhost league_* files will be searched on root/store. ', +)); diff --git a/language/en/permissions_football.php b/language/en/permissions_football.php new file mode 100644 index 0000000..1a7022d --- /dev/null +++ b/language/en/permissions_football.php @@ -0,0 +1,50 @@ + 'FOOTBALL', + 'ACL_U_USE_FOOTBALL' => 'Can use Prediction League', + 'ACL_A_FOOTBALL_CONFIG' => 'Can change Prediction League settings', + 'ACL_A_FOOTBALL_DELETE' => 'Can remove match schedules', + 'ACL_A_FOOTBALL_EDITBETS' => 'Can edit all bets', + 'ACL_A_FOOTBALL_PLAN' => 'Can create and edit match schedules', + 'ACL_A_FOOTBALL_RESULTS' => 'Can edit final match results', + 'ACL_A_FOOTBALL_POINTS' => 'Can edit Football accounts', + 'ROLE_ADMIN_FOOTBALL' => 'Prediction League administrator', + 'ROLE_DESCRIPTION_ADMIN_FOOTBALL' => 'Can edit final match results.', +)); diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..3912109 --- /dev/null +++ b/license.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/migrations/profilefield_footb_email.php b/migrations/profilefield_footb_email.php new file mode 100644 index 0000000..33588aa --- /dev/null +++ b/migrations/profilefield_footb_email.php @@ -0,0 +1,93 @@ +db->sql_query($sql); + $field_count = (int) $this->db->sql_fetchfield('field_count'); + $this->db->sql_freeresult($result); + + // Skip migration if custom profile field exist + return $field_count; + } + + static public function depends_on() + { + return array('\football\football\migrations\v094_beta'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + ); + } + + protected $profilefield_name = 'footb_email'; + protected $profilefield_database_type = array('VCHAR', ''); + protected $profilefield_data = array( + 'field_name' => 'footb_email', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'footb_email', + 'field_length' => 30, + 'field_minlen' => 0, + 'field_maxlen' => 100, + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 1, + 'field_show_on_pm' => 0, + 'field_show_on_vt' => 0, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + ); + + public function create_custom_field() + { + parent::create_custom_field(); + $lang_name = (strpos($this->profilefield_name, 'phpbb_') === 0) ? strtoupper(substr($this->profilefield_name, 6)) : strtoupper($this->profilefield_name); + $lang_update = array( + 'lang_explain' => $lang_name . '_EXPLAIN', + ); + $sql = 'SELECT field_id + FROM ' . PROFILE_FIELDS_TABLE . ' + WHERE field_ident = "' . $this->profilefield_data['field_ident'] . '"'; + $result = $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_fetchfield('field_id'); + $this->db->sql_freeresult($result); + $this->db->sql_transaction('begin'); + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) + { + $sql = 'UPDATE ' . PROFILE_LANG_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $lang_update) . ' + WHERE field_id = ' . $field_id; + $this->db->sql_query($sql); + } + $this->db->sql_freeresult($result); + $this->db->sql_transaction('commit'); + } +} \ No newline at end of file diff --git a/migrations/profilefield_footb_rem_f.php b/migrations/profilefield_footb_rem_f.php new file mode 100644 index 0000000..fb574dd --- /dev/null +++ b/migrations/profilefield_footb_rem_f.php @@ -0,0 +1,140 @@ +db->sql_query($sql); + $field_count = (int) $this->db->sql_fetchfield('field_count'); + $this->db->sql_freeresult($result); + + // Skip migration if custom profile field exist + return $field_count; + } + + static public function depends_on() + { + return array('\football\football\migrations\v094_beta'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + array('custom', array(array($this, 'create_language_entries'))), + ); + } + + protected $profilefield_name = 'footb_rem_f'; + protected $profilefield_database_type = array('UINT:2', 2); + protected $profilefield_data = array( + 'field_name' => 'footb_rem_f', + 'field_type' => 'profilefields.type.bool', + 'field_ident' => 'footb_rem_f', + 'field_length' => 1, + 'field_minlen' => 0, + 'field_maxlen' => 0, + 'field_novalue' => 0, + 'field_default_value' => 2, + 'field_validation' => '', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 1, + 'field_show_on_pm' => 0, + 'field_show_on_vt' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 0, + ); + + protected $profilefield_language_data = array( + array( + 'option_id' => 0, + 'field_type' => 'profilefields.type.bool', + 'lang_value' => 'Yes', + ), + array( + 'option_id' => 1, + 'field_type' => 'profilefields.type.bool', + 'lang_value' => 'No', + ), + ); + + public function create_custom_field() + { + parent::create_custom_field(); + $lang_name = (strpos($this->profilefield_name, 'phpbb_') === 0) ? strtoupper(substr($this->profilefield_name, 6)) : strtoupper($this->profilefield_name); + $lang_update = array( + 'lang_explain' => $lang_name . '_EXPLAIN', + ); + $sql = 'SELECT field_id + FROM ' . PROFILE_FIELDS_TABLE . ' + WHERE field_ident = "' . $this->profilefield_data['field_ident'] . '"'; + $result = $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_fetchfield('field_id'); + $this->db->sql_freeresult($result); + $this->db->sql_transaction('begin'); + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) + { + $sql = 'UPDATE ' . PROFILE_LANG_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $lang_update) . ' + WHERE field_id = ' . $field_id; + $this->db->sql_query($sql); + } + $this->db->sql_freeresult($result); + $this->db->sql_transaction('commit'); + } + + public function create_language_entries() + { + parent::create_language_entries(); + // Update German language values + $sql = 'SELECT field_id + FROM ' . PROFILE_FIELDS_TABLE . ' + WHERE field_ident = "' . $this->profilefield_data['field_ident'] . '"'; + $result = $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_fetchfield('field_id'); + $this->db->sql_freeresult($result); + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE . ' + WHERE lang_local_name like "Deutsch%"'; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . PROFILE_FIELDS_LANG_TABLE . ' + SET lang_value = "Ja" + WHERE field_id = ' . $field_id . ' + AND lang_id = ' . $row['lang_id'] . ' + AND option_id = 0'; + $this->db->sql_query($sql); + $sql = 'UPDATE ' . PROFILE_FIELDS_LANG_TABLE . ' + SET lang_value = "Nein" + WHERE field_id = ' . $field_id . ' + AND lang_id = ' . $row['lang_id'] . ' + AND option_id = 1'; + $this->db->sql_query($sql); + } + $this->db->sql_freeresult($result); + } +} \ No newline at end of file diff --git a/migrations/profilefield_footb_rem_s.php b/migrations/profilefield_footb_rem_s.php new file mode 100644 index 0000000..e03e2a0 --- /dev/null +++ b/migrations/profilefield_footb_rem_s.php @@ -0,0 +1,140 @@ +db->sql_query($sql); + $field_count = (int) $this->db->sql_fetchfield('field_count'); + $this->db->sql_freeresult($result); + + // Skip migration if custom profile field exist + return $field_count; + } + + static public function depends_on() + { + return array('\football\football\migrations\v094_beta'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + array('custom', array(array($this, 'create_language_entries'))), + ); + } + + protected $profilefield_name = 'footb_rem_s'; + protected $profilefield_database_type = array('UINT:2', 2); + protected $profilefield_data = array( + 'field_name' => 'footb_rem_s', + 'field_type' => 'profilefields.type.bool', + 'field_ident' => 'footb_rem_s', + 'field_length' => 1, + 'field_minlen' => 0, + 'field_maxlen' => 0, + 'field_novalue' => 0, + 'field_default_value' => 2, + 'field_validation' => '', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 1, + 'field_show_on_pm' => 0, + 'field_show_on_vt' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 0, + ); + + protected $profilefield_language_data = array( + array( + 'option_id' => 0, + 'field_type' => 'profilefields.type.bool', + 'lang_value' => 'Yes', + ), + array( + 'option_id' => 1, + 'field_type' => 'profilefields.type.bool', + 'lang_value' => 'No', + ), + ); + + public function create_custom_field() + { + parent::create_custom_field(); + $lang_name = (strpos($this->profilefield_name, 'phpbb_') === 0) ? strtoupper(substr($this->profilefield_name, 6)) : strtoupper($this->profilefield_name); + $lang_update = array( + 'lang_explain' => $lang_name . '_EXPLAIN', + ); + $sql = 'SELECT field_id + FROM ' . PROFILE_FIELDS_TABLE . ' + WHERE field_ident = "' . $this->profilefield_data['field_ident'] . '"'; + $result = $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_fetchfield('field_id'); + $this->db->sql_freeresult($result); + $this->db->sql_transaction('begin'); + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) + { + $sql = 'UPDATE ' . PROFILE_LANG_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $lang_update) . ' + WHERE field_id = ' . $field_id; + $this->db->sql_query($sql); + } + $this->db->sql_freeresult($result); + $this->db->sql_transaction('commit'); + } + + public function create_language_entries() + { + parent::create_language_entries(); + // Update German language values + $sql = 'SELECT field_id + FROM ' . PROFILE_FIELDS_TABLE . ' + WHERE field_ident = "' . $this->profilefield_data['field_ident'] . '"'; + $result = $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_fetchfield('field_id'); + $this->db->sql_freeresult($result); + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE . ' + WHERE lang_local_name like "Deutsch%"'; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . PROFILE_FIELDS_LANG_TABLE . ' + SET lang_value = "Ja" + WHERE field_id = ' . $field_id . ' + AND lang_id = ' . $row['lang_id'] . ' + AND option_id = 0'; + $this->db->sql_query($sql); + $sql = 'UPDATE ' . PROFILE_FIELDS_LANG_TABLE . ' + SET lang_value = "Nein" + WHERE field_id = ' . $field_id . ' + AND lang_id = ' . $row['lang_id'] . ' + AND option_id = 1'; + $this->db->sql_query($sql); + } + $this->db->sql_freeresult($result); + } +} \ No newline at end of file diff --git a/migrations/v094_beta.php b/migrations/v094_beta.php new file mode 100644 index 0000000..8a55808 --- /dev/null +++ b/migrations/v094_beta.php @@ -0,0 +1,503 @@ +config['football_version']) && version_compare($this->config['football_version'], '0.9.4', '>='); + } + + // first try to update the old MOD and run this migration if update didn't change version number + static public function depends_on() + { + return array('\football\football\migrations\v094_beta_update'); + } + + public function update_schema() + { + //Create the football tables + return array( + 'add_columns' => array( + $this->table_prefix . 'sessions' => array( + 'football_season' => array('USINT', 0), + 'football_league' => array('TINT:2', 0), + 'football_matchday' => array('TINT:2', 0), + 'football_mobile' => array('UINT:1', 0), + 'football_mobile_device' => array('VCHAR:255', NULL), + ), + ), + 'add_tables' => array( + $this->table_prefix . 'footb_bets' => array( + 'COLUMNS' => array( + 'season' => array('USINT', 0), + 'league' => array('TINT:2', 0), + 'match_no' => array('USINT', 0), + 'user_id' => array('UINT', 0), + 'goals_home' => array('CHAR:2',''), + 'goals_guest' => array('CHAR:2',''), + 'bet_time' => array('UINT:11', 0), + ), + 'PRIMARY_KEY' => array('season', 'league', 'match_no', 'user_id'), + ), + $this->table_prefix . 'footb_extra' => array( + 'COLUMNS' => array( + 'season' => array('USINT', 0), + 'league' => array('TINT:2', 0), + 'extra_no' => array('USINT', 0), + 'question_type' => array('TINT:2', 0), + 'question' => array('VCHAR:255', ''), + 'result' => array('VCHAR:255', ''), + 'matchday' => array('TINT:2', 0), + 'matchday_eval' => array('TINT:2', 0), + 'extra_points' => array('TINT:2', 0), + 'extra_status' => array('TINT:2', 0), + ), + 'PRIMARY_KEY' => array('season', 'league', 'extra_no'), + 'KEYS' => array( + 'matchday' => array('INDEX', 'matchday'), + 'eval' => array('INDEX', 'matchday_eval'), + ), + ), + $this->table_prefix . 'footb_extra_bets' => array( + 'COLUMNS' => array( + 'season' => array('USINT', 0), + 'league' => array('TINT:2', 0), + 'extra_no' => array('USINT', 0), + 'user_id' => array('UINT', 0), + 'bet' => array('VCHAR:255', ''), + 'bet_points' => array('TINT:2', 0), + ), + 'PRIMARY_KEY' => array('season', 'league', 'extra_no', 'user_id'), + ), + $this->table_prefix . 'footb_leagues' => array( + 'COLUMNS' => array( + 'season' => array('USINT', 0), + 'league' => array('TINT:2', 0), + 'league_name' => array('VCHAR:20', ''), + 'league_name_short' => array('VCHAR:3', ''), + 'league_type' => array('TINT:1', 1), + 'matchdays' => array('TINT:2', 0), + 'matches_on_matchday' => array('TINT:2', 0), + 'win_result' => array('VCHAR:10', ''), + 'win_result_02' => array('VCHAR:10', ''), + 'win_matchday' => array('VCHAR:255', ''), + 'win_season' => array('VCHAR:255', ''), + 'points_mode' => array('TINT:2', 1), + 'points_result' => array('TINT:2', 0), + 'points_tendency' => array('TINT:2', 0), + 'points_diff' => array('TINT:2', 0), + 'points_last' => array('BOOL', 1), + 'join_by_user' => array('BOOL', 0), + 'join_in_season' => array('BOOL', 0), + 'bet_in_time' => array('BOOL', 0), + 'rules_post_id' => array('UINT', 0), + 'bet_ko_type' => array('TINT:1', 1), + 'bet_points' => array('DECIMAL', 0), + ), + 'PRIMARY_KEY' => array('season', 'league'), + ), + $this->table_prefix . 'footb_matchdays' => array( + 'COLUMNS' => array( + 'season' => array('USINT', 0), + 'league' => array('TINT:2', 0), + 'matchday' => array('TINT:2', 0), + 'status' => array('TINT:2', 0), + 'delivery_date' => array('CHAR:19', ''), + 'delivery_date_2' => array('CHAR:19', ''), + 'delivery_date_3' => array('CHAR:19', ''), + 'matchday_name' => array('VCHAR:30', ''), + 'matches' => array('CHAR:2',''), + ), + 'PRIMARY_KEY' => array('season', 'league', 'matchday'), + 'KEYS' => array( + 'status' => array('INDEX', 'status'), + 'date' => array('INDEX', 'delivery_date'), + ), + ), + $this->table_prefix . 'footb_matches' => array( + 'COLUMNS' => array( + 'season' => array('USINT', 0), + 'league' => array('TINT:2', 0), + 'match_no' => array('USINT', 0), + 'team_id_home' => array('USINT', 0), + 'team_id_guest' => array('USINT', 0), + 'goals_home' => array('CHAR:2',''), + 'goals_guest' => array('CHAR:2',''), + 'matchday' => array('TINT:2', 0), + 'status' => array('TINT:2', 0), + 'match_datetime' => array('CHAR:19', ''), + 'group_id' => array('CHAR:1', ''), + 'formula_home' => array('CHAR:9', ''), + 'formula_guest' => array('CHAR:9', ''), + 'ko_match' => array('BOOL', 0), + 'goals_overtime_home' => array('CHAR:2',''), + 'goals_overtime_guest' => array('CHAR:2',''), + 'trend' => array('CHAR:8', ''), + 'odd_1' => array('DECIMAL', 0.00), + 'odd_x' => array('DECIMAL', 0.00), + 'odd_2' => array('DECIMAL', 0.00), + 'rating' => array('DECIMAL', 0.00), + ), + 'PRIMARY_KEY' => array('season', 'league', 'match_no'), + 'KEYS' => array( + 'gid' => array('INDEX', 'team_id_guest'), + 'hid' => array('INDEX', 'team_id_home'), + 'md' => array('INDEX', 'matchday'), + ), + ), + $this->table_prefix . 'footb_matches_hist' => array( + 'COLUMNS' => array( + 'match_date' => array('CHAR:10', ''), + 'team_id_home' => array('USINT', 1), + 'team_id_guest' => array('USINT', 1), + 'match_type' => array('VCHAR:5', ''), + 'goals_home' => array('CHAR:2', ''), + 'goals_guest' => array('CHAR:2', ''), + ), + 'PRIMARY_KEY' => array('match_date', 'team_id_home', 'team_id_guest'), + 'KEYS' => array( + 'gid' => array('INDEX', 'team_id_guest'), + 'hid' => array('INDEX', 'team_id_home'), + ), + ), + $this->table_prefix . 'footb_points' => array( + 'COLUMNS' => array( + 'points_id' => array('UINT', NULL, 'auto_increment'), + 'season' => array('USINT', 0), + 'league' => array('TINT:2', 0), + 'matchday' => array('TINT:2', 0), + 'points_type' => array('TINT:1', 0), + 'user_id' => array('UINT', 0), + 'points' => array('DECIMAL:20', 0.00), + 'points_comment' => array('MTEXT_UNI', ''), + 'cash' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => array('points_id'), + 'KEYS' => array( + 'user' => array('INDEX', array('season', 'league', 'user_id')), + 'matchday' => array('INDEX', array('season', 'league', 'matchday')), + 'type' => array('INDEX', array('season', 'league', 'points_type')), + ), + ), + $this->table_prefix . 'footb_rank_matchdays' => array( + 'COLUMNS' => array( + 'season' => array('USINT', 0), + 'league' => array('TINT:2', 0), + 'matchday' => array('TINT:2', 0), + 'user_id' => array('UINT', 0), + 'status' => array('TINT:2', 0), + 'rank' => array('USINT', 0), + 'points' => array('USINT', 0), + 'win' => array('DECIMAL', 0), + 'rank_total' => array('USINT', 0), + 'tendencies' => array('TINT:2', 0), + 'correct_result' => array('TINT:2', 0), + 'points_total' => array('USINT', 0), + 'win_total' => array('DECIMAL', 0), + ), + 'PRIMARY_KEY' => array('season', 'league', 'matchday', 'user_id'), + ), + $this->table_prefix . 'footb_seasons' => array( + 'COLUMNS' => array( + 'season' => array('USINT', 0), + 'season_name' => array('VCHAR:20', ''), + 'season_name_short' => array('VCHAR:10', ''), + ), + 'PRIMARY_KEY' => array('season'), + ), + $this->table_prefix . 'footb_teams' => array( + 'COLUMNS' => array( + 'season' => array('USINT', 0), + 'league' => array('TINT:2', 0), + 'team_id' => array('USINT', 1), + 'team_name' => array('VCHAR:30', ''), + 'team_name_short' => array('VCHAR:10', ''), + 'team_symbol' => array('VCHAR:25', ''), + 'group_id' => array('CHAR:1', ''), + 'matchday' => array('TINT:2', 0), + ), + 'PRIMARY_KEY' => array('season', 'league', 'team_id'), + ), + $this->table_prefix . 'footb_teams_hist' => array( + 'COLUMNS' => array( + 'team_id' => array('USINT', 0), + 'team_name' => array('VCHAR:30', ''), + ), + 'PRIMARY_KEY' => array('team_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'footb_bets', + $this->table_prefix . 'footb_extra', + $this->table_prefix . 'footb_extra_bets', + $this->table_prefix . 'footb_leagues', + $this->table_prefix . 'footb_matchdays', + $this->table_prefix . 'footb_matches', + $this->table_prefix . 'footb_matches_hist', + $this->table_prefix . 'footb_points', + $this->table_prefix . 'footb_rank_matchdays', + $this->table_prefix . 'footb_seasons', + $this->table_prefix . 'footb_teams', + $this->table_prefix . 'footb_teams_hist', + ), + ); + } + + public function update_data() + { + return array( + array('config.remove', array('football_google_league')), + array('config.remove', array('football_menu_forumdesc1')), + array('config.remove', array('football_menu_forumdesc2')), + array('config.remove', array('football_menu_forumdesc3')), + array('config.remove', array('football_menu_forumdesc4')), + array('config.remove', array('football_menu_forumdesc5')), + array('config.remove', array('football_menu_forumdesc6')), + array('config.remove', array('football_menu_forumid1')), + array('config.remove', array('football_menu_forumid2')), + array('config.remove', array('football_menu_forumid3')), + array('config.remove', array('football_menu_forumid4')), + array('config.remove', array('football_menu_forumid5')), + array('config.remove', array('football_menu_forumid6')), + array('config.remove', array('football_side')), + array('config.add', array('football_bank', '0', '0')), + array('config.add', array('football_code', '0000', '0')), + array('config.add', array('football_disable', '0', '0')), + array('config.add', array('football_disable_msg', 'Wartung der Tipprunde. Bitte später erneut versuchen.', '0')), + array('config.add', array('football_display_ranks', '30', '0')), + array('config.add', array('football_founder_delete', '1', '0')), + array('config.add', array('football_fullscreen', '1', '0')), + array('config.add', array('football_guest_view', '1', '0')), + array('config.add', array('football_header_enable', '0', '0')), + array('config.add', array('football_host_timezone', $this->config['board_timezone'], '0')), + array('config.add', array('football_info', '', '0')), + array('config.add', array('football_info_display', '0', '0')), + array('config.add', array('football_last_backup', '0', '0')), + array('config.add', array('football_left_column_width', '180', '0')), + array('config.add', array('football_menu', '1', '0')), + array('config.add', array('football_menu_desc1', 'XML Seasons', '0')), + array('config.add', array('football_menu_desc2', '', '0')), + array('config.add', array('football_menu_desc3', 'XML League', '0')), + array('config.add', array('football_menu_link1', $this->config['server_protocol'] . $this->config['server_name'] . $this->config['script_path'] . '/ext/football/football/xml/seasons.php?code=0000', '0')), + array('config.add', array('football_menu_link2', '', '0')), + array('config.add', array('football_menu_link3', $this->config['server_protocol'] . $this->config['server_name'] . $this->config['script_path'] . '/ext/football/football/xml/league.php?code=0000', '0')), + array('config.add', array('football_name', 'Tipprunde', '0')), + array('config.add', array('football_override_style', '0', '0')), + array('config.add', array('football_remember_enable', '0', '0')), + array('config.add', array('football_remember_next_run', '0', '0')), + array('config.add', array('football_results_at_time', '1', '0')), + array('config.add', array('football_right_column_width', '184', '0')), + array('config.add', array('football_same_allowed', '0', '0')), + array('config.add', array('football_season_start', '0', '0')), + array('config.add', array('football_ult_points', '0', '0')), + array('config.add', array('football_ult_points_factor', '1.0', '0')), + array('config.add', array('football_update_code', '0000', '0')), + array('config.add', array('football_update_source', '', '0')), + array('config.add', array('football_user_view', '1', '0')), + array('config.add', array('football_users_per_page', '30', '0')), + array('config.add', array('football_version', '0.9.4', '0')), + array('config.add', array('football_view_bets', '0', '0')), + array('config.add', array('football_view_current', '1', '0')), + array('config.add', array('football_view_tendencies', '0', '0')), + array('config.add', array('football_win_name', 'PTS', '0')), + array('config.add', array('football_win_hits02', '0', '0')), + array('config.add', array('football_style', $this->config['default_style'], '0')), + + // Add football administrator permission role + array('permission.role_add', array('ROLE_ADMIN_FOOTBALL', 'a_', 'ROLE_DESCRIPTION_ADMIN_FOOTBALL')), // New role "ADMIN_FOOTBALL" + + // Add football permission settings + array('permission.add', array('a_football_config', true)), + array('permission.add', array('a_football_delete', true)), + array('permission.add', array('a_football_editbets', true)), + array('permission.add', array('a_football_plan', true)), + array('permission.add', array('a_football_results', true)), + array('permission.add', array('u_use_football', true)), + array('permission.add', array('a_football_points', true)), + + // We give some default permissions then as well? + array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_football_config')), + array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_football_delete')), + array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_football_editbets')), + array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_football_plan')), + array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_football_results')), + array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_football_points')), + array('permission.permission_set', array('ROLE_ADMIN_STANDARD', 'a_football_results')), + array('permission.permission_set', array('ROLE_ADMIN_FOOTBALL', 'a_football_results')), + array('permission.permission_set', array('ROLE_USER_STANDARD', 'u_use_football')), + + + // Add a new tab named ACP_FOOTBALL + array('module.add', array('acp', 0, 'ACP_FOOTBALL')), + + // Add a new category named ACP_FOOTBALL_OPERATION to ACP_FOOTBALL + array('module.add', array('acp', 'ACP_FOOTBALL', 'ACP_FOOTBALL_OPERATION')), + + // Add the manage mode from football_results to the ACP_FOOTBALL_OPERATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_OPERATION', array( + 'module_basename' => '\football\football\acp\results_module', + 'module_langname' => 'ACP_FOOTBALL_RESULTS_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_results', + ), + )), + + // Add the manage mode from football_all_bets to the ACP_FOOTBALL_OPERATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_OPERATION', array( + 'module_basename' => '\football\football\acp\all_bets_module', + 'module_langname' => 'ACP_FOOTBALL_ALL_BETS_VIEW', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_editbets', + ), + )), + + // Add the manage mode from football_bets to the ACP_FOOTBALL_OPERATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_OPERATION', array( + 'module_basename' => '\football\football\acp\bets_module', + 'module_langname' => 'ACP_FOOTBALL_BETS_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_editbets', + ), + )), + + // Add the manage mode from football_ko to the ACP_FOOTBALL_OPERATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_OPERATION', array( + 'module_basename' => '\football\football\acp\ko_module', + 'module_langname' => 'ACP_FOOTBALL_KO_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_bank to the ACP_FOOTBALL_OPERATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_OPERATION', array( + 'module_basename' => '\football\football\acp\bank_module', + 'module_langname' => 'ACP_FOOTBALL_BANK_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_points', + ), + )), + + + // Add a new category named ACP_FOOTBALL_MANAGE to ACP_FOOTBALL + array('module.add', array('acp', 'ACP_FOOTBALL', 'ACP_FOOTBALL_MANAGE')), + + // Add the manage mode from football_seasons to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\seasons_module', + 'module_langname' => 'ACP_FOOTBALL_SEASONS_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_leagues to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\leagues_module', + 'module_langname' => 'ACP_FOOTBALL_LEAGUES_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_matchdays to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\matchdays_module', + 'module_langname' => 'ACP_FOOTBALL_MATCHDAYS_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_teams to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\teams_module', + 'module_langname' => 'ACP_FOOTBALL_TEAMS_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_matches to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\matches_module', + 'module_langname' => 'ACP_FOOTBALL_MATCHES_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_extra to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\extra_module', + 'module_langname' => 'ACP_FOOTBALL_EXTRA_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_update to the ACP_FOOTBALL_MANAGE category using the "manual" method. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\update_module', + 'module_langname' => 'ACP_FOOTBALL_UPDATE_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add a new category named ACP_FOOTBALL_CONFIGURATION to ACP_FOOTBALL + array('module.add', array('acp', 'ACP_FOOTBALL', 'ACP_FOOTBALL_CONFIGURATION')), + + // Add the settings mode from football to the ACP_FOOTBALL_CONFIGURATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_CONFIGURATION', array( + 'module_basename' => 'football\football\acp\football_module', + 'module_langname' => 'ACP_FOOTBALL_SETTINGS', + 'module_mode' => 'settings', + 'module_auth' => 'acl_a_football_config', + ), + )), + + // Add the features mode from football to the ACP_FOOTBALL_CONFIGURATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_CONFIGURATION', array( + 'module_basename' => 'football\football\acp\football_module', + 'module_langname' => 'ACP_FOOTBALL_FEATURES', + 'module_mode' => 'features', + 'module_auth' => 'acl_a_football_config', + ), + )), + + // Add the menu mode from football to the ACP_FOOTBALL_CONFIGURATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_CONFIGURATION', array( + 'module_basename' => 'football\football\acp\football_module', + 'module_langname' => 'ACP_FOOTBALL_MENU', + 'module_mode' => 'menu', + 'module_auth' => 'acl_a_football_config', + ), + )), + + // Add the userguide mode from football to the ACP_FOOTBALL_CONFIGURATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_CONFIGURATION', array( + 'module_basename' => 'football\football\acp\football_module', + 'module_langname' => 'ACP_FOOTBALL_USERGUIDE', + 'module_mode' => 'userguide', + 'module_auth' => 'acl_a_football_plan' + ), + )), + ); + } +} \ No newline at end of file diff --git a/migrations/v094_beta_update.php b/migrations/v094_beta_update.php new file mode 100644 index 0000000..365d5f6 --- /dev/null +++ b/migrations/v094_beta_update.php @@ -0,0 +1,276 @@ +db_tools->sql_column_exists($this->table_prefix . 'sessions', 'session_matchday'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\extensions'); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'sessions' => array( + 'session_season', + 'session_league', + 'session_matchday', + ) + ), + 'add_columns' => array( + $this->table_prefix . 'sessions' => array( + 'football_season' => array('USINT', 0), + 'football_league' => array('TINT:2', 0), + 'football_matchday' => array('TINT:2', 0), + 'football_mobile' => array('UINT:1', 0), + 'football_mobile_device' => array('VCHAR:255', NULL), + ), + $this->table_prefix . 'footb_bets' => array( + 'bet_time' => array('UINT:11', 0), + ), + $this->table_prefix . 'footb_matches' => array( + 'trend' => array('CHAR:8', ''), + 'odd_1' => array('DECIMAL', 0.00), + 'odd_x' => array('DECIMAL', 0.00), + 'odd_2' => array('DECIMAL', 0.00), + 'rating' => array('DECIMAL', 0.00), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_teampage', + ), + $this->table_prefix . 'sessions' => array( + 'football_mobile', + 'football_mobile_device', + ), + $this->table_prefix . 'footb_bets' => array( + 'bet_time', + ), + $this->table_prefix . 'footb_matches' => array( + 'trend', + 'odd_1', + 'odd_x', + 'odd_2', + 'rating', + ), + ) + ); + } + + public function update_data() + { + return array( + // Add config values + array('config.remove', array('football_google_league')), + array('config.remove', array('football_menu_forumdesc1')), + array('config.remove', array('football_menu_forumdesc2')), + array('config.remove', array('football_menu_forumdesc3')), + array('config.remove', array('football_menu_forumdesc4')), + array('config.remove', array('football_menu_forumdesc5')), + array('config.remove', array('football_menu_forumdesc6')), + array('config.remove', array('football_menu_forumid1')), + array('config.remove', array('football_menu_forumid2')), + array('config.remove', array('football_menu_forumid3')), + array('config.remove', array('football_menu_forumid4')), + array('config.remove', array('football_menu_forumid5')), + array('config.remove', array('football_menu_forumid6')), + array('config.remove', array('football_side')), + array('config.add', array('football_fullscreen', '1', '0')), + array('config.add', array('football_header_enable', '0', '0')), + array('config.add', array('football_last_backup', '0', '0')), + array('config.add', array('football_menu', '1', '0')), + array('config.add', array('football_menu_desc1', 'XML Seasons', '0')), + array('config.add', array('football_menu_desc2', '', '0')), + array('config.add', array('football_menu_desc3', 'XML League', '0')), + array('config.add', array('football_menu_link1', $this->config['server_protocol'] . $this->config['server_name'] . $this->config['script_path'] . '/ext/football/football/xml/seasons.php?code=0000', '0')), + array('config.add', array('football_menu_link2', '', '0')), + array('config.add', array('football_menu_link3', $this->config['server_protocol'] . $this->config['server_name'] . $this->config['script_path'] . '/ext/football/football/xml/league.php?code=0000', '0')), + array('config.add', array('football_remember_enable', '0', '0')), + array('config.add', array('football_remember_next_run', '0', '0')), + array('config.add', array('football_season_start', '0', '0')), + array('config.add', array('football_update_code', '0000', '0')), + array('config.add', array('football_update_source', '', '0')), + array('config.add', array('football_user_view', '1', '0')), + array('config.update', array('football_version', '0.9.4', '0')), + + // Add a new tab named ACP_FOOTBALL + array('module.add', array('acp', 0, 'ACP_FOOTBALL')), + + // Add a new category named ACP_FOOTBALL_OPERATION to ACP_FOOTBALL + array('module.add', array('acp', 'ACP_FOOTBALL', 'ACP_FOOTBALL_OPERATION')), + + // Add the manage mode from football_results to the ACP_FOOTBALL_OPERATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_OPERATION', array( + 'module_basename' => '\football\football\acp\results_module', + 'module_langname' => 'ACP_FOOTBALL_RESULTS_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_results', + ), + )), + + // Add the manage mode from football_all_bets to the ACP_FOOTBALL_OPERATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_OPERATION', array( + 'module_basename' => '\football\football\acp\all_bets_module', + 'module_langname' => 'ACP_FOOTBALL_ALL_BETS_VIEW', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_editbets', + ), + )), + + // Add the manage mode from football_bets to the ACP_FOOTBALL_OPERATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_OPERATION', array( + 'module_basename' => '\football\football\acp\bets_module', + 'module_langname' => 'ACP_FOOTBALL_BETS_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_editbets', + ), + )), + + // Add the manage mode from football_ko to the ACP_FOOTBALL_OPERATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_OPERATION', array( + 'module_basename' => '\football\football\acp\ko_module', + 'module_langname' => 'ACP_FOOTBALL_KO_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_bank to the ACP_FOOTBALL_OPERATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_OPERATION', array( + 'module_basename' => '\football\football\acp\bank_module', + 'module_langname' => 'ACP_FOOTBALL_BANK_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_points', + ), + )), + + + // Add a new category named ACP_FOOTBALL_MANAGE to ACP_FOOTBALL + array('module.add', array('acp', 'ACP_FOOTBALL', 'ACP_FOOTBALL_MANAGE')), + + // Add the manage mode from football_seasons to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\seasons_module', + 'module_langname' => 'ACP_FOOTBALL_SEASONS_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_leagues to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\leagues_module', + 'module_langname' => 'ACP_FOOTBALL_LEAGUES_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_matchdays to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\matchdays_module', + 'module_langname' => 'ACP_FOOTBALL_MATCHDAYS_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_teams to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\teams_module', + 'module_langname' => 'ACP_FOOTBALL_TEAMS_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_matches to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\matches_module', + 'module_langname' => 'ACP_FOOTBALL_MATCHES_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_extra to the ACP_FOOTBALL_MANAGE category. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\extra_module', + 'module_langname' => 'ACP_FOOTBALL_EXTRA_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add the manage mode from football_update to the ACP_FOOTBALL_MANAGE category using the "manual" method. + array('module.add', array('acp', 'ACP_FOOTBALL_MANAGE', array( + 'module_basename' => '\football\football\acp\update_module', + 'module_langname' => 'ACP_FOOTBALL_UPDATE_MANAGE', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_football_plan', + ), + )), + + // Add a new category named ACP_FOOTBALL_CONFIGURATION to ACP_FOOTBALL + array('module.add', array('acp', 'ACP_FOOTBALL', 'ACP_FOOTBALL_CONFIGURATION')), + + // Add the settings mode from football to the ACP_FOOTBALL_CONFIGURATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_CONFIGURATION', array( + 'module_basename' => 'football\football\acp\football_module', + 'module_langname' => 'ACP_FOOTBALL_SETTINGS', + 'module_mode' => 'settings', + 'module_auth' => 'acl_a_football_config', + ), + )), + + // Add the features mode from football to the ACP_FOOTBALL_CONFIGURATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_CONFIGURATION', array( + 'module_basename' => 'football\football\acp\football_module', + 'module_langname' => 'ACP_FOOTBALL_FEATURES', + 'module_mode' => 'features', + 'module_auth' => 'acl_a_football_config', + ), + )), + + // Add the menu mode from football to the ACP_FOOTBALL_CONFIGURATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_CONFIGURATION', array( + 'module_basename' => 'football\football\acp\football_module', + 'module_langname' => 'ACP_FOOTBALL_MENU', + 'module_mode' => 'menu', + 'module_auth' => 'acl_a_football_config', + ), + )), + + // Add the userguide mode from football to the ACP_FOOTBALL_CONFIGURATION category. + array('module.add', array('acp', 'ACP_FOOTBALL_CONFIGURATION', array( + 'module_basename' => 'football\football\acp\football_module', + 'module_langname' => 'ACP_FOOTBALL_USERGUIDE', + 'module_mode' => 'userguide', + 'module_auth' => 'acl_a_football_plan' + ), + )), + ); + } +} diff --git a/migrations/v095_beta.php b/migrations/v095_beta.php new file mode 100644 index 0000000..784ffcb --- /dev/null +++ b/migrations/v095_beta.php @@ -0,0 +1,32 @@ +config['football_breadcrumb']); + } + + static public function depends_on() + { + return array('\football\football\migrations\v094_beta'); + } + + public function update_data() + { + return array( + array('config.add', array('football_side', '0', '0')), + array('config.add', array('football_breadcrumb', '1', '0')), + array('config.update', array('football_version', '0.9.5', '0')), + ); + } +} diff --git a/styles/prosilver/template/all_bets.html b/styles/prosilver/template/all_bets.html new file mode 100644 index 0000000..3a6f774 --- /dev/null +++ b/styles/prosilver/template/all_bets.html @@ -0,0 +1,125 @@ + +
+ {L_FINALLY} - {L_PROVISIONALLY} - {L_NOT_RATED} +
+ + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

{match_panel.match_entry.HOME_NAME}
{match_panel.match_entry.GUEST_NAME}
{L_RESULT}{match_panel.match_entry.RESULT}{L_TOTAL}
{L_TENDENCY}{match_panel.tendency_footer.tendency.TENDENCY}{match_panel.tendency_footer.SUMTOTAL}
{match_panel.user_row.USER_NAME}{match_panel.user_row.bet.BET}{match_panel.user_row.bet.POINTS}{match_panel.user_row.points.POINTS_TOTAL}
+
+
+ +
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_EXTRA_BET}{extra_panel.QUESTION}{L_EVALUATION}{L_POINTS}
{L_RESULT}{extra_panel.RESULT}{extra_panel.EVALUATION}{extra_panel.POINTS}
{extra_panel.user_row.USER_NAME}{extra_panel.user_row.BET} {extra_panel.user_row.BET_POINTS}
+
+ +
+ + + + + + + + + + +
+
{L_NO_MATCHES_ON_MATCHDAY}
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/bank.html b/styles/prosilver/template/bank.html new file mode 100644 index 0000000..4a3fade --- /dev/null +++ b/styles/prosilver/template/bank.html @@ -0,0 +1,65 @@ + + +
+

{L_BANK_OF} :

+
+
+ + + + + +
+
+
+ +

{L_BANK_OF} {USERNAME}:

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_SEASON}{L_LEAGUE}{L_MATCHDAY}{L_BOOK_TYPE}{POINTS}{L_LOGS_COMMENT}
{football.SEASON_NAME}{football.LEAGUE_NAME}{football.MATCHDAY_NAME}{football.POINTS_TYPE}{football.POINTS_SIGN}{football.POINTS}{football.COMMENT}
{L_FOOTBALL_NO_BOOKS}
+
+ +
+ + + + + +
+
{L_NO_MEMBER}
+
+ diff --git a/styles/prosilver/template/bet.html b/styles/prosilver/template/bet.html new file mode 100644 index 0000000..9408a83 --- /dev/null +++ b/styles/prosilver/template/bet.html @@ -0,0 +1,220 @@ + + +
+ + {L_FINALLY} - {L_PROVISIONALLY} - {L_NOT_RATED}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_DATE}{L_NR}{L_GR}{L_VS}{L_BET_OF} ({BET_EXPLAIN}){L_RATING}{L_RESULT}{L_POINTS}
{bet_view.MATCH_TIME}{bet_view.MATCH_NUMBER}{bet_view.GROUP} + {bet_view.HOME_NAME}: + {bet_view.GUEST_NAME}{bet_view.BET_HOME}:{bet_view.BET_GUEST}{bet_view.RATING}{bet_view.GOALS_HOME}:{bet_view.GOALS_GUEST}{bet_view.POINTS} + + + + + +
{bet_edit.MATCH_TIME}{bet_edit.MATCH_NUMBER}{bet_edit.GROUP} + {bet_edit.HOME_NAME} + : + {bet_edit.GUEST_NAME} + + + + + _{bet_edit.BET_HOME}_ + + : + + + + _{bet_edit.BET_GUEST}_ + + {bet_edit.DELIVERTAG} + +      + + + + + +
+
+ + +
+ + *  {L_DELIVERY_UNTIL} {S_DELIVERY2}
+ + + **  {L_DELIVERY_UNTIL} {S_DELIVERY3}
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_QUESTION}{L_POSSIBLE_POINTS}{L_EVALUATION}{L_BET_OF}{L_RESULT}{L_POINTS}
{extra_view.QUESTION}{extra_view.EXTRA_POINTS}{extra_view.EVALUATION}{extra_view.BET}{extra_view.RESULT}{extra_view.BET_POINTS}
{extra_edit.QUESTION}{extra_edit.EXTRA_POINTS}{extra_edit.EVALUATION} + + + + + _{extra_edit.BET}_ + + + + + + + _{extra_edit.BET}_ + + +
+
+ + + + +
+
{S_DBMSG}   
+
+ +
+ +
+ + + + +
+ +
{L_NO_MATCHES_ON_MATCHDAY}
+ +
{L_NO_MEMBER}
+ +
+
+
+
+ {JOIN_LEAGUE}
+
+ +
+
+ + +
+ diff --git a/styles/prosilver/template/bet_popup.html b/styles/prosilver/template/bet_popup.html new file mode 100644 index 0000000..ea32189 --- /dev/null +++ b/styles/prosilver/template/bet_popup.html @@ -0,0 +1,92 @@ + + + +
+
+ +
+ + {L_FINALLY} - {L_PROVISIONALLY} - {L_NOT_RATED}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_DATE}{L_NR}{L_GR}{L_VS}{L_BET_OF}{L_RESULT}{L_POINTS}
{bet_view.MATCH_TIME}{bet_view.MATCH_NUMBER}{bet_view.GROUP}{bet_view.HOME_NAME}:{bet_view.GUEST_NAME}{bet_view.BET_HOME}:{bet_view.BET_GUEST}{bet_view.GOALS_HOME}:{bet_view.GOALS_GUEST}{bet_view.POINTS}
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
{L_QUESTION}{L_POSSIBLE_POINTS}{L_EVALUATION}{L_BET_OF}{L_RESULT}{L_POINTS}
{extra_view.QUESTION}{extra_view.EXTRA_POINTS}{extra_view.EVALUATION}{extra_view.BET}{extra_view.RESULT}{extra_view.BET_POINTS}
+
+ + + +
+
{S_ERROR_MESSAGE}
+
+ + +
+ \ No newline at end of file diff --git a/styles/prosilver/template/delivery.html b/styles/prosilver/template/delivery.html new file mode 100644 index 0000000..eac9f74 --- /dev/null +++ b/styles/prosilver/template/delivery.html @@ -0,0 +1,11 @@ +
+

 {L_DELIVERY_LIST}

+ + + {delivery.DELIVERY}
+ {delivery.LEAGUE_SHORT} + {delivery.MATCHDAY_NAME} +

+ +
+ diff --git a/styles/prosilver/template/event/overall_footer_breadcrumb_prepend.html b/styles/prosilver/template/event/overall_footer_breadcrumb_prepend.html new file mode 100644 index 0000000..a243a3c --- /dev/null +++ b/styles/prosilver/template/event/overall_footer_breadcrumb_prepend.html @@ -0,0 +1 @@ +{S_FOOTBALL_NAME} diff --git a/styles/prosilver/template/event/overall_header_breadcrumb_prepend.html b/styles/prosilver/template/event/overall_header_breadcrumb_prepend.html new file mode 100644 index 0000000..a243a3c --- /dev/null +++ b/styles/prosilver/template/event/overall_header_breadcrumb_prepend.html @@ -0,0 +1 @@ +{S_FOOTBALL_NAME} diff --git a/styles/prosilver/template/event/overall_header_head_append.html b/styles/prosilver/template/event/overall_header_head_append.html new file mode 100644 index 0000000..b824949 --- /dev/null +++ b/styles/prosilver/template/event/overall_header_head_append.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/styles/prosilver/template/event/overall_header_navigation_prepend.html b/styles/prosilver/template/event/overall_header_navigation_prepend.html new file mode 100644 index 0000000..45fa598 --- /dev/null +++ b/styles/prosilver/template/event/overall_header_navigation_prepend.html @@ -0,0 +1,53 @@ + + + \ No newline at end of file diff --git a/styles/prosilver/template/event/overall_header_page_body_before.html b/styles/prosilver/template/event/overall_header_page_body_before.html new file mode 100644 index 0000000..b5ea2a4 --- /dev/null +++ b/styles/prosilver/template/event/overall_header_page_body_before.html @@ -0,0 +1,64 @@ + + + + \ No newline at end of file diff --git a/styles/prosilver/template/event/simple_header_head_append.html b/styles/prosilver/template/event/simple_header_head_append.html new file mode 100644 index 0000000..4e4991d --- /dev/null +++ b/styles/prosilver/template/event/simple_header_head_append.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/styles/prosilver/template/football_body.html b/styles/prosilver/template/football_body.html new file mode 100644 index 0000000..007c16b --- /dev/null +++ b/styles/prosilver/template/football_body.html @@ -0,0 +1,217 @@ + + + + + + + +
+ {L_INFORMATION}: {S_FOOTBALL_INFO} +
+ + +
+ +
+
+ + +
+ + + +

{S_SIDENAME}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
+ + + + + + + + + + +
+ + +
+ + + +
+ +
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/football_print.html b/styles/prosilver/template/football_print.html new file mode 100644 index 0000000..4c53f14 --- /dev/null +++ b/styles/prosilver/template/football_print.html @@ -0,0 +1,117 @@ + + + + + + + + + + + +{META} +{SITENAME} • {PAGE_TITLE} + + + + +
+ + + + +
+
{PAGE_NUMBER}
+ + + + + + + + style="vertical-align: top;" + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + diff --git a/styles/prosilver/template/frame_results.html b/styles/prosilver/template/frame_results.html new file mode 100644 index 0000000..79a8292 --- /dev/null +++ b/styles/prosilver/template/frame_results.html @@ -0,0 +1,13 @@ + +Diese Datei existiert doppelt: Einmal im fooball\football\styles\prsilver\template und einmal im fooball\football\adm\style Ordner +Mit Hilfe dieser Datei werden Fussballergebnisse zum Abgleich und schnelleren Erfassung von externen Seiten, +wie z.B. den Weltfussball.de Torverteiler, eingebunden. +Wenn ihr einen Weltfussball.de Account habt, könnt ihr dort in der Community einen Torverteiler erstellen und den Code hier +unter der entsprechenden Liganummer reinhängen (also 999999 mit der Liganummer bzw. wfb_tv_id ersetzen). +Der Frame wird dann bei der Ergebnisseingabe in der Liga angezeigt, wenn der Spieltag editierbar ist. + + + +
Der Torverteiler - präsentiert von weltfussball.de 
Alles über Fußball oder direkt zur Bundesliga 
+ + diff --git a/styles/prosilver/template/hist_popup.html b/styles/prosilver/template/hist_popup.html new file mode 100644 index 0000000..e4cf52e --- /dev/null +++ b/styles/prosilver/template/hist_popup.html @@ -0,0 +1,288 @@ + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_SEASON}{L_LEAGUE}{L_VS}{L_RESULT}
{historie.SEASON}{historie.LEAGUE}{historie.HNAME}:{historie.GNAME}{historie.GOALS_HOME}:{historie.GOALS_GUEST}
+
+
{STAT_HIST}
+
+
+ + {chart_hist_total.CHARTIMAGE} + + + + + +
+ +
+ +
{L_NO_HIST}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+
{TEAM_HOME}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_TABLE}{L_RANK_FORECAST}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_DOT}
{table_hometeam.TABLE}{table_hometeam.PLFP}{table_hometeam.MATCHES}{table_hometeam.WINS}{table_hometeam.DRAW}{table_hometeam.LOST}{table_hometeam.GOALS_HOME}:{table_hometeam.GOALS_GUEST}{table_hometeam.GDIFF}{table_hometeam.POINTS}
+
+ +
{L_NO_MATCHES_TEAM}
+ +
+
  +
{TEAM_GUEST}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_TABLE}{L_RANK_FORECAST}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_DOT}
{table_guestteam.TABLE}{table_guestteam.PLFP}{table_guestteam.MATCHES}{table_guestteam.WINS}{table_guestteam.DRAW}{table_guestteam.LOST}{table_guestteam.GOALS_HOME}:{table_guestteam.GOALS_GUEST}{table_guestteam.GDIFF}{table_guestteam.POINTS}
+
+ +
{L_NO_MATCHES_TEAM}
+ +
+
+ + {chart_home.CHARTIMAGE} + + + + + +
+ +
  + + {chart_guest.CHARTIMAGE} + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + +
{L_LAST_GAMES}
{last_hometeam.PLACE}{last_hometeam.AGAINST}{last_hometeam.GOALS_HOME}:{last_hometeam.GOALS_GUEST}
+
+ +
{L_NO_MATCHES_TEAM}
+ +
  +
+ + + + + + + + + + + + + + + + + +
{L_LAST_GAMES}
{last_guestteam.PLACE}{last_guestteam.AGAINST}{last_guestteam.GOALS_HOME}:{last_guestteam.GOALS_GUEST}
+
+ +
{L_NO_MATCHES_TEAM}
+ +
+
+ + + + + + + + + + + + + + + + +
{L_LAST_GAMES_HOME}
{lasthome_hometeam.AGAINST}{lasthome_hometeam.GOALS_HOME}:{lasthome_hometeam.GOALS_GUEST}
+
+ +
{L_NO_HOMEMATCHES_TEAM}
+ +
  +
+ + + + + + + + + + + + + + + + +
{L_LAST_GAMES_AWAY}
{lastaway_guestteam.AGAINST}{lastaway_guestteam.GOALS_HOME}:{lastaway_guestteam.GOALS_GUEST}
+
+ +
{L_NO_AWAYMATCHES_TEAM}
+ +
+ + + +
+
{S_ERROR_MESSAGE}
+
+ + +
+ \ No newline at end of file diff --git a/styles/prosilver/template/last_users.html b/styles/prosilver/template/last_users.html new file mode 100644 index 0000000..ac3d89a --- /dev/null +++ b/styles/prosilver/template/last_users.html @@ -0,0 +1,4 @@ +

 {LAST_USERS}

+ + {last_users.USER_NAME}
{last_users.LAST_VISIT_DATE}
+
diff --git a/styles/prosilver/template/mobile_all_bets.html b/styles/prosilver/template/mobile_all_bets.html new file mode 100644 index 0000000..5883954 --- /dev/null +++ b/styles/prosilver/template/mobile_all_bets.html @@ -0,0 +1,98 @@ + +
+ {L_FINALLY} - {L_PROVISIONALLY} - {L_NOT_RATED} +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

{match_panel.match_entry.HOME_NAME}
{match_panel.match_entry.GUEST_NAME}
{L_RESULT}{match_panel.match_entry.RESULT}∑ 
{L_TENDENCY}{match_panel.tendency_footer.tendency.TENDENCY}{match_panel.tendency_footer.SUMTOTAL}
{match_panel.user_row.USER_NAME}{match_panel.user_row.bet.BET}{match_panel.user_row.bet.POINTS}{match_panel.user_row.points.POINTS_TOTAL}
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_EXTRA_BET}{extra_panel.QUESTION}{L_EVALUATION}{L_POINTS_SHORT}
{L_RESULT}{extra_panel.RESULT}{extra_panel.EVALUATION}{extra_panel.POINTS}
{extra_panel.user_row.USER_NAME}{extra_panel.user_row.BET} {extra_panel.user_row.BET_POINTS}
+
+ + + + +
+
{L_NO_MATCHES_ON_MATCHDAY}
+
+ diff --git a/styles/prosilver/template/mobile_bank.html b/styles/prosilver/template/mobile_bank.html new file mode 100644 index 0000000..b664224 --- /dev/null +++ b/styles/prosilver/template/mobile_bank.html @@ -0,0 +1,61 @@ + +
+ +
+

{L_BANK_OF} :

+
+
+ + + + + +
+
+
+ +

{L_BANK_OF} {USERNAME}:

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_LEAGUE}{L_MATCHDAY_SHORT}{L_BOOK_TYPE}{POINTS}{L_LOGS_COMMENT}
{football.LEAGUE_SHORT}{football.MATCHDAY}.{football.POINTS_TYPE}{football.POINTS}{football.COMMENT}
{L_FOOTBALL_NO_BOOKS}
+
+ + + + +
+
{L_NO_MEMBER}
+
+ diff --git a/styles/prosilver/template/mobile_bet.html b/styles/prosilver/template/mobile_bet.html new file mode 100644 index 0000000..79c7728 --- /dev/null +++ b/styles/prosilver/template/mobile_bet.html @@ -0,0 +1,182 @@ + + +
+ + + + + + + {L_FINALLY} - {L_PROVISIONALLY} - {L_NOT_RATED}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_VS}{L_BET_OF}Rat.{L_RESULTS_SHORT_DOT}{L_POINTS_SHORT}
+ {bet_view.HOME_SHORT}: + {bet_view.GUEST_SHORT}{bet_view.BET_HOME}:{bet_view.BET_GUEST}{bet_view.RATING}{bet_view.GOALS_HOME}:{bet_view.GOALS_GUEST}{bet_view.POINTS}
+ {bet_edit.HOME_SHORT} + : + {bet_edit.GUEST_SHORT} + + + : + + {bet_edit.DELIVERTAG} + +     
+
+ +
+ + *  {L_DELIVERY_UNTIL} {S_DELIVERY2}
+ + + **  {L_DELIVERY_UNTIL} {S_DELIVERY3}
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_QUESTION}{L_POSSIBLE_POINTS}{L_EVALUATION}{L_BET_OF}{L_RESULT}{L_POINTS_SHORT}
{extra_view.QUESTION}{extra_view.EXTRA_POINTS}{extra_view.EVALUATION}{extra_view.BET}{extra_view.RESULT}{extra_view.BET_POINTS}
{extra_edit.QUESTION}{extra_edit.EXTRA_POINTS}{extra_edit.EVALUATION} + + + + + + +
+
+ + + +
+
{S_DBMSG}   
+
+
+
+ +
+ + + + +
+ +
{L_NO_MATCHES_ON_MATCHDAY}
+ +
{L_NO_MEMBER}
+ +
+
+
+
+ + + + + + {JOIN_LEAGUE}
+
+ +
+
+ + +
+ diff --git a/styles/prosilver/template/mobile_delivery.html b/styles/prosilver/template/mobile_delivery.html new file mode 100644 index 0000000..ce7ca05 --- /dev/null +++ b/styles/prosilver/template/mobile_delivery.html @@ -0,0 +1,12 @@ + + + + {delivery.DELIVERY}
+ {delivery.LEAGUE_SHORT} {delivery.MATCHDAY_NAME} +

+ + +
+
{L_NO_DELIVERY}
+
+ diff --git a/styles/prosilver/template/mobile_football_body.html b/styles/prosilver/template/mobile_football_body.html new file mode 100644 index 0000000..42a3d26 --- /dev/null +++ b/styles/prosilver/template/mobile_football_body.html @@ -0,0 +1,179 @@ + + + + +
+ {L_INFORMATION}: {S_FOOTBALL_INFO} +
+ + +
+ + +
+
+
+ +
+ + {S_DELIVERY} + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/styles/prosilver/template/mobile_football_print.html b/styles/prosilver/template/mobile_football_print.html new file mode 100644 index 0000000..aef99b9 --- /dev/null +++ b/styles/prosilver/template/mobile_football_print.html @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + +{META} +{SITENAME} • {PAGE_TITLE} + + + + +
+ + + + +
+
{PAGE_NUMBER}
+ + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + diff --git a/styles/prosilver/template/mobile_last_users.html b/styles/prosilver/template/mobile_last_users.html new file mode 100644 index 0000000..e6137e2 --- /dev/null +++ b/styles/prosilver/template/mobile_last_users.html @@ -0,0 +1,3 @@ + + {last_users.USER_NAME}
{last_users.LAST_VISIT_DATE}
+ diff --git a/styles/prosilver/template/mobile_my_bets.html b/styles/prosilver/template/mobile_my_bets.html new file mode 100644 index 0000000..c240bcf --- /dev/null +++ b/styles/prosilver/template/mobile_my_bets.html @@ -0,0 +1,158 @@ + + +
+

{L_BETS_OF} :

+
+
+ + + + + +
+
+
+ +
+

{L_BETS_OF} {USERNAME}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_BET}{L_NUMBER}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL_SHORT}{L_POINTS_SHORT}Ø {L_POINTS_SHORT}
{bets.GOALSHOME}:{bets.GOALSGUEST}{bets.COUNT}{bets.TENDENCIES}{bets.DIRECTHITS}{bets.TOTAL}{bets.POINTS}{bets.AVERAGE}
+
+ +
{L_NO_DATA}
+ +
+
+

{L_BETS_OF_ALL}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_BET}{L_NUMBER}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL_SHORT}{L_POINTS_SHORT}Ø {L_POINTS_SHORT}
{allbets.GOALSHOME}:{allbets.GOALSGUEST}{allbets.COUNT}{allbets.TENDENCIES}{allbets.DIRECTHITS}{allbets.TOTAL}{allbets.POINTS}{allbets.AVERAGE}
+
+ +
{L_NO_DATA}
+ +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
 {L_HOME}{L_DRAW}{L_AWAY}
{bets_wdl.SCORE}{bets_wdl.HOMEWIN}{bets_wdl.DRAW}{bets_wdl.GUESTWIN}
+
+ +
{L_NO_DATA}
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + +
 {L_HOME}{L_DRAW}{L_AWAY}
{bets_wdl_all.SCORE}{bets_wdl_all.HOMEWIN}{bets_wdl_all.DRAW}{bets_wdl_all.GUESTWIN}
+
+ +
{L_NO_DATA}
+ +
+
+
+ + +
+
{L_NO_BETS}
+
+
+ + + diff --git a/styles/prosilver/template/mobile_my_chart.html b/styles/prosilver/template/mobile_my_chart.html new file mode 100644 index 0000000..f7997de --- /dev/null +++ b/styles/prosilver/template/mobile_my_chart.html @@ -0,0 +1,131 @@ + +
+

{L_CHART_OF} :

+ + +
+
+ + + + + + + + +
+
+ + {USERNAME1} + + + +
+
+ + + + + + + + +
+
+ + {USERNAME2} + + + +
+
+ + + + + + + + +
+
+ + {USERNAME3} + + + +
+
+ + + + + + + + +
+
+ + {USERNAME4} + +
+ +
+ {L_MYCHART_TEXT} + +
+
+
+ +

{L_TOTAL_RANKS_OF_ALL}

+
+ {chart_rank.CHARTIMAGE} +
+ +
+
+
+
+ +

{L_DAY_RANKS_OF_ALL}

+
+ {chart_matchtdays.CHARTIMAGE} +
+ +
+
+
+
+ +

{L_DAY_POINTS_OF_ALL}

+
+ {chart_points.CHARTIMAGE} +
+ +
+
+
+ + +
+
{L_NO_BETS}
+
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/mobile_my_koeff.html b/styles/prosilver/template/mobile_my_koeff.html new file mode 100644 index 0000000..1eef129 --- /dev/null +++ b/styles/prosilver/template/mobile_my_koeff.html @@ -0,0 +1,101 @@ + + +
+

{L_KOEFF_OF} :

+
+
+ + + + + +
+
+
+ + + + +

{L_KOEFF_OF} {USERNAME}:

+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

{match_panel.match_entry.HOME_NAME}
{match_panel.match_entry.GUEST_NAME}
{L_RESULT}{match_panel.match_entry.RESULT}{L_TOTAL}
{L_TENDENCY}{match_panel.tendency_footer.tendency.TENDENCY}{match_panel.tendency_footer.SUMTOTAL}
{match_panel.user_row.USER_NAME}{match_panel.user_row.bet.BET}{match_panel.user_row.bet.POINTS}{match_panel.user_row.points.POINTS_TOTAL}
+
+
+ +
+ + + + + + + + + +
+
{L_NO_MATCHES_ON_MATCHDAY}
+
+ diff --git a/styles/prosilver/template/mobile_my_points.html b/styles/prosilver/template/mobile_my_points.html new file mode 100644 index 0000000..4795fa7 --- /dev/null +++ b/styles/prosilver/template/mobile_my_points.html @@ -0,0 +1,112 @@ + + +
+

{L_POINTS_OF} :

+
+
+ + + + + +
+
+
+ +
+

{L_POINTS_OF} {USERNAME}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_BETS}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_DIRECTHITS_SHORT}{L_TENDENCY_SHORT}{L_TOTAL_SHORT}{L_POINTS_SHORT}
{points.RANK}{points.TEAM}{points.COUNT}{points.WIN}{points.DRAW}{points.LOST}{points.DIRECTHITS}{points.TENDENCIES}{points.TOTAL}{points.POINTS}
+
+ +
{L_NO_DATA}
+ +
+
+

{L_POINTS_OF_ALL}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_DIRECTHITS_SHORT}{L_TENDENCY_SHORT}{L_TOTAL_SHORT}{L_POINTS_SHORT}
{allpoints.RANK}{allpoints.TEAM}{allpoints.WIN}{allpoints.DRAW}{allpoints.LOST}{allpoints.DIRECTHITS}{allpoints.TENDENCIES}{allpoints.TOTAL}{allpoints.POINTS}
+
+ +
{L_NO_DATA}
+ +
+
+
+ + +
+
{L_NO_BETS}
+
+
+ + + diff --git a/styles/prosilver/template/mobile_my_rank.html b/styles/prosilver/template/mobile_my_rank.html new file mode 100644 index 0000000..7e44395 --- /dev/null +++ b/styles/prosilver/template/mobile_my_rank.html @@ -0,0 +1,107 @@ + + +
+

{L_RANKS_OF} :

+
+
+ + + + + +
+
+
+ +
+

{L_RANKS_OF} {USERNAME}

+
+ + + + + + + + + + + + + + + + + + + + + + + +
{L_SEASON}{L_PARTICIPANTS_SHORT}{L_POINTS_SHORT}{L_RANK1}{L_RANK2}{L_RANK3}
{myrank.SEASON}{myrank.MATCHDAYS}{myrank.POINTS}{myrank.RANK1}{myrank.RANK2}{myrank.RANK3}
+
+
+
+ + + + + + + + + + + + + + + +
{L_PLACE}{L_NUMBER}
{season_ranks.RANK}{season_ranks.MATCHDAYS}
+
+
+
+

{L_RANKS_OF_ALL}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_NAME}{L_PARTICIPANTS_SHORT}{L_POINTS_SHORT}Ø {L_POINTS_SHORT}{L_RANK1}{L_RANK2}{L_RANK3}
{allranks.NAME}{allranks.MATCHDAYS}{allranks.POINTS}{allranks.AVERAGE}{allranks.RANK1}{allranks.RANK2}{allranks.RANK3}
+
+
+
+
+ + +
+
{L_NO_BETS}
+
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/mobile_my_table.html b/styles/prosilver/template/mobile_my_table.html new file mode 100644 index 0000000..8872a9a --- /dev/null +++ b/styles/prosilver/template/mobile_my_table.html @@ -0,0 +1,216 @@ + +
+

{L_USER_TABLE} :

+ +
+
+ + + + + +
+
+ +

{USERNAME}

+ +
+
+

{L_TABLE_TOTAL}

+ {L_POINTS_DIFF} = {S_PDIFF} {L_POINTS} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_POINTS_SHORT}
{total.GROUP}
{total.RANK}{total.TEAM}{total.GAMES}{total.WIN}{total.DRAW}{total.LOST}{total.GOALS}:{total.GOALS_AGAINST}{total.POINTS}
+
+
+
+

{L_TABLE_FORM}

+ {TEXT_FORM} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{form.GROUP}
{form.RANK}{form.TEAM}{form.GAMES}{form.WIN}{form.DRAW}{form.LOST}{form.GOALS}:{form.GOALS_AGAINST}{form.GOALS_DIFF}{form.POINTS}
+
+ +
+
+
{L_NO_TABLEFORM}
+
+
+ +
+
+
+
+

{L_TABLE_HOME}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{home.GROUP}
{home.RANK}{home.TEAM}{home.GAMES}{home.WIN}{home.DRAW}{home.LOST}{home.GOALS}:{home.GOALS_AGAINST}{home.GOALS_DIFF}{home.POINTS}
+
+
+
+

{L_TABLE_AWAY}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{away.GROUP}
{away.RANK}{away.TEAM}{away.GAMES}{away.WIN}{away.DRAW}{away.LOST}{away.GOALS}:{away.GOALS_AGAINST}{away.GOALS_DIFF}{away.POINTS}
+
+
+
+
+ + +
+
{L_NO_TABLE}
+
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/mobile_nav_delivery.html b/styles/prosilver/template/mobile_nav_delivery.html new file mode 100644 index 0000000..8501d62 --- /dev/null +++ b/styles/prosilver/template/mobile_nav_delivery.html @@ -0,0 +1,22 @@ + + +
+ \ No newline at end of file diff --git a/styles/prosilver/template/mobile_odds.html b/styles/prosilver/template/mobile_odds.html new file mode 100644 index 0000000..cb6ff2a --- /dev/null +++ b/styles/prosilver/template/mobile_odds.html @@ -0,0 +1,35 @@ + +
+ + + + + + + + + + + + + + + + + + + + + +
{L_VS}%Quoten
+ {odds.HOME_NAME}: + {odds.GUEST_NAME}{odds.TREND}{odds.ODD_1}{odds.ODD_X}{odds.ODD_2}
+
+
+ + +
+
{L_NO_PLAN}
+
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/mobile_ranks.html b/styles/prosilver/template/mobile_ranks.html new file mode 100644 index 0000000..c49e92b --- /dev/null +++ b/styles/prosilver/template/mobile_ranks.html @@ -0,0 +1,51 @@ + + +
+

{S_HEADER}

+
+ +
+ {L_FINALLY} - {L_PROVISIONALLY} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_PLACE}{L_TENDENCY}{L_NAME}{L_BETS}{L_POINTS}{WIN_NAME}
{rankstotal.RANK}{rankstotal.CHANGE_IMG} {rankstotal.CHANGE_DIFFER}{rankstotal.USERNAME}{rankstotal.BETS}{rankstotal.POINTS}{rankstotal.WIN}
+
+ +
+
{L_NO_RESULTS}
+
+ + diff --git a/styles/prosilver/template/mobile_results.html b/styles/prosilver/template/mobile_results.html new file mode 100644 index 0000000..96b0c4e --- /dev/null +++ b/styles/prosilver/template/mobile_results.html @@ -0,0 +1,141 @@ + + +
+
+ + + + + + + {L_FINALLY} - {L_PROVISIONALLY} - {L_NOT_RATED} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_VS}{L_RESULT} ({RESULT_EXPLAIN}){LABEL_FINALRESULT}
+ {result.HOME_SHORT}: + {result.GUEST_SHORT} + + + : + + + + + + + +   + + : + + + + +   + + {result.GOALS_HOME}:{result.GOALS_GUEST}{result.KOGOALS_HOME}:{result.KOGOALS_GUEST}
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
{L_QUESTION}{L_POSSIBLE_POINTS}{L_EVALUATION}{L_RESULT}
{extra_result.QUESTION}{extra_result.EXTRA_POINTS}{extra_result.EVALUATION} + + + + + + _{extra_result.RESULT}_ + + + + + + + {extra_result.RESULT} + +
+
+ + + +
+
{S_DBMSG}   
+
+
+
+ +
+ +
{L_NO_MEMBER}
+ +
+
+ + + +
{L_NO_PLAN}
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/mobile_stat_points.html b/styles/prosilver/template/mobile_stat_points.html new file mode 100644 index 0000000..b718449 --- /dev/null +++ b/styles/prosilver/template/mobile_stat_points.html @@ -0,0 +1,136 @@ + +
+

{L_TOP20_POINTS}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_NAME}{L_MATCHDAY_SHORT}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL_SHORT}{L_POINTS_SHORT}{L_EUR}
{top20.NAME}{top20.MATCHDAY}{top20.TENDENCIES}{top20.DIRECTHITS}{top20.TOTAL}{top20.POINTS}{top20.WIN}
+
+
+
+

{L_FLOP20_POINTS}

+
+ + + + + + + + + + + + + + + + + + + + + + + +
{L_NAME}{L_MATCHDAY_SHORT}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL_SHORT}{L_POINTS_SHORT}
{flop20.NAME}{flop20.MATCHDAY}{flop20.TENDENCIES}{flop20.DIRECTHITS}{flop20.TOTAL}{flop20.POINTS}
+
+
+
+
+
+

{L_TOP20_POINTS_ALL}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_NAME}{L_SEASON}{L_MATCHDAY_SHORT}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL_SHORT}{L_POINTS_SHORT}{L_EUR}
{alltop20.NAME}{alltop20.SEASON}{alltop20.MATCHDAY}{alltop20.TENDENCIES}{alltop20.DIRECTHITS}{alltop20.TOTAL}{alltop20.POINTS}{alltop20.WIN}
+
+
+
+

{L_FLOP20_POINTS_ALL}

+
+ + + + + + + + + + + + + + + +
{L_NAME}{L_ZERO_POINTS}
{allflop20.NAME}{allflop20.COUNTZERO}
+
+
+
+
+ + +
+
{L_NO_BETS}
+
+
+ + + diff --git a/styles/prosilver/template/mobile_stat_results.html b/styles/prosilver/template/mobile_stat_results.html new file mode 100644 index 0000000..a5f913e --- /dev/null +++ b/styles/prosilver/template/mobile_stat_results.html @@ -0,0 +1,85 @@ + +
+

{L_STAT_GAME_RESULTS}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RESULT}{L_NUMBER}{L_BETS}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL_SHORT}{L_POINTS_SHORT}Ø {L_POINTS_SHORT}
{result.GOALS_HOME}:{result.GOALS_GUEST}{result.RESULTS}{result.BETS}{result.TENDENCIES}{result.HITS}{result.TOTAL}{result.POINTS}{result.AVERAGE}
+
+
+
+

{L_DIFF_COUNT}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}<-2-1 0+1+2>{L_GOALS_DIFF_SHORT}
{points.RANK}{points.TEAM}{points.MATCHES}{points.MINUS3}{points.MINUS2}{points.MINUS1}{points.DRAW}{points.PLUS1}{points.PLUS2}{points.PLUS3}{points.GOALS_DIFF}
+
+
+
+
+ + +
+
{L_NO_RESULTS}
+
+
+ + + diff --git a/styles/prosilver/template/mobile_table.html b/styles/prosilver/template/mobile_table.html new file mode 100644 index 0000000..67d83c0 --- /dev/null +++ b/styles/prosilver/template/mobile_table.html @@ -0,0 +1,203 @@ + +
+

{L_TABLE_TOTAL}

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{total.GROUP}
{total.RANK}{total.TEAM_SHORT}{total.GAMES}{total.WIN}{total.DRAW}{total.LOST}{total.GOALS}:{total.GOALS_AGAINST}{total.GOALS_DIFF}{total.POINTS}
+
+
+ +
+

{L_TABLE_FORM}

+ {TEXT_FORM} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{form.GROUP}
{form.RANK}{form.TEAM_SHORT}{form.GAMES}{form.WIN}{form.DRAW}{form.LOST}{form.GOALS}:{form.GOALS_AGAINST}{form.GOALS_DIFF}{form.POINTS}
+
+ +
+
+
{L_NO_TABLEFORM}
+
+
+ +
+
+
+
+

{L_TABLE_HOME}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{home.GROUP}
{home.RANK}{home.TEAM_SHORT}{home.GAMES}{home.WIN}{home.DRAW}{home.LOST}{home.GOALS}:{home.GOALS_AGAINST}{home.GOALS_DIFF}{home.POINTS}
+
+
+
+

{L_TABLE_AWAY}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{away.GROUP}
{away.RANK}{away.TEAM_SHORT}{away.GAMES}{away.WIN}{away.DRAW}{away.LOST}{away.GOALS}:{away.GOALS_AGAINST}{away.GOALS_DIFF}{away.POINTS}
+
+
+ +
+
+ + + +
+
{L_NO_TABLE}
+
+
+ + + diff --git a/styles/prosilver/template/mobile_under_construction.html b/styles/prosilver/template/mobile_under_construction.html new file mode 100644 index 0000000..a5d4c3a --- /dev/null +++ b/styles/prosilver/template/mobile_under_construction.html @@ -0,0 +1,6 @@ +
+

{L_UNDER_CONSTRUCTION}

+
+
+ {L_UNDER_CONSTRUCTION_EXPLAIN} +
diff --git a/styles/prosilver/template/mobile_viewplan_popup.html b/styles/prosilver/template/mobile_viewplan_popup.html new file mode 100644 index 0000000..8a4cf71 --- /dev/null +++ b/styles/prosilver/template/mobile_viewplan_popup.html @@ -0,0 +1,57 @@ + + + +
+
+ +
+ + {L_WON} - {L_DRAW} - {L_LOST} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_DATE}{L_GR}{L_VS}{L_RESULT}
{match.MATCH_TIME}{match.GROUP}{match.HOME_NAME}:{match.GUEST_NAME}{match.GOALS_HOME}:{match.GOALS_GUEST}
+
+ +
+
{S_ERROR_MESSAGE}
+
+ + +
+ \ No newline at end of file diff --git a/styles/prosilver/template/my_bets.html b/styles/prosilver/template/my_bets.html new file mode 100644 index 0000000..cecc4f8 --- /dev/null +++ b/styles/prosilver/template/my_bets.html @@ -0,0 +1,158 @@ + + +
+

{L_BETS_OF} :

+
+
+ + + + + +
+
+
+ +
+

{L_BETS_OF} {USERNAME}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_BET}{L_NUMBER}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL}{L_POINTS}Ø {L_POINTS_SHORT}
{bets.GOALSHOME}:{bets.GOALSGUEST}{bets.COUNT}{bets.TENDENCIES}{bets.DIRECTHITS}{bets.TOTAL}{bets.POINTS}{bets.AVERAGE}
+
+ +
{L_NO_DATA}
+ +
+
+

{L_BETS_OF_ALL}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_BET}{L_NUMBER}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL}{L_POINTS}Ø {L_POINTS_SHORT}
{allbets.GOALSHOME}:{allbets.GOALSGUEST}{allbets.COUNT}{allbets.TENDENCIES}{allbets.DIRECTHITS}{allbets.TOTAL}{allbets.POINTS}{allbets.AVERAGE}
+
+ +
{L_NO_DATA}
+ +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
 {L_HOME}{L_DRAW}{L_AWAY}
{bets_wdl.SCORE}{bets_wdl.HOMEWIN}{bets_wdl.DRAW}{bets_wdl.GUESTWIN}
+
+ +
{L_NO_DATA}
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + +
 {L_HOME}{L_DRAW}{L_AWAY}
{bets_wdl_all.SCORE}{bets_wdl_all.HOMEWIN}{bets_wdl_all.DRAW}{bets_wdl_all.GUESTWIN}
+
+ +
{L_NO_DATA}
+ +
+
+
+ + +
+
{L_NO_BETS}
+
+
+ + + diff --git a/styles/prosilver/template/my_chart.html b/styles/prosilver/template/my_chart.html new file mode 100644 index 0000000..9add9e1 --- /dev/null +++ b/styles/prosilver/template/my_chart.html @@ -0,0 +1,131 @@ + +
+

{L_CHART_OF} :

+ + +
+
+ + + + + + + + +
+
+ + {USERNAME1} + + + +
+
+ + + + + + + + +
+
+ + {USERNAME2} + + + +
+
+ + + + + + + + +
+
+ + {USERNAME3} + + + +
+
+ + + + + + + + +
+
+ + {USERNAME4} + +
+ +
+ {L_MYCHART_TEXT} + +
+
+
+ +

{L_TOTAL_RANKS_OF_ALL}

+
+ {chart_rank.CHARTIMAGE} +
+ +
+
+
+
+ +

{L_DAY_RANKS_OF_ALL}

+
+ {chart_matchtdays.CHARTIMAGE} +
+ +
+
+
+
+ +

{L_DAY_POINTS_OF_ALL}

+
+ {chart_points.CHARTIMAGE} +
+ +
+
+
+ + +
+
{L_NO_BETS}
+
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/my_koeff.html b/styles/prosilver/template/my_koeff.html new file mode 100644 index 0000000..0e41078 --- /dev/null +++ b/styles/prosilver/template/my_koeff.html @@ -0,0 +1,106 @@ + + +
+

{L_KOEFF_OF} :

+
+
+ + + + + +
+
+
+ + + + + + +

{L_KOEFF_OF} {USERNAME}:

+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

{match_panel.match_entry.HOME_NAME}
{match_panel.match_entry.GUEST_NAME}
{L_RESULT}{match_panel.match_entry.RESULT}{L_TOTAL}
{L_TENDENCY}{match_panel.tendency_footer.tendency.TENDENCY}{match_panel.tendency_footer.SUMTOTAL}
{match_panel.user_row.USER_NAME}{match_panel.user_row.bet.BET}{match_panel.user_row.bet.POINTS}{match_panel.user_row.points.POINTS_TOTAL}
+
+
+ +
+ + + + + + + + + +
+
{L_NO_MATCHES_ON_MATCHDAY}
+
+ diff --git a/styles/prosilver/template/my_points.html b/styles/prosilver/template/my_points.html new file mode 100644 index 0000000..9c2bfd8 --- /dev/null +++ b/styles/prosilver/template/my_points.html @@ -0,0 +1,118 @@ + + +
+

{L_POINTS_OF} :

+
+
+ + + + + +
+
+
+ +
+

{L_POINTS_OF} {USERNAME}

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_BETS}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_DIRECTHITS_SHORT}{L_TENDENCY_SHORT}{L_TOTAL}{L_POINTS_SHORT}
{points.RANK}{points.TEAM}{points.COUNT}{points.WIN}{points.DRAW}{points.LOST}{points.DIRECTHITS}{points.TENDENCIES}{points.TOTAL}{points.POINTS}
+
+
+ +
{L_NO_DATA}
+ +
+
+

{L_POINTS_OF_ALL}

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_BETS}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_DIRECTHITS_SHORT}{L_TENDENCY_SHORT}{L_TOTAL}{L_POINTS_SHORT}
{allpoints.RANK}{allpoints.TEAM}{allpoints.COUNT}{allpoints.WIN}{allpoints.DRAW}{allpoints.LOST}{allpoints.DIRECTHITS}{allpoints.TENDENCIES}{allpoints.TOTAL}{allpoints.POINTS}
+
+
+ +
{L_NO_DATA}
+ +
+
+
+ + +
+
{L_NO_BETS}
+
+
+ + + diff --git a/styles/prosilver/template/my_rank.html b/styles/prosilver/template/my_rank.html new file mode 100644 index 0000000..297a98b --- /dev/null +++ b/styles/prosilver/template/my_rank.html @@ -0,0 +1,107 @@ + + +
+

{L_RANKS_OF} :

+
+
+ + + + + +
+
+
+ +
+

{L_RANKS_OF} {USERNAME}

+
+ + + + + + + + + + + + + + + + + + + + + + + +
{L_SEASON}{L_PARTICIPANTS_SHORT}{L_POINTS_SHORT}{L_RANK1}{L_RANK2}{L_RANK3}
{myrank.SEASON}{myrank.MATCHDAYS}{myrank.POINTS}{myrank.RANK1}{myrank.RANK2}{myrank.RANK3}
+
+
+
+ + + + + + + + + + + + + + + +
{L_PLACE}{L_NUMBER}
{season_ranks.RANK}{season_ranks.MATCHDAYS}
+
+
+
+

{L_RANKS_OF_ALL}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_NAME}{L_PARTICIPANTS_SHORT}{L_POINTS_SHORT}Ø {L_POINTS_SHORT}{L_RANK1}{L_RANK2}{L_RANK3}
{allranks.NAME}{allranks.MATCHDAYS}{allranks.POINTS}{allranks.AVERAGE}{allranks.RANK1}{allranks.RANK2}{allranks.RANK3}
+
+
+
+
+ + +
+
{L_NO_BETS}
+
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/my_table.html b/styles/prosilver/template/my_table.html new file mode 100644 index 0000000..0b30d37 --- /dev/null +++ b/styles/prosilver/template/my_table.html @@ -0,0 +1,218 @@ + +
+

{L_USER_TABLE} :

+ +
+
+ + + + + +
+
+ +

{USERNAME}

+ +
+
+

{L_TABLE_TOTAL}

+ {L_POINTS_DIFF} = {S_PDIFF} {L_POINTS} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{total.GROUP}
{total.RANK}{total.TEAM}{total.GAMES}{total.WIN}{total.DRAW}{total.LOST}{total.GOALS}:{total.GOALS_AGAINST}{total.GOALS_DIFF}{total.POINTS}
+
+
+
+

{L_TABLE_FORM}

+ {TEXT_FORM} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{form.GROUP}
{form.RANK}{form.TEAM}{form.GAMES}{form.WIN}{form.DRAW}{form.LOST}{form.GOALS}:{form.GOALS_AGAINST}{form.GOALS_DIFF}{form.POINTS}
+
+ +
+
+
{L_NO_TABLEFORM}
+
+
+ +
+
+
+
+

{L_TABLE_HOME}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{home.GROUP}
{home.RANK}{home.TEAM}{home.GAMES}{home.WIN}{home.DRAW}{home.LOST}{home.GOALS}:{home.GOALS_AGAINST}{home.GOALS_DIFF}{home.POINTS}
+
+
+
+

{L_TABLE_AWAY}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{away.GROUP}
{away.RANK}{away.TEAM}{away.GAMES}{away.WIN}{away.DRAW}{away.LOST}{away.GOALS}:{away.GOALS_AGAINST}{away.GOALS_DIFF}{away.POINTS}
+
+
+
+
+ + +
+
{L_NO_TABLE}
+
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/nav_delivery.html b/styles/prosilver/template/nav_delivery.html new file mode 100644 index 0000000..848ac5c --- /dev/null +++ b/styles/prosilver/template/nav_delivery.html @@ -0,0 +1,21 @@ + + + diff --git a/styles/prosilver/template/odds.html b/styles/prosilver/template/odds.html new file mode 100644 index 0000000..4be85d2 --- /dev/null +++ b/styles/prosilver/template/odds.html @@ -0,0 +1,68 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_DATE}{L_GR}{L_VS}{L_RESULT} ({RESULT_EXPLAIN}){LABEL_FINALRESULT}%Quoten
{odds.MATCH_TIME}{odds.GROUP} + {odds.HOME_NAME}: + {odds.GUEST_NAME}{odds.GOALS_HOME}:{odds.GOALS_GUEST}{odds.KOGOALS_HOME}:{odds.KOGOALS_GUEST}{odds.TREND} + + + + + + {odds.ODD_1}{odds.ODD_X}{odds.ODD_2}
+
+ +
+
+
+ + +
+
{L_NO_PLAN}
+
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/rank_matchday.html b/styles/prosilver/template/rank_matchday.html new file mode 100644 index 0000000..8adb799 --- /dev/null +++ b/styles/prosilver/template/rank_matchday.html @@ -0,0 +1,32 @@ +
+

 {L_RANK_MATCHDAY}

+ + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT_DOT}{L_NAME}{L_POINTS_SHORT_DOT}{WIN_NAME}
{rank.RANK}{rank.USERNAME}{rank.POINTS}{rank.WIN}
+ +
{L_NO_RESULTS}
+
+ +
diff --git a/styles/prosilver/template/rank_total.html b/styles/prosilver/template/rank_total.html new file mode 100644 index 0000000..9da417f --- /dev/null +++ b/styles/prosilver/template/rank_total.html @@ -0,0 +1,37 @@ +
+

+   + + {L_RANK_TOTAL} +

+ + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT_DOT}{L_NAME}{L_POINTS_SHORT_DOT}{WIN_NAME}
{ranktotal.RANK}{ranktotal.USERNAME}{ranktotal.POINTS}{ranktotal.WIN}
+ +
{L_NO_RESULTS}
+
+ +
\ No newline at end of file diff --git a/styles/prosilver/template/ranks.html b/styles/prosilver/template/ranks.html new file mode 100644 index 0000000..0b8f5fb --- /dev/null +++ b/styles/prosilver/template/ranks.html @@ -0,0 +1,108 @@ + + +
+

{S_HEADER}

+
+ +
+ {L_FINALLY} - {L_PROVISIONALLY} +
+ + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_PLACE}{L_TENDENCY}{L_NAME}{L_SEASON}{L_PLACE}{L_BETS}{L_NO_BET}{L_TENDENCIES}{L_DIRECTHITS}{L_DIRECTHITS02}{L_POINTS}{WIN_NAME}
{rankstotal.RANK}{rankstotal.CHANGE_SIGN}{rankstotal.CHANGE_IMG}{rankstotal.CHANGE_DIFFER}{rankstotal.USERNAME}{rankstotal.SEASON}{rankstotal.SEASON_RANK}{rankstotal.BETS}{rankstotal.NOBETS}{rankstotal.TENDENCIES}{rankstotal.DIRECTHITS}{rankstotal.DIRECTHITS02}{rankstotal.POINTS}{rankstotal.WIN}
+
+ +
+ + {L_RANKING} • + + + {L_RANKING_ALL_TIME} + + + + {L_RANKING_COMPARE} + +
+ + + + + + + + + + +
+
{L_NO_RESULTS}
+
+ diff --git a/styles/prosilver/template/results.html b/styles/prosilver/template/results.html new file mode 100644 index 0000000..026e5bb --- /dev/null +++ b/styles/prosilver/template/results.html @@ -0,0 +1,171 @@ + + +
+
+ + {L_FINALLY} - {L_PROVISIONALLY} - {L_NOT_RATED}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_DATE}{L_NR}{L_GR}{L_VS}{L_RESULT} ({RESULT_EXPLAIN}){LABEL_FINALRESULT}
{result.MATCH_TIME}{result.MATCH_NUMBER}{result.GROUP} + {result.HOME_NAME}: + {result.GUEST_NAME} + + + + + _{result.RESULT_HOME}_ + + : + + + + + _{result.RESULT_GUEST}_ + + + + + + + +   + + + _{result.KORESULT_HOME}_ + + : + + + + + +   + + + _{result.KORESULT_GUEST}_ + + {result.GOALS_HOME}:{result.GOALS_GUEST}{result.KOGOALS_HOME}:{result.KOGOALS_GUEST}
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + +
{L_QUESTION}{L_POSSIBLE_POINTS}{L_EVALUATION}{L_RESULT}
{extra_result.QUESTION}{extra_result.EXTRA_POINTS}{extra_result.EVALUATION} + + + + + + _{extra_result.RESULT}_ + + + + + + + _{extra_result.RESULT}_ + + + + {extra_result.RESULT} + +
+
+ + + + +
+
{S_DBMSG}   
+
+ +
+ +
+ +
{L_NO_MEMBER}
+ +
+
+ + + + +
+
{L_NO_PLAN}
+
+
+ \ No newline at end of file diff --git a/styles/prosilver/template/rules_popup.html b/styles/prosilver/template/rules_popup.html new file mode 100644 index 0000000..c6c5b30 --- /dev/null +++ b/styles/prosilver/template/rules_popup.html @@ -0,0 +1,70 @@ + + + +
+
+ +
+ +

+ + {LINK_RULES} + + {L_NO_LINK_RULES} + +

+ {L_RULES_EXPLAIN} +
+ +

{L_JOIN_MODE}

+ {JOIN_MODE}
+ +

{L_POINTS}

+ {POINTS_HIT} + {POINTS_DIFF} + {POINTS_TENDENCY} + {POINTS_LAST} + +

{L_DELIVERY}

+ + {L_BET_IN_TIME} + + {L_BET_UNTIL_DELIVERY} + + +

{wintable.WIN_DESC}

+
+
+ + + + + + + + + + + + + + + +
{L_PLACE}{WIN_NAME}
{wintable.entry.RANK}{wintable.entry.WIN}
+
+
+
+ + +
+
{S_ERROR_MESSAGE}
+
+ +
+ +
+ \ No newline at end of file diff --git a/styles/prosilver/template/stat_points.html b/styles/prosilver/template/stat_points.html new file mode 100644 index 0000000..4288052 --- /dev/null +++ b/styles/prosilver/template/stat_points.html @@ -0,0 +1,137 @@ + +
+
+

{L_TOP20_POINTS}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_NAME}{L_MATCHDAY_SHORT}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL}{L_POINTS_SHORT}{L_WIN}
{top20.NAME}{top20.MATCHDAY}{top20.TENDENCIES}{top20.DIRECTHITS}{top20.TOTAL}{top20.POINTS}{top20.WIN}
+
+
+
+

{L_FLOP20_POINTS}

+
+ + + + + + + + + + + + + + + + + + + + + + + +
{L_NAME}{L_MATCHDAY_SHORT}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL}{L_POINTS_SHORT}
{flop20.NAME}{flop20.MATCHDAY}{flop20.TENDENCIES}{flop20.DIRECTHITS}{flop20.TOTAL}{flop20.POINTS}
+
+
+
+
+
+

{L_TOP20_POINTS_ALL}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_NAME}{L_SEASON}{L_MATCHDAY_SHORT}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL}{L_POINTS_SHORT}{L_WIN}
{alltop20.NAME}{alltop20.SEASON}{alltop20.MATCHDAY}{alltop20.TENDENCIES}{alltop20.DIRECTHITS}{alltop20.TOTAL}{alltop20.POINTS}{alltop20.WIN}
+
+
+
+

{L_FLOP20_POINTS_ALL}

+
+ + + + + + + + + + + + + + + +
{L_NAME}{L_ZERO_POINTS}
{allflop20.NAME}{allflop20.COUNTZERO}
+
+
+
+
+ + +
+
{L_NO_BETS}
+
+
+ + + diff --git a/styles/prosilver/template/stat_results.html b/styles/prosilver/template/stat_results.html new file mode 100644 index 0000000..13044fc --- /dev/null +++ b/styles/prosilver/template/stat_results.html @@ -0,0 +1,87 @@ + +
+

{L_STAT_GAME_RESULTS}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RESULT}{L_NUMBER}{L_BETS}{L_TENDENCY_SHORT}{L_HITS_SHORT}{L_TOTAL}{L_POINTS}Ø {L_POINTS_SHORT}
{result.GOALS_HOME}:{result.GOALS_GUEST}{result.RESULTS}{result.BETS}{result.TENDENCIES}{result.HITS}{result.TOTAL}{result.POINTS}{result.AVERAGE}
+
+
+
+

{L_DIFF_COUNT}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}<-2-1 0+1+2>{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{points.RANK}{points.TEAM}{points.MATCHES}{points.MINUS3}{points.MINUS2}{points.MINUS1}{points.DRAW}{points.PLUS1}{points.PLUS2}{points.PLUS3}{points.GOALS_DIFF}{points.POINTS}
+
+
+
+
+ + +
+
{L_NO_RESULTS}
+
+
+ + + diff --git a/styles/prosilver/template/table.html b/styles/prosilver/template/table.html new file mode 100644 index 0000000..5556e41 --- /dev/null +++ b/styles/prosilver/template/table.html @@ -0,0 +1,206 @@ + +
+

{L_TABLE_TOTAL}

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{total.GROUP}
{total.RANK}{total.TEAM_SHORT}{total.GAMES}{total.WIN}{total.DRAW}{total.LOST}{total.GOALS}:{total.GOALS_AGAINST}{total.GOALS_DIFF}{total.POINTS}
+
+
+ +
+

{L_TABLE_FORM}

+ {TEXT_FORM} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{form.GROUP}
{form.RANK}{form.TEAM_SHORT}{form.GAMES}{form.WIN}{form.DRAW}{form.LOST}{form.GOALS}:{form.GOALS_AGAINST}{form.GOALS_DIFF}{form.POINTS}
+
+ +
+
+
{L_NO_TABLEFORM}
+
+
+ +
+
+
+
+

{L_TABLE_HOME}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{home.GROUP}
{home.RANK}{home.TEAM_SHORT}{home.GAMES}{home.WIN}{home.DRAW}{home.LOST}{home.GOALS}:{home.GOALS_AGAINST}{home.GOALS_DIFF}{home.POINTS}
+
+
+
+

{L_TABLE_AWAY}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_SHORT}{L_TEAM}{L_GAMES_SHORT}{L_WIN_SHORT}{L_DRAW_SHORT}{L_LOST_SHORT}{L_GOALS}{L_GOALS_DIFF_SHORT}{L_POINTS_SHORT}
{away.GROUP}
{away.RANK}{away.TEAM_SHORT}{away.GAMES}{away.WIN}{away.DRAW}{away.LOST}{away.GOALS}:{away.GOALS_AGAINST}{away.GOALS_DIFF}{away.POINTS}
+
+
+ +
+
+ + +
+
{L_NO_TABLE}
+
+
+ + + diff --git a/styles/prosilver/template/under_construction.html b/styles/prosilver/template/under_construction.html new file mode 100644 index 0000000..a5d4c3a --- /dev/null +++ b/styles/prosilver/template/under_construction.html @@ -0,0 +1,6 @@ +
+

{L_UNDER_CONSTRUCTION}

+
+
+ {L_UNDER_CONSTRUCTION_EXPLAIN} +
diff --git a/styles/prosilver/template/viewplan_popup.html b/styles/prosilver/template/viewplan_popup.html new file mode 100644 index 0000000..0f519a8 --- /dev/null +++ b/styles/prosilver/template/viewplan_popup.html @@ -0,0 +1,57 @@ + + + +
+
+ +
+ + {L_WON} - {L_DRAW} - {L_LOST} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_DATE}{L_GR}{L_VS}{L_RESULT}
{match.MATCH_TIME}{match.GROUP}{match.HOME_NAME}:{match.GUEST_NAME}{match.GOALS_HOME}:{match.GOALS_GUEST}
+
+ +
+
{S_ERROR_MESSAGE}
+
+ + +
+ \ No newline at end of file diff --git a/styles/prosilver/theme/football.css b/styles/prosilver/theme/football.css new file mode 100644 index 0000000..eedb189 --- /dev/null +++ b/styles/prosilver/theme/football.css @@ -0,0 +1,324 @@ +/* ----------------------------------------------------------------------------------------- + * @package phpBB Extension - Football Football + * @copyright (c) 2016 football (http://football.bplaced.net) + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * ----------------------------------------------------------------------------------------- */ + +.football-table-scroll { + overflow-x:auto; + overflow-y:visible; + width: 100%; +} + +#football-links { + margin: 0 7px 0 0; +} + +#football-links a.responsive-menu-link { + display: block; + font-size: inherit; + line-height: inherit; + margin: 0; + width: auto; +} + +#football-links a.responsive-menu-link:before { + font-size: 16px; + line-height: 16.5px; +} + +.compact #football-links a.responsive-menu-link { + font-size: 0; +} + + +span.small-icon { + display: inline-block; + vertical-align: top; + overflow: hidden; + width: 16px; + height: 14px; +} + +.icon-allbets { background-image: url("./images/icon_allbets.gif"); } +.icon-ball { background-image: url("./images/icon_ball.gif"); } +.icon-ball2 { background-image: url("./images/icon_ball2.gif"); } +.icon-bet { background-image: url("./images/icon_bet.gif"); } +.icon-bookmark { background-image: url("./images/icon_bookmark.gif"); } +.icon-download { background-image: url("./images/icon_download.gif"); } +.icon-football { background-image: url("./images/icon_football.gif"); background-repeat: no-repeat; } +.icon-info { background-image: url("./images/icon_info.gif"); } +.icon-list { background-image: url("./images/icon_list.gif"); } +.icon-mark { background-image: url("./images/icon_mark.gif"); } +.icon-odds { background-image: url("./images/icon_odds.gif"); } +.icon-points { background-image: url("./images/icon_points.gif"); } +.icon-print { background-image: url("./images/icon_print.gif"); } +.icon-rank { background-image: url("./images/icon_rank.gif"); } +.icon-results { background-image: url("./images/icon_results.gif"); } +.icon-rules { background-image: url("./images/icon_rules.gif"); } +.icon-statistics { background-image: url("./images/icon_statistics.gif"); } +.icon-xml { background-image: url("./images/icon_xml.gif"); } + +/** +* Replacement for table layout +*/ +#football-left, #football-right { + position: relative; + float: left; +} + +.football-inner-left, .football-inner-right { + position: relative; + float: left; + width: 50%; +} + +.football-inner-left .forabg { + margin-right: 4px; +} + +.football-inner-right .forabg { + margin-left: 4px; +} + +.rtl .football-inner-left .forabg { + margin-left: 4px; +} + +.rtl .football-inner-right .forabg { + margin-right: 4px; +} + +.rtl #football-left, .rtl #football-right, .rtl .football-inner-left, .rtl .football-inner-right { + float: right; +} + +#football-center-wrapper { + width: 100%; + float: left; + display: block; +} + +.rtl #football-center-wrapper { + float: right; +} + +#football-left { + margin-left: -100%; +} + +.rtl #football-left { + margin-right: -100%; + margin-left: 0; +} + +#football-body { + padding-top: 0px; + width: 100%; +} + +#football-body .panel { + margin-bottom: 4px; +} + +#football-body { + margin-left: 0px; + margin-right: 0px; +} + +@media only screen and (max-width: 1125px), only screen and (max-device-width: 1125px) +{ + div#football-right { width: 50% !important; float: right; } + div#football-left { clear: both; width: 50% !important; float: left; margin-left: 0 !important; } + .football-inner-left { clear: both; width: 100% !important; margin: 0 !important; } + .football-inner-right { clear: both; width: 100% !important; margin: 0 !important; } + .football-inner-left .forabg, .football-inner-right .forabg {margin-left: 0px; margin-right: 0px;} + div#football-center { + margin-right: 0 !important; + margin-left: 0 !important; + padding-right: 0 !important; + padding-left: 0 !important; + } + #football-right .panel { + margin-left: 2px; + } + #football-left .panel { + margin-right: 2px; + } +} + +div.info { + background-color: #0094FF; + color: #fff; + margin: 4px 0; + font-size: 1.1em; + padding: 5px 10px; + border-radius: 7px; +} + +.construction { + background-image: url("./images/under_construction.gif"); + background-repeat: no-repeat; + height: 135px; + width: 155px; +} + +.football_bg { + margin-bottom: 5px; + padding: 0 5px; + clear: both; +} + +.football-h3 { + /* Sub-headers (also used as post headers, but defined later) */ + font-family: Arial, Helvetica, sans-serif; + font-weight: bold; + text-transform: uppercase; + font-size: 1.05em; +} + +/* Table for rank in a box */ +table.rank { font-size: 0.9em; padding: 2px !important; vertical-align: middle; border-collapse:separate; border-radius: 0px; border-spacing: 0px; width: 100%; } +table.rank thead th { font-weight: normal; text-transform: uppercase; color: #FFFFFF; padding: 0 2px 1px 2px; vertical-align: middle; } +table.rank tbody tr { border: 1px solid #cfcfcf; } +table.rank tbody tr:hover, +table.rank tbody tr.hover { background-color: #FFFFFF; color: #000000; } +table.rank td { padding: 0 2px; vertical-align: middle; } +table.rank td.td_rank { text-align: right; } +table.rank td.td_pts { text-align: right; } +table.rank td.td_wins { padding: 0 2px 0 4px; text-align: right; } + +/* Table for football data */ +/* Specific column styles */ +table.football_main { font-size: 1em; padding: 0px !important; border-collapse:collapse; border-radius: 0px; border-spacing: 0px; width: 100%; } +table.football { font-size: 1em; padding: 0px !important; border-collapse:collapse; border-radius: 0px; border-spacing: 0px; width: 100%; } +table.football th { text-align: center; color: #FFFFFF; vertical-align: middle;} +table.football thead th { font-weight: normal; text-transform: uppercase; line-height: 1.3em; padding: 0 2px 2px 2px; vertical-align: middle;} +table.football tfoot td { text-align: center; color: #FFFFFF; font-weight: normal; text-transform: uppercase; line-height: 1.3em; padding: 0 2px 2px 2px; vertical-align: middle; } +table.football thead th span { padding-left: 7px; } +table.football tbody tr:hover, +table.football tbody tr.hover { background-color: #FFFFFF; color: #000000; } +table.football tbody td { padding: 1px 2px; border-top: 1px solid #FAFAFA; vertical-align: middle;} +table.football tbody th { padding: 1px 2px; border-top: 1px solid #000000; vertical-align: middle;} +table.football tbody tr { border: 1px solid #cfcfcf; } +table.football td { vertical-align: middle; } +table.football td.td_tendency { padding: 4px 2px 0 2px; font-weight: bold; } +table.football td.td_pts_total { text-align: right; padding: 4px 4px 0 2px; } +table.football td.td_rank { text-align: right; } +table.football td.td_group { text-align: center; } +table.football td.td_hits { text-align: center; } +table.football td.td_wins { text-align: right; padding: 0 2px 0 4px; } +table.football td.td_match_no { text-align: right; } +table.football td.td_logo { text-align: center; } +table.football td.td_team { text-align: left; } +table.football td.td_team_home { text-align: right; width: 155px; } +table.football td.td_team_guest { text-align: left; width: 155px; } +table.football td.td_vs { text-align: center; max-width: 1em; padding: 0; } +table.football td.td_goals_home { text-align: right; max-width: 2em; padding: 0; } +table.football td.td_goals_guest { text-align: left; max-width: 2em; padding: 0; white-space: nowrap; } +table.football td.td_pts { text-align: right; padding: 0 2px 0 2px; white-space: nowrap; } +table.football td.td_button { text-align: right; padding-right: 4px; } +table.football td.td_result { text-align: center; } +table.football td.td_season { text-align: center; } +table.football td.td_league { text-align: center; } +table.football td.td_pts_total { text-align: right; padding: 0 4px 0 2px; } +table.football td.td_points { text-align: right; padding: 0 2em 0 2px; } +table.football td.td_fp { text-align: center; } +table.football td.td_matches { text-align: center; } +table.football td.td_diff { text-align: right; } +table.football td.td_counter { text-align: right; } +table.football td.td_name { text-align: left; } +table.football td.td_edit_right { text-align: right; white-space: nowrap; padding: 0; } +table.football td.td_edit_left { text-align: left; white-space: nowrap; padding: 0; } + +table.rank td.color_finally, table.football .color_finally, .color_finally , table.football .match_win, .match_win { + font-weight: bold; + color: #00AA00; +} + +table.rank td.color_provisionally, table.football .color_provisionally, .color_provisionally , table.football .match_lost, .match_lost { + font-weight: bold; + color: #AA0000; +} + +table.football .match_draw, .match_draw { + font-weight: bold; + color: #6A6A6A; +} + +table.rank td.color_not_rated, table.football .color_not_rated, .color_not_rated { + font-weight: bold; + color: purple; +} + +/* Links for past and future delivery */ +a.pastlink, a.futurelink { + font-size: 1.0em; + font-weight: bold; + text-decoration: none; +} + +a.pastlink { color: #CC0000 !important; } + +a.futurelink { color: #006600 !important; } + +a.pastlink:hover, a.futurelink:hover { + text-decoration: underline; +} + +a.football_print { + background-image: url("./images/icon_print.gif"); + display: inline-block; + vertical-align: top; + overflow: hidden; + width: 16px; + height: 14px; +} + +a.match_info { + display: block; + overflow: hidden; + width: 28px; + height: 28px; + text-indent: -5000px; + text-align: left; + background-repeat: no-repeat; + background-image: url("./images/icon_statistic.gif"); +} + +a.prev_matchday { + background: transparent url("./images/left_arrow.png") no-repeat scroll 50% 0; + display: inline-block; + overflow: hidden; + width: 16px; + height: 16px; +} + +a.next_matchday { + background: transparent url("./images/right_arrow.png") no-repeat scroll 0 0; + display: inline-block; + overflow: hidden; + width: 16px; + height: 16px; +} + +.message { + font-weight: bold; + color: #AA0000; +} + +.maintitle { + font-weight: bold; + font-size: 20px; + text-align: center; + text-decoration: none; + color: #5c81b1; +} + +/* Background colors where the tables iterate between two colors or mark user*/ +.row_light { background-color: #e1ebf2; } +.row_dark { background-color: #cadceb; } +.row_user { background-color: #99CC99; } +.row_group td { background-color: #12A3EB; color: #FFFFFF !important; } +.row_result { background-color: #BFC1CF; } +.row_result td { padding: 1px 2px; } diff --git a/styles/prosilver/theme/football_print.css b/styles/prosilver/theme/football_print.css new file mode 100644 index 0000000..fab8cd0 --- /dev/null +++ b/styles/prosilver/theme/football_print.css @@ -0,0 +1,95 @@ +/* ----------------------------------------------------------------------------------------- + * @package phpBB Extension - Football Football + * @copyright (c) 2016 football (http://football.bplaced.net) + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * ----------------------------------------------------------------------------------------- */ +body { + font: 11pt Verdana, Arial, Helvetica, sans-serif; + color:#000000; +} + +a:link { color: #000000; text-decoration: none; } +a:visited { color: #000000; text-decoration: none; } +a:active { color: #000000; text-decoration: none; } + +h1, h2, h3, h1 a, h2 a, h3 a { + font-family: "Trebuchet MS",georgia,Verdana,Sans-serif; + color: #000000; + background: none; + text-decoration: none; + font-weight: bold; +} + +h1 { font-size: 20pt; } +h2 { font-size: 16pt; margin-top: 1em; } +h3 { font-size: 14pt; margin-top: 1em; } + + hr { + height: 1px; + background-color: #999999; + border-width: 0; +} + + + +img {border-width:0; display: block !important;} + +/* Table for rank in a box */ +table.rank { font-size: 0.9em;} +table.rank thead th { font-weight: normal; text-transform: uppercase; padding: 0 2px 1px 2px; } +table.rank td { padding: 0 2px; } +table.rank td.td_rank { text-align: right; } +table.rank td.td_pts { text-align: right; } +table.rank td.td_wins { padding: 0 2px 0 4px; text-align: right; } + +/* Table for football data */ +/* Specific column styles */ +table.football { font-size: 0.9em; white-space: nowrap; width: auto; border: 1px solid #000000; } +table.football th { text-align: center; } +table.football thead th { font-weight: bold; text-transform: uppercase; line-height: 1.3em; padding: 0 4px 2px 4px; } +table.football thead th span { padding-left: 7px; } +table.football tbody td { padding: 1px 2px; } +table.football tbody th { padding: 1px 2px; } +table.football th.td_tendency { padding: 4px 2px 0 2px; font-weight:bold; } +table.football th.td_pts_total { text-align: right; padding:4px 4px 0 2px; } +table.football td.td_rank { text-align: right; } +table.football td.td_group { text-align: center; } +table.football td.td_hits { text-align: center; } +table.football td.td_wins { text-align: right; padding: 0 2px 0 4px; } +table.football td.td_match_no { text-align: right; } +table.football td.td_logo { text-align: center; } +table.football td.td_team { text-align: left; padding: 0 1em 0 2px; } +table.football td.td_team_home { text-align: right; width: 155px; } +table.football td.td_team_guest { text-align: left; width: 155px; } +table.football td.td_vs { text-align: center; max-width: 1em; padding: 0; } +table.football td.td_goals_home { text-align: right; max-width: 3em; padding: 0;} +table.football td.td_goals_guest { text-align: left; max-width: 3em; padding:0; white-space: nowrap;} +table.football td.td_pts { text-align: right; padding: 0 2px 0 2px; } +table.football td.td_button { text-align: right; padding-right: 4px; } +table.football td.td_result { text-align: center; } +table.football td.td_season { text-align: center; } +table.football td.td_league { text-align: center; } +table.football td.td_pts_total { text-align: right; padding: 0 4px 0 2px; } +table.football td.td_points { text-align: right; padding: 0 2em 0 2px; } +table.football td.td_fp { text-align: center; } +table.football td.td_matches { text-align: center; } +table.football td.td_diff { text-align: right; } +table.football td.td_counter { text-align: right; } + +table.rank td.color_finally, +table.football .color_finally, .color_finally , +table.football .match_win, .match_win { font-weight: bold; color: #00AA00; } + +table.rank td.color_provisionally, +table.football .color_provisionally, .color_provisionally , +table.football .match_lost, .match_lost { font-weight: bold; color: #AA0000; } + +table.football .match_draw, .match_draw { font-weight: bold; color: #6A6A6A; } + +table.rank td.color_not_rated, +table.football .color_not_rated, +.color_not_rated { font-weight: bold; color: purple; } + +.row_result { + font-weight: bold; +} diff --git a/styles/prosilver/theme/football_side.css b/styles/prosilver/theme/football_side.css new file mode 100644 index 0000000..185870e --- /dev/null +++ b/styles/prosilver/theme/football_side.css @@ -0,0 +1,42 @@ +#footballside { + width: 200px; + position: fixed; + z-index: 1001; + left: -185px; + top: 100px; + min-height: 200px; + background-color: #fff; +} +* html #footballside { + position: absolute; + height: 200px; +} +#footballside .forabg { + margin-bottom: 0; +} +#footballside:hover, #footballside.iehover { + left: -5px; +} +#footballside ul { + list-style: none; + margin-right: 15px; +} +#footballside li { + padding: 3px; +} +* html #footballside li.header, * html #footballside li.header dl, * html #footballside li.header dl dt { + height: 18px; +} +#footballside li.header { + padding: 0 5px; +} +#dirty { + margin: 0; + padding: 10px 0; + position: relative; + float: right; + right: 0; + text-align: center; + font-weight: bold; + color: #FFF; +} \ No newline at end of file diff --git a/styles/prosilver/theme/fullscreen.css b/styles/prosilver/theme/fullscreen.css new file mode 100644 index 0000000..4a8d09f --- /dev/null +++ b/styles/prosilver/theme/fullscreen.css @@ -0,0 +1,15 @@ +/* ----------------------------------------------------------------------------------------- + * @package phpBB Extension - Football Football + * @copyright (c) 2016 football (http://football.bplaced.net) + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * ----------------------------------------------------------------------------------------- */ +#wrap { + max-width: none !important; + margin: 0; + padding: 5px !important; +} + +body { + padding: 0px !important; + +} diff --git a/styles/prosilver/theme/images/header.jpg b/styles/prosilver/theme/images/header.jpg new file mode 100644 index 0000000..fdc7a9f Binary files /dev/null and b/styles/prosilver/theme/images/header.jpg differ diff --git a/styles/prosilver/theme/images/header1.gif b/styles/prosilver/theme/images/header1.gif new file mode 100644 index 0000000..8241185 Binary files /dev/null and b/styles/prosilver/theme/images/header1.gif differ diff --git a/styles/prosilver/theme/images/header2.gif b/styles/prosilver/theme/images/header2.gif new file mode 100644 index 0000000..b82400d Binary files /dev/null and b/styles/prosilver/theme/images/header2.gif differ diff --git a/styles/prosilver/theme/images/header20.gif b/styles/prosilver/theme/images/header20.gif new file mode 100644 index 0000000..131c236 Binary files /dev/null and b/styles/prosilver/theme/images/header20.gif differ diff --git a/styles/prosilver/theme/images/header21.gif b/styles/prosilver/theme/images/header21.gif new file mode 100644 index 0000000..3f635e0 Binary files /dev/null and b/styles/prosilver/theme/images/header21.gif differ diff --git a/styles/prosilver/theme/images/header22.gif b/styles/prosilver/theme/images/header22.gif new file mode 100644 index 0000000..c85a7d3 Binary files /dev/null and b/styles/prosilver/theme/images/header22.gif differ diff --git a/styles/prosilver/theme/images/header23.gif b/styles/prosilver/theme/images/header23.gif new file mode 100644 index 0000000..4d27286 Binary files /dev/null and b/styles/prosilver/theme/images/header23.gif differ diff --git a/styles/prosilver/theme/images/header29.gif b/styles/prosilver/theme/images/header29.gif new file mode 100644 index 0000000..3c1a4eb Binary files /dev/null and b/styles/prosilver/theme/images/header29.gif differ diff --git a/styles/prosilver/theme/images/header3.gif b/styles/prosilver/theme/images/header3.gif new file mode 100644 index 0000000..158fd52 Binary files /dev/null and b/styles/prosilver/theme/images/header3.gif differ diff --git a/styles/prosilver/theme/images/header4.gif b/styles/prosilver/theme/images/header4.gif new file mode 100644 index 0000000..c24eac2 Binary files /dev/null and b/styles/prosilver/theme/images/header4.gif differ diff --git a/styles/prosilver/theme/images/header40.gif b/styles/prosilver/theme/images/header40.gif new file mode 100644 index 0000000..ef270d2 Binary files /dev/null and b/styles/prosilver/theme/images/header40.gif differ diff --git a/styles/prosilver/theme/images/header41.gif b/styles/prosilver/theme/images/header41.gif new file mode 100644 index 0000000..cd0cb7d Binary files /dev/null and b/styles/prosilver/theme/images/header41.gif differ diff --git a/styles/prosilver/theme/images/header44.gif b/styles/prosilver/theme/images/header44.gif new file mode 100644 index 0000000..fd8e55b Binary files /dev/null and b/styles/prosilver/theme/images/header44.gif differ diff --git a/styles/prosilver/theme/images/header45.gif b/styles/prosilver/theme/images/header45.gif new file mode 100644 index 0000000..61a6f86 Binary files /dev/null and b/styles/prosilver/theme/images/header45.gif differ diff --git a/styles/prosilver/theme/images/header60.gif b/styles/prosilver/theme/images/header60.gif new file mode 100644 index 0000000..20b039c Binary files /dev/null and b/styles/prosilver/theme/images/header60.gif differ diff --git a/styles/prosilver/theme/images/header61.gif b/styles/prosilver/theme/images/header61.gif new file mode 100644 index 0000000..00039d6 Binary files /dev/null and b/styles/prosilver/theme/images/header61.gif differ diff --git a/styles/prosilver/theme/images/header70.gif b/styles/prosilver/theme/images/header70.gif new file mode 100644 index 0000000..b73e402 Binary files /dev/null and b/styles/prosilver/theme/images/header70.gif differ diff --git a/styles/prosilver/theme/images/icon_allbets.gif b/styles/prosilver/theme/images/icon_allbets.gif new file mode 100644 index 0000000..6131582 Binary files /dev/null and b/styles/prosilver/theme/images/icon_allbets.gif differ diff --git a/styles/prosilver/theme/images/icon_ball.gif b/styles/prosilver/theme/images/icon_ball.gif new file mode 100644 index 0000000..32a704b Binary files /dev/null and b/styles/prosilver/theme/images/icon_ball.gif differ diff --git a/styles/prosilver/theme/images/icon_ball2.gif b/styles/prosilver/theme/images/icon_ball2.gif new file mode 100644 index 0000000..dcddefc Binary files /dev/null and b/styles/prosilver/theme/images/icon_ball2.gif differ diff --git a/styles/prosilver/theme/images/icon_bet.gif b/styles/prosilver/theme/images/icon_bet.gif new file mode 100644 index 0000000..9ecf126 Binary files /dev/null and b/styles/prosilver/theme/images/icon_bet.gif differ diff --git a/styles/prosilver/theme/images/icon_bookmark.gif b/styles/prosilver/theme/images/icon_bookmark.gif new file mode 100644 index 0000000..2644293 Binary files /dev/null and b/styles/prosilver/theme/images/icon_bookmark.gif differ diff --git a/styles/prosilver/theme/images/icon_download.gif b/styles/prosilver/theme/images/icon_download.gif new file mode 100644 index 0000000..1b697f3 Binary files /dev/null and b/styles/prosilver/theme/images/icon_download.gif differ diff --git a/styles/prosilver/theme/images/icon_football.gif b/styles/prosilver/theme/images/icon_football.gif new file mode 100644 index 0000000..13f8544 Binary files /dev/null and b/styles/prosilver/theme/images/icon_football.gif differ diff --git a/styles/prosilver/theme/images/icon_info.gif b/styles/prosilver/theme/images/icon_info.gif new file mode 100644 index 0000000..adb2739 Binary files /dev/null and b/styles/prosilver/theme/images/icon_info.gif differ diff --git a/styles/prosilver/theme/images/icon_list.gif b/styles/prosilver/theme/images/icon_list.gif new file mode 100644 index 0000000..014cd9b Binary files /dev/null and b/styles/prosilver/theme/images/icon_list.gif differ diff --git a/styles/prosilver/theme/images/icon_mark.gif b/styles/prosilver/theme/images/icon_mark.gif new file mode 100644 index 0000000..7a65893 Binary files /dev/null and b/styles/prosilver/theme/images/icon_mark.gif differ diff --git a/styles/prosilver/theme/images/icon_odds.gif b/styles/prosilver/theme/images/icon_odds.gif new file mode 100644 index 0000000..1ae32b6 Binary files /dev/null and b/styles/prosilver/theme/images/icon_odds.gif differ diff --git a/styles/prosilver/theme/images/icon_points.gif b/styles/prosilver/theme/images/icon_points.gif new file mode 100644 index 0000000..398ca5f Binary files /dev/null and b/styles/prosilver/theme/images/icon_points.gif differ diff --git a/styles/prosilver/theme/images/icon_print.gif b/styles/prosilver/theme/images/icon_print.gif new file mode 100644 index 0000000..3af72d4 Binary files /dev/null and b/styles/prosilver/theme/images/icon_print.gif differ diff --git a/styles/prosilver/theme/images/icon_rank.gif b/styles/prosilver/theme/images/icon_rank.gif new file mode 100644 index 0000000..2a5fcc3 Binary files /dev/null and b/styles/prosilver/theme/images/icon_rank.gif differ diff --git a/styles/prosilver/theme/images/icon_results.gif b/styles/prosilver/theme/images/icon_results.gif new file mode 100644 index 0000000..5ca18af Binary files /dev/null and b/styles/prosilver/theme/images/icon_results.gif differ diff --git a/styles/prosilver/theme/images/icon_rules.gif b/styles/prosilver/theme/images/icon_rules.gif new file mode 100644 index 0000000..3afa98e Binary files /dev/null and b/styles/prosilver/theme/images/icon_rules.gif differ diff --git a/styles/prosilver/theme/images/icon_statistic.gif b/styles/prosilver/theme/images/icon_statistic.gif new file mode 100644 index 0000000..0162de0 Binary files /dev/null and b/styles/prosilver/theme/images/icon_statistic.gif differ diff --git a/styles/prosilver/theme/images/icon_statistics.gif b/styles/prosilver/theme/images/icon_statistics.gif new file mode 100644 index 0000000..341b93f Binary files /dev/null and b/styles/prosilver/theme/images/icon_statistics.gif differ diff --git a/styles/prosilver/theme/images/icon_xml.gif b/styles/prosilver/theme/images/icon_xml.gif new file mode 100644 index 0000000..27013fc Binary files /dev/null and b/styles/prosilver/theme/images/icon_xml.gif differ diff --git a/styles/prosilver/theme/images/index.htm b/styles/prosilver/theme/images/index.htm new file mode 100644 index 0000000..e0cc5f3 --- /dev/null +++ b/styles/prosilver/theme/images/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/styles/prosilver/theme/images/left_arrow.png b/styles/prosilver/theme/images/left_arrow.png new file mode 100644 index 0000000..18f9cc1 Binary files /dev/null and b/styles/prosilver/theme/images/left_arrow.png differ diff --git a/styles/prosilver/theme/images/right_arrow.png b/styles/prosilver/theme/images/right_arrow.png new file mode 100644 index 0000000..e252606 Binary files /dev/null and b/styles/prosilver/theme/images/right_arrow.png differ diff --git a/xml/de.txt b/xml/de.txt new file mode 100644 index 0000000..3796712 --- /dev/null +++ b/xml/de.txt @@ -0,0 +1,71 @@ +dir=ltr +foot=Copyright © 2011 phpBB3 Football Extension. +s_title=Spielpläne dieser Seite +l_title=Spielplan +h1l=Der Spielplan +h1s=Auf dieser Seite zum Download angebotene Spielpläne +h3-pointswins=Punkte und Gewinne +link-l=Sprache +l-l=Liga +nls=Keine Spielpläne vorhanden +nll=Keine Spielplandaten vorhanden +s-fixl=Spielpläne der Saison +s-season=Saison +slg=Sprache auswählen: +t-leagues=Ligadaten +t-matchdays=Spieltage +t-matches=Spielpaarungen +t-seasons=Saisondaten +t-teams=Mannschaften +tf-match_datetime=Datum +tf-match_no=SpNr +tf-match_matchday=SpTag +tf-match=Begegnung +tf-result=Ergebnis +tf-extratime=Verl. +tf-match_status=Status +tf-group=Gruppe +tf-ko=KO +tf-formula=Formel +tf-team_id=Team-ID +tf-team_name=Mannschaftsbezeichnung +tf-team_name_short=Kurzbezeichnung +tf-team_symbol=Wappen +tf-group_id=Gruppe +tf-participate=Teiln. bis Spieltag +tf-league=Saison +tf-league_name=Liga Bezeichnung +tf-league_name_short=Liga Kürzel +tf-league_type=Typ +tf-matchdays=Spieltage +tf-matches_on_matchday=Spiele/Sptag +tf-win_result=G. Volltreffer +tf-win_result_02=G. Volltreffer 02 +tf-win_matchday=G. Spieltag +tf-win_season=G. Saison +tf-points_mode=P. Modus +tf-points_result=P. Volltreffer +tf-points_tendency=P. Tendenz +tf-points_diff=P. Differenz +tf-points_last=P. Nichttipper +tf-join_by_user=User Beitritt +tf-join_in_season=Beitritt in Saison +tf-bet_in_time=Tippen bis Spielbeginn +tf-rules_post_id=Regeln +tf-bet_ko_type=Tippart +tf-bet_points=Einsatz +tf-matchday=Spieltag +tf-status=Status +tf-delivery_date=1. Abgabetermin +tf-delivery_date_2=2. Abgabetermin +tf-delivery_date_3=3. Abgabetermin +tf-matchday_name=Spieltagsbezeichnung +tf-matches=Anzahl Spiele +tf-season=Saison +tf-season_name=Saison Bezeichnung +tf-season_name_short=Saison Kurzbezeichnung +tnl=Keine Ligadaten vorhanden +tnmd=Keine Spieltagsdaten vorhanden +tnm=Keine Spiele vorhanden +tns=Keine Saisondaten vorhanden +tnt=Keine Mannschaftsdaten vorhanden \ No newline at end of file diff --git a/xml/en.txt b/xml/en.txt new file mode 100644 index 0000000..0f3a7d0 --- /dev/null +++ b/xml/en.txt @@ -0,0 +1,71 @@ +dir=ltr +foot=Copyright © 2011 phpBB3 Football Extension. +s_title=All fixtures of this site +l_title=Fixture list +h1l=The fixture list +h1s=On this page downloadable fixtures +h3-pointswins=Points and wins +link-l=Language +l-l=League +nls=No fixture lists available +nll=No fixture list data available +s-fixl=Fixture Lists of the season +s-season=Season +slg=Choose language: +t-leagues=League data +t-matchdays=Rounds +t-matches=Fixtures +t-seasons=Season data +t-teams=Teams +tf-match_datetime=Date +tf-match_no=MatchNo +tf-match_matchday=Round +tf-match=Match +tf-result=Score +tf-extratime=Extratime +tf-match_status=Status +tf-group=Group +tf-ko=KO +tf-formula=Formula +tf-team_id=Team ID +tf-team_name=Team Name +tf-team_name_short=Shortname +tf-team_symbol=Coat of Arms +tf-group_id=Group +tf-participate=To participate +tf-league=Season +tf-league_name=League Name +tf-league_name_short=League shortcut +tf-league_type=Type +tf-matchdays=Rounds +tf-matches_on_matchday=Games / Round +tf-win_result=W. hit +tf-win_result_02=W. hit 02 +tf-win_matchday=W. round +tf-win_season=W. season +tf-points_mode=P. mode +tf-points_result=P. hit +tf-points_tendency=P. tendency +tf-points_diff=P. difference +tf-points_last=P. no bet +tf-join_by_user=User accession +tf-join_in_season=Accession season +tf-bet_in_time=Tap to kick-off +tf-rules_post_id=Rules +tf-bet_ko_type=Bet type +tf-bet_points=Bet +tf-matchday=Round +tf-status=Status +tf-delivery_date=1. Delivery +tf-delivery_date_2=2. Delivery +tf-delivery_date_3=3. Delivery +tf-matchday_name=Round Description +tf-matches=No of matches +tf-season=Season +tf-season_name=Season name +tf-season_name_short=Season shortname +tnl=No league available +tnmd=No round available +tnm=No matches available +tns=No season available +tnt=No team available diff --git a/xml/index.htm b/xml/index.htm new file mode 100644 index 0000000..e0cc5f3 --- /dev/null +++ b/xml/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/xml/languages.txt b/xml/languages.txt new file mode 100644 index 0000000..4e0e64d --- /dev/null +++ b/xml/languages.txt @@ -0,0 +1,2 @@ +de=Deutsch +en=English diff --git a/xml/league-data-0.9.4.xsd b/xml/league-data-0.9.4.xsd new file mode 100644 index 0000000..884c8c3 --- /dev/null +++ b/xml/league-data-0.9.4.xsd @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xml/league-data.prosilver.xsl b/xml/league-data.prosilver.xsl new file mode 100644 index 0000000..999e41b --- /dev/null +++ b/xml/league-data.prosilver.xsl @@ -0,0 +1,1268 @@ + + + +]> + + + + + + + + + + + + + + + phpBB3 Football Extension » Spielplan <xsl:value-of select="$leaguename" /> <xsl:value-of select="$season" /> + + + +
+
+ +
+
+
+
+

+
Der Spielplan für   + + + league.php?season=&league=&d=true + +
+
+

+
+ + + + + Keine Saisondaten vorhanden
+
+ + + + + Keine Ligadaten vorhanden
+
+ + + + + Keine Spieltagsdaten vorhanden
+
+ + + + + Keine Mannschaftsdaten vorhanden
+
+ + + + + Keine Mannschaftsdaten vorhanden
+
+
+
+
+
+
+ +
+ + +
+ + +
+ +
+

Saisondaten

+
+ + + + + + + + + + + + + + + + + +
SaisonSaison BezeichnungSaison Kurzbezeichnung
+
+ +
+
+ + +
+ +
+

Ligadaten

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LigaLiga BezeichnungLiga KürzelTypSpieltageSpiele/SptagUser BeitrittBeitritt in SaisonTippen bis SpielbeginnRegelnTippart
+

Punkte und Gewinne

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
P. ModusP. RichtigP. TendenzP. DifferenzP. NichttipperEinsatzG. VolltrefferG. Volltreffer 02G. SpieltagG. Saison
+
+ +
+
+ + +
+ +
+

Spieltage

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpieltagStatus1. Abgabetermin2. Abgabetermin3. AbgabeterminSpieltagsbezeichnungAnzahl Spiele
+
+ +
+
+ + +
+ +
+

Mannschaften

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Team-IDMannschaftsbezeichnungKurzbezeichnungWappenGruppeTeiln. bis Spieltag
+
+ +
+
+ + +
+ +
+

Spielpaarungen

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DatumSpNrSpTagBegegnungErgebnisVerl.StatusGruppeKOFormel
+ + + + + - + + + + + : : -
+ + + + + - + + + + + : : -
+
+ +
+
+ +
\ No newline at end of file diff --git a/xml/league.php b/xml/league.php new file mode 100644 index 0000000..4b3e4ec --- /dev/null +++ b/xml/league.php @@ -0,0 +1,150 @@ +session_begin(); + $auth->acl($user->data); + $user->setup(); + $user->add_lang_ext('football/football', 'info_acp_update'); + include('../includes/constants.' . $phpEx); + + if ($config['board_disable']) + { + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + trigger_error($message); + } + + $season = $request->variable('season', 0); + $league = $request->variable('league', 0); + if (!$season or !$league) + { + exit; + } + + $download = $request->variable('d', false); + $string = xml_data($season, $league); + + if ( $string == '') + { + trigger_error('Fehler! Die XML-Datei konnte nicht erzeugt werden.'); + } + + if ($download) + { + // Download header + header('Pragma: no-cache'); + header('Content-Type: application/xml name=\"league_' . $season . '_' . $league . '.xml'); + header('Content-disposition: attachment; filename=league_' . $season . '_' . $league . '.xml'); + } + else + { + // XML header + header ("content-type: text/xml"); + } + echo $string; +} + +function xml_data($season, $league) +{ + global $db, $phpbb_root_path, $phpEx, $table_prefix; + + $xml_data = ''; + + $xml_league_data = xml_table($season, $league, 'FOOTB_SEASONS'); + $xml_league_data .= xml_table($season, $league, 'FOOTB_LEAGUES'); + $xml_league_data .= xml_table($season, $league, 'FOOTB_MATCHDAYS'); + $xml_league_data .= xml_table($season, $league, 'FOOTB_TEAMS'); + $xml_league_data .= xml_table($season, $league, 'FOOTB_MATCHES'); + + if ( $xml_league_data <> '' ) + { + $xml_data = '' . "\n"; + $xml_data .= '' . "\n"; + $xml_data .= '' . "\n"; + $xml_data .= '' . "\n"; + $xml_data .= $xml_league_data; + $xml_data .= ''; + } + return $xml_data; +} + + +function xml_table($season, $league, $table) +{ + global $db, $phpbb_root_path, $phpEx, $table_prefix; + + $xml_table = ''; + $skip_fields = array("trend", "odd_1", "odd_x", "odd_2", "rating"); + + $table_name = constant($table); + $where_league = ($table == 'FOOTB_SEASONS') ? '' : " AND league = $league"; + $sql = 'SELECT * + FROM ' . $table_name . " + WHERE season = $season + $where_league + ORDER BY 1, 2, 3;"; + if ( $result = $db->sql_query($sql) ) + { + while($row = $db->sql_fetchrow($result)) + { + $xml_table .= " <" . strtolower($table) . ">" . "\n"; + foreach($row as $fieldname => $value) + { + switch ($fieldname) + { + case 'win_result': + case 'win_result_02': + case 'win_matchday': + case 'win_season': + case 'points_last': + case 'join_by_user': + case 'join_in_season': + case 'rules_post_id': + case 'bet_points': + { + $value = 0; + } + break; + case 'status': + { + // only match status 0-3 + $value = ($value > 3) ? $value - 3 : $value; + } + break; + } + if (!in_array($fieldname, $skip_fields, TRUE) ) + { + if (!isset($value) || is_null($value)) + { + $xml_table .= " <$fieldname>'NULL'" . "\n"; + } + else + { + $xml_table .= " <$fieldname>" . $value . "" . "\n"; + } + } + } + $xml_table .= " " . "\n"; + } + } + return $xml_table; +} +?> \ No newline at end of file diff --git a/xml/seasons-data-0.9.4.xsd b/xml/seasons-data-0.9.4.xsd new file mode 100644 index 0000000..fc830a9 --- /dev/null +++ b/xml/seasons-data-0.9.4.xsd @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml/seasons-data.prosilver.xsl b/xml/seasons-data.prosilver.xsl new file mode 100644 index 0000000..46a29d9 --- /dev/null +++ b/xml/seasons-data.prosilver.xsl @@ -0,0 +1,911 @@ + + + +]> + + + + + + + + + + + phpBB3 Football Extension » Spielpläne dieser Seite + + + +
+
+ +
+
+
+
+

Auf dieser Seite zum Download angebotene Spielpläne

+
+ + + + + + + Keine Spielpläne vorhanden
+
+
+
+
+
+
+ +
+ + +
+ + +
+ +
+

Saison 

+
+

Spielpläne der Saison :

+
+ +
+ + + + league.php?season=&league=&code= + + +
+
+
+ +
+
+ +
\ No newline at end of file diff --git a/xml/seasons.php b/xml/seasons.php new file mode 100644 index 0000000..c8befe3 --- /dev/null +++ b/xml/seasons.php @@ -0,0 +1,101 @@ +session_begin(); + $auth->acl($user->data); + $user->setup(); + $user->add_lang_ext('football/football', 'info_acp_update'); + include('../includes/constants.' . $phpEx); + + if ($config['board_disable']) + { + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + trigger_error($message); + } + + //Check Access Code + global $code; + $code = $request->variable('code', ''); + if (strcmp($code, trim($config['football_update_code'])) <> 0) + { + trigger_error('ERROR_XML_CODE'); + } + + $string = xml_seasons(); + + if ( $string == '') + { + trigger_error('ERROR_XML_CREATE'); + } + + header ("content-type: text/xml"); + echo $string; +} + +function xml_seasons() +{ + global $db, $phpbb_root_path, $phpEx, $table_prefix, $code, $ext_path; + + $xml_seasons = ''; + $sql = 'SELECT s.season, s.season_name_short, l.league, l.league_name + FROM ' . FOOTB_SEASONS . ' AS s + JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season) + WHERE 1 + ORDER BY s.season DESC, l.league ASC;'; + $last_season = 0; + $data = false; + if ( $result = $db->sql_query($sql) ) + { + $xml_seasons = '' . "\n"; + $xml_seasons .= '' . "\n"; + $xml_seasons .= '' . "\n"; + $xml_seasons .= '' . "\n"; + $xml_seasons .= ' ' . $code . "\n"; + + while($row = $db->sql_fetchrow($result)) + { + if ( $row['season'] <> $last_season ) + { + if ($data) + { + $xml_seasons .= ' ' . "\n"; + } + $xml_seasons .= ' ' . "\n"; + $xml_seasons .= " " . $row['season'] . "" . "\n"; + $xml_seasons .= " " . $row['season_name_short'] . "" . "\n"; + $data = true; + $last_season = $row['season']; + } + $xml_seasons .= ' ' . "\n"; + $xml_seasons .= " " . $row['league'] . "" . "\n"; + $xml_seasons .= " " . $row['league_name'] . "" . "\n"; + $xml_seasons .= ' ' . "\n"; + } + if ($data) + { + $xml_seasons .= ' ' . "\n"; + } + $xml_seasons .= '' . "\n"; + } + return $xml_seasons; +} +?> \ No newline at end of file