From 90172d076bc7e0ea4680a14f5c0fc28015b1387e Mon Sep 17 00:00:00 2001 From: Julian Date: Sun, 3 Jun 2018 13:57:34 +0200 Subject: [PATCH] Add modifications for show_table of matches and bet_type for leagues in ACP. --- acp/leagues_module.php | 29 +++++++++++++++++++++++++---- acp/matches_module.php | 26 ++++++++++++++++++++++++-- adm/style/acp_football_leagues.html | 6 +++++- adm/style/acp_football_matches.html | 4 ++++ language/de/info_acp_leagues.php | 4 +++- language/de/info_acp_matches.php | 4 +++- 6 files changed, 64 insertions(+), 9 deletions(-) diff --git a/acp/leagues_module.php b/acp/leagues_module.php index 5312f1c..30845e8 100644 --- a/acp/leagues_module.php +++ b/acp/leagues_module.php @@ -416,7 +416,7 @@ class leagues_module break; case 'add': - if ($league > 0 AND $league <= 99) + if ($league > 0 AND $league <= 101) { if ($league_info) { @@ -494,6 +494,7 @@ class leagues_module $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); + $league_info['bet_type'] = $this->request->variable('bet_type', false); if (!$league_info['rules_post_id'] and $league_info['join_by_user'] == 1) { @@ -509,6 +510,15 @@ class leagues_module { $error[] = $user->lang['CHECK_HITS02_WINS']; } + + if ($league_info['bet_type'] == true) + { + $bet_type = '0'; + } + else + { + $bet_type = '1'; + } $matchday_wins = explode(';',$league_info['win_matchday']); foreach ($matchday_wins as $matchday_win) @@ -555,6 +565,7 @@ class leagues_module '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'], + 'bet_type' => (int) $bet_type, ); $data['league'] = $league; @@ -564,8 +575,8 @@ class leagues_module $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' => array('num', false, 1, 101), + 'league_name' => array('string', false, 2, 25), 'league_short' => array('string', false, 1, 3), 'league_matchdays' => array('num', false, 0, 99), 'league_matches' => array('num', false, 0, 99), @@ -620,6 +631,15 @@ class leagues_module // check if matches created $existing_matches_on_league = count_existing_matches($season, $league, 0); + if ($league_info['bet_type'] == true) + { + $bet_type = '0'; + } + else + { + $bet_type = '1'; + } + $u_back = $this->u_action . "&s=$season"; $template->assign_vars(array( @@ -661,7 +681,8 @@ class leagues_module '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"' : '', + 'POINTS_LAST_NO' => ($league_info['points_last'] == 0) ? ' checked="checked"' : '', + 'S_BET_TYPE' => $bet_type, 'U_BACK' => $u_back, 'U_ACTION' => "{$this->u_action}&action=$action&s=$season", ) diff --git a/acp/matches_module.php b/acp/matches_module.php index 3ecd9fe..069f071 100644 --- a/acp/matches_module.php +++ b/acp/matches_module.php @@ -398,6 +398,7 @@ class matches_module $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)) : ''; + $match_row['show_table'] = $this->request->variable('show_table', false); if ($match_row['team_id_home'] <> '') { @@ -436,6 +437,15 @@ class matches_module { $error[] = $user->lang['NO_MATCH_BEGIN']; } + + if ($match_row['show_table'] == true) + { + $show_table = '0'; + } + else + { + $show_table = '1'; + } if (!sizeof($error)) { @@ -459,7 +469,8 @@ class matches_module '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'] : '', + 'goals_overtime_guest' => (is_numeric($match_row['goals_overtime_guest'])) ? $match_row['goals_overtime_guest'] : '', + 'show_table' => (int) $show_table, ); @@ -628,6 +639,16 @@ class matches_module $team_home_options .= ''; } $db->sql_freeresult($result); + + if($match_row['show_table'] == 1) + { + $show_table = false; + } + else + { + $show_table = true; + } + $u_back = $this->u_action . "&s=$season&l=$league&m=$matchday"; $template->assign_vars(array( @@ -648,7 +669,8 @@ class matches_module 'MATCH_STATUS' => $match_row['status'], 'STATUS_OPTIONS' => $status_options, 'S_GROUP_CHECKED' => (strlen($match_row['group_id']) > 0) ? true : false, - 'MATCH_GROUP' => $match_group, + 'MATCH_GROUP' => $match_group, + 'S_SHOW_TABLE' => $show_table, 'S_KO_CHECKED' => $match_row['ko_match'], 'FORMULA_HOME' => $match_row['formula_home'], 'FORMULA_GUEST' => $match_row['formula_guest'], diff --git a/adm/style/acp_football_leagues.html b/adm/style/acp_football_leagues.html index 5aeb9c0..7504d93 100644 --- a/adm/style/acp_football_leagues.html +++ b/adm/style/acp_football_leagues.html @@ -33,7 +33,7 @@
-
+

{L_LEAGUE_SHORT_EXPLAIN}
@@ -100,6 +100,10 @@
+
+

{L_BET_TYPE_EXPLAIN}
+
checked="checked" />
+
diff --git a/adm/style/acp_football_matches.html b/adm/style/acp_football_matches.html index 7a1cdef..885f1f0 100644 --- a/adm/style/acp_football_matches.html +++ b/adm/style/acp_football_matches.html @@ -96,6 +96,10 @@
+
+

{L_SHOW_TABLE_EXPLAIN}
+
checked="checked" />
+
diff --git a/language/de/info_acp_leagues.php b/language/de/info_acp_leagues.php index 891d189..9d91738 100644 --- a/language/de/info_acp_leagues.php +++ b/language/de/info_acp_leagues.php @@ -46,7 +46,9 @@ $lang = array_merge($lang, array( 'ALL_USERS' => 'Alle Mitglieder', 'BET_POINTS' => 'Einsatz', - 'BET_POINTS_EXPLAIN' => 'Einsatz zur Teilnahme am Saisonanfang', + 'BET_POINTS_EXPLAIN' => 'Einsatz zur Teilnahme am Saisonanfang', + 'BET_TYPE' => 'Tippliga-Modus', + 'BET_TYPE_EXPLAIN' => 'Wenn der Haken gesetzt ist tippen die Spieler gegeneinander, andernfalls werden nur die Tore addiert.', 'BET_TYPE_KO' => 'Tipp bei KO-Spielen', 'BET_TYPE_KO_EXPLAIN' => 'Auf welches Ergebnis soll bei KO-Spielen getippt werden?', diff --git a/language/de/info_acp_matches.php b/language/de/info_acp_matches.php index d3912ad..299f928 100644 --- a/language/de/info_acp_matches.php +++ b/language/de/info_acp_matches.php @@ -98,7 +98,9 @@ $lang = array_merge($lang, array( 'PREDICTION_LEAGUE' => 'Tipprunde', 'SEASON' => 'Saison', - 'SELECT_MATCHDAY' => 'Spieltag wählen', + 'SELECT_MATCHDAY' => 'Spieltag wählen', + 'SHOW_TABLE' => 'Spiel einberechnen', + 'SHOW_TABLE_EXPLAIN' => 'Spiele werden bei gesetztem Haken für die Berechnung der Tabelle berücksichtigt', 'TOO_LARGE_MATCH_BEGIN_H' => 'Stundenangabe beim Spielbeginn zu groß.', 'TOO_LARGE_MATCH_BEGIN_MIN' => 'Minutenangabe beim Spielbeginn zu groß.',