32 Commits

Author SHA1 Message Date
76cedb15a2 Only allow betting if user is in a match 2022-08-12 20:07:38 +02:00
41397ffbdc Fix warning in all bets when no bets are shown. 2022-08-11 16:29:35 +02:00
abf7e95d08 Fix calculation of bonuspoints and corrected values for form table 2021-01-27 22:12:23 +01:00
573a3bdea7 Changes for phpbb 3.3.0 2020-08-03 21:22:09 +02:00
25e4e53485 Fix mobile style to display correct page when results_tl is clicked.
Rearrange mobile menu to fit to the desktop menu.
2018-08-04 16:00:21 +02:00
adfecaac96 Fix change sign in ranks_matchday and ranks_total. 2018-07-07 16:03:31 +02:00
4870166b96 Show table on bet site also on mobile devices 2018-06-24 16:39:04 +02:00
9d57480e6d Change last blue color to green in table. 2018-06-24 15:57:39 +02:00
948f7b8511 Updated desktop menu to show ranks_total if bet_type is 1
Updated mobile menu to behave like desktop menu
2018-06-23 16:08:29 +02:00
90172d076b Add modifications for show_table of matches and bet_type for leagues in ACP. 2018-06-03 13:57:34 +02:00
66dceff9f2 change color to green 2018-05-20 16:18:38 +02:00
8b679b1286 Change order of tippers in all_bets site according to the tipper vs tipper matches and change background color. 2018-04-03 22:16:31 +02:00
e1db71c99d Add matchtime tooltip to all_bets site 2018-04-03 21:58:09 +02:00
3ade0f043f Add bonuspoint, corr and chart calculation and update displaying of chart. 2018-04-03 21:06:22 +02:00
f56cf04e74 Rearange main menu and change external links to internal links 2018-04-03 19:57:48 +02:00
66b2a1a8d0 Readd rank_matchday in all sites and add check for correct league --> Display of rank_matchday works on table and results_tl site. 2018-04-03 19:24:37 +02:00
889ff05ca6 Remove highlight of table menu item in bet site. 2018-04-03 19:14:08 +02:00
0b9f099381 Remove small rank total from main view. 2018-04-03 19:13:08 +02:00
148c16c87a Remove unneeded teams from tables in mytable site. 2018-04-03 19:12:36 +02:00
511fab50b7 Add results_tl and handling in different files 2018-04-03 18:43:39 +02:00
6c06de3772 Remove unneeded menu items. 2018-04-03 17:47:42 +02:00
37204150dc Add results_tl to language and main controller. 2018-04-03 17:47:30 +02:00
85d3c835d2 Change short team names to full team names 2018-04-02 23:25:37 +02:00
ac536658fa Add auto selection of correct leage (higher or lower league id 50) 2018-04-02 22:58:54 +02:00
92267523b9 Include full table in bet view instead of small table 2018-04-02 22:56:21 +02:00
4a64eb71a3 Add bonus points to the missing tables and make non relevant teams invisible in tables. 2018-04-02 22:24:49 +02:00
268ca763f7 Fix BNS coloumn displaying 2018-02-21 23:26:07 +01:00
66b35b0155 Fix table and add corr to constants 2018-02-21 23:24:04 +01:00
4b627586f8 Add bonus points calculation to table total. 2018-02-21 23:19:03 +01:00
3b47093a3a fix broken function current_league($season) sql select 2018-02-19 22:57:59 +01:00
511a23d609 Wappen der Mannschaften hinzugefügt 2018-02-19 22:10:07 +01:00
6b9ebb0d1a Football functions.php angepasst, damit ertippte Punkte bei ihren jeweiligen Teams als Tore eingetragen werden. 2018-02-19 21:56:29 +01:00
610 changed files with 919 additions and 308 deletions

3
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

6
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_14" project-jdk-name="openjdk-14" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/phpbb_football_tlw.iml" filepath="$PROJECT_DIR$/.idea/phpbb_football_tlw.iml" />
</modules>
</component>
</project>

9
.idea/phpbb_football_tlw.iml generated Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -426,6 +426,9 @@ class bets_module
$league_info = league_info($season, $league);
$cash = $this->request->variable('cash', false);
save_ranking_matchday($season, $league, $matchday, $cash);
bonuspoints($season, $league, $matchday);
corr($season, $league, $matchday);
chart($season, $league, $matchday);
}
break;
}

View File

@@ -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 . "&amp;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}&amp;action=$action&amp;s=$season",
)

View File

@@ -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 .= '<option value="' . $row['group_id'] . ';' . $row['team_id'] .'"' . $selected_home . '>' . $row['team_name'] . '</option>';
}
$db->sql_freeresult($result);
if($match_row['show_table'] == 1)
{
$show_table = false;
}
else
{
$show_table = true;
}
$u_back = $this->u_action . "&amp;s=$season&amp;l=$league&amp;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'],

View File

@@ -443,6 +443,9 @@ class results_module
$cash = $this->request->variable('cash', false);
save_ranking_matchday($season, $league, $matchday, $cash);
bonuspoints($season, $league, $matchday);
corr($season, $league, $matchday);
chart($season, $league, $matchday);
// Patch delevirey
if ($league_info['bet_in_time'] == 1)

View File

@@ -33,7 +33,7 @@
</dl>
<dl>
<dt><label for="league_name">{L_LEAGUE_NAME}:</label></dt>
<dd><input name="league_name" type="text" id="league_name" size="20" maxlength="20" value="{LEAGUE_NAME}" /></dd>
<dd><input name="league_name" type="text" id="league_name" size="25" maxlength="21" value="{LEAGUE_NAME}" /></dd>
</dl>
<dl>
<dt><label for="league_short">{L_LEAGUE_SHORT}:</label><br /><span>{L_LEAGUE_SHORT_EXPLAIN}</span></dt>
@@ -100,6 +100,10 @@
</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="bet_type">{L_BET_TYPE}:</label><br /><span>{L_BET_TYPE_EXPLAIN}</span></dt>
<dd><input name="bet_type" type="checkbox" id="bet_type" <!-- IF S_BET_TYPE -->checked="checked" <!-- ENDIF --> /></dd>
</dl>
</fieldset>
<fieldset>

View File

@@ -96,6 +96,10 @@
<dd><input name="formula_guest" type="text" id="formula_guest" size="9" maxlength="9" value="{FORMULA_GUEST}" /></dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="show_table">{L_SHOW_TABLE}:</label><br /><span>{L_SHOW_TABLE_EXPLAIN}</span></dt>
<dd><input name="show_table" type="checkbox" class="radio" id="show_table" <!-- IF S_SHOW_TABLE --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<input type="hidden" name="ko_league" value="1" />
</fieldset>

View File

@@ -14,11 +14,23 @@ if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL'))
$start = $this->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";
$league_info = league_info($season, $league);
if($league_info['bet_type'])
{
$sql = 'SELECT COUNT(DISTINCT b.user_id) AS num_users
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 b.season = $season AND b.league = $league AND m.matchday = $matchday";
}
else
{
$sql = 'SELECT COUNT(DISTINCT b.user_id) AS num_users
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_MATCHES . ' AS m2 ON (m2.season = m.season AND m2.league = m.league + 50 AND m2.matchday = m.matchday AND m2.team_id_home = b.user_id + 2000)
LEFT JOIN ' . FOOTB_MATCHES . " AS m3 ON (m3.season = m.season AND m3.league = m.league + 50 AND m3.matchday = m.matchday AND m3.team_id_guest = b.user_id + 2000)
WHERE b.season = $season AND b.league = $league AND m.matchday = $matchday AND (m2.match_no IS NOT NULL || m3.match_no IS NOT NULL) ";
}
$result = $db->sql_query($sql);
$total_users = (int) $db->sql_fetchfield('num_users');
$db->sql_freeresult($result);
@@ -36,7 +48,19 @@ $sql = "SELECT
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
SUM(IF(b.goals_home + 0 < b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS 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)
@@ -67,7 +91,7 @@ if ($user->data['football_mobile'])
}
else
{
if ($count_matches > 11)
if ($count_matches > 12)
{
$split_after = 8;
$splits = ceil($count_matches / 8);
@@ -113,21 +137,47 @@ 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";
if($league_info['bet_type'])
{
$sql = "SELECT
u.user_id,
u.username,
m.status,
b.goals_home AS bet_home,
b.goals_guest AS bet_guest,
IFNULL(m2.match_no,m3.match_no),
" . 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)
LEFT JOIN ' . FOOTB_MATCHES . ' AS m2 ON (m2.season = m.season AND m2.league = m.league + 50 AND m2.matchday = m.matchday AND m2.team_id_home = b.user_id + 2000)
LEFT JOIN ' . FOOTB_MATCHES . " AS m3 ON (m3.season = m.season AND m3.league = m.league + 50 AND m3.matchday = m.matchday AND m3.team_id_guest = b.user_id + 2000)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
ORDER BY IFNULL(m2.match_no,m3.match_no) ASC, m3.match_no ASC, LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC";
}
else
{
$sql = "SELECT
u.user_id,
u.username,
m.status,
b.goals_home AS bet_home,
b.goals_guest AS bet_guest,
IFNULL(m2.match_no,m3.match_no),
" . 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)
LEFT JOIN ' . FOOTB_MATCHES . ' AS m2 ON (m2.season = m.season AND m2.league = m.league + 50 AND m2.matchday = m.matchday AND m2.team_id_home = b.user_id + 2000)
LEFT JOIN ' . FOOTB_MATCHES . " AS m3 ON (m3.season = m.season AND m3.league = m.league + 50 AND m3.matchday = m.matchday AND m3.team_id_guest = b.user_id + 2000)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
AND (m3.match_no IS NOT NULL OR m2.match_no IS NOT NULL)
ORDER BY IFNULL(m2.match_no,m3.match_no) ASC, m3.match_no ASC, 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);
@@ -164,56 +214,67 @@ foreach ($matches AS $match)
$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'] == '') ? 0 : $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'] == '') ? '&nbsp;' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?';
}
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'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
if(!empty($bet_line))
{
foreach ($bet_line[$split_index] AS $user_bet)
{
if ($bet_index == 0)
{
$count_user++;
$league_info = league_info($season, $league);
if ($league_info['bet_type'])
{
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
}
else
{
$row_class = (!(($count_user + ($count_user % 2)) % 4)) ? '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'] == '') ? 0 : $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'] == '') ? '&nbsp;' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
if ($bet_index == $split_after)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$bet_index = 0;
}
}
$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'] == '') ? '&nbsp;' : $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,
@@ -264,10 +325,11 @@ foreach ($matches AS $match)
}
$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,
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'RESULT' => $match['goals_home']. ':'.$match['goals_guest'],
'COLOR_STYLE' => $colorstyle_match,
'MATCH_TIME' => $match['match_time'],
)
);
if ($match['status'] < 1 && !$config['football_view_tendencies'])
@@ -287,59 +349,70 @@ if ($count_matches > 0)
$total = 0;
$count_user = 0;
$bet_index = 0;
foreach ($bet_line[$split_index] AS $user_bet)
if(!empty($bet_line))
{
if ($bet_index == 0)
foreach ($bet_line[$split_index] AS $user_bet)
{
$count_user++;
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_bet['user_id'] == $user->data['user_id'])
if ($bet_index == 0)
{
$row_class = 'bg3 row_user';
$count_user++;
$league_info = league_info($season, $league);
if ($league_info['bet_type'])
{
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
}
else
{
$row_class = (!(($count_user + ($count_user % 2)) % 4)) ? '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'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
}
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
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'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
$total = 0;
}
$bet_index++;
$total += ($user_bet['points'] == '') ? 0 : $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'] == '') ? '&nbsp;' : $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;
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;
}
}
}
@@ -450,7 +523,7 @@ while ($row = $db->sql_fetchrow($result))
while ($user_row = $db->sql_fetchrow($result_bet))
{
$bet_number++ ;
$row_class = (!($bet_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$row_class = (!(($count_user + ($count_user % 2)) % 4)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';

View File

@@ -20,7 +20,9 @@ $join_league = false;
$matchnumber = 0;
$userid = $user->data['user_id'];
$lang_dates = $user->lang['datetime'];
$league_info = league_info($season, $league);
$user_is_member = user_is_member($userid, $season, $league);
$user_is_allowed_to_bet = $league_info['bet_type'] ? true : user_is_allowed_to_bet($userid, $season, $league, $matchday);
$display_rating = false;
// Calculate multiple delivery
@@ -470,7 +472,6 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
$league_info = league_info($season, $league);
$bet_explain = '';
switch ($league_info['bet_ko_type'])
{
@@ -511,7 +512,7 @@ $template->assign_vars(array(
'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_BET' => $data_bet && $user_is_allowed_to_bet,
'S_DATA_GROUP' => $data_group,
'S_DATA_BET_RESULTS' => $data_bet_results,
'S_EDIT_MODE' => $edit_mode,

View File

@@ -22,17 +22,17 @@ $username2 = '';
$username3 = '';
$username4 = '';
// Calculate rank total
$sql = 'SELECT
$sql = "SELECT
r.user_id,
u.username,
SUM(r.points) AS points_total
FROM ' . FOOTB_RANKS . ' AS r
(SELECT SUM(c.rank_total) FROM " . FOOTB_MY_CHART . " AS c WHERE c.user_id = (r.user_id) AND c.season = r.season AND c.league = r.league AND c.matchday = $matchday) AS points_total
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
AND r.matchday <= $matchday
GROUP BY r.user_id
ORDER BY points_total DESC, LOWER(u.username) ASC";
ORDER BY points_total ASC, LOWER(u.username) ASC";
$result = $db->sql_query($sql);
$current_ranks = $db->sql_fetchrowset($result);
@@ -158,7 +158,7 @@ if ($total_users > 3 AND $total_users <= 50)
$ranks_dayl_1 = '';
$points_1 = '';
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
FROM ' . FOOTB_MY_CHART . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
@@ -211,7 +211,7 @@ if ($total_users > 3 AND $total_users <= 50)
if ($user3 != 0)
{
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
FROM ' . FOOTB_MY_CHART . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
@@ -238,7 +238,7 @@ if ($total_users > 3 AND $total_users <= 50)
if ($user4 != 0)
{
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
FROM ' . FOOTB_MY_CHART . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
@@ -267,7 +267,7 @@ if ($total_users > 3 AND $total_users <= 50)
$sql = 'SELECT
MIN(points) As points_min,
MAX(points) As points_max
FROM ' . FOOTB_RANKS . "
FROM ' . FOOTB_MY_CHART . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday

View File

@@ -137,6 +137,7 @@ $sql = 'SELECT
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
AND m.show_table = 0
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
@@ -233,6 +234,7 @@ $sql = 'SELECT
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday >= $form_from
AND m.show_table = 0
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
@@ -300,6 +302,7 @@ $sql = 'SELECT
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
AND m.show_table = 0
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
@@ -365,6 +368,7 @@ $sql = 'SELECT
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
AND m.show_table = 0
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";

View File

@@ -12,6 +12,15 @@ if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL'))
exit;
}
if ($league > 50)
{
$league_corr = $league - 50;
}
else
{
$league_corr = $league;
}
if ($league <> 0)
{
$data_rank_matchday = false;
@@ -26,7 +35,7 @@ if ($league <> 0)
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.league = $league_corr
AND r.matchday = $matchday
AND r.status IN (2,3)
ORDER BY rank ASC, LOWER(u.username) ASC";
@@ -50,7 +59,7 @@ if ($league <> 0)
'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,
'U_BET_USER' => $this->helper->route('football_football_popup', array('popside' => 'bet_popup', 's' => $season, 'l' => $league_corr,
'm' => $matchday, 'u' => $row['user_id'])),
'POINTS' => $row['points'],
'COLOR_STYLE' => $colorstyle,
@@ -60,7 +69,7 @@ if ($league <> 0)
}
}
$db->sql_freeresult($result);
$league_info = league_info($season, $league);
$league_info = league_info($season, $league_corr);
$template->assign_vars(array(
'S_DISPLAY_RANK_MATCHDAY' => true,

View File

@@ -172,13 +172,13 @@ while($row = $db->sql_fetchrow($result))
{
if ($rankof[$row['user_id']] > $prevrankof[$row['user_id']])
{
$change_sign = '+';
$differ = $rankof[$row['user_id']] - $prevrankof[$row['user_id']];
$change_sign = '-';
$differ = $prevrankof[$row['user_id']] - $rankof[$row['user_id']];
$change_differ = ' (' . $differ . ')';
}
else
{
$change_sign = '-';
$change_sign = '+';
$differ = $prevrankof[$row['user_id']] - $rankof[$row['user_id']];
$change_differ = ' (' . $differ . ')';
}

View File

@@ -482,13 +482,13 @@ switch ($mode)
{
if ($rank > $prev_rank_of[$curr_rank['user_id']])
{
$change_sign = '+';
$differ = $rank - $prev_rank_of[$curr_rank['user_id']];
$change_sign = '-';
$differ = $prev_rank_of[$curr_rank['user_id']] - $rank;
$change_differ = ' (' . $differ . ')';
}
else
{
$change_sign = '-';
$change_sign = '+';
$differ = $prev_rank_of[$curr_rank['user_id']] - $rank;
$change_differ = ' (' . $differ . ')';
}

View File

@@ -389,7 +389,6 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['RESULTS']);
switch ($league_info['bet_ko_type'])
{
case BET_KO_90:
@@ -410,8 +409,21 @@ switch ($league_info['bet_ko_type'])
break;
}
// set correct display for usage in menu template
if($side == 'results')
{
$display_results = true;
$sidename = sprintf($user->lang['RESULTS']);
}
if($side == 'results_tl')
{
$display_results_tl = true;
$sidename = sprintf($user->lang['RESULTS']);
}
$template->assign_vars(array(
'S_DISPLAY_RESULTS' => true,
'S_DISPLAY_RESULTS' => $display_results,
'S_DISPLAY_RESULTS_TL' => $display_results_tl,
'S_EXTRA_RESULTS' => $extra_results,
'S_SIDENAME' => $sidename,
'RESULT_EXPLAIN' => $result_explain,

View File

@@ -42,17 +42,23 @@ $rank = 0;
$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, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0)))
+ IFNULL((SELECT SUM(c.win) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday),0)AS win,
SUM(IF(goals_home = goals_guest, 1, 0))
+ IFNULL((SELECT SUM(c.draw) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday),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)))
+ IFNULL((SELECT SUM(c.lost) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday),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,
) + IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday), 0)
+ IFNULL((SELECT SUM(c.points) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday),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
SUM(IF(m.team_id_home = t.team_id, goals_guest , goals_home)) AS goals_against,
IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday), 0) AS bonus
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)
@@ -60,6 +66,7 @@ $sql = "SELECT
AND t.league = $league
AND m.matchday <= $matchday
AND m.status IN (2,3,5,6)
AND m.show_table = 0
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
@@ -147,7 +154,8 @@ foreach($points_ary as $group_id => $points)
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'],
'BONUS' => round($row['bonus'],2),
'POINTS' => round($row['points'],2),
)
);
}
@@ -157,27 +165,34 @@ foreach($points_ary as $group_id => $points)
$db->sql_freeresult($result);
$rank = 0;
// Get form-table-information
$sql = 'SELECT
$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)),
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)))
+ IFNULL((SELECT SUM(c.win) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.matchday >= $form_from),0)AS win,
SUM(IF(goals_home = goals_guest, 1, 0))
+ IFNULL((SELECT SUM(c.draw) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.matchday >= $form_from),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)))
+ IFNULL((SELECT SUM(c.lost) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.matchday >= $form_from),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,
) + IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday AND b.matchday >= $form_from),0)
+ IFNULL((SELECT SUM(c.points) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.matchday >= $form_from),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
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,
IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday AND b.matchday >= $form_from),0) AS bonus
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)
AND m.show_table = 0
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
@@ -241,8 +256,9 @@ while($row = $db->sql_fetchrow($result))
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'],
'GOALS_DIFF' => $row['goals_diff'],
'BONUS' => round($row['bonus'],2),
'POINTS' => round($row['points'],2),
)
);
}
@@ -250,23 +266,29 @@ while($row = $db->sql_fetchrow($result))
$db->sql_freeresult($result);
$rank = 0;
// Get home-table-information
$sql = 'SELECT
$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(IF(goals_home + 0 > goals_guest, 1, 0))
+ IFNULL((SELECT SUM(c.win) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 1 ),0)AS win,
SUM(IF(goals_home = goals_guest, 1, 0))
+ IFNULL((SELECT SUM(c.draw) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 1 ),0)AS draw,
SUM(IF(goals_home + 0 < goals_guest, 1, 0))
+ IFNULL((SELECT SUM(c.lost) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 1 ),0)AS lost,
SUM(IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)))+ IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday AND home = '1'),0)
+ IFNULL((SELECT SUM(c.points) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 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
SUM(goals_guest) AS goals_against,
IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND home = '1'),0) AS bonus
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)
AND m.show_table = 0
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
@@ -329,8 +351,9 @@ while($row = $db->sql_fetchrow($result))
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'],
'GOALS_DIFF' => $row['goals_diff'],
'BONUS' => round($row['bonus'],2),
'POINTS' => round($row['points'],2),
)
);
}
@@ -338,23 +361,29 @@ while($row = $db->sql_fetchrow($result))
$db->sql_freeresult($result);
$rank = 0;
// Get away-table-information
$sql = 'SELECT
$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(IF(goals_home + 0 < goals_guest, 1, 0))
+ IFNULL((SELECT SUM(c.win) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 0 ),0)AS win,
SUM(IF(goals_home = goals_guest, 1, 0))
+ IFNULL((SELECT SUM(c.draw) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 0 ),0)AS draw,
SUM(IF(goals_home + 0 > goals_guest, 1, 0))
+ IFNULL((SELECT SUM(c.lost) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 0 ),0)AS lost,
SUM(IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) + IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday AND home = '0'),0)
+ IFNULL((SELECT SUM(c.points) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 0 ),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
SUM(goals_home) AS goals_against,
IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND home = '0'),0) AS bonus
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)
AND m.show_table = 0
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
@@ -417,23 +446,34 @@ while($row = $db->sql_fetchrow($result))
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'],
'GOALS_DIFF' => $row['goals_diff'],
'BONUS' => round($row['bonus'],2),
'POINTS' => round($row['points'],2),
)
);
}
}
if($league > 50)
{
// Activate bonus coloumn only for tippers.
$data_bns = true;
}
if($side == 'table') {
$display_table_menu = true;
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['TABLE']);
$template->assign_vars(array(
'S_DISPLAY_TABLE' => true,
'S_DISPLAY_TABLE' => true,
'S_DISPLAY_TABLE_MENU' => $display_table_menu,
'S_SIDENAME' => $sidename,
'S_DATA_TABLE' => $data_table,
'S_DATA_FORM' => $data_form,
'SEASON' => $season,
'LEAGUE' => $league,
'TEXT_FORM' => $text_form,
'S_DATA_BNS' => $data_bns,
)
);

View File

@@ -12,46 +12,46 @@ 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
- '@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
- '@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
- '@auth'
- '@config'
- '@ext.manager'
- '@path_helper'
- '@dbal.conn'
- '@controller.helper'
- '@template'
- '@user'
- %core.root_path%
- %core.php_ext%
@@ -60,38 +60,38 @@ services:
scope: prototype
arguments:
- %football.version_data%
- @config
- @version_helper
- @template
- @user
- '@config'
- '@version_helper'
- '@template'
- '@user'
football.football.controller_xml:
class: football\football\controller\xmlplan
arguments:
- @config
- @ext.manager
- @path_helper
- @dbal.conn
- @user
- '@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
- '@user'
- '@dbal.conn'
football.football.listener:
class: football\football\event\main_listener
arguments:
- @auth
- @config
- @controller.helper
- @template
- @path_helper
- @ext.manager
- @user
- '@auth'
- '@config'
- '@controller.helper'
- '@template'
- '@path_helper'
- '@ext.manager'
- '@user'
- %core.root_path%
- %core.php_ext%
tags:
@@ -102,12 +102,12 @@ services:
arguments:
- %core.root_path%
- %core.php_ext%
- @ext.manager
- @path_helper
- @dbal.conn
- @config
- @log
- @user
- '@ext.manager'
- '@path_helper'
- '@dbal.conn'
- '@config'
- '@log'
- '@user'
calls:
- [set_name, [football.football.cron.task.football_remember]]
tags:

View File

@@ -732,6 +732,9 @@ class main
}
calculate_extra_points($season, $league, $matchday);
save_ranking_matchday($season, $league, $matchday);
bonuspoints($season, $league, $matchday);
corr($season, $league, $matchday);
chart($season, $league, $matchday);
break;
case 'join':
join_league($season, $league, $user->data['user_id']);
@@ -782,19 +785,48 @@ class main
}
$league_name = '';
$sql = 'SELECT * FROM ' . FOOTB_LEAGUES . " WHERE season = $season AND league_type >= 1";
if ($side == 'table' OR $side == 'results_tl')
{
$sql = 'SELECT * FROM ' . FOOTB_LEAGUES . " WHERE season = $season AND league_type >= 1 AND (league >= 50 OR bet_type = 1) ORDER BY sort ASC";
}
else
{
$sql = 'SELECT * FROM ' . FOOTB_LEAGUES . " WHERE season = $season AND league_type >= 1 AND league < 50";
}
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result))
{
$selected = ($league && $row['league'] == $league) ? ' selected="selected"' : '';
$selected = ($league && $row['league'] == $league) ? ' selected="selected"' : '';
if ($side == 'table' && $league_info['bet_type'])
{
$side = 'ranks_total';
}
elseif ($side == 'ranks_total' && !$league_info['bet_type'])
{
$side = 'table';
}
elseif ($side == 'table' OR $side == 'results_tl')
{
if ($league < 51)
{
$league = $league + 50;
}
}
else
{
if ($league > 50)
{
$league = $league - 50;
}
}
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
'S_LEAGUENAME' => $row['league_name'],
'S_SELECTED' => $selected
)
);
}
@@ -905,7 +937,7 @@ class main
// Start matchday list
if ($side == 'bet')
{
include($this->football_root_path . 'block/side_table.' . $this->php_ext);
}
else
{
@@ -915,18 +947,18 @@ class main
//*****************************************************************************
// 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
//*****************************************************************************
}
if ($side == 'bet')
{
include($this->football_root_path . 'block/table.' . $this->php_ext);
}
// Start assign vars
$sql_ary = array(
'football_season' => (int) $season,
@@ -978,8 +1010,9 @@ class main
'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'],
'FOOTBALL_LEFT_COLUMN' => $config['football_left_column_width'],
'FOOTBALL_RIGHT_COLUMN' => $config['football_right_column_width'],
'S_BET_TYPE' => $league_info['bet_type'],
));
// End assign vars
@@ -989,6 +1022,10 @@ class main
{
include($this->football_root_path . 'block/under_construction.' . $this->php_ext);
}
elseif ($side == 'results_tl')
{
include($this->football_root_path . 'block/results.' . $this->php_ext);
}
else
{
include($this->football_root_path . 'block/' . $side . '.' . $this->php_ext);

View File

@@ -219,8 +219,9 @@ class main_listener implements EventSubscriberInterface
'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_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_RESULTS_TL' => $this->controller_helper->route('football_main_controller', array('side' => 'results_tl', '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)),

BIN
images/flags/1. FC Gera.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
images/flags/AC Florenz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
images/flags/AC Mailand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/flags/AEK Athen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/flags/AIK Solna.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
images/flags/AS Monaco.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
images/flags/AS Rom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
images/flags/AZ Alkmaar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/flags/Aalborg BK.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
images/flags/Albania.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
images/flags/Algeria.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
images/flags/Andorra.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

BIN
images/flags/Angola.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

BIN
images/flags/Anguilla.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
images/flags/Argentina.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

BIN
images/flags/Armenia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
images/flags/Aruba.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
images/flags/Australia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
images/flags/Austria.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

BIN
images/flags/Azerbaijan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
images/flags/Bahamas.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/flags/Bahrain.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

BIN
images/flags/Bangladesh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

BIN
images/flags/Barbados.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
images/flags/Belarus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

BIN
images/flags/Belgium.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

BIN
images/flags/Belize.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/flags/Benin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/flags/Bermuda.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/flags/Bhutan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Some files were not shown because too many files have changed in this diff Show More