42 Commits

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

27
.gitignore vendored
View File

@@ -39,3 +39,30 @@ 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
/.buildpath
/.project
/.settings/

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

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

11
.idea/aws.xml generated Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="accountSettings">
<option name="activeRegion" value="us-east-1" />
<option name="recentlyUsedRegions">
<list>
<option value="us-east-1" />
</list>
</option>
</component>
</project>

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

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

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

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

4
.idea/php.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpProjectSharedConfiguration" php_language_level="5.3.0" />
</project>

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

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

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

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

View File

@@ -1,6 +1,6 @@
Follow the phpBB instruction to the convert from 3.0 to 3.1. Follow the phpBB instruction to the convert from 3.0 to 3.1.
Don't remove football MOD permissions, custom profile fields and football tables in database. Don't remove football MOD permissions, custom profile fields and football tables in database.
Please remove recursive the "football MOD Version 0.9.3" ACP Modules in ACP-SYSTEM-MODUL MANAGEMENT. Please remove recursive the "football MOD Version 0.9.3" ACP Modules in ACP-SYSTEM-MODUL MANAGEMENT.
Unzip Football Prediction League extension in folder ext/ Unzip Football Prediction League extension in folder ext/
Activate the Football Prediction League extension in ACP. Activate the Football Prediction League extension in ACP.

View File

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class all_bets_info class all_bets_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\all_bets_module', 'filename' => '\football\football\acp\all_bets_module',
'title' => 'ACP_FOOTBALL_ALL_BETS_MANAGEMENT', 'title' => 'ACP_FOOTBALL_ALL_BETS_MANAGEMENT',
'version' => '0.9.4', 'version' => '0.9.4',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_ALL_BETS_VIEW', 'auth' => 'acl_a_football_editbets', 'cat' => array('ACP_FOOTBALL_ALL_BETS')), 'manage' => array('title' => 'ACP_FOOTBALL_ALL_BETS_VIEW', 'auth' => 'acl_a_football_editbets', 'cat' => array('ACP_FOOTBALL_ALL_BETS')),
), ),
); );
} }
} }

View File

@@ -56,13 +56,13 @@ class all_bets_module
$form_key = 'acp_football_all_bets'; $form_key = 'acp_football_all_bets';
add_form_key($form_key); add_form_key($form_key);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); include_once($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
// Check and set some common vars // Check and set some common vars
$season = $this->request->variable('s', 0); $season = $this->request->variable('s', 0);
$league = $this->request->variable('l', 0); $league = $this->request->variable('l', 0);
$matchday = $this->request->variable('m', 0); $matchday = $this->request->variable('m', 0);
$start = $this->request->variable('start', 0); $start = $this->request->variable('start', 0);
// Grab current season // Grab current season
if (!$season) if (!$season)
@@ -118,11 +118,11 @@ class all_bets_module
$league_options .= '<option value="' . $row['league'] . '"' . $selected . '>' . $row['league_name'] . '</option>'; $league_options .= '<option value="' . $row['league'] . '"' . $selected . '>' . $row['league_name'] . '</option>';
if ($selected <> '') if ($selected <> '')
{ {
$league_matchdays = $row['matchdays']; $league_matchdays = $row['matchdays'];
$matches_matchday = $row['matches_on_matchday']; $matches_matchday = $row['matches_on_matchday'];
$league_name = $row['league_name']; $league_name = $row['league_name'];
$league_type = $row['league_type']; $league_type = $row['league_type'];
$ko_league = ($row['league_type'] == LEAGUE_KO) ? true : false; $ko_league = ($row['league_type'] == LEAGUE_KO) ? true : false;
} }
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@@ -219,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)
@@ -311,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';
@@ -321,9 +320,9 @@ class all_bets_module
$colorstyle_bet = color_style($user_bet['status']); $colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array( $template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest, 'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet, 'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'], 'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
) )
); );
@@ -365,9 +364,9 @@ class all_bets_module
} }
if (0 == $match['hid']) if (0 == $match['hid'])
{ {
$home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']); $home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']);
$home_in_array = explode("#",$home_info); $home_in_array = explode("#",$home_info);
$homename = $home_in_array[3]; $homename = $home_in_array[3];
} }
else else
{ {
@@ -375,9 +374,9 @@ class all_bets_module
} }
if (0 == $match['gid']) if (0 == $match['gid'])
{ {
$guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']); $guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']);
$guest_in_array = explode("#",$guest_info); $guest_in_array = explode("#",$guest_info);
$guestname = $guest_in_array[3]; $guestname = $guest_in_array[3];
} }
else else
{ {
@@ -385,10 +384,10 @@ class all_bets_module
} }
$colorstyle_match = color_style($match['status']); $colorstyle_match = color_style($match['status']);
$template->assign_block_vars('match_panel.match', array( $template->assign_block_vars('match_panel.match', 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,
) )
); );
@@ -419,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';
@@ -429,9 +428,9 @@ class all_bets_module
$colorstyle_bet = color_style($user_bet['status']); $colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array( $template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest, 'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet, 'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'], 'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
) )
); );
@@ -440,8 +439,8 @@ class all_bets_module
$sum_total[$user_bet['username']] += $total; $sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total; $matchday_sum_total += $total;
$template->assign_block_vars('match_panel.user_row.points', array( $template->assign_block_vars('match_panel.user_row.points', array(
'COLOR_STYLE' => $colorstyle_total, 'COLOR_STYLE' => $colorstyle_total,
'POINTS_TOTAL' => $sum_total[$user_bet['username']], 'POINTS_TOTAL' => $sum_total[$user_bet['username']],
) )
); );
$bet_index = 0; $bet_index = 0;
@@ -449,9 +448,9 @@ class all_bets_module
} }
$template->assign_block_vars('match_panel.tendency_footer', array( $template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => true, 'S_TOTAL' => true,
'COLOR_STYLE' => $colorstyle_total, //currently ignored 'COLOR_STYLE' => $colorstyle_total, //currently ignored
'SUMTOTAL' => $matchday_sum_total, 'SUMTOTAL' => $matchday_sum_total,
) )
); );
foreach ($matches_tendency AS $match_tendency) foreach ($matches_tendency AS $match_tendency)
@@ -522,12 +521,12 @@ class all_bets_module
$extra_colorstyle = color_style($row['extra_status']); $extra_colorstyle = color_style($row['extra_status']);
$template->assign_block_vars('extra_panel', array( $template->assign_block_vars('extra_panel', array(
'QUESTION' => $row['question'], 'QUESTION' => $row['question'],
'RESULT' => ($display_type == 1) ? $row['result_team'] : $row['result'], 'RESULT' => ($display_type == 1) ? $row['result_team'] : $row['result'],
'POINTS' => $row['extra_points'], 'POINTS' => $row['extra_points'],
'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
'EVALUATION_TITLE' => $eval_title, 'EVALUATION_TITLE' => $eval_title,
'COLOR_STYLE' => $extra_colorstyle, 'COLOR_STYLE' => $extra_colorstyle,
) )
); );
@@ -565,34 +564,35 @@ class all_bets_module
$template->assign_block_vars('extra_panel.user_row', array( $template->assign_block_vars('extra_panel.user_row', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'USER_NAME' => $user_row['username'], 'USER_NAME' => $user_row['username'],
'BET' => ($display_type == 1) ? $bet_team : $bet, 'BET' => ($display_type == 1) ? $bet_team : $bet,
'BET_POINTS' => $user_row['bet_points'], 'BET_POINTS' => $user_row['bet_points'],
'COLOR_STYLE' => $extra_colorstyle, 'COLOR_STYLE' => $extra_colorstyle,
) )
); );
} }
$db->sql_freeresult($result_bet);
} }
$db->sql_freeresult($result);
$legend = delivery($season, $league, $matchday); $legend = delivery($season, $league, $matchday);
$template->assign_vars(array( $template->assign_vars(array(
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)),
'S_SEASON' => $season, 'S_SEASON' => $season,
'S_LEAGUE' => $league, 'S_LEAGUE' => $league,
'S_MATCHDAY' => $matchday, 'S_MATCHDAY' => $matchday,
'S_SEASON_OPTIONS' => $season_options, 'S_SEASON_OPTIONS' => $season_options,
'S_LEAGUE_OPTIONS' => $league_options, 'S_LEAGUE_OPTIONS' => $league_options,
'S_MATCHDAY_OPTIONS' => $matchday_options, 'S_MATCHDAY_OPTIONS' => $matchday_options,
'S_DISPLAY_ALL_BETS' => true, 'S_DISPLAY_ALL_BETS' => true,
'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,
'S_VERSION_NO' => $this->config['football_version'], 'S_VERSION_NO' => $this->config['football_version'],
'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),
'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

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class bank_info class bank_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\bank_module', 'filename' => '\football\football\acp\bank_module',
'title' => 'ACP_FOOTBALL_BANK_MANAGEMENT', 'title' => 'ACP_FOOTBALL_BANK_MANAGEMENT',
'version' => '0.9.2', 'version' => '0.9.2',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_BANK_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_BANK')), 'manage' => array('title' => 'ACP_FOOTBALL_BANK_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_BANK')),
), ),
); );
} }
} }

View File

@@ -73,7 +73,7 @@ class bank_module
$form_key = 'acp_football_bank'; $form_key = 'acp_football_bank';
add_form_key($form_key); add_form_key($form_key);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); include_once($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addmembers'])) ? 'addmembers' : $this->request->variable('action', '')); $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addmembers'])) ? 'addmembers' : $this->request->variable('action', ''));
@@ -184,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
{ {
@@ -199,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;
@@ -351,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));
@@ -552,7 +555,7 @@ class bank_module
'POINTS' => $this->config['points_name'], 'POINTS' => $this->config['points_name'],
'TARGET' => $target, 'TARGET' => $target,
'ACTUAL' => $actual, 'ACTUAL' => $actual,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bank', 's' => $season, 'l' => $league)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bank', 's' => $season, 'l' => $league)),
'U_ACTION' => $this->u_action . "&amp;s=$season&amp;l=$league", 'U_ACTION' => $this->u_action . "&amp;s=$season&amp;l=$league",
'U_BACK' => $this->u_action. "&amp;s=$season&amp;l=$league", 'U_BACK' => $this->u_action. "&amp;s=$season&amp;l=$league",
) )
@@ -590,7 +593,7 @@ class bank_module
{ {
$template->assign_block_vars('member', array( $template->assign_block_vars('member', array(
'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;action=edit&amp;u={$row['user_id']}"), 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;action=edit&amp;u={$row['user_id']}"),
'U_USER_BANK' => $helper->route('football_main_controller',array('side' => 'bank', 's' => $season, 'l' => $league, 'u' => $row['user_id'])), 'U_USER_BANK' => $helper->route('football_football_controller',array('side' => 'bank', 's' => $season, 'l' => $league, 'u' => $row['user_id'])),
'USERNAME' => $row['username'], 'USERNAME' => $row['username'],
'POINTS' => $functions_points->number_format_points($row['user_points']), 'POINTS' => $functions_points->number_format_points($row['user_points']),
'TARGET' => $functions_points->number_format_points($row['target']), 'TARGET' => $functions_points->number_format_points($row['target']),
@@ -616,7 +619,7 @@ class bank_module
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bank', 's' => $season)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bank', 's' => $season)),
'U_DLOAD_BANK_OPEN' => $helper->route('football_football_download',array('downside' => 'dload_bank_open', 's' => $season)), 'U_DLOAD_BANK_OPEN' => $helper->route('football_football_download',array('downside' => 'dload_bank_open', 's' => $season)),
'S_SEASON' => $season, 'S_SEASON' => $season,
'S_LIST_DEPOSITED' => ($this->config['football_ult_points'] == UP_POINTS) ? false : true, 'S_LIST_DEPOSITED' => ($this->config['football_ult_points'] == UP_POINTS) ? false : true,
@@ -642,7 +645,7 @@ class bank_module
LEFT JOIN ' . FOOTB_POINTS . " AS p ON (p.season = $season AND p.league = l.league) LEFT JOIN ' . FOOTB_POINTS . " AS p ON (p.season = $season AND p.league = l.league)
WHERE l.season = $season WHERE l.season = $season
GROUP BY l.league GROUP BY l.league
ORDER BY league ASC"; ORDER BY l.league ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$rows_leagues = $db->sql_fetchrowset($result); $rows_leagues = $db->sql_fetchrowset($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
@@ -667,5 +670,3 @@ class bank_module
} }
} }
} }
?>

View File

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class bets_info class bets_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\bets_module', 'filename' => '\football\football\acp\bets_module',
'title' => 'ACP_FOOTBALL_BETS_MANAGEMENT', 'title' => 'ACP_FOOTBALL_BETS_MANAGEMENT',
'version' => '0.9.4', 'version' => '0.9.4',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_BETS_MANAGE', 'auth' => 'acl_a_football_editbets', 'cat' => array('ACP_FOOTBALL_BETS')), 'manage' => array('title' => 'ACP_FOOTBALL_BETS_MANAGE', 'auth' => 'acl_a_football_editbets', 'cat' => array('ACP_FOOTBALL_BETS')),
), ),
); );
} }
} }

View File

@@ -66,7 +66,7 @@ class bets_module
$form_key = 'acp_football_bets'; $form_key = 'acp_football_bets';
add_form_key($form_key); add_form_key($form_key);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); include_once($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['bet'])) ? 'bet' : $this->request->variable('action', ''); $action = (isset($_POST['bet'])) ? 'bet' : $this->request->variable('action', '');
@@ -325,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)
@@ -358,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";
@@ -418,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);
@@ -425,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;
} }
@@ -582,7 +586,8 @@ class bets_module
) )
); );
} }
$db->sql_freeresult($result);
// Calculate extra bets of matchday // Calculate extra bets of matchday
// Start select team // Start select team
$sql = 'SELECT $sql = 'SELECT
@@ -728,7 +733,7 @@ class bets_module
$legend = delivery($season, $league, $matchday); $legend = delivery($season, $league, $matchday);
$template->assign_vars(array( $template->assign_vars(array(
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)),
'S_LEGEND' => $legend, 'S_LEGEND' => $legend,
'S_SUCCESS' => (sizeof($success)) ? true : false, 'S_SUCCESS' => (sizeof($success)) ? true : false,
'SUCCESS_MSG' => (sizeof($success)) ? implode('<br />', $success) : '', 'SUCCESS_MSG' => (sizeof($success)) ? implode('<br />', $success) : '',
@@ -748,4 +753,3 @@ class bets_module
); );
} }
} }
?>

View File

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class extra_info class extra_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\extra_module', 'filename' => '\football\football\acp\extra_module',
'title' => 'ACP_FOOTBALL_EXTRA_MANAGEMENT', 'title' => 'ACP_FOOTBALL_EXTRA_MANAGEMENT',
'version' => '0.9.4', 'version' => '0.9.4',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_EXTRA_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_EXTRA')), 'manage' => array('title' => 'ACP_FOOTBALL_EXTRA_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_EXTRA')),
), ),
); );
} }
} }

View File

@@ -56,7 +56,7 @@ class extra_module
$form_key = 'acp_football_extra'; $form_key = 'acp_football_extra';
add_form_key($form_key); add_form_key($form_key);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); include_once($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['remove'])) ? 'remove' : $this->request->variable('action', '')); $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['remove'])) ? 'remove' : $this->request->variable('action', ''));
@@ -151,8 +151,6 @@ class extra_module
$existing_extra = sizeof($extra_row); $existing_extra = sizeof($extra_row);
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
$db->sql_freeresult($result);
// Which page? // Which page?
switch ($action) switch ($action)
@@ -265,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++)
{ {
@@ -417,7 +415,7 @@ class extra_module
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet', 's' => $season, 'l' => $league)),
'S_SEASON' => $season, 'S_SEASON' => $season,
'S_LEAGUE' => $league, 'S_LEAGUE' => $league,
'S_SEASON_OPTIONS' => $season_options, 'S_SEASON_OPTIONS' => $season_options,
@@ -458,4 +456,3 @@ class extra_module
} }
} }
} }
?>

View File

@@ -1,28 +1,28 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class football_info class football_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\football_module', 'filename' => '\football\football\acp\football_module',
'title' => 'ACP_FOOTBALL_MANAGEMENT', 'title' => 'ACP_FOOTBALL_MANAGEMENT',
'version' => '0.9.4', 'version' => '0.9.4',
'modes' => array( 'modes' => array(
'settings' => array('title' => 'ACP_FOOTBALL_SETTINGS', 'auth' => 'acl_a_football_config', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')), 'settings' => array('title' => 'ACP_FOOTBALL_SETTINGS', 'auth' => 'acl_a_football_config', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')),
'features' => array('title' => 'ACP_FOOTBALL_FEATURES', 'auth' => 'acl_a_football_config', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')), 'features' => array('title' => 'ACP_FOOTBALL_FEATURES', 'auth' => 'acl_a_football_config', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')),
'menu' => array('title' => 'ACP_FOOTBALL_MENU', 'auth' => 'acl_a_football_config', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')), 'menu' => array('title' => 'ACP_FOOTBALL_MENU', 'auth' => 'acl_a_football_config', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')),
'userguide' => array('title' => 'ACP_FOOTBALL_USERGUIDE','auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')), 'userguide' => array('title' => 'ACP_FOOTBALL_USERGUIDE','auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_CONFIGURATION')),
), ),
); );
} }
} }

View File

@@ -65,19 +65,19 @@ class football_module
switch ($mode) switch ($mode)
{ {
case 'userguide': case 'userguide':
$this->page_title = 'ACP_FOOTBALL_USERGUIDE'; $this->page_title = 'ACP_FOOTBALL_USERGUIDE';
$this->tpl_name = 'acp_football_userguide'; $this->tpl_name = 'acp_football_userguide';
$template->assign_vars(array( $template->assign_vars(array(
'S_IN_FOOTBALL_USERGUIDE' => true, 'S_IN_FOOTBALL_USERGUIDE' => true,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet')), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet')),
'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'], 'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'],
'ICON_BACK_TO_TOP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" style="vertical-align: middle;" alt="' . $user->lang['BACK_TO_TOP'] . '" title="' . $user->lang['BACK_TO_TOP'] . '" />', 'ICON_BACK_TO_TOP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" style="vertical-align: middle;" alt="' . $user->lang['BACK_TO_TOP'] . '" title="' . $user->lang['BACK_TO_TOP'] . '" />',
'S_VERSION_NO' => $this->config['football_version'], 'S_VERSION_NO' => $this->config['football_version'],
)); ));
// 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] == '--')
{ {
@@ -107,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),
@@ -120,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),
@@ -240,7 +242,7 @@ class football_module
$this->page_title = $display_vars['title']; $this->page_title = $display_vars['title'];
$template->assign_vars(array( $template->assign_vars(array(
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet')), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet')),
'L_TITLE' => $user->lang[$display_vars['title']], 'L_TITLE' => $user->lang[$display_vars['title']],
'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'], 'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'],
'S_ERROR' => (sizeof($error)) ? true : false, 'S_ERROR' => (sizeof($error)) ? true : false,
@@ -362,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 = '')
{ {
@@ -419,6 +421,16 @@ 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

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class ko_info class ko_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\ko_module', 'filename' => '\football\football\acp\ko_module',
'title' => 'ACP_FOOTBALL_KO_MANAGEMENT', 'title' => 'ACP_FOOTBALL_KO_MANAGEMENT',
'version' => '0.9.4', 'version' => '0.9.4',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_KO_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_KO')), 'manage' => array('title' => 'ACP_FOOTBALL_KO_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_KO')),
), ),
); );
} }
} }

View File

@@ -56,7 +56,7 @@ class ko_module
$form_key = 'acp_football_ko'; $form_key = 'acp_football_ko';
add_form_key($form_key); add_form_key($form_key);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); include_once($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['update'])) ? 'update' : $this->request->variable('action', ''); $action = (isset($_POST['update'])) ? 'update' : $this->request->variable('action', '');
@@ -230,7 +230,7 @@ class ko_module
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet', 's' => $season, 'l' => $league)),
'S_ERROR' => (sizeof($error)) ? true : false, 'S_ERROR' => (sizeof($error)) ? true : false,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'S_SUCCESS' => (sizeof($success)) ? true : false, 'S_SUCCESS' => (sizeof($success)) ? true : false,
@@ -252,4 +252,3 @@ class ko_module
); );
} }
} }
?>

View File

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class leagues_info class leagues_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\leagues_module', 'filename' => '\football\football\acp\leagues_module',
'title' => 'ACP_FOOTBALL_LEAGUES_MANAGEMENT', 'title' => 'ACP_FOOTBALL_LEAGUES_MANAGEMENT',
'version' => '0.9.4', 'version' => '0.9.4',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_LEAGUES_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_LEAGUES')), 'manage' => array('title' => 'ACP_FOOTBALL_LEAGUES_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_LEAGUES')),
), ),
); );
} }
} }

View File

@@ -56,7 +56,7 @@ class leagues_module
$form_key = 'acp_football_leagues'; $form_key = 'acp_football_leagues';
add_form_key($form_key); add_form_key($form_key);
include($phpbb_root_path . 'includes/functions_user.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addmembers'])) ? 'addmembers' : $this->request->variable('action', '')); $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addmembers'])) ? 'addmembers' : $this->request->variable('action', ''));
@@ -153,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);
} }
@@ -417,7 +416,7 @@ class leagues_module
break; break;
case 'add': case 'add':
if ($league > 0 AND $league <= 99) if ($league > 0 AND $league <= 101)
{ {
if ($league_info) if ($league_info)
{ {
@@ -495,6 +494,7 @@ class leagues_module
$league_info['join_in_season'] = $this->request->variable('league_join_in_season', $league_info['join_in_season'], true); $league_info['join_in_season'] = $this->request->variable('league_join_in_season', $league_info['join_in_season'], true);
$league_info['bet_in_time'] = $this->request->variable('league_bet_in_time', $league_info['bet_in_time'], true); $league_info['bet_in_time'] = $this->request->variable('league_bet_in_time', $league_info['bet_in_time'], true);
$league_info['rules_post_id'] = $this->request->variable('league_rules_post_id', $league_info['rules_post_id'], true); $league_info['rules_post_id'] = $this->request->variable('league_rules_post_id', $league_info['rules_post_id'], true);
$league_info['bet_type'] = $this->request->variable('bet_type', false);
if (!$league_info['rules_post_id'] and $league_info['join_by_user'] == 1) if (!$league_info['rules_post_id'] and $league_info['join_by_user'] == 1)
{ {
@@ -510,6 +510,15 @@ class leagues_module
{ {
$error[] = $user->lang['CHECK_HITS02_WINS']; $error[] = $user->lang['CHECK_HITS02_WINS'];
} }
if ($league_info['bet_type'] == true)
{
$bet_type = '0';
}
else
{
$bet_type = '1';
}
$matchday_wins = explode(';',$league_info['win_matchday']); $matchday_wins = explode(';',$league_info['win_matchday']);
foreach ($matchday_wins as $matchday_win) foreach ($matchday_wins as $matchday_win)
@@ -556,6 +565,7 @@ class leagues_module
'bet_in_time' => $league_info['bet_in_time'], 'bet_in_time' => $league_info['bet_in_time'],
'rules_post_id' => (is_numeric($league_info['rules_post_id'])) ? $league_info['rules_post_id'] : 0, 'rules_post_id' => (is_numeric($league_info['rules_post_id'])) ? $league_info['rules_post_id'] : 0,
'bet_points' => $league_info['bet_points'], 'bet_points' => $league_info['bet_points'],
'bet_type' => (int) $bet_type,
); );
$data['league'] = $league; $data['league'] = $league;
@@ -565,8 +575,8 @@ class leagues_module
$data['league_matches'] = ($league_info['league_type'] == LEAGUE_KO) ? 0 : $league_info['matches_on_matchday']; $data['league_matches'] = ($league_info['league_type'] == LEAGUE_KO) ? 0 : $league_info['matches_on_matchday'];
$var_ary = array( $var_ary = array(
'league' => array('num', false, 1, 99), 'league' => array('num', false, 1, 101),
'league_name' => array('string', false, 2, 20), 'league_name' => array('string', false, 2, 25),
'league_short' => array('string', false, 1, 3), 'league_short' => array('string', false, 1, 3),
'league_matchdays' => array('num', false, 0, 99), 'league_matchdays' => array('num', false, 0, 99),
'league_matches' => array('num', false, 0, 99), 'league_matches' => array('num', false, 0, 99),
@@ -621,6 +631,15 @@ class leagues_module
// check if matches created // check if matches created
$existing_matches_on_league = count_existing_matches($season, $league, 0); $existing_matches_on_league = count_existing_matches($season, $league, 0);
if ($league_info['bet_type'] == true)
{
$bet_type = '0';
}
else
{
$bet_type = '1';
}
$u_back = $this->u_action . "&amp;s=$season"; $u_back = $this->u_action . "&amp;s=$season";
$template->assign_vars(array( $template->assign_vars(array(
@@ -662,7 +681,8 @@ class leagues_module
'LEAGUE_WIN_MATCHDAYS' => $league_info['win_matchday'], 'LEAGUE_WIN_MATCHDAYS' => $league_info['win_matchday'],
'LEAGUE_WIN_SEASON' => $league_info['win_season'], 'LEAGUE_WIN_SEASON' => $league_info['win_season'],
'POINTS_LAST_YES' => ($league_info['points_last'] == 1) ? ' checked="checked"' : '', 'POINTS_LAST_YES' => ($league_info['points_last'] == 1) ? ' checked="checked"' : '',
'POINTS_LAST_NO' => ($league_info['points_last'] == 0) ? ' checked="checked"' : '', 'POINTS_LAST_NO' => ($league_info['points_last'] == 0) ? ' checked="checked"' : '',
'S_BET_TYPE' => $bet_type,
'U_BACK' => $u_back, 'U_BACK' => $u_back,
'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;s=$season", 'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;s=$season",
) )
@@ -673,7 +693,7 @@ class leagues_module
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet', 's' => $season)),
'S_SEASON' => $season, 'S_SEASON' => $season,
'S_SEASON_OPTIONS' => $season_options, 'S_SEASON_OPTIONS' => $season_options,
'S_LEAGUE_ADD' => true, 'S_LEAGUE_ADD' => true,
@@ -691,8 +711,8 @@ class leagues_module
FROM ' . FOOTB_LEAGUES . ' AS l FROM ' . FOOTB_LEAGUES . ' AS l
LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = l.season AND b.league = l.league) LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = l.season AND b.league = l.league)
WHERE l.season = $season WHERE l.season = $season
GROUP BY league GROUP BY l.league
ORDER BY league ASC"; ORDER BY l.league ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$rows_leagues = $db->sql_fetchrowset($result); $rows_leagues = $db->sql_fetchrowset($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
@@ -731,4 +751,3 @@ class leagues_module
} }
} }
} }
?>

View File

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class matchdays_info class matchdays_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\matchdays_module', 'filename' => '\football\football\acp\matchdays_module',
'title' => 'ACP_FOOTBALL_MATCHDAYS_MANAGEMENT', 'title' => 'ACP_FOOTBALL_MATCHDAYS_MANAGEMENT',
'version' => '0.9.4', 'version' => '0.9.4',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_MATCHDAYS_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_MATCHDAYS')), 'manage' => array('title' => 'ACP_FOOTBALL_MATCHDAYS_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_MATCHDAYS')),
), ),
); );
} }
} }

View File

@@ -56,7 +56,7 @@ class matchdays_module
$form_key = 'acp_football_matchdays'; $form_key = 'acp_football_matchdays';
add_form_key($form_key); add_form_key($form_key);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); include_once($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : ''; $action = (isset($_POST['add'])) ? 'add' : '';
@@ -216,7 +216,7 @@ class matchdays_module
$show_delivery_select = false; $show_delivery_select = false;
$show_delivery = true; $show_delivery = true;
$lang_dates = $user->lang['datetime']; $lang_dates = $user->lang['datetime'];
$sql = "(SELECT md.matchday, $sql = "(SELECT md.matchday AS matchday,
1 AS number, 1 AS number,
md.delivery_date, md.delivery_date,
CASE DATE_FORMAT(md.delivery_date,'%w') CASE DATE_FORMAT(md.delivery_date,'%w')
@@ -251,7 +251,7 @@ class matchdays_module
AND md.league = agg.league AND md.league = agg.league
AND md.matchday = agg.matchday) AND md.matchday = agg.matchday)
UNION UNION
(SELECT md2.matchday, (SELECT md2.matchday AS matchday,
2 AS number, 2 AS number,
md2.delivery_date_2 AS delivery_date, md2.delivery_date_2 AS delivery_date,
CASE DATE_FORMAT(md2.delivery_date_2,'%w') CASE DATE_FORMAT(md2.delivery_date_2,'%w')
@@ -286,7 +286,7 @@ class matchdays_module
AND md2.league = agg2.league AND md2.league = agg2.league
AND md2.matchday = agg2.matchday) AND md2.matchday = agg2.matchday)
UNION UNION
(SELECT md3.matchday, (SELECT md3.matchday AS matchday,
3 AS number, 3 AS number,
md3.delivery_date_3 AS delivery_date, md3.delivery_date_3 AS delivery_date,
CASE DATE_FORMAT(md3.delivery_date_3,'%w') CASE DATE_FORMAT(md3.delivery_date_3,'%w')
@@ -323,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)
{ {
@@ -710,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
@@ -764,6 +765,7 @@ class matchdays_module
// reopen matchday // reopen matchday
$matchday_row['status'] = 0; $matchday_row['status'] = 0;
} }
$db->sql_freeresult($result);
} }
} }
else else
@@ -1088,7 +1090,7 @@ class matchdays_module
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet', 's' => $season, 'l' => $league)),
'S_SEASON' => $season, 'S_SEASON' => $season,
'S_LEAGUE' => $league, 'S_LEAGUE' => $league,
'S_SEASON_OPTIONS' => $season_options, 'S_SEASON_OPTIONS' => $season_options,
@@ -1129,4 +1131,3 @@ class matchdays_module
} }
} }
} }
?>

View File

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class matches_info class matches_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\matches_module', 'filename' => '\football\football\acp\matches_module',
'title' => 'ACP_FOOTBALL_MATCHES_MANAGEMENT', 'title' => 'ACP_FOOTBALL_MATCHES_MANAGEMENT',
'version' => '0.9.4', 'version' => '0.9.4',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_MATCHES_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_MATCHES')), 'manage' => array('title' => 'ACP_FOOTBALL_MATCHES_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_MATCHES')),
), ),
); );
} }
} }

View File

@@ -56,7 +56,7 @@ class matches_module
$form_key = 'acp_football_matches'; $form_key = 'acp_football_matches';
add_form_key($form_key); add_form_key($form_key);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); include_once($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', ''); $action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', '');
@@ -124,12 +124,12 @@ class matches_module
$league_options .= '<option value="' . $row['league'] . '"' . $selected . '>' . $row['league_name'] . '</option>'; $league_options .= '<option value="' . $row['league'] . '"' . $selected . '>' . $row['league_name'] . '</option>';
if ($selected <> '') if ($selected <> '')
{ {
$league_info = $row; $league_info = $row;
$league_matchdays = $row['matchdays']; $league_matchdays = $row['matchdays'];
$matches_matchday = $row['matches_on_matchday']; $matches_matchday = $row['matches_on_matchday'];
$league_name = $row['league_name']; $league_name = $row['league_name'];
$league_type = $row['league_type']; $league_type = $row['league_type'];
$ko_league = ($row['league_type'] == LEAGUE_KO) ? true : false; $ko_league = ($row['league_type'] == LEAGUE_KO) ? true : false;
} }
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@@ -387,18 +387,19 @@ class matches_module
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league&amp;m=$matchday"), E_USER_WARNING); trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league&amp;m=$matchday"), E_USER_WARNING);
} }
$match_row['status'] = utf8_normalize_nfc($this->request->variable('match_status', '', true)); $match_row['status'] = utf8_normalize_nfc($this->request->variable('match_status', '', true));
$match_row['odd_1'] = round($this->request->variable('odd_1', $match_row['odd_1']),2); $match_row['odd_1'] = round($this->request->variable('odd_1', $match_row['odd_1']),2);
$match_row['odd_x'] = round($this->request->variable('odd_x', $match_row['odd_x']),2); $match_row['odd_x'] = round($this->request->variable('odd_x', $match_row['odd_x']),2);
$match_row['odd_2'] = round($this->request->variable('odd_2', $match_row['odd_2']),2); $match_row['odd_2'] = round($this->request->variable('odd_2', $match_row['odd_2']),2);
$match_row['rating'] = round($this->request->variable('rating', $match_row['rating']),2); $match_row['rating'] = round($this->request->variable('rating', $match_row['rating']),2);
$match_row['team_id_home'] = utf8_normalize_nfc($this->request->variable('team_home', '', true)); $match_row['team_id_home'] = utf8_normalize_nfc($this->request->variable('team_home', '', true));
$match_row['team_id_guest'] = utf8_normalize_nfc($this->request->variable('team_guest', '', true)); $match_row['team_id_guest'] = utf8_normalize_nfc($this->request->variable('team_guest', '', true));
$match_row['formula_home'] = utf8_normalize_nfc($this->request->variable('formula_home', '', true)); $match_row['formula_home'] = utf8_normalize_nfc($this->request->variable('formula_home', '', true));
$match_row['formula_guest'] = utf8_normalize_nfc($this->request->variable('formula_guest', '', true)); $match_row['formula_guest'] = utf8_normalize_nfc($this->request->variable('formula_guest', '', true));
$match_row['ko_match'] = $this->request->variable('match_ko', false); $match_row['ko_match'] = $this->request->variable('match_ko', false);
$match_row['group_id'] = ($this->request->variable('group_match', false)) ? utf8_normalize_nfc($this->request->variable('match_group', '', true)) : ''; $match_row['group_id'] = ($this->request->variable('group_match', false)) ? utf8_normalize_nfc($this->request->variable('match_group', '', true)) : '';
$match_row['show_table'] = $this->request->variable('show_table', false);
if ($match_row['team_id_home'] <> '') if ($match_row['team_id_home'] <> '')
{ {
$team_arr = explode(';', $match_row['team_id_home']); $team_arr = explode(';', $match_row['team_id_home']);
@@ -413,7 +414,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
@@ -627,7 +628,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(
@@ -717,7 +718,7 @@ class matches_module
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)),
'S_SEASON' => $season, 'S_SEASON' => $season,
'S_LEAGUE' => $league, 'S_LEAGUE' => $league,
'S_KO_LEAGUE' => $ko_league, 'S_KO_LEAGUE' => $ko_league,
@@ -761,5 +762,3 @@ class matches_module
} }
} }
} }
?>

View File

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class results_info class results_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\results_module', 'filename' => '\football\football\acp\results_module',
'title' => 'ACP_FOOTBALL_RESULTS_MANAGEMENT', 'title' => 'ACP_FOOTBALL_RESULTS_MANAGEMENT',
'version' => '1.0.0', 'version' => '1.0.0',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_RESULTS_MANAGE', 'auth' => 'acl_a_football_results', 'cat' => array('ACP_FOOTBALL_RESULTS')), 'manage' => array('title' => 'ACP_FOOTBALL_RESULTS_MANAGE', 'auth' => 'acl_a_football_results', 'cat' => array('ACP_FOOTBALL_RESULTS')),
), ),
); );
} }
} }

View File

@@ -60,7 +60,7 @@ class results_module
$form_key = 'acp_football_results'; $form_key = 'acp_football_results';
add_form_key($form_key); add_form_key($form_key);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); include_once($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['edit'])) ? 'edit' : $this->request->variable('action', ''); $action = (isset($_POST['edit'])) ? 'edit' : $this->request->variable('action', '');
@@ -192,7 +192,7 @@ class results_module
{ {
trigger_error(sprintf($user->lang['NO_MATCHDAY'], $league_info['league_name'], $season) . adm_back_link($this->u_action . "&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)
@@ -382,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);
@@ -442,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)
@@ -768,6 +772,7 @@ class results_module
); );
} }
} }
$db->sql_freeresult($result);
switch ($league_info['bet_ko_type']) switch ($league_info['bet_ko_type'])
{ {
@@ -791,7 +796,7 @@ class results_module
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday)),
'S_LEGEND' => $legend, 'S_LEGEND' => $legend,
'S_SUCCESS' => (sizeof($success)) ? true : false, 'S_SUCCESS' => (sizeof($success)) ? true : false,
'SUCCESS_MSG' => (sizeof($success)) ? implode('<br />', $success) : '', 'SUCCESS_MSG' => (sizeof($success)) ? implode('<br />', $success) : '',
@@ -813,5 +818,3 @@ class results_module
); );
} }
} }
?>

View File

@@ -56,7 +56,7 @@ class seasons_module
$form_key = 'acp_football_seasons'; $form_key = 'acp_football_seasons';
add_form_key($form_key); add_form_key($form_key);
include($phpbb_root_path . 'includes/functions_user.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', ''); $action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', '');
@@ -335,6 +335,7 @@ class seasons_module
'SEASON_SHORT' => $season_row['season_name_short'], 'SEASON_SHORT' => $season_row['season_name_short'],
'U_BACK' => $u_back, 'U_BACK' => $u_back,
'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;s=$season", 'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;s=$season",
'S_VERSION_NO' => $this->config['football_version'],
) )
); );
return; return;
@@ -343,7 +344,7 @@ class seasons_module
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet')), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet')),
'S_SEASON_ADD' => true, 'S_SEASON_ADD' => true,
) )
); );
@@ -356,8 +357,8 @@ class seasons_module
COUNT(l.league) AS leagues COUNT(l.league) AS leagues
FROM ' . FOOTB_SEASONS . ' s FROM ' . FOOTB_SEASONS . ' s
LEFT JOIN ' . FOOTB_LEAGUES . ' l on l.season = s.season LEFT JOIN ' . FOOTB_LEAGUES . ' l on l.season = s.season
GROUP BY season GROUP BY s.season
ORDER BY season DESC'; ORDER BY s.season DESC';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$rows_seasons = $db->sql_fetchrowset($result); $rows_seasons = $db->sql_fetchrowset($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
@@ -390,5 +391,3 @@ class seasons_module
} }
} }
} }
?>

View File

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class teams_info class teams_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\teams_module', 'filename' => '\football\football\acp\teams_module',
'title' => 'ACP_FOOTBALL_TEAMS_MANAGEMENT', 'title' => 'ACP_FOOTBALL_TEAMS_MANAGEMENT',
'version' => '0.9.4', 'version' => '0.9.4',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_TEAMS_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_TEAMS')), 'manage' => array('title' => 'ACP_FOOTBALL_TEAMS_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_TEAMS')),
), ),
); );
} }
} }

View File

@@ -56,7 +56,7 @@ class teams_module
$form_key = 'acp_football_teams'; $form_key = 'acp_football_teams';
add_form_key($form_key); add_form_key($form_key);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); include_once($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', ''); $action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', '');
@@ -177,7 +177,7 @@ class teams_module
$folder = $this->ext_football_path . 'images/flags/'; $folder = $this->ext_football_path . 'images/flags/';
$directory = opendir($folder); $directory = opendir($folder);
$files = array(); $files = array();
while($file = readdir($directory)) while($file = readdir($directory))
{ {
if( !(bool) preg_match('/.+\.(?:jpe?g|gif|png)$/i', $file) ) if( !(bool) preg_match('/.+\.(?:jpe?g|gif|png)$/i', $file) )
{ {
@@ -309,7 +309,7 @@ class teams_module
$folder = $this->ext_football_path . 'images/flags/'; $folder = $this->ext_football_path . 'images/flags/';
$directory = opendir($folder); $directory = opendir($folder);
$files = array(); $files = array();
while($file = readdir($directory)) while($file = readdir($directory))
{ {
if( !(bool) preg_match('/.+\.(?:jpe?g|gif|png)$/i', $file) ) if( !(bool) preg_match('/.+\.(?:jpe?g|gif|png)$/i', $file) )
{ {
@@ -589,7 +589,7 @@ class teams_module
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet', 's' => $season, 'l' => $league)),
'S_SEASON' => $season, 'S_SEASON' => $season,
'S_LEAGUE' => $league, 'S_LEAGUE' => $league,
'S_KO_LEAGUE' => $ko_league, 'S_KO_LEAGUE' => $ko_league,
@@ -597,6 +597,7 @@ class teams_module
'S_LEAGUE_OPTIONS' => $league_options, 'S_LEAGUE_OPTIONS' => $league_options,
'S_TEAM_OPTIONS' => $team_options, 'S_TEAM_OPTIONS' => $team_options,
'S_TEAM_ADD' => true, 'S_TEAM_ADD' => true,
'S_VERSION_NO' => $this->config['football_version'],
) )
); );
@@ -609,7 +610,7 @@ class teams_module
WHERE t.season = $season WHERE t.season = $season
AND t.league = $league AND t.league = $league
GROUP BY t.team_id GROUP BY t.team_id
ORDER BY team_id ASC"; ORDER BY t.team_id ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$rows_teams = $db->sql_fetchrowset($result); $rows_teams = $db->sql_fetchrowset($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
@@ -654,4 +655,3 @@ class teams_module
); );
} }
} }
?>

View File

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace football\football\acp; namespace football\football\acp;
class update_info class update_info
{ {
function module() function module()
{ {
return array( return array(
'filename' => '\football\football\acp\update_module', 'filename' => '\football\football\acp\update_module',
'title' => 'ACP_FOOTBALL_UPDATE_MANAGEMENT', 'title' => 'ACP_FOOTBALL_UPDATE_MANAGEMENT',
'version' => '0.9.4', 'version' => '0.9.4',
'modes' => array( 'modes' => array(
'manage' => array('title' => 'ACP_FOOTBALL_UPDATE_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_UPDATE')), 'manage' => array('title' => 'ACP_FOOTBALL_UPDATE_MANAGE', 'auth' => 'acl_a_football_plan', 'cat' => array('ACP_FOOTBALL_UPDATE')),
), ),
); );
} }
} }

View File

@@ -107,7 +107,7 @@ class update_module
$form_key = 'acp_football_update'; $form_key = 'acp_football_update';
add_form_key($form_key); add_form_key($form_key);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); include_once($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
// Check and set some common vars // Check and set some common vars
$action = (isset($_POST['load_xml_season'])) ? 'load_xml_season' : ''; $action = (isset($_POST['load_xml_season'])) ? 'load_xml_season' : '';
@@ -131,7 +131,7 @@ class update_module
$insert_season = $this->request->variable('insert_season', false); $insert_season = $this->request->variable('insert_season', false);
$insert_league = $this->request->variable('insert_league', false); $insert_league = $this->request->variable('insert_league', false);
$list = $this->request->variable('list', false); $list = $this->request->variable('list', false);
$this->xml_ary = unserialize(urldecode($this->request->variable('xml_ary', ''))); $this->xml_ary = json_decode(urldecode($this->request->variable('xml_ary', '')),true);
$display_team_mapping = false; $display_team_mapping = false;
// Clear some vars // Clear some vars
$error = array(); $error = array();
@@ -397,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 . "
@@ -414,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))
{ {
@@ -547,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)
@@ -591,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)
@@ -635,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)
@@ -662,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
( (
@@ -725,7 +730,7 @@ class update_module
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'U_CHOOSE_ACTION' => $this->u_action . "&amp;action=choose", 'U_CHOOSE_ACTION' => $this->u_action . "&amp;action=choose",
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), 'U_FOOTBALL' => $helper->route('football_football_controller',array('side' => 'bet', 's' => $season, 'l' => $league)),
'S_ERROR' => (sizeof($error)) ? true : false, 'S_ERROR' => (sizeof($error)) ? true : false,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'S_SUCCESS' => (sizeof($success)) ? true : false, 'S_SUCCESS' => (sizeof($success)) ? true : false,
@@ -745,7 +750,7 @@ class update_module
'DO_MATCHES' => ($insert_league) ? sprintf($user->lang['INSERT_MATCHES']) : sprintf($user->lang['UPDATE_MATCHES']), 'DO_MATCHES' => ($insert_league) ? sprintf($user->lang['INSERT_MATCHES']) : sprintf($user->lang['UPDATE_MATCHES']),
'XML_SEASON_URL' => $xml_season_url, 'XML_SEASON_URL' => $xml_season_url,
'XML_LEAGUE_URL' => $xml_league_url, 'XML_LEAGUE_URL' => $xml_league_url,
'XML_ARY' => (sizeof($this->xml_ary)) ? urlencode(serialize($this->xml_ary)) : '', 'XML_ARY' => (is_array($this->xml_ary) && sizeof($this->xml_ary)) ? urlencode(json_encode($this->xml_ary)) : '',
'S_XSEASON_OPTIONS' => $xseason_options, 'S_XSEASON_OPTIONS' => $xseason_options,
'S_XLEAGUE_OPTIONS' => $xleague_options, 'S_XLEAGUE_OPTIONS' => $xleague_options,
'S_XSEASON' => $xseason, 'S_XSEASON' => $xseason,
@@ -846,7 +851,7 @@ class update_module
{ {
$this->xml_ary['footb_teams'][$key]['team_id'] = $team_id_map_ary[$xml_team['team_id']]; $this->xml_ary['footb_teams'][$key]['team_id'] = $team_id_map_ary[$xml_team['team_id']];
} }
usort($this->xml_ary['footb_teams'], 'sort_teams'); usort($this->xml_ary['footb_teams'], array($this, 'sort_teams'));
foreach ($this->xml_ary['footb_matches'] AS $key => $xml_team) foreach ($this->xml_ary['footb_matches'] AS $key => $xml_team)
{ {
@@ -1139,7 +1144,7 @@ class update_module
{ {
if (sizeof($table_row)) if (sizeof($table_row))
{ {
$tpl .= '<input type="hidden" name="row_' . $id . '" value="' . urlencode(serialize($diff)) . '" />'; $tpl .= '<input type="hidden" name="row_' . $id . '" value="' . urlencode(json_encode($diff)) . '" />';
// match status update and database // match status update and database
if (substr($id, 0, 13) == 'FOOTB_MATCHES') if (substr($id, 0, 13) == 'FOOTB_MATCHES')
{ {
@@ -1155,7 +1160,7 @@ class update_module
else else
{ {
// Insert team // Insert team
$tpl .= '<input type="hidden" name="' . $id . '[]" value="' . urlencode(serialize($diff)) . '" />'; $tpl .= '<input type="hidden" name="' . $id . '[]" value="' . urlencode(json_encode($diff)) . '" />';
} }
} }
@@ -1166,7 +1171,7 @@ class update_module
{ {
if (sizeof($table_row)) if (sizeof($table_row))
{ {
$color_open = '<span title= "' . sprintf($user->lang['CURRENT_VALUE']) . ': ' . htmlspecialchars($table_row[$key], ENT_COMPAT, 'UTF-8') . '" style="color: red;">* '; $color_open = '<span title= "' . sprintf($user->lang['CURRENT_VALUE']) . ': ' . utf8_htmlspecialchars($table_row[$key]) . '" style="color: red;">* ';
$color_close = '</span>'; $color_close = '</span>';
} }
else else
@@ -1183,8 +1188,8 @@ class update_module
if (sizeof($order)) if (sizeof($order))
{ {
$value = (substr($key, 0, 7) == 'team_id') ? $value . ' ' . $this->team_ary[$value] : $value; $value = (substr($key, 0, 7) == 'team_id') ? $value . ' ' . $this->team_ary[$value] : $value;
$tpl_ary[$order[$key]] = ($order[$key] % 2) ? $color_open . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . $color_close . '&nbsp;</td>' : $tpl_ary[$order[$key]] = ($order[$key] % 2) ? $color_open . utf8_htmlspecialchars($value) . $color_close . '&nbsp;</td>' :
'<td>' . $color_open . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . $color_close . '<br />'; '<td>' . $color_open . utf8_htmlspecialchars($value) . $color_close . '<br />';
} }
else else
{ {
@@ -1193,14 +1198,14 @@ class update_module
// Write table fields // Write table fields
if (sizeof($table_row)) if (sizeof($table_row))
{ {
$tpl .= '<td title= "' . htmlspecialchars($table_row[$key], ENT_COMPAT, 'UTF-8') . '">' . $tpl .= '<td title= "' . utf8_htmlspecialchars($table_row[$key]) . '">' .
$color_open . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . $color_close . $color_open . utf8_htmlspecialchars($value) . $color_close .
'</td>'; '</td>';
} }
else else
{ {
$tpl .= '<td title= "' . sprintf($user->lang['NEW_TEAM']) . '">' . $tpl .= '<td title= "' . sprintf($user->lang['NEW_TEAM']) . '">' .
$color_open . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . $color_close . $color_open . utf8_htmlspecialchars($value) . $color_close .
'</td>'; '</td>';
} }
} }
@@ -1240,15 +1245,15 @@ class update_module
if (sizeof($order)) if (sizeof($order))
{ {
$value = (substr($key, 0, 7) == 'team_id') ? $value . ' ' . $this->team_ary[$value] : $value; $value = (substr($key, 0, 7) == 'team_id') ? $value . ' ' . $this->team_ary[$value] : $value;
$tpl_ary[$order[$key]] = ($order[$key] % 2) ? htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '&nbsp;</td>' : $tpl_ary[$order[$key]] = ($order[$key] % 2) ? utf8_htmlspecialchars($value) . '&nbsp;</td>' :
'<td>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '<br />'; '<td>' . utf8_htmlspecialchars($value) . '<br />';
} }
else else
{ {
if ($key <> 'season' and $key <> 'league') if ($key <> 'season' and $key <> 'league')
{ {
// Write XML-table fields // Write XML-table fields
$tpl .= '<td>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</td>'; $tpl .= '<td>' . utf8_htmlspecialchars($value) . '</td>';
} }
} }
} }
@@ -1317,7 +1322,7 @@ class update_module
if ($this->request->variable($table . '_' . $row['index_field'], false)) if ($this->request->variable($table . '_' . $row['index_field'], false))
{ {
$diff_ary = unserialize(urldecode($this->request->variable('row_' . $table . '_' . $row['index_field'], ''))); $diff_ary = json_decode(urldecode($this->request->variable('row_' . $table . '_' . $row['index_field'], '')),true);
$sql_ary = array_intersect_ukey($diff_ary, $selected_fields, 'self::key_compare_func'); $sql_ary = array_intersect_ukey($diff_ary, $selected_fields, 'self::key_compare_func');
if ($table == 'FOOTB_MATCHES') if ($table == 'FOOTB_MATCHES')
{ {
@@ -1382,6 +1387,7 @@ class update_module
} }
} }
} }
$db->sql_freeresult($result);
return $count_updates; return $count_updates;
} }
@@ -1401,7 +1407,7 @@ class update_module
} }
foreach ($insert_ary AS $insert) foreach ($insert_ary AS $insert)
{ {
$sql_ary = unserialize(urldecode($insert)); $sql_ary = json_decode(urldecode($insert),true);
$sql = 'INSERT INTO ' . $table_name . ' ' . $db->sql_build_array('INSERT', $sql_ary); $sql = 'INSERT INTO ' . $table_name . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql); $db->sql_query($sql);
if ($db->sql_affectedrows()) if ($db->sql_affectedrows())
@@ -1455,4 +1461,3 @@ class update_module
return $selected_fields; return $selected_fields;
} }
} }
?>

View File

@@ -1,65 +1,65 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_TITLE}</h1> <h1>{L_TITLE}</h1>
<p>{L_TITLE_EXPLAIN}</p> <p>{L_TITLE_EXPLAIN}</p>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- BEGIN mods --> <!-- BEGIN mods -->
<fieldset> <fieldset>
<legend>{L_FOOTBALL_VERSION_CHECK}</legend> <legend>{L_FOOTBALL_VERSION_CHECK}</legend>
<p style="font-weight: bold; color: <!-- IF mods.S_UP_TO_DATE -->#228822<!-- ELSE -->#BC2A4D<!-- ENDIF -->;">{mods.UP_TO_DATE}</p> <p style="font-weight: bold; color: <!-- IF mods.S_UP_TO_DATE -->#228822<!-- ELSE -->#BC2A4D<!-- ENDIF -->;">{mods.UP_TO_DATE}</p>
<dl> <dl>
<dt><label>{L_CURRENT_VERSION}</label></dt> <dt><label>{L_CURRENT_VERSION}</label></dt>
<dd><strong>{mods.CURRENT_VERSION}</strong></dd> <dd><strong>{mods.CURRENT_VERSION}</strong></dd>
</dl> </dl>
<dl> <dl>
<dt><label>{L_LATEST_VERSION}</label></dt> <dt><label>{L_LATEST_VERSION}</label></dt>
<dd><strong>{mods.LATEST_VERSION}</strong></dd> <dd><strong>{mods.LATEST_VERSION}</strong></dd>
</dl> </dl>
<!-- IF not mods.S_UP_TO_DATE --> <!-- IF not mods.S_UP_TO_DATE -->
<dl> <dl>
<dt><label>{L_DOWNLOAD_LATEST}</label></dt> <dt><label>{L_DOWNLOAD_LATEST}</label></dt>
<dd><strong><a href="{mods.DOWNLOAD}">{L_DOWNLOAD} {mods.TITLE} {mods.LATEST_VERSION}</a></strong></dd> <dd><strong><a href="{mods.DOWNLOAD}">{L_DOWNLOAD} {mods.TITLE} {mods.LATEST_VERSION}</a></strong></dd>
</dl> </dl>
<dl> <dl>
<dt><label>{L_ANNOUNCEMENT_TOPIC}</label></dt> <dt><label>{L_ANNOUNCEMENT_TOPIC}</label></dt>
<dd><strong><a href="{mods.ANNOUNCEMENT}">{L_RELEASE_ANNOUNCEMENT}</a></strong></dd> <dd><strong><a href="{mods.ANNOUNCEMENT}">{L_RELEASE_ANNOUNCEMENT}</a></strong></dd>
</dl> </dl>
<!-- ENDIF --> <!-- ENDIF -->
</fieldset> </fieldset>
<!-- END mods --> <!-- END mods -->
<form id="acp_football" method="post" action="{U_ACTION}"> <form id="acp_football" method="post" action="{U_ACTION}">
<!-- BEGIN options --> <!-- BEGIN options -->
<!-- IF options.S_LEGEND --> <!-- IF options.S_LEGEND -->
<!-- IF not options.S_FIRST_ROW --> <!-- IF not options.S_FIRST_ROW -->
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->
<fieldset> <fieldset>
<legend>{options.LEGEND}</legend> <legend>{options.LEGEND}</legend>
<!-- ELSE --> <!-- ELSE -->
<dl> <dl>
<dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
<dd>{options.CONTENT}</dd> <dd>{options.CONTENT}</dd>
</dl> </dl>
<!-- ENDIF --> <!-- ENDIF -->
<!-- END options --> <!-- END options -->
<p class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p> </p>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,151 +1,151 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_ACP_FOOTBALL_ALL_BETS_VIEW}</h1> <h1>{L_ACP_FOOTBALL_ALL_BETS_VIEW}</h1>
<p>{L_ACP_FOOTBALL_ALL_BETS_VIEW_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_ALL_BETS_VIEW_EXPLAIN}</p>
<h1 style="display:inline;">{L_SELECT_MATCHDAY}:</h1> <h1 style="display:inline;">{L_SELECT_MATCHDAY}:</h1>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<select name="s" id="match_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select> <select name="s" id="match_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<select name="l" id="match_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select> <select name="l" id="match_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<select name="m" id="match_matchday" onchange="this.form.submit();">{S_MATCHDAY_OPTIONS}</select> <select name="m" id="match_matchday" onchange="this.form.submit();">{S_MATCHDAY_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<fieldset> <fieldset>
<legend>{S_LEGEND}</legend> <legend>{S_LEGEND}</legend>
<!-- IF .pagination --> <!-- IF .pagination -->
<div class="pagination top-pagination"> <div class="pagination top-pagination">
<!-- INCLUDE pagination.html --> <!-- INCLUDE pagination.html -->
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF .match_panel --> <!-- IF .match_panel -->
<!-- BEGIN match_panel --> <!-- BEGIN match_panel -->
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th style="text-align: right;"><br/></th> <th style="text-align: right;"><br/></th>
<!-- BEGIN match --> <!-- BEGIN match -->
<th colspan="2">{match_panel.match.HOME_NAME}-<br />{match_panel.match.GUEST_NAME}</th> <th colspan="2">{match_panel.match.HOME_NAME}-<br />{match_panel.match.GUEST_NAME}</th>
<!-- END match --> <!-- END match -->
<!-- IF match_panel.S_TOTAL --> <!-- IF match_panel.S_TOTAL -->
<th style="text-align: center;"></th> <th style="text-align: center;"></th>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
<tr class="row_result"> <tr class="row_result">
<td title="{L_RESULT_EXPLAIN}" style="text-align: right;"><b>{L_RESULT}</b></td> <td title="{L_RESULT_EXPLAIN}" style="text-align: right;"><b>{L_RESULT}</b></td>
<!-- BEGIN match --> <!-- BEGIN match -->
<td class="td_result {match_panel.match.COLOR_STYLE}">{match_panel.match.RESULT}</td> <td class="td_result {match_panel.match.COLOR_STYLE}">{match_panel.match.RESULT}</td>
<td class="td_pts"></td> <td class="td_pts"></td>
<!-- END match --> <!-- END match -->
<!-- IF match_panel.S_TOTAL --> <!-- IF match_panel.S_TOTAL -->
<td title="{L_TOTAL_EXPLAIN}" style="text-align: center;"><b>{L_TOTAL}</b></td> <td title="{L_TOTAL_EXPLAIN}" style="text-align: center;"><b>{L_TOTAL}</b></td>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
</thead> </thead>
<!-- BEGIN tendency_footer --> <!-- BEGIN tendency_footer -->
<tfoot> <tfoot>
<tr> <tr>
<td class="td_tendency" style="text-align: right;" title="{L_TEND_TEXT}">{L_TENDENCY}</td> <td class="td_tendency" style="text-align: right;" title="{L_TEND_TEXT}">{L_TENDENCY}</td>
<!-- BEGIN tendency --> <!-- BEGIN tendency -->
<td class="td_tendency" colspan="2"> <td class="td_tendency" colspan="2">
<dfn style="display: none;">{match_panel.tendency_footer.tendency.MATCH_ENTRY}</dfn> <dfn style="display: none;">{match_panel.tendency_footer.tendency.MATCH_ENTRY}</dfn>
{match_panel.tendency_footer.tendency.TENDENCY} {match_panel.tendency_footer.tendency.TENDENCY}
</td> </td>
<!-- END tendency --> <!-- END tendency -->
<!-- IF match_panel.tendency_footer.S_TOTAL --> <!-- IF match_panel.tendency_footer.S_TOTAL -->
<td class="td_pts_total" title="{L_POINTS_TOTAL}"> <td class="td_pts_total" title="{L_POINTS_TOTAL}">
<dfn style="display: none;">{L_POINTS_TOTAL}</dfn> <dfn style="display: none;">{L_POINTS_TOTAL}</dfn>
{match_panel.tendency_footer.SUMTOTAL} {match_panel.tendency_footer.SUMTOTAL}
</td> </td>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
</tfoot> </tfoot>
<!-- END tendency_footer --> <!-- END tendency_footer -->
<tbody> <tbody>
<!-- BEGIN user_row --> <!-- BEGIN user_row -->
<tr class="{match_panel.user_row.ROW_CLASS}"> <tr class="{match_panel.user_row.ROW_CLASS}">
<td class="td_name">{match_panel.user_row.USER_NAME}</td> <td class="td_name">{match_panel.user_row.USER_NAME}</td>
<!-- BEGIN bet --> <!-- BEGIN bet -->
<td class="td_result">{match_panel.user_row.bet.BET}</td> <td class="td_result">{match_panel.user_row.bet.BET}</td>
<td class="{match_panel.bet.COLOR_STYLE}">{match_panel.user_row.bet.POINTS}</td> <td class="{match_panel.bet.COLOR_STYLE}">{match_panel.user_row.bet.POINTS}</td>
<!-- END bet --> <!-- END bet -->
<!-- BEGIN points --> <!-- BEGIN points -->
<td class="td_pts_total {match_panel.points.COLOR_STYLE}">{match_panel.user_row.points.POINTS_TOTAL}</td> <td class="td_pts_total {match_panel.points.COLOR_STYLE}">{match_panel.user_row.points.POINTS_TOTAL}</td>
<!-- END points --> <!-- END points -->
</tr> </tr>
<!-- END user_row --> <!-- END user_row -->
</tbody> </tbody>
</table> </table>
<!-- END match_panel --> <!-- END match_panel -->
<!-- BEGIN extra_panel --> <!-- BEGIN extra_panel -->
<br /> <br />
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th style="text-align:left;">{L_EXTRA_BET}</th> <th style="text-align:left;">{L_EXTRA_BET}</th>
<th style="width:70%; text-align:left;">{extra_panel.QUESTION}</th> <th style="width:70%; text-align:left;">{extra_panel.QUESTION}</th>
<th>{L_EVALUATION}</th> <th>{L_EVALUATION}</th>
<th>{L_POINTS}</th> <th>{L_POINTS}</th>
</tr> </tr>
<tr class="row_result"> <tr class="row_result">
<td><b>{L_RESULT}</b></td> <td><b>{L_RESULT}</b></td>
<td style="text-align:left;" class="{extra_panel.COLOR_STYLE}">{extra_panel.RESULT}</td> <td style="text-align:left;" class="{extra_panel.COLOR_STYLE}">{extra_panel.RESULT}</td>
<td style="text-align:center;">{extra_panel.EVALUATION}</td> <td style="text-align:center;">{extra_panel.EVALUATION}</td>
<td style="text-align:center;" title="{extra_panel.EVALUATION_TITLE}">{extra_panel.POINTS}</td> <td style="text-align:center;" title="{extra_panel.EVALUATION_TITLE}">{extra_panel.POINTS}</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN user_row --> <!-- BEGIN user_row -->
<tr class="{extra_panel.user_row.ROW_CLASS}"> <tr class="{extra_panel.user_row.ROW_CLASS}">
<td class="td_name">{extra_panel.user_row.USER_NAME}</td> <td class="td_name">{extra_panel.user_row.USER_NAME}</td>
<td style="text-align:left;">{extra_panel.user_row.BET}</td> <td style="text-align:left;">{extra_panel.user_row.BET}</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td style="text-align:center;" class="{extra_panel.bet.COLOR_STYLE}">{extra_panel.user_row.POINTS}</td> <td style="text-align:center;" class="{extra_panel.bet.COLOR_STYLE}">{extra_panel.user_row.POINTS}</td>
</tr> </tr>
<!-- END user_row --> <!-- END user_row -->
</tbody> </tbody>
</table> </table>
<!-- IF S_VIEW == 'print' --> <!-- IF S_VIEW == 'print' -->
<br /> <br />
<!-- ENDIF --> <!-- ENDIF -->
<!-- END extra_panel --> <!-- END extra_panel -->
<!-- IF .pagination or TOTAL_USERS --> <!-- IF .pagination or TOTAL_USERS -->
<div class="pagination"> <div class="pagination">
{TOTAL_USERS} {TOTAL_USERS}
<!-- IF .pagination --> <!-- IF .pagination -->
<!-- INCLUDE pagination.html --> <!-- INCLUDE pagination.html -->
<!-- ELSE --> <!-- ELSE -->
&bull; {PAGE_NUMBER} &bull; {PAGE_NUMBER}
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- ELSE --> <!-- ELSE -->
<br /> <br />
<div class="message">{L_NO_MATCHES_ON_MATCHDAY}</div> <div class="message">{L_NO_MATCHES_ON_MATCHDAY}</div>
<br /> <br />
<!-- ENDIF --> <!-- ENDIF -->
</fieldset> </fieldset>
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,160 +1,160 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF S_LIST --> <!-- IF S_LIST -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a> <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
<h1>{PAGE_TYPE} :: {LEAGUE_NAME}</h1> <h1>{PAGE_TYPE} :: {LEAGUE_NAME}</h1>
<p>{PAGE_TYPE_EXPLAIN}</p> <p>{PAGE_TYPE_EXPLAIN}</p>
<form id="list" method="post" action="{U_ACTION}"> <form id="list" method="post" action="{U_ACTION}">
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="setvalues('list', 'newvalue', 'curvalue', {BET_POINTS}); return false;">{L_SET_DEPOSITS}</a> &bull; <a href="#" onclick="setvalues('list', 'newvalue', 'curvalue', {BET_POINTS}); return false;">{L_SET_DEPOSITS}</a> &bull;
<a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></p> <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>
<!-- IF .pagination --> <!-- IF .pagination -->
<div class="pagination top-pagination"> <div class="pagination top-pagination">
<!-- INCLUDE pagination.html --> <!-- INCLUDE pagination.html -->
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_USERNAME}</th> <th>{L_USERNAME}</th>
<!-- IF POINTS --> <!-- IF POINTS -->
<th>{POINTS}</th> <th>{POINTS}</th>
<!-- ENDIF --> <!-- ENDIF -->
<th>{TARGET}</th> <th>{TARGET}</th>
<th>{ACTUAL}</th> <th>{ACTUAL}</th>
<th>{L_BOOK}</th> <th>{L_BOOK}</th>
<th>{L_MARK}</th> <th>{L_MARK}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN member --> <!-- BEGIN member -->
<!-- IF member.S_ROW_COUNT is even --><tr class="bg1 row_light"><!-- ELSE --><tr class="bg2 row_dark"><!-- ENDIF --> <!-- IF member.S_ROW_COUNT is even --><tr class="bg1 row_light"><!-- ELSE --><tr class="bg2 row_dark"><!-- ENDIF -->
<td><a href="{member.U_USER_BANK}">{member.USERNAME}</a></td> <td><a href="{member.U_USER_BANK}">{member.USERNAME}</a></td>
<!-- IF POINTS --> <!-- IF POINTS -->
<td style="text-align: right;">{member.POINTS}</td> <td style="text-align: right;">{member.POINTS}</td>
<!-- ENDIF --> <!-- ENDIF -->
<td style="text-align: right;">{member.TARGET}</td> <td style="text-align: right;">{member.TARGET}</td>
<td style="text-align: right;">{member.ACTUAL}<input type="hidden" name="curvalue{member.USER_ID}" id="curvalue{member.USER_ID}" value="{member.ACTUAL}" /></td> <td style="text-align: right;">{member.ACTUAL}<input type="hidden" name="curvalue{member.USER_ID}" id="curvalue{member.USER_ID}" value="{member.ACTUAL}" /></td>
<td style="text-align: right;"><input type="text" name="newvalue{member.USER_ID}" value="{member.NEW_VALUE}" <td style="text-align: right;"><input type="text" name="newvalue{member.USER_ID}" value="{member.NEW_VALUE}"
onchange="document.getElementById('select_{member.USER_ID}').checked = true;" /></td> onchange="document.getElementById('select_{member.USER_ID}').checked = true;" /></td>
<td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" id="select_{member.USER_ID}" value="{member.USER_ID}" /></td> <td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" id="select_{member.USER_ID}" value="{member.USER_ID}" /></td>
</tr> </tr>
<!-- END member --> <!-- END member -->
</tbody> </tbody>
</table> </table>
<!-- IF S_CASH_POINTS --> <!-- IF S_CASH_POINTS -->
{L_CASH_POINTS} <input name="cash" type="checkbox" class="radio" checked="checked" /> {L_CASH_POINTS} <input name="cash" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --> <!-- ENDIF -->
{L_MATCHDAY}: <!-- IF S_SELECT_MATCHDAY --><input type="text" name="m" value="{S_MATCHDAY}" /><!-- ELSE --> {L_MATCHDAY}: <!-- IF S_SELECT_MATCHDAY --><input type="text" name="m" value="{S_MATCHDAY}" /><!-- ELSE -->
<input type="hidden" name="m" value="{S_MATCHDAY}" />{S_MATCHDAY}<!-- ENDIF --> <input type="hidden" name="m" value="{S_MATCHDAY}" />{S_MATCHDAY}<!-- ENDIF -->
<!-- IF .pagination or TOTAL_MEMBERS --> <!-- IF .pagination or TOTAL_MEMBERS -->
<div class="pagination"> <div class="pagination">
{TOTAL_MEMBERS} {TOTAL_MEMBERS}
<!-- IF .pagination --> <!-- IF .pagination -->
<!-- INCLUDE pagination.html --> <!-- INCLUDE pagination.html -->
<!-- ELSE --> <!-- ELSE -->
&bull; {PAGE_NUMBER} &bull; {PAGE_NUMBER}
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<fieldset class="quick"> <fieldset class="quick">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<input type="hidden" name="t" value="{S_TYPE}" /> <input type="hidden" name="t" value="{S_TYPE}" />
<input type="hidden" name="start" value="{S_START}" /> <input type="hidden" name="start" value="{S_START}" />
<select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select> <select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select>
<input class="button2" type="submit" name="update" value="{L_SUBMIT}" /> <input class="button2" type="submit" name="update" value="{L_SUBMIT}" />
</fieldset> </fieldset>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</form> </form>
<!-- ELSE --> <!-- ELSE -->
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_ACP_FOOTBALL_BANK_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_BANK_MANAGE}</h1>
<p>{L_ACP_FOOTBALL_BANK_MANAGE_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_BANK_MANAGE_EXPLAIN}</p>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<h1 style="display:inline;">{L_SELECT_SEASON}:</h1> <h1 style="display:inline;">{L_SELECT_SEASON}:</h1>
<select name="s" id="bank_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select> <select name="s" id="bank_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<h1>{L_LEAGUE_BANK}</h1> <h1>{L_LEAGUE_BANK}</h1>
<p>{L_LEAGUE_BANK_EXPLAIN}</p> <p>{L_LEAGUE_BANK_EXPLAIN}</p>
<p><a href="{U_DLOAD_BANK_OPEN}">Offene Posten bis einschließlich dieser Saison</a></p> <p><a href="{U_DLOAD_BANK_OPEN}">Offene Posten bis einschließlich dieser Saison</a></p>
<form id="overview" method="post" action="{U_ACTION}"> <form id="overview" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="marklist('overview', 'markleague', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('overview', 'markleague', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('overview', 'markleague', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('overview', 'markleague', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_LEAGUE}</th> <th>{L_LEAGUE}</th>
<th style="width: 25%">{L_LEAGUE_NAME}</th> <th style="width: 25%">{L_LEAGUE_NAME}</th>
<th>{L_BET_POINTS}</th> <th>{L_BET_POINTS}</th>
<th>{L_DEPOSITED}</th> <th>{L_DEPOSITED}</th>
<th>{L_WINS}</th> <th>{L_WINS}</th>
<th>{L_PAID}</th> <th>{L_PAID}</th>
<th>{L_MARK}</th> <th>{L_MARK}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- IF .leagues --> <!-- IF .leagues -->
<!-- BEGIN leagues --> <!-- BEGIN leagues -->
<!-- IF leagues.S_ROW_COUNT is even --><tr class="bg1 row_light"><!-- ELSE --><tr class="bg2 row_dark"><!-- ENDIF --> <!-- IF leagues.S_ROW_COUNT is even --><tr class="bg1 row_light"><!-- ELSE --><tr class="bg2 row_dark"><!-- ENDIF -->
<td style="text-align: center;"><strong>{leagues.LEAGUE}</strong></td> <td style="text-align: center;"><strong>{leagues.LEAGUE}</strong></td>
<td><a href="{leagues.U_DLOAD_BANK}">{leagues.LEAGUE_NAME}</a></td> <td><a href="{leagues.U_DLOAD_BANK}">{leagues.LEAGUE_NAME}</a></td>
<td style="text-align: right;"><a href="{leagues.U_LIST_BET_POINTS}">{leagues.BET_POINTS}</a></td> <td style="text-align: right;"><a href="{leagues.U_LIST_BET_POINTS}">{leagues.BET_POINTS}</a></td>
<td style="text-align: right;"> <td style="text-align: right;">
<!-- IF S_LIST_DEPOSITED --><a href="{leagues.U_LIST_DEPOSITED}"><!-- ENDIF --> <!-- IF S_LIST_DEPOSITED --><a href="{leagues.U_LIST_DEPOSITED}"><!-- ENDIF -->
{leagues.DEPOSITED} {leagues.DEPOSITED}
<!-- IF S_LIST_DEPOSITED --></a><!-- ENDIF --></td> <!-- IF S_LIST_DEPOSITED --></a><!-- ENDIF --></td>
<td style="text-align: right;">{leagues.WINS}</td> <td style="text-align: right;">{leagues.WINS}</td>
<td style="text-align: right;"> <td style="text-align: right;">
<!-- IF S_LIST_PAID --><a href="{leagues.U_LIST_PAID}"><!-- ENDIF --> <!-- IF S_LIST_PAID --><a href="{leagues.U_LIST_PAID}"><!-- ENDIF -->
{leagues.PAID} {leagues.PAID}
<!-- IF S_LIST_PAID --></a><!-- ENDIF --></td> <!-- IF S_LIST_PAID --></a><!-- ENDIF --></td>
<td style="text-align: center;"><input type="checkbox" class="radio" name="markleague[]" value="{leagues.LEAGUE}" /></td> <td style="text-align: center;"><input type="checkbox" class="radio" name="markleague[]" value="{leagues.LEAGUE}" /></td>
</tr> </tr>
<!-- END leagues --> <!-- END leagues -->
<!-- ELSE --> <!-- ELSE -->
<tr> <tr>
<td colspan="3" class="row3">{L_NO_LEAGUES_CREATED}</td> <td colspan="3" class="row3">{L_NO_LEAGUES_CREATED}</td>
</tr> </tr>
<!-- ENDIF --> <!-- ENDIF -->
</tbody> </tbody>
</table> </table>
<!-- IF S_CASH_POINTS --> <!-- IF S_CASH_POINTS -->
{L_CASH_POINTS} <input name="cash" type="checkbox" class="radio" checked="checked" /> {L_CASH_POINTS} <input name="cash" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --> <!-- ENDIF -->
<fieldset class="quick"> <fieldset class="quick">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_LEAGUE_ACTION_OPTIONS}</select> <select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_LEAGUE_ACTION_OPTIONS}</select>
<input class="button2" type="submit" name="update" value="{L_SUBMIT}" /> <input class="button2" type="submit" name="update" value="{L_SUBMIT}" />
</fieldset> </fieldset>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form><!-- ENDIF --> </form><!-- ENDIF -->
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,155 +1,155 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_ACP_FOOTBALL_BETS_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_BETS_MANAGE}</h1>
<p>{L_ACP_FOOTBALL_BETS_MANAGE_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_BETS_MANAGE_EXPLAIN}</p>
<h1 style="display:inline;">{L_SELECT_MATCHDAY}:</h1> <h1 style="display:inline;">{L_SELECT_MATCHDAY}:</h1>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<select name="s" id="match_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select> <select name="s" id="match_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<select name="l" id="match_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select> <select name="l" id="match_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<select name="m" id="match_matchday" onchange="this.form.submit();">{S_MATCHDAY_OPTIONS}</select> <select name="m" id="match_matchday" onchange="this.form.submit();">{S_MATCHDAY_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<!-- IF S_USERS --> <!-- IF S_USERS -->
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<input type="hidden" name="m" value="{S_MATCHDAY}" /> <input type="hidden" name="m" value="{S_MATCHDAY}" />
<select name="u" id="match_user" onchange="this.form.submit();">{S_USER_OPTIONS}</select> <select name="u" id="match_user" onchange="this.form.submit();">{S_USER_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_SUCCESS --> <!-- IF S_SUCCESS -->
<div class="successbox"> <div class="successbox">
<h3>{L_ADVICE}</h3> <h3>{L_ADVICE}</h3>
<p>{SUCCESS_MSG}</p> <p>{SUCCESS_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF .bet_edit --> <!-- IF .bet_edit -->
<form method="post" action="{U_ACTION}"> <form method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{S_LEGEND}</legend> <legend>{S_LEGEND}</legend>
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<input type="hidden" name="m" value="{S_MATCHDAY}" /> <input type="hidden" name="m" value="{S_MATCHDAY}" />
<input type="hidden" name="u" value="{S_USER}" /> <input type="hidden" name="u" value="{S_USER}" />
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_DATE}</th> <th>{L_DATE}</th>
<th style="text-align:right">{L_NR}</th> <th style="text-align:right">{L_NR}</th>
<!-- IF S_DATA_GROUP --> <!-- IF S_DATA_GROUP -->
<th>{L_GR}</th> <th>{L_GR}</th>
<!-- ENDIF --> <!-- ENDIF -->
<th></th> <th></th>
<th>{L_HOME}</th> <th>{L_HOME}</th>
<th></th> <th></th>
<th></th> <th></th>
<th>{L_GUEST}</th> <th>{L_GUEST}</th>
<th style="text-align:right">{L_GOALS_HOME}</th> <th style="text-align:right">{L_GOALS_HOME}</th>
<th></th> <th></th>
<th>{L_GOALS_GUEST}</th> <th>{L_GOALS_GUEST}</th>
<th>{L_BET_TIME}</th> <th>{L_BET_TIME}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN bet_edit --> <!-- BEGIN bet_edit -->
<tr class="{bet_edit.ROW_CLASS}"> <tr class="{bet_edit.ROW_CLASS}">
<td>{bet_edit.MATCH_TIME}</td> <td>{bet_edit.MATCH_TIME}</td>
<td class="td_match_no">{bet_edit.MATCH_NUMBER}</td> <td class="td_match_no">{bet_edit.MATCH_NUMBER}</td>
<!-- IF S_DATA_GROUP --> <!-- IF S_DATA_GROUP -->
<td class="td_group">{bet_edit.GROUP}</td> <td class="td_group">{bet_edit.GROUP}</td>
<!-- ENDIF --> <!-- ENDIF -->
<td style="text-align:right; width:32px;">{bet_edit.LOGO_HOME}&nbsp;</td> <td style="text-align:right; width:32px;">{bet_edit.LOGO_HOME}&nbsp;</td>
<td class="td_team">{bet_edit.HOME_NAME}</td> <td class="td_team">{bet_edit.HOME_NAME}</td>
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td style="text-align:right; width:32px;">{bet_edit.LOGO_GUEST}&nbsp;</td> <td style="text-align:right; width:32px;">{bet_edit.LOGO_GUEST}&nbsp;</td>
<td class="td_team">{bet_edit.GUEST_NAME}</td> <td class="td_team">{bet_edit.GUEST_NAME}</td>
<td class="td_goals_home"><input style="text-align:right; width:30px;" type="number" <td class="td_goals_home"><input style="text-align:right; width:30px;" type="number"
name="goalsh{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_HOME}" /></td> name="goalsh{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_HOME}" /></td>
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td class="td_goals_guest"><input style="margin:0; width:30px;" type="number" <td class="td_goals_guest"><input style="margin:0; width:30px;" type="number"
name="goalsg{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_GUEST}" /></td> name="goalsg{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_GUEST}" /></td>
<td>{bet_edit.BET_TIME}</td> <td>{bet_edit.BET_TIME}</td>
</tr> </tr>
<!-- END bet_edit --> <!-- END bet_edit -->
</tbody> </tbody>
</table> </table>
<!-- IF S_EXTRA_BET --> <!-- IF S_EXTRA_BET -->
<br /> <br />
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th style="text-align: left;">{L_QUESTION}</th> <th style="text-align: left;">{L_QUESTION}</th>
<th>{L_POSSIBLE_POINTS}</th> <th>{L_POSSIBLE_POINTS}</th>
<th>{L_EVALUATION}</th> <th>{L_EVALUATION}</th>
<th>{L_BET_OF}</th> <th>{L_BET_OF}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN extra_edit --> <!-- BEGIN extra_edit -->
<tr class="{extra_edit.ROW_CLASS}" style="height:30px"> <tr class="{extra_edit.ROW_CLASS}" style="height:30px">
<td>{extra_edit.QUESTION}</td> <td>{extra_edit.QUESTION}</td>
<td style="text-align: center;">{extra_edit.EXTRA_POINTS}</td> <td style="text-align: center;">{extra_edit.EXTRA_POINTS}</td>
<td style="text-align: center;" title="{extra_edit.EVALUATION_TITLE}">{extra_edit.EVALUATION}</td> <td style="text-align: center;" title="{extra_edit.EVALUATION_TITLE}">{extra_edit.EVALUATION}</td>
<td style="text-align: center;"> <td style="text-align: center;">
<!-- IF extra_edit.S_DISPLAY_TYPE == 1 --> <!-- IF extra_edit.S_DISPLAY_TYPE == 1 -->
<select name="extra{extra_edit.EXTRA_NO}"> <select name="extra{extra_edit.EXTRA_NO}">
<!-- BEGIN extra_option --> <!-- BEGIN extra_option -->
<option {extra_edit.extra_option.S_SELECTED} value="{extra_edit.extra_option.OPTION_VALUE}">{extra_edit.extra_option.OPTION_NAME}</option> <option {extra_edit.extra_option.S_SELECTED} value="{extra_edit.extra_option.OPTION_VALUE}">{extra_edit.extra_option.OPTION_NAME}</option>
<!-- END extra_option --> <!-- END extra_option -->
</select> </select>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF extra_edit.S_DISPLAY_TYPE == 2 --> <!-- IF extra_edit.S_DISPLAY_TYPE == 2 -->
<input style="display:inline; margin:0; padding:0;" type="text" name="extra{extra_edit.EXTRA_NO}" size="15" maxlength="255" value="{extra_edit.BET}"> <input style="display:inline; margin:0; padding:0;" type="text" name="extra{extra_edit.EXTRA_NO}" size="15" maxlength="255" value="{extra_edit.BET}">
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
</tr> </tr>
<!-- END extra_edit --> <!-- END extra_edit -->
</tbody> </tbody>
</table> </table>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_CASH_POINTS -->{L_CASH_POINTS} <input name="cash" type="checkbox" class="radio" checked="checked" /> <!-- ENDIF --> <!-- IF S_CASH_POINTS -->{L_CASH_POINTS} <input name="cash" type="checkbox" class="radio" checked="checked" /> <!-- ENDIF -->
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<input class="button1" type="submit" id="submit" name="bet" value="{L_SAVE}" />&nbsp; <input class="button1" type="submit" id="submit" name="bet" value="{L_SAVE}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</fieldset> </fieldset>
</form> </form>
<!-- ELSE --> <!-- ELSE -->
<fieldset> <fieldset>
<legend>{S_LEGEND}</legend> <legend>{S_LEGEND}</legend>
<br /> <br />
<div class="message"><!-- IF S_USERS -->{L_NO_MATCHES_ON_MATCHDAY}<!-- ELSE -->{L_NO_USERS}<!-- ENDIF --></div> <div class="message"><!-- IF S_USERS -->{L_NO_MATCHES_ON_MATCHDAY}<!-- ELSE -->{L_NO_USERS}<!-- ENDIF --></div>
<br /> <br />
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,149 +1,149 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF S_EDIT --> <!-- IF S_EDIT -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a> <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
<h1>{L_ACP_FOOTBALL_EXTRA_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_EXTRA_MANAGE}</h1>
<p>{L_MATCHDAY_EDIT_EXPLAIN}</p> <p>{L_MATCHDAY_EDIT_EXPLAIN}</p>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<form id="settings" method="post" action="{U_ACTION}"> <form id="settings" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{L_EXTRA_DETAILS}</legend> <legend>{L_EXTRA_DETAILS}</legend>
<dl> <dl>
<dt><label for="season">{L_SEASON}:</label></dt> <dt><label for="season">{L_SEASON}:</label></dt>
<dd><strong>{SEASON_NAME}</strong><input name="s" type="hidden" id="season" value="{SEASON}" /></dd> <dd><strong>{SEASON_NAME}</strong><input name="s" type="hidden" id="season" value="{SEASON}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="league">{L_LEAGUE}:</label></dt> <dt><label for="league">{L_LEAGUE}:</label></dt>
<dd><strong>{LEAGUE_NAME}</strong><input name="l" type="hidden" id="league" value="{LEAGUE}" /></dd> <dd><strong>{LEAGUE_NAME}</strong><input name="l" type="hidden" id="league" value="{LEAGUE}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="extra_no">{L_EXTRA_NO}:</label></dt> <dt><label for="extra_no">{L_EXTRA_NO}:</label></dt>
<dd><strong>{EXTRA_NO}</strong><input name="e" type="hidden" id="extra_no" value="{EXTRA_NO}" /></dd> <dd><strong>{EXTRA_NO}</strong><input name="e" type="hidden" id="extra_no" value="{EXTRA_NO}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="question_type">{L_EXTRA_QUESTION_TYPE}:</label><br /><span>{L_EXTRA_QUESTION_TYPE_EXPLAIN}</span></dt> <dt><label for="question_type">{L_EXTRA_QUESTION_TYPE}:</label><br /><span>{L_EXTRA_QUESTION_TYPE_EXPLAIN}</span></dt>
<dd><select id="question_type" name="question_type">{S_QUESTION_TYPE_OPTIONS}</select> </dd> <dd><select id="question_type" name="question_type">{S_QUESTION_TYPE_OPTIONS}</select> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="question">{L_EXTRA_QUESTION}:</label><br /><span>{L_EXTRA_QUESTION_EXPLAIN}</span></dt> <dt><label for="question">{L_EXTRA_QUESTION}:</label><br /><span>{L_EXTRA_QUESTION_EXPLAIN}</span></dt>
<dd><input name="question" type="text" id="question" size="80" maxlength="255" value="{QUESTION}" /></dd> <dd><input name="question" type="text" id="question" size="80" maxlength="255" value="{QUESTION}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="matchday">{L_EXTRA_MATCHDAY}:</label><br /><span>{L_EXTRA_MATCHDAY_EXPLAIN}</span></dt> <dt><label for="matchday">{L_EXTRA_MATCHDAY}:</label><br /><span>{L_EXTRA_MATCHDAY_EXPLAIN}</span></dt>
<dd><select id="matchday" name="matchday">{S_MATCHDAY_OPTIONS}</select> </dd> <dd><select id="matchday" name="matchday">{S_MATCHDAY_OPTIONS}</select> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="matchday_eval">{L_EXTRA_MATCHDAY_EVAL}:</label><br /><span>{L_EXTRA_MATCHDAY_EVAL_EXPLAIN}</span></dt> <dt><label for="matchday_eval">{L_EXTRA_MATCHDAY_EVAL}:</label><br /><span>{L_EXTRA_MATCHDAY_EVAL_EXPLAIN}</span></dt>
<dd><select id="matchday_eval" name="matchday_eval">{S_MATCHDAY_EVAL_OPTIONS}</select> </dd> <dd><select id="matchday_eval" name="matchday_eval">{S_MATCHDAY_EVAL_OPTIONS}</select> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="extra_points">{L_EXTRA_POINTS}:</label><br /><span>{L_EXTRA_POINTS_EXPLAIN}</span></dt> <dt><label for="extra_points">{L_EXTRA_POINTS}:</label><br /><span>{L_EXTRA_POINTS_EXPLAIN}</span></dt>
<dd><input name="extra_points" type="text" id="extra_points" size="2" maxlength="2" value="{EXTRA_POINTS}" /></dd> <dd><input name="extra_points" type="text" id="extra_points" size="2" maxlength="2" value="{EXTRA_POINTS}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="extra_status">{L_EXTRA_STATUS}:</label><br /><span>{L_EXTRA_STATUS_EXPLAIN}</span></dt> <dt><label for="extra_status">{L_EXTRA_STATUS}:</label><br /><span>{L_EXTRA_STATUS_EXPLAIN}</span></dt>
<dd><select id="extra_status" name="extra_status">{S_EXTRA_STATUS_OPTIONS}</select></dd> <dd><select id="extra_status" name="extra_status">{S_EXTRA_STATUS_OPTIONS}</select></dd>
</dl> </dl>
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<!-- ELSE --> <!-- ELSE -->
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_ACP_FOOTBALL_EXTRA_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_EXTRA_MANAGE}</h1>
<p>{L_ACP_FOOTBALL_EXTRA_MANAGE_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_EXTRA_MANAGE_EXPLAIN}</p>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<h1 style="display:inline;">{L_SELECT_LEAGUE}:</h1> <h1 style="display:inline;">{L_SELECT_LEAGUE}:</h1>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<select name="s" id="matchday_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select> <select name="s" id="matchday_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<select name="l" id="matchday_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select> <select name="l" id="matchday_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form id="add_extra" method="post" action="{U_ACTION}"> <form id="add_extra" method="post" action="{U_ACTION}">
<fieldset class="quick"> <fieldset class="quick">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<!-- IF S_EXTRA_ADD --> <!-- IF S_EXTRA_ADD -->
<input class="button2" type="submit" name="submit" value="{L_EXTRA_ADD}" /> <input class="button2" type="submit" name="submit" value="{L_EXTRA_ADD}" />
<input type="hidden" name="add" value="1" /> <input type="hidden" name="add" value="1" />
<!-- ENDIF --> <!-- ENDIF -->
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<h1>{L_EXTRA_DEF}</h1> <h1>{L_EXTRA_DEF}</h1>
<p>{L_EXTRA_DEF_EXPLAIN}</p> <p>{L_EXTRA_DEF_EXPLAIN}</p>
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_EXTRA_NO}</th> <th>{L_EXTRA_NO}</th>
<th>{L_QUESTION_TYPE}</th> <th>{L_QUESTION_TYPE}</th>
<th style="width: 40%">{L_EXTRA_QUESTION}</th> <th style="width: 40%">{L_EXTRA_QUESTION}</th>
<th>{L_EXTRA_MATCHDAY}</th> <th>{L_EXTRA_MATCHDAY}</th>
<th>{L_EXTRA_MATCHDAY_EVAL}</th> <th>{L_EXTRA_MATCHDAY_EVAL}</th>
<th>{L_EXTRA_POINTS}</th> <th>{L_EXTRA_POINTS}</th>
<th>{L_STATUS}</th> <th>{L_STATUS}</th>
<th>{L_OPTIONS}</th> <th>{L_OPTIONS}</th>
<th>{L_ACTION}</th> <th>{L_ACTION}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- IF .extras --> <!-- IF .extras -->
<!-- BEGIN extras --> <!-- BEGIN extras -->
<tr class="{extras.ROW_CLASS}"> <tr class="{extras.ROW_CLASS}">
<td style="text-align:center;"><strong>{extras.EXTRA_NO}</strong></td> <td style="text-align:center;"><strong>{extras.EXTRA_NO}</strong></td>
<td style="text-align:center;">{extras.QUESTION_TYPE}</td> <td style="text-align:center;">{extras.QUESTION_TYPE}</td>
<td>{extras.QUESTION}</td> <td>{extras.QUESTION}</td>
<td style="text-align:right;">{extras.MATCHDAY}</td> <td style="text-align:right;">{extras.MATCHDAY}</td>
<td style="text-align:right;">{extras.MATCHDAY_EVAL}</td> <td style="text-align:right;">{extras.MATCHDAY_EVAL}</td>
<td style="text-align:center;">{extras.EXTRA_POINTS}</td> <td style="text-align:center;">{extras.EXTRA_POINTS}</td>
<td style="text-align:center;">{extras.EXTRA_STATUS}</td> <td style="text-align:center;">{extras.EXTRA_STATUS}</td>
<td style="text-align: center;"><a href="{extras.U_EDIT}">{L_SETTINGS}</a></td> <td style="text-align: center;"><a href="{extras.U_EDIT}">{L_SETTINGS}</a></td>
<td style="text-align: center;"><!-- IF extras.U_DELETE --><a href="{extras.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td> <td style="text-align: center;"><!-- IF extras.U_DELETE --><a href="{extras.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>
</tr> </tr>
<!-- END extras --> <!-- END extras -->
<!-- ELSE --> <!-- ELSE -->
<tr> <tr>
<td colspan="9" class="row3">{L_NO_EXTRA_CREATED}</td> <td colspan="9" class="row3">{L_NO_EXTRA_CREATED}</td>
</tr> </tr>
<!-- ENDIF --> <!-- ENDIF -->
</tbody> </tbody>
</table> </table>
<!-- ENDIF --> <!-- ENDIF -->
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,85 +1,85 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_ACP_FOOTBALL_KO_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_KO_MANAGE}</h1>
<p>{L_ACP_FOOTBALL_KO_MANAGE_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_KO_MANAGE_EXPLAIN}</p>
<h1 style="display:inline;">{L_SELECT_LEAGUE}:</h1> <h1 style="display:inline;">{L_SELECT_LEAGUE}:</h1>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<select name="s" id="match_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select> <select name="s" id="match_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<select name="l" id="match_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select> <select name="l" id="match_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<form id="settings" method="post" action="{U_ACTION}"> <form id="settings" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{L_KO_MATCHDAYS}</legend> <legend>{L_KO_MATCHDAYS}</legend>
<dl> <dl>
<dt><label for="matchday_from">{L_MATCHDAY_FROM}:</label></dt> <dt><label for="matchday_from">{L_MATCHDAY_FROM}:</label></dt>
<dd><select name="matchday_from" id="matchday_from" >{S_MATCHDAY_FROM_OPTIONS}</select></dd> <dd><select name="matchday_from" id="matchday_from" >{S_MATCHDAY_FROM_OPTIONS}</select></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="matchday_to">{L_MATCHDAY_TO}:</label></dt> <dt><label for="matchday_to">{L_MATCHDAY_TO}:</label></dt>
<dd><select name="matchday_to" id="matchday_to" >{S_MATCHDAY_TO_OPTIONS}</select></dd> <dd><select name="matchday_to" id="matchday_to" >{S_MATCHDAY_TO_OPTIONS}</select></dd>
</dl> </dl>
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>{L_MATCHDAY_TARGET}</legend> <legend>{L_MATCHDAY_TARGET}</legend>
<dl> <dl>
<dt><label for="matchday_new">{L_MATCHDAY_NEW}:</label></dt> <dt><label for="matchday_new">{L_MATCHDAY_NEW}:</label></dt>
<dd><select name="matchday_new" id="matchday_new" >{S_MATCHDAY_NEW_OPTIONS}</select></dd> <dd><select name="matchday_new" id="matchday_new" >{S_MATCHDAY_NEW_OPTIONS}</select></dd>
</dl> </dl>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>{L_KO_GROUP}</legend> <legend>{L_KO_GROUP}</legend>
<dl> <dl>
<dt><label for="matchday_new">{L_MANAGE_GROUP}:</label></dt> <dt><label for="matchday_new">{L_MANAGE_GROUP}:</label></dt>
<dd><input name="check_rank" id="check_rank" type="checkbox" value="1" class="radio" <!-- IF S_CHECK_RANK --> checked="checked"<!-- ENDIF --> /></dd> <dd><input name="check_rank" id="check_rank" type="checkbox" value="1" class="radio" <!-- IF S_CHECK_RANK --> checked="checked"<!-- ENDIF --> /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="rank">{L_GROUP_RANK}:</label><br /><span>{L_GROUP_RANK_EXPLAIN}</span></dt> <dt><label for="rank">{L_GROUP_RANK}:</label><br /><span>{L_GROUP_RANK_EXPLAIN}</span></dt>
<dd><input name="rank" type="text" id="rank" value="{S_RANK}" size="1" maxlength="1" /></dd> <dd><input name="rank" type="text" id="rank" value="{S_RANK}" size="1" maxlength="1" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="move_rank">{L_MOVE_RANK}:</label><br /><span>{L_MOVE_RANK_EXPLAIN}</span></dt> <dt><label for="move_rank">{L_MOVE_RANK}:</label><br /><span>{L_MOVE_RANK_EXPLAIN}</span></dt>
<dd><input name="move_rank" type="text" id="move_rank" value="{S_MOVE_RANK}" size="1" maxlength="1" /> <dd><input name="move_rank" type="text" id="move_rank" value="{S_MOVE_RANK}" size="1" maxlength="1" />
{L_MOVE_LEAGUE} {L_MOVE_LEAGUE}
<select name="move_league" id="move_league">{S_MOVE_LEAGUE_OPTIONS}</select> <select name="move_league" id="move_league">{S_MOVE_LEAGUE_OPTIONS}</select>
{L_MATCHDAY} {L_MATCHDAY}
<input name="move_matchday" type="text" id="move_matchday" value="{S_MOVE_MATCHDAY}" size="2" maxlength="2" /> <input name="move_matchday" type="text" id="move_matchday" value="{S_MOVE_MATCHDAY}" size="2" maxlength="2" />
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -100,6 +100,10 @@
</dd> </dd>
</dl> </dl>
<!-- ENDIF --> <!-- ENDIF -->
<dl>
<dt><label for="bet_type">{L_BET_TYPE}:</label><br /><span>{L_BET_TYPE_EXPLAIN}</span></dt>
<dd><input name="bet_type" type="checkbox" id="bet_type" <!-- IF S_BET_TYPE -->checked="checked" <!-- ENDIF --> /></dd>
</dl>
</fieldset> </fieldset>
<fieldset> <fieldset>

View File

@@ -1,285 +1,285 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF S_EDIT --> <!-- IF S_EDIT -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a> <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
<h1>{L_ACP_FOOTBALL_MATCHDAYS_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_MATCHDAYS_MANAGE}</h1>
<p>{L_MATCHDAY_EDIT_EXPLAIN}</p> <p>{L_MATCHDAY_EDIT_EXPLAIN}</p>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<form id="settings" method="post" action="{U_ACTION}"> <form id="settings" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{L_MATCHDAY_DETAILS}</legend> <legend>{L_MATCHDAY_DETAILS}</legend>
<dl> <dl>
<dt><label for="season">{L_SEASON}:</label></dt> <dt><label for="season">{L_SEASON}:</label></dt>
<dd><strong>{SEASON_NAME}</strong><input name="s" type="hidden" id="season" value="{SEASON}" /></dd> <dd><strong>{SEASON_NAME}</strong><input name="s" type="hidden" id="season" value="{SEASON}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="league">{L_LEAGUE}:</label></dt> <dt><label for="league">{L_LEAGUE}:</label></dt>
<dd><strong>{LEAGUE_NAME}</strong><input name="l" type="hidden" id="league" value="{LEAGUE}" /></dd> <dd><strong>{LEAGUE_NAME}</strong><input name="l" type="hidden" id="league" value="{LEAGUE}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="matchday">{L_MATCHDAY}:</label></dt> <dt><label for="matchday">{L_MATCHDAY}:</label></dt>
<dd><strong>{MATCHDAY}</strong><input name="m" type="hidden" id="matchday" value="{MATCHDAY}" /></dd> <dd><strong>{MATCHDAY}</strong><input name="m" type="hidden" id="matchday" value="{MATCHDAY}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="matchday_name">{L_MATCHDAY_NAME}:</label></dt> <dt><label for="matchday_name">{L_MATCHDAY_NAME}:</label></dt>
<dd><input name="matchday_name" type="text" id="matchday_name" size="30" maxlength="30" value="{MATCHDAY_NAME}" /></dd> <dd><input name="matchday_name" type="text" id="matchday_name" size="30" maxlength="30" value="{MATCHDAY_NAME}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="matchday_status">{L_MATCHDAY_STATUS}:</label><br /><span>{L_MATCHDAY_STATUS_EXPLAIN}</span></dt> <dt><label for="matchday_status">{L_MATCHDAY_STATUS}:</label><br /><span>{L_MATCHDAY_STATUS_EXPLAIN}</span></dt>
<dd><strong>{MATCHDAY_STATUS}</strong><input name="matchday_status" type="hidden" id="matchday_status" value="{MATCHDAY_STATUS}" /></dd> <dd><strong>{MATCHDAY_STATUS}</strong><input name="matchday_status" type="hidden" id="matchday_status" value="{MATCHDAY_STATUS}" /></dd>
</dl> </dl>
<!-- IF S_EDIT_DELIVERY --> <!-- IF S_EDIT_DELIVERY -->
<dl> <dl>
<dt><label for="delivery1">{L_MATCHDAY_DELIVERY}:</label><br /><span>{L_MATCHDAY_DELIVERY_EXPLAIN}</span></dt> <dt><label for="delivery1">{L_MATCHDAY_DELIVERY}:</label><br /><span>{L_MATCHDAY_DELIVERY_EXPLAIN}</span></dt>
<dd>{L_DAY}: <select id="delivery1" name="dday1_day">{S_DELIVERY1_DAY_OPTIONS}</select> <dd>{L_DAY}: <select id="delivery1" name="dday1_day">{S_DELIVERY1_DAY_OPTIONS}</select>
{L_MONTH}: <select name="dday1_month">{S_DELIVERY1_MONTH_OPTIONS}</select> {L_MONTH}: <select name="dday1_month">{S_DELIVERY1_MONTH_OPTIONS}</select>
{L_YEAR}: <select name="dday1_year">{S_DELIVERY1_YEAR_OPTIONS}</select>&nbsp;&nbsp;&nbsp; {L_YEAR}: <select name="dday1_year">{S_DELIVERY1_YEAR_OPTIONS}</select>&nbsp;&nbsp;&nbsp;
{L_TIME}: <select name="dday1_hour">{S_DELIVERY1_HOUR_OPTIONS}</select>: {L_TIME}: <select name="dday1_hour">{S_DELIVERY1_HOUR_OPTIONS}</select>:
<select name="dday1_min">{S_DELIVERY1_MIN_OPTIONS}</select> <select name="dday1_min">{S_DELIVERY1_MIN_OPTIONS}</select>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="delivery2">{L_MATCHDAY_DELIVERY2}:</label><br /><span>{L_MATCHDAY_DELIVERY2_EXPLAIN}</span></dt> <dt><label for="delivery2">{L_MATCHDAY_DELIVERY2}:</label><br /><span>{L_MATCHDAY_DELIVERY2_EXPLAIN}</span></dt>
<dd>{L_DAY}: <select id="delivery2" name="dday2_day">{S_DELIVERY2_DAY_OPTIONS}</select> <dd>{L_DAY}: <select id="delivery2" name="dday2_day">{S_DELIVERY2_DAY_OPTIONS}</select>
{L_MONTH}: <select name="dday2_month">{S_DELIVERY2_MONTH_OPTIONS}</select> {L_MONTH}: <select name="dday2_month">{S_DELIVERY2_MONTH_OPTIONS}</select>
{L_YEAR}: <select name="dday2_year">{S_DELIVERY2_YEAR_OPTIONS}</select>&nbsp;&nbsp;&nbsp; {L_YEAR}: <select name="dday2_year">{S_DELIVERY2_YEAR_OPTIONS}</select>&nbsp;&nbsp;&nbsp;
{L_TIME}: <select name="dday2_hour">{S_DELIVERY2_HOUR_OPTIONS}</select>: {L_TIME}: <select name="dday2_hour">{S_DELIVERY2_HOUR_OPTIONS}</select>:
<select name="dday2_min">{S_DELIVERY2_MIN_OPTIONS}</select> <select name="dday2_min">{S_DELIVERY2_MIN_OPTIONS}</select>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="delivery3">{L_MATCHDAY_DELIVERY3}:</label><br /><span>{L_MATCHDAY_DELIVERY3_EXPLAIN}</span></dt> <dt><label for="delivery3">{L_MATCHDAY_DELIVERY3}:</label><br /><span>{L_MATCHDAY_DELIVERY3_EXPLAIN}</span></dt>
<dd>{L_DAY}: <select id="delivery3" name="dday3_day">{S_DELIVERY3_DAY_OPTIONS}</select> <dd>{L_DAY}: <select id="delivery3" name="dday3_day">{S_DELIVERY3_DAY_OPTIONS}</select>
{L_MONTH}: <select name="dday3_month">{S_DELIVERY3_MONTH_OPTIONS}</select> {L_MONTH}: <select name="dday3_month">{S_DELIVERY3_MONTH_OPTIONS}</select>
{L_YEAR}: <select name="dday3_year">{S_DELIVERY3_YEAR_OPTIONS}</select>&nbsp;&nbsp;&nbsp; {L_YEAR}: <select name="dday3_year">{S_DELIVERY3_YEAR_OPTIONS}</select>&nbsp;&nbsp;&nbsp;
{L_TIME}: <select name="dday3_hour">{S_DELIVERY3_HOUR_OPTIONS}</select>: {L_TIME}: <select name="dday3_hour">{S_DELIVERY3_HOUR_OPTIONS}</select>:
<select name="dday3_min">{S_DELIVERY3_MIN_OPTIONS}</select> <select name="dday3_min">{S_DELIVERY3_MIN_OPTIONS}</select>
</dd> </dd>
</dl> </dl>
<!-- ELSE --> <!-- ELSE -->
<dl> <dl>
<dt><label for="matchday_delivery1">{L_MATCHDAY_DELIVERY}:</label><br /><span>{L_MATCHDAY_DELIVERY_EXPLAIN}</span></dt> <dt><label for="matchday_delivery1">{L_MATCHDAY_DELIVERY}:</label><br /><span>{L_MATCHDAY_DELIVERY_EXPLAIN}</span></dt>
<dd> <dd>
{MATCHDAY_DEL1} {MATCHDAY_DEL1}
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="matchday_delivery2">{L_MATCHDAY_DELIVERY2}:</label><br /><span>{L_MATCHDAY_DELIVERY2_EXPLAIN}</span></dt> <dt><label for="matchday_delivery2">{L_MATCHDAY_DELIVERY2}:</label><br /><span>{L_MATCHDAY_DELIVERY2_EXPLAIN}</span></dt>
<dd> <dd>
{MATCHDAY_DEL2} {MATCHDAY_DEL2}
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="matchday_delivery3">{L_MATCHDAY_DELIVERY3}:</label><br /><span>{L_MATCHDAY_DELIVERY3_EXPLAIN}</span></dt> <dt><label for="matchday_delivery3">{L_MATCHDAY_DELIVERY3}:</label><br /><span>{L_MATCHDAY_DELIVERY3_EXPLAIN}</span></dt>
<dd> <dd>
{MATCHDAY_DEL3} {MATCHDAY_DEL3}
</dd> </dd>
</dl> </dl>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_KO_LEAGUE --> <!-- IF S_KO_LEAGUE -->
<dl> <dl>
<dt><label for="matchday_matches">{L_MATCHDAY_MATCHES}:</label><br /><span>{L_MATCHDAY_MATCHES_EXPLAIN}</span></dt> <dt><label for="matchday_matches">{L_MATCHDAY_MATCHES}:</label><br /><span>{L_MATCHDAY_MATCHES_EXPLAIN}</span></dt>
<dd> <dd>
<!-- IF S_EDIT_MATCHES --> <!-- IF S_EDIT_MATCHES -->
<input name="matchday_matches" type="text" id="matchday_matches" size="2" maxlength="2" value="{MATCHDAY_MATCHES}" /> <input name="matchday_matches" type="text" id="matchday_matches" size="2" maxlength="2" value="{MATCHDAY_MATCHES}" />
<!-- ELSE --> <!-- ELSE -->
{MATCHDAY_MATCHES} {MATCHDAY_MATCHES}
<!-- ENDIF --> <!-- ENDIF -->
</dd> </dd>
</dl> </dl>
<input type="hidden" name="ko_league" value="1" /> <input type="hidden" name="ko_league" value="1" />
<!-- ENDIF --> <!-- ENDIF -->
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<!-- ELSEIF S_CHANGE_DELIVERY --> <!-- ELSEIF S_CHANGE_DELIVERY -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a> <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
<h1>{L_CHANGE_DELIVERY}</h1> <h1>{L_CHANGE_DELIVERY}</h1>
<p>{L_CHANGE_DELIVERY_EXPLAIN}</p> <p>{L_CHANGE_DELIVERY_EXPLAIN}</p>
<form id="change_delivery" method="post" action="{U_ACTION}"> <form id="change_delivery" method="post" action="{U_ACTION}">
<!-- IF S_SHOW_DELIVERY_SELECT --> <!-- IF S_SHOW_DELIVERY_SELECT -->
<fieldset> <fieldset>
<legend>{L_DELIVERY_SET_TIME}</legend> <legend>{L_DELIVERY_SET_TIME}</legend>
<dl> <dl>
<dt><label> {L_BACKWARD_DELIVERY}:</label><br /><span>{L_BACKWARD_DELIVERY_EXPLAIN}</span></dt> <dt><label> {L_BACKWARD_DELIVERY}:</label><br /><span>{L_BACKWARD_DELIVERY_EXPLAIN}</span></dt>
<dd>{L_DAYS}: <select id="backward_days" name="backward_days">{S_BACKWARD_DAYS_OPTIONS}</select> &nbsp; <dd>{L_DAYS}: <select id="backward_days" name="backward_days">{S_BACKWARD_DAYS_OPTIONS}</select> &nbsp;
{L_HOURS}: <select name="backward_hours">{S_BACKWARD_HOURS_OPTIONS}</select> &nbsp; {L_HOURS}: <select name="backward_hours">{S_BACKWARD_HOURS_OPTIONS}</select> &nbsp;
{L_MINUTES}: <select name="backward_minutes">{S_BACKWARD_MINUTES_OPTIONS}</select> {L_MINUTES}: <select name="backward_minutes">{S_BACKWARD_MINUTES_OPTIONS}</select>
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_SHOW_DELIVERY --> <!-- IF S_SHOW_DELIVERY -->
<h1>{L_UPDATE_DELIVERY}</h1> <h1>{L_UPDATE_DELIVERY}</h1>
<p>{L_UPDATE_DELIVERY_EXPLAIN}</p> <p>{L_UPDATE_DELIVERY_EXPLAIN}</p>
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="marklist('change_delivery', 'delivery_', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('change_delivery', 'delivery_', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('change_delivery', 'delivery_', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('change_delivery', 'delivery_', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_MATCHDAY}</th> <th>{L_MATCHDAY}</th>
<th>{L_DELIVERY_NUMBER}</th> <th>{L_DELIVERY_NUMBER}</th>
<th>{L_DELIVERY}</th> <th>{L_DELIVERY}</th>
<th>{L_NEW_DELIVERY}</th> <th>{L_NEW_DELIVERY}</th>
<th>{L_SELECT}</th> <th>{L_SELECT}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN delivery --> <!-- BEGIN delivery -->
<tr class="{delivery.ROW_CLASS}"> <tr class="{delivery.ROW_CLASS}">
<td style="text-align: center;"><strong>{delivery.MATCHDAY}</strong></td> <td style="text-align: center;"><strong>{delivery.MATCHDAY}</strong></td>
<td>{delivery.NUMBER}</td> <td>{delivery.NUMBER}</td>
<td><b>{delivery.DELIVERY_DATE_DAY}</b> <td><b>{delivery.DELIVERY_DATE_DAY}</b>
<!-- IF delivery.DELIVERY_ERROR --><span style="color: #FF0000;"><!-- ENDIF --> <!-- IF delivery.DELIVERY_ERROR --><span style="color: #FF0000;"><!-- ENDIF -->
{delivery.DELIVERY_DATE} {delivery.DELIVERY_DATE}
<!-- IF delivery.DELIVERY_ERROR --></span><!-- ENDIF --> <!-- IF delivery.DELIVERY_ERROR --></span><!-- ENDIF -->
</td> </td>
<td><b>{delivery.NEW_DELIVERY_DAY}</b> {delivery.NEW_DELIVERY} <td><b>{delivery.NEW_DELIVERY_DAY}</b> {delivery.NEW_DELIVERY}
<input type="hidden" name="new_delivery_{delivery.MATCHDAY}_{delivery.NUMBER}" value="{delivery.NEW_DELIVERY}" /> <input type="hidden" name="new_delivery_{delivery.MATCHDAY}_{delivery.NUMBER}" value="{delivery.NEW_DELIVERY}" />
</td> </td>
<td> <td>
<input name="delivery_{delivery.MATCHDAY}_{delivery.NUMBER}" id="delivery_{delivery.MATCHDAY}_{delivery.NUMBER}" <input name="delivery_{delivery.MATCHDAY}_{delivery.NUMBER}" id="delivery_{delivery.MATCHDAY}_{delivery.NUMBER}"
type="checkbox" class="radio" <!-- IF delivery.SELECT_CHECKED --> checked="checked"<!-- ENDIF --> /> type="checkbox" class="radio" <!-- IF delivery.SELECT_CHECKED --> checked="checked"<!-- ENDIF --> />
</td> </td>
</tr> </tr>
<!-- END delivery --> <!-- END delivery -->
</tbody> </tbody>
</table> </table>
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="marklist('update_delivery', 'delivery_', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('update_delivery', 'delivery_', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('update_delivery', 'delivery_', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('update_delivery', 'delivery_', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<!-- ENDIF --> <!-- ENDIF -->
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<!-- IF S_SHOW_DELIVERY --> <!-- IF S_SHOW_DELIVERY -->
<input class="button1" type="submit" id="update_delivery" name="update_delivery" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="update_delivery" name="update_delivery" value="{L_SUBMIT}" />&nbsp;
<!-- ELSE --> <!-- ELSE -->
<input class="button1" type="submit" id="show_delivery" name="show_delivery" value="{L_SHOW_DELIVERY}" />&nbsp; <input class="button1" type="submit" id="show_delivery" name="show_delivery" value="{L_SHOW_DELIVERY}" />&nbsp;
<!-- ENDIF --> <!-- ENDIF -->
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<!-- ELSE --> <!-- ELSE -->
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_ACP_FOOTBALL_MATCHDAYS_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_MATCHDAYS_MANAGE}</h1>
<p>{L_ACP_FOOTBALL_MATCHDAYS_MANAGE_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_MATCHDAYS_MANAGE_EXPLAIN}</p>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<h1 style="display:inline;">{L_SELECT_LEAGUE}:</h1> <h1 style="display:inline;">{L_SELECT_LEAGUE}:</h1>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<select name="s" id="matchday_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select> <select name="s" id="matchday_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<select name="l" id="matchday_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select> <select name="l" id="matchday_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" id="add_matchday" method="post" action="{U_ACTION}"> <form style="display:inline;" id="add_matchday" method="post" action="{U_ACTION}">
<fieldset class="quick"> <fieldset class="quick">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<input type="hidden" name="m" value="{S_MATCHDAY}" /> <input type="hidden" name="m" value="{S_MATCHDAY}" />
<input type="hidden" name="ko_league" value="{KO_LEAGUE}" /> <input type="hidden" name="ko_league" value="{KO_LEAGUE}" />
<!-- IF S_MATCHDAYS_REMOVE --> <!-- IF S_MATCHDAYS_REMOVE -->
<input class="button2" type="submit" name="submit" value="{L_REMOVE_MATCHDAYS}" /> <input class="button2" type="submit" name="submit" value="{L_REMOVE_MATCHDAYS}" />
<input type="hidden" name="remove" value="1" /> <input type="hidden" name="remove" value="1" />
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_MATCHDAY_ADD --> <!-- IF S_MATCHDAY_ADD -->
<input class="button2" type="submit" name="submit" value="{L_GENERATE_MATCHDAY}" /> <input class="button2" type="submit" name="submit" value="{L_GENERATE_MATCHDAY}" />
<input type="hidden" name="add" value="1" /> <input type="hidden" name="add" value="1" />
<!-- ENDIF --> <!-- ENDIF -->
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<form style="display:inline;" id="change_delivery" method="post" action="{U_ACTION}"> <form style="display:inline;" id="change_delivery" method="post" action="{U_ACTION}">
<fieldset class="quick"> <fieldset class="quick">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<!-- IF not S_MATCHDAY_ADD and not S_MATCHDAYS_REMOVE --> <!-- IF not S_MATCHDAY_ADD and not S_MATCHDAYS_REMOVE -->
<input class="button2" type="submit" name="change_delivery" value="{L_CHANGE_DELIVERY}" /> <input class="button2" type="submit" name="change_delivery" value="{L_CHANGE_DELIVERY}" />
<!-- ENDIF --> <!-- ENDIF -->
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<h1>{L_MATCHDAY_DEF}</h1> <h1>{L_MATCHDAY_DEF}</h1>
<p>{L_MATCHDAY_DEF_EXPLAIN}</p> <p>{L_MATCHDAY_DEF_EXPLAIN}</p>
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_MATCHDAY}</th> <th>{L_MATCHDAY}</th>
<th style="width: 25%">{L_MATCHDAY_NAME}</th> <th style="width: 25%">{L_MATCHDAY_NAME}</th>
<th>{L_MATCHDAY_STATUS}</th> <th>{L_MATCHDAY_STATUS}</th>
<th>{L_MATCHDAY_DELIVERY}</th> <th>{L_MATCHDAY_DELIVERY}</th>
<th>{L_MATCHDAY_DELIVERY} 2</th> <th>{L_MATCHDAY_DELIVERY} 2</th>
<th>{L_MATCHDAY_DELIVERY} 3</th> <th>{L_MATCHDAY_DELIVERY} 3</th>
<th>{L_OPTIONS}</th> <th>{L_OPTIONS}</th>
<th>{L_ACTION}</th> <th>{L_ACTION}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- IF .matchdays --> <!-- IF .matchdays -->
<!-- BEGIN matchdays --> <!-- BEGIN matchdays -->
<tr class="{matchdays.ROW_CLASS}"> <tr class="{matchdays.ROW_CLASS}">
<td style="text-align: center;"><strong>{matchdays.MATCHDAY}</strong></td> <td style="text-align: center;"><strong>{matchdays.MATCHDAY}</strong></td>
<td>{matchdays.MATCHDAY_NAME}</td> <td>{matchdays.MATCHDAY_NAME}</td>
<td style="text-align: center;">{matchdays.MATCHDAY_STATUS}</td> <td style="text-align: center;">{matchdays.MATCHDAY_STATUS}</td>
<td>{matchdays.MATCHDAY_DELIVERY}</td> <td>{matchdays.MATCHDAY_DELIVERY}</td>
<td>{matchdays.MATCHDAY_DELIVERY_2}</td> <td>{matchdays.MATCHDAY_DELIVERY_2}</td>
<td>{matchdays.MATCHDAY_DELIVERY_3}</td> <td>{matchdays.MATCHDAY_DELIVERY_3}</td>
<td style="text-align: center;"><a href="{matchdays.U_EDIT}">{L_SETTINGS}</a></td> <td style="text-align: center;"><a href="{matchdays.U_EDIT}">{L_SETTINGS}</a></td>
<td style="text-align: center;"><!-- IF matchdays.U_DELETE --><a href="{matchdays.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td> <td style="text-align: center;"><!-- IF matchdays.U_DELETE --><a href="{matchdays.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>
</tr> </tr>
<!-- END matchdays --> <!-- END matchdays -->
<!-- ELSE --> <!-- ELSE -->
<tr> <tr>
<td colspan="4" class="row3">{L_NO_MATCHDAYS_CREATED}</td> <td colspan="4" class="row3">{L_NO_MATCHDAYS_CREATED}</td>
</tr> </tr>
<!-- ENDIF --> <!-- ENDIF -->
</tbody> </tbody>
</table> </table>
<!-- ENDIF --> <!-- ENDIF -->
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

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

View File

@@ -1,223 +1,223 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_ACP_FOOTBALL_RESULTS_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_RESULTS_MANAGE}</h1>
<p>{L_ACP_FOOTBALL_RESULTS_MANAGE_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_RESULTS_MANAGE_EXPLAIN}</p>
<h1 style="display:inline;">{L_SELECT_MATCHDAY}:</h1> <h1 style="display:inline;">{L_SELECT_MATCHDAY}:</h1>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<select name="s" id="match_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select> <select name="s" id="match_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<select name="l" id="match_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select> <select name="l" id="match_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<select name="m" id="match_matchday" onchange="this.form.submit();">{S_MATCHDAY_OPTIONS}</select> <select name="m" id="match_matchday" onchange="this.form.submit();">{S_MATCHDAY_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<!-- IF S_SUCCESS --> <!-- IF S_SUCCESS -->
<div class="successbox"> <div class="successbox">
<h3>{L_ADVICE}</h3> <h3>{L_ADVICE}</h3>
<p>{SUCCESS_MSG}</p> <p>{SUCCESS_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<form id="list" method="post" action="{U_ACTION}"> <form id="list" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{S_LEGEND}</legend> <legend>{S_LEGEND}</legend>
<p class="small" style="margin:0px">{S_TIME}</p> <p class="small" style="margin:0px">{S_TIME}</p>
<input type="hidden" name="s" value="{S_SEASON}" style="display:inline" /> <input type="hidden" name="s" value="{S_SEASON}" style="display:inline" />
<input type="hidden" name="l" value="{S_LEAGUE}" style="display:inline" /> <input type="hidden" name="l" value="{S_LEAGUE}" style="display:inline" />
<input type="hidden" name="m" value="{S_MATCHDAY}" style="display:inline" /> <input type="hidden" name="m" value="{S_MATCHDAY}" style="display:inline" />
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="marklist('list', 'delete_', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'delete_', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('list', 'delete_', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('list', 'delete_', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th title="{L_SELECT_EXPLAIN}" style="text-align:center">{L_SELECT}</th> <th title="{L_SELECT_EXPLAIN}" style="text-align:center">{L_SELECT}</th>
<th>{L_MATCH_BEGIN}</th> <th>{L_MATCH_BEGIN}</th>
<th colspan="3" style="text-align:center">{L_VS}</th> <th colspan="3" style="text-align:center">{L_VS}</th>
<th title="{L_RESULT_EXPLAIN}" colspan="3" style="text-align:center">{L_RESULT} ({RESULT_EXPLAIN})</th> <th title="{L_RESULT_EXPLAIN}" colspan="3" style="text-align:center">{L_RESULT} ({RESULT_EXPLAIN})</th>
<!-- IF S_KO_MATCHDAY --> <!-- IF S_KO_MATCHDAY -->
<th title="{L_OVERTIME_EXPLAIN}" colspan="3" style="text-align:center">{LABEL_FINALRESULT}</th> <th title="{L_OVERTIME_EXPLAIN}" colspan="3" style="text-align:center">{LABEL_FINALRESULT}</th>
<!-- ENDIF --> <!-- ENDIF -->
<th title="{L_MATCH_STATUS_TITLE}" style="text-align:center">{L_STATUS} </th> <th title="{L_MATCH_STATUS_TITLE}" style="text-align:center">{L_STATUS} </th>
<th title="{L_NO_VALUATION_EXPLAIN}" style="text-align:center">{L_NO_VALUATION}</th> <th title="{L_NO_VALUATION_EXPLAIN}" style="text-align:center">{L_NO_VALUATION}</th>
<th title="{L_DELETE_EXPLAIN}" style="text-align:center">{L_DELETE}</th> <th title="{L_DELETE_EXPLAIN}" style="text-align:center">{L_DELETE}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- IF .match --> <!-- IF .match -->
<!-- BEGIN match --> <!-- BEGIN match -->
<tr class="{match.ROW_CLASS}"> <tr class="{match.ROW_CLASS}">
<td style="text-align:center"> <td style="text-align:center">
<!-- IF match.EDIT --> <!-- IF match.EDIT -->
<input name="select_{match.NUMBER}" id="select_{match.NUMBER}" type="checkbox" <input name="select_{match.NUMBER}" id="select_{match.NUMBER}" type="checkbox"
class="radio" <!-- IF match.SELECT_CHECKED --> checked="checked"<!-- ENDIF --> /> class="radio" <!-- IF match.SELECT_CHECKED --> checked="checked"<!-- ENDIF --> />
<!-- ELSE --> <!-- ELSE -->
&nbsp; &nbsp;
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<td> {match.BEGIN}</td> <td> {match.BEGIN}</td>
<td>{match.HOME_NAME}</td> <td>{match.HOME_NAME}</td>
<td>:</td> <td>:</td>
<td style="text-align:left">{match.GUEST_NAME}</td> <td style="text-align:left">{match.GUEST_NAME}</td>
<td style="text-align:right"> <td style="text-align:right">
<!-- IF match.EDIT --> <!-- IF match.EDIT -->
<input name="goals_home_{match.NUMBER}" style="margin:0; width:30px;" <input name="goals_home_{match.NUMBER}" style="margin:0; width:30px;"
type="number" min="0" max="20" size="2" value="{match.GOALS_HOME}" type="number" min="0" max="20" size="2" value="{match.GOALS_HOME}"
onchange="document.getElementById('select_{match.NUMBER}').checked = true;" /> onchange="document.getElementById('select_{match.NUMBER}').checked = true;" />
<!-- ELSE --> <!-- ELSE -->
{match.GOALS_HOME} {match.GOALS_HOME}
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<td style="text-align:center;width:3px;">:</td> <td style="text-align:center;width:3px;">:</td>
<td style="text-align:left"> <td style="text-align:left">
<!-- IF match.EDIT --> <!-- IF match.EDIT -->
<input name="goals_guest_{match.NUMBER}" style="margin:0; width:30px;" <input name="goals_guest_{match.NUMBER}" style="margin:0; width:30px;"
type="number" min="0" max="20" size="2" value="{match.GOALS_GUEST}" type="number" min="0" max="20" size="2" value="{match.GOALS_GUEST}"
onchange="document.getElementById('select_{match.NUMBER}').checked = true;" /> onchange="document.getElementById('select_{match.NUMBER}').checked = true;" />
<!-- ELSE --> <!-- ELSE -->
{match.GOALS_GUEST} {match.GOALS_GUEST}
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<!-- IF S_KO_MATCHDAY --> <!-- IF S_KO_MATCHDAY -->
<td style="text-align:right"> <td style="text-align:right">
<!-- IF match.KO_MATCH --> <!-- IF match.KO_MATCH -->
<!-- IF match.EDIT --> <!-- IF match.EDIT -->
<input name="overtime_home_{match.NUMBER}" style="margin:0; width:30px;" <input name="overtime_home_{match.NUMBER}" style="margin:0; width:30px;"
type="number" min="0" max="20" size="2" value="{match.OVERTIME_HOME}" type="number" min="0" max="20" size="2" value="{match.OVERTIME_HOME}"
onchange="document.getElementById('select_{match.NUMBER}').checked = true;" /> onchange="document.getElementById('select_{match.NUMBER}').checked = true;" />
<!-- ELSE --> <!-- ELSE -->
{match.OVERTIME_HOME} {match.OVERTIME_HOME}
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<td style="text-align:center; width:3px;">:</td> <td style="text-align:center; width:3px;">:</td>
<td style="text-align:left"> <td style="text-align:left">
<!-- IF match.KO_MATCH --> <!-- IF match.KO_MATCH -->
<!-- IF match.EDIT --> <!-- IF match.EDIT -->
<input name="overtime_guest_{match.NUMBER}" style="margin:0; width:30px;" <input name="overtime_guest_{match.NUMBER}" style="margin:0; width:30px;"
type="number" min="0" max="20" size="2" value="{match.OVERTIME_GUEST}" type="number" min="0" max="20" size="2" value="{match.OVERTIME_GUEST}"
onchange="document.getElementById('select_{match.NUMBER}').checked = true;" /> onchange="document.getElementById('select_{match.NUMBER}').checked = true;" />
<!-- ELSE --> <!-- ELSE -->
{match.OVERTIME_GUEST} {match.OVERTIME_GUEST}
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<!-- ENDIF --> <!-- ENDIF -->
<td style="text-align:center"><input type="hidden" name="status" value="{match.STATUS}" />{match.STATUS_COLOR}</td> <td style="text-align:center"><input type="hidden" name="status" value="{match.STATUS}" />{match.STATUS_COLOR}</td>
<td style="text-align:center"> <td style="text-align:center">
<input name="no_valuation_{match.NUMBER}" type="checkbox" class="radio" <input name="no_valuation_{match.NUMBER}" type="checkbox" class="radio"
<!-- IF match.NO_VALUATION_CHECKED --> checked="checked"<!-- ENDIF --> <!-- IF match.NO_VALUATION_CHECKED --> checked="checked"<!-- ENDIF -->
onchange="document.getElementById('select_{match.NUMBER}').checked = true;" /> onchange="document.getElementById('select_{match.NUMBER}').checked = true;" />
</td> </td>
<td style="text-align:center"> <td style="text-align:center">
<input name="delete_{match.NUMBER}" type="checkbox" class="radio" <input name="delete_{match.NUMBER}" type="checkbox" class="radio"
onchange="document.getElementById('select_{match.NUMBER}').checked = true;" /> onchange="document.getElementById('select_{match.NUMBER}').checked = true;" />
</td> </td>
</tr> </tr>
<!-- END match --> <!-- END match -->
</tbody> </tbody>
</table> </table>
<p class="small"> <p class="small">
<a href="#" onclick="marklist('list', 'select_', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'select_', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('list', 'select_', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('list', 'select_', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<!-- IF S_EXTRA_RESULTS --> <!-- IF S_EXTRA_RESULTS -->
<br /> <br />
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th style="text-align:center">{L_SELECT}</th> <th style="text-align:center">{L_SELECT}</th>
<th style="text-align: left;">{L_QUESTION}</th> <th style="text-align: left;">{L_QUESTION}</th>
<th>{L_POSSIBLE_POINTS}</th> <th>{L_POSSIBLE_POINTS}</th>
<th>{L_EVALUATION}</th> <th>{L_EVALUATION}</th>
<th>{L_RESULT}</th> <th>{L_RESULT}</th>
<th>{L_STATUS} </th> <th>{L_STATUS} </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN extra_result --> <!-- BEGIN extra_result -->
<tr class="{extra_result.ROW_CLASS}"> <tr class="{extra_result.ROW_CLASS}">
<td style="text-align:center"> <td style="text-align:center">
<!-- IF extra_result.S_EDIT_EXTRA --> <!-- IF extra_result.S_EDIT_EXTRA -->
<input name="select{extra_result.EXTRA_NO}" id="select{extra_result.EXTRA_NO}" type="checkbox" class="radio" /> <input name="select{extra_result.EXTRA_NO}" id="select{extra_result.EXTRA_NO}" type="checkbox" class="radio" />
<!-- ELSE --> <!-- ELSE -->
&nbsp; &nbsp;
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<td>{extra_result.QUESTION}</td> <td>{extra_result.QUESTION}</td>
<td style="text-align: center;">{extra_result.EXTRA_POINTS}</td> <td style="text-align: center;">{extra_result.EXTRA_POINTS}</td>
<td style="text-align: center;" title="{extra_result.EVALUATION_TITLE}">{extra_result.EVALUATION}</td> <td style="text-align: center;" title="{extra_result.EVALUATION_TITLE}">{extra_result.EVALUATION}</td>
<td style="text-align: center;"> <td style="text-align: center;">
<!-- IF extra_result.S_EDIT_EXTRA --> <!-- IF extra_result.S_EDIT_EXTRA -->
<!-- IF extra_result.S_DISPLAY_TYPE == 1 --> <!-- IF extra_result.S_DISPLAY_TYPE == 1 -->
<!-- IF S_VIEW <> 'print' --> <!-- IF S_VIEW <> 'print' -->
<select {extra_result.S_MULTIPLE} name="extra{extra_result.EXTRA_NO}{extra_result.S_MULTIPLE_ARR}" <select {extra_result.S_MULTIPLE} name="extra{extra_result.EXTRA_NO}{extra_result.S_MULTIPLE_ARR}"
onchange="document.getElementById('select{extra_result.EXTRA_NO}').checked = true;"> onchange="document.getElementById('select{extra_result.EXTRA_NO}').checked = true;">
<!-- BEGIN extra_option --> <!-- BEGIN extra_option -->
<option {extra_result.extra_option.S_SELECTED} value="{extra_result.extra_option.OPTION_VALUE}">{extra_result.extra_option.OPTION_NAME}</option> <option {extra_result.extra_option.S_SELECTED} value="{extra_result.extra_option.OPTION_VALUE}">{extra_result.extra_option.OPTION_NAME}</option>
<!-- END extra_option --> <!-- END extra_option -->
</select> </select>
<!-- ELSE --> <!-- ELSE -->
_{extra_result.RESULT}_ _{extra_result.RESULT}_
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF extra_result.S_DISPLAY_TYPE == 2 --> <!-- IF extra_result.S_DISPLAY_TYPE == 2 -->
<!-- IF S_VIEW <> 'print' --> <!-- IF S_VIEW <> 'print' -->
<input style="display:inline; margin:0; padding:0;" type="text" name="extra{extra_result.EXTRA_NO}" size="15" maxlength="255" <input style="display:inline; margin:0; padding:0;" type="text" name="extra{extra_result.EXTRA_NO}" size="15" maxlength="255"
value="{extra_result.RESULT}" onchange="document.getElementById('select{extra_result.EXTRA_NO}').checked = true;"> value="{extra_result.RESULT}" onchange="document.getElementById('select{extra_result.EXTRA_NO}').checked = true;">
<!-- ELSE --> <!-- ELSE -->
_{extra_result.RESULT}_ _{extra_result.RESULT}_
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- ELSE --> <!-- ELSE -->
{extra_result.RESULT} {extra_result.RESULT}
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<td style="text-align:center"><input type="hidden" name="status" value="{extra_result.STATUS}" />{extra_result.STATUS_COLOR}</td> <td style="text-align:center"><input type="hidden" name="status" value="{extra_result.STATUS}" />{extra_result.STATUS_COLOR}</td>
</tr> </tr>
<!-- END extra_result --> <!-- END extra_result -->
</tbody> </tbody>
</table> </table>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_CASH_POINTS -->{L_CASH_POINTS} <input name="cash" type="checkbox" class="radio" <!-- IF S_CASH -->checked="checked"<!-- ENDIF --> /> <!-- ENDIF --> <!-- IF S_CASH_POINTS -->{L_CASH_POINTS} <input name="cash" type="checkbox" class="radio" <!-- IF S_CASH -->checked="checked"<!-- ENDIF --> /> <!-- ENDIF -->
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="edit" value="{L_SAVE}" />&nbsp; <input class="button1" type="submit" id="submit" name="edit" value="{L_SAVE}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<!-- ELSE --> <!-- ELSE -->
<tr> <tr>
<td colspan="14" class="row3">{L_NO_MATCHES}</td> <td colspan="14" class="row3">{L_NO_MATCHES}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<!-- ENDIF --> <!-- ENDIF -->
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE frame_results.html --> <!-- INCLUDE frame_results.html -->
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,105 +1,105 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF S_EDIT --> <!-- IF S_EDIT -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a> <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
<h1>{L_ACP_FOOTBALL_SEASONS_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_SEASONS_MANAGE}</h1>
<p>{L_SEASON_EDIT_EXPLAIN}</p> <p>{L_SEASON_EDIT_EXPLAIN}</p>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<form id="settings" method="post" action="{U_ACTION}"> <form id="settings" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{L_SEASON_DETAILS}</legend> <legend>{L_SEASON_DETAILS}</legend>
<dl> <dl>
<dt><label for="season">{L_SEASON}:</label></dt> <dt><label for="season">{L_SEASON}:</label></dt>
<dd><!-- IF not S_ADD_SEASON --><strong>{SEASON}</strong><!-- ENDIF --> <dd><!-- IF not S_ADD_SEASON --><strong>{SEASON}</strong><!-- ENDIF -->
<input name="s" type="<!-- IF S_ADD_SEASON -->text<!-- ELSE -->hidden<!-- ENDIF -->" id="season" value="{SEASON}" size="4" maxlength="4" /></dd> <input name="s" type="<!-- IF S_ADD_SEASON -->text<!-- ELSE -->hidden<!-- ENDIF -->" id="season" value="{SEASON}" size="4" maxlength="4" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="season_name">{L_SEASON_NAME}:</label><br /><span>{L_SEASON_NAME_EXPLAIN}</span></dt> <dt><label for="season_name">{L_SEASON_NAME}:</label><br /><span>{L_SEASON_NAME_EXPLAIN}</span></dt>
<dd><input name="season_name" type="text" id="season_name" value="{SEASON_NAME}" size="20" maxlength="20" /></dd> <dd><input name="season_name" type="text" id="season_name" value="{SEASON_NAME}" size="20" maxlength="20" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="season_short">{L_SEASON_SHORT}:</label><br /><span>{L_SEASON_SHORT_EXPLAIN}</span></dt> <dt><label for="season_short">{L_SEASON_SHORT}:</label><br /><span>{L_SEASON_SHORT_EXPLAIN}</span></dt>
<dd><input name="season_short" type="text" id="season_short" value="{SEASON_SHORT}" size="10" maxlength="10" /></dd> <dd><input name="season_short" type="text" id="season_short" value="{SEASON_SHORT}" size="10" maxlength="10" /></dd>
</dl> </dl>
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
<!-- IF S_ADD_SEASON --> <!-- IF S_ADD_SEASON -->
<input type="hidden" name="add" value="1" /> <input type="hidden" name="add" value="1" />
<!-- ENDIF --> <!-- ENDIF -->
<input type="hidden" name="edit" value="1" /> <input type="hidden" name="edit" value="1" />
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<!-- ELSE --> <!-- ELSE -->
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_ACP_FOOTBALL_SEASONS_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_SEASONS_MANAGE}</h1>
<p>{L_ACP_FOOTBALL_SEASONS_MANAGE_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_SEASONS_MANAGE_EXPLAIN}</p>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<form id="acp_football_seasons" method="post" action="{U_ACTION}"> <form id="acp_football_seasons" method="post" action="{U_ACTION}">
<fieldset class="quick"> <fieldset class="quick">
<!-- IF S_SEASON_ADD --> <!-- IF S_SEASON_ADD -->
{L_CREATE_SEASON}: <input type="text" name="s" value="" /> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> {L_CREATE_SEASON}: <input type="text" name="s" value="" /> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
<input type="hidden" name="add" value="1" /> <input type="hidden" name="add" value="1" />
<!-- ENDIF --> <!-- ENDIF -->
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<h1>{L_SEASON_DEF}</h1> <h1>{L_SEASON_DEF}</h1>
<p>{L_SEASON_DEF_EXPLAIN}</p> <p>{L_SEASON_DEF_EXPLAIN}</p>
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_SEASON}</th> <th>{L_SEASON}</th>
<th style="width: 35%">{L_SEASON_NAME}</th> <th style="width: 35%">{L_SEASON_NAME}</th>
<th>{L_SEASON_SHORT}</th> <th>{L_SEASON_SHORT}</th>
<th>{L_LEAGUES}</th> <th>{L_LEAGUES}</th>
<th>{L_OPTIONS}</th> <th>{L_OPTIONS}</th>
<th>{L_ACTION}</th> <th>{L_ACTION}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- IF .seasons --> <!-- IF .seasons -->
<!-- BEGIN seasons --> <!-- BEGIN seasons -->
<tr class="{seasons.ROW_CLASS}"> <tr class="{seasons.ROW_CLASS}">
<td style="text-align: center;"><strong>{seasons.SEASON}</strong></td> <td style="text-align: center;"><strong>{seasons.SEASON}</strong></td>
<td>{seasons.SEASON_NAME}</td> <td>{seasons.SEASON_NAME}</td>
<td>{seasons.SEASON_SHORT}</td> <td>{seasons.SEASON_SHORT}</td>
<td style="text-align: center;">{seasons.LEAGUES}</td> <td style="text-align: center;">{seasons.LEAGUES}</td>
<td style="text-align: center;"><a href="{seasons.U_EDIT}">{L_SETTINGS}</a></td> <td style="text-align: center;"><a href="{seasons.U_EDIT}">{L_SETTINGS}</a></td>
<td style="text-align: center;"><!-- IF seasons.U_DELETE --><a href="{seasons.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td> <td style="text-align: center;"><!-- IF seasons.U_DELETE --><a href="{seasons.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>
</tr> </tr>
<!-- END seasons --> <!-- END seasons -->
<!-- ELSE --> <!-- ELSE -->
<tr> <tr>
<td colspan="4" class="row3">{L_NO_SEASONS_CREATED}</td> <td colspan="4" class="row3">{L_NO_SEASONS_CREATED}</td>
</tr> </tr>
<!-- ENDIF --> <!-- ENDIF -->
</tbody> </tbody>
</table> </table>
<!-- ENDIF --> <!-- ENDIF -->
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,164 +1,164 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF S_EDIT --> <!-- IF S_EDIT -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a> <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
<h1>{L_ACP_FOOTBALL_TEAMS_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_TEAMS_MANAGE}</h1>
<p>{L_TEAM_EDIT_EXPLAIN}</p> <p>{L_TEAM_EDIT_EXPLAIN}</p>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<form id="settings" method="post" action="{U_ACTION}"> <form id="settings" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{L_TEAM_DETAILS}</legend> <legend>{L_TEAM_DETAILS}</legend>
<dl> <dl>
<dt><label for="team">{L_SEASON}:</label></dt> <dt><label for="team">{L_SEASON}:</label></dt>
<dd><strong>{SEASON_NAME}</strong><input name="s" type="hidden" id="season" value="{SEASON}" /></dd> <dd><strong>{SEASON_NAME}</strong><input name="s" type="hidden" id="season" value="{SEASON}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="team">{L_LEAGUE}:</label></dt> <dt><label for="team">{L_LEAGUE}:</label></dt>
<dd><strong>{LEAGUE_NAME}</strong><input name="l" type="hidden" id="league" value="{LEAGUE}" /></dd> <dd><strong>{LEAGUE_NAME}</strong><input name="l" type="hidden" id="league" value="{LEAGUE}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="team">{L_TEAM}:</label></dt> <dt><label for="team">{L_TEAM}:</label></dt>
<dd><!-- IF not S_ADD_TEAM --><strong>{TEAM}</strong><!-- ENDIF --> <dd><!-- IF not S_ADD_TEAM --><strong>{TEAM}</strong><!-- ENDIF -->
<input name="t" type="<!-- IF S_ADD_TEAM -->text<!-- ELSE -->hidden<!-- ENDIF -->" id="team" value="{TEAM}" /></dd> <input name="t" type="<!-- IF S_ADD_TEAM -->text<!-- ELSE -->hidden<!-- ENDIF -->" id="team" value="{TEAM}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="team_name">{L_TEAM_NAME}:</label></dt> <dt><label for="team_name">{L_TEAM_NAME}:</label></dt>
<dd><input name="team_name" type="text" id="team_name" size="30" maxlength="30" value="{TEAM_NAME}" /></dd> <dd><input name="team_name" type="text" id="team_name" size="30" maxlength="30" value="{TEAM_NAME}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="team_short">{L_TEAM_SHORT}:</label><br /><span>{L_TEAM_SHORT_EXPLAIN}</span></dt> <dt><label for="team_short">{L_TEAM_SHORT}:</label><br /><span>{L_TEAM_SHORT_EXPLAIN}</span></dt>
<dd><input name="team_short" type="text" id="team_short" size="10" maxlength="10" value="{TEAM_SHORT}" /></dd> <dd><input name="team_short" type="text" id="team_short" size="10" maxlength="10" value="{TEAM_SHORT}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="team_symbol">{L_TEAM_SYMBOL}:</label><br /><span>{L_TEAM_SYMBOL_EXPLAIN}</span></dt> <dt><label for="team_symbol">{L_TEAM_SYMBOL}:</label><br /><span>{L_TEAM_SYMBOL_EXPLAIN}</span></dt>
<dd><span> <dd><span>
<select style="vertical-align:top;" name="team_symbol" id="team_symbol" <select style="vertical-align:top;" name="team_symbol" id="team_symbol"
onchange="document.getElementById('teamsymbol').src = '{PHPBB_ROOT_PATH}images/flags/' + this.value;"> onchange="document.getElementById('teamsymbol').src = '{PHPBB_ROOT_PATH}images/flags/' + this.value;">
{TEAM_SYMBOL_OPTIONS} {TEAM_SYMBOL_OPTIONS}
</select>&nbsp;&nbsp;&nbsp;<img src="{TEAM_IMAGE}" id="teamsymbol" alt="{TEAM_NAME}" title="{TEAM_NAME}" /></span></dd> </select>&nbsp;&nbsp;&nbsp;<img src="{TEAM_IMAGE}" id="teamsymbol" alt="{TEAM_NAME}" title="{TEAM_NAME}" /></span></dd>
</dl> </dl>
<!-- IF S_KO_LEAGUE --> <!-- IF S_KO_LEAGUE -->
<dl> <dl>
<dt><label for="team_group">{L_TEAM_GROUP}:</label><br /><span>{L_TEAM_GROUP_EXPLAIN}</span></dt> <dt><label for="team_group">{L_TEAM_GROUP}:</label><br /><span>{L_TEAM_GROUP_EXPLAIN}</span></dt>
<dd><input name="team_group" type="text" id="team_group" size="1" maxlength="1" value="{TEAM_GROUP}" /></dd> <dd><input name="team_group" type="text" id="team_group" size="1" maxlength="1" value="{TEAM_GROUP}" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="team_round">{L_TEAM_ROUND}:</label><br /><span>{L_TEAM_ROUND_EXPLAIN}</span></dt> <dt><label for="team_round">{L_TEAM_ROUND}:</label><br /><span>{L_TEAM_ROUND_EXPLAIN}</span></dt>
<dd><select name="team_round" id="team_round">{TEAM_MATCHDAY_OPTIONS}</select></dd> <dd><select name="team_round" id="team_round">{TEAM_MATCHDAY_OPTIONS}</select></dd>
</dl> </dl>
<input type="hidden" name="ko_league" value="1" /> <input type="hidden" name="ko_league" value="1" />
<!-- ENDIF --> <!-- ENDIF -->
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
<!-- IF S_ADD_TEAM --> <!-- IF S_ADD_TEAM -->
<input type="hidden" name="add" value="1" /> <input type="hidden" name="add" value="1" />
<!-- ENDIF --> <!-- ENDIF -->
<input type="hidden" name="edit" value="1" /> <input type="hidden" name="edit" value="1" />
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<!-- ELSE --> <!-- ELSE -->
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_ACP_FOOTBALL_TEAMS_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_TEAMS_MANAGE}</h1>
<p>{L_ACP_FOOTBALL_TEAMS_MANAGE_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_TEAMS_MANAGE_EXPLAIN}</p>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<h1 style="display:inline;">{L_SELECT_LEAGUE}:</h1> <h1 style="display:inline;">{L_SELECT_LEAGUE}:</h1>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<select name="s" id="team_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select> <select name="s" id="team_season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form style="display:inline;" method="post" action="{U_ACTION}"> <form style="display:inline;" method="post" action="{U_ACTION}">
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<select name="l" id="team_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select> <select name="l" id="team_league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</form> </form>
<form id="add_team" method="post" action="{U_ACTION}"> <form id="add_team" method="post" action="{U_ACTION}">
<fieldset class="quick"> <fieldset class="quick">
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<input type="hidden" name="ko_league" value="{S_KO_LEAGUE}" /> <input type="hidden" name="ko_league" value="{S_KO_LEAGUE}" />
<!-- IF S_TEAM_ADD --> <!-- IF S_TEAM_ADD -->
{L_ADD_TEAM}: <select name="t" id="old_team">{S_TEAM_OPTIONS}</select> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> {L_ADD_TEAM}: <select name="t" id="old_team">{S_TEAM_OPTIONS}</select> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
<input type="hidden" name="add" value="1" /> <input type="hidden" name="add" value="1" />
<!-- ENDIF --> <!-- ENDIF -->
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<h1>{L_TEAM_DEF} {S_TEAMS}</h1> <h1>{L_TEAM_DEF} {S_TEAMS}</h1>
<p>{L_TEAM_DEF_EXPLAIN}</p> <p>{L_TEAM_DEF_EXPLAIN}</p>
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_TEAM}</th> <th>{L_TEAM}</th>
<th></th> <th></th>
<th style="width: 25%">{L_TEAM_NAME}</th> <th style="width: 25%">{L_TEAM_NAME}</th>
<th></th> <th></th>
<th>{L_TEAM_MATCHES}</th> <th>{L_TEAM_MATCHES}</th>
<th>{L_TEAM_AWAY}</th> <th>{L_TEAM_AWAY}</th>
<!-- IF S_KO_LEAGUE --> <!-- IF S_KO_LEAGUE -->
<th>{L_GROUP}</th> <th>{L_GROUP}</th>
<th>{L_MATCHDAY}</th> <th>{L_MATCHDAY}</th>
<!-- ENDIF --> <!-- ENDIF -->
<th>{L_OPTIONS}</th> <th>{L_OPTIONS}</th>
<th>{L_ACTION}</th> <th>{L_ACTION}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- IF .teams --> <!-- IF .teams -->
<!-- BEGIN teams --> <!-- BEGIN teams -->
<tr class="{teams.ROW_CLASS}"> <tr class="{teams.ROW_CLASS}">
<td style="text-align: center;"><strong>{teams.TEAM}</strong></td> <td style="text-align: center;"><strong>{teams.TEAM}</strong></td>
<td style="text-align: center;"><img src="{teams.TEAM_IMAGE}" alt="{teams.TEAM_NAME}" title="{teams.TEAM_NAME}" width="20" height="20" /></td> <td style="text-align: center;"><img src="{teams.TEAM_IMAGE}" alt="{teams.TEAM_NAME}" title="{teams.TEAM_NAME}" width="20" height="20" /></td>
<td>{teams.TEAM_NAME}</td> <td>{teams.TEAM_NAME}</td>
<td>{teams.TEAM_SHORT}</td> <td>{teams.TEAM_SHORT}</td>
<td>{teams.TEAM_MATCHES}</td> <td>{teams.TEAM_MATCHES}</td>
<td>{teams.TEAM_HOME}</td> <td>{teams.TEAM_HOME}</td>
<!-- IF S_KO_LEAGUE --> <!-- IF S_KO_LEAGUE -->
<td style="text-align: center;">{teams.TEAM_GROUP}</td> <td style="text-align: center;">{teams.TEAM_GROUP}</td>
<td style="text-align: center;">{teams.TEAM_ROUND}</td> <td style="text-align: center;">{teams.TEAM_ROUND}</td>
<!-- ENDIF --> <!-- ENDIF -->
<td style="text-align: center;"><a href="{teams.U_EDIT}">{L_SETTINGS}</a></td> <td style="text-align: center;"><a href="{teams.U_EDIT}">{L_SETTINGS}</a></td>
<td style="text-align: center;"><!-- IF teams.U_DELETE --><a href="{teams.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td> <td style="text-align: center;"><!-- IF teams.U_DELETE --><a href="{teams.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>
</tr> </tr>
<!-- END teams --> <!-- END teams -->
<!-- ELSE --> <!-- ELSE -->
<tr> <tr>
<td colspan="2" class="row3">{L_NO_TEAMS_CREATED}</td> <td colspan="2" class="row3">{L_NO_TEAMS_CREATED}</td>
</tr> </tr>
<!-- ENDIF --> <!-- ENDIF -->
</tbody> </tbody>
</table> </table>
<!-- IF S_MATCHES --> {S_MATCHES} {L_TEAM_MATCHES} <!-- ENDIF --> <!-- IF S_MATCHES --> {S_MATCHES} {L_TEAM_MATCHES} <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,430 +1,430 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<h1>{L_ACP_FOOTBALL_UPDATE_MANAGE}</h1> <h1>{L_ACP_FOOTBALL_UPDATE_MANAGE}</h1>
<p>{L_ACP_FOOTBALL_UPDATE_MANAGE_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_UPDATE_MANAGE_EXPLAIN}</p>
<!-- IF S_SUCCESS --> <!-- IF S_SUCCESS -->
<div class="successbox"> <div class="successbox">
<h3>{L_ADVICE}</h3> <h3>{L_ADVICE}</h3>
<p>{SUCCESS_MSG}</p> <p>{SUCCESS_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<form id="settings" method="post" action="{U_ACTION}"> <form id="settings" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{L_SOURCE}</legend> <legend>{L_SOURCE}</legend>
<dl> <dl>
<dt><label for="xml_season_url">{L_XML_SEASON_URL}:</label><br /><span>{L_XML_SEASON_URL_EXPLAIN}</span></dt> <dt><label for="xml_season_url">{L_XML_SEASON_URL}:</label><br /><span>{L_XML_SEASON_URL_EXPLAIN}</span></dt>
<dd> <dd>
<input name="xml_season_url" type="text" id="xml_season_url" value="{XML_SEASON_URL}" size="60" maxlength="100" <input name="xml_season_url" type="text" id="xml_season_url" value="{XML_SEASON_URL}" size="60" maxlength="100"
<!-- IF not S_ALLOW_URL_FOPEN --> DISABLED <!-- ENDIF -->/> <!-- IF not S_ALLOW_URL_FOPEN --> DISABLED <!-- ENDIF -->/>
<input class="button1" type="submit" id="load_xml_season" name="load_xml_season" value="{L_LOAD}" />&nbsp; <input class="button1" type="submit" id="load_xml_season" name="load_xml_season" value="{L_LOAD}" />&nbsp;
<!-- IF not S_ALLOW_URL_FOPEN --> <!-- IF not S_ALLOW_URL_FOPEN -->
<br /> <span style="color: red;">{L_ALLOW_URL_FOPEN}</span> <br /> <span style="color: red;">{L_ALLOW_URL_FOPEN}</span>
<!-- ENDIF --> <!-- ENDIF -->
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>
</form> </form>
<!-- IF S_CHOOSE --> <!-- IF S_CHOOSE -->
<form method="post" action="{U_CHOOSE_ACTION}"> <form method="post" action="{U_CHOOSE_ACTION}">
<fieldset> <fieldset>
<legend>{L_CHOOSE_LEAGUES}</legend> <legend>{L_CHOOSE_LEAGUES}</legend>
<dl> <dl>
<dt><label for="xs">{L_SOURCE}:</label></dt> <dt><label for="xs">{L_SOURCE}:</label></dt>
<dd> <dd>
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<input type="hidden" name="xml_season_url" value="{XML_SEASON_URL}" /> <input type="hidden" name="xml_season_url" value="{XML_SEASON_URL}" />
<input type="hidden" name="league_name" value="{S_LEAGUE_NAME}" /> <input type="hidden" name="league_name" value="{S_LEAGUE_NAME}" />
<input type="hidden" name="xcode" value="{S_XCODE}" /> <input type="hidden" name="xcode" value="{S_XCODE}" />
<select name="xs" id="xs" onchange="this.form.submit();">{S_XSEASON_OPTIONS}</select> <select name="xs" id="xs" onchange="this.form.submit();">{S_XSEASON_OPTIONS}</select>
</div> </div>
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<select name="xl" id="xl" onchange="this.form.submit();">{S_XLEAGUE_OPTIONS}</select> <select name="xl" id="xl" onchange="this.form.submit();">{S_XLEAGUE_OPTIONS}</select>
</div> </div>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="s">{L_TARGET}:</label></dt> <dt><label for="s">{L_TARGET}:</label></dt>
<dd> <dd>
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<select name="s" id="season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select> <select name="s" id="season" onchange="this.form.submit();">{S_SEASON_OPTIONS}</select>
</div> </div>
<div style="display:inline; margin:0; padding:0;"> <div style="display:inline; margin:0; padding:0;">
<select name="l" id="league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select> <select name="l" id="league" onchange="this.form.submit();">{S_LEAGUE_OPTIONS}</select>
</div> </div>
<div title="{L_NEW_LEAGUE_EXPLAIN}" style="display:inline; margin:0; padding:0;"> <div title="{L_NEW_LEAGUE_EXPLAIN}" style="display:inline; margin:0; padding:0;">
<input name="new_league" type="text" id="new_league" value="{NEW_LEAGUE}" size="2" maxlength="2" /> <input name="new_league" type="text" id="new_league" value="{NEW_LEAGUE}" size="2" maxlength="2" />
</div> </div>
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<!-- IF S_LEAGUE --> <!-- IF S_LEAGUE -->
<input class="button1" type="submit" id="team_mapping" name="team_mapping" value="{L_COMPARE_UPDATE}" />&nbsp; <input class="button1" type="submit" id="team_mapping" name="team_mapping" value="{L_COMPARE_UPDATE}" />&nbsp;
<!-- ELSE --> <!-- ELSE -->
<input class="button1" type="submit" id="load_xml_league" name="load_xml_league" value="{L_SHOW_UPDATE}" />&nbsp; <input class="button1" type="submit" id="load_xml_league" name="load_xml_league" value="{L_SHOW_UPDATE}" />&nbsp;
<!-- ENDIF --> <!-- ENDIF -->
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_TEAMS --> <!-- IF S_TEAMS -->
<form id="teams" method="post" action="{U_ACTION}"> <form id="teams" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{L_TEAM_MAPPING}</legend> <legend>{L_TEAM_MAPPING}</legend>
<!-- IF S_MISSING_TEAMS --><span style="color: red;">{S_MISSING_TEAMS}</span><!-- ENDIF --> <!-- IF S_MISSING_TEAMS --><span style="color: red;">{S_MISSING_TEAMS}</span><!-- ENDIF -->
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_TEAM}</th> <th>{L_TEAM}</th>
<th style="width: 25%">{L_TEAM_NAME}</th> <th style="width: 25%">{L_TEAM_NAME}</th>
<th>{L_TEAM_NAME_SHORT}</th> <th>{L_TEAM_NAME_SHORT}</th>
<th>{L_TEAM_MAPPING}</th> <th>{L_TEAM_MAPPING}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN teams --> <!-- BEGIN teams -->
<tr class="{teams.ROW_CLASS}"> <tr class="{teams.ROW_CLASS}">
<td>{teams.TEAM_ID_XML}</td> <td>{teams.TEAM_ID_XML}</td>
<td><img src="{teams.TEAM_IMAGE_XML}" id="teamsymbol" alt="{teams.TEAM_NAME_XML}" title="{teams.TEAM_NAME_XML}" />&nbsp;&nbsp;&nbsp; <td><img src="{teams.TEAM_IMAGE_XML}" id="teamsymbol" alt="{teams.TEAM_NAME_XML}" title="{teams.TEAM_NAME_XML}" />&nbsp;&nbsp;&nbsp;
{teams.TEAM_NAME_XML} {teams.TEAM_NAME_XML}
</td> </td>
<td>{teams.TEAM_NAME_SHORT_XML}</td> <td>{teams.TEAM_NAME_SHORT_XML}</td>
<td <!-- IF teams.DUPLICATE_TEAM -->title="{L_DUPLICATE_TEAM}" bgcolor=#ECD5D8<!-- ENDIF -->> <td <!-- IF teams.DUPLICATE_TEAM -->title="{L_DUPLICATE_TEAM}" bgcolor=#ECD5D8<!-- ENDIF -->>
<select name="team_id_db_{teams.TEAM_ID_XML}" id="team_id_{teams.TEAM_ID_XML}" onchange="this.form.submit();">{teams.TEAM_OPTIONS}</select> <select name="team_id_db_{teams.TEAM_ID_XML}" id="team_id_{teams.TEAM_ID_XML}" onchange="this.form.submit();">{teams.TEAM_OPTIONS}</select>
</td> </td>
</tr> </tr>
<!-- END teams --> <!-- END teams -->
</tbody> </tbody>
</table> </table>
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<input type="hidden" name="xml_season_url" value="{XML_SEASON_URL}" /> <input type="hidden" name="xml_season_url" value="{XML_SEASON_URL}" />
<input type="hidden" name="league_name" value="{S_LEAGUE_NAME}" /> <input type="hidden" name="league_name" value="{S_LEAGUE_NAME}" />
<input type="hidden" name="xml_ary" value="{XML_ARY}" /> <input type="hidden" name="xml_ary" value="{XML_ARY}" />
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<input type="hidden" name="xs" value="{S_XSEASON}" /> <input type="hidden" name="xs" value="{S_XSEASON}" />
<input type="hidden" name="xl" value="{S_XLEAGUE}" /> <input type="hidden" name="xl" value="{S_XLEAGUE}" />
<input type="hidden" name="xcode" value="{S_XCODE}" /> <input type="hidden" name="xcode" value="{S_XCODE}" />
<input class="button1" type="submit" id="submit" name="map_teams" value="{L_MAP_TEAMS}" />&nbsp; <input class="button1" type="submit" id="submit" name="map_teams" value="{L_MAP_TEAMS}" />&nbsp;
<input class="button1" type="submit" id="submit" name="choose" value="{L_CHOOSE_OTHER_LEAGUE}" />&nbsp; <input class="button1" type="submit" id="submit" name="choose" value="{L_CHOOSE_OTHER_LEAGUE}" />&nbsp;
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
</form> </form>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_LIST --> <!-- IF S_LIST -->
<form id="list" method="post" action="{U_ACTION}"> <form id="list" method="post" action="{U_ACTION}">
<!-- IF S_INSERT_LEAGUE --><h1>{L_INSERT_LEAGUE}</h3><!-- ELSE --><h1>{L_UPDATE_LEAGUE}</h3><!-- ENDIF --> <!-- IF S_INSERT_LEAGUE --><h1>{L_INSERT_LEAGUE}</h3><!-- ELSE --><h1>{L_UPDATE_LEAGUE}</h3><!-- ENDIF -->
<fieldset> <fieldset>
<dl> <dl>
<dt><label for="xml_season_url">{L_SEASON}:</label></dt> <dt><label for="xml_season_url">{L_SEASON}:</label></dt>
<dd>{S_SEASON}</dd> <dd>{S_SEASON}</dd>
</dl> </dl>
<dl> <dl>
<dt><label for="xml_season_url">{L_LEAGUE}:</label></dt> <dt><label for="xml_season_url">{L_LEAGUE}:</label></dt>
<dd>{S_LEAGUE}</dd> <dd>{S_LEAGUE}</dd>
</dl> </dl>
<dl> <dl>
<dt><label for="xml_season_url">{L_LEAGUE_NAME}:</label></dt> <dt><label for="xml_season_url">{L_LEAGUE_NAME}:</label></dt>
<dd>{S_LEAGUE_NAME}</dd> <dd>{S_LEAGUE_NAME}</dd>
</dl> </dl>
</fieldset> </fieldset>
<!-- IF S_INSERT_SEASON --> <!-- IF S_INSERT_SEASON -->
<fieldset> <fieldset>
<legend>{L_INSERT_SEASON}</legend> <legend>{L_INSERT_SEASON}</legend>
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_SEASON}</th> <th>{L_SEASON}</th>
<th>{L_SEASON_NAME}</th> <th>{L_SEASON_NAME}</th>
<th>{L_SEASON_SHORT}</th> <th>{L_SEASON_SHORT}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN footb_seasons --> <!-- BEGIN footb_seasons -->
{footb_seasons.TPL} {footb_seasons.TPL}
<!-- END footb_seasons --> <!-- END footb_seasons -->
</tbody> </tbody>
</table> </table>
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_INSERT_LEAGUE --> <!-- IF S_INSERT_LEAGUE -->
<fieldset> <fieldset>
<legend>{L_INSERT_LEAGUE}</legend> <legend>{L_INSERT_LEAGUE}</legend>
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th style="width: 20%">{L_LEAGUE_NAME}</th> <th style="width: 20%">{L_LEAGUE_NAME}</th>
<th>{L_LEAGUE_SHORTCUT}</th> <th>{L_LEAGUE_SHORTCUT}</th>
<th>{L_LEAGUE_TYPE}</th> <th>{L_LEAGUE_TYPE}</th>
<th>{L_LEAGUE_MATCHDAYS}</th> <th>{L_LEAGUE_MATCHDAYS}</th>
<th>{L_LEAGUE_MATCHES}</th> <th>{L_LEAGUE_MATCHES}</th>
<th>{L_LEAGUE_POINTS_MODE}</th> <th>{L_LEAGUE_POINTS_MODE}</th>
<th>{L_LEAGUE_BET_IN_TIME}</th> <th>{L_LEAGUE_BET_IN_TIME}</th>
<th>{L_BET_TYPE_KO}</th> <th>{L_BET_TYPE_KO}</th>
<th>{L_OTHER_FIELDS}</th> <th>{L_OTHER_FIELDS}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN footb_leagues --> <!-- BEGIN footb_leagues -->
{footb_leagues.TPL} {footb_leagues.TPL}
<!-- END footb_leagues --> <!-- END footb_leagues -->
</tbody> </tbody>
</table> </table>
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF .footb_matchdays --> <!-- IF .footb_matchdays -->
<fieldset> <fieldset>
<legend>{DO_MATCHDAYS}</legend> <legend>{DO_MATCHDAYS}</legend>
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="marklist('list', 'FOOTB_MATCHDAYS_', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'FOOTB_MATCHDAYS_', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('list', 'FOOTB_MATCHDAYS_', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('list', 'FOOTB_MATCHDAYS_', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<!-- ENDIF --> <!-- ENDIF -->
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_MATCHDAY}</th> <th>{L_MATCHDAY}</th>
<th>{L_MATCHDAY_STATUS} <th>{L_MATCHDAY_STATUS}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matchdays_status" id="update_matchdays_status" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matchdays_status" id="update_matchdays_status" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th>{L_MATCHDAY_DELIVERY} <th>{L_MATCHDAY_DELIVERY}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matchdays_delivery_date" id="update_matchdays_delivery_date" type="checkbox" class="radio" /> <input title="{L_UPDATE_THIS}" name="update_matchdays_delivery_date" id="update_matchdays_delivery_date" type="checkbox" class="radio" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th>{L_MATCHDAY_DELIVERY} 2 <th>{L_MATCHDAY_DELIVERY} 2
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matchdays_delivery_date_2" id="update_matchdays_delivery_date_2" type="checkbox" class="radio" /> <input title="{L_UPDATE_THIS}" name="update_matchdays_delivery_date_2" id="update_matchdays_delivery_date_2" type="checkbox" class="radio" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th>{L_MATCHDAY_DELIVERY} 3 <th>{L_MATCHDAY_DELIVERY} 3
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matchdays_delivery_date_3" id="update_matchdays_delivery_date_3" type="checkbox" class="radio" /> <input title="{L_UPDATE_THIS}" name="update_matchdays_delivery_date_3" id="update_matchdays_delivery_date_3" type="checkbox" class="radio" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th style="width: 25%">{L_MATCHDAY_NAME} <th style="width: 25%">{L_MATCHDAY_NAME}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matchdays_matchday_name" id="update_matchdays_matchday_name" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matchdays_matchday_name" id="update_matchdays_matchday_name" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th>{L_MATCHES} <th>{L_MATCHES}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matchdays_matches" id="update_matchdays_matches" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matchdays_matches" id="update_matchdays_matches" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<th title="{L_SELECT_EXPLAIN}" style="text-align:center">{L_SELECT}</th> <th title="{L_SELECT_EXPLAIN}" style="text-align:center">{L_SELECT}</th>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN footb_matchdays --> <!-- BEGIN footb_matchdays -->
{footb_matchdays.TPL} {footb_matchdays.TPL}
<!-- END footb_matchdays --> <!-- END footb_matchdays -->
</tbody> </tbody>
</table> </table>
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="marklist('list', 'FOOTB_MATCHDAYS_', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'FOOTB_MATCHDAYS_', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('list', 'FOOTB_MATCHDAYS_', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('list', 'FOOTB_MATCHDAYS_', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<!-- ENDIF --> <!-- ENDIF -->
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF .footb_teams --> <!-- IF .footb_teams -->
<fieldset> <fieldset>
<legend>{DO_TEAMS}</legend> <legend>{DO_TEAMS}</legend>
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="marklist('list', 'FOOTB_TEAMS_', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'FOOTB_TEAMS_', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('list', 'FOOTB_TEAMS_', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('list', 'FOOTB_TEAMS_', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<!-- ENDIF --> <!-- ENDIF -->
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_TEAM}</th> <th>{L_TEAM}</th>
<th style="width: 25%">{L_TEAM_NAME} <th style="width: 25%">{L_TEAM_NAME}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_teams_team_name" id="update_teams_team_nmae" type="checkbox" class="radio" /> <input title="{L_UPDATE_THIS}" name="update_teams_team_name" id="update_teams_team_nmae" type="checkbox" class="radio" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th>{L_TEAM_NAME_SHORT} <th>{L_TEAM_NAME_SHORT}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_teams_team_name_short" id="update_teams_team_name_short" type="checkbox" class="radio" /> <input title="{L_UPDATE_THIS}" name="update_teams_team_name_short" id="update_teams_team_name_short" type="checkbox" class="radio" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th>{L_TEAM_SYMBOL} <th>{L_TEAM_SYMBOL}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_teams_team_symbol" id="update_teams_team_symbol" type="checkbox" class="radio" /> <input title="{L_UPDATE_THIS}" name="update_teams_team_symbol" id="update_teams_team_symbol" type="checkbox" class="radio" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th>{L_GROUP} <th>{L_GROUP}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_teams_group_id" id="update_teams_group_id" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_teams_group_id" id="update_teams_group_id" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th>{L_MATCHDAY} <th>{L_MATCHDAY}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_teams_matchday" id="update_teams_matchday" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_teams_matchday" id="update_teams_matchday" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<th title="{L_SELECT_EXPLAIN}" style="text-align:center">{L_SELECT}</th> <th title="{L_SELECT_EXPLAIN}" style="text-align:center">{L_SELECT}</th>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN footb_teams --> <!-- BEGIN footb_teams -->
{footb_teams.TPL} {footb_teams.TPL}
<!-- END footb_teams --> <!-- END footb_teams -->
</tbody> </tbody>
</table> </table>
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="marklist('list', 'FOOTB_TEAMS_', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'FOOTB_TEAMS_', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('list', 'FOOTB_TEAMS_', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('list', 'FOOTB_TEAMS_', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<!-- ENDIF --> <!-- ENDIF -->
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF .footb_matches --> <!-- IF .footb_matches -->
<fieldset> <fieldset>
<legend>{DO_MATCHES}</legend> <legend>{DO_MATCHES}</legend>
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<p class="small"><input name="update_neg_status" id="update_neg_status" type="checkbox" class="radio" {S_CHECK_NEG_STATUS} /> {L_UPDATE_NEG_STATUS}</p> <p class="small"><input name="update_neg_status" id="update_neg_status" type="checkbox" class="radio" {S_CHECK_NEG_STATUS} /> {L_UPDATE_NEG_STATUS}</p>
<p class="small"><input name="update_same_status" id="update_same_status" type="checkbox" class="radio" {S_CHECK_SAME_STATUS} /> {L_UPDATE_SAME_STATUS}</p> <p class="small"><input name="update_same_status" id="update_same_status" type="checkbox" class="radio" {S_CHECK_SAME_STATUS} /> {L_UPDATE_SAME_STATUS}</p>
<p class="small"><input name="update_only_final" id="update_only_final" type="checkbox" class="radio" {S_CHECK_ONLY_FINAL} /> {L_UPDATE_ONLY_FINAL}</p> <p class="small"><input name="update_only_final" id="update_only_final" type="checkbox" class="radio" {S_CHECK_ONLY_FINAL} /> {L_UPDATE_ONLY_FINAL}</p>
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="marklist('list', 'FOOTB_MATCHES_', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'FOOTB_MATCHES_', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('list', 'FOOTB_MATCHES_', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('list', 'FOOTB_MATCHES_', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<!-- ENDIF --> <!-- ENDIF -->
<table class="type_f"> <table class="type_f">
<thead> <thead>
<tr> <tr>
<th>{L_MATCHDAY} <th>{L_MATCHDAY}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matches_matchday" id="update_matches_matchday" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matches_matchday" id="update_matches_matchday" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --><br /> <!-- ENDIF --><br />
{L_MATCH_NUMBER} {L_MATCH_NUMBER}
</th> </th>
<th>{L_MATCH_BEGIN} <th>{L_MATCH_BEGIN}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matches_match_datetime" id="update_matches_match_datetime" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matches_match_datetime" id="update_matches_match_datetime" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --><br /> <!-- ENDIF --><br />
{L_MATCH_OF_GROUP} {L_MATCH_OF_GROUP}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matches_group_id" id="update_matches_group_id" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matches_group_id" id="update_matches_group_id" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th>{L_MATCH_HOME} <th>{L_MATCH_HOME}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matches_team_id_home" id="update_matches_team_id_home" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matches_team_id_home" id="update_matches_team_id_home" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --><br /> <!-- ENDIF --><br />
{L_MATCH_GUEST} {L_MATCH_GUEST}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matches_team_id_guest" id="update_matches_team_id_guest" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matches_team_id_guest" id="update_matches_team_id_guest" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --> <!-- ENDIF -->
</th> </th>
<th>{L_RESULT} <th>{L_RESULT}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matches_goals" id="update_matches_goals" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matches_goals" id="update_matches_goals" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --><br /> <!-- ENDIF --><br />
&nbsp; &nbsp;
</th> </th>
<th>{L_EXTRATIME_SHORT} <th>{L_EXTRATIME_SHORT}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matches_goals_overtime" id="update_matches_goals_overtime" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matches_goals_overtime" id="update_matches_goals_overtime" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --><br /> <!-- ENDIF --><br />
&nbsp; &nbsp;
</th> </th>
<th>{L_FORMULA} <th>{L_FORMULA}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matches_formula" id="update_matches_formula" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matches_formula" id="update_matches_formula" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --><br /> <!-- ENDIF --><br />
&nbsp; &nbsp;
</th> </th>
<th>{L_STATUS} <th>{L_STATUS}
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<input title="{L_UPDATE_THIS}" name="update_matches_status" id="update_matches_status" type="checkbox" class="radio" checked="checked" /> <input title="{L_UPDATE_THIS}" name="update_matches_status" id="update_matches_status" type="checkbox" class="radio" checked="checked" />
<!-- ENDIF --><br /> <!-- ENDIF --><br />
{L_KO} {L_KO}
</th> </th>
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<th title="{L_SELECT_EXPLAIN}" style="text-align:center">{L_SELECT}<br /> <th title="{L_SELECT_EXPLAIN}" style="text-align:center">{L_SELECT}<br />
&nbsp; &nbsp;
</th> </th>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN footb_matches --> <!-- BEGIN footb_matches -->
{footb_matches.TPL} {footb_matches.TPL}
<!-- END footb_matches --> <!-- END footb_matches -->
</tbody> </tbody>
</table> </table>
<!-- IF not S_INSERT_LEAGUE --> <!-- IF not S_INSERT_LEAGUE -->
<p class="small" style="text-align:right;margin-bottom:0px"> <p class="small" style="text-align:right;margin-bottom:0px">
<a href="#" onclick="marklist('list', 'FOOTB_MATCHES_', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'FOOTB_MATCHES_', true); return false;">{L_MARK_ALL}</a> &bull;
<a href="#" onclick="marklist('list', 'FOOTB_MATCHES_', false); return false;">{L_UNMARK_ALL}</a> <a href="#" onclick="marklist('list', 'FOOTB_MATCHES_', false); return false;">{L_UNMARK_ALL}</a>
</p> </p>
<!-- ENDIF --> <!-- ENDIF -->
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF .footb_matchdays or .footb_teams or .footb_matches --> <!-- IF .footb_matchdays or .footb_teams or .footb_matches -->
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<input type="hidden" name="xml_ary" value="{XML_ARY}" /> <input type="hidden" name="xml_ary" value="{XML_ARY}" />
<input type="hidden" name="s" value="{S_SEASON}" /> <input type="hidden" name="s" value="{S_SEASON}" />
<input type="hidden" name="l" value="{S_LEAGUE}" /> <input type="hidden" name="l" value="{S_LEAGUE}" />
<input type="hidden" name="league_name" value="{S_LEAGUE_NAME}" /> <input type="hidden" name="league_name" value="{S_LEAGUE_NAME}" />
<input type="hidden" name="xcode" value="{S_XCODE}" /> <input type="hidden" name="xcode" value="{S_XCODE}" />
<!-- IF S_INSERT_LEAGUE --> <!-- IF S_INSERT_LEAGUE -->
<input class="button1" type="submit" id="submit" name="insert" value="{L_INSERT_LEAGUE}" />&nbsp; <input class="button1" type="submit" id="submit" name="insert" value="{L_INSERT_LEAGUE}" />&nbsp;
<!-- ELSE --> <!-- ELSE -->
<input class="button1" type="submit" id="submit" name="update" value="{L_UPDATE_LEAGUE}" />&nbsp; <input class="button1" type="submit" id="submit" name="update" value="{L_UPDATE_LEAGUE}" />&nbsp;
<!-- ENDIF --> <!-- ENDIF -->
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
<!-- ELSE --> <!-- ELSE -->
<div class="successbox"> <div class="successbox">
<h3>{L_ADVICE}</h3> <h3>{L_ADVICE}</h3>
<p>{L_NO_DIFFERENCES}</p> <p>{L_NO_DIFFERENCES}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
</form> </form>
<!-- ENDIF --> <!-- ENDIF -->
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,44 +1,44 @@
<!-- INCLUDECSS css/football_acp.css --> <!-- INCLUDECSS css/football_acp.css -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF S_IN_FOOTBALL_USERGUIDE --> <!-- IF S_IN_FOOTBALL_USERGUIDE -->
<!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF --> <!-- IF U_FOOTBALL --><a href="{U_FOOTBALL}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_PREDICTION_LEAGUE}</a><!-- ENDIF -->
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p> <p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<h1>{L_ACP_FOOTBALL} - {L_ACP_FOOTBALL_USERGUIDE}</h1> <h1>{L_ACP_FOOTBALL} - {L_ACP_FOOTBALL_USERGUIDE}</h1>
<p>{L_ACP_FOOTBALL_USERGUIDE_EXPLAIN}</p> <p>{L_ACP_FOOTBALL_USERGUIDE_EXPLAIN}</p>
<fieldset id="userguidelinks"> <fieldset id="userguidelinks">
<!-- BEGIN userguide_block --> <!-- BEGIN userguide_block -->
<div style="font-size: 0.85em; padding-bottom: 5px; margin-bottom: 0.7em; line-height: 1.40em;"><strong>{userguide_block.BLOCK_TITLE}</strong><br /> <div style="font-size: 0.85em; padding-bottom: 5px; margin-bottom: 0.7em; line-height: 1.40em;"><strong>{userguide_block.BLOCK_TITLE}</strong><br />
<!-- BEGIN userguide_row --> <!-- BEGIN userguide_row -->
<a href="#ug{userguide_block.S_ROW_COUNT}{userguide_block.userguide_row.S_ROW_COUNT}">{userguide_block.userguide_row.USERGUIDE_QUESTION}</a><br /> <a href="#ug{userguide_block.S_ROW_COUNT}{userguide_block.userguide_row.S_ROW_COUNT}">{userguide_block.userguide_row.USERGUIDE_QUESTION}</a><br />
<!-- END userguide_row --> <!-- END userguide_row -->
</div> </div>
<!-- END userguide_block --> <!-- END userguide_block -->
</fieldset> </fieldset>
<!-- BEGIN userguide_block --> <!-- BEGIN userguide_block -->
<fieldset> <fieldset>
<h2>{userguide_block.BLOCK_TITLE}</h2> <h2>{userguide_block.BLOCK_TITLE}</h2>
<!-- BEGIN userguide_row --> <!-- BEGIN userguide_row -->
<div style="font-size: 0.85em; padding-bottom: 5px; margin-bottom: 0.7em; line-height: 1.40em;"> <div style="font-size: 0.85em; padding-bottom: 5px; margin-bottom: 0.7em; line-height: 1.40em;">
<span id="ug{userguide_block.S_ROW_COUNT}{userguide_block.userguide_row.S_ROW_COUNT}"> <span id="ug{userguide_block.S_ROW_COUNT}{userguide_block.userguide_row.S_ROW_COUNT}">
<strong>{userguide_block.userguide_row.USERGUIDE_QUESTION}</strong></span><br /> <strong>{userguide_block.userguide_row.USERGUIDE_QUESTION}</strong></span><br />
{userguide_block.userguide_row.USERGUIDE_ANSWER}<br /><br /> {userguide_block.userguide_row.USERGUIDE_ANSWER}<br /><br />
<a href="#userguidelinks">{ICON_BACK_TO_TOP}&nbsp;{L_BACK_TO_TOP}</a> <a href="#userguidelinks">{ICON_BACK_TO_TOP}&nbsp;{L_BACK_TO_TOP}</a>
</div> </div>
<!-- IF not userguide_block.userguide_row.S_LAST_ROW --><hr class="dashed" /><!-- ENDIF --> <!-- IF not userguide_block.userguide_row.S_LAST_ROW --><hr class="dashed" /><!-- ENDIF -->
<!-- END userguide_row --> <!-- END userguide_row -->
</fieldset> </fieldset>
<!-- END userguide_block --> <!-- END userguide_block -->
<!-- ENDIF --> <!-- ENDIF -->
<br /> <br />
<div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div> <div style="text-align: center;">phpBB Extension - Football Prediction League - Version {S_VERSION_NO} &copy; 2016 <a href="http://football.bplaced.net">football</a></div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,87 +1,87 @@
/* ----------------------------------------------------------------------------------------- /* -----------------------------------------------------------------------------------------
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* ----------------------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------------------- */
/* Table for football data */ /* Table for football data */
/* Specific column styles */ /* Specific column styles */
table.type_f thead th { font-weight:normal; text-transform:uppercase; line-height:1.3em; padding:0 4px 2px 4px; } table.type_f thead th { font-weight:normal; text-transform:uppercase; line-height:1.3em; padding:0 4px 2px 4px; }
table.type_f thead th span { padding-left:7px; } table.type_f thead th span { padding-left:7px; }
table.type_f tfoot td { table.type_f tfoot td {
padding: 3px 4px; padding: 3px 4px;
color: #FFFFFF; color: #FFFFFF;
background: #70AED3 url("../images/gradient2b.gif") bottom left repeat-x; background: #70AED3 url("../images/gradient2b.gif") bottom left repeat-x;
border-bottom: 1px solid #6DACD2; border-bottom: 1px solid #6DACD2;
border-top: 1px solid #327AA5; border-top: 1px solid #327AA5;
text-align: left; text-align: left;
font-size: 0.75em; font-size: 0.75em;
text-transform: uppercase; text-transform: uppercase;
} }
table.type_f tbody tr:hover, table.type_f tbody tr:hover,
table.type_f tbody tr.hover { table.type_f tbody tr.hover {
background-color: #FFFFFF; color: #000000; background-color: #FFFFFF; color: #000000;
} }
table.type_f body td { padding: 1px 2px; border-top: 1px solid #FAFAFA; } table.type_f body td { padding: 1px 2px; border-top: 1px solid #FAFAFA; }
table.type_f tbody th { padding:1px 2px; border-top: 1px solid #000000; background-color: #BFC1CF; } table.type_f tbody th { padding:1px 2px; border-top: 1px solid #000000; background-color: #BFC1CF; }
table.type_f tbody tr { border: 1px solid #cfcfcf; } table.type_f tbody tr { border: 1px solid #cfcfcf; }
th.td_tendency { text-align: center; padding: 4px 2px 0 2px; font-weight: bold; } th.td_tendency { text-align: center; padding: 4px 2px 0 2px; font-weight: bold; }
th.td_pts_total { text-align: right; padding: 4px 4px 0 2px; } th.td_pts_total { text-align: right; padding: 4px 4px 0 2px; }
td.td_rank { text-align: right; } td.td_rank { text-align: right; }
td.td_group { text-align: center; } td.td_group { text-align: center; }
td.td_hits { text-align: center; } td.td_hits { text-align: center; }
td.td_wins { text-align: right; padding: 0 2px 0 4px; } td.td_wins { text-align: right; padding: 0 2px 0 4px; }
td.td_match_no { text-align: right; } td.td_match_no { text-align: right; }
td.td_logo { text-align: center; } td.td_logo { text-align: center; }
td.td_team { text-align: left; padding: 0 1em 0 2px; } td.td_team { text-align: left; padding: 0 1em 0 2px; }
td.td_team_home { text-align: right; width: 155px; } td.td_team_home { text-align: right; width: 155px; }
td.td_team_guest { text-align: left; width: 155px; } td.td_team_guest { text-align: left; width: 155px; }
td.td_vs { text-align: center; max-width: 1em; padding: 0; } td.td_vs { text-align: center; max-width: 1em; padding: 0; }
td.td_goals_home { text-align: right; max-width: 3em; padding: 0;} td.td_goals_home { text-align: right; max-width: 3em; padding: 0;}
td.td_goals_guest { text-align: left; max-width: 3em; padding: 0; white-space: nowrap;} td.td_goals_guest { text-align: left; max-width: 3em; padding: 0; white-space: nowrap;}
td.td_pts { text-align: right; padding: 0 2px 0 2px; } td.td_pts { text-align: right; padding: 0 2px 0 2px; }
td.td_button { text-align: right; padding-right: 4px; } td.td_button { text-align: right; padding-right: 4px; }
td.td_result { text-align: center; } td.td_result { text-align: center; }
td.td_season { text-align: center; } td.td_season { text-align: center; }
td.td_league { text-align: center; } td.td_league { text-align: center; }
td.td_pts_total { text-align: right; padding: 0 4px 0 2px; } td.td_pts_total { text-align: right; padding: 0 4px 0 2px; }
td.td_points { text-align: right; padding: 0 2em 0 2px; } td.td_points { text-align: right; padding: 0 2em 0 2px; }
td.td_fp { text-align: center; } td.td_fp { text-align: center; }
td.td_matches { text-align: center; } td.td_matches { text-align: center; }
td.td_diff { text-align: right; } td.td_diff { text-align: right; }
td.td_counter { text-align: right; } td.td_counter { text-align: right; }
td.td_name { text-align: left; } td.td_name { text-align: left; }
table.rank td.color_finally, table.football .color_finally, .color_finally , table.football .match_win, .match_win { table.rank td.color_finally, table.football .color_finally, .color_finally , table.football .match_win, .match_win {
font-weight: bold; font-weight: bold;
color: #00AA00; color: #00AA00;
} }
table.rank td.color_provisionally, table.football .color_provisionally, .color_provisionally , table.football .match_lost, .match_lost { table.rank td.color_provisionally, table.football .color_provisionally, .color_provisionally , table.football .match_lost, .match_lost {
font-weight: bold; font-weight: bold;
color: #AA0000; color: #AA0000;
} }
table.football .match_draw, .match_draw { table.football .match_draw, .match_draw {
font-weight: bold; font-weight: bold;
color: #6A6A6A; color: #6A6A6A;
} }
table.rank td.color_not_rated, table.football .color_not_rated, .color_not_rated { table.rank td.color_not_rated, table.football .color_not_rated, .color_not_rated {
font-weight: bold; font-weight: bold;
color: purple; color: purple;
} }
/* Background colors where the tables iterate between two colors or mark user*/ /* Background colors where the tables iterate between two colors or mark user*/
.row_light { background-color: #e1ebf2; } .row_light { background-color: #e1ebf2; }
.row_dark { background-color: #cadceb; } .row_dark { background-color: #cadceb; }
.row_user { background-color: #99CC99; } .row_user { background-color: #99CC99; }
.row_group td { background-color: #12A3EB; color: #FFFFFF !important; } .row_group td { background-color: #12A3EB; color: #FFFFFF !important; }
.row_result { background-color: #BFC1CF; } .row_result { background-color: #BFC1CF; }
.row_result td { padding: 1px 2px; } .row_result td { padding: 1px 2px; }
.message { .message {
font-weight: bold; font-weight: bold;
color: #AA0000; color: #AA0000;
} }

View File

@@ -1,13 +1,13 @@
<!-- IF 0 --> <!-- IF 0 -->
Diese Datei existiert doppelt: Einmal im fooball\football\styles\prsilver\template und einmal im fooball\football\adm\style Ordner Diese Datei existiert doppelt: Einmal im fooball\football\styles\prsilver\template und einmal im fooball\football\adm\style Ordner
Mit Hilfe dieser Datei werden Fussballergebnisse zum Abgleich und schnelleren Erfassung von externen Seiten, Mit Hilfe dieser Datei werden Fussballergebnisse zum Abgleich und schnelleren Erfassung von externen Seiten,
wie z.B. den Weltfussball.de Torverteiler, eingebunden. wie z.B. den Weltfussball.de Torverteiler, eingebunden.
Wenn ihr einen Weltfussball.de Account habt, könnt ihr dort in der Community einen Torverteiler erstellen und den Code hier Wenn ihr einen Weltfussball.de Account habt, könnt ihr dort in der Community einen Torverteiler erstellen und den Code hier
unter der entsprechenden Liganummer reinhängen (also 999999 mit der Liganummer bzw. wfb_tv_id ersetzen). unter der entsprechenden Liganummer reinhängen (also 999999 mit der Liganummer bzw. wfb_tv_id ersetzen).
Der Frame wird dann bei der Ergebnisseingabe in der Liga angezeigt, wenn der Spieltag editierbar ist. Der Frame wird dann bei der Ergebnisseingabe in der Liga angezeigt, wenn der Spieltag editierbar ist.
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_EDIT_MODE --> <!-- IF S_EDIT_MODE -->
<!-- IF S_LEAGUE == 999999 --> <!-- IF S_LEAGUE == 999999 -->
<div id="tor_v1" style="width:400px;text-align:right;font-family:Arial,Helvetica,Verdana,sans-serif;color:#000000;font-size:8pt;background-color:#cadceb;"><div id="iTorV1"></div>Der Torverteiler - pr&auml;sentiert von <a href="http://www.weltfussball.de/" target="_blank">weltfussball.de</a>&nbsp;<br />Alles &uuml;ber <a href="http://www.weltfussball.de/" target="_blank">Fu&szlig;ball</a> oder direkt zur <a href="http://www.weltfussball.de/wettbewerb/bundesliga/">Bundesliga</a>&nbsp;</div><script type="text/javascript">var wfb_tv_id="999999";</script><script id="wfb_link" type="text/javascript" src="http://www.weltfussball.de/js/get_tv.js"></script> <div id="tor_v1" style="width:400px;text-align:right;font-family:Arial,Helvetica,Verdana,sans-serif;color:#000000;font-size:8pt;background-color:#cadceb;"><div id="iTorV1"></div>Der Torverteiler - pr&auml;sentiert von <a href="http://www.weltfussball.de/" target="_blank">weltfussball.de</a>&nbsp;<br />Alles &uuml;ber <a href="http://www.weltfussball.de/" target="_blank">Fu&szlig;ball</a> oder direkt zur <a href="http://www.weltfussball.de/wettbewerb/bundesliga/">Bundesliga</a>&nbsp;</div><script type="text/javascript">var wfb_tv_id="999999";</script><script id="wfb_link" type="text/javascript" src="http://www.weltfussball.de/js/get_tv.js"></script>
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->

View File

@@ -7,18 +7,30 @@
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$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)
@@ -95,7 +118,7 @@ $sql_limit = $config['football_users_per_page'] * $count_matches;
// If we've got a hightlight set pass it on to pagination. // If we've got a hightlight set pass it on to pagination.
// handle pagination. // handle pagination.
$base_url = $this->helper->route('football_main_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)); $base_url = $this->helper->route('football_football_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday));
$pagination = $phpbb_container->get('pagination'); $pagination = $phpbb_container->get('pagination');
if ($user->data['football_mobile']) if ($user->data['football_mobile'])
{ {
@@ -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);
@@ -165,56 +214,67 @@ foreach ($matches AS $match)
$count_user = 0; $count_user = 0;
$bet_index = 0; $bet_index = 0;
$last_match_index = 0; $last_match_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']) $count_user++;
{ $league_info = league_info($season, $league);
$row_class = 'bg3 row_user'; if ($league_info['bet_type'])
} {
$template->assign_block_vars('match_panel.user_row', array( $row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
'ROW_CLASS' => $row_class, }
'USER_NAME' => $user_bet['username'], else
) {
); $row_class = (!(($count_user + ($count_user % 2)) % 4)) ? 'bg1 row_light' : 'bg2 row_dark';
$total = 0; }
} if ($user_bet['user_id'] == $user->data['user_id'])
$bet_index++; {
$total += $user_bet['points']; $row_class = 'bg3 row_user';
if ($user_bet['status'] < 3) }
{ $template->assign_block_vars('match_panel.user_row', array(
$colorstyle_total = ' color_provisionally'; 'ROW_CLASS' => $row_class,
} 'USER_NAME' => $user_bet['username'],
if ($user_bet['status'] < 1 && !$config['football_view_bets']) )
{ );
// hide bets $total = 0;
$bet_home = ($user_bet['bet_home'] == '') ? '&nbsp;' : '?'; }
$bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?'; $bet_index++;
} $total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
else if ($user_bet['status'] < 3)
{ {
$bet_home = $user_bet['bet_home']; $colorstyle_total = ' color_provisionally';
$bet_guest = $user_bet['bet_guest']; }
} if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
$colorstyle_bet = color_style($user_bet['status']); // hide bets
$template->assign_block_vars('match_panel.user_row.bet', array( $bet_home = ($user_bet['bet_home'] == '') ? '&nbsp;' : '?';
'BET' => $bet_home. ':'. $bet_guest, $bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?';
'COLOR_STYLE' => $colorstyle_bet, }
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'], else
) {
); $bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
if ($bet_index == $split_after) $colorstyle_bet = color_style($user_bet['status']);
{ $template->assign_block_vars('match_panel.user_row.bet', array(
$sum_total[$user_bet['username']] += $total; 'BET' => $bet_home. ':'. $bet_guest,
$matchday_sum_total += $total; 'COLOR_STYLE' => $colorstyle_bet,
$bet_index = 0; 'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
} )
} );
if ($bet_index == $split_after)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$bet_index = 0;
}
}
}
$template->assign_block_vars('match_panel.tendency_footer', array( $template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => false, 'S_TOTAL' => false,
@@ -265,10 +325,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 +349,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;
}
$bet_index++;
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
}
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet_home = ($user_bet['bet_home'] == '') ? '' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
} }
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
)
);
$total = 0;
}
$bet_index++;
$total += $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
}
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet_home = ($user_bet['bet_home'] == '') ? '' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
if ($bet_index == $last_match_index) $colorstyle_bet = color_style($user_bet['status']);
{ $template->assign_block_vars('match_panel.user_row.bet', array(
$sum_total[$user_bet['username']] += $total; 'BET' => $bet_home. ':'. $bet_guest,
$matchday_sum_total += $total; 'COLOR_STYLE' => $colorstyle_bet,
$template->assign_block_vars('match_panel.user_row.points', array( 'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
'COLOR_STYLE' => $colorstyle_total,
'POINTS_TOTAL' => $sum_total[$user_bet['username']],
) )
); );
$bet_index = 0;
if ($bet_index == $last_match_index)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$template->assign_block_vars('match_panel.user_row.points', array(
'COLOR_STYLE' => $colorstyle_total,
'POINTS_TOTAL' => $sum_total[$user_bet['username']],
)
);
$bet_index = 0;
}
} }
} }
@@ -451,7 +523,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,23 +551,17 @@ 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),
'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

@@ -1,235 +1,232 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
// Check Prediction League authorisation if (!defined('IN_PHPBB'))
if ( !$this->auth->acl_get('u_use_football') ) {
{ exit;
trigger_error('NO_AUTH_VIEW'); }
} // Check Prediction League authorisation
if ( !$this->auth->acl_get('u_use_football') )
global $phpbb_extension_manager; {
if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints')) trigger_error('NO_AUTH_VIEW');
{
$this->user->add_lang_ext('dmzx/ultimatepoints', 'common'); }
// Get an instance of the ultimatepoints functions_points
$functions_points = $phpbb_container->get('dmzx.ultimatepoints.core.functions.points'); global $phpbb_extension_manager;
} if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints'))
else {
{ $this->user->add_lang_ext('dmzx/ultimatepoints', 'common');
// Get an instance of the football functions_points // Get an instance of the ultimatepoints functions_points
$functions_points = $phpbb_container->get('football.football.core.functions.points'); $functions_points = $phpbb_container->get('dmzx.ultimatepoints.core.functions.points');
} }
else
if (!$user_sel) {
{ // Get an instance of the football functions_points
if (user_is_member($user->data['user_id'], $season, $league) or $league == 0) $functions_points = $phpbb_container->get('football.football.core.functions.points');
{ }
$user_sel = $user->data['user_id'];
} if (!$user_sel)
} {
if (user_is_member($user->data['user_id'], $season, $league) or $league == 0)
$username = ''; {
$member = true; $user_sel = $user->data['user_id'];
if ($this->auth->acl_get('a_football_points')) }
{ }
$where_user = '';
$multi_view = true; $username = '';
} $member = true;
else if ($this->auth->acl_get('a_football_points'))
{ {
$multi_view = false; $where_user = '';
if (user_is_member($user->data['user_id'], $season, $league)) $multi_view = true;
{ }
$where_user = ' AND b.user_id = ' . $user->data['user_id'] . ' '; else
$user_sel = $user->data['user_id']; {
} $multi_view = false;
else if (user_is_member($user->data['user_id'], $season, $league))
{ {
if ($league) $where_user = ' AND b.user_id = ' . $user->data['user_id'] . ' ';
{ $user_sel = $user->data['user_id'];
$member = false; }
} else
} {
} if ($league)
$where_league = ''; {
if ($league) $member = false;
{ }
$where_league = " AND b.league = $league"; }
} }
$where_league = '';
$data = false; if ($league)
// Select user {
$total_users = 0; $where_league = " AND b.league = $league";
$sql = 'SELECT DISTINCT }
u.user_id,
u.username $data = false;
FROM ' . FOOTB_BETS . ' AS b // Select user
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) $total_users = 0;
WHERE season = $season $sql = 'SELECT DISTINCT
$where_league u.user_id,
$where_user u.username
ORDER BY LOWER(u.username) ASC"; FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
$result = $db->sql_query($sql); WHERE season = $season
$where_league
while($row = $db->sql_fetchrow($result)) $where_user
{ ORDER BY LOWER(u.username) ASC";
$total_users++;
if ($user_sel == $row['user_id'] OR !$user_sel) $result = $db->sql_query($sql);
{
$selectid = ' selected="selected"'; while($row = $db->sql_fetchrow($result))
$username = $row['username']; {
$user_sel = $row['user_id']; $total_users++;
} if ($user_sel == $row['user_id'] OR !$user_sel)
else {
{ $selectid = ' selected="selected"';
$selectid = ''; $username = $row['username'];
} $user_sel = $row['user_id'];
$template->assign_block_vars('form_user', array( }
'S_USER' => $row['user_id'], else
'S_USERNAME' => $row['username'], {
'S_SELECTEDID' => $selectid, $selectid = '';
) }
); $template->assign_block_vars('form_user', array(
} 'S_USER' => $row['user_id'],
$db->sql_freeresult($result); 'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid,
$where_season = ''; )
if ($season) );
{ }
$where_season = " AND fp.season = $season"; $db->sql_freeresult($result);
}
$where_season = '';
$where_league = ''; if ($season)
$order_by = 'ORDER BY fp.points_type ASC, fp.matchday ASC, fp.league ASC'; {
$where_season = " AND fp.season = $season";
if ($league) }
{
$where_league = " AND fp.league = $league"; $where_league = '';
$order_by = 'ORDER BY fp.league ASC, fp.matchday ASC, fp.points_type ASC'; $order_by = 'ORDER BY fp.points_type ASC, fp.matchday ASC, fp.league ASC';
}
if ($league)
// The different book types {
$types = array( $where_league = " AND fp.league = $league";
0 => '--', $order_by = 'ORDER BY fp.league ASC, fp.matchday ASC, fp.points_type ASC';
1 => sprintf($user->lang['FOOTBALL_BET_POINTS']), }
2 => $user->lang['FOOTBALL_DEPOSIT'],
3 => sprintf($user->lang['FOOTBALL_WIN']), // The different book types
4 => $user->lang['FOOTBALL_WIN'], $types = array(
5 => $user->lang['FOOTBALL_WIN'], 0 => '--',
6 => $user->lang['FOOTBALL_WIN'], 1 => sprintf($user->lang['FOOTBALL_BET_POINTS']),
7 => $user->lang['FOOTBALL_PAYOUT'], 2 => $user->lang['FOOTBALL_DEPOSIT'],
); 3 => sprintf($user->lang['FOOTBALL_WIN']),
4 => $user->lang['FOOTBALL_WIN'],
// Grab the football points 5 => $user->lang['FOOTBALL_WIN'],
$sql = 'SELECT fp.season, 6 => $user->lang['FOOTBALL_WIN'],
s.season_name, 7 => $user->lang['FOOTBALL_PAYOUT'],
s.season_name_short, );
fp.league,
l.league_name, // Grab the football points
l.league_name_short, $sql = 'SELECT fp.season,
fp.matchday, s.season_name,
md.matchday_name, s.season_name_short,
fp.points_type, fp.league,
fp.points, l.league_name,
fp.points_comment, l.league_name_short,
fp.cash fp.matchday,
FROM ' . FOOTB_POINTS . ' AS fp md.matchday_name,
INNER JOIN ' . FOOTB_SEASONS . ' AS s ON (s.season = fp.season) fp.points_type,
INNER JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = fp.season AND l.league = fp.league) fp.points,
INNER JOIN ' . FOOTB_MATCHDAYS . ' AS md ON (md.season = fp.season AND md.league = fp.league AND md.matchday = fp.matchday) fp.points_comment,
WHERE user_id = ' . (int) $user_sel . " fp.cash
$where_season FROM ' . FOOTB_POINTS . ' AS fp
$where_league INNER JOIN ' . FOOTB_SEASONS . ' AS s ON (s.season = fp.season)
$order_by"; INNER JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = fp.season AND l.league = fp.league)
$result = $db->sql_query($sql); INNER JOIN ' . FOOTB_MATCHDAYS . ' AS md ON (md.season = fp.season AND md.league = fp.league AND md.matchday = fp.matchday)
WHERE user_id = ' . (int) $user_sel . "
$current_balance = 0.00; $where_season
$count = 0; $where_league
// Start looping all the football points $order_by";
while ($row = $db->sql_fetchrow($result)) $result = $db->sql_query($sql);
{
$count = $count + 1; $current_balance = 0.00;
if ($row['points_type'] == POINTS_BET OR $row['points_type'] == POINTS_PAID) $count = 0;
{ // Start looping all the football points
$points_sign = '-'; while ($row = $db->sql_fetchrow($result))
$points_style = " color: red;"; {
$current_balance -= $row['points']; $count = $count + 1;
} if ($row['points_type'] == POINTS_BET OR $row['points_type'] == POINTS_PAID)
else {
{ $points_sign = '-';
$points_sign = '+'; $points_style = " color: red;";
$points_style = " color: green;"; $current_balance -= $row['points'];
$current_balance += $row['points']; }
} else
// Add the items to the template {
$template->assign_block_vars('football', array( $points_sign = '+';
'SEASON' => $season, $points_style = " color: green;";
'SEASON_NAME' => $season_name, $current_balance += $row['points'];
'LEAGUE' => $row['league'], }
'LEAGUE_NAME' => $row['league_name'], // Add the items to the template
'LEAGUE_SHORT' => $row['league_name_short'], $template->assign_block_vars('football', array(
'MATCHDAY' => $row['matchday'], 'SEASON' => $season,
'MATCHDAY_NAME' => ($row['matchday_name'] == '') ? $row['matchday'] . '.' . sprintf($user->lang['FOOTBALL_MATCHDAY']) : $row['matchday_name'], 'SEASON_NAME' => $season_name,
'MATCHDAY_SHORT'=> $row['matchday'] . '.' . sprintf($user->lang['MATCHDAY_SHORT']), 'LEAGUE' => $row['league'],
'POINTS_SIGN' => $points_sign, 'LEAGUE_NAME' => $row['league_name'],
'POINTS_STYLE' => $points_style, 'LEAGUE_SHORT' => $row['league_name_short'],
'POINTS_TYPE' => $types[$row['points_type']], 'MATCHDAY' => $row['matchday'],
'S_CASH' => $row['cash'], 'MATCHDAY_NAME' => ($row['matchday_name'] == '') ? $row['matchday'] . '.' . sprintf($user->lang['FOOTBALL_MATCHDAY']) : $row['matchday_name'],
'POINTS' => $functions_points->number_format_points($row['points']), 'MATCHDAY_SHORT'=> $row['matchday'] . '.' . sprintf($user->lang['MATCHDAY_SHORT']),
'COMMENT' => nl2br($row['points_comment']), 'POINTS_SIGN' => $points_sign,
)); 'POINTS_STYLE' => $points_style,
} 'POINTS_TYPE' => $types[$row['points_type']],
$db->sql_freeresult($result); 'S_CASH' => $row['cash'],
'POINTS' => $functions_points->number_format_points($row['points']),
if ($current_balance < 0) 'COMMENT' => nl2br($row['points_comment']),
{ ));
$points_style = " color: red;"; }
} $db->sql_freeresult($result);
else
{ if ($current_balance < 0)
$points_style = " color: green;"; {
} $points_style = " color: red;";
}
$template->assign_block_vars('football', array( else
'SEASON' => $season, {
'SEASON_NAME' => '', $points_style = " color: green;";
'LEAGUE' => $league, }
'LEAGUE_NAME' => '',
'MATCHDAY' => '', $template->assign_block_vars('football', array(
'MATCHDAY_NAME' => '', 'SEASON' => $season,
'POINTS_SIGN' => '', 'SEASON_NAME' => '',
'POINTS_STYLE' => $points_style, 'LEAGUE' => $league,
'POINTS_TYPE' => '', 'LEAGUE_NAME' => '',
'S_CASH' => 1, 'MATCHDAY' => '',
'POINTS' => $functions_points->number_format_points($current_balance), 'MATCHDAY_NAME' => '',
'COMMENT' => ($league == 0) ? sprintf($user->lang['FOOTBALL_BALANCES']) : sprintf($user->lang['FOOTBALL_BALANCE']), 'POINTS_SIGN' => '',
)); 'POINTS_STYLE' => $points_style,
'POINTS_TYPE' => '',
$sidename = sprintf($user->lang['FOOTBALL_BANK']); 'S_CASH' => 1,
$template->assign_vars(array( 'POINTS' => $functions_points->number_format_points($current_balance),
'S_DISPLAY_BANK' => true, 'COMMENT' => ($league == 0) ? sprintf($user->lang['FOOTBALL_BALANCES']) : sprintf($user->lang['FOOTBALL_BALANCE']),
'S_MATCHDAY_HIDE' => true, ));
'S_MEMBER' => $member,
'S_SIDENAME' => $sidename, $sidename = sprintf($user->lang['FOOTBALL_BANK']);
'S_MULTI_VIEW' => $multi_view, $template->assign_vars(array(
'L_TOTAL_ENTRIES' => ($count == 1) ? $count . ' ' .sprintf($user->lang['FOOTBALL_RECORD']) : $count . ' ' .sprintf($user->lang['FOOTBALL_RECORDS']), 'S_DISPLAY_BANK' => true,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), 'S_MATCHDAY_HIDE' => true,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['RANK_TOTAL']), 'S_MEMBER' => $member,
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), 'S_SIDENAME' => $sidename,
'RIGHT_LINK' => sprintf($user->lang['MY_BETS']) . ' &gt;', 'S_MULTI_VIEW' => $multi_view,
'LEFT_TITLE' => sprintf($user->lang['TITLE_RANK_TOTAL']), 'L_TOTAL_ENTRIES' => ($count == 1) ? $count . ' ' .sprintf($user->lang['FOOTBALL_RECORD']) : $count . ' ' .sprintf($user->lang['FOOTBALL_RECORDS']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_BETS']), 'USERNAME' => $username,
'USERNAME' => $username, 'POINTS' => $config['football_win_name'],
'POINTS' => $config['football_win_name'], )
) );
);
?>

File diff suppressed because it is too large Load Diff

View File

@@ -1,391 +1,396 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
// Can this user view Prediction Leagues pages? if (!defined('IN_PHPBB'))
if (!$config['football_guest_view']) {
{ exit;
if ($user->data['user_id'] == ANONYMOUS) }
{
trigger_error('NO_GUEST_VIEW'); // Can this user view Prediction Leagues pages?
} if (!$config['football_guest_view'])
} {
if (!$config['football_user_view']) if ($user->data['user_id'] == ANONYMOUS)
{ {
// Only Prediction League member should see this page trigger_error('NO_GUEST_VIEW');
// Check Prediction League authorisation }
if ( !$this->auth->acl_get('u_use_football') ) }
{ if (!$config['football_user_view'])
trigger_error('NO_AUTH_VIEW'); {
} // Only Prediction League member should see this page
} // Check Prediction League authorisation
if ( !$this->auth->acl_get('u_use_football') )
// Football disabled? {
if ($config['football_disable']) trigger_error('NO_AUTH_VIEW');
{ }
$message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; }
trigger_error($message);
} // Football disabled?
if ($config['football_disable'])
$userid = $this->request->variable('u', 0); {
$season = $this->request->variable('s', 0); $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED';
$league = $this->request->variable('l', 0); trigger_error($message);
$matchday = $this->request->variable('m', 0); }
$error_message = ''; $userid = $this->request->variable('u', 0);
$username = '?'; $season = $this->request->variable('s', 0);
if (!$userid OR !$season OR !$league OR !$matchday) $league = $this->request->variable('l', 0);
{ $matchday = $this->request->variable('m', 0);
$data_bet = false;
if (!$userid) $error_message = '';
{ $username = '?';
$error_message .= sprintf($user->lang['NO_USERID']) . '<br />'; if (!$userid OR !$season OR !$league OR !$matchday)
} {
if (!$season) $data_bet = false;
{ if (!$userid)
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />'; {
} $error_message .= sprintf($user->lang['NO_USERID']) . '<br />';
if (!$league) }
{ if (!$season)
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />'; {
} $error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
if (!$matchday) }
{ if (!$league)
$error_message .= sprintf($user->lang['NO_MATCHDAY']) . '<br />'; {
} $error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
} }
else if (!$matchday)
{ {
$season_info = season_info($season); $error_message .= sprintf($user->lang['NO_MATCHDAY']) . '<br />';
if (sizeof($season_info)) }
{ }
$league_info = league_info($season, $league); else
if (sizeof($league_info)) {
{ $season_info = season_info($season);
// Get username if (sizeof($season_info))
$sql = 'SELECT username {
FROM ' . USERS_TABLE . " $league_info = league_info($season, $league);
WHERE user_id = $userid "; if (sizeof($league_info))
$result = $db->sql_query($sql); {
if ($row = $db->sql_fetchrow($result)) // Get username
{ $sql = 'SELECT username
$username = $row['username']; FROM ' . USERS_TABLE . "
} WHERE user_id = $userid ";
else $result = $db->sql_query($sql);
{ if ($row = $db->sql_fetchrow($result))
$data_bet = false; {
$error_message .= sprintf($user->lang['NO_USERID']) . '<br />'; $username = $row['username'];
} }
$db->sql_freeresult($result); else
{
$display_group = false; $data_bet = false;
$lang_dates = $user->lang['datetime']; $error_message .= sprintf($user->lang['NO_USERID']) . '<br />';
// Required for select_points function: }
$league_info = league_info($season, $league); $db->sql_freeresult($result);
// Calculate matches and bets of matchday $display_group = false;
$sql = "SELECT $lang_dates = $user->lang['datetime'];
m.league, // Required for select_points function:
m.match_no, $league_info = league_info($season, $league);
m.matchday,
m.status, // Calculate matches and bets of matchday
m.group_id, $sql = "SELECT
m.formula_home, m.league,
m.formula_guest, m.match_no,
t1.team_symbol AS home_symbol, m.matchday,
t2.team_symbol AS guest_symbol, m.status,
t1.team_id AS home_id, m.group_id,
t2.team_id AS guest_id, m.formula_home,
t1.team_name AS home_name, m.formula_guest,
t2.team_name AS guest_name, t1.team_symbol AS home_symbol,
b.goals_home AS bet_home, t2.team_symbol AS guest_symbol,
b.goals_guest AS bet_guest, t1.team_id AS home_id,
m.goals_home, t2.team_id AS guest_id,
m.goals_guest, t1.team_name AS home_name,
CONCAT( t2.team_name AS guest_name,
CASE DATE_FORMAT(m.match_datetime,'%w') b.goals_home AS bet_home,
WHEN 0 THEN '" . $lang_dates['Sun'] . "' b.goals_guest AS bet_guest,
WHEN 1 THEN '" . $lang_dates['Mon'] . "' m.goals_home,
WHEN 2 THEN '" . $lang_dates['Tue'] . "' m.goals_guest,
WHEN 3 THEN '" . $lang_dates['Wed'] . "' CONCAT(
WHEN 4 THEN '" . $lang_dates['Thu'] . "' CASE DATE_FORMAT(m.match_datetime,'%w')
WHEN 5 THEN '" . $lang_dates['Fri'] . "' WHEN 0 THEN '" . $lang_dates['Sun'] . "'
WHEN 6 THEN '" . $lang_dates['Sat'] . "' WHEN 1 THEN '" . $lang_dates['Mon'] . "'
ELSE 'Error' END, WHEN 2 THEN '" . $lang_dates['Tue'] . "'
DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i') WHEN 3 THEN '" . $lang_dates['Wed'] . "'
) AS match_time, WHEN 4 THEN '" . $lang_dates['Thu'] . "'
" . select_points() . " WHEN 5 THEN '" . $lang_dates['Fri'] . "'
FROM " . FOOTB_MATCHES . ' AS m WHEN 6 THEN '" . $lang_dates['Sat'] . "'
INNER JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no AND b.user_id = $userid) ELSE 'Error' END,
LEFT JOIN " . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i')
LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) ) AS match_time,
WHERE m.season = $season " . select_points() . "
AND m.league = $league FROM " . FOOTB_MATCHES . ' AS m
AND m.matchday = $matchday INNER JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no AND b.user_id = $userid)
GROUP BY m.match_no LEFT JOIN " . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home)
ORDER BY m.match_datetime ASC, m.match_no ASC"; 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.season = $season
$result = $db->sql_query($sql); AND m.league = $league
if ($row = $db->sql_fetchrow($result)) AND m.matchday = $matchday
{ GROUP BY m.match_no
$data_bet = true; ORDER BY m.match_datetime ASC, m.match_no ASC";
$matchnumber = 0;
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); $result = $db->sql_query($sql);
do if ($row = $db->sql_fetchrow($result))
{ {
$matchnumber++ ; $data_bet = true;
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $matchnumber = 0;
$display_link = true; $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
if (0 == $row['home_id']) do
{ {
$home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']); $matchnumber++ ;
$home_in_array = explode("#",$home_info); $row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$homelogo = $home_in_array[0]; $display_link = true;
$homeid = $home_in_array[1]; if (0 == $row['home_id'])
$homename = $home_in_array[2]; {
} $home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']);
else $home_in_array = explode("#",$home_info);
{ $homelogo = $home_in_array[0];
$homelogo = $row['home_symbol']; $homeid = $home_in_array[1];
$homeid = $row['home_id']; $homename = $home_in_array[2];
$homename = $row['home_name']; }
} else
if (0 == $row['guest_id']) {
{ $homelogo = $row['home_symbol'];
$guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']); $homeid = $row['home_id'];
$guest_in_array = explode("#",$guest_info); $homename = $row['home_name'];
$guestlogo = $guest_in_array[0]; }
$guestid = $guest_in_array[1]; if (0 == $row['guest_id'])
$guestname = $guest_in_array[2]; {
} $guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']);
else $guest_in_array = explode("#",$guest_info);
{ $guestlogo = $guest_in_array[0];
$guestlogo = $row['guest_symbol']; $guestid = $guest_in_array[1];
$guestid = $row['guest_id']; $guestname = $guest_in_array[2];
$guestname = $row['guest_name']; }
} else
if ($homelogo <> '') {
{ $guestlogo = $row['guest_symbol'];
$logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ; $guestid = $row['guest_id'];
} $guestname = $row['guest_name'];
else }
{ if ($homelogo <> '')
$logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; {
} $logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ;
if ($guestlogo <> '') }
{ else
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ; {
} $logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
else }
{ if ($guestlogo <> '')
$logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; {
} $logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ;
}
if ($row['group_id'] == '') else
{ {
$group_id = '&nbsp;'; $logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
} }
else
{ if ($row['group_id'] == '')
$display_group = true; {
$group_id = $row['group_id']; $group_id = '&nbsp;';
} }
else
{
if ($row['status'] < 1 && !$config['football_view_bets']) $display_group = true;
{ $group_id = $row['group_id'];
// hide bets }
$bet_home = ($row['bet_home'] == '') ? '&nbsp;' : '?';
$bet_guest = ($row['bet_guest'] == '') ? '&nbsp;' : '?';
} if ($row['status'] < 1 && !$config['football_view_bets'])
else {
{ // hide bets
$bet_home = ($row['bet_home'] == '') ? '&nbsp;' : $row['bet_home']; $bet_home = ($row['bet_home'] == '') ? '&nbsp;' : '?';
$bet_guest = ($row['bet_guest'] == '') ? '&nbsp;' : $row['bet_guest']; $bet_guest = ($row['bet_guest'] == '') ? '&nbsp;' : '?';
} }
else
$colorstyle = color_style($row['status']); {
$template->assign_block_vars('bet_view', array( $bet_home = ($row['bet_home'] == '') ? '&nbsp;' : $row['bet_home'];
'ROW_CLASS' => $row_class, $bet_guest = ($row['bet_guest'] == '') ? '&nbsp;' : $row['bet_guest'];
'LEAGUE_ID' => $row['league'], }
'MATCH_NUMBER' => $row['match_no'],
'MATCHDAY' => $row['matchday'], $colorstyle = color_style($row['status']);
'STATUS' => $row['status'], $template->assign_block_vars('bet_view', array(
'MATCH_TIME' => $row['match_time'], 'ROW_CLASS' => $row_class,
'GROUP' => $group_id, 'LEAGUE_ID' => $row['league'],
'HOME_ID' => $homeid, 'MATCH_NUMBER' => $row['match_no'],
'GUEST_ID' => $guestid, 'MATCHDAY' => $row['matchday'],
'LOGO_HOME' => $logoH, 'STATUS' => $row['status'],
'LOGO_GUEST' => $logoG, 'MATCH_TIME' => $row['match_time'],
'HOME_NAME' => $homename, 'GROUP' => $group_id,
'GUEST_NAME' => $guestname, 'HOME_ID' => $homeid,
'BET_HOME' => $bet_home, 'GUEST_ID' => $guestid,
'BET_GUEST' => $bet_guest, 'LOGO_HOME' => $logoH,
'GOALS_HOME' => ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'], 'LOGO_GUEST' => $logoG,
'GOALS_GUEST' => ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'], 'HOME_NAME' => $homename,
'POINTS' => ($row['points'] == '') ? '&nbsp;' : $row['points'], 'GUEST_NAME' => $guestname,
'COLOR_STYLE' => $colorstyle, 'BET_HOME' => $bet_home,
) 'BET_GUEST' => $bet_guest,
); 'GOALS_HOME' => ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'],
} 'GOALS_GUEST' => ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'],
while ($row = $db->sql_fetchrow($result)); 'POINTS' => ($row['points'] == '') ? '&nbsp;' : $row['points'],
$db->sql_freeresult($result); 'COLOR_STYLE' => $colorstyle,
} )
else );
{ }
$data_bet = false; while ($row = $db->sql_fetchrow($result));
$error_message .= sprintf($user->lang['NO_BETS']) . '<br />'; $db->sql_freeresult($result);
} }
} else
else {
{ $data_bet = false;
$data_bet = false; $error_message .= sprintf($user->lang['NO_BETS']) . '<br />';
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />'; }
} }
} else
else {
{ $data_bet = false;
$data_bet = false; $error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />'; }
} }
} else
{
// Calculate extra bets of matchday $data_bet = false;
$sql = "SELECT e.*, $error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
eb.bet, }
eb.bet_points, }
t1.team_name AS result_team,
t2.team_name AS bet_team // Calculate extra bets of matchday
FROM " . FOOTB_EXTRA . ' AS e $sql = "SELECT e.*,
LEFT JOIN ' . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = e.season AND eb.league = e.league AND eb.extra_no = e.extra_no AND eb.user_id = $userid) eb.bet,
LEFT JOIN " . FOOTB_TEAMS . ' AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result) eb.bet_points,
LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = e.season AND t2.league = e.league AND t2.team_id = eb.bet) t1.team_name AS result_team,
WHERE e.season = $season t2.team_name AS bet_team
AND e.league = $league FROM " . FOOTB_EXTRA . ' AS e
AND e.matchday = $matchday LEFT JOIN ' . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = e.season AND eb.league = e.league AND eb.extra_no = e.extra_no AND eb.user_id = $userid)
ORDER BY e.extra_no ASC"; LEFT JOIN " . FOOTB_TEAMS . ' AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result)
LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = e.season AND t2.league = e.league AND t2.team_id = eb.bet)
$result = $db->sql_query($sql); WHERE e.season = $season
AND e.league = $league
$extra_bet = false; AND e.matchday = $matchday
$extranumber = 0; ORDER BY e.extra_no ASC";
while ($row = $db->sql_fetchrow($result)) $result = $db->sql_query($sql);
{
$extra_bet = true; $extra_bet = false;
$extranumber++ ; $extranumber = 0;
$row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
while ($row = $db->sql_fetchrow($result))
if ($row['extra_status'] < 1 && !$config['football_view_bets']) {
{ $extra_bet = true;
// hide bets $extranumber++ ;
$bet = ($row['bet'] == '') ? '&nbsp;' : '?'; $row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$bet_team = ($row['bet_team'] == NULL) ? '&nbsp;' : '?';
} if ($row['extra_status'] < 1 && !$config['football_view_bets'])
else {
{ // hide bets
$bet = ($row['bet'] == '') ? '&nbsp;' : $row['bet']; $bet = ($row['bet'] == '') ? '&nbsp;' : '?';
$bet_team = ($row['bet_team'] == NULL) ? '&nbsp;' : $row['bet_team']; $bet_team = ($row['bet_team'] == NULL) ? '&nbsp;' : '?';
} }
$extra_colorstyle = color_style($row['extra_status']); else
{
switch($row['question_type']) $bet = ($row['bet'] == '') ? '&nbsp;' : $row['bet'];
{ $bet_team = ($row['bet_team'] == NULL) ? '&nbsp;' : $row['bet_team'];
case '1': }
{ $extra_colorstyle = color_style($row['extra_status']);
$display_type = 1;
$eval_title = sprintf($user->lang['EXTRA_HIT']); switch($row['question_type'])
} {
break; case '1':
case '2': {
{ $display_type = 1;
$display_type = 1; $eval_title = sprintf($user->lang['EXTRA_HIT']);
$eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); }
} break;
break; case '2':
case '3': {
{ $display_type = 1;
$display_type = 2; $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']);
$eval_title = sprintf($user->lang['EXTRA_HIT']); }
} break;
break; case '3':
case '4': {
{ $display_type = 2;
$display_type = 2; $eval_title = sprintf($user->lang['EXTRA_HIT']);
$eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']); }
} break;
break; case '4':
case '5': {
{ $display_type = 2;
$display_type = 2; $eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']);
$eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); }
} break;
break; case '5':
default : {
{ $display_type = 2;
$display_type = 2; $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']);
$eval_title = ''; }
} break;
break; default :
} {
$display_type = 2;
$template->assign_block_vars('extra_view', array( $eval_title = '';
'ROW_CLASS' => $row_class, }
'QUESTION' => $row['question'], break;
'EXTRA_POINTS' => $row['extra_points'], }
'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
'EVALUATION_TITLE' => $eval_title, $template->assign_block_vars('extra_view', array(
'RESULT' => ($display_type == 1) ? $row['result_team'] : $row['result'], 'ROW_CLASS' => $row_class,
'BET' => ($display_type == 1) ? $bet_team : $bet, 'QUESTION' => $row['question'],
'BET_POINTS' => $row['bet_points'], 'EXTRA_POINTS' => $row['extra_points'],
'COLOR_STYLE' => $extra_colorstyle, 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
) 'EVALUATION_TITLE' => $eval_title,
); 'RESULT' => ($display_type == 1) ? $row['result_team'] : $row['result'],
} 'BET' => ($display_type == 1) ? $bet_team : $bet,
'BET_POINTS' => $row['bet_points'],
$sidename = sprintf($user->lang['BET']); 'COLOR_STYLE' => $extra_colorstyle,
if ($data_bet) )
{ );
$template->assign_vars(array( }
'S_SIDENAME' => $sidename, $db->sql_freeresult($result);
'S_USER_NAME' => $username,
'S_ERROR_MESSAGE' => $error_message, $sidename = sprintf($user->lang['BET']);
'S_FROM' => sprintf($user->lang['FROM_DAY_SEASON'], $matchday, $season), if ($data_bet)
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), {
'S_DATA_BET' => $data_bet, $template->assign_vars(array(
'S_DISPLAY_GROUP' => $display_group, 'S_SIDENAME' => $sidename,
'S_EXTRA_BET' => $extra_bet, 'S_USER_NAME' => $username,
) 'S_ERROR_MESSAGE' => $error_message,
); 'S_FROM' => sprintf($user->lang['FROM_DAY_SEASON'], $matchday, $season),
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
// output page 'S_DATA_BET' => $data_bet,
page_header(sprintf($user->lang['BETS_OF']) . ' ' . $username); 'S_DISPLAY_GROUP' => $display_group,
} 'S_EXTRA_BET' => $extra_bet,
else )
{ );
$template->assign_vars(array(
'S_SIDENAME' => $sidename, // output page
'S_USER_NAME' => '', page_header(sprintf($user->lang['BETS_OF']) . ' ' . $username);
'S_ERROR_MESSAGE' => $error_message, }
'S_FROM' => '', else
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), {
'S_DATA_BET' => $data_bet, $template->assign_vars(array(
'S_DISPLAY_GROUP' => false, 'S_SIDENAME' => $sidename,
) 'S_USER_NAME' => '',
); 'S_ERROR_MESSAGE' => $error_message,
'S_FROM' => '',
// output page 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
page_header(sprintf($user->lang['BETS_OF'])); 'S_DATA_BET' => $data_bet,
} 'S_DISPLAY_GROUP' => false,
)
$template->set_filenames(array( );
'body' => 'bet_popup.html')
); // output page
page_header(sprintf($user->lang['BETS_OF']));
page_footer(); }
?>
$template->set_filenames(array(
'body' => 'bet_popup.html')
);
page_footer();

View File

@@ -7,7 +7,7 @@
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
@@ -15,7 +15,7 @@ $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,
@@ -43,8 +43,8 @@ $sql = "SELECT
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.status <= 0 WHERE m.status <= 0
GROUP BY delivery, m.league GROUP BY m.season, m.league, m.matchday, l.league_name_short, matchday_name, delivery
ORDER BY delivery, m.league"; ORDER BY delivery, m.season, m.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)
@@ -55,7 +55,7 @@ while($row = $db->sql_fetchrow($result) AND $index < 11)
$template->assign_block_vars('delivery', array( $template->assign_block_vars('delivery', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'U_BET_LINK' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $row['season'], 'l' => $row['league'], 'm' => $row['matchday'])), 'U_BET_LINK' => $this->helper->route('football_football_controller', array('side' => 'bet', 's' => $row['season'], 'l' => $row['league'], 'm' => $row['matchday'])),
'LEAGUE_SHORT' => $row['league_name_short'], 'LEAGUE_SHORT' => $row['league_name_short'],
'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',
@@ -71,5 +71,3 @@ $template->assign_vars(array(
'S_DATA_DELIVERY' => $data_delivery, 'S_DATA_DELIVERY' => $data_delivery,
) )
); );
?>

View File

@@ -1,134 +1,151 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
$this->user->add_lang_ext('football/football', 'info_acp_bank'); if (!defined('IN_PHPBB'))
{
// Check Prediction League authorisation exit;
if ( !$this->auth->acl_get('u_use_football') ) }
{
trigger_error('NO_AUTH_VIEW'); $this->user->add_lang_ext('football/football', 'info_acp_bank');
}
// Check Prediction League authorisation
$action=''; if ( !$this->auth->acl_get('u_use_football') )
$phpbb_root_path = './../../'; {
trigger_error('NO_AUTH_VIEW');
if (!$season OR !$league) }
{
redirect($this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league))); $action='';
} $phpbb_root_path = './../../';
else
{ if (!$season OR !$league)
$season_info = season_info($season); {
if (!sizeof($season_info)) redirect($this->helper->route('football_football_controller', array('side' => 'bank', 's' => $season, 'l' => $league)));
{ }
$error_message = sprintf($user->lang['NO_SEASON']); else
trigger_error($error_message); {
} $season_info = season_info($season);
else if (!sizeof($season_info))
{ {
$league_info = league_info($season, $league); $error_message = sprintf($user->lang['NO_SEASON']);
if (!sizeof($league_info)) trigger_error($error_message);
{ }
$error_message = sprintf($user->lang['NO_LEAGUE']); else
trigger_error($error_message); {
} $league_info = league_info($season, $league);
else if (!sizeof($league_info))
{ {
$bet_points = $league_info['bet_points']; $error_message = sprintf($user->lang['NO_LEAGUE']);
$league_name =$league_info['league_name']; trigger_error($error_message);
$league_short =$league_info['league_name_short']; }
else
$user_points = ''; {
global $phpbb_extension_manager; $bet_points = $league_info['bet_points'];
if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $config['points_enable']) $league_name =$league_info['league_name'];
{ $league_short =$league_info['league_name_short'];
$user_points = 'u.user_points,';
} $user_points = '';
else global $phpbb_extension_manager;
{ if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $config['points_enable'])
$user_points = "0.00 AS user_points,"; {
} $user_points = 'u.user_points,';
}
// Grab the members points else
$sql = "SELECT {
b.user_id, $user_points = "0.00 AS user_points,";
u.username, }
$user_points
$bet_points AS bet_points, // Grab the members points
SUM(IF(p.points_type = " . POINTS_BET . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_bet_points, $sql = "SELECT
SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_deposit, b.user_id,
SUM(IF(p.points_type IN (' . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . '), u.username,
IF(p.cash = 0, p.points, 0.00), $user_points
0.00)) AS no_cash_wins, $bet_points AS bet_points,
SUM(IF(p.points_type = ' . POINTS_PAID . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_paid, SUM(IF(p.points_type = " . POINTS_BET . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_bet_points,
SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', p.points, 0.00)) AS deposit, SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_deposit,
IF(SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points, p.points * -1.0)) > 0, SUM(IF(p.points_type IN (' . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . '),
SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points, p.points * -1.0)), 0.00) AS new_deposit, IF(p.cash = 0, p.points, 0.00),
SUM(IF(p.points_type IN (' . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . '), 0.00)) AS no_cash_wins,
p.points, 0.00)) AS wins, SUM(IF(p.points_type = ' . POINTS_PAID . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_paid,
SUM(IF(p.points_type = ' . POINTS_PAID . ', p.points, 0.00)) AS paid, SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', p.points, 0.00)) AS deposit,
IF(SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)) > 0, IF(SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points, p.points * -1.0)) > 0,
SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)), 0.00) AS new_pay SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points, p.points * -1.0)), 0.00) AS new_deposit,
FROM ' . FOOTB_BETS . ' AS b SUM(IF(p.points_type IN (' . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . '),
JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id) p.points, 0.00)) AS wins,
LEFT JOIN ' . FOOTB_POINTS . " AS p ON (p.season = $season AND p.league = $league AND p.user_id = b.user_id) SUM(IF(p.points_type = ' . POINTS_PAID . ', p.points, 0.00)) AS paid,
WHERE b.season = $season IF(SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)) > 0,
AND b.league = $league SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)), 0.00) AS new_pay
AND b.match_no = 1 FROM ' . FOOTB_BETS . ' AS b
GROUP BY b.user_id JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id)
ORDER BY u.username ASC"; LEFT JOIN ' . FOOTB_POINTS . " AS p ON (p.season = $season AND p.league = $league AND p.user_id = b.user_id)
WHERE b.season = $season
if(!$result = $db->sql_query($sql)) AND b.league = $league
{ AND b.match_no = 1
trigger_error('NO_LEAGUE'); GROUP BY b.user_id
} ORDER BY u.username ASC";
$user_rows = $db->sql_fetchrowset($result);
$export_file = $league_short . '_' . $season . '_bank.csv'; if(!$result = $db->sql_query($sql))
$newline = "\r\n"; {
header('Pragma: no-cache'); trigger_error('NO_LEAGUE');
header("Content-Type: text/csv; name=\"$export_file\""); }
header("Content-disposition: attachment; filename=$export_file"); $user_rows = $db->sql_fetchrowset($result);
$export= ''; $db->sql_freeresult($result);
$export .= $league_name . ' ' . sprintf($user->lang['SEASON']) . ' ' . $season. $newline; $newline = "\r\n";
$export .= sprintf($user->lang['NAME']) . ';' . $config['football_win_name'] . ';' . sprintf($user->lang['BET_POINTS']) . ';' . $csv_data= '';
sprintf($user->lang['DEPOSITED']) . ';' . sprintf($user->lang['DEPOSIT']) . ';' . sprintf($user->lang['WINS']) . ';' . $csv_data .= $league_name . ' ' . sprintf($user->lang['SEASON']) . ' ' . $season. $newline;
sprintf($user->lang['PAID']) . ';' . sprintf($user->lang['PAYOUT']) . ';' . $newline; $csv_data .= sprintf($user->lang['NAME']) . ';' . $config['football_win_name'] . ';' . sprintf($user->lang['BET_POINTS']) . ';' .
sprintf($user->lang['DEPOSITED']) . ';' . sprintf($user->lang['DEPOSIT']) . ';' . sprintf($user->lang['WINS']) . ';' .
$curr_season = curr_season(); sprintf($user->lang['PAID']) . ';' . sprintf($user->lang['PAYOUT']) . ';' . $newline;
foreach ($user_rows as $user_row)
{ $curr_season = curr_season();
if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $config['points_enable'] && $season == $curr_season) foreach ($user_rows as $user_row)
{ {
$no_cash_bet_points = ($user_row['no_cash_bet_points'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_bet_points']) . ')'; if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $config['points_enable'] && $season == $curr_season)
$no_cash_deposit = ($user_row['no_cash_deposit'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_deposit']) . ')'; {
$no_cash_wins = ($user_row['no_cash_wins'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_wins']) . ')'; $no_cash_bet_points = ($user_row['no_cash_bet_points'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_bet_points']) . ')';
$no_cash_paid = ($user_row['no_cash_paid'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_paid']) . ')'; $no_cash_deposit = ($user_row['no_cash_deposit'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_deposit']) . ')';
} $no_cash_wins = ($user_row['no_cash_wins'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_wins']) . ')';
else $no_cash_paid = ($user_row['no_cash_paid'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_paid']) . ')';
{ }
$no_cash_bet_points = ''; else
$no_cash_deposit = ''; {
$no_cash_wins = ''; $no_cash_bet_points = '';
$no_cash_paid = ''; $no_cash_deposit = '';
} $no_cash_wins = '';
$export .= str_replace("\"", "\"\"", $user_row['username']) . ';' . $no_cash_paid = '';
str_replace('.', ',', $user_row['user_points']) . ';' . }
str_replace('.', ',', $user_row['bet_points']) . $no_cash_bet_points . ';' . $csv_data .= str_replace("\"", "\"\"", $user_row['username']) . ';' .
str_replace('.', ',', $user_row['deposit']) . $no_cash_deposit . ';' . str_replace('.', ',', $user_row['user_points']) . ';' .
str_replace('.', ',', $user_row['new_deposit']) . ';' . str_replace('.', ',', $user_row['bet_points']) . $no_cash_bet_points . ';' .
str_replace('.', ',', $user_row['wins']) . $no_cash_wins . ';' . str_replace('.', ',', $user_row['deposit']) . $no_cash_deposit . ';' .
str_replace('.', ',', $user_row['paid']) . $no_cash_paid . ';' . str_replace('.', ',', $user_row['new_deposit']) . ';' .
str_replace('.', ',', $user_row['new_pay']) . ';' . $newline; str_replace('.', ',', $user_row['wins']) . $no_cash_wins . ';' .
} str_replace('.', ',', $user_row['paid']) . $no_cash_paid . ';' .
echo utf8_decode($export); str_replace('.', ',', $user_row['new_pay']) . ';' . $newline;
exit; }
}
} // Output the csv file
} $filename = $league_short . '_' . $season . '_bank.csv';
?> $fp = fopen('php://output', 'w');
header('Content-Type: application/octet-stream');
header("Content-disposition: attachment; filename=\"" . basename($filename) . "\"");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false);
header('Pragma: public');
header('Content-Transfer-Encoding: binary');
fwrite($fp, "\xEF\xBB\xBF"); // UTF-8 BOM
fwrite($fp, utf8_decode($csv_data));
fclose($fp);
exit_handler();
}
}
}

View File

@@ -1,87 +1,103 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
$this->user->add_lang_ext('football/football', 'info_acp_bank'); if (!defined('IN_PHPBB'))
{
// Check Prediction League authorisation exit;
if ( !$this->auth->acl_get('u_use_football') ) }
{
trigger_error('NO_AUTH_VIEW'); $this->user->add_lang_ext('football/football', 'info_acp_bank');
}
// Check Prediction League authorisation
$action=''; if ( !$this->auth->acl_get('u_use_football') )
{
if (!$season) trigger_error('NO_AUTH_VIEW');
{ }
redirect($this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season)));
} $action='';
else
{ if (!$season)
$season_info = season_info($season); {
if (!sizeof($season_info)) redirect($this->helper->route('football_football_controller', array('side' => 'bank', 's' => $season)));
{ }
$error_message = sprintf($user->lang['NO_SEASON']); else
trigger_error($error_message); {
} $season_info = season_info($season);
else if (!sizeof($season_info))
{ {
// Grab the members points $error_message = sprintf($user->lang['NO_SEASON']);
$sql = 'SELECT trigger_error($error_message);
u.username, }
p.season, else
p.league, {
round(sum(if(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)),2) as saldo // Grab the members points
FROM ' . FOOTB_POINTS . ' AS p $sql = 'SELECT
JOIN ' . USERS_TABLE . " AS u ON (u.user_id = p.user_id) u.username,
WHERE p.season <= $season p.season,
GROUP BY p.season, p.league, u.username p.league,
HAVING saldo <> 0.00 round(sum(if(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)),2) as saldo
ORDER BY u.username, p.season, p.league"; FROM ' . FOOTB_POINTS . ' AS p
JOIN ' . USERS_TABLE . " AS u ON (u.user_id = p.user_id)
if(!$result = $db->sql_query($sql)) WHERE p.season <= $season
{ GROUP BY p.season, p.league, u.username
trigger_error('NO_SEASON'); HAVING saldo <> 0.00
} ORDER BY u.username, p.season, p.league";
$user_rows = $db->sql_fetchrowset($result);
$export_file = $season. '_bank.csv'; if(!$result = $db->sql_query($sql))
$newline = "\r\n"; {
header('Pragma: no-cache'); trigger_error('NO_SEASON');
header("Content-Type: text/csv; name=\"$export_file\""); }
header("Content-disposition: attachment; filename=$export_file"); $user_rows = $db->sql_fetchrowset($result);
$export= ''; $db->sql_freeresult($result);
$export .= sprintf($user->lang['SEASON']) . ' ' . $season. $newline; $newline = "\r\n";
$export .= sprintf($user->lang['NAME']) . ';' . sprintf($user->lang['SEASON']) . ';' . sprintf($user->lang['LEAGUE']) . ';Saldo;' . $newline; $csv_data= '';
$csv_data .= sprintf($user->lang['SEASON']) . ' ' . $season. $newline;
$last_username = ''; $csv_data .= sprintf($user->lang['NAME']) . ';' . sprintf($user->lang['SEASON']) . ';' . sprintf($user->lang['LEAGUE']) . ';Saldo;' . $newline;
$sum_saldo = 0.0;
foreach ($user_rows as $user_row) $last_username = '';
{ $sum_saldo = 0.0;
if ($last_username != '' AND $last_username != $user_row['username']) foreach ($user_rows as $user_row)
{ {
$export .= str_replace("\"", "\"\"", $last_username) . ';Summe;;' . if ($last_username != '' AND $last_username != $user_row['username'])
str_replace('.', ',', $sum_saldo) . ';' . $newline; {
$sum_saldo = 0.0; $csv_data .= str_replace("\"", "\"\"", $last_username) . ';Summe;;' .
} str_replace('.', ',', $sum_saldo) . ';' . $newline;
$export .= str_replace("\"", "\"\"", $user_row['username']) . ';' . $sum_saldo = 0.0;
$user_row['season'] . ';' . }
$user_row['league'] . ';' . $csv_data .= str_replace("\"", "\"\"", $user_row['username']) . ';' .
str_replace('.', ',', $user_row['saldo']) . ';' . $newline; $user_row['season'] . ';' .
$sum_saldo += $user_row['saldo']; $user_row['league'] . ';' .
$last_username = $user_row['username']; str_replace('.', ',', $user_row['saldo']) . ';' . $newline;
} $sum_saldo += $user_row['saldo'];
if ($last_username != '') $last_username = $user_row['username'];
{ }
$export .= str_replace("\"", "\"\"", $last_username) . ';Summe;;' . if ($last_username != '')
str_replace('.', ',', $sum_saldo) . ';' . $newline; {
} $csv_data .= str_replace("\"", "\"\"", $last_username) . ';Summe;;' .
echo utf8_decode($export); str_replace('.', ',', $sum_saldo) . ';' . $newline;
exit; }
} // Output the csv file
} $filename = $season. '_bank.csv';
?> $fp = fopen('php://output', 'w');
header('Content-Type: application/octet-stream');
header("Content-disposition: attachment; filename=\"" . basename($filename) . "\"");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false);
header('Pragma: public');
header('Content-Transfer-Encoding: binary');
fwrite($fp, "\xEF\xBB\xBF"); // UTF-8 BOM
fwrite($fp, utf8_decode($csv_data));
fclose($fp);
exit_handler();
}
}

View File

@@ -1,52 +1,55 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
// Check Prediction League authorisation if (!defined('IN_PHPBB'))
if ( !$this->auth->acl_get('u_use_football') ) {
{ exit;
trigger_error('NO_AUTH_VIEW'); }
}
// Check Prediction League authorisation
$action=''; if ( !$this->auth->acl_get('u_use_football') )
{
if (!$season OR !$league) trigger_error('NO_AUTH_VIEW');
{ }
redirect($this->helper->route('football_main_controller', array('side' => 'bet')));
} $action='';
else
{ if (!$season OR !$league)
if (user_is_member($user->data['user_id'], $season, $league)) {
{ redirect($this->helper->route('football_football_controller', array('side' => 'bet')));
$season_info = season_info($season); }
if (!sizeof($season_info)) else
{ {
$error_message = sprintf($user->lang['NO_SEASON']); if (user_is_member($user->data['user_id'], $season, $league))
trigger_error($error_message); {
} $season_info = season_info($season);
else if (!sizeof($season_info))
{ {
$league_info = league_info($season, $league); $error_message = sprintf($user->lang['NO_SEASON']);
if (!sizeof($league_info)) trigger_error($error_message);
{ }
$error_message = sprintf($user->lang['NO_LEAGUE']); else
trigger_error($error_message); {
} $league_info = league_info($season, $league);
else if (!sizeof($league_info))
{ {
include($this->football_includes_path . 'export.' . $this->php_ext); $error_message = sprintf($user->lang['NO_LEAGUE']);
} trigger_error($error_message);
} }
} else
else {
{ include($this->football_includes_path . 'export.' . $this->php_ext);
redirect($this->helper->route('football_main_controller', array('side' => 'bet'))); }
} }
} }
else
?> {
redirect($this->helper->route('football_football_controller', array('side' => 'bet')));
}
}

File diff suppressed because it is too large Load Diff

148
block/last_results.php Normal file
View File

@@ -0,0 +1,148 @@
<?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'))
{
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_football_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

@@ -1,66 +1,64 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$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
, u.user_lastvisit , u.user_lastvisit
, MAX(s.session_time) AS session_time , MAX(s.session_time) AS session_time
, IF(MAX(s.session_time) > u.user_lastvisit, MAX(s.session_time), u.user_lastvisit) AS lastvisit , IF(MAX(s.session_time) > u.user_lastvisit, MAX(s.session_time), u.user_lastvisit) AS lastvisit
, IF(MAX(s.session_time) > u.user_lastvisit, MAX(CONCAT(s.session_time,s.session_browser)), "") AS session_browser , IF(MAX(s.session_time) > u.user_lastvisit, MAX(CONCAT(s.session_time,s.session_browser)), "") AS session_browser
FROM ' . USERS_TABLE . ' AS u FROM ' . USERS_TABLE . ' AS u
LEFT JOIN ' . SESSIONS_TABLE . ' AS s ON (u.user_id = s.session_user_id) LEFT JOIN ' . SESSIONS_TABLE . ' AS s ON (u.user_id = s.session_user_id)
WHERE u.user_lastvisit > 0 WHERE u.user_lastvisit > 0
AND u.user_type IN (0,3) AND u.user_type IN (0,3)
GROUP BY u.user_id GROUP BY u.user_id
ORDER BY lastvisit DESC'; ORDER BY lastvisit DESC';
$result = $db->sql_query_limit($sql, 5); $result = $db->sql_query_limit($sql, $config['football_display_last_users']);
$first = true; $first = true;
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
if (!$row['lastvisit'] && $first == true) if (!$row['lastvisit'] && $first == true)
{ {
$display_last_users = false; $display_last_users = false;
} }
else else
{ {
$display_last_users = true; $display_last_users = true;
if($row['lastvisit'] > 0) if($row['lastvisit'] > 0)
{ {
$browser = ''; $browser = '';
if (preg_match('/iPad|iPhone|iOS|Opera Mobi|BlackBerry|Android|IEMobile|Symbian/', $row['session_browser'], $match_browser)) if (preg_match('/iPad|iPhone|iOS|Opera Mobi|BlackBerry|Android|IEMobile|Symbian/', $row['session_browser'], $match_browser))
{ {
$browser = ' (' . $match_browser[0] . ')'; $browser = ' (' . $match_browser[0] . ')';
} }
$template->assign_block_vars('last_users', array( $template->assign_block_vars('last_users', array(
'USER_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']) . $browser, 'USER_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']) . $browser,
'LAST_VISIT_DATE' => $user->format_date($row['lastvisit']), 'LAST_VISIT_DATE' => $user->format_date($row['lastvisit']),
)); ));
} }
} }
$first = false; $first = false;
} }
$db->sql_freeresult($result); $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

@@ -1,332 +1,322 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
if (!$user_sel) if (!$user_sel)
{ {
if (user_is_member($user->data['user_id'], $season, $league)) if (user_is_member($user->data['user_id'], $season, $league))
{ {
$user_sel = $user->data['user_id']; $user_sel = $user->data['user_id'];
} }
} }
$username = ''; $username = '';
$data = false; $data = false;
// select user // select user
$sql = 'SELECT DISTINCT $sql = 'SELECT DISTINCT
u.user_id, u.user_id,
u.username u.username
FROM ' . FOOTB_BETS . ' AS b FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE season = $season AND league = $league WHERE season = $season AND league = $league
ORDER BY LOWER(u.username) ASC"; ORDER BY LOWER(u.username) ASC";
$numb_users = 0; $numb_users = 0;
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$numb_users++; $numb_users++;
$data = true; $data = true;
if ($user_sel == $row['user_id'] OR !$user_sel) if ($user_sel == $row['user_id'] OR !$user_sel)
{ {
$selectid = ' selected="selected"'; $selectid = ' selected="selected"';
$username = $row['username']; $username = $row['username'];
$user_sel = $row['user_id']; $user_sel = $row['user_id'];
} }
else else
{ {
$selectid = ''; $selectid = '';
} }
$template->assign_block_vars('form_user', array( $template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'], 'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'], 'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid, 'S_SELECTEDID' => $selectid,
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
// All bets of selected user group by bet // All bets of selected user group by bet
$rank = 0; $rank = 0;
$bets_home_win = 0; $bets_home_win = 0;
$bets_draw = 0; $bets_draw = 0;
$bets_guest_win = 0; $bets_guest_win = 0;
$win_home_win = 0; $win_home_win = 0;
$win_draw = 0; $win_draw = 0;
$win_guest_win = 0; $win_guest_win = 0;
$points_home_win = 0; $points_home_win = 0;
$points_draw = 0; $points_draw = 0;
$points_guest_win = 0; $points_guest_win = 0;
$sql = 'SELECT $sql = 'SELECT
COUNT(b.match_no) AS bets, COUNT(b.match_no) AS bets,
b.goals_home, b.goals_home,
b.goals_guest, b.goals_guest,
SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest)
OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest)
OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0, 0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0) IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)
) )
) AS hits, ) AS hits,
SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest)
OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest)
OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0, 0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
) )
) AS tendencies, ) AS tendencies,
' . select_points('m',true) . ' ' . select_points('m',true) . '
FROM ' . FOOTB_BETS . ' AS b FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no)
WHERE b.season = $season WHERE b.season = $season
AND b.league = $league AND b.league = $league
AND b.goals_home <> '' AND b.goals_home <> ''
AND b.goals_guest <> '' AND b.goals_guest <> ''
AND m.status = 3 AND m.status = 3
AND b.user_id = $user_sel AND b.user_id = $user_sel
AND m.matchday <= $matchday AND m.matchday <= $matchday
GROUP by b.goals_home, b.goals_guest GROUP by b.goals_home, b.goals_guest
ORDER by bets DESC"; ORDER by bets DESC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
if ($row['goals_home'] > $row['goals_guest']) if ($row['goals_home'] > $row['goals_guest'])
{ {
$bets_home_win += $row['bets']; $bets_home_win += $row['bets'];
$win_home_win += $row['hits'] + $row['tendencies']; $win_home_win += $row['hits'] + $row['tendencies'];
$points_home_win += $row['points']; $points_home_win += $row['points'];
} }
if ($row['goals_home'] == $row['goals_guest']) if ($row['goals_home'] == $row['goals_guest'])
{ {
$bets_draw += $row['bets']; $bets_draw += $row['bets'];
$win_draw += $row['hits'] + $row['tendencies']; $win_draw += $row['hits'] + $row['tendencies'];
$points_draw += $row['points']; $points_draw += $row['points'];
} }
if ($row['goals_home'] < $row['goals_guest']) if ($row['goals_home'] < $row['goals_guest'])
{ {
$bets_guest_win += $row['bets']; $bets_guest_win += $row['bets'];
$win_guest_win += $row['hits'] + $row['tendencies']; $win_guest_win += $row['hits'] + $row['tendencies'];
$points_guest_win += $row['points']; $points_guest_win += $row['points'];
} }
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('bets', array( $template->assign_block_vars('bets', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'GOALSHOME' => $row['goals_home'], 'GOALSHOME' => $row['goals_home'],
'GOALSGUEST' => $row['goals_guest'], 'GOALSGUEST' => $row['goals_guest'],
'COUNT' => $row['bets'], 'COUNT' => $row['bets'],
'DIRECTHITS' => $row['hits'], 'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'], 'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'], 'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
'AVERAGE' => round($row['points'] / $row['bets'],1), 'AVERAGE' => round($row['points'] / $row['bets'],1),
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Tendencies of all results // Tendencies of all results
$sql = "SELECT $sql = "SELECT
SUM(IF(goals_home + 0 > goals_guest,1,0)) AS SUM_HOME_WIN, SUM(IF(goals_home + 0 > goals_guest,1,0)) AS SUM_HOME_WIN,
SUM(IF(goals_home = goals_guest,1,0)) AS SUM_DRAW, SUM(IF(goals_home = goals_guest,1,0)) AS SUM_DRAW,
SUM(IF(goals_home + 0 < goals_guest,1,0)) AS SUM_GUEST_WIN SUM(IF(goals_home + 0 < goals_guest,1,0)) AS SUM_GUEST_WIN
FROM " . FOOTB_MATCHES . " FROM " . FOOTB_MATCHES . "
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
AND status = 3 AND status = 3
AND matchday <= $matchday"; AND matchday <= $matchday";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$template->assign_block_vars('bets_wdl', array( $template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg2 row_dark', 'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['PLAYED']), 'SCORE' => sprintf($user->lang['PLAYED']),
'HOMEWIN' => $row['SUM_HOME_WIN'], 'HOMEWIN' => $row['SUM_HOME_WIN'],
'DRAW' => $row['SUM_DRAW'], 'DRAW' => $row['SUM_DRAW'],
'GUESTWIN' => $row['SUM_GUEST_WIN'], 'GUESTWIN' => $row['SUM_GUEST_WIN'],
) )
); );
// Muliply with user of this league // Muliply with user of this league
$template->assign_block_vars('bets_wdl_all', array( $template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg2 row_dark', 'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['PLAYED']), 'SCORE' => sprintf($user->lang['PLAYED']),
'HOMEWIN' => $row['SUM_HOME_WIN'] * $numb_users, 'HOMEWIN' => $row['SUM_HOME_WIN'] * $numb_users,
'DRAW' => $row['SUM_DRAW'] * $numb_users, 'DRAW' => $row['SUM_DRAW'] * $numb_users,
'GUESTWIN' => $row['SUM_GUEST_WIN'] * $numb_users, 'GUESTWIN' => $row['SUM_GUEST_WIN'] * $numb_users,
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Count tendencies (bets of selected user) // Count tendencies (bets of selected user)
$template->assign_block_vars('bets_wdl', array( $template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg1 row_light', 'ROW_CLASS' => 'bg1 row_light',
'SCORE' => sprintf($user->lang['GUESSED']), 'SCORE' => sprintf($user->lang['GUESSED']),
'HOMEWIN' => $bets_home_win, 'HOMEWIN' => $bets_home_win,
'DRAW' => $bets_draw, 'DRAW' => $bets_draw,
'GUESTWIN' => $bets_guest_win, 'GUESTWIN' => $bets_guest_win,
) )
); );
// Scored with tendency (bets of selected user) // Scored with tendency (bets of selected user)
$template->assign_block_vars('bets_wdl', array( $template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg2 row_dark', 'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['SCORED']), 'SCORE' => sprintf($user->lang['SCORED']),
'HOMEWIN' => $win_home_win, 'HOMEWIN' => $win_home_win,
'DRAW' => $win_draw, 'DRAW' => $win_draw,
'GUESTWIN' => $win_guest_win, 'GUESTWIN' => $win_guest_win,
) )
); );
// Points with tendency (bets of selected user) // Points with tendency (bets of selected user)
$template->assign_block_vars('bets_wdl', array( $template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg1 row_light', 'ROW_CLASS' => 'bg1 row_light',
'SCORE' => sprintf($user->lang['POINTS']), 'SCORE' => sprintf($user->lang['POINTS']),
'HOMEWIN' => $points_home_win, 'HOMEWIN' => $points_home_win,
'DRAW' => $points_draw, 'DRAW' => $points_draw,
'GUESTWIN' => $points_guest_win, 'GUESTWIN' => $points_guest_win,
) )
); );
// All bets of all users group by bet // All bets of all users group by bet
$rank = 0; $rank = 0;
$bets_home_win = 0; $bets_home_win = 0;
$bets_draw = 0; $bets_draw = 0;
$bets_guest_win = 0; $bets_guest_win = 0;
$win_home_win = 0; $win_home_win = 0;
$win_draw = 0; $win_draw = 0;
$win_guest_win = 0; $win_guest_win = 0;
$points_home_win = 0; $points_home_win = 0;
$points_draw = 0; $points_draw = 0;
$points_guest_win = 0; $points_guest_win = 0;
$sql = 'SELECT $sql = 'SELECT
COUNT(b.match_no) AS bets, COUNT(b.match_no) AS bets,
b.goals_home, b.goals_home,
b.goals_guest, b.goals_guest,
SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest)
OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest)
OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0, 0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0) IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)
) )
) AS hits, ) AS hits,
SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest)
OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest)
OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0, 0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
) )
) AS tendencies, ) AS tendencies,
' . select_points('m',true) . ' ' . select_points('m',true) . '
FROM ' . FOOTB_BETS . ' AS b FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no)
WHERE b.season = $season WHERE b.season = $season
AND b.league = $league AND b.league = $league
AND b.goals_home <> '' AND b.goals_home <> ''
AND b.goals_guest <> '' AND b.goals_guest <> ''
AND m.status = 3 AND m.status = 3
AND m.matchday <= $matchday AND m.matchday <= $matchday
GROUP by b.goals_home, b.goals_guest GROUP by b.goals_home, b.goals_guest
ORDER by bets DESC"; ORDER by bets DESC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
if ($row['goals_home'] > $row['goals_guest']) if ($row['goals_home'] > $row['goals_guest'])
{ {
$bets_home_win += $row['bets']; $bets_home_win += $row['bets'];
$win_home_win += $row['hits'] + $row['tendencies']; $win_home_win += $row['hits'] + $row['tendencies'];
$points_home_win += $row['points']; $points_home_win += $row['points'];
} }
if ($row['goals_home'] == $row['goals_guest']) if ($row['goals_home'] == $row['goals_guest'])
{ {
$bets_draw += $row['bets']; $bets_draw += $row['bets'];
$win_draw += $row['hits'] + $row['tendencies']; $win_draw += $row['hits'] + $row['tendencies'];
$points_draw += $row['points']; $points_draw += $row['points'];
} }
if ($row['goals_home'] < $row['goals_guest']) if ($row['goals_home'] < $row['goals_guest'])
{ {
$bets_guest_win += $row['bets']; $bets_guest_win += $row['bets'];
$win_guest_win += $row['hits'] + $row['tendencies']; $win_guest_win += $row['hits'] + $row['tendencies'];
$points_guest_win += $row['points']; $points_guest_win += $row['points'];
} }
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('allbets', array( $template->assign_block_vars('allbets', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'GOALSHOME' => $row['goals_home'], 'GOALSHOME' => $row['goals_home'],
'GOALSGUEST' => $row['goals_guest'], 'GOALSGUEST' => $row['goals_guest'],
'COUNT' => $row['bets'], 'COUNT' => $row['bets'],
'DIRECTHITS' => $row['hits'], 'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'], 'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'], 'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
'AVERAGE' => round($row['points'] / $row['bets'],1), 'AVERAGE' => round($row['points'] / $row['bets'],1),
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Count tendencies (bets of all user) // Count tendencies (bets of all user)
$template->assign_block_vars('bets_wdl_all', array( $template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg2 row_dark', 'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['GUESSED']), 'SCORE' => sprintf($user->lang['GUESSED']),
'HOMEWIN' => $bets_home_win, 'HOMEWIN' => $bets_home_win,
'DRAW' => $bets_draw, 'DRAW' => $bets_draw,
'GUESTWIN' => $bets_guest_win, 'GUESTWIN' => $bets_guest_win,
) )
); );
// Scored with tendency (bets of all user) // Scored with tendency (bets of all user)
$template->assign_block_vars('bets_wdl_all', array( $template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg1 row_light', 'ROW_CLASS' => 'bg1 row_light',
'SCORE' => sprintf($user->lang['SCORED']), 'SCORE' => sprintf($user->lang['SCORED']),
'HOMEWIN' => $win_home_win, 'HOMEWIN' => $win_home_win,
'DRAW' => $win_draw, 'DRAW' => $win_draw,
'GUESTWIN' => $win_guest_win, 'GUESTWIN' => $win_guest_win,
) )
); );
// Points with tendency (bets of all user) // Points with tendency (bets of all user)
$template->assign_block_vars('bets_wdl_all', array( $template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg2 row_dark', 'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['POINTS']), 'SCORE' => sprintf($user->lang['POINTS']),
'HOMEWIN' => $points_home_win, 'HOMEWIN' => $points_home_win,
'DRAW' => $points_draw, 'DRAW' => $points_draw,
'GUESTWIN' => $points_guest_win, 'GUESTWIN' => $points_guest_win,
) )
); );
$sidename = sprintf($user->lang['MY_BETS']); $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)) : 'S_DATA_MY_BETS' => $data,
$this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), 'SEASON' => $season,
'LEFT_LINK' => ($config['football_bank']) ? '&lt; ' . sprintf($user->lang['FOOTBALL_BANK']) : 'LEAGUE' => $league,
'&lt; ' . sprintf($user->lang['RANK_TOTAL']), 'USERNAME' => $username,
'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,
'SEASON' => $season,
'LEAGUE' => $league,
'USERNAME' => $username,
)
);
?>

View File

@@ -1,339 +1,333 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$data = false; $data = false;
$user1 = ''; $user1 = '';
$user2 = ''; $user2 = '';
$user3 = ''; $user3 = '';
$user4 = ''; $user4 = '';
$username = ''; $username = '';
$username2 = ''; $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);
$total_users = sizeof($current_ranks); $db->sql_freeresult($result);
if ($total_users > 3 AND $total_users <= 50) $total_users = sizeof($current_ranks);
{ if ($total_users > 3 AND $total_users <= 50)
$data = true; {
$middle = round($total_users / 2,0); $data = true;
// If user = leader then first = seconde $middle = round($total_users / 2,0);
$user_first = $current_ranks[0]['user_id']; // If user = leader then first = seconde
if ($user_first == $user->data['user_id']) $user_first = $current_ranks[0]['user_id'];
$user_first = $current_ranks[1]['user_id']; if ($user_first == $user->data['user_id'])
// If user = middle then middle = middle - 1 $user_first = $current_ranks[1]['user_id'];
$user_middle = $current_ranks[$middle-1]['user_id']; // If user = middle then middle = middle - 1
if ($user_middle == $user->data['user_id']) $user_middle = $current_ranks[$middle-1]['user_id'];
$user_middle = $current_ranks[$middle]['user_id']; if ($user_middle == $user->data['user_id'])
// If user = last then last = last but one $user_middle = $current_ranks[$middle]['user_id'];
$user_last = $current_ranks[$total_users - 1]['user_id']; // If user = last then last = last but one
if ($user_last == $user->data['user_id']) $user_last = $current_ranks[$total_users - 1]['user_id'];
$user_last = $current_ranks[$total_users - 2]['user_id']; if ($user_last == $user->data['user_id'])
$user_last = $current_ranks[$total_users - 2]['user_id'];
if (user_is_member($user->data['user_id'], $season, $league))
{ if (user_is_member($user->data['user_id'], $season, $league))
// Take user, leader, middle and last {
$user1 = $this->request->variable('user1', $user->data['user_id']); // Take user, leader, middle and last
$user2 = $this->request->variable('user2', $user_first); $user1 = $this->request->variable('user1', $user->data['user_id']);
$user3 = $this->request->variable('user3', $user_middle); $user2 = $this->request->variable('user2', $user_first);
$user4 = $this->request->variable('user4', $user_last); $user3 = $this->request->variable('user3', $user_middle);
} $user4 = $this->request->variable('user4', $user_last);
else }
{ else
// Only take leader, middle and last {
$user1 = $this->request->variable('user1', $user_first); // Only take leader, middle and last
$user2 = $this->request->variable('user2', $user_middle); $user1 = $this->request->variable('user1', $user_first);
$user3 = $this->request->variable('user3', $user_last); $user2 = $this->request->variable('user2', $user_middle);
$user4 = $this->request->variable('user4', 0); $user3 = $this->request->variable('user3', $user_last);
} $user4 = $this->request->variable('user4', 0);
}
// Add empty choice
$template->assign_block_vars('form_user2', array( // Add empty choice
'S_USERNAME' => sprintf($user->lang['OPTION_USER']), $template->assign_block_vars('form_user2', array(
'S_USERID' => 0, 'S_USERNAME' => sprintf($user->lang['OPTION_USER']),
'S_SELECTEDID2' => '', 'S_USERID' => 0,
) 'S_SELECTEDID2' => '',
); )
$template->assign_block_vars('form_user3', array( );
'S_USERNAME' => sprintf($user->lang['OPTION_USER']), $template->assign_block_vars('form_user3', array(
'S_USERID' => 0, 'S_USERNAME' => sprintf($user->lang['OPTION_USER']),
'S_SELECTEDID3' => '', 'S_USERID' => 0,
) 'S_SELECTEDID3' => '',
); )
$template->assign_block_vars('form_user4', array( );
'S_USERNAME' => sprintf($user->lang['OPTION_USER']), $template->assign_block_vars('form_user4', array(
'S_USERID' => 0, 'S_USERNAME' => sprintf($user->lang['OPTION_USER']),
'S_SELECTEDID4' => '', 'S_USERID' => 0,
) 'S_SELECTEDID4' => '',
); )
);
// Start select user
foreach ($current_ranks as $rank_user) // Start select user
{ foreach ($current_ranks as $rank_user)
$curr_userid =$rank_user['user_id']; {
if ($user1 == $curr_userid) $curr_userid =$rank_user['user_id'];
{ if ($user1 == $curr_userid)
$selectid1 = ' selected="selected"'; {
$username = $rank_user['username']; $selectid1 = ' selected="selected"';
} $username = $rank_user['username'];
else }
{ else
$selectid1 = ''; {
} $selectid1 = '';
if ($user2 == $curr_userid) }
{ if ($user2 == $curr_userid)
$selectid2 = ' selected="selected"'; {
$username2 = $rank_user['username']; $selectid2 = ' selected="selected"';
} $username2 = $rank_user['username'];
else }
{ else
$selectid2 = ''; {
} $selectid2 = '';
if ($user3 == $curr_userid) }
{ if ($user3 == $curr_userid)
$selectid3 = ' selected="selected"'; {
$username3 = $rank_user['username']; $selectid3 = ' selected="selected"';
} $username3 = $rank_user['username'];
else }
{ else
$selectid3 = ''; {
} $selectid3 = '';
if ($user4 == $curr_userid) }
{ if ($user4 == $curr_userid)
$selectid4 = ' selected="selected"'; {
$username4 = $rank_user['username']; $selectid4 = ' selected="selected"';
} $username4 = $rank_user['username'];
else }
{ else
$selectid4 = ''; {
} $selectid4 = '';
if ($curr_userid != $user2 AND $curr_userid != $user3 AND $curr_userid != $user4) }
$template->assign_block_vars('form_user1', array( if ($curr_userid != $user2 AND $curr_userid != $user3 AND $curr_userid != $user4)
'S_USERNAME' => $rank_user['username'], $template->assign_block_vars('form_user1', array(
'S_USERID' => $curr_userid, 'S_USERNAME' => $rank_user['username'],
'S_SELECTEDID' => $selectid1)); 'S_USERID' => $curr_userid,
if ($curr_userid != $user1 AND $curr_userid != $user3 AND $curr_userid != $user4) 'S_SELECTEDID' => $selectid1));
$template->assign_block_vars('form_user2', array( if ($curr_userid != $user1 AND $curr_userid != $user3 AND $curr_userid != $user4)
'S_USERNAME' => $rank_user['username'], $template->assign_block_vars('form_user2', array(
'S_USERID' => $curr_userid, 'S_USERNAME' => $rank_user['username'],
'S_SELECTEDID' => $selectid2)); 'S_USERID' => $curr_userid,
if ($curr_userid != $user1 AND $curr_userid != $user2 AND $curr_userid != $user4) 'S_SELECTEDID' => $selectid2));
$template->assign_block_vars('form_user3', array( if ($curr_userid != $user1 AND $curr_userid != $user2 AND $curr_userid != $user4)
'S_USERNAME' => $rank_user['username'], $template->assign_block_vars('form_user3', array(
'S_USERID' => $curr_userid, 'S_USERNAME' => $rank_user['username'],
'S_SELECTEDID' => $selectid3)); 'S_USERID' => $curr_userid,
if ($curr_userid != $user1 AND $curr_userid != $user2 AND $curr_userid != $user3) 'S_SELECTEDID' => $selectid3));
$template->assign_block_vars('form_user4', array( if ($curr_userid != $user1 AND $curr_userid != $user2 AND $curr_userid != $user3)
'S_USERNAME' => $rank_user['username'], $template->assign_block_vars('form_user4', array(
'S_USERID' => $curr_userid, 'S_USERNAME' => $rank_user['username'],
'S_SELECTEDID' => $selectid4)); 'S_USERID' => $curr_userid,
} 'S_SELECTEDID' => $selectid4));
}
$ranks_total_1 = '';
$ranks_dayl_1 = ''; $ranks_total_1 = '';
$points_1 = ''; $ranks_dayl_1 = '';
$sql = 'SELECT * $points_1 = '';
FROM ' . FOOTB_RANKS . " $sql = 'SELECT *
WHERE season = $season FROM ' . FOOTB_MY_CHART . "
AND league = $league WHERE season = $season
AND matchday <= $matchday AND league = $league
AND user_id = $user1 AND matchday <= $matchday
ORDER BY matchday ASC"; AND user_id = $user1
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{ while($row = $db->sql_fetchrow($result))
$points_1 = $points_1. $row['points']. ','; {
$ranks_total_1 = $ranks_total_1. $row['rank_total']. ','; $points_1 = $points_1. $row['points']. ',';
$ranks_dayl_1 = $ranks_dayl_1. $row['rank']. ','; $ranks_total_1 = $ranks_total_1. $row['rank_total']. ',';
} $ranks_dayl_1 = $ranks_dayl_1. $row['rank']. ',';
$points_1 = substr($points_1, 0, strlen($points_1) - 1); }
$ranks_total_1 = substr($ranks_total_1, 0, strlen($ranks_total_1) - 1); $points_1 = substr($points_1, 0, strlen($points_1) - 1);
$ranks_dayl_1 = substr($ranks_dayl_1, 0, strlen($ranks_dayl_1) - 1); $ranks_total_1 = substr($ranks_total_1, 0, strlen($ranks_total_1) - 1);
$db->sql_freeresult($result); $ranks_dayl_1 = substr($ranks_dayl_1, 0, strlen($ranks_dayl_1) - 1);
$db->sql_freeresult($result);
$ranks_total_2 = '';
$ranks_dayl_2 = ''; $ranks_total_2 = '';
$points_2 = ''; $ranks_dayl_2 = '';
if ($user2 != 0) $points_2 = '';
{ if ($user2 != 0)
$sql = 'SELECT * {
FROM ' . FOOTB_RANKS . " $sql = 'SELECT *
WHERE season = $season FROM ' . FOOTB_RANKS . "
AND league = $league WHERE season = $season
AND matchday <= $matchday AND league = $league
AND user_id = $user2 AND matchday <= $matchday
ORDER BY matchday ASC"; AND user_id = $user2
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{ while($row = $db->sql_fetchrow($result))
$points_2 = $points_2 . $row['points']. ','; {
$ranks_total_2 = $ranks_total_2 . $row['rank_total']. ','; $points_2 = $points_2 . $row['points']. ',';
$ranks_dayl_2 = $ranks_dayl_2 . $row['rank']. ','; $ranks_total_2 = $ranks_total_2 . $row['rank_total']. ',';
} $ranks_dayl_2 = $ranks_dayl_2 . $row['rank']. ',';
$points_2 = substr($points_2, 0, strlen($points_2) - 1); }
$ranks_total_2 = substr($ranks_total_2, 0, strlen($ranks_total_2) - 1); $points_2 = substr($points_2, 0, strlen($points_2) - 1);
$ranks_dayl_2 = substr($ranks_dayl_2, 0, strlen($ranks_dayl_2) - 1); $ranks_total_2 = substr($ranks_total_2, 0, strlen($ranks_total_2) - 1);
$db->sql_freeresult($result); $ranks_dayl_2 = substr($ranks_dayl_2, 0, strlen($ranks_dayl_2) - 1);
} $db->sql_freeresult($result);
}
$ranks_total_3 = '';
$ranks_dayl_3 = ''; $ranks_total_3 = '';
$points_3 = ''; $ranks_dayl_3 = '';
if ($user3 != 0) $points_3 = '';
{ if ($user3 != 0)
$sql = 'SELECT * {
FROM ' . FOOTB_RANKS . " $sql = 'SELECT *
WHERE season = $season FROM ' . FOOTB_MY_CHART . "
AND league = $league WHERE season = $season
AND matchday <= $matchday AND league = $league
AND user_id = $user3 AND matchday <= $matchday
ORDER BY matchday ASC"; AND user_id = $user3
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{ while($row = $db->sql_fetchrow($result))
$points_3 = $points_3. $row['points']. ','; {
$ranks_total_3 = $ranks_total_3. $row['rank_total']. ','; $points_3 = $points_3. $row['points']. ',';
$ranks_dayl_3 = $ranks_dayl_3. $row['rank']. ','; $ranks_total_3 = $ranks_total_3. $row['rank_total']. ',';
} $ranks_dayl_3 = $ranks_dayl_3. $row['rank']. ',';
$points_3 = substr($points_3,0,strlen($points_3)-1); }
$ranks_total_3 = substr($ranks_total_3,0,strlen($ranks_total_3)-1); $points_3 = substr($points_3,0,strlen($points_3)-1);
$ranks_dayl_3 = substr($ranks_dayl_3,0,strlen($ranks_dayl_3)-1); $ranks_total_3 = substr($ranks_total_3,0,strlen($ranks_total_3)-1);
$db->sql_freeresult($result); $ranks_dayl_3 = substr($ranks_dayl_3,0,strlen($ranks_dayl_3)-1);
} $db->sql_freeresult($result);
}
$ranks_total_4 = '';
$ranks_dayl_4 = ''; $ranks_total_4 = '';
$points_4 = ''; $ranks_dayl_4 = '';
if ($user4 != 0) $points_4 = '';
{ if ($user4 != 0)
$sql = 'SELECT * {
FROM ' . FOOTB_RANKS . " $sql = 'SELECT *
WHERE season = $season FROM ' . FOOTB_MY_CHART . "
AND league = $league WHERE season = $season
AND matchday <= $matchday AND league = $league
AND user_id = $user4 AND matchday <= $matchday
ORDER BY matchday ASC"; AND user_id = $user4
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{ while($row = $db->sql_fetchrow($result))
$points_4 = $points_4. $row['points']. ','; {
$sptagplatz = $row['rank']; $points_4 = $points_4. $row['points']. ',';
$ranks_total_4 = $ranks_total_4. $row['rank_total']. ','; $sptagplatz = $row['rank'];
$ranks_dayl_4 = $ranks_dayl_4. $row['rank']. ','; $ranks_total_4 = $ranks_total_4. $row['rank_total']. ',';
} $ranks_dayl_4 = $ranks_dayl_4. $row['rank']. ',';
$points_4 = substr($points_4,0,strlen($points_4)-1); }
$ranks_total_4 = substr($ranks_total_4,0,strlen($ranks_total_4)-1); $points_4 = substr($points_4,0,strlen($points_4)-1);
$ranks_dayl_4 = substr($ranks_dayl_4,0,strlen($ranks_dayl_4)-1); $ranks_total_4 = substr($ranks_total_4,0,strlen($ranks_total_4)-1);
$db->sql_freeresult($result); $ranks_dayl_4 = substr($ranks_dayl_4,0,strlen($ranks_dayl_4)-1);
} $db->sql_freeresult($result);
}
$min = '';
$max = ''; $min = '';
if ($user1 != 0) $max = '';
{ if ($user1 != 0)
$sql = 'SELECT {
MIN(points) As points_min, $sql = 'SELECT
MAX(points) As points_max MIN(points) As points_min,
FROM ' . FOOTB_RANKS . " MAX(points) As points_max
WHERE season = $season FROM ' . FOOTB_MY_CHART . "
AND league = $league WHERE season = $season
AND matchday <= $matchday AND league = $league
GROUP BY matchday AND matchday <= $matchday
ORDER BY matchday ASC"; GROUP BY matchday
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{ while($row = $db->sql_fetchrow($result))
$min = $min. $row['points_min']. ','; {
$max = $max. $row['points_max']. ','; $min = $min. $row['points_min']. ',';
} $max = $max. $row['points_max']. ',';
$min = substr($min,0,strlen($min)-1); }
$max = substr($max,0,strlen($max)-1); $min = substr($min,0,strlen($min)-1);
$db->sql_freeresult($result); $max = substr($max,0,strlen($max)-1);
} $db->sql_freeresult($result);
// Create and display charts }
$chart= "<img src='". generate_board_url() . '/' . $this->football_root_path // Create and display charts
. "includes/chart_rank.php?t=$total_users&amp;m=$matchday&amp;v1=$ranks_total_1&amp;v2=$ranks_total_2&amp;v3=$ranks_total_3&amp;v4=$ranks_total_4&amp;c=" $chart= "<img src='". generate_board_url() . '/' . $this->football_root_path
. sprintf($user->lang['PLACE']) . "' alt='" . "includes/chart_rank.php?t=$total_users&amp;m=$matchday&amp;v1=$ranks_total_1&amp;v2=$ranks_total_2&amp;v3=$ranks_total_3&amp;v4=$ranks_total_4&amp;c="
. sprintf($user->lang['CHART_TOTAL']) . sprintf($user->lang['PLACE']) . "' alt='"
. "'/>"; . sprintf($user->lang['CHART_TOTAL'])
$template->assign_block_vars('chart_rank', array( . "'/>";
'CHARTIMAGE' => $chart, $template->assign_block_vars('chart_rank', array(
) 'CHARTIMAGE' => $chart,
); )
$chart= "<img src='". generate_board_url() . '/' . $this->football_root_path );
. "includes/chart_rank.php?t=$total_users&amp;m=$matchday&amp;v1=$ranks_dayl_1&amp;v2=$ranks_dayl_2&amp;v3=$ranks_dayl_3&amp;v4=$ranks_dayl_4&amp;c=" $chart= "<img src='". generate_board_url() . '/' . $this->football_root_path
. sprintf($user->lang['PLACE']) . "' alt='" . "includes/chart_rank.php?t=$total_users&amp;m=$matchday&amp;v1=$ranks_dayl_1&amp;v2=$ranks_dayl_2&amp;v3=$ranks_dayl_3&amp;v4=$ranks_dayl_4&amp;c="
. sprintf($user->lang['CHART_MATCHDAY']) . sprintf($user->lang['PLACE']) . "' alt='"
. "'/>"; . sprintf($user->lang['CHART_MATCHDAY'])
$template->assign_block_vars('chart_matchtdays', array( . "'/>";
'CHARTIMAGE' => $chart, $template->assign_block_vars('chart_matchtdays', array(
) 'CHARTIMAGE' => $chart,
); )
$chart= "<img src='". generate_board_url() . '/' . $this->football_root_path );
. "includes/chart_points.php?m=$matchday&amp;v1=$points_1&amp;v2=$points_2&amp;v3=$points_3&amp;v4=$points_4&amp;min=$min&amp;max=$max&amp;c=" $chart= "<img src='". generate_board_url() . '/' . $this->football_root_path
. sprintf($user->lang['POINTS']) . ',' . sprintf($user->lang['BANDWIDTH']) . "' alt='" . "includes/chart_points.php?m=$matchday&amp;v1=$points_1&amp;v2=$points_2&amp;v3=$points_3&amp;v4=$points_4&amp;min=$min&amp;max=$max&amp;c="
. sprintf($user->lang['CHART_POINTS']) . sprintf($user->lang['POINTS']) . ',' . sprintf($user->lang['BANDWIDTH']) . "' alt='"
. "'/>"; . sprintf($user->lang['CHART_POINTS'])
$template->assign_block_vars('chart_points', array( . "'/>";
'CHARTIMAGE' => $chart, $template->assign_block_vars('chart_points', array(
) 'CHARTIMAGE' => $chart,
); )
} );
$sidename = sprintf($user->lang['MY_CHART']); }
$template->assign_vars(array( $sidename = sprintf($user->lang['MY_CHART']);
'S_DISPLAY_MY_CHART' => true, $template->assign_vars(array(
'S_SIDENAME' => $sidename, 'S_DISPLAY_MY_CHART' => true,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_rank', 's' => $season, 'l' => $league, 'm' => $matchday)), 'S_SIDENAME' => $sidename,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_RANK']), 'S_DATA_MY_CHART' => $data,
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday)), 'SEASON' => $season,
'RIGHT_LINK' => sprintf($user->lang['MY_KOEFF']) . ' &gt;', 'LEAGUE' => $league,
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_RANKS']), 'S_USER1' => $user1,
'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_KOEFF']), 'S_USER2' => $user2,
'S_DATA_MY_CHART' => $data, 'S_USER3' => $user3,
'SEASON' => $season, 'S_USER4' => $user4,
'LEAGUE' => $league, 'USERNAME1' => $username,
'S_USER1' => $user1, 'USERNAME2' => $username2,
'S_USER2' => $user2, 'USERNAME3' => $username3,
'S_USER3' => $user3, 'USERNAME4' => $username4,
'S_USER4' => $user4, )
'USERNAME1' => $username, );
'USERNAME2' => $username2,
'USERNAME3' => $username3,
'USERNAME4' => $username4,
)
);
?>

View File

@@ -1,393 +1,384 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$start = $this->request->variable('start', 0); $start = $this->request->variable('start', 0);
$matches_on_matchday = false; $matches_on_matchday = false;
if (!$user_sel) if (!$user_sel)
{ {
if (user_is_member($user->data['user_id'], $season, $league)) if (user_is_member($user->data['user_id'], $season, $league))
{ {
$user_sel = $user->data['user_id']; $user_sel = $user->data['user_id'];
} }
} }
$username = ''; $username = '';
$data = false; $data = false;
// Select user // Select user
$total_users = 0; $total_users = 0;
$sql = 'SELECT DISTINCT $sql = 'SELECT DISTINCT
u.user_id, u.user_id,
u.username u.username
FROM ' . FOOTB_BETS . ' AS b FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
ORDER BY LOWER(u.username) ASC"; ORDER BY LOWER(u.username) ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$total_users++; $total_users++;
if ($user_sel == $row['user_id'] OR !$user_sel) if ($user_sel == $row['user_id'] OR !$user_sel)
{ {
$selectid = ' selected="selected"'; $selectid = ' selected="selected"';
$username = $row['username']; $username = $row['username'];
$user_sel = $row['user_id']; $user_sel = $row['user_id'];
} }
else else
{ {
$selectid = ''; $selectid = '';
} }
$template->assign_block_vars('form_user', array( $template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'], 'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'], 'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid, 'S_SELECTEDID' => $selectid,
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Select matches with results and tendencies // Select matches with results and tendencies
$sql = "SELECT $sql = "SELECT
m.match_no, m.match_no,
m.status, m.status,
m.formula_home, m.formula_home,
m.formula_guest, m.formula_guest,
t1.team_name_short AS home_name, t1.team_name_short AS home_name,
t2.team_name_short AS guest_name, t2.team_name_short AS guest_name,
t1.team_id AS home_id, t1.team_id AS home_id,
t2.team_id AS guest_id, t2.team_id AS guest_id,
m.goals_home, m.goals_home,
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
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)
LEFT JOIN ' . FOOTB_BETS . " AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) LEFT JOIN ' . FOOTB_BETS . " AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
WHERE m.season = $season WHERE m.season = $season
AND m.league = $league AND m.league = $league
AND m.matchday = $matchday AND m.matchday = $matchday
GROUP BY m.match_no GROUP BY m.match_no
ORDER BY m.match_datetime ASC, m.match_no ASC"; ORDER BY m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$matches = $db->sql_fetchrowset($result); $matches = $db->sql_fetchrowset($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
$count_matches = sizeof($matches); $count_matches = sizeof($matches);
if ($count_matches > 11) if ($count_matches > 11)
{ {
$split_after = 8; $split_after = 8;
$splits = floor($count_matches / 8); $splits = floor($count_matches / 8);
} }
else 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) {
{ $start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page'];
$start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page']; }
} else
else {
{ $start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page'];
$start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page']; }
}
$sql_start = $start * $count_matches;
$sql_start = $start * $count_matches; $sql_limit = $config['football_users_per_page'] * $count_matches;
$sql_limit = $config['football_users_per_page'] * $count_matches;
// handle pagination.
// handle pagination. $base_url = $this->helper->route('football_football_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday, 'u' => "$user_sel"));
$base_url = $this->helper->route('football_main_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday, 'u' => "$user_sel")); $pagination = $phpbb_container->get('pagination');
$pagination = $phpbb_container->get('pagination'); $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
$bet_line = array();
$bet_line = array(); if ($count_matches > 0)
if ($count_matches > 0) {
{ $matches_on_matchday = true;
$matches_on_matchday = true; // Select user bets and points on user results
// Select user bets and points on user results $sql = "SELECT
$sql = "SELECT u.user_id,
u.user_id, u.username,
u.username, m.status,
m.status, b.goals_home AS bet_home,
b.goals_home AS bet_home, b.goals_guest AS bet_guest,
b.goals_guest AS bet_guest, " . select_points("bu") . "
" . select_points("bu") . " FROM " . FOOTB_MATCHES . ' AS m
FROM " . FOOTB_MATCHES . ' AS m LEFT JOIN ' . FOOTB_BETS . ' AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
LEFT JOIN ' . FOOTB_BETS . ' AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) LEFT JOIN ' . FOOTB_BETS . " AS bu ON(bu.season = m.season AND bu.league = m.league AND bu.match_no = m.match_no AND bu.user_id = $user_sel)
LEFT JOIN ' . FOOTB_BETS . " AS bu ON(bu.season = m.season AND bu.league = m.league AND bu.match_no = m.match_no AND bu.user_id = $user_sel) LEFT JOIN " . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
LEFT JOIN " . USERS_TABLE . " AS u ON (u.user_id = b.user_id) WHERE m.season = $season
WHERE m.season = $season AND m.league = $league
AND m.league = $league AND m.matchday = $matchday
AND m.matchday = $matchday ORDER BY LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC";
ORDER BY 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); $bet_index = 0;
$bet_index = 0; $split_index = 0;
$split_index = 0; foreach ($user_bets AS $user_bet)
foreach ($user_bets AS $user_bet) {
{ $data = true;
$data = true; if ($bet_index == $count_matches)
if ($bet_index == $count_matches) {
{ $bet_index = 0;
$bet_index = 0; $split_index = 0;
$split_index = 0; }
} if (!($bet_index % $split_after))
if (!($bet_index % $split_after)) {
{ $split_index++;
$split_index++; }
} $sum_total[$user_bet['username']] = 0;
$sum_total[$user_bet['username']] = 0; $bet_line[$split_index][] = $user_bet;
$bet_line[$split_index][] = $user_bet; $bet_index++;
$bet_index++; }
} }
} $match_index = 0;
$match_index = 0; $split_index = 0;
$split_index = 0; $matchday_sum_total = 0;
$matchday_sum_total = 0; $colorstyle_total = ' color_finally';
$colorstyle_total = ' color_finally'; foreach ($matches AS $match)
foreach ($matches AS $match) {
{ if (!($match_index % $split_after))
if (!($match_index % $split_after)) {
{ if ($match_index > 0)
if ($match_index > 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)
foreach ($bet_line[$split_index] AS $user_bet) {
{ if ($bet_index == 0)
if ($bet_index == 0) {
{ $count_user++;
$count_user++; $row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$row_class = (!($count_user % 2)) ? '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'; }
} $template->assign_block_vars('match_panel.user_row', array(
$template->assign_block_vars('match_panel.user_row', array( 'ROW_CLASS' => $row_class,
'ROW_CLASS' => $row_class, 'USER_NAME' => $user_bet['username'],
'USER_NAME' => $user_bet['username'], )
) );
); $total = 0;
$total = 0; }
} $bet_index++;
$bet_index++; $total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
$total += $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 $bet_home = ($user_bet['bet_home'] == '') ? '&nbsp;' : '?';
$bet_home = ($user_bet['bet_home'] == '') ? '&nbsp;' : '?'; $bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?'; }
} else
else {
{ $bet_home = $user_bet['bet_home'];
$bet_home = $user_bet['bet_home']; $bet_guest = $user_bet['bet_guest'];
$bet_guest = $user_bet['bet_guest']; }
}
$colorstyle_bet = color_style($user_bet['status']);
$colorstyle_bet = color_style($user_bet['status']); $template->assign_block_vars('match_panel.user_row.bet', array(
$template->assign_block_vars('match_panel.user_row.bet', array( 'BET' => $bet_home. ':'. $bet_guest,
'BET' => $bet_home. ':'. $bet_guest, 'COLOR_STYLE' => $colorstyle_bet,
'COLOR_STYLE' => $colorstyle_bet, 'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'], )
) );
);
if ($bet_index == $split_after)
if ($bet_index == $split_after) {
{ $sum_total[$user_bet['username']] += $total;
$sum_total[$user_bet['username']] += $total; $matchday_sum_total += $total;
$matchday_sum_total += $total; $bet_index = 0;
$bet_index = 0; }
} }
}
$template->assign_block_vars('match_panel.tendency_footer', array(
$template->assign_block_vars('match_panel.tendency_footer', array( 'S_TOTAL' => false,
'S_TOTAL' => false, )
) );
); foreach ($matches_tendency AS $match_tendency)
foreach ($matches_tendency AS $match_tendency) {
{ $template->assign_block_vars('match_panel.tendency_footer.tendency', array(
$template->assign_block_vars('match_panel.tendency_footer.tendency', array( 'TENDENCY' => $match_tendency,
'TENDENCY' => $match_tendency, )
) );
); }
} }
} $matches_tendency = array();
$matches_tendency = array(); $split_index++;
$split_index++; if ($split_index == $splits)
if ($split_index == $splits) {
{ $display_total = true;
$display_total = true; }
} else
else {
{ $display_total = false;
$display_total = false; }
} $template->assign_block_vars('match_panel', array(
$template->assign_block_vars('match_panel', array( 'S_TOTAL' => $display_total,
'S_TOTAL' => $display_total, )
) );
); }
} if (0 == $match['home_id'])
if (0 == $match['home_id']) {
{ $home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']);
$home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']); $home_in_array = explode("#",$home_info);
$home_in_array = explode("#",$home_info); $homename = $home_in_array[3];
$homename = $home_in_array[3]; }
} else
else {
{ $homename = $match['home_name'];
$homename = $match['home_name']; }
} if (0 == $match['guest_id'])
if (0 == $match['guest_id']) {
{ $guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']);
$guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']); $guest_in_array = explode("#",$guest_info);
$guest_in_array = explode("#",$guest_info); $guestname = $guest_in_array[3];
$guestname = $guest_in_array[3]; }
} else
else {
{ $guestname = $match['guest_name'];
$guestname = $match['guest_name']; }
} $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, )
) );
); if ($match['status'] < 1 && !$config['football_view_tendencies'])
if ($match['status'] < 1 && !$config['football_view_tendencies']) {
{ // hide tendencies
// hide tendencies $matches_tendency[] = '?-?-?';
$matches_tendency[] = '?-?-?'; }
} else
else {
{ $matches_tendency[] = $match['home'] . '-' . $match['draw'] . '-' . $match['guest'];
$matches_tendency[] = $match['home'] . '-' . $match['draw'] . '-' . $match['guest']; }
} $match_index++;
$match_index++; }
} if ($count_matches > 0)
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)
foreach ($bet_line[$split_index] AS $user_bet) {
{ if ($bet_index == 0)
if ($bet_index == 0) {
{ $count_user++;
$count_user++; $row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$row_class = (!($count_user % 2)) ? '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'; }
} $template->assign_block_vars('match_panel.user_row', array(
$template->assign_block_vars('match_panel.user_row', array( 'ROW_CLASS' => $row_class,
'ROW_CLASS' => $row_class, 'USER_NAME' => $user_bet['username'],
'USER_NAME' => $user_bet['username'], )
) );
); $total = 0;
$total = 0; }
} $bet_index++;
$bet_index++; $total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
$total += $user_bet['points']; if ($user_bet['status'] < 1)
if ($user_bet['status'] < 1) {
{ if ($user_bet['bet_home'] == '')
if ($user_bet['bet_home'] == '') {
{ $bet_home = '';
$bet_home = ''; }
} else
else {
{ $bet_home = '?';
$bet_home = '?'; }
} if ($user_bet['bet_guest'] == '')
if ($user_bet['bet_guest'] == '') {
{ $bet_guest = '';
$bet_guest = ''; }
} else
else {
{ $bet_guest = '?';
$bet_guest = '?'; }
} }
} else
else {
{ $bet_home = $user_bet['bet_home'];
$bet_home = $user_bet['bet_home']; $bet_guest = $user_bet['bet_guest'];
$bet_guest = $user_bet['bet_guest']; }
}
$colorstyle_bet = color_style($user_bet['status']);
$colorstyle_bet = color_style($user_bet['status']); $template->assign_block_vars('match_panel.user_row.bet', array(
$template->assign_block_vars('match_panel.user_row.bet', array( 'BET' => $bet_home. ':'. $bet_guest,
'BET' => $bet_home. ':'. $bet_guest, 'COLOR_STYLE' => $colorstyle_bet,
'COLOR_STYLE' => $colorstyle_bet, 'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'], )
) );
);
if ($bet_index == $split_after)
if ($bet_index == $split_after) {
{ $sum_total[$user_bet['username']] += $total;
$sum_total[$user_bet['username']] += $total; $matchday_sum_total += $total;
$matchday_sum_total += $total; $template->assign_block_vars('match_panel.user_row.points', array(
$template->assign_block_vars('match_panel.user_row.points', array( 'COLOR_STYLE' => $colorstyle_total,
'COLOR_STYLE' => $colorstyle_total, 'POINTS_TOTAL' => $sum_total[$user_bet['username']],
'POINTS_TOTAL' => $sum_total[$user_bet['username']], )
) );
); $bet_index = 0;
$bet_index = 0; }
} }
}
$template->assign_block_vars('match_panel.tendency_footer', array(
$template->assign_block_vars('match_panel.tendency_footer', array( 'S_TOTAL' => true,
'S_TOTAL' => true, 'COLOR_STYLE' => $colorstyle_total, //currently ignored
'COLOR_STYLE' => $colorstyle_total, //currently ignored 'SUMTOTAL' => $matchday_sum_total,
'SUMTOTAL' => $matchday_sum_total, )
) );
); foreach ($matches_tendency AS $match_tendency)
foreach ($matches_tendency AS $match_tendency) {
{ $template->assign_block_vars('match_panel.tendency_footer.tendency', array(
$template->assign_block_vars('match_panel.tendency_footer.tendency', array( 'TENDENCY' => $match_tendency,
'TENDENCY' => $match_tendency, )
) );
); }
} }
}
$sidename = sprintf($user->lang['MY_KOEFF']);
$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, 'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_chart', 's' => $season, 'l' => $league, 'm' => $matchday)), 'S_SPALTEN' => ($count_matches * 2) + 2,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_CHART']), 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'stat_points', 's' => $season, 'l' => $league, 'm' => $matchday)), 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
'RIGHT_LINK' => sprintf($user->lang['STAT_POINTS']) . ' &gt;', 'USERNAME' => $username,
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_CHART']), )
'RIGHT_TITLE' => sprintf($user->lang['TITLE_STAT_POINTS']), );
'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday,
'S_SPALTEN' => ($count_matches * 2) + 2,
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
'USERNAME' => $username,
)
);
?>

View File

@@ -1,204 +1,197 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
if (!$user_sel) if (!$user_sel)
{ {
if (user_is_member($user->data['user_id'], $season, $league)) if (user_is_member($user->data['user_id'], $season, $league))
{ {
$user_sel = $user->data['user_id']; $user_sel = $user->data['user_id'];
} }
} }
$username = ''; $username = '';
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$data = false; $data = false;
// Select user // Select user
$sql = 'SELECT DISTINCT $sql = 'SELECT DISTINCT
u.user_id, u.user_id,
u.username u.username
FROM ' . FOOTB_BETS . ' AS b FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
ORDER BY LOWER(u.username) ASC"; ORDER BY LOWER(u.username) ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$data = true; $data = true;
if ($user_sel == $row['user_id'] OR !$user_sel) if ($user_sel == $row['user_id'] OR !$user_sel)
{ {
$selectid = ' selected="selected"'; $selectid = ' selected="selected"';
$username = $row['username']; $username = $row['username'];
$user_sel = $row['user_id']; $user_sel = $row['user_id'];
} }
else else
{ {
$selectid = ''; $selectid = '';
} }
$template->assign_block_vars('form_user', array( $template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'], 'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'], 'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid, 'S_SELECTEDID' => $selectid,
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$rank = 0; $rank = 0;
// Select sum of users points group by team // Select sum of users points group by team
$sql = "SELECT $sql = "SELECT
t.*, t.*,
SUM(1) AS bets, SUM(1) AS bets,
SUM(IF((m.team_id_home = t.team_id), SUM(IF((m.team_id_home = t.team_id),
IF(b.goals_home + 0 > b.goals_guest, 1, 0), IF(b.goals_home + 0 > b.goals_guest, 1, 0),
IF(b.goals_home + 0 < b.goals_guest, 1, 0) IF(b.goals_home + 0 < b.goals_guest, 1, 0)
) )
) AS win, ) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
SUM(IF((m.team_id_home = t.team_id), SUM(IF((m.team_id_home = t.team_id),
IF(b.goals_home + 0 < b.goals_guest, 1, 0), IF(b.goals_home + 0 < b.goals_guest, 1, 0),
IF(b.goals_home + 0 > b.goals_guest, 1, 0) IF(b.goals_home + 0 > b.goals_guest, 1, 0)
) )
) AS lost, ) AS lost,
SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest)
OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest)
OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0, 0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest=m.goals_guest), IF((b.goals_home = m.goals_home) AND (b.goals_guest=m.goals_guest),
0,1 0,1
) )
) )
)AS tendencies, )AS tendencies,
SUM(IF((b.goals_home = m.goals_home) AND (b.goals_guest=m.goals_guest),1,0))AS hits, SUM(IF((b.goals_home = m.goals_home) AND (b.goals_guest=m.goals_guest),1,0))AS hits,
" . select_points('m',true) . " " . select_points('m',true) . "
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.team_id_home = t.team_id OR m.team_id_guest = t.team_id))
LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no=m.match_no) LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no=m.match_no)
WHERE t.season = $season WHERE t.season = $season
AND t.league = $league AND t.league = $league
AND m.status IN (3,6) AND m.status IN (3,6)
AND b.user_id = $user_sel AND b.user_id = $user_sel
AND b.goals_home <> '' AND b.goals_home <> ''
AND b.goals_guest <> '' AND b.goals_guest <> ''
AND m.matchday <= $matchday AND m.matchday <= $matchday
GROUP BY t.team_id GROUP BY t.team_id
ORDER BY points DESC"; ORDER BY points DESC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$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=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('points', array( $template->assign_block_vars('points', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'RANK' => $rank, 'RANK' => $rank,
'LOGO' => $logo, 'LOGO' => $logo,
'TEAM' => $row['team_name_short'], 'TEAM' => $row['team_name_short'],
'COUNT' => $row['bets'], 'COUNT' => $row['bets'],
'WIN' => $row['win'], 'WIN' => $row['win'],
'DRAW' => $row['draw'], 'DRAW' => $row['draw'],
'LOST' => $row['lost'], 'LOST' => $row['lost'],
'DIRECTHITS' => $row['hits'], 'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'], 'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'], 'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$rank = 0; $rank = 0;
// Select sum of all users points group by team // Select sum of all users points group by team
$sql = "SELECT $sql = "SELECT
t.*, t.*,
SUM(1) AS bets, SUM(1) AS bets,
SUM(IF((m.team_id_home = t.team_id), SUM(IF((m.team_id_home = t.team_id),
IF(b.goals_home + 0 > b.goals_guest, 1, 0), IF(b.goals_home + 0 > b.goals_guest, 1, 0),
IF(b.goals_home + 0 < b.goals_guest, 1, 0) IF(b.goals_home + 0 < b.goals_guest, 1, 0)
) )
) AS win, ) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
SUM(IF((m.team_id_home = t.team_id), SUM(IF((m.team_id_home = t.team_id),
IF(b.goals_home + 0 < b.goals_guest, 1, 0), IF(b.goals_home + 0 < b.goals_guest, 1, 0),
IF(b.goals_home + 0 > b.goals_guest, 1, 0) IF(b.goals_home + 0 > b.goals_guest, 1, 0)
) )
) AS lost, ) AS lost,
SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest)
OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest)
OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0, 0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
) )
)AS tendencies, )AS tendencies,
SUM(IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)) AS hits, SUM(IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)) AS hits,
" . select_points('m',true) . " " . select_points('m',true) . "
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.team_id_home = t.team_id OR m.team_id_guest = t.team_id))
LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no=m.match_no) LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no=m.match_no)
WHERE t.season = $season WHERE t.season = $season
AND t.league = $league AND t.league = $league
AND b.goals_home <> '' AND b.goals_home <> ''
AND b.goals_guest <> '' AND b.goals_guest <> ''
AND m.status IN (3,6) AND m.status IN (3,6)
AND m.matchday <= $matchday AND m.matchday <= $matchday
GROUP BY t.team_id GROUP BY t.team_id
ORDER BY points DESC"; ORDER BY points DESC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$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=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('allpoints', array( $template->assign_block_vars('allpoints', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'RANK' => $rank, 'RANK' => $rank,
'LOGO' => $logo, 'LOGO' => $logo,
'TEAM' => $row['team_name_short'], 'TEAM' => $row['team_name_short'],
'COUNT' => $row['bets'], 'COUNT' => $row['bets'],
'WIN' => $row['win'], 'WIN' => $row['win'],
'DRAW' => $row['draw'], 'DRAW' => $row['draw'],
'LOST' => $row['lost'], 'LOST' => $row['lost'],
'DIRECTHITS' => $row['hits'], 'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'], 'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'], 'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$sidename = sprintf($user->lang['MY_POINTS']); $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)), 'S_DATA_MY_POINTS' => $data,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_BETS']), 'SEASON' => $season,
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_table', 's' => $season, 'l' => $league, 'm' => $matchday)), 'LEAGUE' => $league,
'RIGHT_LINK' => sprintf($user->lang['MY_TABLE']) . ' &gt;', 'USERNAME' => $username,
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_BETS']), )
'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_TABLE']), );
'S_DATA_MY_POINTS' => $data,
'SEASON' => $season,
'LEAGUE' => $league,
'USERNAME' => $username,
)
);
?>

View File

@@ -1,179 +1,171 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
if (!$user_sel) if (!$user_sel)
{ {
if (user_is_member($user->data['user_id'], $season, $league)) if (user_is_member($user->data['user_id'], $season, $league))
{ {
$user_sel = $user->data['user_id']; $user_sel = $user->data['user_id'];
} }
} }
$username = ''; $username = '';
$data = false; $data = false;
// select user // select user
$sql = 'SELECT DISTINCT $sql = 'SELECT DISTINCT
u.user_id, u.user_id,
u.username u.username
FROM ' . FOOTB_BETS . ' AS w FROM ' . FOOTB_BETS . ' AS w
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = w.user_id) LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = w.user_id)
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
ORDER BY LOWER(u.username) ASC "; ORDER BY LOWER(u.username) ASC ";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
if ($user_sel == $row['user_id'] OR !$user_sel) if ($user_sel == $row['user_id'] OR !$user_sel)
{ {
$selectid = ' selected="selected"'; $selectid = ' selected="selected"';
$username = $row['username']; $username = $row['username'];
$user_sel = $row['user_id']; $user_sel = $row['user_id'];
} }
else else
{ {
$selectid = ''; $selectid = '';
} }
$template->assign_block_vars('form_user', array( $template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'], 'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'], 'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid, 'S_SELECTEDID' => $selectid,
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$rank = 0; $rank = 0;
// Get ranks 1-3 of selected user // Get ranks 1-3 of selected user
$sql = 'SELECT $sql = 'SELECT
season, season,
COUNT(matchday) AS matchdays, COUNT(matchday) AS matchdays,
SUM(points) AS points, SUM(points) AS points,
SUM(IF(rank = 1, 1, 0)) AS rank1, SUM(IF(rank = 1, 1, 0)) AS rank1,
SUM(IF(rank = 2, 1, 0)) AS rank2, SUM(IF(rank = 2, 1, 0)) AS rank2,
SUM(IF(rank = 3, 1, 0)) AS rank3 SUM(IF(rank = 3, 1, 0)) AS rank3
FROM ' . FOOTB_RANKS . " FROM ' . FOOTB_RANKS . "
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
AND user_id = $user_sel AND user_id = $user_sel
GROUP BY user_id, season GROUP BY user_id, season
ORDER BY season ASC"; ORDER BY season ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('myrank', array( $template->assign_block_vars('myrank', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'SEASON' => $row['season'], 'SEASON' => $row['season'],
'MATCHDAYS' => $row['matchdays'], 'MATCHDAYS' => $row['matchdays'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
'RANK1' => $row['rank1'], 'RANK1' => $row['rank1'],
'RANK2' => $row['rank2'], 'RANK2' => $row['rank2'],
'RANK3' => $row['rank3'], 'RANK3' => $row['rank3'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$rank = 0; $rank = 0;
// Get all ranks 1-3 of selected user // Get all ranks 1-3 of selected user
$sql = 'SELECT $sql = 'SELECT
COUNT(matchday) AS matchdays, COUNT(matchday) AS matchdays,
rank rank
FROM ' . FOOTB_RANKS . " FROM ' . FOOTB_RANKS . "
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
AND user_id = $user_sel AND user_id = $user_sel
GROUP BY user_id, rank GROUP BY user_id, rank
ORDER BY rank ASC"; ORDER BY rank ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('season_ranks', array( $template->assign_block_vars('season_ranks', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'RANK' => $row['rank'], 'RANK' => $row['rank'],
'MATCHDAYS' => $row['matchdays'], 'MATCHDAYS' => $row['matchdays'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$rank = 0; $rank = 0;
// Get ranks 1-3 of all users // Get ranks 1-3 of all users
$sql = 'SELECT $sql = 'SELECT
r.user_id, r.user_id,
u.username, u.username,
COUNT(r.matchday) AS matchdays, COUNT(r.matchday) AS matchdays,
SUM(r.points) AS points, SUM(r.points) AS points,
SUM(IF(r.rank =1, 1, 0)) AS rank1, SUM(IF(r.rank =1, 1, 0)) AS rank1,
SUM(IF(r.rank =2, 1, 0)) AS rank2, SUM(IF(r.rank =2, 1, 0)) AS rank2,
SUM(IF(r.rank =3, 1, 0)) AS rank3 SUM(IF(r.rank =3, 1, 0)) AS rank3
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
GROUP BY r.user_id GROUP BY r.user_id
ORDER BY rank1 DESC, rank2 DESC, rank3 DESC"; ORDER BY rank1 DESC, rank2 DESC, rank3 DESC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$data = true; $data = true;
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id']) if ($row['user_id'] == $user->data['user_id'])
{ {
$row_class = 'bg3 row_user'; $row_class = 'bg3 row_user';
} }
$template->assign_block_vars('allranks', array( $template->assign_block_vars('allranks', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'NAME' => $row['username'], 'NAME' => $row['username'],
'MATCHDAYS' => $row['matchdays'], 'MATCHDAYS' => $row['matchdays'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
'AVERAGE' => round($row['points'] / $row['matchdays'],1), 'AVERAGE' => round($row['points'] / $row['matchdays'],1),
'RANK1' => $row['rank1'], 'RANK1' => $row['rank1'],
'RANK2' => $row['rank2'], 'RANK2' => $row['rank2'],
'RANK3' => $row['rank3'], 'RANK3' => $row['rank3'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$sidename = sprintf($user->lang['MY_RANK']); $sidename = sprintf($user->lang['MY_RANK']);
$template->assign_vars(array( $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)), 'S_DATA_MY_RANK' => $data,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_TABLE']), 'SEASON' => $season,
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_chart', 's' => $season, 'l' => $league, 'm' => $matchday)), 'LEAGUE' => $league,
'RIGHT_LINK' => sprintf($user->lang['MY_CHART']) . ' &gt;', 'USERNAME' => $username,
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_TABLE']), )
'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_CHART']), );
'S_DATA_MY_RANK' => $data,
'SEASON' => $season,
'LEAGUE' => $league,
'USERNAME' => $username,
)
);
?>

View File

@@ -1,434 +1,428 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
if (!$user_sel) if (!$user_sel)
{ {
if (user_is_member($user->data['user_id'], $season, $league)) if (user_is_member($user->data['user_id'], $season, $league))
{ {
$user_sel = $user->data['user_id']; $user_sel = $user->data['user_id'];
} }
} }
$username = ''; $username = '';
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
// select user // select user
$sql = 'SELECT DISTINCT $sql = 'SELECT DISTINCT
u.user_id, u.user_id,
u.username u.username
FROM ' . FOOTB_BETS . ' AS b FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id) LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
ORDER BY LOWER(u.username) ASC"; ORDER BY LOWER(u.username) ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ($user_sel == 900) if ($user_sel == 900)
{ {
$selectid = ' selected="selected"'; $selectid = ' selected="selected"';
$username = 'Alle'; $username = 'Alle';
$user_sel = 900; $user_sel = 900;
$where_user = ""; $where_user = "";
} }
else else
{ {
$selectid = ''; $selectid = '';
$where_user = "b.user_id = $user_sel AND "; $where_user = "b.user_id = $user_sel AND ";
} }
$template->assign_block_vars('form_user', array( $template->assign_block_vars('form_user', array(
'S_USER' => 900, 'S_USER' => 900,
'S_USERNAME' => 'Alle', 'S_USERNAME' => 'Alle',
'S_SELECTEDID' => $selectid, 'S_SELECTEDID' => $selectid,
) )
); );
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
if ($user_sel == $row['user_id'] OR !$user_sel) if ($user_sel == $row['user_id'] OR !$user_sel)
{ {
$selectid = ' selected="selected"'; $selectid = ' selected="selected"';
$username = $row['username']; $username = $row['username'];
$user_sel = $row['user_id']; $user_sel = $row['user_id'];
} }
else else
{ {
$selectid = ''; $selectid = '';
} }
$template->assign_block_vars('form_user', array( $template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'], 'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'], 'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid, 'S_SELECTEDID' => $selectid,
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$data_table = false; $data_table = false;
$data_form = false; $data_form = false;
if ($matchday > 5) if ($matchday > 5)
{ {
$form_from = $matchday - 5; $form_from = $matchday - 5;
} }
else else
{ {
$form_from = 1; $form_from = 1;
} }
$sql = ' $sql = '
SELECT * SELECT *
FROM ' . FOOTB_LEAGUES . " FROM ' . FOOTB_LEAGUES . "
WHERE season = $season WHERE season = $season
AND league = $league"; AND league = $league";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result); $row = $db->sql_fetchrow($result);
$league_type = $row['league_type']; $league_type = $row['league_type'];
$db->sql_freeresult($result); $db->sql_freeresult($result);
$text_form = sprintf($user->lang['TABLE_FORM_FROM'], $form_from); $text_form = sprintf($user->lang['TABLE_FORM_FROM'], $form_from);
$rank = 0; $rank = 0;
// Select table on selected user bets // Select table on selected user bets
$sql = 'SELECT $sql = 'SELECT
t.*, t.*,
SUM(1) AS matches, SUM(1) AS matches,
SUM(IF((m.team_id_home = t.team_id), SUM(IF((m.team_id_home = t.team_id),
IF(b.goals_home + 0 > b.goals_guest, 1, 0), IF(b.goals_home + 0 > b.goals_guest, 1, 0),
IF(b.goals_home + 0 < b.goals_guest, 1, 0) IF(b.goals_home + 0 < b.goals_guest, 1, 0)
) )
) AS win, ) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
SUM(IF((m.team_id_home = t.team_id), SUM(IF((m.team_id_home = t.team_id),
IF(b.goals_home + 0 < b.goals_guest, 1, 0), IF(b.goals_home + 0 < b.goals_guest, 1, 0),
IF(b.goals_home + 0 > b.goals_guest, 1, 0) IF(b.goals_home + 0 > b.goals_guest, 1, 0)
) )
) AS lost, ) AS lost,
SUM(IF(m.team_id_home = t.team_id, SUM(IF(m.team_id_home = t.team_id,
IF(b.goals_home + 0 > b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0)), IF(b.goals_home + 0 > b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0)),
IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0)) IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))
) )
) AS points, ) AS points,
SUM(IF(m.team_id_home = t.team_id, SUM(IF(m.team_id_home = t.team_id,
IF(m.goals_home + 0 > m.goals_guest, 3, IF(m.goals_home = m.goals_guest, 1, 0)), IF(m.goals_home + 0 > m.goals_guest, 3, IF(m.goals_home = m.goals_guest, 1, 0)),
IF(m.goals_home + 0 < m.goals_guest, 3, IF(m.goals_home = m.goals_guest, 1, 0)) IF(m.goals_home + 0 < m.goals_guest, 3, IF(m.goals_home = m.goals_guest, 1, 0))
) )
) AS realpoints, ) AS realpoints,
SUM(IF(m.team_id_home = t.team_id, b.goals_home - b.goals_guest, b.goals_guest - b.goals_home)) AS goals_diff, SUM(IF(m.team_id_home = t.team_id, b.goals_home - b.goals_guest, b.goals_guest - b.goals_home)) AS goals_diff,
SUM(IF(m.team_id_home = t.team_id, b.goals_home, b.goals_guest)) AS goals, SUM(IF(m.team_id_home = t.team_id, b.goals_home, b.goals_guest)) AS goals,
SUM(IF(m.team_id_home = t.team_id, b.goals_guest, b.goals_home)) AS goals_against SUM(IF(m.team_id_home = t.team_id, b.goals_guest, b.goals_home)) AS goals_against
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)
LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no) LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no)
WHERE $where_user WHERE $where_user
t.season = $season t.season = $season
AND t.league = $league AND t.league = $league
AND b.goals_home <> '' AND b.goals_home <> ''
AND b.goals_guest <> '' AND b.goals_guest <> ''
AND m.matchday <= $matchday AND m.matchday <= $matchday
GROUP BY t.team_id AND m.show_table = 0
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$lastGroup = ''; $result = $db->sql_query($sql);
$sumdiff = 0; $lastGroup = '';
while($row = $db->sql_fetchrow($result)) $sumdiff = 0;
{ while($row = $db->sql_fetchrow($result))
if ($lastGroup != $row['group_id']) {
{ if ($lastGroup != $row['group_id'])
$lastGroup = $row['group_id']; {
$rank = 0; $lastGroup = $row['group_id'];
$template->assign_block_vars('total', array( $rank = 0;
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], $template->assign_block_vars('total', array(
) 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
); )
} );
if ($league_type != 2 OR $row['group_id'] != '') }
{ if ($league_type != 2 OR $row['group_id'] != '')
$data_table = true; {
$rank++; $data_table = true;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $rank++;
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$pdiff = $row['points'] - $row['realpoints']; $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
if ($pdiff >= 0) $pdiff = $row['points'] - $row['realpoints'];
{ if ($pdiff >= 0)
$sumdiff += $pdiff; {
$pdiff = ' (+' . $pdiff . ')'; $sumdiff += $pdiff;
$pdiff = ' (+' . $pdiff . ')';
}
else }
{ else
$sumdiff -= $pdiff; {
$pdiff = ' (' . $pdiff . ')'; $sumdiff -= $pdiff;
} $pdiff = ' (' . $pdiff . ')';
if ($user_sel == 900) }
{ if ($user_sel == 900)
$pdiff = ''; {
} $pdiff = '';
}
$template->assign_block_vars('total', array(
'RANK' => $rank . '.', $template->assign_block_vars('total', array(
'ROW_CLASS' => $row_class, 'RANK' => $rank . '.',
'LOGO' => $logo, 'ROW_CLASS' => $row_class,
'TEAM_ID' => $row['team_id'], 'LOGO' => $logo,
'TEAM' => $row['team_name_short'], 'TEAM_ID' => $row['team_id'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, 'TEAM' => $row['team_name_short'],
'tid' => $row['team_id'], 'mode' => 'played')), 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'GAMES' => $row['matches'], 'tid' => $row['team_id'], 'mode' => 'played')),
'WIN' => $row['win'], 'GAMES' => $row['matches'],
'DRAW' => $row['draw'], 'WIN' => $row['win'],
'LOST' => $row['lost'], 'DRAW' => $row['draw'],
'GOALS' => $row['goals'], 'LOST' => $row['lost'],
'GOALS_AGAINST' => $row['goals_against'], 'GOALS' => $row['goals'],
'GOALS_DIFF' => $row['goals_diff'], 'GOALS_AGAINST' => $row['goals_against'],
'POINTS' => $row['points'] . $pdiff, 'GOALS_DIFF' => $row['goals_diff'],
) 'POINTS' => $row['points'] . $pdiff,
); )
} );
} }
$db->sql_freeresult($result); }
$db->sql_freeresult($result);
$rank = 0;
// Select formtable on selected user bets $rank = 0;
$sql = 'SELECT // Select formtable on selected user bets
t.*, $sql = 'SELECT
SUM(1) AS matches, t.*,
SUM(IF((m.team_id_home = t.team_id), SUM(1) AS matches,
IF(b.goals_home + 0 > b.goals_guest, 1, 0), SUM(IF((m.team_id_home = t.team_id),
IF(b.goals_home + 0 < b.goals_guest, 1, 0) IF(b.goals_home + 0 > b.goals_guest, 1, 0),
) IF(b.goals_home + 0 < b.goals_guest, 1, 0)
) AS win, )
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, ) AS win,
SUM(IF((m.team_id_home = t.team_id), SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
IF(b.goals_home + 0 < b.goals_guest, 1, 0), SUM(IF((m.team_id_home = t.team_id),
IF(b.goals_home + 0 > b.goals_guest, 1, 0) IF(b.goals_home + 0 < b.goals_guest, 1, 0),
) IF(b.goals_home + 0 > b.goals_guest, 1, 0)
) AS lost, )
SUM(IF(m.team_id_home = t.team_id, ) AS lost,
IF(b.goals_home + 0 > b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0)), SUM(IF(m.team_id_home = t.team_id,
IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0)) IF(b.goals_home + 0 > b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0)),
) IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))
) AS points, )
SUM(IF(m.team_id_home = t.team_id, b.goals_home - b.goals_guest, b.goals_guest - b.goals_home)) AS goals_diff, ) AS points,
SUM(IF(m.team_id_home = t.team_id, b.goals_home, b.goals_guest)) AS goals, SUM(IF(m.team_id_home = t.team_id, b.goals_home - b.goals_guest, b.goals_guest - b.goals_home)) AS goals_diff,
SUM(IF(m.team_id_home = t.team_id, b.goals_guest, b.goals_home)) AS goals_against SUM(IF(m.team_id_home = t.team_id, b.goals_home, b.goals_guest)) AS goals,
FROM ' . FOOTB_TEAMS . ' AS t SUM(IF(m.team_id_home = t.team_id, b.goals_guest, b.goals_home)) AS goals_against
LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league FROM ' . FOOTB_TEAMS . ' AS t
AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league
LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no) AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id)
WHERE $where_user LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no)
t.season = $season WHERE $where_user
AND t.league = $league t.season = $season
AND b.goals_home <> '' AND t.league = $league
AND b.goals_guest <> '' AND b.goals_home <> ''
AND m.matchday >= $form_from AND b.goals_guest <> ''
GROUP BY t.team_id AND m.matchday >= $form_from
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; AND m.show_table = 0
GROUP BY t.team_id
$result = $db->sql_query($sql); ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$lastGroup = '';
while($row = $db->sql_fetchrow($result)) $result = $db->sql_query($sql);
{ $lastGroup = '';
$data_form = true; while($row = $db->sql_fetchrow($result))
if ($lastGroup != $row['group_id']) {
{ $data_form = true;
$lastGroup = $row['group_id']; if ($lastGroup != $row['group_id'])
$rank = 0; {
$template->assign_block_vars('form', array( $lastGroup = $row['group_id'];
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], $rank = 0;
) $template->assign_block_vars('form', array(
); 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
} )
if ($league_type != 2 OR $row['group_id'] != '') );
{ }
$rank++; if ($league_type != 2 OR $row['group_id'] != '')
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; {
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('form', array( $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
'RANK' => $rank . '.',
'ROW_CLASS' => $row_class, $template->assign_block_vars('form', array(
'LOGO' => $logo, 'RANK' => $rank . '.',
'TEAM_ID' => $row['team_id'], 'ROW_CLASS' => $row_class,
'TEAM' => $row['team_name_short'], 'LOGO' => $logo,
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, 'TEAM_ID' => $row['team_id'],
'tid' => $row['team_id'], 'mode' => 'rest')), 'TEAM' => $row['team_name_short'],
'GAMES' => $row['matches'], 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'WIN' => $row['win'], 'tid' => $row['team_id'], 'mode' => 'rest')),
'DRAW' => $row['draw'], 'GAMES' => $row['matches'],
'LOST' => $row['lost'], 'WIN' => $row['win'],
'GOALS' => $row['goals'], 'DRAW' => $row['draw'],
'GOALS_AGAINST' => $row['goals_against'], 'LOST' => $row['lost'],
'GOALS_DIFF' => $row['goals_diff'], 'GOALS' => $row['goals'],
'POINTS' => $row['points'], 'GOALS_AGAINST' => $row['goals_against'],
) 'GOALS_DIFF' => $row['goals_diff'],
); 'POINTS' => $row['points'],
} )
} );
$db->sql_freeresult($result); }
}
$rank = 0; $db->sql_freeresult($result);
// Select home-table on selected user bets
$sql = 'SELECT $rank = 0;
t.*, // Select home-table on selected user bets
SUM(1) AS matches, $sql = 'SELECT
SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS win, t.*,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, SUM(1) AS matches,
SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS lost, SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS win,
SUM(IF(b.goals_home + 0 > b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))) AS points, SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
SUM(b.goals_home - b.goals_guest) AS goals_diff, SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS lost,
SUM(b.goals_home) AS goals, SUM(IF(b.goals_home + 0 > b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))) AS points,
SUM(b.goals_guest) AS goals_against SUM(b.goals_home - b.goals_guest) AS goals_diff,
FROM ' . FOOTB_TEAMS . ' AS t SUM(b.goals_home) AS goals,
LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league SUM(b.goals_guest) AS goals_against
AND m.team_id_home = t.team_id AND m.group_id = t.group_id) FROM ' . FOOTB_TEAMS . ' AS t
LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no) LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league
WHERE $where_user AND m.team_id_home = t.team_id AND m.group_id = t.group_id)
t.season = $season LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no)
AND t.league = $league WHERE $where_user
AND b.goals_home <> '' t.season = $season
AND b.goals_guest <> '' AND t.league = $league
AND m.matchday <= $matchday AND b.goals_home <> ''
GROUP BY t.team_id AND b.goals_guest <> ''
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; AND m.matchday <= $matchday
AND m.show_table = 0
$result = $db->sql_query($sql); GROUP BY t.team_id
$lastGroup = ''; ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
while($row = $db->sql_fetchrow($result))
{ $result = $db->sql_query($sql);
if ($lastGroup != $row['group_id']) $lastGroup = '';
{ while($row = $db->sql_fetchrow($result))
$lastGroup = $row['group_id']; {
$rank = 0; if ($lastGroup != $row['group_id'])
$template->assign_block_vars('home', array( {
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], $lastGroup = $row['group_id'];
) $rank = 0;
); $template->assign_block_vars('home', array(
} 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
if ($league_type != 2 OR $row['group_id'] != '') )
{ );
$rank++; }
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; if ($league_type != 2 OR $row['group_id'] != '')
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; {
$rank++;
$template->assign_block_vars('home', array( $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
'RANK' => $rank . '.', $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
'ROW_CLASS' => $row_class,
'LOGO' => $logo, $template->assign_block_vars('home', array(
'TEAM_ID' => $row['team_id'], 'RANK' => $rank . '.',
'TEAM' => $row['team_name_short'], 'ROW_CLASS' => $row_class,
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, 'LOGO' => $logo,
'tid' => $row['team_id'], 'mode' => 'home')), 'TEAM_ID' => $row['team_id'],
'GAMES' => $row['matches'], 'TEAM' => $row['team_name_short'],
'WIN' => $row['win'], 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'DRAW' => $row['draw'], 'tid' => $row['team_id'], 'mode' => 'home')),
'LOST' => $row['lost'], 'GAMES' => $row['matches'],
'GOALS' => $row['goals'], 'WIN' => $row['win'],
'GOALS_AGAINST' => $row['goals_against'], 'DRAW' => $row['draw'],
'GOALS_DIFF' => $row['goals_diff'], 'LOST' => $row['lost'],
'POINTS' => $row['points'], 'GOALS' => $row['goals'],
) 'GOALS_AGAINST' => $row['goals_against'],
); 'GOALS_DIFF' => $row['goals_diff'],
} 'POINTS' => $row['points'],
} )
$db->sql_freeresult($result); );
}
$rank = 0; }
// Select away-table on selected user bets $db->sql_freeresult($result);
$sql = 'SELECT
t.*, $rank = 0;
SUM(1) AS matches, // Select away-table on selected user bets
SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS win, $sql = 'SELECT
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, t.*,
SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS lost, SUM(1) AS matches,
SUM(IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))) AS points, SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS win,
SUM(b.goals_guest - b.goals_home) AS goals_diff, SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
SUM(b.goals_guest) AS goals, SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS lost,
SUM(b.goals_home) AS goals_against SUM(IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))) AS points,
FROM ' . FOOTB_TEAMS . ' AS t SUM(b.goals_guest - b.goals_home) AS goals_diff,
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) SUM(b.goals_guest) AS goals,
LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no) SUM(b.goals_home) AS goals_against
WHERE $where_user FROM ' . FOOTB_TEAMS . ' AS t
t.season = $season 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 t.league = $league LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no)
AND b.goals_home <> '' WHERE $where_user
AND b.goals_guest <> '' t.season = $season
AND m.matchday <= $matchday AND t.league = $league
GROUP BY t.team_id AND b.goals_home <> ''
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; AND b.goals_guest <> ''
AND m.matchday <= $matchday
$result = $db->sql_query($sql); AND m.show_table = 0
$lastGroup = ''; GROUP BY t.team_id
while($row = $db->sql_fetchrow($result)) ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
{
if ($lastGroup != $row['group_id']) $result = $db->sql_query($sql);
{ $lastGroup = '';
$lastGroup = $row['group_id']; while($row = $db->sql_fetchrow($result))
$rank = 0; {
$template->assign_block_vars('away', array( if ($lastGroup != $row['group_id'])
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], {
) $lastGroup = $row['group_id'];
); $rank = 0;
} $template->assign_block_vars('away', array(
if ($league_type != 2 OR $row['group_id'] != '') 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
{ )
$rank++; );
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; }
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; if ($league_type != 2 OR $row['group_id'] != '')
{
$template->assign_block_vars('away', array( $rank++;
'RANK' => $rank . '.', $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
'ROW_CLASS' => $row_class, $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
'LOGO' => $logo,
'TEAM_ID' => $row['team_id'], $template->assign_block_vars('away', array(
'TEAM' => $row['team_name_short'], 'RANK' => $rank . '.',
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, 'ROW_CLASS' => $row_class,
'tid' => $row['team_id'], 'mode' => 'away')), 'LOGO' => $logo,
'GAMES' => $row['matches'], 'TEAM_ID' => $row['team_id'],
'WIN' => $row['win'], 'TEAM' => $row['team_name_short'],
'DRAW' => $row['draw'], 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'LOST' => $row['lost'], 'tid' => $row['team_id'], 'mode' => 'away')),
'GOALS' => $row['goals'], 'GAMES' => $row['matches'],
'GOALS_AGAINST' => $row['goals_against'], 'WIN' => $row['win'],
'GOALS_DIFF' => $row['goals_diff'], 'DRAW' => $row['draw'],
'POINTS' => $row['points'], 'LOST' => $row['lost'],
) 'GOALS' => $row['goals'],
); 'GOALS_AGAINST' => $row['goals_against'],
} 'GOALS_DIFF' => $row['goals_diff'],
} 'POINTS' => $row['points'],
$db->sql_freeresult($result); )
);
$sidename = sprintf($user->lang['MY_TABLE']); }
$template->assign_vars(array( }
'S_DISPLAY_MY_TABLE' => true, $db->sql_freeresult($result);
'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_points', 's' => $season, 'l' => $league, 'm' => $matchday)), $sidename = sprintf($user->lang['MY_TABLE']);
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_TABLE']), $template->assign_vars(array(
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_POINTS']), 'S_DISPLAY_MY_TABLE' => true,
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_rank', 's' => $season, 'l' => $league, 'm' => $matchday)), 'S_SIDENAME' => $sidename,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_TABLE']), 'S_DATA_MY_TABLE' => $data_table,
'RIGHT_LINK' => sprintf($user->lang['MY_RANK']) . ' &gt;', 'S_DATA_FORM' => $data_form,
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_POINTS']), 'SEASON' => $season,
'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_RANKS']), 'LEAGUE' => $league,
'S_DATA_MY_TABLE' => $data_table, 'TEXT_FORM' => $text_form,
'S_DATA_FORM' => $data_form, 'S_PDIFF' => $sumdiff,
'SEASON' => $season, 'USERNAME' => $username,
'LEAGUE' => $league, )
'TEXT_FORM' => $text_form, );
'S_PDIFF' => $sumdiff,
'USERNAME' => $username,
)
);
?>

View File

@@ -1,211 +1,214 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$data_odds = false; $data_odds = false;
$matchnumber = 0; $userid = $user->data['user_id'];
$lang_dates = $user->lang['datetime']; $user_is_member = user_is_member($userid, $season, $league);
$matchnumber = 0;
$sql = "SELECT $lang_dates = $user->lang['datetime'];
m.league,
m.match_no, $sql = "SELECT
CONCAT( m.league,
CASE DATE_FORMAT(m.match_datetime,'%w') m.match_no,
WHEN 0 THEN '" . $lang_dates['Sun'] . "' CONCAT(
WHEN 1 THEN '" . $lang_dates['Mon'] . "' CASE DATE_FORMAT(m.match_datetime,'%w')
WHEN 2 THEN '" . $lang_dates['Tue'] . "' WHEN 0 THEN '" . $lang_dates['Sun'] . "'
WHEN 3 THEN '" . $lang_dates['Wed'] . "' WHEN 1 THEN '" . $lang_dates['Mon'] . "'
WHEN 4 THEN '" . $lang_dates['Thu'] . "' WHEN 2 THEN '" . $lang_dates['Tue'] . "'
WHEN 5 THEN '" . $lang_dates['Fri'] . "' WHEN 3 THEN '" . $lang_dates['Wed'] . "'
WHEN 6 THEN '" . $lang_dates['Sat'] . "' WHEN 4 THEN '" . $lang_dates['Thu'] . "'
ELSE 'Error' END, WHEN 5 THEN '" . $lang_dates['Fri'] . "'
DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i') WHEN 6 THEN '" . $lang_dates['Sat'] . "'
) AS match_time, ELSE 'Error' END,
t1.team_symbol AS home_symbol, DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i')
t2.team_symbol AS guest_symbol, ) AS match_time,
t1.team_name_short AS home_name, t1.team_symbol AS home_symbol,
t2.team_name_short AS guest_name, t2.team_symbol AS guest_symbol,
t1.team_id AS home_id, t1.team_name_short AS home_name,
t2.team_id AS guest_id, t2.team_name_short AS guest_name,
m.goals_home, t1.team_id AS home_id,
m.goals_guest, t2.team_id AS guest_id,
m.goals_overtime_home AS kogoals_home, b.goals_home AS bet_home,
m.goals_overtime_guest AS kogoals_guest, b.goals_guest AS bet_guest,
m.ko_match, m.goals_home,
m.group_id, m.goals_guest,
m.formula_home, m.goals_overtime_home AS kogoals_home,
m.formula_guest, m.goals_overtime_guest AS kogoals_guest,
m.odd_1, m.ko_match,
m.odd_x, m.group_id,
m.odd_2, m.formula_home,
m.trend FROM " . FOOTB_MATCHES . ' AS m m.formula_guest,
LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home) m.odd_1,
LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest) m.odd_x,
WHERE m.season = $season m.odd_2,
AND m.league = $league m.trend
AND m.matchday = $matchday FROM " . FOOTB_MATCHES . ' AS m
ORDER BY m.match_datetime ASC, m.match_no ASC"; LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no AND b.user_id = $userid)
LEFT JOIN " . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home)
$result = $db->sql_query($sql); LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest)
$rows = $db->sql_fetchrowset($result); WHERE m.season = $season
AND m.league = $league
$league_info = league_info($season, $league); AND m.matchday = $matchday
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); ORDER BY m.match_datetime ASC, m.match_no ASC";
//while($row = $db->sql_fetchrow($result))
foreach ($rows as $row) $result = $db->sql_query($sql);
{ $rows = $db->sql_fetchrowset($result);
$data_odds = true;
$matchnumber++ ; $league_info = league_info($season, $league);
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
if (0 == $row['home_id']) //while($row = $db->sql_fetchrow($result))
{ foreach ($rows as $row)
$home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']); {
$home_in_array = explode("#",$home_info); $data_odds = true;
$homelogo = $home_in_array[0]; $matchnumber++ ;
$homeid = $home_in_array[1]; $row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$homename = $home_in_array[2]; if (0 == $row['home_id'])
} {
else $home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']);
{ $home_in_array = explode("#",$home_info);
$homelogo = $row['home_symbol']; $homelogo = $home_in_array[0];
$homeid = $row['home_id']; $homeid = $home_in_array[1];
$homename = $row['home_name']; $homename = $home_in_array[2];
} }
if (0 == $row['guest_id']) else
{ {
$guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']); $homelogo = $row['home_symbol'];
$guest_in_array = explode("#",$guest_info); $homeid = $row['home_id'];
$guestlogo = $guest_in_array[0]; $homename = $row['home_name'];
$guestid = $guest_in_array[1]; }
$guestname = $guest_in_array[2]; if (0 == $row['guest_id'])
} {
else $guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']);
{ $guest_in_array = explode("#",$guest_info);
$guestlogo = $row['guest_symbol']; $guestlogo = $guest_in_array[0];
$guestid = $row['guest_id']; $guestid = $guest_in_array[1];
$guestname = $row['guest_name']; $guestname = $guest_in_array[2];
} }
if ($homelogo <> '') else
{ {
$logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ; $guestlogo = $row['guest_symbol'];
} $guestid = $row['guest_id'];
else $guestname = $row['guest_name'];
{ }
$logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; if ($homelogo <> '')
} {
if ($guestlogo <> '') $logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ;
{ }
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ; else
} {
else $logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
{ }
$logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; if ($guestlogo <> '')
} {
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ;
if ($row['ko_match']) }
{ else
$display_ko = true; {
$ko_match = true; $logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
} }
else
{ if ($row['ko_match'])
$ko_match = false; {
} $display_ko = true;
$ko_match = true;
if ($row['group_id'] == '') }
{ else
$group_id = '&nbsp;'; {
} $ko_match = false;
else }
{
$display_group = true; if ($row['group_id'] == '')
$group_id = $row['group_id']; {
} $group_id = '&nbsp;';
}
$edit_match = false; else
$goals_home = ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home']; {
$goals_guest = ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest']; $display_group = true;
$kogoals_home = ($row['kogoals_home'] == '') ? '&nbsp;' : $row['kogoals_home']; $group_id = $row['group_id'];
$kogoals_guest = ($row['kogoals_guest'] == '') ? '&nbsp;' : $row['kogoals_guest']; }
$template->assign_block_vars('odds', array( $edit_match = false;
'ROW_CLASS' => $row_class, $goals_home = ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'];
'MATCH_NUMBER' => $row['match_no'], $goals_guest = ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'];
'MATCHDAY' => $matchday, $kogoals_home = ($row['kogoals_home'] == '') ? '&nbsp;' : $row['kogoals_home'];
'MATCH_TIME' => $row['match_time'], $kogoals_guest = ($row['kogoals_guest'] == '') ? '&nbsp;' : $row['kogoals_guest'];
'GROUP' => $group_id, $bet_home = ($row['bet_home'] == '') ? '&nbsp;' : $row['bet_home'];
'HOME_ID' => $homeid, $bet_guest = ($row['bet_guest'] == '') ? '&nbsp;' : $row['bet_guest'];
'GUEST_ID' => $guestid,
'LOGO_HOME' => $logoH, $template->assign_block_vars('odds', array(
'LOGO_GUEST' => $logoG, 'ROW_CLASS' => $row_class,
'HOME_NAME' => $homename, 'MATCH_NUMBER' => $row['match_no'],
'GUEST_NAME' => $guestname, 'MATCHDAY' => $matchday,
'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, 'MATCH_TIME' => $row['match_time'],
'tid' => $homeid, 'mode' => 'all')), 'GROUP' => $group_id,
'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, 'HOME_ID' => $homeid,
'tid' => $guestid, 'mode' => 'all')), 'GUEST_ID' => $guestid,
'GOALS_HOME' => $goals_home, 'LOGO_HOME' => $logoH,
'GOALS_GUEST' => $goals_guest, 'LOGO_GUEST' => $logoG,
'COLOR_STYLE' => '', 'HOME_NAME' => $homename,
'KOGOALS_HOME' => $kogoals_home, 'GUEST_NAME' => $guestname,
'KOGOALS_GUEST' => $kogoals_guest, 'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'S_KO_MATCH' => $ko_match, 'tid' => $homeid, 'mode' => 'all')),
'TREND' => $row['trend'], 'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'U_MATCH_STATS' => $this->helper->route('football_football_popup', array('popside' => 'hist_popup', 's' => $season, 'l' => $league, 'tid' => $guestid, 'mode' => 'all')),
'hid' => $homeid, 'gid' => $guestid, 'm' => $matchday, 'BET_HOME' => $bet_home,
'mn' => $row['match_no'], 'gr' => $row['group_id'])), 'BET_GUEST' => $bet_guest,
'ODD_1' => $row['odd_1'], 'GOALS_HOME' => $goals_home,
'ODD_X' => $row['odd_x'], 'GOALS_GUEST' => $goals_guest,
'ODD_2' => $row['odd_2'], 'COLOR_STYLE' => '',
) 'KOGOALS_HOME' => $kogoals_home,
); 'KOGOALS_GUEST' => $kogoals_guest,
} 'S_KO_MATCH' => $ko_match,
$db->sql_freeresult($result); 'S_USER_IS_MEMBER' => $user_is_member,
'TREND' => $row['trend'],
$sidename = 'Chancen'; 'U_MATCH_STATS' => $this->helper->route('football_football_popup', array('popside' => 'hist_popup', 's' => $season, 'l' => $league,
switch ($league_info['bet_ko_type']) 'hid' => $homeid, 'gid' => $guestid, 'm' => $matchday,
{ 'mn' => $row['match_no'], 'gr' => $row['group_id'])),
case BET_KO_90: 'ODD_1' => $row['odd_1'],
$result_explain = sprintf($user->lang['MIN90']); 'ODD_X' => $row['odd_x'],
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); 'ODD_2' => $row['odd_2'],
break; )
case BET_KO_EXTRATIME: );
$result_explain = sprintf($user->lang['EXTRATIME_SHORT']); }
$label_finalresult = sprintf($user->lang['PENALTY']); $db->sql_freeresult($result);
break;
case BET_KO_PENALTY: $sidename = 'Chancen';
$result_explain = sprintf($user->lang['PENALTY']); switch ($league_info['bet_ko_type'])
$display_ko = false; {
break; case BET_KO_90:
default: $result_explain = sprintf($user->lang['MIN90']);
$result_explain = sprintf($user->lang['MIN90']); $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); break;
break; case BET_KO_EXTRATIME:
} $result_explain = sprintf($user->lang['EXTRATIME_SHORT']);
$label_finalresult = sprintf($user->lang['PENALTY']);
$template->assign_vars(array( break;
'S_DISPLAY_ODDS' => true, case BET_KO_PENALTY:
'S_SIDENAME' => $sidename, $result_explain = sprintf($user->lang['PENALTY']);
'RESULT_EXPLAIN' => $result_explain, $display_ko = false;
'LABEL_FINALRESULT' => $label_finalresult, break;
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), default:
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['BET']), $result_explain = sprintf($user->lang['MIN90']);
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)), $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
'RIGHT_LINK' => sprintf($user->lang['TABLE']) . ' &gt;', break;
'LEFT_TITLE' => sprintf($user->lang['TITLE_BET']), }
'RIGHT_TITLE' => sprintf($user->lang['TITLE_TABLE']),
'S_DATA_ODDS' => $data_odds, $template->assign_vars(array(
) 'S_DISPLAY_ODDS' => true,
); 'S_SIDENAME' => $sidename,
'RESULT_EXPLAIN' => $result_explain,
?> 'LABEL_FINALRESULT' => $label_finalresult,
'S_DATA_ODDS' => $data_odds,
)
);

View File

@@ -7,11 +7,20 @@
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
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,10 +35,10 @@ 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 r.rank ASC, LOWER(u.username) ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
@@ -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,
@@ -69,4 +78,3 @@ if ($league <> 0)
'WIN_NAME' => $config['football_win_name'], 'WIN_NAME' => $config['football_win_name'],
)); ));
} }
?>

View File

@@ -1,94 +1,93 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
if ($league <> 0) if ($league <> 0)
{ {
$sql = 'SELECT $sql = 'SELECT
r.matchday AS last_matchday r.matchday AS last_matchday
FROM '. FOOTB_RANKS . " AS r FROM '. FOOTB_RANKS . " AS r
WHERE r.season = $season WHERE r.season = $season
AND r.league = $league AND r.league = $league
AND r.status IN (2,3) AND r.status IN (2,3)
ORDER BY r.matchday DESC"; ORDER BY r.matchday DESC";
$result = $db->sql_query_limit($sql, 1); $result = $db->sql_query_limit($sql, 1);
if($row = $db->sql_fetchrow($result)) if($row = $db->sql_fetchrow($result))
{ {
$last_matchday = $row['last_matchday']; $last_matchday = $row['last_matchday'];
$db->sql_freeresult($result); $db->sql_freeresult($result);
$rank_matchday = ($last_matchday < $matchday) ? $last_matchday : $matchday; $rank_matchday = ($last_matchday < $matchday) ? $last_matchday : $matchday;
$sql = 'SELECT $sql = 'SELECT
r.rank_total AS rank, r.rank_total AS rank,
r.user_id, r.user_id,
u.username, u.username,
u.user_colour, u.user_colour,
r.status AS status, r.status AS status,
r.points_total AS points, r.points_total AS points,
r.win_total AS win r.win_total AS win
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
AND r.matchday = $rank_matchday AND r.matchday = $rank_matchday
AND r.status IN (2,3) AND r.status IN (2,3)
ORDER BY points DESC, LOWER(u.username) ASC"; ORDER BY points DESC, LOWER(u.username) ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$index = 0; $index = 0;
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$index++; $index++;
$data_rank_total = true; $data_rank_total = true;
if (($index <= $config['football_display_ranks']) OR ($row['user_id'] == $user->data['user_id'])) if (($index <= $config['football_display_ranks']) OR ($row['user_id'] == $user->data['user_id']))
{ {
$row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id']) if ($row['user_id'] == $user->data['user_id'])
{ {
$row_class = 'bg3 row_user'; $row_class = 'bg3 row_user';
} }
$colorstyle = color_style($row['status']); $colorstyle = color_style($row['status']);
$template->assign_block_vars("ranktotal", array( $template->assign_block_vars("ranktotal", array(
'RANK' => $row['rank'], 'RANK' => $row['rank'],
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'USERID' => $row['user_id'], 'USERID' => $row['user_id'],
'USERNAME' => $row['username'], 'USERNAME' => $row['username'],
'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
'URL' => $phpbb_root_path . "profile.php?mode=viewprofile&u=" . $row['user_id'], 'URL' => $phpbb_root_path . "profile.php?mode=viewprofile&u=" . $row['user_id'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
'COLOR_STYLE' => $colorstyle, 'COLOR_STYLE' => $colorstyle,
'WIN' => $row['win'] , 'WIN' => $row['win'] ,
) )
); );
} }
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
else else
{ {
$data_rank_total = false; $data_rank_total = false;
} }
$league_info = league_info($season, $league); $league_info = league_info($season, $league);
$template->assign_vars(array( $template->assign_vars(array(
'S_DISPLAY_RANK_TOTAL' => true, 'S_DISPLAY_RANK_TOTAL' => true,
'S_DATA_RANK_TOTAL' => $data_rank_total, 'S_DATA_RANK_TOTAL' => $data_rank_total,
'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,
'WIN_NAME' => $config['football_win_name'], 'WIN_NAME' => $config['football_win_name'],
) )
); );
} }
?>

View File

@@ -1,270 +1,259 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$start = $this->request->variable('start', 0); $start = $this->request->variable('start', 0);
$win_user_most_hits = array(); $win_user_most_hits = array();
$win_user_most_hits_away = array(); $win_user_most_hits_away = array();
$season_wins = array(); $season_wins = array();
$win_user_most_hits = win_user_most_hits($season, $league, $matchday); $win_user_most_hits = win_user_most_hits($season, $league, $matchday);
$win_user_most_hits_away = win_user_most_hits_away($season, $league, $matchday); $win_user_most_hits_away = win_user_most_hits_away($season, $league, $matchday);
// Statistics of matchday // Statistics of matchday
$sql = "SELECT $sql = "SELECT
b.user_id, b.user_id,
COUNT(b.match_no) AS matches, COUNT(b.match_no) AS matches,
SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS bets, SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS bets,
SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', SUM(IF(b.goals_home <> '' AND b.goals_guest <> '',
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0), IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0),
0 0
) )
) AS hits, ) AS hits,
SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', SUM(IF(b.goals_home <> '' AND b.goals_guest <> '',
IF((m.goals_home <= m.goals_guest), IF((m.goals_home <= m.goals_guest),
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0), IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0),
0 0
), ),
0 0
) )
) AS hits02, ) AS hits02,
SUM(IF(b.goals_home <> '' AND b.goals_guest <> '', SUM(IF(b.goals_home <> '' AND b.goals_guest <> '',
IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) OR IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) OR
(b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR
(b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0, 0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
), ),
0 0
) )
) AS tendency ) AS tendency
FROM " . FOOTB_BETS . ' AS b FROM " . FOOTB_BETS . ' AS b
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no)
WHERE b.season = $season WHERE b.season = $season
AND b.league = $league AND b.league = $league
AND m.status IN (2,3) AND m.status IN (2,3)
AND m.matchday = $matchday AND m.matchday = $matchday
GROUP BY user_id"; GROUP BY b.user_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$usersstats = $db->sql_fetchrowset($result); $usersstats = $db->sql_fetchrowset($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
foreach ($usersstats AS $userstats) foreach ($usersstats AS $userstats)
{ {
$betsof[$userstats['user_id']] = $userstats['bets']; $betsof[$userstats['user_id']] = $userstats['bets'];
$nobetsof[$userstats['user_id']] = $userstats['matches'] - $userstats['bets']; $nobetsof[$userstats['user_id']] = $userstats['matches'] - $userstats['bets'];
$tendenciesof[$userstats['user_id']] = $userstats['tendency']; $tendenciesof[$userstats['user_id']] = $userstats['tendency'];
$hitsof[$userstats['user_id']] = $userstats['hits']; $hitsof[$userstats['user_id']] = $userstats['hits'];
$hits02of[$userstats['user_id']] = $userstats['hits02']; $hits02of[$userstats['user_id']] = $userstats['hits02'];
} }
// ranks of matchday // ranks of matchday
$sql = 'SELECT $sql = 'SELECT
rank, rank,
user_id user_id
FROM '. FOOTB_RANKS . " FROM '. FOOTB_RANKS . "
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
AND matchday = $matchday AND matchday = $matchday
AND status IN (2,3) AND status IN (2,3)
ORDER BY rank ASC, user_id ASC"; ORDER BY rank ASC, user_id ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$ranks = $db->sql_fetchrowset($result); $ranks = $db->sql_fetchrowset($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
$total_users = sizeof($ranks); $total_users = sizeof($ranks);
foreach ($ranks AS $rank) foreach ($ranks AS $rank)
{ {
$rankof[$rank['user_id']] = $rank['rank']; $rankof[$rank['user_id']] = $rank['rank'];
} }
if ($matchday > 1) if ($matchday > 1)
{ {
// rank previous matchday // rank previous matchday
$sql = 'SELECT $sql = 'SELECT
rank AS last_rang, rank AS last_rang,
user_id user_id
FROM '. FOOTB_RANKS . " FROM '. FOOTB_RANKS . "
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
AND matchday = ($matchday-1) AND matchday = ($matchday-1)
AND status IN (2,3) AND status IN (2,3)
ORDER BY last_rang ASC, user_id ASC"; ORDER BY last_rang ASC, user_id ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$ranks = $db->sql_fetchrowset($result); $ranks = $db->sql_fetchrowset($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
foreach ($ranks AS $rank) foreach ($ranks AS $rank)
{ {
$prevrankof[$rank['user_id']] = $rank['last_rang']; $prevrankof[$rank['user_id']] = $rank['last_rang'];
} }
} }
if ($matchday == $maxmatchday) if ($matchday == $maxmatchday)
{ {
$season_wins = season_wins($season, $league, $matchday); $season_wins = season_wins($season, $league, $matchday);
} }
// 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)
{ {
$sql_start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page']; $sql_start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page'];
} }
else else
{ {
$sql_start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page']; $sql_start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page'];
} }
$sql_limit = $config['football_users_per_page']; $sql_limit = $config['football_users_per_page'];
// handle pagination. // handle pagination.
$base_url = $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)); $base_url = $this->helper->route('football_football_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday));
$pagination = $phpbb_container->get('pagination'); $pagination = $phpbb_container->get('pagination');
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start); $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
$data_ranks = false; $data_ranks = false;
$index = 0; $index = 0;
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$sql = 'SELECT $sql = 'SELECT
r.rank, r.rank,
r.status, r.status,
r.user_id, r.user_id,
r.points, r.points,
r.win AS wins, r.win AS wins,
u.user_colour, u.user_colour,
u.username u.username
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
AND r.matchday = $matchday AND r.matchday = $matchday
AND r.status IN (2,3) AND r.status IN (2,3)
ORDER BY r.rank ASC, r.points DESC, LOWER(u.username) ASC"; ORDER BY r.rank ASC, r.points DESC, LOWER(u.username) ASC";
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start); $result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$index++; $index++;
$data_ranks = true; $data_ranks = true;
if (isset($prevrankof[$row['user_id']])) if (isset($prevrankof[$row['user_id']]))
{ {
if ($rankof[$row['user_id']] == '') if ($rankof[$row['user_id']] == '')
{ {
$change_sign = ''; $change_sign = '';
$change_img = ''; $change_differ = '&nbsp;';
$change_differ = '&nbsp;'; }
} else
else {
{ if ($rankof[$row['user_id']] == $prevrankof[$row['user_id']])
if ($rankof[$row['user_id']] == $prevrankof[$row['user_id']]) {
{ $change_sign = '=';
$change_sign = '='; $change_differ = '&nbsp;';
$change_img = "<img src=\"" . $ext_path . "images/no_change.gif\" alt=\"" . $user->lang['NO_CHANGES'] . "\"/>"; }
$change_differ = '&nbsp;'; else
} {
else if ($rankof[$row['user_id']] > $prevrankof[$row['user_id']])
{ {
if ($rankof[$row['user_id']] > $prevrankof[$row['user_id']]) $change_sign = '-';
{ $differ = $prevrankof[$row['user_id']] - $rankof[$row['user_id']];
$change_sign = '+'; $change_differ = ' (' . $differ . ')';
$change_img = "<img src=\"" . $ext_path . "images/arrow_down.gif\" alt=\"" . $user->lang['WORSENED'] . "\"/>"; }
$differ = $rankof[$row['user_id']] - $prevrankof[$row['user_id']]; else
$change_differ = ' (' . $differ . ')'; {
} $change_sign = '+';
else $differ = $prevrankof[$row['user_id']] - $rankof[$row['user_id']];
{ $change_differ = ' (' . $differ . ')';
$change_sign = '-'; }
$change_img = "<img src=\"" . $ext_path . "images/arrow_up.gif\" alt=\"" . $user->lang['IMPROVED'] . "\"/>"; }
$differ = $prevrankof[$row['user_id']] - $rankof[$row['user_id']]; }
$change_differ = ' (' . $differ . ')'; }
} else
} {
} $change_sign = '';
} $change_differ = '&nbsp;';
else }
{
$change_sign = ''; if ($matchday == $maxmatchday)
$change_img = ''; {
$change_differ = '&nbsp;'; // if someone didn't bet the hole Season
} if(!isset($win_user_most_hits[$row['user_id']]['win']))
{
if ($matchday == $maxmatchday) $win_user_most_hits[$row['user_id']]['win'] = 0;
{ }
// if someone didn't bet the hole Season if(!isset($win_user_most_hits_away[$row['user_id']]['win']))
if(!isset($win_user_most_hits[$row['user_id']]['win'])) {
{ $win_user_most_hits_away[$row['user_id']]['win'] = 0;
$win_user_most_hits[$row['user_id']]['win'] = 0; }
} if(!isset($season_wins[$row['user_id']]['win']))
if(!isset($win_user_most_hits_away[$row['user_id']]['win'])) {
{ $season_wins[$row['user_id']]['win'] = 0;
$win_user_most_hits_away[$row['user_id']]['win'] = 0; }
} $win_total = sprintf('%01.2f',$row['wins'] + $win_user_most_hits[$row['user_id']]['win'] + $win_user_most_hits_away[$row['user_id']]['win']
if(!isset($season_wins[$row['user_id']]['win'])) + $season_wins[$row['user_id']]['win']);
{ }
$season_wins[$row['user_id']]['win'] = 0; else
} {
$win_total = sprintf('%01.2f',$row['wins'] + $win_user_most_hits[$row['user_id']]['win'] + $win_user_most_hits_away[$row['user_id']]['win'] $win_total = sprintf('%01.2f',$row['wins']);
+ $season_wins[$row['user_id']]['win']); }
} $row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
else if ($row['user_id'] == $user->data['user_id'])
{ {
$win_total = sprintf('%01.2f',$row['wins']); $row_class = 'bg3 row_user';
} }
$row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $colorstyle = color_style($row['status']);
if ($row['user_id'] == $user->data['user_id'])
{ $template->assign_block_vars('rankstotal', array(
$row_class = 'bg3 row_user'; 'ROW_CLASS' => $row_class,
} 'RANK' => $rankof[$row['user_id']],
$colorstyle = color_style($row['status']); 'NO_CHANGES' => ($change_sign == '=') ? true : false,
'WORSENED' => ($change_sign == '+') ? true : false,
$template->assign_block_vars('rankstotal', array( 'IMPROVED' => ($change_sign == '-') ? true : false,
'ROW_CLASS' => $row_class, 'CHANGE_SIGN' => $change_sign,
'RANK' => $rankof[$row['user_id']], 'CHANGE_DIFFER' => $change_differ,
'CHANGE_SIGN' => $change_sign, 'USERID' => $row['user_id'],
'CHANGE_IMG' => $change_img, 'USERNAME' => $row['username'],
'CHANGE_DIFFER' => $change_differ, 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
'USERID' => $row['user_id'], 'BETS' => $betsof[$row['user_id']],
'USERNAME' => $row['username'], 'NOBETS' => ($nobetsof[$row['user_id']] == 0) ? '&nbsp;' : $nobetsof[$row['user_id']],
'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), 'TENDENCIES' => ($tendenciesof[$row['user_id']] == 0) ? '&nbsp;' : $tendenciesof[$row['user_id']],
'BETS' => $betsof[$row['user_id']], 'DIRECTHITS' => ($hitsof[$row['user_id']] == 0) ? '&nbsp;' : $hitsof[$row['user_id']],
'NOBETS' => ($nobetsof[$row['user_id']] == 0) ? '&nbsp;' : $nobetsof[$row['user_id']], 'DIRECTHITS02' => ($hits02of[$row['user_id']] == 0) ? '&nbsp;' : $hits02of[$row['user_id']],
'TENDENCIES' => ($tendenciesof[$row['user_id']] == 0) ? '&nbsp;' : $tendenciesof[$row['user_id']], 'POINTS' => $row['points'],
'DIRECTHITS' => ($hitsof[$row['user_id']] == 0) ? '&nbsp;' : $hitsof[$row['user_id']], 'COLOR_STYLE' => $colorstyle,
'DIRECTHITS02' => ($hits02of[$row['user_id']] == 0) ? '&nbsp;' : $hits02of[$row['user_id']], 'WIN' => $win_total,
'POINTS' => $row['points'], )
'COLOR_STYLE' => $colorstyle, );
'WIN' => $win_total, }
) $db->sql_freeresult($result);
); $league_info = league_info($season, $league);
}
$db->sql_freeresult($result); $sidename = sprintf($user->lang['RANK_MATCHDAY']);
$league_info = league_info($season, $league); $template->assign_vars(array(
'S_DISPLAY_RANKS_MATCHDAY' => true,
$sidename = sprintf($user->lang['RANK_MATCHDAY']); 'S_DISPLAY_HITS02' => $config['football_win_hits02'],
$template->assign_vars(array( 'S_SIDENAME' => $sidename,
'S_DISPLAY_RANKS_MATCHDAY' => true, 'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true,
'S_DISPLAY_HITS02' => $config['football_win_hits02'], 'S_DATA_RANKS' => $data_ranks,
'S_SIDENAME' => $sidename, 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true, 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)), 'WIN_NAME' => $config['football_win_name'],
'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,
'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),
'WIN_NAME' => $config['football_win_name'],
)
);
?>

View File

@@ -7,7 +7,7 @@
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
@@ -39,7 +39,7 @@ switch ($mode)
WHERE b.league = $league WHERE b.league = $league
AND ((b.season < $season) OR (b.season = $season AND m.matchday <= $matchday)) AND ((b.season < $season) OR (b.season = $season AND m.matchday <= $matchday))
AND m.status IN (2,3) AND m.status IN (2,3)
GROUP BY user_id"; GROUP BY b.user_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result); $rows = $db->sql_fetchrowset($result);
@@ -61,7 +61,7 @@ switch ($mode)
WHERE r.league = $league WHERE r.league = $league
AND ((r.season < $season AND r.matchday = l.matchdays) OR (r.season = $season AND r.matchday = $matchday)) AND ((r.season < $season AND r.matchday = l.matchdays) OR (r.season = $season AND r.matchday = $matchday))
AND r.status IN (2,3) AND r.status IN (2,3)
GROUP BY user_id GROUP BY r.user_id
ORDER BY r.user_id ASC"; ORDER BY r.user_id ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@@ -89,7 +89,7 @@ switch ($mode)
WHERE r.league = $league WHERE r.league = $league
AND ((r.season < $season) OR (r.season = $season AND r.matchday <= $matchday)) AND ((r.season < $season) OR (r.season = $season AND r.matchday <= $matchday))
AND r.status IN (2,3) AND r.status IN (2,3)
GROUP BY user_id GROUP BY r.user_id
ORDER BY points_total DESC, LOWER(u.username) ASC"; ORDER BY points_total DESC, LOWER(u.username) ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@@ -114,7 +114,7 @@ switch ($mode)
$index_end = $index_start + $config['football_users_per_page'] - 1; $index_end = $index_start + $config['football_users_per_page'] - 1;
// handle pagination. // handle pagination.
$base_url = $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'alltime')); $base_url = $this->helper->route('football_football_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'alltime'));
$pagination = $phpbb_container->get('pagination'); $pagination = $phpbb_container->get('pagination');
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start); $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
@@ -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,22 +165,15 @@ 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,
'WIN_NAME' => $config['football_win_name'], 'WIN_NAME' => $config['football_win_name'],
'S_SHOW_OTHER_LINKS' => true, 'S_SHOW_OTHER_LINKS' => true,
'S_HEADER' => sprintf($user->lang['RANKING_ALL_TIME']), 'S_HEADER' => sprintf($user->lang['RANKING_ALL_TIME']),
'S_LINK_RANKING' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), 'S_LINK_RANKING' => $this->helper->route('football_football_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)),
'S_LINK_ALL_TIME' => '', 'S_LINK_ALL_TIME' => '',
'S_LINK_COMPARE' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'compare')), 'S_LINK_COMPARE' => $this->helper->route('football_football_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'compare')),
) )
); );
break; break;
@@ -235,8 +227,8 @@ switch ($mode)
AND r.league = $league AND r.league = $league
AND r.matchday = $matchday AND r.matchday = $matchday
AND r.status IN (2,3) AND r.status IN (2,3)
GROUP BY season, user_id GROUP BY r.season, r.user_id
ORDER BY r.user_id ASC, season ASC"; ORDER BY r.user_id ASC, r.season ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@@ -283,7 +275,7 @@ switch ($mode)
$index_end = $index_start + $config['football_users_per_page'] - 1; $index_end = $index_start + $config['football_users_per_page'] - 1;
// handle pagination. // handle pagination.
$base_url = $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'compare')); $base_url = $this->helper->route('football_football_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'compare'));
$pagination = $phpbb_container->get('pagination'); $pagination = $phpbb_container->get('pagination');
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start); $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
@@ -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,21 +328,14 @@ 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,
'WIN_NAME' => $config['football_win_name'], 'WIN_NAME' => $config['football_win_name'],
'S_SHOW_OTHER_LINKS' => true, 'S_SHOW_OTHER_LINKS' => true,
'S_HEADER' => sprintf($user->lang['RANKING_COMPARE']), 'S_HEADER' => sprintf($user->lang['RANKING_COMPARE']),
'S_LINK_RANKING' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), 'S_LINK_RANKING' => $this->helper->route('football_football_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)),
'S_LINK_ALL_TIME' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'alltime')), 'S_LINK_ALL_TIME' => $this->helper->route('football_football_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'alltime')),
'S_LINK_COMPARE' => '', 'S_LINK_COMPARE' => '',
) )
); );
@@ -385,7 +369,7 @@ switch ($mode)
AND b.league = $league AND b.league = $league
AND m.status IN (2,3) AND m.status IN (2,3)
AND m.matchday <= $matchday AND m.matchday <= $matchday
GROUP BY user_id"; GROUP BY b.user_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result); $rows = $db->sql_fetchrowset($result);
@@ -439,7 +423,7 @@ switch ($mode)
AND r.league = $league AND r.league = $league
AND r.matchday = $matchday AND r.matchday = $matchday
AND r.status IN (2,3) AND r.status IN (2,3)
GROUP BY user_id GROUP BY r.user_id
ORDER BY r.points_total DESC, LOWER(u.username) ASC"; ORDER BY r.points_total DESC, LOWER(u.username) ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@@ -463,7 +447,7 @@ switch ($mode)
$index_end = $index_start + $config['football_users_per_page'] - 1; $index_end = $index_start + $config['football_users_per_page'] - 1;
// handle pagination. // handle pagination.
$base_url = $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)); $base_url = $this->helper->route('football_football_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday));
$pagination = $phpbb_container->get('pagination'); $pagination = $phpbb_container->get('pagination');
if ($user->data['football_mobile']) if ($user->data['football_mobile'])
{ {
@@ -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,21 +548,14 @@ 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,
'WIN_NAME' => $config['football_win_name'], 'WIN_NAME' => $config['football_win_name'],
'S_SHOW_OTHER_LINKS' => true, 'S_SHOW_OTHER_LINKS' => true,
'S_LINK_RANKING' => '', 'S_LINK_RANKING' => '',
'S_LINK_ALL_TIME' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'alltime')), 'S_LINK_ALL_TIME' => $this->helper->route('football_football_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'alltime')),
'S_LINK_COMPARE' => $this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'compare')), 'S_LINK_COMPARE' => $this->helper->route('football_football_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday, 'mode' => 'compare')),
) )
); );
break; break;

View File

@@ -1,433 +1,439 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$user_is_member = user_is_member($user->data['user_id'], $season, $league); $user_is_member = user_is_member($user->data['user_id'], $season, $league);
$edit_mode = false; $edit_mode = false;
$display_group = false; $display_group = false;
$display_ko = false; $display_ko = false;
$data_results = false; $data_results = false;
$lang_dates = $user->lang['datetime']; $lang_dates = $user->lang['datetime'];
$matchnumber = 0; $matchnumber = 0;
$editstatus = array(1, 2, 4, 5); $editstatus = array(1, 2, 4, 5);
$league_info = league_info($season, $league); $league_info = league_info($season, $league);
// Calculate matches AND results of matchday // Calculate matches AND results of matchday
$sql = "SELECT $sql = "SELECT
m.match_no, m.match_no,
m.matchday, m.matchday,
m.status, m.status,
m.group_id, m.group_id,
m.formula_home, m.formula_home,
m.formula_guest, m.formula_guest,
t1.team_symbol AS home_symbol, t1.team_symbol AS home_symbol,
t2.team_symbol AS guest_symbol, t2.team_symbol AS guest_symbol,
t1.team_id AS home_id, t1.team_id AS home_id,
t2.team_id AS guest_id, t2.team_id AS guest_id,
t1.team_name AS home_name, t1.team_name AS home_name,
t2.team_name AS guest_name, t2.team_name AS guest_name,
t1.team_name_short AS home_short, t1.team_name_short AS home_short,
t2.team_name_short AS guest_short, t2.team_name_short AS guest_short,
m.goals_home, m.goals_home,
m.goals_guest, m.goals_guest,
m.ko_match AS ko_match, m.ko_match AS ko_match,
m.goals_overtime_home AS kogoals_home, m.goals_overtime_home AS kogoals_home,
m.goals_overtime_guest AS kogoals_guest, m.goals_overtime_guest AS kogoals_guest,
CONCAT( CONCAT(
CASE DATE_FORMAT(m.match_datetime,'%w') CASE DATE_FORMAT(m.match_datetime,'%w')
WHEN 0 THEN '" . $lang_dates['Sun'] . "' WHEN 0 THEN '" . $lang_dates['Sun'] . "'
WHEN 1 THEN '" . $lang_dates['Mon'] . "' WHEN 1 THEN '" . $lang_dates['Mon'] . "'
WHEN 2 THEN '" . $lang_dates['Tue'] . "' WHEN 2 THEN '" . $lang_dates['Tue'] . "'
WHEN 3 THEN '" . $lang_dates['Wed'] . "' WHEN 3 THEN '" . $lang_dates['Wed'] . "'
WHEN 4 THEN '" . $lang_dates['Thu'] . "' WHEN 4 THEN '" . $lang_dates['Thu'] . "'
WHEN 5 THEN '" . $lang_dates['Fri'] . "' WHEN 5 THEN '" . $lang_dates['Fri'] . "'
WHEN 6 THEN '" . $lang_dates['Sat'] . "' WHEN 6 THEN '" . $lang_dates['Sat'] . "'
ELSE 'Error' END, ELSE 'Error' END,
DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i') DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i')
) AS match_time ) 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)
WHERE m.season = $season WHERE m.season = $season
AND m.league = $league AND m.league = $league
AND m.matchday = $matchday AND m.matchday = $matchday
ORDER BY m.match_datetime ASC, m.match_no ASC"; ORDER BY m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query($sql); $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)); $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)) while($row = $db->sql_fetchrow($result))
{ {
$data_results = true; $data_results = true;
$matchnumber++ ; $matchnumber++ ;
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if (0 == $row['home_id']) if (0 == $row['home_id'])
{ {
$home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']); $home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']);
$home_in_array = explode("#",$home_info); $home_in_array = explode("#",$home_info);
$homelogo = $home_in_array[0]; $homelogo = $home_in_array[0];
$homeid = $home_in_array[1]; $homeid = $home_in_array[1];
$homename = $home_in_array[2]; $homename = $home_in_array[2];
$homeshort = $home_in_array[2]; $homeshort = $home_in_array[2];
} }
else else
{ {
$homelogo = $row['home_symbol']; $homelogo = $row['home_symbol'];
$homeid = $row['home_id']; $homeid = $row['home_id'];
$homename = $row['home_name']; $homename = $row['home_name'];
$homeshort = $row['home_short']; $homeshort = $row['home_short'];
} }
if (0 == $row['guest_id']) if (0 == $row['guest_id'])
{ {
$guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']); $guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']);
$guest_in_array = explode("#",$guest_info); $guest_in_array = explode("#",$guest_info);
$guestlogo = $guest_in_array[0]; $guestlogo = $guest_in_array[0];
$guestid = $guest_in_array[1]; $guestid = $guest_in_array[1];
$guestname = $guest_in_array[2]; $guestname = $guest_in_array[2];
$guestshort = $guest_in_array[2]; $guestshort = $guest_in_array[2];
} }
else else
{ {
$guestlogo = $row['guest_symbol']; $guestlogo = $row['guest_symbol'];
$guestid = $row['guest_id']; $guestid = $row['guest_id'];
$guestname = $row['guest_name']; $guestname = $row['guest_name'];
$guestshort = $row['guest_short']; $guestshort = $row['guest_short'];
} }
if ($homelogo <> '') if ($homelogo <> '')
{ {
$logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ; $logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ;
} }
else else
{ {
$logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; $logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
} }
if ($guestlogo <> '') if ($guestlogo <> '')
{ {
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ; $logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ;
} }
else else
{ {
$logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; $logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
} }
if ($row['ko_match']) if ($row['ko_match'])
{ {
$display_ko = true; $display_ko = true;
$ko_match = true; $ko_match = true;
} }
else else
{ {
$ko_match = false; $ko_match = false;
} }
if ($row['group_id'] == '') if ($row['group_id'] == '')
{ {
$group_id = '&nbsp;'; $group_id = '&nbsp;';
} }
else else
{ {
$display_group = true; $display_group = true;
$group_id = $row['group_id']; $group_id = $row['group_id'];
} }
if (in_array($row['status'], $editstatus) AND $user_is_member) if (in_array($row['status'], $editstatus) AND $user_is_member)
{ {
$edit_mode = true; $edit_mode = true;
$edit_match = true; $edit_match = true;
$goals_home = $row['goals_home']; $goals_home = $row['goals_home'];
$goals_guest = $row['goals_guest']; $goals_guest = $row['goals_guest'];
$kogoals_home = $row['kogoals_home']; $kogoals_home = $row['kogoals_home'];
$kogoals_guest = $row['kogoals_guest']; $kogoals_guest = $row['kogoals_guest'];
} }
else else
{ {
$edit_match = false; $edit_match = false;
$goals_home = ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home']; $goals_home = ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'];
$goals_guest = ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest']; $goals_guest = ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'];
$kogoals_home = ($row['kogoals_home'] == '') ? '&nbsp;' : $row['kogoals_home']; $kogoals_home = ($row['kogoals_home'] == '') ? '&nbsp;' : $row['kogoals_home'];
$kogoals_guest = ($row['kogoals_guest'] == '') ? '&nbsp;' : $row['kogoals_guest']; $kogoals_guest = ($row['kogoals_guest'] == '') ? '&nbsp;' : $row['kogoals_guest'];
} }
$template->assign_block_vars('result', array( $template->assign_block_vars('result', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'MATCH_NUMBER' => $row['match_no'], 'MATCH_NUMBER' => $row['match_no'],
'MATCHDAY' => $row['matchday'], 'MATCHDAY' => $row['matchday'],
'STATUS' => $row['status'], 'STATUS' => $row['status'],
'MATCH_TIME' => $row['match_time'], 'MATCH_TIME' => $row['match_time'],
'GROUP' => $group_id, 'GROUP' => $group_id,
'HOME_ID' => $homeid, 'HOME_ID' => $homeid,
'GUEST_ID' => $guestid, 'GUEST_ID' => $guestid,
'LOGO_HOME' => $logoH, 'LOGO_HOME' => $logoH,
'LOGO_GUEST' => $logoG, 'LOGO_GUEST' => $logoG,
'HOME_NAME' => $homename, 'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname, 'GUEST_NAME' => $guestname,
'HOME_SHORT' => $homeshort, 'HOME_SHORT' => $homeshort,
'GUEST_SHORT' => $guestshort, 'GUEST_SHORT' => $guestshort,
'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, 'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $homeid, 'mode' => 'all')), 'tid' => $homeid, 'mode' => 'all')),
'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, 'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $guestid, 'mode' => 'all')), 'tid' => $guestid, 'mode' => 'all')),
'GOALS_HOME' => $goals_home, 'GOALS_HOME' => $goals_home,
'GOALS_GUEST' => $goals_guest, 'GOALS_GUEST' => $goals_guest,
'COLOR_STYLE' => color_style($row['status']), 'COLOR_STYLE' => color_style($row['status']),
'KOGOALS_HOME' => $kogoals_home, 'KOGOALS_HOME' => $kogoals_home,
'KOGOALS_GUEST' => $kogoals_guest, 'KOGOALS_GUEST' => $kogoals_guest,
'S_KO_MATCH' => $ko_match, 'S_KO_MATCH' => $ko_match,
'S_EDIT_MATCH' => $edit_match, 'S_EDIT_MATCH' => $edit_match,
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Calculate extra bets of matchday // Calculate extra bets of matchday
// Start select team // Start select team
$sql = 'SELECT $sql = 'SELECT
team_id AS option_value, team_id AS option_value,
team_name AS option_name team_name AS option_name
FROM ' . FOOTB_TEAMS . " FROM ' . FOOTB_TEAMS . "
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
ORDER BY team_name ASC"; ORDER BY team_name ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$option_rows = $db->sql_fetchrowset($result); $option_rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
if ($edit_mode) if ($edit_mode)
{ {
$template->assign_block_vars('worldfootball', array('LEAGUE' => $league-1,)); $template->assign_block_vars('worldfootball', array('LEAGUE' => $league-1,));
} }
$sql = "SELECT e.*, $sql = "SELECT e.*,
t1.team_name AS result_team t1.team_name AS result_team
FROM " . FOOTB_EXTRA . ' AS e FROM " . FOOTB_EXTRA . ' AS e
LEFT JOIN ' . FOOTB_TEAMS . " AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result) LEFT JOIN ' . FOOTB_TEAMS . " AS t1 ON (t1.season = e.season AND t1.league = e.league AND t1.team_id = e.result)
WHERE e.season = $season WHERE e.season = $season
AND e.league = $league AND e.league = $league
AND e.matchday_eval = $matchday AND e.matchday_eval = $matchday
ORDER BY e.extra_no ASC"; ORDER BY e.extra_no ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$extra_results = false; $extra_results = false;
$extranumber = 0; $extranumber = 0;
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
$extra_results = true; $extra_results = true;
$extranumber++ ; $extranumber++ ;
$row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
switch($row['question_type']) switch($row['question_type'])
{ {
case '1': case '1':
{ {
$display_type = 1; $display_type = 1;
$eval_title = sprintf($user->lang['EXTRA_HIT']); $eval_title = sprintf($user->lang['EXTRA_HIT']);
} }
break; break;
case '2': case '2':
{ {
$display_type = 1; $display_type = 1;
$eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']);
} }
break; break;
case '3': case '3':
{ {
$display_type = 2; $display_type = 2;
$eval_title = sprintf($user->lang['EXTRA_HIT']); $eval_title = sprintf($user->lang['EXTRA_HIT']);
} }
break; break;
case '4': case '4':
case '5': case '5':
{ {
$display_type = 2; $display_type = 2;
$eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']); $eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']);
} }
break; break;
default : default :
{ {
$display_type = 2; $display_type = 2;
$eval_title = ''; $eval_title = '';
} }
break; break;
} }
if ($row['extra_status'] > 0 && $row['extra_status'] < 3 && $user_is_member) if ($row['extra_status'] > 0 && $row['extra_status'] < 3 && $user_is_member)
{ {
$edit_mode = true; $edit_mode = true;
$result_extra = ($row['result_team'] == NULL) ? '' : $row['result_team']; $result_extra = ($row['result_team'] == NULL) ? '' : $row['result_team'];
$multiple = ''; $multiple = '';
switch($row['question_type']) switch($row['question_type'])
{ {
case '2': case '2':
{ {
$multiple = ' multiple="multiple" size="3" '; $multiple = ' multiple="multiple" size="3" ';
} }
break; break;
case '4': case '4':
{ {
$option_arr = array(); $option_arr = array();
for ($i = 65; $i <= 72; $i++) for ($i = 65; $i <= 72; $i++)
{ {
if (strstr($row['question'], chr($i) . ':')) if (strstr($row['question'], chr($i) . ':'))
{ {
$option_arr[] = array( $option_arr[] = array(
'option_value' => chr($i), 'option_value' => chr($i),
'option_name' => chr($i), 'option_name' => chr($i),
); );
} }
} }
if (sizeof($option_arr) > 1) if (sizeof($option_arr) > 1)
{ {
$display_type = 1; $display_type = 1;
$option_rows = $option_arr; $option_rows = $option_arr;
$result_extra = $row['result']; $result_extra = $row['result'];
$multiple = ' multiple="multiple" size="3" '; $multiple = ' multiple="multiple" size="3" ';
} }
} }
break; break;
case '3': case '3':
{ {
$option_arr = array(); $option_arr = array();
for ($i = 65; $i <= 72; $i++) for ($i = 65; $i <= 72; $i++)
{ {
if (strstr($row['question'], chr($i) . ':')) if (strstr($row['question'], chr($i) . ':'))
{ {
$option_arr[] = array( $option_arr[] = array(
'option_value' => chr($i), 'option_value' => chr($i),
'option_name' => chr($i), 'option_name' => chr($i),
); );
} }
} }
if (sizeof($option_arr) > 1) if (sizeof($option_arr) > 1)
{ {
$display_type = 1; $display_type = 1;
$option_rows = $option_arr; $option_rows = $option_arr;
$result_extra = $row['result']; $result_extra = $row['result'];
} }
} }
break; break;
} }
$template->assign_block_vars('extra_result', array( $template->assign_block_vars('extra_result', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'EXTRA_NO' => $row['extra_no'], 'EXTRA_NO' => $row['extra_no'],
'S_EDIT_EXTRA' => true, 'S_EDIT_EXTRA' => true,
'QUESTION' => $row['question'], 'QUESTION' => $row['question'],
'EXTRA_POINTS' => $row['extra_points'], 'EXTRA_POINTS' => $row['extra_points'],
'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
'EVALUATION_TITLE' => $eval_title, 'EVALUATION_TITLE' => $eval_title,
'RESULT' => ($display_type == 1) ? $result_extra : $row['result'], 'RESULT' => ($display_type == 1) ? $result_extra : $row['result'],
'S_DISPLAY_TYPE' => $display_type, 'S_DISPLAY_TYPE' => $display_type,
) )
); );
if ($display_type == 1) if ($display_type == 1)
{ {
$selected = ($row['result'] == '') ? ' selected="selected"' : ''; $selected = ($row['result'] == '') ? ' selected="selected"' : '';
$template->assign_block_vars('extra_result.extra_option', array( $template->assign_block_vars('extra_result.extra_option', array(
'OPTION_VALUE' => '', 'OPTION_VALUE' => '',
'OPTION_NAME' => sprintf($user->lang['SELECT']), 'OPTION_NAME' => sprintf($user->lang['SELECT']),
'S_SELECTED' => $selected)); 'S_SELECTED' => $selected));
foreach ($option_rows as $option_row) foreach ($option_rows as $option_row)
{ {
if (strstr($row['result'], ';')) if (strstr($row['result'], ';'))
{ {
$selected = ''; $selected = '';
$result_arr = explode(';', $row['result']); $result_arr = explode(';', $row['result']);
foreach($result_arr AS $result_value) foreach($result_arr AS $result_value)
{ {
if ($result_value <> '') if ($result_value <> '')
{ {
if ($option_row['option_value'] == $result_value) if ($option_row['option_value'] == $result_value)
{ {
$selected = ' selected="selected"'; $selected = ' selected="selected"';
} }
} }
} }
} }
else else
{ {
$selected = ($option_row['option_value'] == $row['result']) ? ' selected="selected"' : ''; $selected = ($option_row['option_value'] == $row['result']) ? ' selected="selected"' : '';
} }
$template->assign_block_vars('extra_result.extra_option', array( $template->assign_block_vars('extra_result.extra_option', array(
'OPTION_VALUE' => $option_row['option_value'], 'OPTION_VALUE' => $option_row['option_value'],
'OPTION_NAME' => $option_row['option_name'], 'OPTION_NAME' => $option_row['option_name'],
'S_SELECTED' => $selected)); 'S_SELECTED' => $selected));
} }
} }
} }
else else
{ {
$extra_colorstyle = color_style($row['extra_status']); $extra_colorstyle = color_style($row['extra_status']);
$extra_result = ($row['result'] == '') ? '&nbsp;' : $row['result']; $extra_result = ($row['result'] == '') ? '&nbsp;' : $row['result'];
$result_extra = ($row['result_team'] == NULL) ? '&nbsp;' : $row['result_team']; $result_extra = ($row['result_team'] == NULL) ? '&nbsp;' : $row['result_team'];
$template->assign_block_vars('extra_result', array( $template->assign_block_vars('extra_result', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'S_EDIT_EXTRA' => false, 'S_EDIT_EXTRA' => false,
'QUESTION' => $row['question'], 'QUESTION' => $row['question'],
'EXTRA_POINTS' => $row['extra_points'], 'EXTRA_POINTS' => $row['extra_points'],
'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']), 'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
'RESULT' => ($display_type == 1) ? $result_extra : $extra_result, 'RESULT' => ($display_type == 1) ? $result_extra : $extra_result,
'COLOR_STYLE' => $extra_colorstyle, 'COLOR_STYLE' => $extra_colorstyle,
) )
); );
} }
} }
$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:
$result_explain = sprintf($user->lang['MIN90']); $result_explain = sprintf($user->lang['MIN90']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
break; break;
case BET_KO_EXTRATIME: case BET_KO_EXTRATIME:
$result_explain = sprintf($user->lang['EXTRATIME_SHORT']); $result_explain = sprintf($user->lang['EXTRATIME_SHORT']);
$label_finalresult = sprintf($user->lang['PENALTY']); $label_finalresult = sprintf($user->lang['PENALTY']);
break; break;
case BET_KO_PENALTY: case BET_KO_PENALTY:
$result_explain = sprintf($user->lang['PENALTY']); $result_explain = sprintf($user->lang['PENALTY']);
$display_ko = false; $display_ko = false;
break; break;
default: default:
$result_explain = sprintf($user->lang['MIN90']); $result_explain = sprintf($user->lang['MIN90']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
break; break;
} }
// set correct display for usage in menu template
$template->assign_vars(array( if($side == 'results')
'S_DISPLAY_RESULTS' => true, {
'S_EXTRA_RESULTS' => $extra_results, $display_results = true;
'S_SIDENAME' => $sidename, $display_results_tl = false;
'RESULT_EXPLAIN' => $result_explain, $sidename = sprintf($user->lang['RESULTS']);
'LABEL_FINALRESULT' => $label_finalresult, }
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), if($side == 'results_tl')
'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)), $display_results = false;
'RIGHT_LINK' => sprintf($user->lang['TABLE']) . ' &gt;', $display_results_tl = true;
'LEFT_TITLE' => sprintf($user->lang['TITLE_ALL_BETS']), $sidename = sprintf($user->lang['RESULTS']);
'RIGHT_TITLE' => sprintf($user->lang['TITLE_TABLE']), }
'S_FORM_ACTION_RESULT' => $this->helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'result')),
'S_DATA_RESULTS' => $data_results, $template->assign_vars(array(
'S_USER_IS_MEMBER' => $user_is_member, 'S_DISPLAY_RESULTS' => $display_results,
'S_DISPLAY_GROUP' => $display_group, 'S_DISPLAY_RESULTS_TL' => $display_results_tl,
'S_DISPLAY_KO' => $display_ko, 'S_EXTRA_RESULTS' => $extra_results,
'S_EDIT_MODE' => $edit_mode, 'S_SIDENAME' => $sidename,
) 'RESULT_EXPLAIN' => $result_explain,
); 'LABEL_FINALRESULT' => $label_finalresult,
'S_FORM_ACTION_RESULT' => $this->helper->route('football_football_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'result')),
?> 'S_DATA_RESULTS' => $data_results,
'S_USER_IS_MEMBER' => $user_is_member,
'S_DISPLAY_GROUP' => $display_group,
'S_DISPLAY_KO' => $display_ko,
'S_EDIT_MODE' => $edit_mode,
)
);

View File

@@ -1,227 +1,233 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
// Can this user view Prediction Leagues pages? if (!defined('IN_PHPBB'))
if (!$config['football_guest_view']) {
{ exit;
if ($user->data['user_id'] == ANONYMOUS) }
{
trigger_error('NO_GUEST_VIEW'); // Can this user view Prediction Leagues pages?
} if (!$config['football_guest_view'])
} {
if (!$config['football_user_view']) if ($user->data['user_id'] == ANONYMOUS)
{ {
// Only Prediction League member should see this page trigger_error('NO_GUEST_VIEW');
// Check Prediction League authorisation }
if ( !$this->auth->acl_get('u_use_football') ) }
{ if (!$config['football_user_view'])
trigger_error('NO_AUTH_VIEW'); {
} // Only Prediction League member should see this page
} // Check Prediction League authorisation
if ( !$this->auth->acl_get('u_use_football') )
// Football disabled? {
if ($config['football_disable']) trigger_error('NO_AUTH_VIEW');
{ }
$message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; }
trigger_error($message);
} // Football disabled?
if ($config['football_disable'])
$season = $this->request->variable('s', 0); {
$league = $this->request->variable('l', 0); $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED';
trigger_error($message);
// Check parms }
$error_message = '';
if (!$season OR !$league) $season = $this->request->variable('s', 0);
{ $league = $this->request->variable('l', 0);
$data_rules = false;
if (!$season) // Check parms
{ $error_message = '';
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />'; if (!$season OR !$league)
} {
if (!$league) $data_rules = false;
{ if (!$season)
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />'; {
} $error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
} }
else if (!$league)
{ {
$season_info = season_info($season); $error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
if (sizeof($season_info)) }
{ }
$season_name = $season_info['season_name']; else
$league_info = league_info($season, $league); {
if (sizeof($league_info)) $season_info = season_info($season);
{ if (sizeof($season_info))
$data_rules = true; {
$matchdays = $league_info['matchdays']; $season_name = $season_info['season_name'];
$league_name = $league_info['league_name']; $league_info = league_info($season, $league);
if (sizeof($league_info))
if ($user->data['is_registered'] and !$user->data['is_bot']) {
{ $data_rules = true;
$win_hits = ''; $matchdays = $league_info['matchdays'];
$win_hits02 = ''; $league_name = $league_info['league_name'];
$win_matchday = explode(';', "0;" . $league_info['win_matchday']);
$win_season = explode(';',"0;" . $league_info['win_season']); if ($user->data['is_registered'] and !$user->data['is_bot'])
$win_hits = $league_info['win_result']; {
$win_hits02 = $league_info['win_result_02']; $win_hits = '';
$win_hits02 = '';
if($win_hits != '' AND $win_hits != 0) $win_matchday = explode(';', "0;" . $league_info['win_matchday']);
{ $win_season = explode(';',"0;" . $league_info['win_season']);
$template->assign_block_vars('wintable', array( $win_hits = $league_info['win_result'];
'WIN_DESC' => sprintf($user->lang['WIN_HITS']), $win_hits02 = $league_info['win_result_02'];
)
); if($win_hits != '' AND $win_hits != 0)
$template->assign_block_vars('wintable.entry', array( {
'ROW_CLASS' => 'bg1 row_light', $template->assign_block_vars('wintable', array(
'RANK' => '1. ' . sprintf($user->lang['PLACE']), 'WIN_DESC' => sprintf($user->lang['WIN_HITS']),
'WIN' => $win_hits, )
) );
); $template->assign_block_vars('wintable.entry', array(
} 'ROW_CLASS' => 'bg1 row_light',
'RANK' => '1. ' . sprintf($user->lang['PLACE']),
if($win_hits02 != '' AND $win_hits02 != 0 AND $config['football_win_hits02']) 'WIN' => $win_hits,
{ )
$template->assign_block_vars('wintable', array( );
'WIN_DESC' => sprintf($user->lang['WIN_HITS02']), }
)
); if($win_hits02 != '' AND $win_hits02 != 0 AND $config['football_win_hits02'])
$template->assign_block_vars('wintable.entry', array( {
'ROW_CLASS' => 'bg1 row_light', $template->assign_block_vars('wintable', array(
'RANK' => '1. ' . sprintf($user->lang['PLACE']), 'WIN_DESC' => sprintf($user->lang['WIN_HITS02']),
'WIN' => $win_hits02, )
) );
); $template->assign_block_vars('wintable.entry', array(
} 'ROW_CLASS' => 'bg1 row_light',
'RANK' => '1. ' . sprintf($user->lang['PLACE']),
'WIN' => $win_hits02,
if($win_matchday[1] != '' AND $win_matchday[1] != 0) )
{ );
$template->assign_block_vars('wintable', array( }
'WIN_DESC' => sprintf($user->lang['WINS_MATCHDAY']),
)
); if($win_matchday[1] != '' AND $win_matchday[1] != 0)
$rank = 1; {
while ($win_matchday[$rank] != '') $template->assign_block_vars('wintable', array(
{ 'WIN_DESC' => sprintf($user->lang['WINS_MATCHDAY']),
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; )
$template->assign_block_vars('wintable.entry', array( );
'ROW_CLASS' => $row_class, $rank = 1;
'RANK' => $rank . '. ' . sprintf($user->lang['PLACE']), while ($win_matchday[$rank] != '')
'WIN' => $win_matchday[$rank], {
) $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
); $template->assign_block_vars('wintable.entry', array(
$rank++ ; 'ROW_CLASS' => $row_class,
if ($rank > sizeof($win_matchday)-1) 'RANK' => $rank . '. ' . sprintf($user->lang['PLACE']),
{ 'WIN' => $win_matchday[$rank],
break; )
} );
} $rank++ ;
} if ($rank > sizeof($win_matchday)-1)
{
if($win_season[1] != '' AND $win_season[1] != 0) break;
{ }
$template->assign_block_vars('wintable', array( }
'WIN_DESC' => sprintf($user->lang['WINS_SEASON']), }
)
); if($win_season[1] != '' AND $win_season[1] != 0)
$rank = 1; {
while ($win_season[$rank] != '') $template->assign_block_vars('wintable', array(
{ 'WIN_DESC' => sprintf($user->lang['WINS_SEASON']),
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; )
$template->assign_block_vars('wintable.entry', array( );
'ROW_CLASS' => $row_class, $rank = 1;
'RANK' => $rank. '. ' . sprintf($user->lang['PLACE']), while ($win_season[$rank] != '')
'WIN' => $win_season[$rank], {
) $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
); $template->assign_block_vars('wintable.entry', array(
$rank++ ; 'ROW_CLASS' => $row_class,
if ($rank > sizeof($win_season)-1) 'RANK' => $rank. '. ' . sprintf($user->lang['PLACE']),
{ 'WIN' => $win_season[$rank],
break; )
} );
} $rank++ ;
} if ($rank > sizeof($win_season)-1)
} {
} break;
else }
{ }
$data_rules = false; }
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />'; }
$league_name = ''; }
} else
} {
else $data_rules = false;
{ $error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
$data_rules = false; $league_name = '';
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />'; }
$season_name = ''; }
} else
} {
$data_rules = false;
$sidename = sprintf($user->lang['FOOTBALL_RULES']); $error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
if ($data_rules) $season_name = '';
{ }
$link_rules = append_sid($phpbb_root_path . "viewtopic.$phpEx?p=" . $league_info["rules_post_id"]); }
$points_tendency = ($league_info['points_mode'] < 3) ? sprintf($user->lang['POINTS_TENDENCY' . $league_info['points_mode']], $league_info['points_tendency']) : sprintf($user->lang['POINTS_TENDENCY'], $league_info['points_tendency']);
$template->assign_vars(array( $sidename = sprintf($user->lang['FOOTBALL_RULES']);
'S_SIDENAME' => $sidename, if ($data_rules)
'S_DATA_RULES' => $data_rules, {
'S_BET_IN_TIME' => $league_info['bet_in_time'], $link_rules = append_sid($phpbb_root_path . "viewtopic.$phpEx?p=" . $league_info["rules_post_id"]);
'S_RULES_POST_ID' => $league_info['rules_post_id'], $points_tendency = ($league_info['points_mode'] < 3) ? sprintf($user->lang['POINTS_TENDENCY' . $league_info['points_mode']], $league_info['points_tendency']) : sprintf($user->lang['POINTS_TENDENCY'], $league_info['points_tendency']);
'S_ERROR_MESSAGE' => $error_message, $template->assign_vars(array(
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), 'S_SIDENAME' => $sidename,
'WIN_NAME' => $config['football_win_name'], 'S_DATA_RULES' => $data_rules,
'JOIN_MODE' => ($league_info['join_by_user']) ? (($league_info['join_in_season']) ? sprintf($user->lang['JOIN_IN_SEASON']) : sprintf($user->lang['JOIN_BY_USER'])) : sprintf($user->lang['JOIN_BY_ADMIN']), 'S_BET_IN_TIME' => $league_info['bet_in_time'],
'POINTS_HIT' => sprintf($user->lang['POINTS_HIT'], $league_info['points_result']) . '<br/>', 'S_BET_POINTS' => true,
'POINTS_TENDENCY' => $points_tendency . '<br/>', 'S_RULES_POST_ID' => $league_info['rules_post_id'],
'POINTS_DIFF' => ($league_info['points_mode'] == 4) ? sprintf($user->lang['POINTS_DIFFERENCE'], $league_info['points_diff']) . '<br/>' : 'S_ERROR_MESSAGE' => $error_message,
(($league_info['points_mode'] == 5) ? sprintf($user->lang['POINTS_DIFFERENCE_DRAW'], $league_info['points_diff']) . '<br/>' : ''), 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'POINTS_LAST' => ($league_info['points_last']) ? sprintf($user->lang['POINTS_NO_BET']) . '<br/>' : '', 'WIN_NAME' => $config['football_win_name'],
'LINK_RULES' => sprintf($user->lang['LINK_RULES'], $link_rules), 'JOIN_MODE' => ($league_info['join_by_user']) ? (($league_info['join_in_season']) ? sprintf($user->lang['JOIN_IN_SEASON']) : sprintf($user->lang['JOIN_BY_USER'])) : sprintf($user->lang['JOIN_BY_ADMIN']),
'SEASONNAME' => $season_info['season_name'], 'POINTS_HIT' => sprintf($user->lang['POINTS_HIT'], $league_info['points_result']) . '<br/>',
'LEAGUENAME' => $league_name, 'POINTS_TENDENCY' => $points_tendency . '<br/>',
) 'POINTS_DIFF' => ($league_info['points_mode'] == 4) ? sprintf($user->lang['POINTS_DIFFERENCE'], $league_info['points_diff']) . '<br/>' :
); (($league_info['points_mode'] == 5) ? sprintf($user->lang['POINTS_DIFFERENCE_DRAW'], $league_info['points_diff']) . '<br/>' : ''),
'POINTS_LAST' => ($league_info['points_last']) ? sprintf($user->lang['POINTS_NO_BET']) . '<br/>' : '',
// output page 'LINK_RULES' => sprintf($user->lang['LINK_RULES'], $link_rules),
page_header(sprintf($user->lang['FOOTBALL_RULES' ]) . ' ' . $league_info['league_name'] . ' ' . $season_info['season_name']); 'SEASONNAME' => $season_info['season_name'],
} 'LEAGUENAME' => $league_name,
else 'BET_POINTS' => $league_info['bet_points'],
{ )
$template->assign_vars(array( );
'S_SIDENAME' => $sidename,
'S_DATA_RULES' => $data_rules, // output page
'S_BET_IN_TIME' => false, page_header(sprintf($user->lang['FOOTBALL_RULES' ]) . ' ' . $league_info['league_name'] . ' ' . $season_info['season_name']);
'S_RULES_POST_ID' => 0, }
'S_ERROR_MESSAGE' => $error_message, else
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), {
'WIN_NAME' => $config['football_win_name'], $template->assign_vars(array(
'JOIN_MODE' => '', 'S_SIDENAME' => $sidename,
'POINTS_HIT' => '', 'S_DATA_RULES' => $data_rules,
'POINTS_TENDENCY' => '', 'S_BET_IN_TIME' => false,
'POINTS_DIFF' => '', 'S_BET_POINTS' => false,
'POINTS_LAST' => '', 'S_RULES_POST_ID' => 0,
'LINK_RULES' => '', 'S_ERROR_MESSAGE' => $error_message,
'SEASONNAME' => '', 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'LEAGUENAME' => '', 'WIN_NAME' => $config['football_win_name'],
) 'JOIN_MODE' => '',
); 'POINTS_HIT' => '',
'POINTS_TENDENCY' => '',
// output page 'POINTS_DIFF' => '',
page_header(sprintf($user->lang['FOOTBALL_RULES' ])); 'POINTS_LAST' => '',
} 'LINK_RULES' => '',
$template->set_filenames(array( 'SEASONNAME' => '',
'body' => 'rules_popup.html' 'LEAGUENAME' => '',
) )
); );
// $template->display('popup');
// output page
page_footer(); page_header(sprintf($user->lang['FOOTBALL_RULES' ]));
}
?> $template->set_filenames(array(
'body' => 'rules_popup.html'
)
);
// $template->display('popup');
page_footer();

View File

@@ -1,145 +1,144 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$data_table = false; $data_table = false;
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$sql = 'SELECT * $sql = 'SELECT *
FROM ' . FOOTB_RANKS . " FROM ' . FOOTB_RANKS . "
WHERE season = $season WHERE season = $season
AND league = $league AND league = $league
AND matchday = $matchday"; AND matchday = $matchday";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result); $row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
if ($row) if ($row)
{ {
include($this->football_root_path . 'block/rank_matchday.' . $this->php_ext); include($this->football_root_path . 'block/rank_matchday.' . $this->php_ext);
} }
else else
{ {
$rank = 0; $rank = 0;
// Get table-information // Get 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, 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, ) - 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 FROM " . FOOTB_TEAMS . ' AS t
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league
AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id)
WHERE t.season = $season WHERE t.season = $season
AND t.league = $league AND t.league = $league
AND m.matchday <= $matchday AND m.matchday <= $matchday
AND m.status IN (2,3,5,6) AND m.status IN (2,3,5,6)
GROUP BY t.team_id GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$table_ary = array(); $table_ary = array();
$points_ary = array(); $points_ary = array();
$ranks_ary = array(); $ranks_ary = array();
while( $row = $db->sql_fetchrow($result)) while( $row = $db->sql_fetchrow($result))
{ {
$table_ary[$row['team_id']] = $row; $table_ary[$row['team_id']] = $row;
$points_ary[$row['group_id']][$row['points']][]=$row['team_id']; $points_ary[$row['group_id']][$row['points']][]=$row['team_id'];
$ranks_ary[] = $row['team_id']; $ranks_ary[] = $row['team_id'];
} }
$last_group = ''; $last_group = '';
$rank = 0; $rank = 0;
$current_rank = 0; $current_rank = 0;
$last_goals = 0; $last_goals = 0;
$last_goals_againts = 0; $last_goals_againts = 0;
$last_points = 0; $last_points = 0;
foreach($points_ary as $group_id => $points) foreach($points_ary as $group_id => $points)
{ {
$data_table = true; $data_table = true;
if ($last_group != $group_id) if ($last_group != $group_id)
{ {
$last_group =$group_id; $last_group =$group_id;
$rank = 0; $rank = 0;
$last_goals = 0; $last_goals = 0;
$last_goals_againts = 0; $last_goals_againts = 0;
$last_points = 0; $last_points = 0;
$template->assign_block_vars('side_total', array( $template->assign_block_vars('side_total', array(
'GROUP' => sprintf($user->lang['GROUP']) . ' ' .$group_id, 'GROUP' => sprintf($user->lang['GROUP']) . ' ' .$group_id,
) )
); );
} }
foreach($points as $point => $teams) foreach($points as $point => $teams)
{ {
if(count($teams) > 1 AND $group_id != '') if(count($teams) > 1 AND $group_id != '')
{ {
// Compare teams with equal points and sort // Compare teams with equal points and sort
$teams = get_order_team_compare($teams, $season, $league, $group_id, $ranks_ary, $matchday); $teams = get_order_team_compare($teams, $season, $league, $group_id, $ranks_ary, $matchday);
} }
foreach($teams as $key => $team) foreach($teams as $key => $team)
{ {
$row = $table_ary[$team]; $row = $table_ary[$team];
$rank++; $rank++;
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
{ {
$current_rank = $rank . '.'; $current_rank = $rank . '.';
} }
else else
{ {
$current_rank = ''; $current_rank = '';
} }
$last_points = $row['points']; $last_points = $row['points'];
$last_goals = $row['goals']; $last_goals = $row['goals'];
$last_goals_againts = $row['goals_against']; $last_goals_againts = $row['goals_against'];
$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(
'RANK' => $current_rank, 'RANK' => $current_rank,
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'LOGO' => $logo, 'LOGO' => $logo,
'TEAM_ID' => $row['team_id'], 'TEAM_ID' => $row['team_id'],
'TEAM_SHORT' => $row['team_name_short'], 'TEAM_SHORT' => $row['team_name_short'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'],
'tid' => $row['team_id'], 'mode' => 'played')), 'tid' => $row['team_id'], 'mode' => 'played')),
'GAMES' => $row['matches'], 'GAMES' => $row['matches'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
) )
); );
} }
} }
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$template->assign_vars(array( $template->assign_vars(array(
'S_DISPLAY_SIDE_TABLE' => true, 'S_DISPLAY_SIDE_TABLE' => true,
'S_DATA_SIDE_TABLE' => $data_table, 'S_DATA_SIDE_TABLE' => $data_table,
) )
); );
} }
?>

View File

@@ -1,170 +1,162 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$data = false; $data = false;
$data_all = false; $data_all = false;
$rank = 0; $rank = 0;
$sql = 'SELECT $sql = 'SELECT
r.user_id, r.user_id,
u.username, u.username,
r.* r.*
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 season = $season WHERE season = $season
AND league = $league AND league = $league
ORDER BY r.points DESC"; ORDER BY r.points DESC";
$result = $db->sql_query_limit($sql, 20); $result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$data = true; $data = true;
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id']) if ($row['user_id'] == $user->data['user_id'])
{ {
$row_class = 'bg3 row_user'; $row_class = 'bg3 row_user';
} }
$template->assign_block_vars('top20', array( $template->assign_block_vars('top20', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'NAME' => $row['username'], 'NAME' => $row['username'],
'MATCHDAY' => $row['matchday'], 'MATCHDAY' => $row['matchday'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
'WIN' => $row['win'], 'WIN' => $row['win'],
'DIRECTHITS' => $row['correct_result'], 'DIRECTHITS' => $row['correct_result'],
'TENDENCIES' => $row['tendencies'] - $row['correct_result'], 'TENDENCIES' => $row['tendencies'] - $row['correct_result'],
'TOTAL' => $row['tendencies'], 'TOTAL' => $row['tendencies'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$rank = 0; $rank = 0;
$sql = 'SELECT $sql = 'SELECT
r.user_id, r.user_id,
u.username, u.username,
r.* r.*
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
ORDER BY r.points ASC"; ORDER BY r.points ASC";
$result = $db->sql_query_limit($sql, 20); $result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id']) if ($row['user_id'] == $user->data['user_id'])
{ {
$row_class = 'bg3 row_user'; $row_class = 'bg3 row_user';
} }
$template->assign_block_vars('flop20', array( $template->assign_block_vars('flop20', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'NAME' => $row['username'], 'NAME' => $row['username'],
'MATCHDAY' => $row['matchday'], 'MATCHDAY' => $row['matchday'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
'DIRECTHITS' => $row['correct_result'], 'DIRECTHITS' => $row['correct_result'],
'TENDENCIES' => $row['tendencies'] - $row['correct_result'], 'TENDENCIES' => $row['tendencies'] - $row['correct_result'],
'TOTAL' => $row['tendencies'], 'TOTAL' => $row['tendencies'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$rank = 0; $rank = 0;
$sql = 'SELECT $sql = 'SELECT
r.user_id, r.user_id,
u.username, u.username,
r.* r.*
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 league = $league WHERE league = $league
ORDER BY r.points DESC"; ORDER BY r.points DESC";
$result = $db->sql_query_limit($sql, 20); $result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$data_all = true; $data_all = true;
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id']) if ($row['user_id'] == $user->data['user_id'])
{ {
$row_class = 'bg3 row_user'; $row_class = 'bg3 row_user';
} }
$template->assign_block_vars('alltop20', array( $template->assign_block_vars('alltop20', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'NAME' => $row['username'], 'NAME' => $row['username'],
'SEASON' => $row['season'], 'SEASON' => $row['season'],
'MATCHDAY' => $row['matchday'], 'MATCHDAY' => $row['matchday'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
'WIN' => $row['win'], 'WIN' => $row['win'],
'DIRECTHITS' => $row['correct_result'], 'DIRECTHITS' => $row['correct_result'],
'TENDENCIES' => $row['tendencies'] - $row['correct_result'], 'TENDENCIES' => $row['tendencies'] - $row['correct_result'],
'TOTAL' => $row['tendencies'], 'TOTAL' => $row['tendencies'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$rank = 0; $rank = 0;
$sql = 'SELECT $sql = 'SELECT
r.user_id, r.user_id,
u.username, u.username,
COUNT(points) AS count_zero COUNT(points) AS count_zero
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.league = $league WHERE r.league = $league
AND r.points = 0 AND r.points = 0
GROUP BY r.user_id GROUP BY r.user_id
ORDER BY count_zero DESC"; ORDER BY count_zero DESC";
$result = $db->sql_query_limit($sql, 20); $result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id']) if ($row['user_id'] == $user->data['user_id'])
{ {
$row_class = 'bg3 row_user'; $row_class = 'bg3 row_user';
} }
$template->assign_block_vars('allflop20', array( $template->assign_block_vars('allflop20', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'NAME' => $row['username'], 'NAME' => $row['username'],
'COUNTZERO' => $row['count_zero'], 'COUNTZERO' => $row['count_zero'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$league_info = league_info($season, $league); $league_info = league_info($season, $league);
$sidename = sprintf($user->lang['STAT_POINTS']); $sidename = sprintf($user->lang['STAT_POINTS']);
$template->assign_vars(array( $template->assign_vars(array(
'S_DISPLAY_STAT_POINTS' => true, 'S_DISPLAY_STAT_POINTS' => true,
'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)), 'S_DATA_STAT_POINTS' => $data,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_KOEFF']), 'S_DATA_ALL_POINTS' => $data_all,
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'stat_results', 's' => $season, 'l' => $league, 'm' => $matchday)), 'SEASON' => $season,
'RIGHT_LINK' => sprintf($user->lang['STAT_RESULTS']) . ' &gt;', 'LEAGUE' => $league,
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_KOEFF']), )
'RIGHT_TITLE' => sprintf($user->lang['TITLE_STAT_RESULTS']), );
'S_DATA_STAT_POINTS' => $data,
'S_DATA_ALL_POINTS' => $data_all,
'SEASON' => $season,
'LEAGUE' => $league,
)
);
?>

View File

@@ -1,146 +1,138 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$data = false; $data = false;
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$rank = 0; $rank = 0;
// Select results and count // Select results and count
$sql = 'SELECT $sql = 'SELECT
COUNT(DISTINCT(m.match_no)) AS count_result, COUNT(DISTINCT(m.match_no)) AS count_result,
COUNT(m.match_no) AS count_bets, COUNT(m.match_no) AS count_bets,
m.goals_home, m.goals_home,
m.goals_guest, m.goals_guest,
SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest)
OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest)
OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0, 0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0) IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)
) )
) AS hits, ) AS hits,
SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest) SUM(IF((b.goals_home + 0 < b.goals_guest) <> (m.goals_home + 0 < m.goals_guest)
OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest) OR (b.goals_home = b.goals_guest) <> (m.goals_home = m.goals_guest)
OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest), OR (b.goals_home + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0, 0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1) IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
) )
) AS tendencies, ) AS tendencies,
' . select_points('m',true) . ' ' . select_points('m',true) . '
FROM ' . FOOTB_MATCHES . ' AS m FROM ' . FOOTB_MATCHES . ' AS m
LEFT JOIN ' . FOOTB_BETS . " AS b ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no) LEFT JOIN ' . FOOTB_BETS . " AS b ON (m.season = b.season AND m.league = b.league AND m.match_no = b.match_no)
WHERE m.season = $season WHERE m.season = $season
AND m.league = $league AND m.league = $league
AND b.goals_home <> '' AND b.goals_home <> ''
AND b.goals_guest <> '' AND b.goals_guest <> ''
AND (m.status IN (3,6)) AND (m.status IN (3,6))
AND m.matchday <= $matchday AND m.matchday <= $matchday
GROUP BY m.goals_home, m.goals_guest GROUP BY m.goals_home, m.goals_guest
ORDER BY count_bets DESC"; ORDER BY count_bets DESC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$data = true; $data = true;
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('result', array( $template->assign_block_vars('result', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'GOALS_HOME' => $row['goals_home'], 'GOALS_HOME' => $row['goals_home'],
'GOALS_GUEST' => $row['goals_guest'], 'GOALS_GUEST' => $row['goals_guest'],
'RESULTS' => $row['count_result'], 'RESULTS' => $row['count_result'],
'BETS' => $row['count_bets'], 'BETS' => $row['count_bets'],
'HITS' => $row['hits'], 'HITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'], 'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'], 'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
'AVERAGE' => round($row['points'] / $row['count_bets'],1), 'AVERAGE' => round($row['points'] / $row['count_bets'],1),
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Get goaldifferences by team // Get goaldifferences by team
$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 wins, 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 wins,
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, SUM(IF(goals_home = goals_guest, 1, 0)) AS draw,
SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > (goals_guest+2), 1, 0), IF((goals_home + 2) < goals_guest, 1, 0))) AS plus3, SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > (goals_guest+2), 1, 0), IF((goals_home + 2) < goals_guest, 1, 0))) AS plus3,
SUM(IF((m.team_id_home = t.team_id), IF(goals_home = (goals_guest+2), 1, 0), IF((goals_home + 2) = goals_guest, 1, 0))) AS plus2, SUM(IF((m.team_id_home = t.team_id), IF(goals_home = (goals_guest+2), 1, 0), IF((goals_home + 2) = goals_guest, 1, 0))) AS plus2,
SUM(IF((m.team_id_home = t.team_id), IF(goals_home = (goals_guest+1), 1, 0), IF((goals_home + 1) = goals_guest, 1, 0))) AS plus1, SUM(IF((m.team_id_home = t.team_id), IF(goals_home = (goals_guest+1), 1, 0), IF((goals_home + 1) = goals_guest, 1, 0))) AS plus1,
SUM(IF((m.team_id_home = t.team_id), IF((goals_home + 1) = goals_guest, 1, 0), IF(goals_home = (goals_guest + 1), 1, 0))) AS minus1, SUM(IF((m.team_id_home = t.team_id), IF((goals_home + 1) = goals_guest, 1, 0), IF(goals_home = (goals_guest + 1), 1, 0))) AS minus1,
SUM(IF((m.team_id_home = t.team_id), IF((goals_home + 2) = goals_guest, 1, 0), IF(goals_home = (goals_guest + 2), 1, 0))) AS minus2, SUM(IF((m.team_id_home = t.team_id), IF((goals_home + 2) = goals_guest, 1, 0), IF(goals_home = (goals_guest + 2), 1, 0))) AS minus2,
SUM(IF((m.team_id_home = t.team_id), IF((goals_home + 2) < goals_guest, 1, 0), IF(goals_home + 0 > (goals_guest + 2), 1, 0))) AS minus3, SUM(IF((m.team_id_home = t.team_id), IF((goals_home + 2) < goals_guest, 1, 0), IF(goals_home + 0 > (goals_guest + 2), 1, 0))) AS minus3,
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, ) AS points,
SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goal_diff, SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goal_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_get SUM(IF(m.team_id_home = t.team_id, goals_guest , goals_home)) AS goals_get
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 AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id)) 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))
WHERE t.season = $season WHERE t.season = $season
AND t.league = $league AND t.league = $league
AND m.season = $season AND m.season = $season
AND m.league = $league AND m.league = $league
AND m.status IN (3,6) AND m.status IN (3,6)
AND m.matchday <= $matchday AND m.matchday <= $matchday
GROUP BY t.team_id GROUP BY t.team_id
ORDER BY points DESC, goal_diff DESC, goals DESC"; ORDER BY points DESC, goal_diff DESC, goals DESC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$rank = 0; $rank = 0;
while($row = $db->sql_fetchrow($result)) while($row = $db->sql_fetchrow($result))
{ {
$rank++; $rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$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=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('points', array( $template->assign_block_vars('points', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'RANK' => $rank, 'RANK' => $rank,
'LOGO' => $logo, 'LOGO' => $logo,
'TEAM' => $row['team_name_short'], 'TEAM' => $row['team_name_short'],
'MATCHES' => $row['matches'], 'MATCHES' => $row['matches'],
'PLUS3' => $row['plus3'], 'PLUS3' => $row['plus3'],
'PLUS2' => $row['plus2'], 'PLUS2' => $row['plus2'],
'PLUS1' => $row['plus1'], 'PLUS1' => $row['plus1'],
'DRAW' => $row['draw'], 'DRAW' => $row['draw'],
'MINUS1' => $row['minus1'], 'MINUS1' => $row['minus1'],
'MINUS2' => $row['minus2'], 'MINUS2' => $row['minus2'],
'MINUS3' => $row['minus3'], 'MINUS3' => $row['minus3'],
'GOALS_DIFF' => $row['goal_diff'], 'GOALS_DIFF' => $row['goal_diff'],
'POINTS' => $row['points'], 'POINTS' => $row['points'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$sidename = sprintf($user->lang['STAT_RESULTS']); $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)), 'S_DATA_STAT_RESULTS' => $data,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['STAT_POINTS']), 'SEASON' => $season,
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), 'LEAGUE' => $league,
'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,
'SEASON' => $season,
'LEAGUE' => $league,
)
);
?>

View File

@@ -1,446 +1,482 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$data_table = false; $data_table = false;
$data_form = false; $data_form = false;
if ($matchday > 5) if ($matchday > 5)
{ {
$form_from = $matchday - 5; $form_from = $matchday - 5;
} }
else else
{ {
$form_from = 1; $form_from = 1;
} }
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$sql = 'SELECT * $sql = 'SELECT *
FROM ' . FOOTB_LEAGUES . " FROM ' . FOOTB_LEAGUES . "
WHERE season = $season WHERE season = $season
AND league = $league"; AND league = $league";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result); $row = $db->sql_fetchrow($result);
$league_type = $row['league_type']; $league_type = $row['league_type'];
$db->sql_freeresult($result); $db->sql_freeresult($result);
$text_form = sprintf($user->lang['TABLE_FORM_FROM'], $form_from); $text_form = sprintf($user->lang['TABLE_FORM_FROM'], $form_from);
$rank = 0; $rank = 0;
// Get table-information // Get 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))
SUM(IF(m.team_id_home = t.team_id, + 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,
IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)), SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 < goals_guest, 1, 0), IF(goals_home + 0 > goals_guest, 1, 0)))
IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0)) + IFNULL((SELECT SUM(c.lost) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday),0)AS lost,
) SUM(IF(m.team_id_home = t.team_id,
) - IF(t.team_id = 20 AND t.season = 2011 AND $matchday > 7, 2, 0) AS points, IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)),
SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goals_diff, IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))
SUM(IF(m.team_id_home = t.team_id, goals_home , goals_guest)) AS goals, )
SUM(IF(m.team_id_home = t.team_id, goals_guest , goals_home)) AS goals_against ) + IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday), 0)
FROM " . FOOTB_TEAMS . ' AS t + 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)
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league - IF(t.team_id = 20 AND t.season = 2011 AND $matchday > 7, 2, 0) AS points,
AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goals_diff,
WHERE t.season = $season SUM(IF(m.team_id_home = t.team_id, goals_home , goals_guest)) AS goals,
AND t.league = $league SUM(IF(m.team_id_home = t.team_id, goals_guest , goals_home)) AS goals_against,
AND m.matchday <= $matchday 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
AND m.status IN (2,3,5,6) FROM " . FOOTB_TEAMS . ' AS t
GROUP BY t.team_id LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; 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
$result = $db->sql_query($sql); AND t.league = $league
AND m.matchday <= $matchday
$table_ary = array(); AND m.status IN (2,3,5,6)
$points_ary = array(); AND m.show_table = 0
$ranks_ary = array(); GROUP BY t.team_id
$rank = 0; ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
while( $row = $db->sql_fetchrow($result))
{ $result = $db->sql_query($sql);
$rank++;
$table_ary[$row['team_id']] = $row; $table_ary = array();
$points_ary[$row['group_id']][$row['points']][]=$row['team_id']; $points_ary = array();
$ranks_ary[] = $row['team_id']; $ranks_ary = array();
} $rank = 0;
while( $row = $db->sql_fetchrow($result))
$last_group = ''; {
$rank = 0; $rank++;
$current_rank = 0; $table_ary[$row['team_id']] = $row;
$last_goals = 0; $points_ary[$row['group_id']][$row['points']][]=$row['team_id'];
$last_goals_againts = 0; $ranks_ary[] = $row['team_id'];
$last_points = 0; }
foreach($points_ary as $group_id => $points)
{ $last_group = '';
$data_table = true; $rank = 0;
if ($last_group != $group_id) $current_rank = 0;
{ $last_goals = 0;
$last_group =$group_id; $last_goals_againts = 0;
$rank = 0; $last_points = 0;
$last_goals = 0; foreach($points_ary as $group_id => $points)
$last_goals_againts = 0; {
$last_points = 0; $data_table = true;
$template->assign_block_vars('total', array( if ($last_group != $group_id)
'GROUP' => sprintf($user->lang['GROUP']) . ' ' .$group_id, {
) $last_group =$group_id;
); $rank = 0;
} $last_goals = 0;
$last_goals_againts = 0;
foreach($points as $point => $teams) $last_points = 0;
{ $template->assign_block_vars('total', array(
if(count($teams) > 1 AND $group_id != '') 'GROUP' => sprintf($user->lang['GROUP']) . ' ' .$group_id,
{ )
// Compare teams with equal points and sort );
$teams = get_order_team_compare($teams, $season, $league, $group_id, $ranks_ary, $matchday); }
}
foreach($teams as $key => $team) foreach($points as $point => $teams)
{ {
$row = $table_ary[$team]; if(count($teams) > 1 AND $group_id != '')
$rank++; {
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) // Compare teams with equal points and sort
{ $teams = get_order_team_compare($teams, $season, $league, $group_id, $ranks_ary, $matchday);
$current_rank = $rank . '.'; }
} foreach($teams as $key => $team)
else {
{ $row = $table_ary[$team];
$current_rank = ''; $rank++;
} if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
$last_points = $row['points']; {
$last_goals = $row['goals']; $current_rank = $rank . '.';
$last_goals_againts = $row['goals_against']; }
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; else
if ($row['team_symbol'] <> '') {
{ $current_rank = '';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; }
} $last_points = $row['points'];
else $last_goals = $row['goals'];
{ $last_goals_againts = $row['goals_against'];
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
} if ($row['team_symbol'] <> '')
{
$template->assign_block_vars('total', array( $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
'RANK' => $current_rank, }
'ROW_CLASS' => $row_class, else
'LOGO' => $logo, {
'TEAM_ID' => $row['team_id'], $logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
'TEAM' => $row['team_name'], }
'TEAM_SHORT' => $row['team_name_short'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], $template->assign_block_vars('total', array(
'tid' => $row['team_id'], 'mode' => 'played')), 'RANK' => $current_rank,
'GAMES' => $row['matches'], 'ROW_CLASS' => $row_class,
'WIN' => $row['win'], 'LOGO' => $logo,
'DRAW' => $row['draw'], 'TEAM_ID' => $row['team_id'],
'LOST' => $row['lost'], 'TEAM' => $row['team_name'],
'GOALS' => $row['goals'], 'TEAM_SHORT' => $row['team_name_short'],
'GOALS_AGAINST' => $row['goals_against'], 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'],
'GOALS_DIFF' => $row['goals_diff'], 'tid' => $row['team_id'], 'mode' => 'played')),
'POINTS' => $row['points'], 'GAMES' => $row['matches'],
) 'WIN' => $row['win'],
); 'DRAW' => $row['draw'],
} 'LOST' => $row['lost'],
} 'GOALS' => $row['goals'],
} 'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
$db->sql_freeresult($result); 'BONUS' => round($row['bonus'],2),
$rank = 0; 'POINTS' => round($row['points'],2),
// Get form-table-information )
$sql = 'SELECT );
t.*, }
SUM(1) AS matches, }
SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS win, }
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw,
SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 < goals_guest, 1, 0), IF(goals_home + 0 > goals_guest, 1, 0))) AS lost, $db->sql_freeresult($result);
SUM(IF(m.team_id_home = t.team_id, $rank = 0;
IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)), // Get form-table-information
IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0)) $sql = "SELECT
) t.*,
) AS points, SUM(1) AS matches,
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), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0)))
SUM(IF(m.team_id_home = t.team_id, goals_home, goals_guest)) AS goals, + IFNULL((SELECT SUM(c.win) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.matchday >= $form_from),0)AS win,
SUM(IF(m.team_id_home = t.team_id, goals_guest, goals_home)) AS goals_against SUM(IF(goals_home = goals_guest, 1, 0))
FROM ' . FOOTB_TEAMS . ' AS t + IFNULL((SELECT SUM(c.draw) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.matchday >= $form_from),0)AS draw,
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 < goals_guest, 1, 0), IF(goals_home + 0 > goals_guest, 1, 0)))
AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) + IFNULL((SELECT SUM(c.lost) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.matchday >= $form_from),0)AS lost,
WHERE t.season = $season SUM(IF(m.team_id_home = t.team_id,
AND t.league = $league IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)),
AND m.matchday >= $form_from IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))
AND m.status IN (2, 3,5,6) )
GROUP BY t.team_id ) + IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday AND b.matchday >= $form_from),0)
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; + IFNULL((SELECT SUM(c.points) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.matchday >= $form_from),0)
- IF(t.team_id = 20 AND t.season = 2011 AND $matchday > 7, 2, 0) AS points,
$result = $db->sql_query($sql); SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goals_diff,
$last_group = ''; SUM(IF(m.team_id_home = t.team_id, goals_home , goals_guest)) AS goals,
$current_rank = 0; SUM(IF(m.team_id_home = t.team_id, goals_guest , goals_home)) AS goals_against,
$last_goals = 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 b.matchday >= $form_from),0) AS bonus
$last_goals_againts = 0; FROM " . FOOTB_TEAMS . ' AS t
$last_points = 0; LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league
while($row = $db->sql_fetchrow($result)) 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
if ($last_group != $row['group_id']) AND t.league = $league
{ AND m.matchday >= $form_from
$last_group = $row['group_id']; AND m.status IN (2, 3,5,6)
$rank = 0; AND m.show_table = 0
$last_goals = 0; GROUP BY t.team_id
$last_goals_againts = 0; ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
$last_points = 0;
$template->assign_block_vars('form', array( $result = $db->sql_query($sql);
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], $last_group = '';
) $current_rank = 0;
); $last_goals = 0;
} $last_goals_againts = 0;
if ($league_type != 2 OR $row['group_id'] != '') $last_points = 0;
{ while($row = $db->sql_fetchrow($result))
$data_form = true; {
$rank++; if ($last_group != $row['group_id'])
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) {
{ $last_group = $row['group_id'];
$current_rank = $rank . '.'; $rank = 0;
} $last_goals = 0;
else $last_goals_againts = 0;
{ $last_points = 0;
$current_rank = ''; $template->assign_block_vars('form', array(
} 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
$last_points = $row['points']; )
$last_goals = $row['goals']; );
$last_goals_againts = $row['goals_against']; }
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; if ($league_type != 2 OR $row['group_id'] != '')
if ($row['team_symbol'] <> '') {
{ $data_form = true;
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; $rank++;
} if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
else {
{ $current_rank = $rank . '.';
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; }
} else
{
$template->assign_block_vars('form', array( $current_rank = '';
'RANK' => $current_rank, }
'ROW_CLASS' => $row_class, $last_points = $row['points'];
'LOGO' => $logo, $last_goals = $row['goals'];
'TEAM_ID' => $row['team_id'], $last_goals_againts = $row['goals_against'];
'TEAM' => $row['team_name'], $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
'TEAM_SHORT' => $row['team_name_short'], if ($row['team_symbol'] <> '')
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], {
'tid' => $row['team_id'], 'mode' => 'rest')), $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
'GAMES' => $row['matches'], }
'WIN' => $row['win'], else
'DRAW' => $row['draw'], {
'LOST' => $row['lost'], $logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
'GOALS' => $row['goals'], }
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'], $template->assign_block_vars('form', array(
'POINTS' => $row['points'], 'RANK' => $current_rank,
) 'ROW_CLASS' => $row_class,
); 'LOGO' => $logo,
} 'TEAM_ID' => $row['team_id'],
} 'TEAM' => $row['team_name'],
$db->sql_freeresult($result); 'TEAM_SHORT' => $row['team_name_short'],
$rank = 0; 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'],
// Get home-table-information 'tid' => $row['team_id'], 'mode' => 'rest')),
$sql = 'SELECT 'GAMES' => $row['matches'],
t.*, 'WIN' => $row['win'],
SUM(1) AS matches, 'DRAW' => $row['draw'],
SUM(IF(goals_home + 0 > goals_guest, 1, 0)) AS win, 'LOST' => $row['lost'],
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, 'GOALS' => $row['goals'],
SUM(IF(goals_home + 0 < goals_guest, 1, 0)) AS lost, 'GOALS_AGAINST' => $row['goals_against'],
SUM(IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) AS points, 'GOALS_DIFF' => $row['goals_diff'],
SUM(goals_home - goals_guest) AS goals_diff, 'BONUS' => round($row['bonus'],2),
SUM(goals_home) AS goals, 'POINTS' => round($row['points'],2),
SUM(goals_guest) AS goals_against )
FROM ' . FOOTB_TEAMS . ' AS t );
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league }
AND m.team_id_home = t.team_id AND m.group_id = t.group_id) }
WHERE t.season = $season $db->sql_freeresult($result);
AND t.league = $league $rank = 0;
AND m.matchday <= $matchday // Get home-table-information
AND m.status IN (2, 3,5,6) $sql = "SELECT
GROUP BY t.team_id t.*,
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; SUM(1) AS matches,
SUM(IF(goals_home + 0 > goals_guest, 1, 0))
$result = $db->sql_query($sql); + 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,
$last_group = ''; SUM(IF(goals_home = goals_guest, 1, 0))
$current_rank = 0; + IFNULL((SELECT SUM(c.draw) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 1 ),0)AS draw,
$last_goals = 0; SUM(IF(goals_home + 0 < goals_guest, 1, 0))
$last_goals_againts = 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,
$last_points = 0; 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)
while($row = $db->sql_fetchrow($result)) + 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,
if ($last_group != $row['group_id']) SUM(goals_home) AS goals,
{ SUM(goals_guest) AS goals_against,
$last_group = $row['group_id']; 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
$rank = 0; FROM " . FOOTB_TEAMS . ' AS t
$last_goals = 0; LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league
$last_goals_againts = 0; AND m.team_id_home = t.team_id AND m.group_id = t.group_id)
$last_points = 0; WHERE t.season = $season
$template->assign_block_vars('home', array( AND t.league = $league
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], AND m.matchday <= $matchday
) AND m.status IN (2, 3,5,6)
); AND m.show_table = 0
} GROUP BY t.team_id
if ($league_type != 2 OR $row['group_id'] != '') ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
{
$rank++; $result = $db->sql_query($sql);
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) $last_group = '';
{ $current_rank = 0;
$current_rank = $rank . '.'; $last_goals = 0;
} $last_goals_againts = 0;
else $last_points = 0;
{ while($row = $db->sql_fetchrow($result))
$current_rank = ''; {
} if ($last_group != $row['group_id'])
$last_points = $row['points']; {
$last_goals = $row['goals']; $last_group = $row['group_id'];
$last_goals_againts = $row['goals_against']; $rank = 0;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $last_goals = 0;
if ($row['team_symbol'] <> '') $last_goals_againts = 0;
{ $last_points = 0;
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; $template->assign_block_vars('home', array(
} 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
else )
{ );
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; }
} if ($league_type != 2 OR $row['group_id'] != '')
{
$template->assign_block_vars('home', array( $rank++;
'RANK' => $current_rank, if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
'ROW_CLASS' => $row_class, {
'LOGO' => $logo, $current_rank = $rank . '.';
'TEAM_ID' => $row['team_id'], }
'TEAM' => $row['team_name'], else
'TEAM_SHORT' => $row['team_name_short'], {
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], $current_rank = '';
'tid' => $row['team_id'], 'mode' => 'home')), }
'GAMES' => $row['matches'], $last_points = $row['points'];
'WIN' => $row['win'], $last_goals = $row['goals'];
'DRAW' => $row['draw'], $last_goals_againts = $row['goals_against'];
'LOST' => $row['lost'], $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
'GOALS' => $row['goals'], if ($row['team_symbol'] <> '')
'GOALS_AGAINST' => $row['goals_against'], {
'GOALS_DIFF' => $row['goals_diff'], $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
'POINTS' => $row['points'], }
) else
); {
} $logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
} }
$db->sql_freeresult($result);
$rank = 0; $template->assign_block_vars('home', array(
// Get away-table-information 'RANK' => $current_rank,
$sql = 'SELECT 'ROW_CLASS' => $row_class,
t.*, 'LOGO' => $logo,
SUM(1) AS matches, 'TEAM_ID' => $row['team_id'],
SUM(IF(goals_home + 0 < goals_guest, 1, 0)) AS win, 'TEAM' => $row['team_name'],
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, 'TEAM_SHORT' => $row['team_name_short'],
SUM(IF(goals_home + 0 > goals_guest, 1, 0)) AS lost, 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'],
SUM(IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) AS points, 'tid' => $row['team_id'], 'mode' => 'home')),
SUM(goals_guest - goals_home) AS goals_diff, 'GAMES' => $row['matches'],
SUM(goals_guest) AS goals, 'WIN' => $row['win'],
SUM(goals_home) AS goals_against 'DRAW' => $row['draw'],
FROM ' . FOOTB_TEAMS . ' AS t 'LOST' => $row['lost'],
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league 'GOALS' => $row['goals'],
AND m.team_id_guest = t.team_id AND m.group_id = t.group_id) 'GOALS_AGAINST' => $row['goals_against'],
WHERE t.season = $season 'GOALS_DIFF' => $row['goals_diff'],
AND t.league = $league 'BONUS' => round($row['bonus'],2),
AND m.matchday <= $matchday 'POINTS' => round($row['points'],2),
AND m.status IN (2, 3,5,6) )
GROUP BY t.team_id );
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; }
}
$result = $db->sql_query($sql); $db->sql_freeresult($result);
$last_group = ''; $rank = 0;
$current_rank = 0; // Get away-table-information
$last_goals = 0; $sql = "SELECT
$last_goals_againts = 0; t.*,
$last_points = 0; SUM(1) AS matches,
while($row = $db->sql_fetchrow($result)) SUM(IF(goals_home + 0 < goals_guest, 1, 0))
{ + IFNULL((SELECT SUM(c.win) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 0 ),0)AS win,
if ($last_group != $row['group_id']) SUM(IF(goals_home = goals_guest, 1, 0))
{ + IFNULL((SELECT SUM(c.draw) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday AND c.home = 0 ),0)AS draw,
$last_group = $row['group_id']; SUM(IF(goals_home + 0 > goals_guest, 1, 0))
$rank = 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,
$last_goals = 0; 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)
$last_goals_againts = 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,
$last_points = 0; SUM(goals_guest - goals_home) AS goals_diff,
$template->assign_block_vars('away', array( SUM(goals_guest) AS goals,
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], SUM(goals_home) AS goals_against,
) IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND home = '0'),0) AS bonus
); FROM " . FOOTB_TEAMS . ' AS t
} LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league
if ($league_type != 2 OR $row['group_id'] != '') AND m.team_id_guest = t.team_id AND m.group_id = t.group_id)
{ WHERE t.season = $season
$rank++; AND t.league = $league
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) AND m.matchday <= $matchday
{ AND m.status IN (2, 3,5,6)
$current_rank = $rank . '.'; AND m.show_table = 0
} GROUP BY t.team_id
else ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
{
$current_rank = ''; $result = $db->sql_query($sql);
} $last_group = '';
$last_points = $row['points']; $current_rank = 0;
$last_goals = $row['goals']; $last_goals = 0;
$last_goals_againts = $row['goals_against']; $last_goals_againts = 0;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $last_points = 0;
if ($row['team_symbol'] <> '') while($row = $db->sql_fetchrow($result))
{ {
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; if ($last_group != $row['group_id'])
} {
else $last_group = $row['group_id'];
{ $rank = 0;
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; $last_goals = 0;
} $last_goals_againts = 0;
$last_points = 0;
$template->assign_block_vars('away', array( $template->assign_block_vars('away', array(
'RANK' => $current_rank, 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
'ROW_CLASS' => $row_class, )
'LOGO' => $logo, );
'TEAM_ID' => $row['team_id'], }
'TEAM' => $row['team_name'], if ($league_type != 2 OR $row['group_id'] != '')
'TEAM_SHORT' => $row['team_name_short'], {
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], $rank++;
'tid' => $row['team_id'], 'mode' => 'away')), if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
'GAMES' => $row['matches'], {
'WIN' => $row['win'], $current_rank = $rank . '.';
'DRAW' => $row['draw'], }
'LOST' => $row['lost'], else
'GOALS' => $row['goals'], {
'GOALS_AGAINST' => $row['goals_against'], $current_rank = '';
'GOALS_DIFF' => $row['goals_diff'], }
'POINTS' => $row['points'], $last_points = $row['points'];
) $last_goals = $row['goals'];
); $last_goals_againts = $row['goals_against'];
} $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
} if ($row['team_symbol'] <> '')
{
$db->sql_freeresult($result); $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$sidename = sprintf($user->lang['TABLE']); }
$template->assign_vars(array( else
'S_DISPLAY_TABLE' => true, {
'S_SIDENAME' => $sidename, $logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
'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)), $template->assign_block_vars('away', array(
'RIGHT_LINK' => sprintf($user->lang['RANK_MATCHDAY']) . ' &gt;', 'RANK' => $current_rank,
'LEFT_TITLE' => sprintf($user->lang['TITLE_RESULTS']), 'ROW_CLASS' => $row_class,
'RIGHT_TITLE' => sprintf($user->lang['TITLE_RANK_MATCHDAY']), 'LOGO' => $logo,
'S_DATA_TABLE' => $data_table, 'TEAM_ID' => $row['team_id'],
'S_DATA_FORM' => $data_form, 'TEAM' => $row['team_name'],
'SEASON' => $season, 'TEAM_SHORT' => $row['team_name_short'],
'LEAGUE' => $league, 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'],
'TEXT_FORM' => $text_form, 'tid' => $row['team_id'], 'mode' => 'away')),
) 'GAMES' => $row['matches'],
); 'WIN' => $row['win'],
'DRAW' => $row['draw'],
?> 'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'BONUS' => round($row['bonus'],2),
'POINTS' => round($row['points'],2),
)
);
}
}
if($league > 50)
{
// Activate bonus coloumn only for tippers.
$data_bns = true;
} else {
$data_bns = false;
}
if($side == 'table') {
$display_table_menu = true;
} else {
$display_table_menu = false;
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['TABLE']);
$template->assign_vars(array(
'S_DISPLAY_TABLE' => true,
'S_DISPLAY_TABLE_MENU' => $display_table_menu,
'S_SIDENAME' => $sidename,
'S_DATA_TABLE' => $data_table,
'S_DATA_FORM' => $data_form,
'SEASON' => $season,
'LEAGUE' => $league,
'TEXT_FORM' => $text_form,
'S_DATA_BNS' => $data_bns,
)
);

View File

@@ -1,23 +1,21 @@
<?php <?php
/** /**
* *
* @package Football * @package Football
* @version $Id: under_construction.php 1 2010-05-17 22:09:43Z football $ * @version $Id: under_construction.php 1 2010-05-17 22:09:43Z football $
* @copyright (c) 2010 football (http://football.bplaced.net) * @copyright (c) 2010 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* *
*/ */
if ( !defined('IN_PHPBB') OR !defined('IN_FOOTBALL') ) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
$sidename = sprintf($user->lang['UNDER_CONSTRUCTION']); $sidename = sprintf($user->lang['UNDER_CONSTRUCTION']);
$template->assign_vars(array( $template->assign_vars(array(
'S_SIDENAME' => $sidename, 'S_SIDENAME' => $sidename,
'S_DISPLAY_UNDER_CONSTRUCTION' => true, 'S_DISPLAY_UNDER_CONSTRUCTION' => true,
) )
); );
?>

View File

@@ -1,297 +1,300 @@
<?php <?php
/** /**
* *
* @package phpBB Extension - Football Football * @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net) * @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
// Can this user view Prediction Leagues pages? if (!defined('IN_PHPBB'))
if (!$config['football_guest_view']) {
{ exit;
if ($user->data['user_id'] == ANONYMOUS) }
{
trigger_error('NO_GUEST_VIEW'); // Can this user view Prediction Leagues pages?
} if (!$config['football_guest_view'])
} {
if (!$config['football_user_view']) if ($user->data['user_id'] == ANONYMOUS)
{ {
// Only Prediction League member should see this page trigger_error('NO_GUEST_VIEW');
// Check Prediction League authorisation }
if ( !$this->auth->acl_get('u_use_football') ) }
{ if (!$config['football_user_view'])
trigger_error('NO_AUTH_VIEW'); {
} // Only Prediction League member should see this page
} // Check Prediction League authorisation
if ( !$this->auth->acl_get('u_use_football') )
// Football disabled? {
if ($config['football_disable']) trigger_error('NO_AUTH_VIEW');
{ }
$message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; }
trigger_error($message);
} // Football disabled?
if ($config['football_disable'])
$mode = $this->request->variable('mode', ''); {
$season = $this->request->variable('s', 0); $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED';
$league = $this->request->variable('l', 0); trigger_error($message);
$team_id = $this->request->variable('tid', 0); }
switch($mode) $mode = $this->request->variable('mode', '');
{ $season = $this->request->variable('s', 0);
case 'played': $league = $this->request->variable('l', 0);
$mode_desc = sprintf($user->lang['PLAYED_MATCHES']); $team_id = $this->request->variable('tid', 0);
$where = ' AND m.status IN (3,6) ';
$data_results = true; switch($mode)
break; {
case 'rest': case 'played':
$mode_desc = sprintf($user->lang['REST_MATCHES']); $mode_desc = sprintf($user->lang['PLAYED_MATCHES']);
$where = ' AND m.status IN (0,1,2,4,5) '; $where = ' AND m.status IN (3,6) ';
$data_results = false; $data_results = true;
break; break;
case 'home': case 'rest':
$mode_desc = sprintf($user->lang['HOME_MATCHES']); $mode_desc = sprintf($user->lang['REST_MATCHES']);
$where = " AND m.team_id_home = $team_id AND m.status IN (3,6) "; $where = ' AND m.status IN (0,1,2,4,5) ';
$data_results = true; $data_results = false;
break; break;
case 'away': case 'home':
$mode_desc = sprintf($user->lang['AWAY_MATCHES']); $mode_desc = sprintf($user->lang['HOME_MATCHES']);
$where = " AND m.team_id_guest = $team_id AND m.status IN (3,6) "; $where = " AND m.team_id_home = $team_id AND m.status IN (3,6) ";
$data_results = true; $data_results = true;
break; break;
// ALL is Default case 'away':
default: $mode_desc = sprintf($user->lang['AWAY_MATCHES']);
$mode_desc = sprintf($user->lang['ALL_MATCHES']); $where = " AND m.team_id_guest = $team_id AND m.status IN (3,6) ";
$where = ''; $data_results = true;
$data_results = true; break;
break; // ALL is Default
} default:
$mode_desc = sprintf($user->lang['ALL_MATCHES']);
// Check parms $where = '';
$error_message = ''; $data_results = true;
if (!$season OR !$league OR !$team_id) break;
{ }
$data_plan = false;
if (!$season) // Check parms
{ $error_message = '';
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />'; if (!$season OR !$league OR !$team_id)
} {
if (!$league) $data_plan = false;
{ if (!$season)
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />'; {
} $error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
if (!$team_id) }
{ if (!$league)
$error_message .= sprintf($user->lang['NO_TEAM_ID']) . '<br />'; {
} $error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
} }
else if (!$team_id)
{ {
$data_group = false; $error_message .= sprintf($user->lang['NO_TEAM_ID']) . '<br />';
$lang_dates = $user->lang['datetime']; }
}
else
// Calculate matches and bets of matchday {
$sql = "SELECT $data_group = false;
IF(m.team_id_home = $team_id, 'H', 'A') AS match_place, $lang_dates = $user->lang['datetime'];
IF(((m.status=3) OR (m.status=6)),
IF(m.team_id_home = $team_id,
IF(m.goals_home + 0 > m.goals_guest, 'match_win', IF(m.goals_home = m.goals_guest, 'match_draw', 'match_lost')), // Calculate matches and bets of matchday
IF(m.goals_home + 0 < m.goals_guest, 'match_win', IF(m.goals_home = m.goals_guest, 'match_draw', 'match_lost'))), $sql = "SELECT
'') AS match_style, IF(m.team_id_home = $team_id, 'H', 'A') AS match_place,
m.match_no, IF(((m.status=3) OR (m.status=6)),
m.matchday, IF(m.team_id_home = $team_id,
m.status, IF(m.goals_home + 0 > m.goals_guest, 'match_win', IF(m.goals_home = m.goals_guest, 'match_draw', 'match_lost')),
m.group_id, IF(m.goals_home + 0 < m.goals_guest, 'match_win', IF(m.goals_home = m.goals_guest, 'match_draw', 'match_lost'))),
t1.team_symbol AS home_symbol, '') AS match_style,
t2.team_symbol AS guest_symbol, m.match_no,
t1.team_id AS home_id, m.matchday,
t2.team_id AS guest_id, m.status,
t1.team_name AS home_name, m.group_id,
t2.team_name AS guest_name, t1.team_symbol AS home_symbol,
t1.team_name_short AS home_short, t2.team_symbol AS guest_symbol,
t2.team_name_short AS guest_short, t1.team_id AS home_id,
m.goals_home, t2.team_id AS guest_id,
m.goals_guest, t1.team_name AS home_name,
CONCAT( t2.team_name AS guest_name,
CASE DATE_FORMAT(m.match_datetime,'%w') t1.team_name_short AS home_short,
WHEN 0 THEN '" . $lang_dates['Sun'] . "' t2.team_name_short AS guest_short,
WHEN 1 THEN '" . $lang_dates['Mon'] . "' m.goals_home,
WHEN 2 THEN '" . $lang_dates['Tue'] . "' m.goals_guest,
WHEN 3 THEN '" . $lang_dates['Wed'] . "' CONCAT(
WHEN 4 THEN '" . $lang_dates['Thu'] . "' CASE DATE_FORMAT(m.match_datetime,'%w')
WHEN 5 THEN '" . $lang_dates['Fri'] . "' WHEN 0 THEN '" . $lang_dates['Sun'] . "'
WHEN 6 THEN '" . $lang_dates['Sat'] . "' WHEN 1 THEN '" . $lang_dates['Mon'] . "'
ELSE 'Error' END, WHEN 2 THEN '" . $lang_dates['Tue'] . "'
DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i') WHEN 3 THEN '" . $lang_dates['Wed'] . "'
) AS match_time WHEN 4 THEN '" . $lang_dates['Thu'] . "'
FROM " . FOOTB_MATCHES . ' AS m WHEN 5 THEN '" . $lang_dates['Fri'] . "'
LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id=m.team_id_home) WHEN 6 THEN '" . $lang_dates['Sat'] . "'
LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id=m.team_id_guest) ELSE 'Error' END,
WHERE m.season = $season DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i')
AND m.league = $league ) AS match_time
AND (m.team_id_home = $team_id OR m.team_id_guest = $team_id) FROM " . FOOTB_MATCHES . ' AS m
$where LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id=m.team_id_home)
GROUP BY m.match_no LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id=m.team_id_guest)
ORDER BY m.match_datetime ASC, m.match_no ASC"; WHERE m.season = $season
$result = $db->sql_query($sql); AND m.league = $league
if ($row = $db->sql_fetchrow($result)) AND (m.team_id_home = $team_id OR m.team_id_guest = $team_id)
{ $where
$data_plan = true; GROUP BY m.match_no
$matchnumber = 0; ORDER BY m.match_datetime ASC, m.match_no ASC";
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true)); $result = $db->sql_query($sql);
do if ($row = $db->sql_fetchrow($result))
{ {
$matchnumber++ ; $data_plan = true;
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $matchnumber = 0;
$display_link = true; $ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$homelogo = $row['home_symbol']; do
$guestlogo = $row['guest_symbol']; {
if ($homelogo <> '') $matchnumber++ ;
{ $row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ; $display_link = true;
} $homelogo = $row['home_symbol'];
else $guestlogo = $row['guest_symbol'];
{ if ($homelogo <> '')
$logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; {
} $logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ;
if ($guestlogo <> '') }
{ else
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ; {
} $logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
else }
{ if ($guestlogo <> '')
$logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; {
} $logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ;
}
if ($row['group_id'] == '') else
{ {
$group_id = '&nbsp;'; $logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
} }
else
{ if ($row['group_id'] == '')
$data_group = true; {
$group_id = $row['group_id']; $group_id = '&nbsp;';
} }
else
if ($row['match_place'] == 'H') {
{ $data_group = true;
$color_home = $row['match_style']; $group_id = $row['group_id'];
$color_guest = ''; }
}
else if ($row['match_place'] == 'H')
{ {
$color_home = ''; $color_home = $row['match_style'];
$color_guest = $row['match_style']; $color_guest = '';
} }
$color_goals = $row['match_style']; else
{
$template->assign_block_vars('match', array( $color_home = '';
'ROW_CLASS' => $row_class, $color_guest = $row['match_style'];
'MATCH_TIME' => $row['match_time'], }
'GROUP' => $group_id, $color_goals = $row['match_style'];
'LOGO_HOME' => $logoH,
'LOGO_GUEST' => $logoG, $template->assign_block_vars('match', array(
'HOME_NAME' => $row['home_short'], 'ROW_CLASS' => $row_class,
'GUEST_NAME' => $row['guest_short'], 'MATCH_TIME' => $row['match_time'],
'GOALS_HOME' => ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'], 'GROUP' => $group_id,
'GOALS_GUEST' => ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'], 'LOGO_HOME' => $logoH,
'COLOR_HOME' => $color_home, 'LOGO_GUEST' => $logoG,
'COLOR_GUEST' => $color_guest, 'HOME_NAME' => $row['home_short'],
'COLOR_GOALS' => $color_goals, 'GUEST_NAME' => $row['guest_short'],
) 'GOALS_HOME' => ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'],
); 'GOALS_GUEST' => ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'],
} 'COLOR_HOME' => $color_home,
while ($row = $db->sql_fetchrow($result)); 'COLOR_GUEST' => $color_guest,
$db->sql_freeresult($result); 'COLOR_GOALS' => $color_goals,
} )
else );
{ }
$data_plan = false; while ($row = $db->sql_fetchrow($result));
} $db->sql_freeresult($result);
}
$season_info = season_info($season); else
if (sizeof($season_info) == 0) {
{ $data_plan = false;
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />'; }
$season_name = '';
} $season_info = season_info($season);
else if (sizeof($season_info) == 0)
{ {
$season_name = $season_info["season_name"]; $error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
$season_name = '';
$league_info = league_info($season, $league); }
if (sizeof($league_info) == 0) else
{ {
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />'; $season_name = $season_info["season_name"];
$league_name = '';
$league_info = league_info($season, $league);
} if (sizeof($league_info) == 0)
else {
{ $error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
$league_name = $league_info["league_name"]; $league_name = '';
$team_info = team_info($season, $league, $team_id); }
if (sizeof($team_info) == 0) else
{ {
$error_message .= sprintf($user->lang['NO_TEAM_ID']) . '<br />'; $league_name = $league_info["league_name"];
$team_name = '';
$logo = ''; $team_info = team_info($season, $league, $team_id);
} if (sizeof($team_info) == 0)
else {
{ $error_message .= sprintf($user->lang['NO_TEAM_ID']) . '<br />';
$team_name = $team_info["team_name"]; $team_name = '';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $team_info["team_symbol"] . "\" alt=\"" . $team_info["team_symbol"] . "\" width=\"28\" height=\"28\"/>" ; $logo = '';
} }
} else
} {
} $team_name = $team_info["team_name"];
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $team_info["team_symbol"] . "\" alt=\"" . $team_info["team_symbol"] . "\" width=\"28\" height=\"28\"/>" ;
$sidename = sprintf($user->lang['PLAN']); }
if ($data_plan) }
{ }
$template->assign_vars(array( }
'S_SIDENAME' => $sidename,
'S_DATA_PLAN' => $data_plan, $sidename = sprintf($user->lang['PLAN']);
'S_DATA_GROUP' => $data_group, if ($data_plan)
'S_ERROR_MESSAGE' => $error_message, {
'MODE_DESC' => $mode_desc, $template->assign_vars(array(
'LOGO' => $logo, 'S_SIDENAME' => $sidename,
'TEAM' => $team_name, 'S_DATA_PLAN' => $data_plan,
'SEASON' => $season_name, 'S_DATA_GROUP' => $data_group,
'LEAGUE' => $league_name, 'S_ERROR_MESSAGE' => $error_message,
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), 'MODE_DESC' => $mode_desc,
'S_DATA_RESULTS' => $data_results, 'LOGO' => $logo,
) 'TEAM' => $team_name,
); 'SEASON' => $season_name,
'LEAGUE' => $league_name,
// output page 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
page_header($mode_desc . ' ' . $team_name); 'S_DATA_RESULTS' => $data_results,
} )
else );
{
$template->assign_vars(array( // output page
'S_SIDENAME' => $sidename, page_header($mode_desc . ' ' . $team_name);
'S_DATA_PLAN' => $data_plan, }
'S_DATA_GROUP' => false, else
'S_ERROR_MESSAGE' => $error_message, {
'MODE_DESC' => $mode_desc, $template->assign_vars(array(
'LOGO' => '', 'S_SIDENAME' => $sidename,
'TEAM' => '', 'S_DATA_PLAN' => $data_plan,
'SEASON' => '', 'S_DATA_GROUP' => false,
'LEAGUE' => '', 'S_ERROR_MESSAGE' => $error_message,
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), 'MODE_DESC' => $mode_desc,
'S_DATA_RESULTS' => false, 'LOGO' => '',
) 'TEAM' => '',
); 'SEASON' => '',
'LEAGUE' => '',
// output page 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
page_header($mode_desc); 'S_DATA_RESULTS' => false,
} )
$template->set_filenames(array( );
'body' => 'viewplan_popup.html')
); // output page
page_header($mode_desc);
page_footer(); }
$template->set_filenames(array(
?> 'body' => 'viewplan_popup.html')
);
page_footer();

View File

@@ -1,29 +1,30 @@
{ {
"name": "football/football", "name" : "football/football",
"type": "phpbb-extension", "type" : "phpbb-extension",
"description": "Football Prediction League", "description" : "Football Prediction League",
"homepage": "http://football.bplaced.net", "homepage" : "http://football.bplaced.net",
"version": "0.9.8", "version" : "0.9.9",
"time": "2017-02-19", "time" : "2021-04-04",
"license": "GPL-2.0", "license" : "GPL-2.0-only",
"authors": [{ "authors" : [{
"name": "J. Helmke", "name" : "J. Helmke",
"email": "phpBB3.football@gmx.de", "email" : "phpBB3.football@gmx.de",
"homepage": "http://football.bplaced.net", "homepage" : "http://football.bplaced.net",
"role": "Lead Developer" "role" : "Lead Developer"
}], }
"require": { ],
"php": ">=5.3.3" "require" : {
"php" : ">=5.3.3"
}, },
"extra": { "extra" : {
"display-name": "Football Prediction League", "display-name" : "Football Prediction League",
"soft-require": { "soft-require" : {
"phpbb/phpbb": "3.1.*" "phpbb/phpbb" : ">=3.2.8,<3.4"
}, },
"version-check": { "version-check" : {
"host": "football.bplaced.net", "host" : "football.bplaced.net",
"directory": "/updatecheck", "directory" : "/updatecheck",
"filename": "football_predictionleague.json" "filename" : "football_predictionleague.json"
} }
} }
} }

View File

@@ -1,4 +1,4 @@
football_main_controller: football_football_controller:
path: /football/{side} path: /football/{side}
defaults: { _controller: football.football.controller:handle } defaults: { _controller: football.football.controller:handle }

View File

@@ -12,102 +12,102 @@ services:
football.football.controller: football.football.controller:
class: football\football\controller\main class: football\football\controller\main
arguments: arguments:
- @auth - '@auth'
- @config - '@config'
- @ext.manager - '@ext.manager'
- @notification_manager - '@notification_manager'
- @log - '@log'
- @path_helper - '@path_helper'
- @dbal.conn - '@dbal.conn'
- @controller.helper - '@controller.helper'
- @template - '@template'
- @user - '@user'
- @pagination - '@pagination'
- %core.root_path% - '%core.root_path%'
- %core.php_ext% - '%core.php_ext%'
football.football.controller_popup: football.football.controller_popup:
class: football\football\controller\popup class: football\football\controller\popup
arguments: arguments:
- @auth - '@auth'
- @config - '@config'
- @ext.manager - '@ext.manager'
- @path_helper - '@path_helper'
- @dbal.conn - '@dbal.conn'
- @controller.helper - '@controller.helper'
- @template - '@template'
- @user - '@user'
- @pagination - '@pagination'
- %core.root_path% - '%core.root_path%'
- %core.php_ext% - '%core.php_ext%'
football.football.controller_download: football.football.controller_download:
class: football\football\controller\download class: football\football\controller\download
arguments: arguments:
- @auth - '@auth'
- @config - '@config'
- @ext.manager - '@ext.manager'
- @path_helper - '@path_helper'
- @dbal.conn - '@dbal.conn'
- @controller.helper - '@controller.helper'
- @template - '@template'
- @user - '@user'
- %core.root_path% - '%core.root_path%'
- %core.php_ext% - '%core.php_ext%'
football.football.version.check: football.football.version.check:
class: football\football\includes\version_check class: football\football\includes\version_check
scope: prototype scope: prototype
arguments: arguments:
- %football.version_data% - '%football.version_data%'
- @config - '@config'
- @version_helper - '@version_helper'
- @template - '@template'
- @user - '@user'
football.football.controller_xml: football.football.controller_xml:
class: football\football\controller\xmlplan class: football\football\controller\xmlplan
arguments: arguments:
- @config - '@config'
- @ext.manager - '@ext.manager'
- @path_helper - '@path_helper'
- @dbal.conn - '@dbal.conn'
- @user - '@user'
- %core.root_path% - '%core.root_path%'
- %core.php_ext% - '%core.php_ext%'
football.football.core.functions.points: football.football.core.functions.points:
class: football\football\core\functions_points class: football\football\core\functions_points
arguments: arguments:
- @user - '@user'
- @dbal.conn - '@dbal.conn'
football.football.listener: football.football.listener:
class: football\football\event\main_listener class: football\football\event\main_listener
arguments: arguments:
- @auth - '@auth'
- @config - '@config'
- @controller.helper - '@controller.helper'
- @template - '@template'
- @path_helper - '@path_helper'
- @ext.manager - '@ext.manager'
- @user - '@user'
- %core.root_path% - '%core.root_path%'
- %core.php_ext% - '%core.php_ext%'
tags: tags:
- { name: event.listener } - { name: event.listener }
football.football.cron.task.football_remember: football.football.cron.task.football_remember:
class: football\football\cron\task\football_remember class: football\football\cron\task\football_remember
arguments: arguments:
- %core.root_path% - '%core.root_path%'
- %core.php_ext% - '%core.php_ext%'
- @ext.manager - '@ext.manager'
- @path_helper - '@path_helper'
- @dbal.conn - '@dbal.conn'
- @config - '@config'
- @log - '@log'
- @user - '@user'
calls: calls:
- [set_name, [football.football.cron.task.football_remember]] - [set_name, [football.football.cron.task.football_remember]]
tags: tags:

View File

@@ -122,7 +122,6 @@ class download
{ {
$message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED';
trigger_error($message); trigger_error($message);
exit;
} }
// Can this user view Prediction Leagues pages? // Can this user view Prediction Leagues pages?

View File

@@ -45,7 +45,7 @@ class main
/* @var \phpbb\user */ /* @var \phpbb\user */
protected $user; protected $user;
/** @var \phpbb\pagination */ /* @var \phpbb\pagination */
protected $pagination; protected $pagination;
/* @var phpBB root path */ /* @var phpBB root path */
@@ -137,7 +137,6 @@ class main
{ {
$message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED';
trigger_error($message); trigger_error($message);
exit;
} }
// Can this user view Prediction Leagues pages? // Can this user view Prediction Leagues pages?
@@ -308,8 +307,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 +418,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 +477,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 +724,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']);
@@ -749,18 +752,18 @@ class main
INNER JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season) INNER JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season)
INNER JOIN ' . FOOTB_MATCHDAYS . ' AS sp ON (sp.season = s.season AND sp.league = l.league) INNER JOIN ' . FOOTB_MATCHDAYS . ' AS sp ON (sp.season = s.season AND sp.league = l.league)
WHERE 1 WHERE 1
ORDER BY season DESC'; ORDER BY s.season DESC';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result)) while( $row = $db->sql_fetchrow($result))
{ {
$selected = ($season && $row['season'] == $season) ? ' selected="selected"' : ''; $selected = ($season && $row['season'] == $season) ? ' selected="selected"' : '';
if ($selected) if ($selected)
{ {
$season_name = htmlspecialchars($row['season_name_short']); $season_name = utf8_htmlspecialchars($row['season_name_short']);
} }
$template->assign_block_vars('form_season', array( $template->assign_block_vars('form_season', array(
'S_SEASON' => htmlspecialchars($row['season']), 'S_SEASON' => utf8_htmlspecialchars($row['season']),
'S_SEASONNAME' => htmlspecialchars($row['season_name_short']), 'S_SEASONNAME' => utf8_htmlspecialchars($row['season_name_short']),
'S_SELECTED' => $selected)); 'S_SELECTED' => $selected));
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@@ -781,11 +784,40 @@ 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'])
{
$side = 'ranks_total';
}
elseif ($side == 'ranks_total' && !$league_info['bet_type'])
{
$side = 'table';
}
elseif ($side == 'table' OR $side == 'results_tl')
{
if ($league < 51)
{
$league = $league + 50;
}
}
else
{
if ($league > 50)
{
$league = $league - 50;
}
}
if ($selected) if ($selected)
{ {
$league_name = $row['league_name']; $league_name = $row['league_name'];
@@ -823,7 +855,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 +936,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);
} }
else else
{ {
@@ -914,18 +946,18 @@ 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
//***************************************************************************** //*****************************************************************************
} }
if ($side == 'bet')
{
include($this->football_root_path . 'block/table.' . $this->php_ext);
}
// Start assign vars // Start assign vars
$sql_ary = array( $sql_ary = array(
'football_season' => (int) $season, 'football_season' => (int) $season,
@@ -944,9 +976,9 @@ class main
$print_start = ($start) ? "start=$start&amp;" : ''; $print_start = ($start) ? "start=$start&amp;" : '';
$template->assign_vars(array( $template->assign_vars(array(
'U_PRINT_FOOTBALL' => $this->helper->route('football_main_controller', array('side' => $side, 's' => $season, 'l' => $league, 'm' => $matchday, 'view' => 'print')), 'U_PRINT_FOOTBALL' => $this->helper->route('football_football_controller', array('side' => $side, 's' => $season, 'l' => $league, 'm' => $matchday, 'view' => 'print')),
'U_MOBILE_SWITCH' => $this->helper->route('football_main_controller', array('side' => $side, 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'switch')), 'U_MOBILE_SWITCH' => $this->helper->route('football_football_controller', array('side' => $side, 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'switch')),
'U_SIDE_LINK' => $this->helper->route('football_main_controller', array('side' => $side, 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_SIDE_LINK' => $this->helper->route('football_football_controller', array('side' => $side, 's' => $season, 'l' => $league, 'm' => $matchday)),
'L_TOP_RANKSP' => sprintf($user->lang['RANKING']) . ' ' . $matchday . '. ' . sprintf($user->lang['MATCHDAY']), 'L_TOP_RANKSP' => sprintf($user->lang['RANKING']) . ' ' . $matchday . '. ' . sprintf($user->lang['MATCHDAY']),
'L_TOP_RANKGESAMT' => sprintf($user->lang['TOTAL_RANKING']) . ' ' . $matchday . '. ' . sprintf($user->lang['MATCHDAY']), 'L_TOP_RANKGESAMT' => sprintf($user->lang['TOTAL_RANKING']) . ' ' . $matchday . '. ' . sprintf($user->lang['MATCHDAY']),
'PHPBB_ROOT_PATH' => $this->phpbb_root_path, 'PHPBB_ROOT_PATH' => $this->phpbb_root_path,
@@ -965,20 +997,21 @@ class main
'S_SEASON_NAME' => $season_name, 'S_SEASON_NAME' => $season_name,
'S_LEAGUE_NAME' => $league_name, 'S_LEAGUE_NAME' => $league_name,
'S_MATCHDAY_NAME' => $matchday_name, 'S_MATCHDAY_NAME' => $matchday_name,
'S_FORMSELF' => $this->helper->route('football_main_controller', array('side' => $side)), 'S_FORMSELF' => $this->helper->route('football_football_controller', array('side' => $side)),
'S_DELIVERY' => delivery($season, $league, $matchday), 'S_DELIVERY' => delivery($season, $league, $matchday),
// For nav_delivery // For nav_delivery
'S_PREV_LINK' => $prev_link, 'S_PREV_LINK' => $prev_link,
'S_PREV_CLASS' => $prev_class, 'S_PREV_CLASS' => $prev_class,
'S_PREV_DEADLINE' => $prev_deadline, 'S_PREV_DEADLINE' => $prev_deadline,
'S_CURR_LINK' => $this->helper->route('football_main_controller', array('side' => $side, 's' => $season, 'l' => $league)), 'S_CURR_LINK' => $this->helper->route('football_football_controller', array('side' => $side, 's' => $season, 'l' => $league)),
'S_CURR_MATCHDAY' => $curr_matchday, 'S_CURR_MATCHDAY' => $curr_matchday,
'S_NEXT_LINK' => $next_link, 'S_NEXT_LINK' => $next_link,
'S_NEXT_CLASS' => $next_class, 'S_NEXT_CLASS' => $next_class,
'S_NEXT_DEADLINE' => $next_deadline, 'S_NEXT_DEADLINE' => $next_deadline,
'S_DBMSG' => $dbmsg, 'S_DBMSG' => $dbmsg,
'FOOTBALL_LEFT_COLUMN' => $config['football_left_column_width'], 'FOOTBALL_LEFT_COLUMN' => $config['football_left_column_width'],
'FOOTBALL_RIGHT_COLUMN' => $config['football_right_column_width'], 'FOOTBALL_RIGHT_COLUMN' => $config['football_right_column_width'],
'S_BET_TYPE' => $league_info['bet_type'],
)); ));
// End assign vars // End assign vars
@@ -988,6 +1021,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 +1037,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

@@ -39,7 +39,7 @@ class popup
/* @var \phpbb\user */ /* @var \phpbb\user */
protected $user; protected $user;
/** @var \phpbb\pagination */ /* @var \phpbb\pagination */
protected $pagination; protected $pagination;
/* @var phpBB root path */ /* @var phpBB root path */
@@ -128,7 +128,6 @@ class popup
{ {
$message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED';
trigger_error($message); trigger_error($message);
exit;
} }
// Can this user view Prediction Leagues pages? // Can this user view Prediction Leagues pages?

View File

@@ -105,7 +105,6 @@ class xmlplan
{ {
$message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED';
trigger_error($message); trigger_error($message);
exit;
} }

View File

@@ -42,7 +42,7 @@ class football_remember extends \phpbb\cron\task\base
* @param string $php_ext * @param string $php_ext
* @param \phpbb\extension\manager $phpbb_extension_manager * @param \phpbb\extension\manager $phpbb_extension_manager
* @param \phpbb\path_helper $phpbb_path_helper * @param \phpbb\path_helper $phpbb_path_helper
* @param \phpbb\db\driver\driver_interfacer $db * @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\config\config $config * @param \phpbb\config\config $config
* @param \phpbb\log\log_interface $log * @param \phpbb\log\log_interface $log
* @param \phpbb\user $user * @param \phpbb\user $user
@@ -333,4 +333,3 @@ class football_remember extends \phpbb\cron\task\base
} }
} }
} }
?>

View File

@@ -129,7 +129,7 @@ class main_listener implements EventSubscriberInterface
} }
else else
{ {
$event['location_url'] = $this->controller_helper->route('football_main_controller', array_merge(array('side' => $url_parts['base']), $url_parts['params'])); $event['location_url'] = $this->controller_helper->route('football_football_controller', array_merge(array('side' => $url_parts['base']), $url_parts['params']));
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
@@ -137,7 +137,7 @@ class main_listener implements EventSubscriberInterface
{ {
$event['location'] = $this->user->lang('VIEWING_FOOTBALL' . (empty($url_parts['base']) ? '' : '_' . strtoupper ($url_parts['base']))); $event['location'] = $this->user->lang('VIEWING_FOOTBALL' . (empty($url_parts['base']) ? '' : '_' . strtoupper ($url_parts['base'])));
} }
$event['location_url'] = $this->controller_helper->route('football_main_controller', array_merge(array('side' => $url_parts['base']), $url_parts['params'])); $event['location_url'] = $this->controller_helper->route('football_football_controller', array_merge(array('side' => $url_parts['base']), $url_parts['params']));
} }
} }
@@ -217,19 +217,20 @@ class main_listener implements EventSubscriberInterface
'S_FOOTBALL_HEADER_LEAGUE' => $league, 'S_FOOTBALL_HEADER_LEAGUE' => $league,
'S_FOOTBALL_EXT_PATH' => $ext_path, 'S_FOOTBALL_EXT_PATH' => $ext_path,
'S_FOOTBALL_HEADER_ENABLED' => $this->config['football_header_enable'] ? $in_football_ext : false, 'S_FOOTBALL_HEADER_ENABLED' => $this->config['football_header_enable'] ? $in_football_ext : false,
'U_FOOTBALL' => $this->controller_helper->route('football_main_controller', array('side' => 'bet')), 'U_FOOTBALL' => $this->controller_helper->route('football_football_controller', array('side' => 'bet')),
'U_BET' => $this->controller_helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_BET' => $this->controller_helper->route('football_football_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_ALL_BETS' => $this->controller_helper->route('football_main_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_ALL_BETS' => $this->controller_helper->route('football_football_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_RESULTS' => $this->controller_helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_RESULTS' => $this->controller_helper->route('football_football_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_TABLE' => $this->controller_helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_RESULTS_TL' => $this->controller_helper->route('football_football_controller', array('side' => 'results_tl', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_RANKS_TOTAL' => $this->controller_helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_TABLE' => $this->controller_helper->route('football_football_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_RANKS_MATCHDAY' => $this->controller_helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_RANKS_TOTAL' => $this->controller_helper->route('football_football_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_DELIVERY_LIST' => $this->controller_helper->route('football_main_controller', array('side' => 'delivery', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_RANKS_MATCHDAY' => $this->controller_helper->route('football_football_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_LAST_VISITORS' => $this->controller_helper->route('football_main_controller', array('side' => 'last_users', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_DELIVERY_LIST' => $this->controller_helper->route('football_football_controller', array('side' => 'delivery', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_FOOTBALL_BANK' => $this->controller_helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_LAST_VISITORS' => $this->controller_helper->route('football_football_controller', array('side' => 'last_users', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_FOOTBALL_BANK' => $this->controller_helper->route('football_football_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_RULES' => $this->controller_helper->route('football_football_popup', array('popside' => 'rules_popup', 's' => $season, 'l' => $league)), 'U_RULES' => $this->controller_helper->route('football_football_popup', array('popside' => 'rules_popup', 's' => $season, 'l' => $league)),
'U_EXPORT' => $this->controller_helper->route('football_football_download', array('downside' => 'dload_export', 's' => $season, 'l' => $league)), 'U_EXPORT' => $this->controller_helper->route('football_football_download', array('downside' => 'dload_export', 's' => $season, 'l' => $league)),
'U_ODDS' => $this->controller_helper->route('football_main_controller', array('side' => 'odds', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_ODDS' => $this->controller_helper->route('football_football_controller', array('side' => 'odds', 's' => $season, 'l' => $league, 'm' => $matchday)),
'S_MENU_LINK1' => (strlen($this->config['football_menu_link1']) > 4) ? true : false, 'S_MENU_LINK1' => (strlen($this->config['football_menu_link1']) > 4) ? true : false,
'U_MENU_LINK1' => $this->config['football_menu_link1'], 'U_MENU_LINK1' => $this->config['football_menu_link1'],
'MENU_DESC_LINK1' => $this->config['football_menu_desc1'], 'MENU_DESC_LINK1' => $this->config['football_menu_desc1'],
@@ -239,14 +240,14 @@ class main_listener implements EventSubscriberInterface
'S_MENU_LINK3' => (strlen($this->config['football_menu_link3']) > 4) ? true : false, 'S_MENU_LINK3' => (strlen($this->config['football_menu_link3']) > 4) ? true : false,
'U_MENU_LINK3' => (strpos($this->config['football_menu_link3'], 'xml/league.php') === false) ? $this->config['football_menu_link3'] : $this->config['football_menu_link3'] . "&season=$season&league=$league", 'U_MENU_LINK3' => (strpos($this->config['football_menu_link3'], 'xml/league.php') === false) ? $this->config['football_menu_link3'] : $this->config['football_menu_link3'] . "&season=$season&league=$league",
'MENU_DESC_LINK3' => $this->config['football_menu_desc3'], 'MENU_DESC_LINK3' => $this->config['football_menu_desc3'],
'U_MY_BETS' => $this->controller_helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_MY_BETS' => $this->controller_helper->route('football_football_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_MY_POINTS' => $this->controller_helper->route('football_main_controller', array('side' => 'my_points', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_MY_POINTS' => $this->controller_helper->route('football_football_controller', array('side' => 'my_points', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_MY_TABLE' => $this->controller_helper->route('football_main_controller', array('side' => 'my_table', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_MY_TABLE' => $this->controller_helper->route('football_football_controller', array('side' => 'my_table', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_MY_RANK' => $this->controller_helper->route('football_main_controller', array('side' => 'my_rank', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_MY_RANK' => $this->controller_helper->route('football_football_controller', array('side' => 'my_rank', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_MY_CHART' => $this->controller_helper->route('football_main_controller', array('side' => 'my_chart', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_MY_CHART' => $this->controller_helper->route('football_football_controller', array('side' => 'my_chart', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_MY_KOEFF' => $this->controller_helper->route('football_main_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_MY_KOEFF' => $this->controller_helper->route('football_football_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_STAT_RESULTS' => $this->controller_helper->route('football_main_controller', array('side' => 'stat_results', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_STAT_RESULTS' => $this->controller_helper->route('football_football_controller', array('side' => 'stat_results', 's' => $season, 'l' => $league, 'm' => $matchday)),
'U_STAT_POINTS' => $this->controller_helper->route('football_main_controller', array('side' => 'stat_points', 's' => $season, 'l' => $league, 'm' => $matchday)), 'U_STAT_POINTS' => $this->controller_helper->route('football_football_controller', array('side' => 'stat_points', 's' => $season, 'l' => $league, 'm' => $matchday)),
)); ));
} }

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

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