Compare commits
25 Commits
v0.9.8
...
dev_julian
| Author | SHA1 | Date | |
|---|---|---|---|
| 66dceff9f2 | |||
| 8b679b1286 | |||
| e1db71c99d | |||
| 3ade0f043f | |||
| f56cf04e74 | |||
| 66b2a1a8d0 | |||
| 889ff05ca6 | |||
| 0b9f099381 | |||
| 148c16c87a | |||
| 511fab50b7 | |||
| 6c06de3772 | |||
| 37204150dc | |||
| 85d3c835d2 | |||
| ac536658fa | |||
| 92267523b9 | |||
| 4a64eb71a3 | |||
| 268ca763f7 | |||
| 66b35b0155 | |||
| 4b627586f8 | |||
| 3b47093a3a | |||
| 511a23d609 | |||
| 6b9ebb0d1a | |||
|
|
7d8b92f1df | ||
|
|
c075143bfc | ||
|
|
a502b5d082 |
24
.gitignore
vendored
@@ -39,3 +39,27 @@ Icon
|
||||
# Files that might appear on external disk
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
/styles/prosilver/theme/images/right_arrow.png
|
||||
/styles/prosilver/theme/images/icon_allbets.gif
|
||||
/styles/prosilver/theme/images/icon_ball.gif
|
||||
/styles/prosilver/theme/images/icon_ball2.gif
|
||||
/styles/prosilver/theme/images/icon_bet.gif
|
||||
/styles/prosilver/theme/images/icon_bookmark.gif
|
||||
/styles/prosilver/theme/images/icon_download.gif
|
||||
/styles/prosilver/theme/images/icon_info.gif
|
||||
/styles/prosilver/theme/images/icon_list.gif
|
||||
/styles/prosilver/theme/images/icon_mark.gif
|
||||
/styles/prosilver/theme/images/icon_odds.gif
|
||||
/styles/prosilver/theme/images/icon_points.gif
|
||||
/styles/prosilver/theme/images/icon_print.gif
|
||||
/styles/prosilver/theme/images/icon_rank.gif
|
||||
/styles/prosilver/theme/images/icon_results.gif
|
||||
/styles/prosilver/theme/images/icon_rules.gif
|
||||
/styles/prosilver/theme/images/icon_statistic.gif
|
||||
/styles/prosilver/theme/images/icon_statistics.gif
|
||||
/styles/prosilver/theme/images/icon_xml.gif
|
||||
/styles/prosilver/theme/images/left_arrow.png
|
||||
/images/no_change.gif
|
||||
/images/arrow_down.gif
|
||||
/images/arrow_up.gif
|
||||
/migrations/v099_beta1.php
|
||||
|
||||
@@ -219,7 +219,6 @@ class all_bets_module
|
||||
$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)
|
||||
@@ -311,7 +310,7 @@ class all_bets_module
|
||||
$total = 0;
|
||||
}
|
||||
$bet_index++;
|
||||
$total += $user_bet['points'];
|
||||
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||
if ($user_bet['status'] < 3)
|
||||
{
|
||||
$colorstyle_total = ' color_provisionally';
|
||||
@@ -419,7 +418,7 @@ class all_bets_module
|
||||
$total = 0;
|
||||
}
|
||||
$bet_index++;
|
||||
$total += $user_bet['points'];
|
||||
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||
if ($user_bet['status'] < 3)
|
||||
{
|
||||
$colorstyle_total = ' color_provisionally';
|
||||
@@ -573,7 +572,9 @@ class all_bets_module
|
||||
)
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result_bet);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$legend = delivery($season, $league, $matchday);
|
||||
|
||||
|
||||
@@ -184,6 +184,7 @@ class bank_module
|
||||
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();
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -199,6 +200,7 @@ class bank_module
|
||||
HAVING win > 0";
|
||||
$result = $db->sql_query($sql);
|
||||
$points_ary = $db->sql_fetchrowset($result);
|
||||
$db->sql_freeresult($result);
|
||||
if (!$default_matchday)
|
||||
{
|
||||
$matchday = (curr_matchday($season, $league) > 0) ? curr_matchday($season, $league) : 1;
|
||||
@@ -351,6 +353,7 @@ class bank_module
|
||||
AND points_type = $type";
|
||||
$result = $db->sql_query($sql);
|
||||
$count_updates += $db->sql_affectedrows();
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
$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));
|
||||
|
||||
@@ -325,6 +325,7 @@ class bets_module
|
||||
}
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($resultopen);
|
||||
if ($count_updates > 0)
|
||||
{
|
||||
if ($same AND ($count_matches > 6) AND $this->config['football_same_allowed'] == 0)
|
||||
@@ -358,7 +359,6 @@ class bets_module
|
||||
{
|
||||
$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";
|
||||
@@ -418,6 +418,7 @@ class bets_module
|
||||
}
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($resultextra);
|
||||
if ($count_extra_updates)
|
||||
{
|
||||
$success[] = sprintf($user->lang['EXTRA_BET' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates);
|
||||
@@ -425,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;
|
||||
}
|
||||
@@ -582,6 +586,7 @@ class bets_module
|
||||
)
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($resultopen);
|
||||
|
||||
// Calculate extra bets of matchday
|
||||
// Start select team
|
||||
|
||||
@@ -152,8 +152,6 @@ class extra_module
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Which page?
|
||||
switch ($action)
|
||||
{
|
||||
@@ -265,7 +263,7 @@ class extra_module
|
||||
$matchday_eval_options .= '<option value="' . $row['matchday'] . '"' . $selected_eval . '>' . $day_name . '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
$question_type_options = '';
|
||||
for($i = 1; $i<= 5; $i++)
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ class football_module
|
||||
));
|
||||
|
||||
// Pull the array data from the lang pack
|
||||
foreach ($user->help as $help_ary)
|
||||
foreach ($user->lang['FOOTBALL_HELP_FAQ'] as $help_ary)
|
||||
{
|
||||
if ($help_ary[0] == '--')
|
||||
{
|
||||
@@ -107,7 +107,7 @@ class football_module
|
||||
'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_time_shift' => array('lang' => 'TIME_SHIFT', 'validate' => 'int', 'type' => 'select', 'method' => 'time_shift_select', 'params' => array('{CONFIG_VALUE}', false), '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),
|
||||
@@ -120,6 +120,8 @@ class football_module
|
||||
'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_last_users' => array('lang' => 'DISPLAY_LAST_USERS', 'validate' => 'int','type' => 'text:3:3', 'explain' => true),
|
||||
'football_display_last_results' => array('lang' => 'DISPLAY_LAST_RESULTS', '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),
|
||||
|
||||
@@ -362,7 +364,7 @@ class football_module
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust Cronjob EMail remember next un
|
||||
* Adjust Cronjob EMail remember next run
|
||||
*/
|
||||
function next_run($value, $key = '')
|
||||
{
|
||||
@@ -419,6 +421,18 @@ class football_module
|
||||
$year_options . ' ' . $user->lang['HOURS'] . ': ' . $hour_options . ' ' . $user->lang['MINUTES'] . ': ' . $minute_options;
|
||||
|
||||
}
|
||||
|
||||
function time_shift_select($default = 0)
|
||||
{
|
||||
$time_shift_options = "";
|
||||
for ($i = -23; $i < 24; $i++)
|
||||
{
|
||||
$selected = ($i == $default) ? ' selected="selected"' : '';
|
||||
$time_shift_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
|
||||
}
|
||||
return $time_shift_options;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -153,7 +153,6 @@ class leagues_module
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
@@ -323,6 +323,7 @@ class matchdays_module
|
||||
ORDER BY matchday ASC, number ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
$rows_matchdays = $db->sql_fetchrowset($result);
|
||||
$db->sql_freeresult($result);
|
||||
$row_number = 0;
|
||||
foreach ($rows_matchdays as $row_matchday)
|
||||
{
|
||||
@@ -710,7 +711,7 @@ class matchdays_module
|
||||
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);
|
||||
$local_board_time = time() + ($this->config['football_time_shift'] * 3600);
|
||||
if ($delivery_timestamp > $local_board_time AND $matchday_row['status'] == 0)
|
||||
{
|
||||
// check if delivery is before all open matches
|
||||
@@ -764,6 +765,7 @@ class matchdays_module
|
||||
// reopen matchday
|
||||
$matchday_row['status'] = 0;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -413,7 +413,7 @@ class matches_module
|
||||
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);
|
||||
$local_board_time = time() + ($this->config['football_time_shift'] * 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
|
||||
@@ -627,7 +627,7 @@ class matches_module
|
||||
$selected_home = ($home_id && $row['team_id'] == $home_id) ? ' selected="selected"' : '';
|
||||
$team_home_options .= '<option value="' . $row['group_id'] . ';' . $row['team_id'] .'"' . $selected_home . '>' . $row['team_name'] . '</option>';
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
$u_back = $this->u_action . "&s=$season&l=$league&m=$matchday";
|
||||
|
||||
$template->assign_vars(array(
|
||||
|
||||
@@ -192,7 +192,7 @@ class results_module
|
||||
{
|
||||
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);
|
||||
$local_board_time = time() + ($this->config['football_time_shift'] * 3600);
|
||||
|
||||
// Which page?
|
||||
switch ($action)
|
||||
@@ -382,6 +382,7 @@ class results_module
|
||||
}
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($resultextra);
|
||||
if ($count_extra_updates)
|
||||
{
|
||||
$success[] = sprintf($user->lang['EXTRA_RESULT' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates);
|
||||
@@ -442,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)
|
||||
@@ -768,6 +772,7 @@ class results_module
|
||||
);
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
switch ($league_info['bet_ko_type'])
|
||||
{
|
||||
|
||||
@@ -397,6 +397,7 @@ class update_module
|
||||
{
|
||||
$error[] = sprintf($user->lang['MISMATCH_MATCHDAYS'], $row['matchdays']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT COUNT(match_no) as matches
|
||||
FROM ' . FOOTB_MATCHES . "
|
||||
@@ -414,6 +415,7 @@ class update_module
|
||||
{
|
||||
$error[] = sprintf($user->lang['MISMATCH_MATCHES'], $row['matches']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!sizeof($error))
|
||||
{
|
||||
@@ -547,6 +549,7 @@ class update_module
|
||||
$count_updates++;
|
||||
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
if ($effected_matchdays <> '')
|
||||
{
|
||||
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
|
||||
@@ -591,6 +594,7 @@ class update_module
|
||||
$count_updates++;
|
||||
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
if ($effected_matchdays <> '')
|
||||
{
|
||||
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
|
||||
@@ -635,6 +639,7 @@ class update_module
|
||||
$count_updates++;
|
||||
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
if ($effected_matchdays <> '')
|
||||
{
|
||||
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
|
||||
@@ -662,7 +667,7 @@ class update_module
|
||||
}
|
||||
|
||||
// check status of matchdays
|
||||
$local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600);
|
||||
$local_board_time = time() + ($this->config['football_time_shift'] * 3600);
|
||||
$sql = $sql = 'UPDATE ' . FOOTB_MATCHDAYS . " AS target
|
||||
INNER JOIN
|
||||
(
|
||||
@@ -1382,6 +1387,7 @@ class update_module
|
||||
}
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
return $count_updates;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
@@ -78,7 +102,6 @@ else
|
||||
$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)
|
||||
@@ -114,21 +137,47 @@ if ($count_matches > 0)
|
||||
{
|
||||
$matches_on_matchday = true;
|
||||
|
||||
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 ' . 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 LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC";
|
||||
|
||||
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);
|
||||
@@ -170,7 +219,15 @@ foreach ($matches AS $match)
|
||||
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';
|
||||
@@ -183,7 +240,7 @@ foreach ($matches AS $match)
|
||||
$total = 0;
|
||||
}
|
||||
$bet_index++;
|
||||
$total += $user_bet['points'];
|
||||
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||
if ($user_bet['status'] < 3)
|
||||
{
|
||||
$colorstyle_total = ' color_provisionally';
|
||||
@@ -269,6 +326,7 @@ foreach ($matches AS $match)
|
||||
'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'])
|
||||
@@ -288,12 +346,22 @@ if ($count_matches > 0)
|
||||
$total = 0;
|
||||
$count_user = 0;
|
||||
$bet_index = 0;
|
||||
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';
|
||||
@@ -306,7 +374,7 @@ if ($count_matches > 0)
|
||||
$total = 0;
|
||||
}
|
||||
$bet_index++;
|
||||
$total += $user_bet['points'];
|
||||
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||
if ($user_bet['status'] < 3)
|
||||
{
|
||||
$colorstyle_total = ' color_provisionally';
|
||||
@@ -343,6 +411,7 @@ if ($count_matches > 0)
|
||||
$bet_index = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_block_vars('match_panel.tendency_footer', array(
|
||||
'S_TOTAL' => true,
|
||||
@@ -451,7 +520,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';
|
||||
@@ -479,19 +548,14 @@ while ($row = $db->sql_fetchrow($result))
|
||||
)
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result_bet);
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$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),
|
||||
|
||||
@@ -221,12 +221,6 @@ $template->assign_vars(array(
|
||||
'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'],
|
||||
)
|
||||
|
||||
@@ -468,6 +468,8 @@ while ($row = $db->sql_fetchrow($result))
|
||||
);
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$league_info = league_info($season, $league);
|
||||
$bet_explain = '';
|
||||
switch ($league_info['bet_ko_type'])
|
||||
@@ -505,12 +507,6 @@ $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')),
|
||||
|
||||
@@ -347,6 +347,7 @@ while ($row = $db->sql_fetchrow($result))
|
||||
)
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sidename = sprintf($user->lang['BET']);
|
||||
if ($data_bet)
|
||||
|
||||
@@ -15,7 +15,7 @@ $data_delivery = false;
|
||||
$user_id = $user->data['user_id'];
|
||||
$lang_dates = $user->lang['datetime'];
|
||||
$index = 0;
|
||||
$local_board_time = time() + (($config['board_timezone'] - $config['football_host_timezone']) * 3600);
|
||||
$local_board_time = time() + ($config['football_time_shift'] * 3600);
|
||||
$sql = "SELECT
|
||||
m.season,
|
||||
m.league,
|
||||
|
||||
@@ -89,6 +89,7 @@ else
|
||||
trigger_error('NO_LEAGUE');
|
||||
}
|
||||
$user_rows = $db->sql_fetchrowset($result);
|
||||
$db->sql_freeresult($result);
|
||||
$export_file = $league_short . '_' . $season . '_bank.csv';
|
||||
$newline = "\r\n";
|
||||
header('Pragma: no-cache');
|
||||
|
||||
@@ -49,6 +49,7 @@ else
|
||||
trigger_error('NO_SEASON');
|
||||
}
|
||||
$user_rows = $db->sql_fetchrowset($result);
|
||||
$db->sql_freeresult($result);
|
||||
$export_file = $season. '_bank.csv';
|
||||
$newline = "\r\n";
|
||||
header('Pragma: no-cache');
|
||||
|
||||
@@ -91,6 +91,10 @@ else
|
||||
$data_last_home = false;
|
||||
$data_last_away = false;
|
||||
$form_from = $matchday-5;
|
||||
$percent_home = 0;
|
||||
$percent_draw = 0;
|
||||
$percent_guest = 0;
|
||||
$stat_hist = '';
|
||||
$value_h = 0;
|
||||
$value_g = 0;
|
||||
$value_hg = 0;
|
||||
@@ -115,7 +119,6 @@ else
|
||||
{
|
||||
$logo[$home_id] = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -142,7 +145,6 @@ else
|
||||
{
|
||||
$logo[$guest_id] = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -245,7 +247,6 @@ else
|
||||
)
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Statistic and forecast-points for historie
|
||||
$sql = "SELECT
|
||||
@@ -322,10 +323,6 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
$stat_hist = '';
|
||||
$percent_home = 0;
|
||||
$percent_draw = 0;
|
||||
$percent_guest = 0;
|
||||
if (sizeof($row))
|
||||
{
|
||||
if ($history_count <= 2)
|
||||
@@ -1003,7 +1000,6 @@ else
|
||||
);
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
//last matches home hometeam
|
||||
$sql = '(SELECT
|
||||
@@ -1074,7 +1070,6 @@ else
|
||||
);
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
//last game guestteam
|
||||
$sql = "(SELECT
|
||||
@@ -1158,7 +1153,6 @@ else
|
||||
);
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
//last matches away guestteam
|
||||
$sql = '(SELECT
|
||||
@@ -1226,7 +1220,6 @@ else
|
||||
);
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($history_count == 0 and !($data_home and $data_guest))
|
||||
{
|
||||
@@ -1266,7 +1259,7 @@ else
|
||||
$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);
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$forecast_value = 0;
|
||||
|
||||
150
block/last_results.php
Normal file
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @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
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$user_is_member = user_is_member($user->data['user_id'], $season, $league);
|
||||
$edit_mode = false;
|
||||
$display_group = false;
|
||||
$display_ko = false;
|
||||
$data_lastresults = false;
|
||||
$curr_year = date("Y");
|
||||
$matchnumber = 0;
|
||||
$match_date = "";
|
||||
|
||||
$local_board_time = time() + ($config['football_time_shift'] * 3600);
|
||||
$sql = 'SELECT * FROM ' . FOOTB_MATCHDAYS . " WHERE status = 0 AND delivery_date < FROM_UNIXTIME('$local_board_time')";
|
||||
|
||||
// Calculate matches AND results of matchday
|
||||
$sql = "SELECT
|
||||
m.season,
|
||||
m.league,
|
||||
m.matchday,
|
||||
m.status,
|
||||
m.match_datetime,
|
||||
LEFT(m.match_datetime, 10) AS match_date,
|
||||
l.league_name,
|
||||
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_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_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league)
|
||||
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.match_datetime < FROM_UNIXTIME('$local_board_time')
|
||||
ORDER BY m.match_datetime DESC, m.league ASC
|
||||
LIMIT 100";
|
||||
|
||||
$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_lastresults = true;
|
||||
$matchnumber++ ;
|
||||
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
|
||||
|
||||
if ($match_date <> $row['match_date'])
|
||||
{
|
||||
$match_date = ($match_date == "") ? $row['match_date'] : $match_date;
|
||||
if ($matchnumber > $config['football_display_last_results'] )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
$homelogo = $row['home_symbol'];
|
||||
$homename = $row['home_name'];
|
||||
$homeshort = $row['home_short'];
|
||||
|
||||
$guestlogo = $row['guest_symbol'];
|
||||
$guestname = $row['guest_name'];
|
||||
$guestshort = $row['guest_short'];
|
||||
|
||||
if ($homelogo <> '')
|
||||
{
|
||||
$logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"20\" height=\"20\"/>" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
$logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"20\" height=\"20\"/>" ;
|
||||
}
|
||||
if ($guestlogo <> '')
|
||||
{
|
||||
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"20\" height=\"20\"/>" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
$logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"20\" height=\"20\"/>" ;
|
||||
}
|
||||
|
||||
|
||||
$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'];
|
||||
$colorstyle = color_style($row['status']);
|
||||
|
||||
$template->assign_block_vars('last_results', array(
|
||||
'ROW_CLASS' => $row_class,
|
||||
'U_RESULTS_LINK'=> $this->helper->route('football_main_controller', array('side' => 'results', 's' => $row['season'], 'l' => $row['league'], 'm' => $row['matchday'])),
|
||||
'MATCH_DATE' => $row['match_date'],
|
||||
'MATCH_TIME' => $row['match_time'],
|
||||
'LEAGUE_NAME' => $row['league_name'],
|
||||
'LOGO_HOME' => $logoH,
|
||||
'LOGO_GUEST' => $logoG,
|
||||
'HOME_NAME' => $homename,
|
||||
'GUEST_NAME' => $guestname,
|
||||
'HOME_SHORT' => $homeshort,
|
||||
'GUEST_SHORT' => $guestshort,
|
||||
'GOALS_HOME' => $goals_home,
|
||||
'GOALS_GUEST' => $goals_guest,
|
||||
'COLOR_STYLE' => color_style($row['status']),
|
||||
'KOGOALS_HOME' => $kogoals_home,
|
||||
'KOGOALS_GUEST' => $kogoals_guest,
|
||||
'COLOR_STYLE' => $colorstyle,
|
||||
)
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
|
||||
$sidename = sprintf($user->lang['LAST_RESULTS']);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_LAST_RESULTS' => true,
|
||||
'S_SIDENAME' => $sidename,
|
||||
'S_DATA_LAST_RESULTS' => $data_lastresults,
|
||||
'S_USER_IS_MEMBER' => $user_is_member,
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -13,7 +13,7 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
$display_last_users = false;
|
||||
// Last 5 users
|
||||
// Last users
|
||||
$sql = 'SELECT s.session_user_id
|
||||
, u.username
|
||||
, u.user_colour
|
||||
@@ -28,7 +28,7 @@ $sql = 'SELECT s.session_user_id
|
||||
GROUP BY u.user_id
|
||||
ORDER BY lastvisit DESC';
|
||||
|
||||
$result = $db->sql_query_limit($sql, 5);
|
||||
$result = $db->sql_query_limit($sql, $config['football_display_last_users']);
|
||||
$first = true;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
@@ -58,7 +58,7 @@ $db->sql_freeresult($result);
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'LAST_USERS' => sprintf($user->lang['LAST_VISITORS'], 5),
|
||||
'LAST_USERS' => sprintf($user->lang['LAST_VISITORS'], $config['football_display_last_users']),
|
||||
'S_DISPLAY_LAST_USERS' => $display_last_users,
|
||||
'S_LAST_USERS' => true,
|
||||
));
|
||||
|
||||
@@ -314,14 +314,6 @@ $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,
|
||||
|
||||
@@ -22,20 +22,21 @@ $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);
|
||||
$db->sql_freeresult($result);
|
||||
$total_users = sizeof($current_ranks);
|
||||
if ($total_users > 3 AND $total_users <= 50)
|
||||
{
|
||||
@@ -157,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
|
||||
@@ -210,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
|
||||
@@ -237,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
|
||||
@@ -266,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
|
||||
@@ -317,12 +318,6 @@ $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,
|
||||
|
||||
@@ -98,7 +98,6 @@ 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)
|
||||
@@ -192,7 +191,7 @@ foreach ($matches AS $match)
|
||||
$total = 0;
|
||||
}
|
||||
$bet_index++;
|
||||
$total += $user_bet['points'];
|
||||
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
|
||||
{
|
||||
// hide bets
|
||||
@@ -310,7 +309,7 @@ if ($count_matches > 0)
|
||||
$total = 0;
|
||||
}
|
||||
$bet_index++;
|
||||
$total += $user_bet['points'];
|
||||
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||
if ($user_bet['status'] < 1)
|
||||
{
|
||||
if ($user_bet['bet_home'] == '')
|
||||
@@ -376,12 +375,6 @@ $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),
|
||||
|
||||
@@ -189,12 +189,6 @@ $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,
|
||||
|
||||
@@ -163,12 +163,6 @@ $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,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -413,14 +417,6 @@ $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,
|
||||
|
||||
@@ -198,12 +198,6 @@ $template->assign_vars(array(
|
||||
'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,
|
||||
)
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -159,7 +159,6 @@ while($row = $db->sql_fetchrow($result))
|
||||
if ($rankof[$row['user_id']] == '')
|
||||
{
|
||||
$change_sign = '';
|
||||
$change_img = '';
|
||||
$change_differ = ' ';
|
||||
}
|
||||
else
|
||||
@@ -167,7 +166,6 @@ while($row = $db->sql_fetchrow($result))
|
||||
if ($rankof[$row['user_id']] == $prevrankof[$row['user_id']])
|
||||
{
|
||||
$change_sign = '=';
|
||||
$change_img = "<img src=\"" . $ext_path . "images/no_change.gif\" alt=\"" . $user->lang['NO_CHANGES'] . "\"/>";
|
||||
$change_differ = ' ';
|
||||
}
|
||||
else
|
||||
@@ -175,14 +173,12 @@ while($row = $db->sql_fetchrow($result))
|
||||
if ($rankof[$row['user_id']] > $prevrankof[$row['user_id']])
|
||||
{
|
||||
$change_sign = '+';
|
||||
$change_img = "<img src=\"" . $ext_path . "images/arrow_down.gif\" alt=\"" . $user->lang['WORSENED'] . "\"/>";
|
||||
$differ = $rankof[$row['user_id']] - $prevrankof[$row['user_id']];
|
||||
$change_differ = ' (' . $differ . ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$change_sign = '-';
|
||||
$change_img = "<img src=\"" . $ext_path . "images/arrow_up.gif\" alt=\"" . $user->lang['IMPROVED'] . "\"/>";
|
||||
$differ = $prevrankof[$row['user_id']] - $rankof[$row['user_id']];
|
||||
$change_differ = ' (' . $differ . ')';
|
||||
}
|
||||
@@ -192,7 +188,6 @@ while($row = $db->sql_fetchrow($result))
|
||||
else
|
||||
{
|
||||
$change_sign = '';
|
||||
$change_img = '';
|
||||
$change_differ = ' ';
|
||||
}
|
||||
|
||||
@@ -228,8 +223,10 @@ while($row = $db->sql_fetchrow($result))
|
||||
$template->assign_block_vars('rankstotal', array(
|
||||
'ROW_CLASS' => $row_class,
|
||||
'RANK' => $rankof[$row['user_id']],
|
||||
'NO_CHANGES' => ($change_sign == '=') ? true : false,
|
||||
'WORSENED' => ($change_sign == '-') ? true : false,
|
||||
'IMPROVED' => ($change_sign == '+') ? true : false,
|
||||
'CHANGE_SIGN' => $change_sign,
|
||||
'CHANGE_IMG' => $change_img,
|
||||
'CHANGE_DIFFER' => $change_differ,
|
||||
'USERID' => $row['user_id'],
|
||||
'USERNAME' => $row['username'],
|
||||
@@ -254,12 +251,6 @@ $template->assign_vars(array(
|
||||
'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),
|
||||
|
||||
@@ -157,7 +157,6 @@ switch ($mode)
|
||||
}
|
||||
$index++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sidename = sprintf($user->lang['RANK_TOTAL']);
|
||||
$league_info = league_info($season, $league);
|
||||
@@ -166,13 +165,6 @@ switch ($mode)
|
||||
'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,
|
||||
@@ -328,7 +320,6 @@ switch ($mode)
|
||||
}
|
||||
$index++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sidename = sprintf($user->lang['RANK_TOTAL']);
|
||||
$league_info = league_info($season, $league);
|
||||
@@ -337,13 +328,6 @@ switch ($mode)
|
||||
'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,
|
||||
@@ -492,7 +476,6 @@ switch ($mode)
|
||||
if ($rank == $prev_rank_of[$curr_rank['user_id']])
|
||||
{
|
||||
$change_sign = '=';
|
||||
$change_img = "<img src=\"" . $ext_path . "images/no_change.gif\" alt=\"" . $user->lang['NO_CHANGES'] . "\"/>";
|
||||
$change_differ = '';
|
||||
}
|
||||
else
|
||||
@@ -500,14 +483,12 @@ switch ($mode)
|
||||
if ($rank > $prev_rank_of[$curr_rank['user_id']])
|
||||
{
|
||||
$change_sign = '+';
|
||||
$change_img = "<img src=\"" . $ext_path . "images/arrow_down.gif\" alt=\"" . $user->lang['WORSENED'] . "\"/>";
|
||||
$differ = $rank - $prev_rank_of[$curr_rank['user_id']];
|
||||
$change_differ = ' (' . $differ . ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$change_sign = '-';
|
||||
$change_img = "<img src=\"" . $ext_path . "images/arrow_up.gif\" alt=\"" . $user->lang['IMPROVED'] . "\"/>";
|
||||
$differ = $prev_rank_of[$curr_rank['user_id']] - $rank;
|
||||
$change_differ = ' (' . $differ . ')';
|
||||
}
|
||||
@@ -516,7 +497,6 @@ switch ($mode)
|
||||
else
|
||||
{
|
||||
$change_sign = '';
|
||||
$change_img = '';
|
||||
$change_differ = '';
|
||||
}
|
||||
|
||||
@@ -539,8 +519,10 @@ switch ($mode)
|
||||
$template->assign_block_vars('rankstotal', array(
|
||||
'ROW_CLASS' => $row_class,
|
||||
'RANK' => $rank,
|
||||
'NO_CHANGES' => ($change_sign == '=') ? true : false,
|
||||
'WORSENED' => ($change_sign == '-') ? true : false,
|
||||
'IMPROVED' => ($change_sign == '+') ? true : false,
|
||||
'CHANGE_SIGN' => $change_sign,
|
||||
'CHANGE_IMG' => $change_img,
|
||||
'CHANGE_DIFFER' => $change_differ,
|
||||
'USERID' => $curr_rank['user_id'],
|
||||
'USERNAME' => $curr_rank['username'],
|
||||
@@ -558,7 +540,6 @@ switch ($mode)
|
||||
}
|
||||
$index++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sidename = sprintf($user->lang['RANK_TOTAL']);
|
||||
$league_info = league_info($season, $league);
|
||||
@@ -567,13 +548,6 @@ switch ($mode)
|
||||
'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,
|
||||
|
||||
@@ -387,8 +387,8 @@ 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:
|
||||
@@ -409,18 +409,25 @@ 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,
|
||||
'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,
|
||||
|
||||
@@ -112,11 +112,11 @@ else
|
||||
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
|
||||
if ($row['team_symbol'] <> '')
|
||||
{
|
||||
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
|
||||
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"20\" height=\"20\"/>" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
|
||||
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"20\" height=\"20\"/>" ;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('side_total', array(
|
||||
|
||||
@@ -154,12 +154,6 @@ $template->assign_vars(array(
|
||||
'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,
|
||||
|
||||
@@ -131,12 +131,6 @@ $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,
|
||||
|
||||
106
block/table.php
@@ -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, 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))
|
||||
)
|
||||
) 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
|
||||
FROM ' . FOOTB_TEAMS . ' AS t
|
||||
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)
|
||||
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";
|
||||
|
||||
@@ -242,7 +257,8 @@ while($row = $db->sql_fetchrow($result))
|
||||
'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),
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
@@ -330,7 +352,8 @@ while($row = $db->sql_fetchrow($result))
|
||||
'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),
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
@@ -418,28 +447,33 @@ while($row = $db->sql_fetchrow($result))
|
||||
'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),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
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_MENU' => $display_table_menu,
|
||||
'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,
|
||||
'S_DATA_BNS' => $data_bns,
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"type": "phpbb-extension",
|
||||
"description": "Football Prediction League",
|
||||
"homepage": "http://football.bplaced.net",
|
||||
"version": "0.9.8",
|
||||
"time": "2017-02-19",
|
||||
"version": "0.9.9",
|
||||
"time": "2017-09-09",
|
||||
"license": "GPL-2.0",
|
||||
"authors": [{
|
||||
"name": "J. Helmke",
|
||||
@@ -18,7 +18,7 @@
|
||||
"extra": {
|
||||
"display-name": "Football Prediction League",
|
||||
"soft-require": {
|
||||
"phpbb/phpbb": "3.1.*"
|
||||
"phpbb/phpbb": ">3.1.*"
|
||||
},
|
||||
"version-check": {
|
||||
"host": "football.bplaced.net",
|
||||
|
||||
@@ -308,8 +308,8 @@ class main
|
||||
$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);
|
||||
$db->sql_freeresult($resultopen);
|
||||
|
||||
$count_matches = 0;
|
||||
$count_updates = 0;
|
||||
@@ -419,7 +419,6 @@ class main
|
||||
{
|
||||
$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";
|
||||
@@ -479,6 +478,7 @@ class main
|
||||
}
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($resultextra);
|
||||
if ($count_extra_updates)
|
||||
{
|
||||
$dbmsg = $dbmsg . ' ' . sprintf($user->lang['EXTRA_BET' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates);
|
||||
@@ -725,12 +725,16 @@ class main
|
||||
}
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($resultextra);
|
||||
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);
|
||||
bonuspoints($season, $league, $matchday);
|
||||
corr($season, $league, $matchday);
|
||||
chart($season, $league, $matchday);
|
||||
break;
|
||||
case 'join':
|
||||
join_league($season, $league, $user->data['user_id']);
|
||||
@@ -781,11 +785,36 @@ 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"' : '';
|
||||
if ($side == 'table' && $league_info['bet_type'])
|
||||
{
|
||||
|
||||
}
|
||||
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'];
|
||||
@@ -823,7 +852,7 @@ class main
|
||||
$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);
|
||||
$local_board_time = time() + ($config['football_time_shift'] * 3600);
|
||||
$sql = "SELECT *,
|
||||
CONCAT(
|
||||
CASE DATE_FORMAT(delivery_date,'%w')
|
||||
@@ -904,7 +933,7 @@ class main
|
||||
// Start matchday list
|
||||
if ($side == 'bet')
|
||||
{
|
||||
include($this->football_root_path . 'block/side_table.' . $this->php_ext);
|
||||
include($this->football_root_path . 'block/table.' . $this->php_ext);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -914,12 +943,6 @@ 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
|
||||
@@ -988,6 +1011,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);
|
||||
@@ -1000,8 +1027,15 @@ class main
|
||||
else
|
||||
{
|
||||
$mobile = '';
|
||||
if ($config['football_display_last_users'] > 0)
|
||||
{
|
||||
include($this->football_root_path . 'block/last_users.' . $this->php_ext);
|
||||
}
|
||||
if ($config['football_display_last_results'] > 0)
|
||||
{
|
||||
include($this->football_root_path . 'block/last_results.' . $this->php_ext);
|
||||
}
|
||||
}
|
||||
// Send data to the template file
|
||||
if ($view == 'print')
|
||||
{
|
||||
|
||||
@@ -221,6 +221,7 @@ class main_listener implements EventSubscriberInterface
|
||||
'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_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)),
|
||||
|
||||
|
Before Width: | Height: | Size: 187 B |
|
Before Width: | Height: | Size: 188 B |
BIN
images/flags/1. FC Gera.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
images/flags/1. FC Heidenheim 1846.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
images/flags/1. FC Kaiserslautern.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
images/flags/1. FC Koeln.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
images/flags/1. FC Magdeburg.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
images/flags/1. FC Neubrandenburg 04.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
images/flags/1. FC Normannia Schwaebisch Gmuend.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
images/flags/1. FC Nuernberg.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
images/flags/1. FC Saarbruecken.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
images/flags/1. FC Schweinfurt 05.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
images/flags/1. FC Union Berlin.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
images/flags/1. FSV Mainz 05.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
images/flags/AC Florenz.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
images/flags/AC Mailand.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
images/flags/AEK Athen.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
images/flags/AEK Larnaka.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
images/flags/AEL Limassol.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
images/flags/AFC Sunderland.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
images/flags/AIK Solna.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
images/flags/APOEL Nikosia.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
images/flags/AS Monaco.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
images/flags/AS Rom.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
images/flags/AS St. Etienne.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
images/flags/ASV Bergedorf 85.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
images/flags/ASV Durlach.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
images/flags/AZ Alkmaar.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
images/flags/Aalborg BK.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
images/flags/Aalesunds FK.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
images/flags/Academica Coimbra.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/flags/Afghanistan.png
Normal file
|
After Width: | Height: | Size: 417 B |
BIN
images/flags/Ajax Amsterdam.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
images/flags/Alania Wladikawkas.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
images/flags/Albania.png
Normal file
|
After Width: | Height: | Size: 594 B |
BIN
images/flags/Alemannia Aachen.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
images/flags/Algeria.png
Normal file
|
After Width: | Height: | Size: 345 B |
BIN
images/flags/American-Samoa.png
Normal file
|
After Width: | Height: | Size: 589 B |
BIN
images/flags/Andorra.png
Normal file
|
After Width: | Height: | Size: 478 B |
BIN
images/flags/Angola.png
Normal file
|
After Width: | Height: | Size: 464 B |
BIN
images/flags/Anguilla.png
Normal file
|
After Width: | Height: | Size: 696 B |
BIN
images/flags/Anker Wismar.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
images/flags/Anorthosis Famagusta.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
images/flags/Anschi Machatschkala.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
images/flags/Antigua-Barbuda.png
Normal file
|
After Width: | Height: | Size: 416 B |
BIN
images/flags/Apollon Limassol.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
images/flags/Argentina.png
Normal file
|
After Width: | Height: | Size: 275 B |
BIN
images/flags/Armenia.png
Normal file
|
After Width: | Height: | Size: 124 B |
BIN
images/flags/Arminia Bielefeld.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
images/flags/Aruba.png
Normal file
|
After Width: | Height: | Size: 306 B |
BIN
images/flags/Asteras Tripolis.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
images/flags/Aston Villa.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
images/flags/Astra Giurgiu.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
images/flags/Athletic Bilbao.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
images/flags/Atletico Madrid.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
images/flags/Atromitos Athen.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
images/flags/Australia.png
Normal file
|
After Width: | Height: | Size: 475 B |
BIN
images/flags/Austria Wien.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
images/flags/Austria.png
Normal file
|
After Width: | Height: | Size: 120 B |
BIN
images/flags/Azerbaijan.png
Normal file
|
After Width: | Height: | Size: 365 B |
BIN
images/flags/BATE Borisov.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |