27 Commits

Author SHA1 Message Date
66dceff9f2 change color to green 2018-05-20 16:18:38 +02:00
8b679b1286 Change order of tippers in all_bets site according to the tipper vs tipper matches and change background color. 2018-04-03 22:16:31 +02:00
e1db71c99d Add matchtime tooltip to all_bets site 2018-04-03 21:58:09 +02:00
3ade0f043f Add bonuspoint, corr and chart calculation and update displaying of chart. 2018-04-03 21:06:22 +02:00
f56cf04e74 Rearange main menu and change external links to internal links 2018-04-03 19:57:48 +02:00
66b2a1a8d0 Readd rank_matchday in all sites and add check for correct league --> Display of rank_matchday works on table and results_tl site. 2018-04-03 19:24:37 +02:00
889ff05ca6 Remove highlight of table menu item in bet site. 2018-04-03 19:14:08 +02:00
0b9f099381 Remove small rank total from main view. 2018-04-03 19:13:08 +02:00
148c16c87a Remove unneeded teams from tables in mytable site. 2018-04-03 19:12:36 +02:00
511fab50b7 Add results_tl and handling in different files 2018-04-03 18:43:39 +02:00
6c06de3772 Remove unneeded menu items. 2018-04-03 17:47:42 +02:00
37204150dc Add results_tl to language and main controller. 2018-04-03 17:47:30 +02:00
85d3c835d2 Change short team names to full team names 2018-04-02 23:25:37 +02:00
ac536658fa Add auto selection of correct leage (higher or lower league id 50) 2018-04-02 22:58:54 +02:00
92267523b9 Include full table in bet view instead of small table 2018-04-02 22:56:21 +02:00
4a64eb71a3 Add bonus points to the missing tables and make non relevant teams invisible in tables. 2018-04-02 22:24:49 +02:00
268ca763f7 Fix BNS coloumn displaying 2018-02-21 23:26:07 +01:00
66b35b0155 Fix table and add corr to constants 2018-02-21 23:24:04 +01:00
4b627586f8 Add bonus points calculation to table total. 2018-02-21 23:19:03 +01:00
3b47093a3a fix broken function current_league($season) sql select 2018-02-19 22:57:59 +01:00
511a23d609 Wappen der Mannschaften hinzugefügt 2018-02-19 22:10:07 +01:00
6b9ebb0d1a Football functions.php angepasst, damit ertippte Punkte bei ihren jeweiligen Teams als Tore eingetragen werden. 2018-02-19 21:56:29 +01:00
football
7d8b92f1df Version 0.9.9 2017-09-09 13:51:15 +02:00
football
c075143bfc Version 0.9.9b1
-replace icons with font awesome icons
-display icons on tabs and hide it on mobile access
-new block last results
-new config values for last users, last results
-replace config value football_host_timezone with football_time_shift
-fixed errors on php 7
-remove unnecessary sql_freeresult calls
-fixed non-numeric value errors
2017-09-09 10:58:32 +02:00
football
a502b5d082 Fix problem in admin-help-section on phpBB3.2 (no help is shown):
[phpBB Debug] PHP Warning: in file [ROOT]/ext/football/football/acp/football_module.php on line 80: Invalid argument supplied for foreach()
2017-03-05 18:04:34 +01:00
football
a16e0e3c79 Version 0.9.8 2017-02-19 20:25:32 +01:00
football
09631cbe15 Version 0.9.7 2016-06-12 17:20:16 +02:00
673 changed files with 19816 additions and 19372 deletions

24
.gitignore vendored
View File

@@ -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

View File

@@ -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);

View File

@@ -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 . '&amp;action=list&amp;s=' . $season . '&amp;l=' . $league . '&amp;t=' . $type . '&amp;start=' . $start; $back_link = $this->u_action . '&amp;action=list&amp;s=' . $season . '&amp;l=' . $league . '&amp;t=' . $type . '&amp;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));

View File

@@ -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

View File

@@ -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++)
{ {

View File

@@ -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;
}
} }
?> ?>

View File

@@ -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';

View File

@@ -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 . "&amp;action=list&amp;s=$season&amp;l=$league"), E_USER_WARNING); trigger_error($user->lang['NO_MEMBERS_SELECTED'] . adm_back_link($this->u_action . "&amp;action=list&amp;s=$season&amp;l=$league"), E_USER_WARNING);
} }

View File

@@ -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

View File

@@ -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 . "&amp;s=$season&amp;l=$league&amp;m=$matchday"; $u_back = $this->u_action . "&amp;s=$season&amp;l=$league&amp;m=$matchday";
$template->assign_vars(array( $template->assign_vars(array(

View File

@@ -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 . "&amp;s=$season&amp;l=$league"), E_USER_WARNING); trigger_error(sprintf($user->lang['NO_MATCHDAY'], $league_info['league_name'], $season) . adm_back_link($this->u_action . "&amp;s=$season&amp;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'])
{ {

View File

@@ -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';

View File

@@ -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'))

View File

@@ -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))
{ {
@@ -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,7 +667,7 @@ 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 = $sql = 'UPDATE ' . FOOTB_MATCHDAYS . " AS target $sql = $sql = 'UPDATE ' . FOOTB_MATCHDAYS . " AS target
INNER JOIN INNER JOIN
( (
@@ -1386,6 +1387,7 @@ class update_module
} }
} }
} }
$db->sql_freeresult($result);
return $count_updates; return $count_updates;
} }

View File

@@ -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;
$sql = "SELECT if($league_info['bet_type'])
u.user_id, {
u.username, $sql = "SELECT
m.status, u.user_id,
b.goals_home AS bet_home, u.username,
b.goals_guest AS bet_guest, m.status,
" . select_points() . ' b.goals_home AS bet_home,
FROM ' . FOOTB_MATCHES . ' AS m b.goals_guest AS bet_guest,
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) IFNULL(m2.match_no,m3.match_no),
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) " . select_points() . '
WHERE m.season = $season FROM ' . FOOTB_MATCHES . ' AS m
AND m.league = $league LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
AND m.matchday = $matchday LEFT JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id)
ORDER BY LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC"; LEFT JOIN ' . FOOTB_MATCHES . ' AS m2 ON (m2.season = m.season AND m2.league = m.league + 50 AND m2.matchday = m.matchday AND m2.team_id_home = b.user_id + 2000)
LEFT JOIN ' . FOOTB_MATCHES . " AS m3 ON (m3.season = m.season AND m3.league = m.league + 50 AND m3.matchday = m.matchday AND m3.team_id_guest = b.user_id + 2000)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
ORDER BY IFNULL(m2.match_no,m3.match_no) ASC, m3.match_no ASC, LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC";
}
else
{
$sql = "SELECT
u.user_id,
u.username,
m.status,
b.goals_home AS bet_home,
b.goals_guest AS bet_guest,
IFNULL(m2.match_no,m3.match_no),
" . select_points() . '
FROM ' . FOOTB_MATCHES . ' AS m
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
LEFT JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id)
LEFT JOIN ' . FOOTB_MATCHES . ' AS m2 ON (m2.season = m.season AND m2.league = m.league + 50 AND m2.matchday = m.matchday AND m2.team_id_home = b.user_id + 2000)
LEFT JOIN ' . FOOTB_MATCHES . " AS m3 ON (m3.season = m.season AND m3.league = m.league + 50 AND m3.matchday = m.matchday AND m3.team_id_guest = b.user_id + 2000)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
AND (m3.match_no IS NOT NULL OR m2.match_no IS NOT NULL)
ORDER BY IFNULL(m2.match_no,m3.match_no) ASC, m3.match_no ASC, LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC";
}
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start); $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++;
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $league_info = league_info($season, $league);
if ($league_info['bet_type'])
{
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
}
else
{
$row_class = (!(($count_user + ($count_user % 2)) % 4)) ? 'bg1 row_light' : 'bg2 row_dark';
}
if ($user_bet['user_id'] == $user->data['user_id']) 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';
@@ -265,10 +322,11 @@ foreach ($matches AS $match)
} }
$colorstyle_match = color_style($match['status']); $colorstyle_match = color_style($match['status']);
$template->assign_block_vars('match_panel.match_entry', array( $template->assign_block_vars('match_panel.match_entry', array(
'HOME_NAME' => $homename, 'HOME_NAME' => $homename,
'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,59 +346,70 @@ if ($count_matches > 0)
$total = 0; $total = 0;
$count_user = 0; $count_user = 0;
$bet_index = 0; $bet_index = 0;
foreach ($bet_line[$split_index] AS $user_bet) if(!empty($bet_line))
{ {
if ($bet_index == 0) foreach ($bet_line[$split_index] AS $user_bet)
{ {
$count_user++; if ($bet_index == 0)
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_bet['user_id'] == $user->data['user_id'])
{ {
$row_class = 'bg3 row_user'; $count_user++;
$league_info = league_info($season, $league);
if ($league_info['bet_type'])
{
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
}
else
{
$row_class = (!(($count_user + ($count_user % 2)) % 4)) ? 'bg1 row_light' : 'bg2 row_dark';
}
if ($user_bet['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
)
);
$total = 0;
} }
$template->assign_block_vars('match_panel.user_row', array( $bet_index++;
'ROW_CLASS' => $row_class, $total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
'USER_NAME' => $user_bet['username'], if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
}
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet_home = ($user_bet['bet_home'] == '') ? '' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
) )
); );
$total = 0;
}
$bet_index++;
$total += $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
}
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet_home = ($user_bet['bet_home'] == '') ? '' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']); if ($bet_index == $last_match_index)
$template->assign_block_vars('match_panel.user_row.bet', array( {
'BET' => $bet_home. ':'. $bet_guest, $sum_total[$user_bet['username']] += $total;
'COLOR_STYLE' => $colorstyle_bet, $matchday_sum_total += $total;
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'], $template->assign_block_vars('match_panel.user_row.points', array(
) 'COLOR_STYLE' => $colorstyle_total,
); 'POINTS_TOTAL' => $sum_total[$user_bet['username']],
)
if ($bet_index == $last_match_index) );
{ $bet_index = 0;
$sum_total[$user_bet['username']] += $total; }
$matchday_sum_total += $total;
$template->assign_block_vars('match_panel.user_row.points', array(
'COLOR_STYLE' => $colorstyle_total,
'POINTS_TOTAL' => $sum_total[$user_bet['username']],
)
);
$bet_index = 0;
} }
} }
@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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),

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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'],
) )

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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')),

View File

@@ -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)

View File

@@ -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,142 +26,25 @@ $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,
SUM(IF(e.extra_no > 0, 1, 0)) AS extra_count SUM(IF(e.extra_no > 0, 1, 0)) AS extra_count
FROM " . FOOTB_MATCHDAYS . " AS m FROM " . FOOTB_MATCHDAYS . " AS m
JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league AND l.bet_in_time = 0) JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league)
JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = 0) JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = 0)
JOIN " . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = ma.match_no AND b.user_id = $user_id) 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 AND l.bet_in_time = 0)
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 AND l.bet_in_time = 0)
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
)
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(ma.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(ma.match_datetime,' %d.%m.%y %H:%i')
) as delivery_time,
ma.match_datetime 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 AND l.bet_in_time = 1)
JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = 0)
JOIN " . FOOTB_BETS . " AS b ON (b.season = ma.season AND b.league = ma.league AND b.match_no = ma.match_no AND b.user_id = $user_id)
WHERE ma.match_datetime > FROM_UNIXTIME('$local_board_time')
AND m.status <= 0
GROUP BY ma.match_datetime, 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)
@@ -178,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'])),
) )
); );
} }

View File

@@ -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');

View File

@@ -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');

View File

@@ -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
View 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,
)
);
?>

View File

@@ -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
@@ -28,7 +28,7 @@ $sql = 'SELECT s.session_user_id
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))
{ {
@@ -58,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,
)); ));

View File

@@ -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']) ? '&lt; ' . sprintf($user->lang['FOOTBALL_BANK']) :
'&lt; ' . 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']) . ' &gt;',
'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,

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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,

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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),

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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,

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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,

View File

@@ -137,6 +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.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";
@@ -233,6 +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.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";
@@ -300,6 +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.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";
@@ -365,6 +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.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";
@@ -413,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' => '&lt; ' . sprintf($user->lang['MY_TABLE']),
'LEFT_LINK' => '&lt; ' . 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' => '&lt; ' . sprintf($user->lang['MY_TABLE']),
'RIGHT_LINK' => sprintf($user->lang['MY_RANK']) . ' &gt;',
'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,

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_BET']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_TABLE']),
'S_DATA_ODDS' => $data_odds, 'S_DATA_ODDS' => $data_odds,
) )
); );

View File

@@ -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,

View File

@@ -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 = '&nbsp;'; $change_differ = '&nbsp;';
} }
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 = '&nbsp;'; $change_differ = '&nbsp;';
} }
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 = '&nbsp;'; $change_differ = '&nbsp;';
} }
@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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),

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;' : sprintf($user->lang['MY_BETS']) . ' &gt;',
'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' => '&lt; ' . 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']) . ' &gt;' : sprintf($user->lang['MY_BETS']) . ' &gt;',
'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' => '&lt; ' . 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']) . ' &gt;' : sprintf($user->lang['MY_BETS']) . ' &gt;',
'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,

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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,

View File

@@ -112,11 +112,11 @@ else
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['team_symbol'] <> '') if ($row['team_symbol'] <> '')
{ {
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"20\" height=\"20\"/>" ;
} }
else else
{ {
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; $logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"20\" height=\"20\"/>" ;
} }
$template->assign_block_vars('side_total', array( $template->assign_block_vars('side_total', array(

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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,

View File

@@ -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' => '&lt; ' . 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']) . ' &gt;',
'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,

View File

@@ -42,17 +42,23 @@ $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)
@@ -60,6 +66,7 @@ $sql = "SELECT
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";
@@ -147,7 +154,8 @@ foreach($points_ary as $group_id => $points)
'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),
) )
); );
} }
@@ -157,27 +165,34 @@ foreach($points_ary as $group_id => $points)
$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";
@@ -241,8 +256,9 @@ while($row = $db->sql_fetchrow($result))
'LOST' => $row['lost'], 'LOST' => $row['lost'],
'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),
) )
); );
} }
@@ -250,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";
@@ -329,8 +351,9 @@ while($row = $db->sql_fetchrow($result))
'LOST' => $row['lost'], 'LOST' => $row['lost'],
'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),
) )
); );
} }
@@ -338,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";
@@ -417,29 +446,34 @@ while($row = $db->sql_fetchrow($result))
'LOST' => $row['lost'], 'LOST' => $row['lost'],
'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' => '&lt; ' . 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']) . ' &gt;',
'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,
) )
); );

View File

@@ -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.6", "version": "0.9.9",
"time": "2016-05-29", "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",

View File

@@ -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')
@@ -904,7 +933,7 @@ class main
// Start matchday list // Start matchday list
if ($side == 'bet') if ($side == 'bet')
{ {
include($this->football_root_path . 'block/side_table.' . $this->php_ext); include($this->football_root_path . 'block/table.' . $this->php_ext);
} }
else else
{ {
@@ -914,12 +943,6 @@ class main
//***************************************************************************** //*****************************************************************************
// Start total list
include($this->football_root_path . 'block/rank_total.' . $this->php_ext);
// End total list
//*****************************************************************************
// Start delivery list // 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
@@ -988,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);
@@ -1000,7 +1027,14 @@ class main
else else
{ {
$mobile = ''; $mobile = '';
include($this->football_root_path . 'block/last_users.' . $this->php_ext); if ($config['football_display_last_users'] > 0)
{
include($this->football_root_path . 'block/last_users.' . $this->php_ext);
}
if ($config['football_display_last_results'] > 0)
{
include($this->football_root_path . 'block/last_results.' . $this->php_ext);
}
} }
// Send data to the template file // Send data to the template file
if ($view == 'print') if ($view == 'print')

View File

@@ -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 ?
@@ -104,13 +105,14 @@ class football_remember extends \phpbb\cron\task\base
} }
$sql = 'SELECT $sql = 'SELECT
m.*, m.*,
l.* l.*
FROM ' . FOOTB_MATCHDAYS . ' AS m FROM ' . FOOTB_MATCHDAYS . ' AS m
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);

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
images/flags/AC Florenz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
images/flags/AC Mailand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/flags/AEK Athen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/flags/AIK Solna.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
images/flags/AS Monaco.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
images/flags/AS Rom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
images/flags/AZ Alkmaar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/flags/Aalborg BK.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
images/flags/Albania.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
images/flags/Algeria.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
images/flags/Andorra.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

BIN
images/flags/Angola.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

BIN
images/flags/Anguilla.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
images/flags/Argentina.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

BIN
images/flags/Armenia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
images/flags/Aruba.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
images/flags/Australia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

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