Compare commits
29 Commits
v0.9.5
...
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 | ||
|
|
a16e0e3c79 | ||
|
|
09631cbe15 | ||
|
|
4734d75718 | ||
|
|
caeec03da8 |
24
.gitignore
vendored
@@ -39,3 +39,27 @@ Icon
|
|||||||
# Files that might appear on external disk
|
# Files that might appear on external disk
|
||||||
.Spotlight-V100
|
.Spotlight-V100
|
||||||
.Trashes
|
.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
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ class all_bets_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$this->tpl_name = 'acp_football_all_bets';
|
$this->tpl_name = 'acp_football_all_bets';
|
||||||
$this->page_title = 'ACP_FOOTBALL_ALL_BETS_VIEW';
|
$this->page_title = 'ACP_FOOTBALL_ALL_BETS_VIEW';
|
||||||
@@ -221,7 +219,6 @@ class all_bets_module
|
|||||||
$split_after = $count_matches;
|
$split_after = $count_matches;
|
||||||
$splits = 1;
|
$splits = 1;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
// Make sure $start is set to the last page if it exceeds the amount
|
// Make sure $start is set to the last page if it exceeds the amount
|
||||||
if ($start < 0 || $start >= $total_users)
|
if ($start < 0 || $start >= $total_users)
|
||||||
@@ -313,7 +310,7 @@ class all_bets_module
|
|||||||
$total = 0;
|
$total = 0;
|
||||||
}
|
}
|
||||||
$bet_index++;
|
$bet_index++;
|
||||||
$total += $user_bet['points'];
|
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||||
if ($user_bet['status'] < 3)
|
if ($user_bet['status'] < 3)
|
||||||
{
|
{
|
||||||
$colorstyle_total = ' color_provisionally';
|
$colorstyle_total = ' color_provisionally';
|
||||||
@@ -421,7 +418,7 @@ class all_bets_module
|
|||||||
$total = 0;
|
$total = 0;
|
||||||
}
|
}
|
||||||
$bet_index++;
|
$bet_index++;
|
||||||
$total += $user_bet['points'];
|
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||||
if ($user_bet['status'] < 3)
|
if ($user_bet['status'] < 3)
|
||||||
{
|
{
|
||||||
$colorstyle_total = ' color_provisionally';
|
$colorstyle_total = ' color_provisionally';
|
||||||
@@ -575,7 +572,9 @@ class all_bets_module
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result_bet);
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$legend = delivery($season, $league, $matchday);
|
$legend = delivery($season, $league, $matchday);
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ class bank_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
if (!$this->config['football_bank'])
|
if (!$this->config['football_bank'])
|
||||||
{
|
{
|
||||||
@@ -186,6 +184,7 @@ class bank_module
|
|||||||
AND points_type IN (" . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . ')';
|
AND points_type IN (" . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . ')';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$count_updates += $db->sql_affectedrows();
|
$count_updates += $db->sql_affectedrows();
|
||||||
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -201,6 +200,7 @@ class bank_module
|
|||||||
HAVING win > 0";
|
HAVING win > 0";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$points_ary = $db->sql_fetchrowset($result);
|
$points_ary = $db->sql_fetchrowset($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
if (!$default_matchday)
|
if (!$default_matchday)
|
||||||
{
|
{
|
||||||
$matchday = (curr_matchday($season, $league) > 0) ? curr_matchday($season, $league) : 1;
|
$matchday = (curr_matchday($season, $league) > 0) ? curr_matchday($season, $league) : 1;
|
||||||
@@ -353,6 +353,7 @@ class bank_module
|
|||||||
AND points_type = $type";
|
AND points_type = $type";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$count_updates += $db->sql_affectedrows();
|
$count_updates += $db->sql_affectedrows();
|
||||||
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
$back_link = $this->u_action . '&action=list&s=' . $season . '&l=' . $league . '&t=' . $type . '&start=' . $start;
|
$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));
|
trigger_error(sprintf($user->lang['LEAGUE_' . $points_var . ($count_updates == 1 ? '' : 'S')], $count_updates) . adm_back_link($back_link));
|
||||||
|
|||||||
@@ -39,10 +39,8 @@ class bets_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$this->ext_football_path = $phpbb_root_path . 'ext/football/football/';
|
$this->ext_football_path = $phpbb_root_path . 'ext/football/football/';
|
||||||
if(!function_exists('season_info'))
|
if(!function_exists('season_info'))
|
||||||
@@ -327,6 +325,7 @@ class bets_module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($resultopen);
|
||||||
if ($count_updates > 0)
|
if ($count_updates > 0)
|
||||||
{
|
{
|
||||||
if ($same AND ($count_matches > 6) AND $this->config['football_same_allowed'] == 0)
|
if ($same AND ($count_matches > 6) AND $this->config['football_same_allowed'] == 0)
|
||||||
@@ -360,7 +359,6 @@ class bets_module
|
|||||||
{
|
{
|
||||||
$success[] = sprintf($user->lang['NO_BETS_SAVED']);
|
$success[] = sprintf($user->lang['NO_BETS_SAVED']);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($resultopen);
|
|
||||||
|
|
||||||
// extra bets
|
// extra bets
|
||||||
$sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND matchday = $matchday";
|
$sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND matchday = $matchday";
|
||||||
@@ -420,6 +418,7 @@ class bets_module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($resultextra);
|
||||||
if ($count_extra_updates)
|
if ($count_extra_updates)
|
||||||
{
|
{
|
||||||
$success[] = sprintf($user->lang['EXTRA_BET' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates);
|
$success[] = sprintf($user->lang['EXTRA_BET' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates);
|
||||||
@@ -427,6 +426,9 @@ class bets_module
|
|||||||
$league_info = league_info($season, $league);
|
$league_info = league_info($season, $league);
|
||||||
$cash = $this->request->variable('cash', false);
|
$cash = $this->request->variable('cash', false);
|
||||||
save_ranking_matchday($season, $league, $matchday, $cash);
|
save_ranking_matchday($season, $league, $matchday, $cash);
|
||||||
|
bonuspoints($season, $league, $matchday);
|
||||||
|
corr($season, $league, $matchday);
|
||||||
|
chart($season, $league, $matchday);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -584,6 +586,7 @@ class bets_module
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($resultopen);
|
||||||
|
|
||||||
// Calculate extra bets of matchday
|
// Calculate extra bets of matchday
|
||||||
// Start select team
|
// Start select team
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ class extra_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$this->tpl_name = 'acp_football_extra';
|
$this->tpl_name = 'acp_football_extra';
|
||||||
$this->page_title = 'ACP_FOOTBALL_EXTRA_MANAGE';
|
$this->page_title = 'ACP_FOOTBALL_EXTRA_MANAGE';
|
||||||
@@ -154,8 +152,6 @@ class extra_module
|
|||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
// Which page?
|
// Which page?
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
@@ -267,7 +263,7 @@ class extra_module
|
|||||||
$matchday_eval_options .= '<option value="' . $row['matchday'] . '"' . $selected_eval . '>' . $day_name . '</option>';
|
$matchday_eval_options .= '<option value="' . $row['matchday'] . '"' . $selected_eval . '>' . $day_name . '</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
$question_type_options = '';
|
$question_type_options = '';
|
||||||
for($i = 1; $i<= 5; $i++)
|
for($i = 1; $i<= 5; $i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,10 +51,8 @@ class football_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $phpbb_log;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $phpbb_log;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$user->add_lang('acp/board');
|
$user->add_lang('acp/board');
|
||||||
|
|
||||||
@@ -79,7 +77,7 @@ class football_module
|
|||||||
));
|
));
|
||||||
|
|
||||||
// Pull the array data from the lang pack
|
// 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] == '--')
|
if ($help_ary[0] == '--')
|
||||||
{
|
{
|
||||||
@@ -109,7 +107,7 @@ class football_module
|
|||||||
'football_header_enable' => array('lang' => 'FOOTBALL_HEADER_ENABLE','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'football_header_enable' => array('lang' => 'FOOTBALL_HEADER_ENABLE','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'football_guest_view' => array('lang' => 'GUEST_VIEW', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'football_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_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_display' => array('lang' => 'FOOTBALL_INFO', 'validate' => 'bool', 'type' => 'custom', 'method' => 'football_info', 'explain' => true),
|
||||||
'football_info' => false,
|
'football_info' => false,
|
||||||
'football_win_name' => array('lang' => 'WIN_NAME', 'validate' => 'string', 'type' => 'text:6:6', 'explain' => true),
|
'football_win_name' => array('lang' => 'WIN_NAME', 'validate' => 'string', 'type' => 'text:6:6', 'explain' => true),
|
||||||
@@ -122,6 +120,8 @@ class football_module
|
|||||||
'legend2' => 'GENERAL_SETTINGS',
|
'legend2' => 'GENERAL_SETTINGS',
|
||||||
'football_left_column_width' => array('lang' => 'LEFT_COLUMN', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'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_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_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),
|
'football_users_per_page' => array('lang' => 'USERS_PAGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
|
|
||||||
@@ -364,7 +364,7 @@ class football_module
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adjust Cronjob EMail remember next un
|
* Adjust Cronjob EMail remember next run
|
||||||
*/
|
*/
|
||||||
function next_run($value, $key = '')
|
function next_run($value, $key = '')
|
||||||
{
|
{
|
||||||
@@ -421,6 +421,18 @@ class football_module
|
|||||||
$year_options . ' ' . $user->lang['HOURS'] . ': ' . $hour_options . ' ' . $user->lang['MINUTES'] . ': ' . $minute_options;
|
$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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -47,10 +47,8 @@ class ko_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$this->tpl_name = 'acp_football_ko';
|
$this->tpl_name = 'acp_football_ko';
|
||||||
$this->page_title = 'ACP_FOOTBALL_KO_MANAGE';
|
$this->page_title = 'ACP_FOOTBALL_KO_MANAGE';
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ class leagues_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$this->tpl_name = 'acp_football_leagues';
|
$this->tpl_name = 'acp_football_leagues';
|
||||||
$this->page_title = 'ACP_FOOTBALL_LEAGUES_MANAGE';
|
$this->page_title = 'ACP_FOOTBALL_LEAGUES_MANAGE';
|
||||||
@@ -155,7 +153,6 @@ class leagues_module
|
|||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
if (!($row = $db->sql_fetchrow($result)))
|
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);
|
trigger_error($user->lang['NO_MEMBERS_SELECTED'] . adm_back_link($this->u_action . "&action=list&s=$season&l=$league"), E_USER_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ class matchdays_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$this->tpl_name = 'acp_football_matchdays';
|
$this->tpl_name = 'acp_football_matchdays';
|
||||||
$this->page_title = 'ACP_FOOTBALL_MATCHDAYS_MANAGE';
|
$this->page_title = 'ACP_FOOTBALL_MATCHDAYS_MANAGE';
|
||||||
@@ -325,6 +323,7 @@ class matchdays_module
|
|||||||
ORDER BY matchday ASC, number ASC";
|
ORDER BY matchday ASC, number ASC";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$rows_matchdays = $db->sql_fetchrowset($result);
|
$rows_matchdays = $db->sql_fetchrowset($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
$row_number = 0;
|
$row_number = 0;
|
||||||
foreach ($rows_matchdays as $row_matchday)
|
foreach ($rows_matchdays as $row_matchday)
|
||||||
{
|
{
|
||||||
@@ -712,7 +711,7 @@ class matchdays_module
|
|||||||
if ($data['dday1_day'] <> '--' and $data['dday1_month'] <> '--' and $data['dday1_year'] <> '--')
|
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']);
|
$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)
|
if ($delivery_timestamp > $local_board_time AND $matchday_row['status'] == 0)
|
||||||
{
|
{
|
||||||
// check if delivery is before all open matches
|
// check if delivery is before all open matches
|
||||||
@@ -766,6 +765,7 @@ class matchdays_module
|
|||||||
// reopen matchday
|
// reopen matchday
|
||||||
$matchday_row['status'] = 0;
|
$matchday_row['status'] = 0;
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ class matches_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$this->tpl_name = 'acp_football_matches';
|
$this->tpl_name = 'acp_football_matches';
|
||||||
$this->page_title = 'ACP_FOOTBALL_MATCHES_MANAGE';
|
$this->page_title = 'ACP_FOOTBALL_MATCHES_MANAGE';
|
||||||
@@ -415,7 +413,7 @@ class matches_module
|
|||||||
if ($data['mday_day'] <> '--' and $data['mday_month'] <> '--' and $data['mday_year'] <> '--')
|
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']);
|
$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)
|
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
|
// Bet in time and match moved to future
|
||||||
@@ -629,7 +627,7 @@ class matches_module
|
|||||||
$selected_home = ($home_id && $row['team_id'] == $home_id) ? ' selected="selected"' : '';
|
$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>';
|
$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";
|
$u_back = $this->u_action . "&s=$season&l=$league&m=$matchday";
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
|||||||
@@ -46,10 +46,8 @@ class results_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) {
|
if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) {
|
||||||
// Get an instance of the ultimatepoints functions_points
|
// Get an instance of the ultimatepoints functions_points
|
||||||
@@ -194,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);
|
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?
|
// Which page?
|
||||||
switch ($action)
|
switch ($action)
|
||||||
@@ -384,6 +382,7 @@ class results_module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($resultextra);
|
||||||
if ($count_extra_updates)
|
if ($count_extra_updates)
|
||||||
{
|
{
|
||||||
$success[] = sprintf($user->lang['EXTRA_RESULT' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates);
|
$success[] = sprintf($user->lang['EXTRA_RESULT' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates);
|
||||||
@@ -444,6 +443,9 @@ class results_module
|
|||||||
|
|
||||||
$cash = $this->request->variable('cash', false);
|
$cash = $this->request->variable('cash', false);
|
||||||
save_ranking_matchday($season, $league, $matchday, $cash);
|
save_ranking_matchday($season, $league, $matchday, $cash);
|
||||||
|
bonuspoints($season, $league, $matchday);
|
||||||
|
corr($season, $league, $matchday);
|
||||||
|
chart($season, $league, $matchday);
|
||||||
|
|
||||||
// Patch delevirey
|
// Patch delevirey
|
||||||
if ($league_info['bet_in_time'] == 1)
|
if ($league_info['bet_in_time'] == 1)
|
||||||
@@ -770,6 +772,7 @@ class results_module
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
switch ($league_info['bet_ko_type'])
|
switch ($league_info['bet_ko_type'])
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ class seasons_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$this->tpl_name = 'acp_football_seasons';
|
$this->tpl_name = 'acp_football_seasons';
|
||||||
$this->page_title = 'ACP_FOOTBALL_SEASONS_MANAGE';
|
$this->page_title = 'ACP_FOOTBALL_SEASONS_MANAGE';
|
||||||
|
|||||||
@@ -37,10 +37,8 @@ class teams_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$this->ext_football_path = $phpbb_root_path . 'ext/football/football/';
|
$this->ext_football_path = $phpbb_root_path . 'ext/football/football/';
|
||||||
if(!function_exists('season_info'))
|
if(!function_exists('season_info'))
|
||||||
|
|||||||
@@ -36,10 +36,8 @@ class update_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$user->add_lang_ext('football/football', 'info_acp_update');
|
$user->add_lang_ext('football/football', 'info_acp_update');
|
||||||
|
|
||||||
@@ -90,10 +88,8 @@ class update_module
|
|||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points, $phpbb_log;
|
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $functions_points, $phpbb_log;
|
||||||
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx, $cache;
|
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx, $cache;
|
||||||
$provider = new \phpbb\controller\ provider();
|
|
||||||
$symphony_request = new \phpbb\ symfony_request($request);
|
$helper = $phpbb_container->get('controller.helper');
|
||||||
$filesystem = new \phpbb\ filesystem();
|
|
||||||
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx);
|
|
||||||
|
|
||||||
$this->ext_football_path = $phpbb_root_path . 'ext/football/football/';
|
$this->ext_football_path = $phpbb_root_path . 'ext/football/football/';
|
||||||
if(!function_exists('season_info'))
|
if(!function_exists('season_info'))
|
||||||
@@ -401,6 +397,7 @@ class update_module
|
|||||||
{
|
{
|
||||||
$error[] = sprintf($user->lang['MISMATCH_MATCHDAYS'], $row['matchdays']);
|
$error[] = sprintf($user->lang['MISMATCH_MATCHDAYS'], $row['matchdays']);
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$sql = 'SELECT COUNT(match_no) as matches
|
$sql = 'SELECT COUNT(match_no) as matches
|
||||||
FROM ' . FOOTB_MATCHES . "
|
FROM ' . FOOTB_MATCHES . "
|
||||||
@@ -418,6 +415,7 @@ class update_module
|
|||||||
{
|
{
|
||||||
$error[] = sprintf($user->lang['MISMATCH_MATCHES'], $row['matches']);
|
$error[] = sprintf($user->lang['MISMATCH_MATCHES'], $row['matches']);
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if (!sizeof($error))
|
if (!sizeof($error))
|
||||||
{
|
{
|
||||||
@@ -512,9 +510,9 @@ class update_module
|
|||||||
$league_info = league_info($season, $league);
|
$league_info = league_info($season, $league);
|
||||||
if ($league_info['bet_in_time'])
|
if ($league_info['bet_in_time'])
|
||||||
{
|
{
|
||||||
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, delivery_date, matchday_name, matches)
|
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . " (season, league, matchday, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
|
||||||
SELECT m.season, m.league, m.matchday, min(m.match_datetime) AS delivery_date, md.matchday_name, md.matches
|
SELECT m.season, m.league, m.matchday, min(m.match_datetime) AS delivery_date, '' AS delivery_date_2, '' AS delivery_date_3, md.matchday_name, md.matches
|
||||||
FROM ' . FOOTB_MATCHES . ' AS m
|
FROM " . FOOTB_MATCHES . ' AS m
|
||||||
JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league)
|
JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league)
|
||||||
JOIN ' . FOOTB_MATCHDAYS . " AS md ON (md.season = m.season AND md.league = m.league AND md.matchday = m.matchday)
|
JOIN ' . FOOTB_MATCHDAYS . " AS md ON (md.season = m.season AND md.league = m.league AND md.matchday = m.matchday)
|
||||||
WHERE m.season = $season
|
WHERE m.season = $season
|
||||||
@@ -551,6 +549,7 @@ class update_module
|
|||||||
$count_updates++;
|
$count_updates++;
|
||||||
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
|
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
if ($effected_matchdays <> '')
|
if ($effected_matchdays <> '')
|
||||||
{
|
{
|
||||||
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
|
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
|
||||||
@@ -595,6 +594,7 @@ class update_module
|
|||||||
$count_updates++;
|
$count_updates++;
|
||||||
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
|
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
if ($effected_matchdays <> '')
|
if ($effected_matchdays <> '')
|
||||||
{
|
{
|
||||||
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
|
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
|
||||||
@@ -639,6 +639,7 @@ class update_module
|
|||||||
$count_updates++;
|
$count_updates++;
|
||||||
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
|
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
if ($effected_matchdays <> '')
|
if ($effected_matchdays <> '')
|
||||||
{
|
{
|
||||||
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
|
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
|
||||||
@@ -666,8 +667,8 @@ class update_module
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check status of matchdays
|
// 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 = "UPDATE phpbb_footb_matchdays AS target
|
$sql = $sql = 'UPDATE ' . FOOTB_MATCHDAYS . " AS target
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
(
|
(
|
||||||
SELECT md.season
|
SELECT md.season
|
||||||
@@ -1386,6 +1387,7 @@ class update_module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
return $count_updates;
|
return $count_updates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,7 @@
|
|||||||
<th style="text-align:right">{L_GOALS_HOME}</th>
|
<th style="text-align:right">{L_GOALS_HOME}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>{L_GOALS_GUEST}</th>
|
<th>{L_GOALS_GUEST}</th>
|
||||||
|
<th>{L_BET_TIME}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -92,6 +93,7 @@
|
|||||||
<td class="td_vs">:</td>
|
<td class="td_vs">:</td>
|
||||||
<td class="td_goals_guest"><input style="margin:0; width:30px;" type="number"
|
<td class="td_goals_guest"><input style="margin:0; width:30px;" type="number"
|
||||||
name="goalsg{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_GUEST}" /></td>
|
name="goalsg{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_GUEST}" /></td>
|
||||||
|
<td>{bet_edit.BET_TIME}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END bet_edit -->
|
<!-- END bet_edit -->
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -14,11 +14,23 @@ if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL'))
|
|||||||
|
|
||||||
$start = $this->request->variable('start', 0);
|
$start = $this->request->variable('start', 0);
|
||||||
$matches_on_matchday = false;
|
$matches_on_matchday = false;
|
||||||
|
$league_info = league_info($season, $league);
|
||||||
$sql = 'SELECT COUNT(DISTINCT user_id) AS num_users
|
if($league_info['bet_type'])
|
||||||
FROM ' . FOOTB_BETS . "
|
{
|
||||||
WHERE season = $season AND league = $league";
|
$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);
|
$result = $db->sql_query($sql);
|
||||||
$total_users = (int) $db->sql_fetchfield('num_users');
|
$total_users = (int) $db->sql_fetchfield('num_users');
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
@@ -36,7 +48,19 @@ $sql = "SELECT
|
|||||||
m.goals_guest,
|
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 + 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 = 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
|
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 t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home)
|
||||||
LEFT JOIN ' . FOOTB_TEAMS . ' AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest)
|
LEFT JOIN ' . FOOTB_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
|
else
|
||||||
{
|
{
|
||||||
if ($count_matches > 11)
|
if ($count_matches > 12)
|
||||||
{
|
{
|
||||||
$split_after = 8;
|
$split_after = 8;
|
||||||
$splits = ceil($count_matches / 8);
|
$splits = ceil($count_matches / 8);
|
||||||
@@ -78,7 +102,6 @@ else
|
|||||||
$splits = 1;
|
$splits = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
// Make sure $start is set to the last page if it exceeds the amount
|
// Make sure $start is set to the last page if it exceeds the amount
|
||||||
if ($start < 0 || $start >= $total_users)
|
if ($start < 0 || $start >= $total_users)
|
||||||
@@ -114,21 +137,47 @@ if ($count_matches > 0)
|
|||||||
{
|
{
|
||||||
$matches_on_matchday = true;
|
$matches_on_matchday = true;
|
||||||
|
|
||||||
|
if($league_info['bet_type'])
|
||||||
|
{
|
||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
u.user_id,
|
u.user_id,
|
||||||
u.username,
|
u.username,
|
||||||
m.status,
|
m.status,
|
||||||
b.goals_home AS bet_home,
|
b.goals_home AS bet_home,
|
||||||
b.goals_guest AS bet_guest,
|
b.goals_guest AS bet_guest,
|
||||||
|
IFNULL(m2.match_no,m3.match_no),
|
||||||
" . select_points() . '
|
" . select_points() . '
|
||||||
FROM ' . FOOTB_MATCHES . ' AS m
|
FROM ' . FOOTB_MATCHES . ' AS m
|
||||||
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
|
LEFT JOIN ' . FOOTB_BETS . ' AS 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
|
WHERE m.season = $season
|
||||||
AND m.league = $league
|
AND m.league = $league
|
||||||
AND m.matchday = $matchday
|
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);
|
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
|
||||||
$user_bets = $db->sql_fetchrowset($result);
|
$user_bets = $db->sql_fetchrowset($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
@@ -170,7 +219,15 @@ foreach ($matches AS $match)
|
|||||||
if ($bet_index == 0)
|
if ($bet_index == 0)
|
||||||
{
|
{
|
||||||
$count_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';
|
$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'])
|
if ($user_bet['user_id'] == $user->data['user_id'])
|
||||||
{
|
{
|
||||||
$row_class = 'bg3 row_user';
|
$row_class = 'bg3 row_user';
|
||||||
@@ -183,7 +240,7 @@ foreach ($matches AS $match)
|
|||||||
$total = 0;
|
$total = 0;
|
||||||
}
|
}
|
||||||
$bet_index++;
|
$bet_index++;
|
||||||
$total += $user_bet['points'];
|
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||||
if ($user_bet['status'] < 3)
|
if ($user_bet['status'] < 3)
|
||||||
{
|
{
|
||||||
$colorstyle_total = ' color_provisionally';
|
$colorstyle_total = ' color_provisionally';
|
||||||
@@ -269,6 +326,7 @@ foreach ($matches AS $match)
|
|||||||
'GUEST_NAME' => $guestname,
|
'GUEST_NAME' => $guestname,
|
||||||
'RESULT' => $match['goals_home']. ':'.$match['goals_guest'],
|
'RESULT' => $match['goals_home']. ':'.$match['goals_guest'],
|
||||||
'COLOR_STYLE' => $colorstyle_match,
|
'COLOR_STYLE' => $colorstyle_match,
|
||||||
|
'MATCH_TIME' => $match['match_time'],
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if ($match['status'] < 1 && !$config['football_view_tendencies'])
|
if ($match['status'] < 1 && !$config['football_view_tendencies'])
|
||||||
@@ -288,12 +346,22 @@ if ($count_matches > 0)
|
|||||||
$total = 0;
|
$total = 0;
|
||||||
$count_user = 0;
|
$count_user = 0;
|
||||||
$bet_index = 0;
|
$bet_index = 0;
|
||||||
|
if(!empty($bet_line))
|
||||||
|
{
|
||||||
foreach ($bet_line[$split_index] AS $user_bet)
|
foreach ($bet_line[$split_index] AS $user_bet)
|
||||||
{
|
{
|
||||||
if ($bet_index == 0)
|
if ($bet_index == 0)
|
||||||
{
|
{
|
||||||
$count_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';
|
$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'])
|
if ($user_bet['user_id'] == $user->data['user_id'])
|
||||||
{
|
{
|
||||||
$row_class = 'bg3 row_user';
|
$row_class = 'bg3 row_user';
|
||||||
@@ -306,7 +374,7 @@ if ($count_matches > 0)
|
|||||||
$total = 0;
|
$total = 0;
|
||||||
}
|
}
|
||||||
$bet_index++;
|
$bet_index++;
|
||||||
$total += $user_bet['points'];
|
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||||
if ($user_bet['status'] < 3)
|
if ($user_bet['status'] < 3)
|
||||||
{
|
{
|
||||||
$colorstyle_total = ' color_provisionally';
|
$colorstyle_total = ' color_provisionally';
|
||||||
@@ -343,6 +411,7 @@ if ($count_matches > 0)
|
|||||||
$bet_index = 0;
|
$bet_index = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('match_panel.tendency_footer', array(
|
$template->assign_block_vars('match_panel.tendency_footer', array(
|
||||||
'S_TOTAL' => true,
|
'S_TOTAL' => true,
|
||||||
@@ -451,7 +520,7 @@ while ($row = $db->sql_fetchrow($result))
|
|||||||
while ($user_row = $db->sql_fetchrow($result_bet))
|
while ($user_row = $db->sql_fetchrow($result_bet))
|
||||||
{
|
{
|
||||||
$bet_number++ ;
|
$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'])
|
if ($user_row['user_id'] == $user->data['user_id'])
|
||||||
{
|
{
|
||||||
$row_class = 'bg3 row_user';
|
$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']);
|
$sidename = sprintf($user->lang['ALL_BETS']);
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DISPLAY_ALL_BETS' => true,
|
'S_DISPLAY_ALL_BETS' => true,
|
||||||
'S_SIDENAME' => $sidename,
|
'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_MATCHES_ON_MATCHDAY' => $matches_on_matchday,
|
||||||
'S_SPALTEN' => ($count_matches * 2) + 2,
|
'S_SPALTEN' => ($count_matches * 2) + 2,
|
||||||
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
|
'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_SIDENAME' => $sidename,
|
||||||
'S_MULTI_VIEW' => $multi_view,
|
'S_MULTI_VIEW' => $multi_view,
|
||||||
'L_TOTAL_ENTRIES' => ($count == 1) ? $count . ' ' .sprintf($user->lang['FOOTBALL_RECORD']) : $count . ' ' .sprintf($user->lang['FOOTBALL_RECORDS']),
|
'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,
|
'USERNAME' => $username,
|
||||||
'POINTS' => $config['football_win_name'],
|
'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);
|
$league_info = league_info($season, $league);
|
||||||
$bet_explain = '';
|
$bet_explain = '';
|
||||||
switch ($league_info['bet_ko_type'])
|
switch ($league_info['bet_ko_type'])
|
||||||
@@ -505,12 +507,6 @@ $template->assign_vars(array(
|
|||||||
'S_DISPLAY_BET' => true,
|
'S_DISPLAY_BET' => true,
|
||||||
'S_SIDENAME' => $sidename,
|
'S_SIDENAME' => $sidename,
|
||||||
'BET_EXPLAIN' => $bet_explain,
|
'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),
|
'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_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_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']);
|
$sidename = sprintf($user->lang['BET']);
|
||||||
if ($data_bet)
|
if ($data_bet)
|
||||||
|
|||||||
@@ -11,13 +11,12 @@ if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL'))
|
|||||||
{
|
{
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data_delivery = false;
|
$data_delivery = false;
|
||||||
$user_id = $user->data['user_id'];
|
$user_id = $user->data['user_id'];
|
||||||
$lang_dates = $user->lang['datetime'];
|
$lang_dates = $user->lang['datetime'];
|
||||||
$index = 0;
|
$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
|
$sql = "SELECT
|
||||||
m.season,
|
m.season,
|
||||||
m.league,
|
m.league,
|
||||||
m.matchday,
|
m.matchday,
|
||||||
@@ -27,19 +26,12 @@ $sql = "(SELECT
|
|||||||
THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "')
|
THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "')
|
||||||
ELSE m.matchday_name
|
ELSE m.matchday_name
|
||||||
END AS matchday_name,
|
END AS matchday_name,
|
||||||
CONCAT(
|
IF(l.bet_in_time = 0, IF(ma.status = 0, m.delivery_date
|
||||||
CASE DATE_FORMAT(m.delivery_date,'%w')
|
, IF(ma.status = -1, m.delivery_date_2
|
||||||
WHEN 0 THEN '" . $lang_dates['Sun'] . "'
|
, m.delivery_date_3
|
||||||
WHEN 1 THEN '" . $lang_dates['Mon'] . "'
|
)
|
||||||
WHEN 2 THEN '" . $lang_dates['Tue'] . "'
|
)
|
||||||
WHEN 3 THEN '" . $lang_dates['Wed'] . "'
|
, ma.match_datetime) AS delivery,
|
||||||
WHEN 4 THEN '" . $lang_dates['Thu'] . "'
|
|
||||||
WHEN 5 THEN '" . $lang_dates['Fri'] . "'
|
|
||||||
WHEN 6 THEN '" . $lang_dates['Sat'] . "'
|
|
||||||
ELSE 'Error' END,
|
|
||||||
DATE_FORMAT(m.delivery_date,' %d.%m.%y %H:%i')
|
|
||||||
) as delivery_time,
|
|
||||||
m.delivery_date AS delivery,
|
|
||||||
SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count,
|
SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count,
|
||||||
COUNT(*) AS matches_count,
|
COUNT(*) AS matches_count,
|
||||||
SUM(IF(eb.extra_no > 0, IF(eb.bet = '', 0, 1), 0)) AS extra_bets_count,
|
SUM(IF(eb.extra_no > 0, IF(eb.bet = '', 0, 1), 0)) AS extra_bets_count,
|
||||||
@@ -50,83 +42,9 @@ $sql = "(SELECT
|
|||||||
JOIN " . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = ma.match_no AND b.user_id = $user_id)
|
JOIN " . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = ma.match_no AND b.user_id = $user_id)
|
||||||
LEFT JOIN " . FOOTB_EXTRA . " AS e ON (e.season = m.season AND e.league = m.league AND e.matchday = m.matchday AND e.extra_status = 0)
|
LEFT JOIN " . FOOTB_EXTRA . " AS e ON (e.season = m.season AND e.league = m.league AND e.matchday = m.matchday AND e.extra_status = 0)
|
||||||
LEFT JOIN " . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = m.season AND eb.league = m.league AND eb.extra_no = e.extra_no AND eb.user_id = $user_id)
|
LEFT JOIN " . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = m.season AND eb.league = m.league AND eb.extra_no = e.extra_no AND eb.user_id = $user_id)
|
||||||
WHERE m.delivery_date > FROM_UNIXTIME('$local_board_time')
|
WHERE m.status <= 0
|
||||||
AND m.status <= 0
|
GROUP BY delivery, m.league
|
||||||
GROUP BY m.delivery_date, m.league, b.user_id
|
ORDER BY delivery, m.league";
|
||||||
)
|
|
||||||
UNION
|
|
||||||
(SELECT
|
|
||||||
m.season,
|
|
||||||
m.league,
|
|
||||||
m.matchday,
|
|
||||||
l.league_name_short,
|
|
||||||
CASE m.matchday_name
|
|
||||||
WHEN ''
|
|
||||||
THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "')
|
|
||||||
ELSE m.matchday_name
|
|
||||||
END AS matchday_name,
|
|
||||||
CONCAT(
|
|
||||||
CASE DATE_FORMAT(m.delivery_date_2,'%w')
|
|
||||||
WHEN 0 THEN '" . $lang_dates['Sun'] . "'
|
|
||||||
WHEN 1 THEN '" . $lang_dates['Mon'] . "'
|
|
||||||
WHEN 2 THEN '" . $lang_dates['Tue'] . "'
|
|
||||||
WHEN 3 THEN '" . $lang_dates['Wed'] . "'
|
|
||||||
WHEN 4 THEN '" . $lang_dates['Thu'] . "'
|
|
||||||
WHEN 5 THEN '" . $lang_dates['Fri'] . "'
|
|
||||||
WHEN 6 THEN '" . $lang_dates['Sat'] . "'
|
|
||||||
ELSE 'Error' END,
|
|
||||||
DATE_FORMAT(m.delivery_date_2,' %d.%m.%y %H:%i')
|
|
||||||
) as delivery_time,
|
|
||||||
m.delivery_date_2 AS delivery ,
|
|
||||||
SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count,
|
|
||||||
COUNT(*) AS matches_count,
|
|
||||||
0 AS extra_bets_count,
|
|
||||||
0 AS extra_count
|
|
||||||
FROM " . FOOTB_MATCHDAYS . " AS m
|
|
||||||
JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league)
|
|
||||||
JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = -1)
|
|
||||||
JOIN " . FOOTB_BETS . " AS b ON (b.season = ma.season AND b.league = ma.league AND b.match_no = ma.match_no AND b.user_id = $user_id)
|
|
||||||
WHERE m.delivery_date_2 > FROM_UNIXTIME('$local_board_time')
|
|
||||||
AND m.status <= 0
|
|
||||||
GROUP BY m.delivery_date, m.league, b.user_id
|
|
||||||
)
|
|
||||||
UNION
|
|
||||||
(SELECT
|
|
||||||
m.season,
|
|
||||||
m.league,
|
|
||||||
m.matchday,
|
|
||||||
l.league_name_short,
|
|
||||||
CASE m.matchday_name
|
|
||||||
WHEN ''
|
|
||||||
THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "')
|
|
||||||
ELSE m.matchday_name
|
|
||||||
END AS matchday_name,
|
|
||||||
CONCAT(
|
|
||||||
CASE DATE_FORMAT(m.delivery_date_3,'%w')
|
|
||||||
WHEN 0 THEN '" . $lang_dates['Sun'] . "'
|
|
||||||
WHEN 1 THEN '" . $lang_dates['Mon'] . "'
|
|
||||||
WHEN 2 THEN '" . $lang_dates['Tue'] . "'
|
|
||||||
WHEN 3 THEN '" . $lang_dates['Wed'] . "'
|
|
||||||
WHEN 4 THEN '" . $lang_dates['Thu'] . "'
|
|
||||||
WHEN 5 THEN '" . $lang_dates['Fri'] . "'
|
|
||||||
WHEN 6 THEN '" . $lang_dates['Sat'] . "'
|
|
||||||
ELSE 'Error' END,
|
|
||||||
DATE_FORMAT(m.delivery_date_3,' %d.%m.%y %H:%i')
|
|
||||||
) as delivery_time,
|
|
||||||
m.delivery_date_3 AS delivery,
|
|
||||||
SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count,
|
|
||||||
COUNT(*) AS matches_count,
|
|
||||||
0 AS extra_bets_count,
|
|
||||||
0 AS extra_count
|
|
||||||
FROM " . FOOTB_MATCHDAYS . " AS m
|
|
||||||
JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league)
|
|
||||||
JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = -2)
|
|
||||||
JOIN " . FOOTB_BETS . " AS b ON (b.season = ma.season AND b.league = ma.league AND b.match_no = ma.match_no AND b.user_id = $user_id)
|
|
||||||
WHERE m.delivery_date_3 > FROM_UNIXTIME('$local_board_time')
|
|
||||||
AND m.status <= 0
|
|
||||||
GROUP BY m.delivery_date, m.league, b.user_id
|
|
||||||
)
|
|
||||||
ORDER BY delivery, league";
|
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
while($row = $db->sql_fetchrow($result) AND $index < 11)
|
while($row = $db->sql_fetchrow($result) AND $index < 11)
|
||||||
@@ -142,7 +60,7 @@ while($row = $db->sql_fetchrow($result) AND $index < 11)
|
|||||||
'MATCHDAY_NAME' => $row['matchday_name'],
|
'MATCHDAY_NAME' => $row['matchday_name'],
|
||||||
'COLOR' => ($row['bets_count'] == $row['matches_count'] && $row['extra_bets_count'] == $row['extra_count']) ? 'green' : 'red',
|
'COLOR' => ($row['bets_count'] == $row['matches_count'] && $row['extra_bets_count'] == $row['extra_count']) ? 'green' : 'red',
|
||||||
'TITLE' => ($row['bets_count'] == $row['matches_count']) ? sprintf($user->lang['DELIVERY_READY']) : sprintf($user->lang['DELIVERY_NOT_READY']),
|
'TITLE' => ($row['bets_count'] == $row['matches_count']) ? sprintf($user->lang['DELIVERY_READY']) : sprintf($user->lang['DELIVERY_NOT_READY']),
|
||||||
'DELIVERY' => $row['delivery_time'],
|
'DELIVERY' => $lang_dates[date("D", strtotime($row['delivery']))] . date(" d.m.y G:i", strtotime($row['delivery'])),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ else
|
|||||||
trigger_error('NO_LEAGUE');
|
trigger_error('NO_LEAGUE');
|
||||||
}
|
}
|
||||||
$user_rows = $db->sql_fetchrowset($result);
|
$user_rows = $db->sql_fetchrowset($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
$export_file = $league_short . '_' . $season . '_bank.csv';
|
$export_file = $league_short . '_' . $season . '_bank.csv';
|
||||||
$newline = "\r\n";
|
$newline = "\r\n";
|
||||||
header('Pragma: no-cache');
|
header('Pragma: no-cache');
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ else
|
|||||||
trigger_error('NO_SEASON');
|
trigger_error('NO_SEASON');
|
||||||
}
|
}
|
||||||
$user_rows = $db->sql_fetchrowset($result);
|
$user_rows = $db->sql_fetchrowset($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
$export_file = $season. '_bank.csv';
|
$export_file = $season. '_bank.csv';
|
||||||
$newline = "\r\n";
|
$newline = "\r\n";
|
||||||
header('Pragma: no-cache');
|
header('Pragma: no-cache');
|
||||||
|
|||||||
@@ -91,6 +91,10 @@ else
|
|||||||
$data_last_home = false;
|
$data_last_home = false;
|
||||||
$data_last_away = false;
|
$data_last_away = false;
|
||||||
$form_from = $matchday-5;
|
$form_from = $matchday-5;
|
||||||
|
$percent_home = 0;
|
||||||
|
$percent_draw = 0;
|
||||||
|
$percent_guest = 0;
|
||||||
|
$stat_hist = '';
|
||||||
$value_h = 0;
|
$value_h = 0;
|
||||||
$value_g = 0;
|
$value_g = 0;
|
||||||
$value_hg = 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\"/>" ;
|
$logo[$home_id] = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -142,7 +145,6 @@ else
|
|||||||
{
|
{
|
||||||
$logo[$guest_id] = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
|
$logo[$guest_id] = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -245,7 +247,6 @@ else
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
// Statistic and forecast-points for historie
|
// Statistic and forecast-points for historie
|
||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
@@ -322,10 +323,6 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$stat_hist = '';
|
|
||||||
$percent_home = 0;
|
|
||||||
$percent_draw = 0;
|
|
||||||
$percent_guest = 0;
|
|
||||||
if (sizeof($row))
|
if (sizeof($row))
|
||||||
{
|
{
|
||||||
if ($history_count <= 2)
|
if ($history_count <= 2)
|
||||||
@@ -1003,7 +1000,6 @@ else
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
//last matches home hometeam
|
//last matches home hometeam
|
||||||
$sql = '(SELECT
|
$sql = '(SELECT
|
||||||
@@ -1074,7 +1070,6 @@ else
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
//last game guestteam
|
//last game guestteam
|
||||||
$sql = "(SELECT
|
$sql = "(SELECT
|
||||||
@@ -1158,7 +1153,6 @@ else
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
//last matches away guestteam
|
//last matches away guestteam
|
||||||
$sql = '(SELECT
|
$sql = '(SELECT
|
||||||
@@ -1226,7 +1220,6 @@ else
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if ($history_count == 0 and !($data_home and $data_guest))
|
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) . "
|
$sql = 'UPDATE ' . FOOTB_MATCHES . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
|
||||||
WHERE season = $season AND league = $league AND match_no = $matchnumber";
|
WHERE season = $season AND league = $league AND match_no = $matchnumber";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
|
||||||
$forecast_value = 0;
|
$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;
|
$display_last_users = false;
|
||||||
// Last 5 users
|
// Last users
|
||||||
$sql = 'SELECT s.session_user_id
|
$sql = 'SELECT s.session_user_id
|
||||||
, u.username
|
, u.username
|
||||||
, u.user_colour
|
, u.user_colour
|
||||||
@@ -24,10 +24,11 @@ $sql = 'SELECT s.session_user_id
|
|||||||
FROM ' . USERS_TABLE . ' AS u
|
FROM ' . USERS_TABLE . ' AS u
|
||||||
LEFT JOIN ' . SESSIONS_TABLE . ' AS s ON (u.user_id = s.session_user_id)
|
LEFT JOIN ' . SESSIONS_TABLE . ' AS s ON (u.user_id = s.session_user_id)
|
||||||
WHERE u.user_lastvisit > 0
|
WHERE u.user_lastvisit > 0
|
||||||
|
AND u.user_type IN (0,3)
|
||||||
GROUP BY u.user_id
|
GROUP BY u.user_id
|
||||||
ORDER BY lastvisit DESC';
|
ORDER BY lastvisit DESC';
|
||||||
|
|
||||||
$result = $db->sql_query_limit($sql, 5);
|
$result = $db->sql_query_limit($sql, $config['football_display_last_users']);
|
||||||
$first = true;
|
$first = true;
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
@@ -57,7 +58,7 @@ $db->sql_freeresult($result);
|
|||||||
|
|
||||||
// Assign specific vars
|
// Assign specific vars
|
||||||
$template->assign_vars(array(
|
$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_DISPLAY_LAST_USERS' => $display_last_users,
|
||||||
'S_LAST_USERS' => true,
|
'S_LAST_USERS' => true,
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -314,14 +314,6 @@ $sidename = sprintf($user->lang['MY_BETS']);
|
|||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DISPLAY_MY_BETS' => true,
|
'S_DISPLAY_MY_BETS' => true,
|
||||||
'S_SIDENAME' => $sidename,
|
'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,
|
'S_DATA_MY_BETS' => $data,
|
||||||
'SEASON' => $season,
|
'SEASON' => $season,
|
||||||
'LEAGUE' => $league,
|
'LEAGUE' => $league,
|
||||||
|
|||||||
@@ -22,20 +22,21 @@ $username2 = '';
|
|||||||
$username3 = '';
|
$username3 = '';
|
||||||
$username4 = '';
|
$username4 = '';
|
||||||
// Calculate rank total
|
// Calculate rank total
|
||||||
$sql = 'SELECT
|
$sql = "SELECT
|
||||||
r.user_id,
|
r.user_id,
|
||||||
u.username,
|
u.username,
|
||||||
SUM(r.points) AS points_total
|
(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
|
FROM " . FOOTB_RANKS . ' AS r
|
||||||
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
|
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
|
||||||
WHERE r.season = $season
|
WHERE r.season = $season
|
||||||
AND r.league = $league
|
AND r.league = $league
|
||||||
AND r.matchday <= $matchday
|
AND r.matchday <= $matchday
|
||||||
GROUP BY r.user_id
|
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);
|
$result = $db->sql_query($sql);
|
||||||
$current_ranks = $db->sql_fetchrowset($result);
|
$current_ranks = $db->sql_fetchrowset($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
$total_users = sizeof($current_ranks);
|
$total_users = sizeof($current_ranks);
|
||||||
if ($total_users > 3 AND $total_users <= 50)
|
if ($total_users > 3 AND $total_users <= 50)
|
||||||
{
|
{
|
||||||
@@ -157,7 +158,7 @@ if ($total_users > 3 AND $total_users <= 50)
|
|||||||
$ranks_dayl_1 = '';
|
$ranks_dayl_1 = '';
|
||||||
$points_1 = '';
|
$points_1 = '';
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . FOOTB_RANKS . "
|
FROM ' . FOOTB_MY_CHART . "
|
||||||
WHERE season = $season
|
WHERE season = $season
|
||||||
AND league = $league
|
AND league = $league
|
||||||
AND matchday <= $matchday
|
AND matchday <= $matchday
|
||||||
@@ -210,7 +211,7 @@ if ($total_users > 3 AND $total_users <= 50)
|
|||||||
if ($user3 != 0)
|
if ($user3 != 0)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . FOOTB_RANKS . "
|
FROM ' . FOOTB_MY_CHART . "
|
||||||
WHERE season = $season
|
WHERE season = $season
|
||||||
AND league = $league
|
AND league = $league
|
||||||
AND matchday <= $matchday
|
AND matchday <= $matchday
|
||||||
@@ -237,7 +238,7 @@ if ($total_users > 3 AND $total_users <= 50)
|
|||||||
if ($user4 != 0)
|
if ($user4 != 0)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . FOOTB_RANKS . "
|
FROM ' . FOOTB_MY_CHART . "
|
||||||
WHERE season = $season
|
WHERE season = $season
|
||||||
AND league = $league
|
AND league = $league
|
||||||
AND matchday <= $matchday
|
AND matchday <= $matchday
|
||||||
@@ -266,7 +267,7 @@ if ($total_users > 3 AND $total_users <= 50)
|
|||||||
$sql = 'SELECT
|
$sql = 'SELECT
|
||||||
MIN(points) As points_min,
|
MIN(points) As points_min,
|
||||||
MAX(points) As points_max
|
MAX(points) As points_max
|
||||||
FROM ' . FOOTB_RANKS . "
|
FROM ' . FOOTB_MY_CHART . "
|
||||||
WHERE season = $season
|
WHERE season = $season
|
||||||
AND league = $league
|
AND league = $league
|
||||||
AND matchday <= $matchday
|
AND matchday <= $matchday
|
||||||
@@ -317,12 +318,6 @@ $sidename = sprintf($user->lang['MY_CHART']);
|
|||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DISPLAY_MY_CHART' => true,
|
'S_DISPLAY_MY_CHART' => true,
|
||||||
'S_SIDENAME' => $sidename,
|
'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,
|
'S_DATA_MY_CHART' => $data,
|
||||||
'SEASON' => $season,
|
'SEASON' => $season,
|
||||||
'LEAGUE' => $league,
|
'LEAGUE' => $league,
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ else
|
|||||||
$split_after = $count_matches;
|
$split_after = $count_matches;
|
||||||
$splits = 1;
|
$splits = 1;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
// Make sure $start is set to the last page if it exceeds the amount
|
// Make sure $start is set to the last page if it exceeds the amount
|
||||||
if ($start < 0 || $start >= $total_users)
|
if ($start < 0 || $start >= $total_users)
|
||||||
@@ -192,7 +191,7 @@ foreach ($matches AS $match)
|
|||||||
$total = 0;
|
$total = 0;
|
||||||
}
|
}
|
||||||
$bet_index++;
|
$bet_index++;
|
||||||
$total += $user_bet['points'];
|
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||||
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
|
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
|
||||||
{
|
{
|
||||||
// hide bets
|
// hide bets
|
||||||
@@ -310,7 +309,7 @@ if ($count_matches > 0)
|
|||||||
$total = 0;
|
$total = 0;
|
||||||
}
|
}
|
||||||
$bet_index++;
|
$bet_index++;
|
||||||
$total += $user_bet['points'];
|
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
|
||||||
if ($user_bet['status'] < 1)
|
if ($user_bet['status'] < 1)
|
||||||
{
|
{
|
||||||
if ($user_bet['bet_home'] == '')
|
if ($user_bet['bet_home'] == '')
|
||||||
@@ -376,12 +375,6 @@ $sidename = sprintf($user->lang['MY_KOEFF']);
|
|||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DISPLAY_MY_KOEFF' => true,
|
'S_DISPLAY_MY_KOEFF' => true,
|
||||||
'S_SIDENAME' => $sidename,
|
'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_MATCHES_ON_MATCHDAY' => $matches_on_matchday,
|
||||||
'S_SPALTEN' => ($count_matches * 2) + 2,
|
'S_SPALTEN' => ($count_matches * 2) + 2,
|
||||||
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
|
'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(
|
$template->assign_vars(array(
|
||||||
'S_DISPLAY_MY_POINTS' => true,
|
'S_DISPLAY_MY_POINTS' => true,
|
||||||
'S_SIDENAME' => $sidename,
|
'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,
|
'S_DATA_MY_POINTS' => $data,
|
||||||
'SEASON' => $season,
|
'SEASON' => $season,
|
||||||
'LEAGUE' => $league,
|
'LEAGUE' => $league,
|
||||||
|
|||||||
@@ -163,12 +163,6 @@ $template->assign_vars(array(
|
|||||||
'S_DISPLAY_MY_RANK' => true,
|
'S_DISPLAY_MY_RANK' => true,
|
||||||
'S_MATCHDAY_HIDE' => true,
|
'S_MATCHDAY_HIDE' => true,
|
||||||
'S_SIDENAME' => $sidename,
|
'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,
|
'S_DATA_MY_RANK' => $data,
|
||||||
'SEASON' => $season,
|
'SEASON' => $season,
|
||||||
'LEAGUE' => $league,
|
'LEAGUE' => $league,
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ $sql = 'SELECT
|
|||||||
AND b.goals_home <> ''
|
AND b.goals_home <> ''
|
||||||
AND b.goals_guest <> ''
|
AND b.goals_guest <> ''
|
||||||
AND m.matchday <= $matchday
|
AND m.matchday <= $matchday
|
||||||
AND m.status IN (2, 3,5,6)
|
AND m.show_table = 0
|
||||||
GROUP BY t.team_id
|
GROUP BY t.team_id
|
||||||
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
|
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ $sql = 'SELECT
|
|||||||
AND b.goals_home <> ''
|
AND b.goals_home <> ''
|
||||||
AND b.goals_guest <> ''
|
AND b.goals_guest <> ''
|
||||||
AND m.matchday >= $form_from
|
AND m.matchday >= $form_from
|
||||||
AND m.status IN (2, 3,5,6)
|
AND m.show_table = 0
|
||||||
GROUP BY t.team_id
|
GROUP BY t.team_id
|
||||||
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
|
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
|
||||||
|
|
||||||
@@ -302,7 +302,7 @@ $sql = 'SELECT
|
|||||||
AND b.goals_home <> ''
|
AND b.goals_home <> ''
|
||||||
AND b.goals_guest <> ''
|
AND b.goals_guest <> ''
|
||||||
AND m.matchday <= $matchday
|
AND m.matchday <= $matchday
|
||||||
AND m.status IN (2, 3,5,6)
|
AND m.show_table = 0
|
||||||
GROUP BY t.team_id
|
GROUP BY t.team_id
|
||||||
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
|
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
|
||||||
|
|
||||||
@@ -368,7 +368,7 @@ $sql = 'SELECT
|
|||||||
AND b.goals_home <> ''
|
AND b.goals_home <> ''
|
||||||
AND b.goals_guest <> ''
|
AND b.goals_guest <> ''
|
||||||
AND m.matchday <= $matchday
|
AND m.matchday <= $matchday
|
||||||
AND m.status IN (2, 3,5,6)
|
AND m.show_table = 0
|
||||||
GROUP BY t.team_id
|
GROUP BY t.team_id
|
||||||
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
|
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
|
||||||
|
|
||||||
@@ -417,14 +417,6 @@ $sidename = sprintf($user->lang['MY_TABLE']);
|
|||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DISPLAY_MY_TABLE' => true,
|
'S_DISPLAY_MY_TABLE' => true,
|
||||||
'S_SIDENAME' => $sidename,
|
'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_MY_TABLE' => $data_table,
|
||||||
'S_DATA_FORM' => $data_form,
|
'S_DATA_FORM' => $data_form,
|
||||||
'SEASON' => $season,
|
'SEASON' => $season,
|
||||||
|
|||||||
@@ -198,12 +198,6 @@ $template->assign_vars(array(
|
|||||||
'S_SIDENAME' => $sidename,
|
'S_SIDENAME' => $sidename,
|
||||||
'RESULT_EXPLAIN' => $result_explain,
|
'RESULT_EXPLAIN' => $result_explain,
|
||||||
'LABEL_FINALRESULT' => $label_finalresult,
|
'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,
|
'S_DATA_ODDS' => $data_odds,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,6 +12,15 @@ if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL'))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($league > 50)
|
||||||
|
{
|
||||||
|
$league_corr = $league - 50;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$league_corr = $league;
|
||||||
|
}
|
||||||
|
|
||||||
if ($league <> 0)
|
if ($league <> 0)
|
||||||
{
|
{
|
||||||
$data_rank_matchday = false;
|
$data_rank_matchday = false;
|
||||||
@@ -26,7 +35,7 @@ if ($league <> 0)
|
|||||||
FROM " . FOOTB_RANKS . ' AS r
|
FROM " . FOOTB_RANKS . ' AS r
|
||||||
LEFT Join ' . USERS_TABLE . " AS u ON (r.user_id = u.user_id)
|
LEFT Join ' . USERS_TABLE . " AS u ON (r.user_id = u.user_id)
|
||||||
WHERE r.season = $season
|
WHERE r.season = $season
|
||||||
AND r.league = $league
|
AND r.league = $league_corr
|
||||||
AND r.matchday = $matchday
|
AND r.matchday = $matchday
|
||||||
AND r.status IN (2,3)
|
AND r.status IN (2,3)
|
||||||
ORDER BY rank ASC, LOWER(u.username) ASC";
|
ORDER BY rank ASC, LOWER(u.username) ASC";
|
||||||
@@ -50,7 +59,7 @@ if ($league <> 0)
|
|||||||
'ROW_CLASS' => $row_class,
|
'ROW_CLASS' => $row_class,
|
||||||
'USERID' => $row['user_id'],
|
'USERID' => $row['user_id'],
|
||||||
'USERNAME' => $row['username'],
|
'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'])),
|
'm' => $matchday, 'u' => $row['user_id'])),
|
||||||
'POINTS' => $row['points'],
|
'POINTS' => $row['points'],
|
||||||
'COLOR_STYLE' => $colorstyle,
|
'COLOR_STYLE' => $colorstyle,
|
||||||
@@ -60,7 +69,7 @@ if ($league <> 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
$league_info = league_info($season, $league);
|
$league_info = league_info($season, $league_corr);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DISPLAY_RANK_MATCHDAY' => true,
|
'S_DISPLAY_RANK_MATCHDAY' => true,
|
||||||
|
|||||||
@@ -159,7 +159,6 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
if ($rankof[$row['user_id']] == '')
|
if ($rankof[$row['user_id']] == '')
|
||||||
{
|
{
|
||||||
$change_sign = '';
|
$change_sign = '';
|
||||||
$change_img = '';
|
|
||||||
$change_differ = ' ';
|
$change_differ = ' ';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -167,7 +166,6 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
if ($rankof[$row['user_id']] == $prevrankof[$row['user_id']])
|
if ($rankof[$row['user_id']] == $prevrankof[$row['user_id']])
|
||||||
{
|
{
|
||||||
$change_sign = '=';
|
$change_sign = '=';
|
||||||
$change_img = "<img src=\"" . $ext_path . "images/no_change.gif\" alt=\"" . $user->lang['NO_CHANGES'] . "\"/>";
|
|
||||||
$change_differ = ' ';
|
$change_differ = ' ';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -175,14 +173,12 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
if ($rankof[$row['user_id']] > $prevrankof[$row['user_id']])
|
if ($rankof[$row['user_id']] > $prevrankof[$row['user_id']])
|
||||||
{
|
{
|
||||||
$change_sign = '+';
|
$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']];
|
$differ = $rankof[$row['user_id']] - $prevrankof[$row['user_id']];
|
||||||
$change_differ = ' (' . $differ . ')';
|
$change_differ = ' (' . $differ . ')';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$change_sign = '-';
|
$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']];
|
$differ = $prevrankof[$row['user_id']] - $rankof[$row['user_id']];
|
||||||
$change_differ = ' (' . $differ . ')';
|
$change_differ = ' (' . $differ . ')';
|
||||||
}
|
}
|
||||||
@@ -192,7 +188,6 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$change_sign = '';
|
$change_sign = '';
|
||||||
$change_img = '';
|
|
||||||
$change_differ = ' ';
|
$change_differ = ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,8 +223,10 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
$template->assign_block_vars('rankstotal', array(
|
$template->assign_block_vars('rankstotal', array(
|
||||||
'ROW_CLASS' => $row_class,
|
'ROW_CLASS' => $row_class,
|
||||||
'RANK' => $rankof[$row['user_id']],
|
'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_SIGN' => $change_sign,
|
||||||
'CHANGE_IMG' => $change_img,
|
|
||||||
'CHANGE_DIFFER' => $change_differ,
|
'CHANGE_DIFFER' => $change_differ,
|
||||||
'USERID' => $row['user_id'],
|
'USERID' => $row['user_id'],
|
||||||
'USERNAME' => $row['username'],
|
'USERNAME' => $row['username'],
|
||||||
@@ -254,12 +251,6 @@ $template->assign_vars(array(
|
|||||||
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
|
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
|
||||||
'S_SIDENAME' => $sidename,
|
'S_SIDENAME' => $sidename,
|
||||||
'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true,
|
'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,
|
'S_DATA_RANKS' => $data_ranks,
|
||||||
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
|
'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),
|
'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++;
|
$index++;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$sidename = sprintf($user->lang['RANK_TOTAL']);
|
$sidename = sprintf($user->lang['RANK_TOTAL']);
|
||||||
$league_info = league_info($season, $league);
|
$league_info = league_info($season, $league);
|
||||||
@@ -166,13 +165,6 @@ switch ($mode)
|
|||||||
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
|
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
|
||||||
'S_DATA_RANKS' => $data_ranks,
|
'S_DATA_RANKS' => $data_ranks,
|
||||||
'S_SIDENAME' => $sidename,
|
'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),
|
'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),
|
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
|
||||||
'S_WIN' => false,
|
'S_WIN' => false,
|
||||||
@@ -328,7 +320,6 @@ switch ($mode)
|
|||||||
}
|
}
|
||||||
$index++;
|
$index++;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$sidename = sprintf($user->lang['RANK_TOTAL']);
|
$sidename = sprintf($user->lang['RANK_TOTAL']);
|
||||||
$league_info = league_info($season, $league);
|
$league_info = league_info($season, $league);
|
||||||
@@ -337,13 +328,6 @@ switch ($mode)
|
|||||||
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
|
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
|
||||||
'S_DATA_RANKS' => $data_ranks,
|
'S_DATA_RANKS' => $data_ranks,
|
||||||
'S_SIDENAME' => $sidename,
|
'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),
|
'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),
|
'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,
|
'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']])
|
if ($rank == $prev_rank_of[$curr_rank['user_id']])
|
||||||
{
|
{
|
||||||
$change_sign = '=';
|
$change_sign = '=';
|
||||||
$change_img = "<img src=\"" . $ext_path . "images/no_change.gif\" alt=\"" . $user->lang['NO_CHANGES'] . "\"/>";
|
|
||||||
$change_differ = '';
|
$change_differ = '';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -500,14 +483,12 @@ switch ($mode)
|
|||||||
if ($rank > $prev_rank_of[$curr_rank['user_id']])
|
if ($rank > $prev_rank_of[$curr_rank['user_id']])
|
||||||
{
|
{
|
||||||
$change_sign = '+';
|
$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']];
|
$differ = $rank - $prev_rank_of[$curr_rank['user_id']];
|
||||||
$change_differ = ' (' . $differ . ')';
|
$change_differ = ' (' . $differ . ')';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$change_sign = '-';
|
$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;
|
$differ = $prev_rank_of[$curr_rank['user_id']] - $rank;
|
||||||
$change_differ = ' (' . $differ . ')';
|
$change_differ = ' (' . $differ . ')';
|
||||||
}
|
}
|
||||||
@@ -516,7 +497,6 @@ switch ($mode)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$change_sign = '';
|
$change_sign = '';
|
||||||
$change_img = '';
|
|
||||||
$change_differ = '';
|
$change_differ = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -539,8 +519,10 @@ switch ($mode)
|
|||||||
$template->assign_block_vars('rankstotal', array(
|
$template->assign_block_vars('rankstotal', array(
|
||||||
'ROW_CLASS' => $row_class,
|
'ROW_CLASS' => $row_class,
|
||||||
'RANK' => $rank,
|
'RANK' => $rank,
|
||||||
|
'NO_CHANGES' => ($change_sign == '=') ? true : false,
|
||||||
|
'WORSENED' => ($change_sign == '-') ? true : false,
|
||||||
|
'IMPROVED' => ($change_sign == '+') ? true : false,
|
||||||
'CHANGE_SIGN' => $change_sign,
|
'CHANGE_SIGN' => $change_sign,
|
||||||
'CHANGE_IMG' => $change_img,
|
|
||||||
'CHANGE_DIFFER' => $change_differ,
|
'CHANGE_DIFFER' => $change_differ,
|
||||||
'USERID' => $curr_rank['user_id'],
|
'USERID' => $curr_rank['user_id'],
|
||||||
'USERNAME' => $curr_rank['username'],
|
'USERNAME' => $curr_rank['username'],
|
||||||
@@ -558,7 +540,6 @@ switch ($mode)
|
|||||||
}
|
}
|
||||||
$index++;
|
$index++;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$sidename = sprintf($user->lang['RANK_TOTAL']);
|
$sidename = sprintf($user->lang['RANK_TOTAL']);
|
||||||
$league_info = league_info($season, $league);
|
$league_info = league_info($season, $league);
|
||||||
@@ -567,13 +548,6 @@ switch ($mode)
|
|||||||
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
|
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
|
||||||
'S_DATA_RANKS' => $data_ranks,
|
'S_DATA_RANKS' => $data_ranks,
|
||||||
'S_SIDENAME' => $sidename,
|
'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),
|
'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),
|
'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,
|
'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'])
|
switch ($league_info['bet_ko_type'])
|
||||||
{
|
{
|
||||||
case BET_KO_90:
|
case BET_KO_90:
|
||||||
@@ -409,18 +409,25 @@ switch ($league_info['bet_ko_type'])
|
|||||||
break;
|
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(
|
$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_EXTRA_RESULTS' => $extra_results,
|
||||||
'S_SIDENAME' => $sidename,
|
'S_SIDENAME' => $sidename,
|
||||||
'RESULT_EXPLAIN' => $result_explain,
|
'RESULT_EXPLAIN' => $result_explain,
|
||||||
'LABEL_FINALRESULT' => $label_finalresult,
|
'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_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_DATA_RESULTS' => $data_results,
|
||||||
'S_USER_IS_MEMBER' => $user_is_member,
|
'S_USER_IS_MEMBER' => $user_is_member,
|
||||||
|
|||||||
@@ -180,7 +180,8 @@ if ($data_rules)
|
|||||||
'JOIN_MODE' => ($league_info['join_by_user']) ? (($league_info['join_in_season']) ? sprintf($user->lang['JOIN_IN_SEASON']) : sprintf($user->lang['JOIN_BY_USER'])) : sprintf($user->lang['JOIN_BY_ADMIN']),
|
'JOIN_MODE' => ($league_info['join_by_user']) ? (($league_info['join_in_season']) ? sprintf($user->lang['JOIN_IN_SEASON']) : sprintf($user->lang['JOIN_BY_USER'])) : sprintf($user->lang['JOIN_BY_ADMIN']),
|
||||||
'POINTS_HIT' => sprintf($user->lang['POINTS_HIT'], $league_info['points_result']) . '<br/>',
|
'POINTS_HIT' => sprintf($user->lang['POINTS_HIT'], $league_info['points_result']) . '<br/>',
|
||||||
'POINTS_TENDENCY' => $points_tendency . '<br/>',
|
'POINTS_TENDENCY' => $points_tendency . '<br/>',
|
||||||
'POINTS_DIFF' => ($league_info['points_mode'] == 4) ? sprintf($user->lang['POINTS_DIFFERENCE'], $league_info['points_diff']) . '<br/>' : '',
|
'POINTS_DIFF' => ($league_info['points_mode'] == 4) ? sprintf($user->lang['POINTS_DIFFERENCE'], $league_info['points_diff']) . '<br/>' :
|
||||||
|
(($league_info['points_mode'] == 5) ? sprintf($user->lang['POINTS_DIFFERENCE_DRAW'], $league_info['points_diff']) . '<br/>' : ''),
|
||||||
'POINTS_LAST' => ($league_info['points_last']) ? sprintf($user->lang['POINTS_NO_BET']) . '<br/>' : '',
|
'POINTS_LAST' => ($league_info['points_last']) ? sprintf($user->lang['POINTS_NO_BET']) . '<br/>' : '',
|
||||||
'LINK_RULES' => sprintf($user->lang['LINK_RULES'], $link_rules),
|
'LINK_RULES' => sprintf($user->lang['LINK_RULES'], $link_rules),
|
||||||
'SEASONNAME' => $season_info['season_name'],
|
'SEASONNAME' => $season_info['season_name'],
|
||||||
|
|||||||
145
block/side_table.php
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
<?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;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data_table = false;
|
||||||
|
|
||||||
|
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
|
||||||
|
|
||||||
|
$sql = 'SELECT *
|
||||||
|
FROM ' . FOOTB_RANKS . "
|
||||||
|
WHERE season = $season
|
||||||
|
AND league = $league
|
||||||
|
AND matchday = $matchday";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if ($row)
|
||||||
|
{
|
||||||
|
include($this->football_root_path . 'block/rank_matchday.' . $this->php_ext);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$rank = 0;
|
||||||
|
// Get table-information
|
||||||
|
$sql = "SELECT
|
||||||
|
t.*,
|
||||||
|
SUM(1) AS matches,
|
||||||
|
SUM(IF(m.team_id_home = t.team_id,
|
||||||
|
IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)),
|
||||||
|
IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))
|
||||||
|
)
|
||||||
|
) - IF(t.team_id = 20 AND t.season = 2011 AND $matchday > 7, 2, 0) AS points,
|
||||||
|
SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goals_diff,
|
||||||
|
SUM(IF(m.team_id_home = t.team_id, goals_home , goals_guest)) AS goals,
|
||||||
|
SUM(IF(m.team_id_home = t.team_id, goals_guest , goals_home)) AS goals_against
|
||||||
|
FROM " . FOOTB_TEAMS . ' AS t
|
||||||
|
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league
|
||||||
|
AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id)
|
||||||
|
WHERE t.season = $season
|
||||||
|
AND t.league = $league
|
||||||
|
AND m.matchday <= $matchday
|
||||||
|
AND m.status IN (2,3,5,6)
|
||||||
|
GROUP BY t.team_id
|
||||||
|
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
|
||||||
|
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$table_ary = array();
|
||||||
|
$points_ary = array();
|
||||||
|
$ranks_ary = array();
|
||||||
|
while( $row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$table_ary[$row['team_id']] = $row;
|
||||||
|
$points_ary[$row['group_id']][$row['points']][]=$row['team_id'];
|
||||||
|
$ranks_ary[] = $row['team_id'];
|
||||||
|
}
|
||||||
|
$last_group = '';
|
||||||
|
$rank = 0;
|
||||||
|
$current_rank = 0;
|
||||||
|
$last_goals = 0;
|
||||||
|
$last_goals_againts = 0;
|
||||||
|
$last_points = 0;
|
||||||
|
foreach($points_ary as $group_id => $points)
|
||||||
|
{
|
||||||
|
$data_table = true;
|
||||||
|
if ($last_group != $group_id)
|
||||||
|
{
|
||||||
|
$last_group =$group_id;
|
||||||
|
$rank = 0;
|
||||||
|
$last_goals = 0;
|
||||||
|
$last_goals_againts = 0;
|
||||||
|
$last_points = 0;
|
||||||
|
$template->assign_block_vars('side_total', array(
|
||||||
|
'GROUP' => sprintf($user->lang['GROUP']) . ' ' .$group_id,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($points as $point => $teams)
|
||||||
|
{
|
||||||
|
if(count($teams) > 1 AND $group_id != '')
|
||||||
|
{
|
||||||
|
// Compare teams with equal points and sort
|
||||||
|
$teams = get_order_team_compare($teams, $season, $league, $group_id, $ranks_ary, $matchday);
|
||||||
|
}
|
||||||
|
foreach($teams as $key => $team)
|
||||||
|
{
|
||||||
|
$row = $table_ary[$team];
|
||||||
|
$rank++;
|
||||||
|
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
|
||||||
|
{
|
||||||
|
$current_rank = $rank . '.';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$current_rank = '';
|
||||||
|
}
|
||||||
|
$last_points = $row['points'];
|
||||||
|
$last_goals = $row['goals'];
|
||||||
|
$last_goals_againts = $row['goals_against'];
|
||||||
|
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
|
||||||
|
if ($row['team_symbol'] <> '')
|
||||||
|
{
|
||||||
|
$logo = "<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=\"20\" height=\"20\"/>" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
$template->assign_block_vars('side_total', array(
|
||||||
|
'RANK' => $current_rank,
|
||||||
|
'ROW_CLASS' => $row_class,
|
||||||
|
'LOGO' => $logo,
|
||||||
|
'TEAM_ID' => $row['team_id'],
|
||||||
|
'TEAM_SHORT' => $row['team_name_short'],
|
||||||
|
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'],
|
||||||
|
'tid' => $row['team_id'], 'mode' => 'played')),
|
||||||
|
'GAMES' => $row['matches'],
|
||||||
|
'POINTS' => $row['points'],
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'S_DISPLAY_SIDE_TABLE' => true,
|
||||||
|
'S_DATA_SIDE_TABLE' => $data_table,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -154,12 +154,6 @@ $template->assign_vars(array(
|
|||||||
'S_MATCHDAY_HIDE' => true,
|
'S_MATCHDAY_HIDE' => true,
|
||||||
'S_SIDENAME' => $sidename,
|
'S_SIDENAME' => $sidename,
|
||||||
'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true,
|
'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_STAT_POINTS' => $data,
|
||||||
'S_DATA_ALL_POINTS' => $data_all,
|
'S_DATA_ALL_POINTS' => $data_all,
|
||||||
'SEASON' => $season,
|
'SEASON' => $season,
|
||||||
|
|||||||
@@ -131,12 +131,6 @@ $sidename = sprintf($user->lang['STAT_RESULTS']);
|
|||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DISPLAY_STAT_RESULTS' => true,
|
'S_DISPLAY_STAT_RESULTS' => true,
|
||||||
'S_SIDENAME' => $sidename,
|
'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,
|
'S_DATA_STAT_RESULTS' => $data,
|
||||||
'SEASON' => $season,
|
'SEASON' => $season,
|
||||||
'LEAGUE' => $league,
|
'LEAGUE' => $league,
|
||||||
|
|||||||
148
block/table.php
@@ -12,6 +12,7 @@ if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL'))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$data_table = false;
|
$data_table = false;
|
||||||
$data_form = false;
|
$data_form = false;
|
||||||
|
|
||||||
@@ -41,50 +42,80 @@ $rank = 0;
|
|||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
t.*,
|
t.*,
|
||||||
SUM(1) AS matches,
|
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((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0)))
|
||||||
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw,
|
+ 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((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(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,
|
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(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 , 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_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
|
FROM " . FOOTB_TEAMS . ' AS t
|
||||||
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league
|
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)
|
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
|
WHERE t.season = $season
|
||||||
AND t.league = $league
|
AND t.league = $league
|
||||||
AND m.matchday <= $matchday
|
AND m.matchday <= $matchday
|
||||||
AND m.status IN (2, 3,5,6)
|
AND m.status IN (2,3,5,6)
|
||||||
|
AND m.show_table = 0
|
||||||
GROUP BY t.team_id
|
GROUP BY t.team_id
|
||||||
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
|
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$table_ary = array();
|
||||||
|
$points_ary = array();
|
||||||
|
$ranks_ary = array();
|
||||||
|
$rank = 0;
|
||||||
|
while( $row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$rank++;
|
||||||
|
$table_ary[$row['team_id']] = $row;
|
||||||
|
$points_ary[$row['group_id']][$row['points']][]=$row['team_id'];
|
||||||
|
$ranks_ary[] = $row['team_id'];
|
||||||
|
}
|
||||||
|
|
||||||
$last_group = '';
|
$last_group = '';
|
||||||
|
$rank = 0;
|
||||||
$current_rank = 0;
|
$current_rank = 0;
|
||||||
$last_goals = 0;
|
$last_goals = 0;
|
||||||
$last_goals_againts = 0;
|
$last_goals_againts = 0;
|
||||||
$last_points = 0;
|
$last_points = 0;
|
||||||
while($row = $db->sql_fetchrow($result))
|
foreach($points_ary as $group_id => $points)
|
||||||
{
|
{
|
||||||
if ($last_group != $row['group_id'])
|
$data_table = true;
|
||||||
|
if ($last_group != $group_id)
|
||||||
{
|
{
|
||||||
$last_group = $row['group_id'];
|
$last_group =$group_id;
|
||||||
$rank = 0;
|
$rank = 0;
|
||||||
$last_goals = 0;
|
$last_goals = 0;
|
||||||
$last_goals_againts = 0;
|
$last_goals_againts = 0;
|
||||||
$last_points = 0;
|
$last_points = 0;
|
||||||
$template->assign_block_vars('total', array(
|
$template->assign_block_vars('total', array(
|
||||||
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
|
'GROUP' => sprintf($user->lang['GROUP']) . ' ' .$group_id,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($league_type != 2 OR $row['group_id'] != '')
|
|
||||||
|
foreach($points as $point => $teams)
|
||||||
{
|
{
|
||||||
$data_table = true;
|
if(count($teams) > 1 AND $group_id != '')
|
||||||
|
{
|
||||||
|
// Compare teams with equal points and sort
|
||||||
|
$teams = get_order_team_compare($teams, $season, $league, $group_id, $ranks_ary, $matchday);
|
||||||
|
}
|
||||||
|
foreach($teams as $key => $team)
|
||||||
|
{
|
||||||
|
$row = $table_ary[$team];
|
||||||
$rank++;
|
$rank++;
|
||||||
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
|
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
|
||||||
{
|
{
|
||||||
@@ -123,35 +154,45 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
'GOALS' => $row['goals'],
|
'GOALS' => $row['goals'],
|
||||||
'GOALS_AGAINST' => $row['goals_against'],
|
'GOALS_AGAINST' => $row['goals_against'],
|
||||||
'GOALS_DIFF' => $row['goals_diff'],
|
'GOALS_DIFF' => $row['goals_diff'],
|
||||||
'POINTS' => $row['points'],
|
'BONUS' => round($row['bonus'],2),
|
||||||
|
'POINTS' => round($row['points'],2),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
$rank = 0;
|
$rank = 0;
|
||||||
// Get form-table-information
|
// Get form-table-information
|
||||||
$sql = 'SELECT
|
$sql = "SELECT
|
||||||
t.*,
|
t.*,
|
||||||
SUM(1) AS matches,
|
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((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0)))
|
||||||
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw,
|
+ 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((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(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,
|
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(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 , 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_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,
|
||||||
FROM ' . FOOTB_TEAMS . ' AS t
|
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
|
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)
|
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
|
WHERE t.season = $season
|
||||||
AND t.league = $league
|
AND t.league = $league
|
||||||
AND m.matchday >= $form_from
|
AND m.matchday >= $form_from
|
||||||
AND m.status IN (2, 3,5,6)
|
AND m.status IN (2, 3,5,6)
|
||||||
|
AND m.show_table = 0
|
||||||
GROUP BY t.team_id
|
GROUP BY t.team_id
|
||||||
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
|
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
|
||||||
|
|
||||||
@@ -216,7 +257,8 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
'GOALS' => $row['goals'],
|
'GOALS' => $row['goals'],
|
||||||
'GOALS_AGAINST' => $row['goals_against'],
|
'GOALS_AGAINST' => $row['goals_against'],
|
||||||
'GOALS_DIFF' => $row['goals_diff'],
|
'GOALS_DIFF' => $row['goals_diff'],
|
||||||
'POINTS' => $row['points'],
|
'BONUS' => round($row['bonus'],2),
|
||||||
|
'POINTS' => round($row['points'],2),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -224,23 +266,29 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
$rank = 0;
|
$rank = 0;
|
||||||
// Get home-table-information
|
// Get home-table-information
|
||||||
$sql = 'SELECT
|
$sql = "SELECT
|
||||||
t.*,
|
t.*,
|
||||||
SUM(1) AS matches,
|
SUM(1) AS matches,
|
||||||
SUM(IF(goals_home + 0 > goals_guest, 1, 0)) AS win,
|
SUM(IF(goals_home + 0 > goals_guest, 1, 0))
|
||||||
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw,
|
+ 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 + 0 < goals_guest, 1, 0)) AS lost,
|
SUM(IF(goals_home = goals_guest, 1, 0))
|
||||||
SUM(IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) AS points,
|
+ 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 - goals_guest) AS goals_diff,
|
||||||
SUM(goals_home) AS goals,
|
SUM(goals_home) AS goals,
|
||||||
SUM(goals_guest) AS goals_against
|
SUM(goals_guest) AS goals_against,
|
||||||
FROM ' . FOOTB_TEAMS . ' AS t
|
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
|
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)
|
AND m.team_id_home = t.team_id AND m.group_id = t.group_id)
|
||||||
WHERE t.season = $season
|
WHERE t.season = $season
|
||||||
AND t.league = $league
|
AND t.league = $league
|
||||||
AND m.matchday <= $matchday
|
AND m.matchday <= $matchday
|
||||||
AND m.status IN (2, 3,5,6)
|
AND m.status IN (2, 3,5,6)
|
||||||
|
AND m.show_table = 0
|
||||||
GROUP BY t.team_id
|
GROUP BY t.team_id
|
||||||
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
|
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
|
||||||
|
|
||||||
@@ -304,7 +352,8 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
'GOALS' => $row['goals'],
|
'GOALS' => $row['goals'],
|
||||||
'GOALS_AGAINST' => $row['goals_against'],
|
'GOALS_AGAINST' => $row['goals_against'],
|
||||||
'GOALS_DIFF' => $row['goals_diff'],
|
'GOALS_DIFF' => $row['goals_diff'],
|
||||||
'POINTS' => $row['points'],
|
'BONUS' => round($row['bonus'],2),
|
||||||
|
'POINTS' => round($row['points'],2),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -312,23 +361,29 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
$rank = 0;
|
$rank = 0;
|
||||||
// Get away-table-information
|
// Get away-table-information
|
||||||
$sql = 'SELECT
|
$sql = "SELECT
|
||||||
t.*,
|
t.*,
|
||||||
SUM(1) AS matches,
|
SUM(1) AS matches,
|
||||||
SUM(IF(goals_home + 0 < goals_guest, 1, 0)) AS win,
|
SUM(IF(goals_home + 0 < goals_guest, 1, 0))
|
||||||
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw,
|
+ 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 + 0 > goals_guest, 1, 0)) AS lost,
|
SUM(IF(goals_home = goals_guest, 1, 0))
|
||||||
SUM(IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) AS points,
|
+ 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 - goals_home) AS goals_diff,
|
||||||
SUM(goals_guest) AS goals,
|
SUM(goals_guest) AS goals,
|
||||||
SUM(goals_home) AS goals_against
|
SUM(goals_home) AS goals_against,
|
||||||
FROM ' . FOOTB_TEAMS . ' AS t
|
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
|
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)
|
AND m.team_id_guest = t.team_id AND m.group_id = t.group_id)
|
||||||
WHERE t.season = $season
|
WHERE t.season = $season
|
||||||
AND t.league = $league
|
AND t.league = $league
|
||||||
AND m.matchday <= $matchday
|
AND m.matchday <= $matchday
|
||||||
AND m.status IN (2, 3,5,6)
|
AND m.status IN (2, 3,5,6)
|
||||||
|
AND m.show_table = 0
|
||||||
GROUP BY t.team_id
|
GROUP BY t.team_id
|
||||||
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
|
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
|
||||||
|
|
||||||
@@ -392,28 +447,33 @@ while($row = $db->sql_fetchrow($result))
|
|||||||
'GOALS' => $row['goals'],
|
'GOALS' => $row['goals'],
|
||||||
'GOALS_AGAINST' => $row['goals_against'],
|
'GOALS_AGAINST' => $row['goals_against'],
|
||||||
'GOALS_DIFF' => $row['goals_diff'],
|
'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);
|
$db->sql_freeresult($result);
|
||||||
$sidename = sprintf($user->lang['TABLE']);
|
$sidename = sprintf($user->lang['TABLE']);
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DISPLAY_TABLE' => true,
|
'S_DISPLAY_TABLE' => true,
|
||||||
|
'S_DISPLAY_TABLE_MENU' => $display_table_menu,
|
||||||
'S_SIDENAME' => $sidename,
|
'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_TABLE' => $data_table,
|
||||||
'S_DATA_FORM' => $data_form,
|
'S_DATA_FORM' => $data_form,
|
||||||
'SEASON' => $season,
|
'SEASON' => $season,
|
||||||
'LEAGUE' => $league,
|
'LEAGUE' => $league,
|
||||||
'TEXT_FORM' => $text_form,
|
'TEXT_FORM' => $text_form,
|
||||||
|
'S_DATA_BNS' => $data_bns,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "football/football",
|
"name": "football/football",
|
||||||
"type": "phpbb-extension",
|
"type": "phpbb-extension",
|
||||||
"description": "Football Prediction League for phpBB 3.1",
|
"description": "Football Prediction League",
|
||||||
"homepage": "http://football.bplaced.net",
|
"homepage": "http://football.bplaced.net",
|
||||||
"version": "0.9.5",
|
"version": "0.9.9",
|
||||||
"time": "2016-04-22",
|
"time": "2017-09-09",
|
||||||
"license": "GPL-2.0",
|
"license": "GPL-2.0",
|
||||||
"authors": [{
|
"authors": [{
|
||||||
"name": "J. Helmke",
|
"name": "J. Helmke",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"extra": {
|
"extra": {
|
||||||
"display-name": "Football Prediction League",
|
"display-name": "Football Prediction League",
|
||||||
"soft-require": {
|
"soft-require": {
|
||||||
"phpbb/phpbb": "3.1.*"
|
"phpbb/phpbb": ">3.1.*"
|
||||||
},
|
},
|
||||||
"version-check": {
|
"version-check": {
|
||||||
"host": "football.bplaced.net",
|
"host": "football.bplaced.net",
|
||||||
|
|||||||
@@ -308,8 +308,8 @@ class main
|
|||||||
$user_id = $user->data['user_id'];
|
$user_id = $user->data['user_id'];
|
||||||
$sql = 'SELECT * FROM ' . FOOTB_MATCHES . " WHERE season = $season AND league = $league AND matchday = $matchday AND status <= 0";
|
$sql = 'SELECT * FROM ' . FOOTB_MATCHES . " WHERE season = $season AND league = $league AND matchday = $matchday AND status <= 0";
|
||||||
$resultopen = $db->sql_query($sql);
|
$resultopen = $db->sql_query($sql);
|
||||||
|
|
||||||
$rows = $db->sql_fetchrowset($resultopen);
|
$rows = $db->sql_fetchrowset($resultopen);
|
||||||
|
$db->sql_freeresult($resultopen);
|
||||||
|
|
||||||
$count_matches = 0;
|
$count_matches = 0;
|
||||||
$count_updates = 0;
|
$count_updates = 0;
|
||||||
@@ -419,7 +419,6 @@ class main
|
|||||||
{
|
{
|
||||||
$dbmsg = sprintf($user->lang['NO_BETS_SAVED']);
|
$dbmsg = sprintf($user->lang['NO_BETS_SAVED']);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($resultopen);
|
|
||||||
|
|
||||||
// extra bets
|
// extra bets
|
||||||
$sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND matchday = $matchday AND extra_status <= 0";
|
$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)
|
if ($count_extra_updates)
|
||||||
{
|
{
|
||||||
$dbmsg = $dbmsg . ' ' . sprintf($user->lang['EXTRA_BET' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $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)
|
if ($count_extra_updates)
|
||||||
{
|
{
|
||||||
$dbmsg = $dbmsg . ' ' . sprintf($user->lang['EXTRA_RESULT' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $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);
|
calculate_extra_points($season, $league, $matchday);
|
||||||
save_ranking_matchday($season, $league, $matchday);
|
save_ranking_matchday($season, $league, $matchday);
|
||||||
|
bonuspoints($season, $league, $matchday);
|
||||||
|
corr($season, $league, $matchday);
|
||||||
|
chart($season, $league, $matchday);
|
||||||
break;
|
break;
|
||||||
case 'join':
|
case 'join':
|
||||||
join_league($season, $league, $user->data['user_id']);
|
join_league($season, $league, $user->data['user_id']);
|
||||||
@@ -781,11 +785,36 @@ class main
|
|||||||
}
|
}
|
||||||
|
|
||||||
$league_name = '';
|
$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);
|
$result = $db->sql_query($sql);
|
||||||
while( $row = $db->sql_fetchrow($result))
|
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'])
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
elseif ($side == 'table' OR $side == 'results_tl')
|
||||||
|
{
|
||||||
|
if ($league < 51)
|
||||||
|
{
|
||||||
|
$league = $league + 50;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($league > 50)
|
||||||
|
{
|
||||||
|
$league = $league - 50;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($selected)
|
if ($selected)
|
||||||
{
|
{
|
||||||
$league_name = $row['league_name'];
|
$league_name = $row['league_name'];
|
||||||
@@ -823,7 +852,7 @@ class main
|
|||||||
$league_type = $row['league_type'];
|
$league_type = $row['league_type'];
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
$lang_dates = $user->lang['datetime'];
|
$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 *,
|
$sql = "SELECT *,
|
||||||
CONCAT(
|
CONCAT(
|
||||||
CASE DATE_FORMAT(delivery_date,'%w')
|
CASE DATE_FORMAT(delivery_date,'%w')
|
||||||
@@ -902,17 +931,18 @@ class main
|
|||||||
if (!$user->data['football_mobile'])
|
if (!$user->data['football_mobile'])
|
||||||
{
|
{
|
||||||
// Start matchday list
|
// Start matchday list
|
||||||
|
if ($side == 'bet')
|
||||||
|
{
|
||||||
|
include($this->football_root_path . 'block/table.' . $this->php_ext);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
include($this->football_root_path . 'block/rank_matchday.' . $this->php_ext);
|
include($this->football_root_path . 'block/rank_matchday.' . $this->php_ext);
|
||||||
|
}
|
||||||
// End matchday list
|
// End matchday list
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
||||||
// Start total list
|
|
||||||
include($this->football_root_path . 'block/rank_total.' . $this->php_ext);
|
|
||||||
// End total list
|
|
||||||
|
|
||||||
//*****************************************************************************
|
|
||||||
|
|
||||||
// Start delivery list
|
// Start delivery list
|
||||||
include($this->football_root_path . 'block/delivery.' . $this->php_ext);
|
include($this->football_root_path . 'block/delivery.' . $this->php_ext);
|
||||||
// End delivery list
|
// End delivery list
|
||||||
@@ -981,6 +1011,10 @@ class main
|
|||||||
{
|
{
|
||||||
include($this->football_root_path . 'block/under_construction.' . $this->php_ext);
|
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
|
else
|
||||||
{
|
{
|
||||||
include($this->football_root_path . 'block/' . $side . '.' . $this->php_ext);
|
include($this->football_root_path . 'block/' . $side . '.' . $this->php_ext);
|
||||||
@@ -993,8 +1027,15 @@ class main
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mobile = '';
|
$mobile = '';
|
||||||
|
if ($config['football_display_last_users'] > 0)
|
||||||
|
{
|
||||||
include($this->football_root_path . 'block/last_users.' . $this->php_ext);
|
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
|
// Send data to the template file
|
||||||
if ($view == 'print')
|
if ($view == 'print')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ class football_remember extends \phpbb\cron\task\base
|
|||||||
include($ext_path . 'includes/constants.' . $this->php_ext);
|
include($ext_path . 'includes/constants.' . $this->php_ext);
|
||||||
|
|
||||||
// Load extension language file
|
// Load extension language file
|
||||||
|
$this->user->setup();
|
||||||
$this->user->add_lang_ext('football/football', 'info_acp_football');
|
$this->user->add_lang_ext('football/football', 'info_acp_football');
|
||||||
|
|
||||||
// mode=test ?
|
// mode=test ?
|
||||||
@@ -87,9 +88,8 @@ class football_remember extends \phpbb\cron\task\base
|
|||||||
|
|
||||||
$season = curr_season();
|
$season = curr_season();
|
||||||
//Matchdays to close in 24 hours and 24 hours later
|
//Matchdays to close in 24 hours and 24 hours later
|
||||||
$local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600);
|
|
||||||
// shift days to test
|
// shift days to test
|
||||||
$local_board_time = $local_board_time + ($days * 86400);
|
$local_board_time = time() + ($days * 86400);
|
||||||
|
|
||||||
if ($mode <> 'test')
|
if ($mode <> 'test')
|
||||||
{
|
{
|
||||||
@@ -111,7 +111,8 @@ class football_remember extends \phpbb\cron\task\base
|
|||||||
LEFT JOIN ' . FOOTB_LEAGUES . " AS l ON (l.season = m.season AND l.league = m.league)
|
LEFT JOIN ' . FOOTB_LEAGUES . " AS l ON (l.season = m.season AND l.league = m.league)
|
||||||
WHERE m.season >= $season AND m.status = 0
|
WHERE m.season >= $season AND m.status = 0
|
||||||
AND (DATE_SUB(m.delivery_date, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time'))
|
AND (DATE_SUB(m.delivery_date, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time'))
|
||||||
AND (DATE_SUB(m.delivery_date, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time'))";
|
AND (DATE_SUB(m.delivery_date, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time'))
|
||||||
|
GROUP BY m.season, m.league, m.matchday";
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
$toclose = $this->db->sql_fetchrowset($result);
|
$toclose = $this->db->sql_fetchrowset($result);
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
@@ -137,12 +138,17 @@ class football_remember extends \phpbb\cron\task\base
|
|||||||
u.user_id AS userid,
|
u.user_id AS userid,
|
||||||
u.user_lang
|
u.user_lang
|
||||||
FROM ' . FOOTB_MATCHES . ' AS m
|
FROM ' . FOOTB_MATCHES . ' AS m
|
||||||
|
LEFT JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league)
|
||||||
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
|
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
|
||||||
LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id
|
LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id
|
||||||
LEFT JOIN ' . USERS_TABLE. " AS u ON u.user_id = b.user_id
|
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
|
WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday
|
||||||
AND ((b.goals_home = '') OR (b.goals_guest = ''))
|
AND ((b.goals_home = '') OR (b.goals_guest = ''))
|
||||||
AND m.status = 0 AND p.pf_footb_rem_f = 1
|
AND m.status = 0 AND p.pf_footb_rem_f = 1
|
||||||
|
AND (l.bet_in_time = 0 OR
|
||||||
|
(l.bet_in_time = 1
|
||||||
|
AND (DATE_SUB(m.match_datetime, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time'))
|
||||||
|
AND (DATE_SUB(m.match_datetime, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time'))))
|
||||||
GROUP BY b.user_id
|
GROUP BY b.user_id
|
||||||
UNION
|
UNION
|
||||||
SELECT
|
SELECT
|
||||||
@@ -151,12 +157,17 @@ class football_remember extends \phpbb\cron\task\base
|
|||||||
u.user_id AS userid,
|
u.user_id AS userid,
|
||||||
u.user_lang
|
u.user_lang
|
||||||
FROM " . FOOTB_MATCHES . ' AS m
|
FROM " . FOOTB_MATCHES . ' AS m
|
||||||
|
LEFT JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league)
|
||||||
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
|
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
|
||||||
LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id
|
LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id
|
||||||
LEFT JOIN ' . USERS_TABLE. " AS u ON u.user_id = b.user_id
|
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
|
WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday
|
||||||
AND ((b.goals_home = '') OR (b.goals_guest = ''))
|
AND ((b.goals_home = '') OR (b.goals_guest = ''))
|
||||||
AND m.status = 0 AND p.pf_footb_rem_s = 1
|
AND m.status = 0 AND p.pf_footb_rem_s = 1
|
||||||
|
AND (l.bet_in_time = 0 OR
|
||||||
|
(l.bet_in_time = 1
|
||||||
|
AND (DATE_SUB(m.match_datetime, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time'))
|
||||||
|
AND (DATE_SUB(m.match_datetime, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time'))))
|
||||||
GROUP BY b.user_id
|
GROUP BY b.user_id
|
||||||
";
|
";
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
|
|||||||
@@ -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_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_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' => $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_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_TOTAL' => $this->controller_helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)),
|
||||||
'U_RANKS_MATCHDAY' => $this->controller_helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)),
|
'U_RANKS_MATCHDAY' => $this->controller_helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)),
|
||||||
@@ -261,8 +262,7 @@ class main_listener implements EventSubscriberInterface
|
|||||||
|
|
||||||
$mobile = false;
|
$mobile = false;
|
||||||
$user_agent = $request->server('HTTP_USER_AGENT');
|
$user_agent = $request->server('HTTP_USER_AGENT');
|
||||||
if ($this->user->data['football_mobile_device'] == '')
|
|
||||||
{
|
|
||||||
switch(true)
|
switch(true)
|
||||||
{
|
{
|
||||||
/** Remove Bots from the list */
|
/** Remove Bots from the list */
|
||||||
@@ -508,7 +508,6 @@ class main_listener implements EventSubscriberInterface
|
|||||||
$this->user->data['football_mobile'] = $mobile;
|
$this->user->data['football_mobile'] = $mobile;
|
||||||
$this->user->data['football_mobile_device'] = $mobile_device;
|
$this->user->data['football_mobile_device'] = $mobile_device;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if user should be able to access football prediction league
|
* Check if user should be able to access football prediction league
|
||||||
|
|||||||
|
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 |