7 Commits

Author SHA1 Message Date
football
7d8b92f1df Version 0.9.9 2017-09-09 13:51:15 +02:00
football
c075143bfc Version 0.9.9b1
-replace icons with font awesome icons
-display icons on tabs and hide it on mobile access
-new block last results
-new config values for last users, last results
-replace config value football_host_timezone with football_time_shift
-fixed errors on php 7
-remove unnecessary sql_freeresult calls
-fixed non-numeric value errors
2017-09-09 10:58:32 +02:00
football
a502b5d082 Fix problem in admin-help-section on phpBB3.2 (no help is shown):
[phpBB Debug] PHP Warning: in file [ROOT]/ext/football/football/acp/football_module.php on line 80: Invalid argument supplied for foreach()
2017-03-05 18:04:34 +01:00
football
a16e0e3c79 Version 0.9.8 2017-02-19 20:25:32 +01:00
football
09631cbe15 Version 0.9.7 2016-06-12 17:20:16 +02:00
football
4734d75718 Version 0.9.7 2016-06-12 16:40:06 +02:00
football
caeec03da8 Version 0.9.6 2016-05-29 15:51:04 +02:00
100 changed files with 19328 additions and 18865 deletions

24
.gitignore vendored
View File

@@ -39,3 +39,27 @@ Icon
# Files that might appear on external disk # Files that might appear on external disk
.Spotlight-V100 .Spotlight-V100
.Trashes .Trashes
/styles/prosilver/theme/images/right_arrow.png
/styles/prosilver/theme/images/icon_allbets.gif
/styles/prosilver/theme/images/icon_ball.gif
/styles/prosilver/theme/images/icon_ball2.gif
/styles/prosilver/theme/images/icon_bet.gif
/styles/prosilver/theme/images/icon_bookmark.gif
/styles/prosilver/theme/images/icon_download.gif
/styles/prosilver/theme/images/icon_info.gif
/styles/prosilver/theme/images/icon_list.gif
/styles/prosilver/theme/images/icon_mark.gif
/styles/prosilver/theme/images/icon_odds.gif
/styles/prosilver/theme/images/icon_points.gif
/styles/prosilver/theme/images/icon_print.gif
/styles/prosilver/theme/images/icon_rank.gif
/styles/prosilver/theme/images/icon_results.gif
/styles/prosilver/theme/images/icon_rules.gif
/styles/prosilver/theme/images/icon_statistic.gif
/styles/prosilver/theme/images/icon_statistics.gif
/styles/prosilver/theme/images/icon_xml.gif
/styles/prosilver/theme/images/left_arrow.png
/images/no_change.gif
/images/arrow_down.gif
/images/arrow_up.gif
/migrations/v099_beta1.php

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,463 +1,459 @@
<?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_module class extra_module
{ {
public $u_action; public $u_action;
protected $db, $user, $template, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; protected $db, $user, $template, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
protected $root_path, $request, $php_ext, $log; protected $root_path, $request, $php_ext, $log;
public function __construct() public function __construct()
{ {
global $db, $user, $request, $template; global $db, $user, $request, $template;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang_ext('football/football', 'football'); $user->add_lang_ext('football/football', 'football');
$user->add_lang_ext('football/football', 'info_acp_extra'); $user->add_lang_ext('football/football', 'info_acp_extra');
$this->root_path = $phpbb_root_path . 'ext/football/football/'; $this->root_path = $phpbb_root_path . 'ext/football/football/';
$this->config = $config; $this->config = $config;
$this->request = $request; $this->request = $request;
$this->phpbb_root_path = $phpbb_root_path; $this->phpbb_root_path = $phpbb_root_path;
$this->phpbb_admin_path = $phpbb_admin_path; $this->phpbb_admin_path = $phpbb_admin_path;
$this->php_ext = $phpEx; $this->php_ext = $phpEx;
if(!function_exists('season_info')) if(!function_exists('season_info'))
{ {
include($this->root_path . 'includes/functions.' . $this->php_ext); include($this->root_path . 'includes/functions.' . $this->php_ext);
} }
if (!defined('FOOTB_SEASONS')) if (!defined('FOOTB_SEASONS'))
{ {
include($this->root_path . 'includes/constants.' . $this->php_ext); include($this->root_path . 'includes/constants.' . $this->php_ext);
} }
} }
function main($id, $mode) function main($id, $mode)
{ {
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
$provider = new \phpbb\controller\ provider();
$symphony_request = new \phpbb\ symfony_request($request); $helper = $phpbb_container->get('controller.helper');
$filesystem = new \phpbb\ filesystem();
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); $this->tpl_name = 'acp_football_extra';
$this->page_title = 'ACP_FOOTBALL_EXTRA_MANAGE';
$this->tpl_name = 'acp_football_extra';
$this->page_title = 'ACP_FOOTBALL_EXTRA_MANAGE'; $form_key = 'acp_football_extra';
add_form_key($form_key);
$form_key = 'acp_football_extra';
add_form_key($form_key); include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); // Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['remove'])) ? 'remove' : $this->request->variable('action', ''));
// Check and set some common vars $edit = $this->request->variable('edit', 0);
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['remove'])) ? 'remove' : $this->request->variable('action', '')); $season = $this->request->variable('s', 0);
$edit = $this->request->variable('edit', 0); $league = $this->request->variable('l', 0);
$season = $this->request->variable('s', 0); $matchday = $this->request->variable('matchday', 0);
$league = $this->request->variable('l', 0); $matchday_eval = $this->request->variable('matchday_eval', 0);
$matchday = $this->request->variable('matchday', 0); $extra_no = $this->request->variable('e', 0);
$matchday_eval = $this->request->variable('matchday_eval', 0); $update = (isset($_POST['update'])) ? true : false;
$extra_no = $this->request->variable('e', 0);
$update = (isset($_POST['update'])) ? true : false; // Clear some vars
$extra_row = array();
// Clear some vars $error = array();
$extra_row = array();
$error = array(); // Grab current season
if (!$season)
// Grab current season {
if (!$season) $season = curr_season();
{ }
$season = curr_season();
} // Grab basic data for select season
if ($season)
// Grab basic data for select season {
if ($season) $sql = 'SELECT *
{ FROM ' . FOOTB_SEASONS . '
$sql = 'SELECT * ORDER BY season DESC';
FROM ' . FOOTB_SEASONS . ' $result = $db->sql_query($sql);
ORDER BY season DESC';
$result = $db->sql_query($sql); $season_options = '';
while ($row = $db->sql_fetchrow($result))
$season_options = ''; {
while ($row = $db->sql_fetchrow($result)) $selected = ($season && $row['season'] == $season) ? ' selected="selected"' : '';
{ $season_options .= '<option value="' . $row['season'] . '"' . $selected . '>' . $row['season_name_short'] . '</option>';
$selected = ($season && $row['season'] == $season) ? ' selected="selected"' : ''; if ($selected <> '')
$season_options .= '<option value="' . $row['season'] . '"' . $selected . '>' . $row['season_name_short'] . '</option>'; {
if ($selected <> '') $season_name = $row['season_name_short'];
{ }
$season_name = $row['season_name_short']; }
} $db->sql_freeresult($result);
} }
$db->sql_freeresult($result); else
} {
else trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
{ }
trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
} // Grab current league
if (!$league)
// Grab current league {
if (!$league) $league = first_league($season, false);
{ }
$league = first_league($season, false);
} // Grab basic data for select league
if ($league)
// Grab basic data for select league {
if ($league) $sql = 'SELECT *
{ FROM ' . FOOTB_LEAGUES . "
$sql = 'SELECT * WHERE season = $season
FROM ' . FOOTB_LEAGUES . " ORDER BY league ASC";
WHERE season = $season $result = $db->sql_query($sql);
ORDER BY league ASC";
$result = $db->sql_query($sql); $league_options = '';
while ($row = $db->sql_fetchrow($result))
$league_options = ''; {
while ($row = $db->sql_fetchrow($result)) $selected = ($league && $row['league'] == $league) ? ' selected="selected"' : '';
{ $league_options .= '<option value="' . $row['league'] . '"' . $selected . '>' . $row['league_name'] . '</option>';
$selected = ($league && $row['league'] == $league) ? ' selected="selected"' : ''; if ($selected <> '')
$league_options .= '<option value="' . $row['league'] . '"' . $selected . '>' . $row['league_name'] . '</option>'; {
if ($selected <> '') $league_matchdays = $row['matchdays'];
{ $league_name = $row['league_name'];
$league_matchdays = $row['matchdays']; $league_type = $row['league_type'];
$league_name = $row['league_name']; $ko_league = ($row['league_type'] == LEAGUE_KO) ? true : false;
$league_type = $row['league_type']; }
$ko_league = ($row['league_type'] == LEAGUE_KO) ? true : false; }
} $db->sql_freeresult($result);
} }
$db->sql_freeresult($result); else
} {
else trigger_error(sprintf($user->lang['NO_LEAGUE'], $season) . adm_back_link($this->u_action . "&amp;s=$season"), E_USER_WARNING);
{ }
trigger_error(sprintf($user->lang['NO_LEAGUE'], $season) . adm_back_link($this->u_action . "&amp;s=$season"), E_USER_WARNING);
} // Grab basic data for extra bets, if extra bet is set and exists
if ($extra_no)
// Grab basic data for extra bets, if extra bet is set and exists {
if ($extra_no) $sql = 'SELECT *
{ FROM ' . FOOTB_EXTRA . "
$sql = 'SELECT * WHERE season = $season
FROM ' . FOOTB_EXTRA . " AND league = $league
WHERE season = $season AND extra_no = $extra_no";
AND league = $league $result = $db->sql_query($sql);
AND extra_no = $extra_no"; $extra_row = $db->sql_fetchrow($result);
$result = $db->sql_query($sql); $existing_extra = sizeof($extra_row);
$extra_row = $db->sql_fetchrow($result); $db->sql_freeresult($result);
$existing_extra = sizeof($extra_row); }
$db->sql_freeresult($result);
} // Which page?
switch ($action)
$db->sql_freeresult($result); {
case 'delete':
// Which page? if (!$season)
switch ($action) {
{ trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
case 'delete': }
if (!$season)
{ if (!$league)
trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING); {
} trigger_error($user->lang['NO_LEAGUE'] . adm_back_link($this->u_action . "&amp;s=$season"), E_USER_WARNING);
}
if (!$league)
{ if (!$extra_no)
trigger_error($user->lang['NO_LEAGUE'] . adm_back_link($this->u_action . "&amp;s=$season"), E_USER_WARNING); {
} trigger_error($user->lang['NO_EXTRA'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING);
}
if (!$extra_no)
{ if (confirm_box(true))
trigger_error($user->lang['NO_EXTRA'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING); {
} $error = '';
if (confirm_box(true)) if (!$auth->acl_get('a_football_delete'))
{ {
$error = ''; trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING);
}
if (!$auth->acl_get('a_football_delete')) if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete'])
{ {
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING); trigger_error($user->lang['EXTRA_NO_DELETE'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING);
} }
if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete'])
{ // Delete extra
trigger_error($user->lang['EXTRA_NO_DELETE'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING); $sql = 'DELETE FROM ' . FOOTB_EXTRA . "
} WHERE season = $season AND league = $league AND extra_no = $extra_no";
$db->sql_query($sql);
// Delete extra
$sql = 'DELETE FROM ' . FOOTB_EXTRA . " // Delete extra bets
WHERE season = $season AND league = $league AND extra_no = $extra_no"; $sql = 'DELETE FROM ' . FOOTB_EXTRA_BETS . "
$db->sql_query($sql); WHERE season = $season
AND league = $league
// Delete extra bets AND extra_no = $extra_no";
$sql = 'DELETE FROM ' . FOOTB_EXTRA_BETS . " $db->sql_query($sql);
WHERE season = $season
AND league = $league trigger_error($user->lang['EXTRA_DELETED'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"));
AND extra_no = $extra_no"; }
$db->sql_query($sql); else
{
trigger_error($user->lang['EXTRA_DELETED'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league")); confirm_box(false, sprintf($user->lang['EXTRA_CONFIRM_DELETE'], $extra_row['question'], $league, $season), build_hidden_fields(array(
} 's' => $season,
else 'l' => $league,
{ 'e' => $extra_no,
confirm_box(false, sprintf($user->lang['EXTRA_CONFIRM_DELETE'], $extra_row['question'], $league, $season), build_hidden_fields(array( 'mode' => $mode,
's' => $season, 'action' => $action))
'l' => $league, );
'e' => $extra_no, }
'mode' => $mode, break;
'action' => $action))
); case 'add':
} $sql = "SELECT
break; max(extra_no) AS max_extra_no
FROM " . FOOTB_EXTRA . "
case 'add': WHERE season = $season
$sql = "SELECT AND league = $league";
max(extra_no) AS max_extra_no $result = $db->sql_query($sql);
FROM " . FOOTB_EXTRA . " $row_extra = $db->sql_fetchrow($result);
WHERE season = $season $existing_extra = sizeof($row_extra);
AND league = $league"; $db->sql_freeresult($result);
$result = $db->sql_query($sql); $extra_no = ($existing_extra) ? $row_extra['max_extra_no'] + 1 : 1;
$row_extra = $db->sql_fetchrow($result); $extra_row['extra_no'] = $extra_no;
$existing_extra = sizeof($row_extra); $extra_row['question_type'] = $this->request->variable('question_type', 3);
$db->sql_freeresult($result); $extra_row['question'] = utf8_normalize_nfc($this->request->variable('question', '', true));
$extra_no = ($existing_extra) ? $row_extra['max_extra_no'] + 1 : 1; $extra_row['matchday'] = $this->request->variable('matchday', 0);
$extra_row['extra_no'] = $extra_no; $extra_row['matchday_eval'] = $this->request->variable('matchday_eval', 0);
$extra_row['question_type'] = $this->request->variable('question_type', 3); $extra_row['result'] = utf8_normalize_nfc($this->request->variable('result', ''));
$extra_row['question'] = utf8_normalize_nfc($this->request->variable('question', '', true)); $extra_row['extra_points'] = $this->request->variable('extra_points', 0);
$extra_row['matchday'] = $this->request->variable('matchday', 0); $extra_row['extra_status'] = $this->request->variable('extra_status', 0);
$extra_row['matchday_eval'] = $this->request->variable('matchday_eval', 0); // No break for edit add
$extra_row['result'] = utf8_normalize_nfc($this->request->variable('result', '')); case 'edit':
$extra_row['extra_points'] = $this->request->variable('extra_points', 0); $error_msg = array();
$extra_row['extra_status'] = $this->request->variable('extra_status', 0);
// No break for edit add if (!sizeof($error))
case 'edit': {
$error_msg = array(); if ($action == 'edit' && !$extra_no)
{
if (!sizeof($error)) trigger_error($user->lang['NO_EXTRA'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING);
{ }
if ($action == 'edit' && !$extra_no)
{ $matchday = $extra_row['matchday'];
trigger_error($user->lang['NO_EXTRA'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING); $matchday_eval = $extra_row['matchday_eval'];
}
$sql = 'SELECT *
$matchday = $extra_row['matchday']; FROM ' . FOOTB_MATCHDAYS . "
$matchday_eval = $extra_row['matchday_eval']; WHERE season = $season
AND league = $league
$sql = 'SELECT * ORDER BY matchday ASC";
FROM ' . FOOTB_MATCHDAYS . " $result = $db->sql_query($sql);
WHERE season = $season
AND league = $league $matchday_options = '<option value="0"' . ((!$matchday) ? ' selected="selected"' : '') . '>' . $user->lang['SELECT_MATCHDAY'] . '</option>';
ORDER BY matchday ASC"; $matchday_eval_options = '<option value="0"' . ((!$matchday_eval) ? ' selected="selected"' : '') . '>' . $user->lang['SELECT_MATCHDAY'] . '</option>';
$result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result))
{
$matchday_options = '<option value="0"' . ((!$matchday) ? ' selected="selected"' : '') . '>' . $user->lang['SELECT_MATCHDAY'] . '</option>'; if ($row['status'] == 0 or $action == 'edit')
$matchday_eval_options = '<option value="0"' . ((!$matchday_eval) ? ' selected="selected"' : '') . '>' . $user->lang['SELECT_MATCHDAY'] . '</option>'; {
while ($row = $db->sql_fetchrow($result)) $selected_matchday = ($matchday && $row['matchday'] == $matchday) ? ' selected="selected"' : '';
{ $selected_eval = ($matchday_eval && $row['matchday'] == $matchday_eval) ? ' selected="selected"' : '';
if ($row['status'] == 0 or $action == 'edit') $day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']);
{ $matchday_options .= '<option value="' . $row['matchday'] . '"' . $selected_matchday . '>' . $day_name . '</option>';
$selected_matchday = ($matchday && $row['matchday'] == $matchday) ? ' selected="selected"' : ''; $matchday_eval_options .= '<option value="' . $row['matchday'] . '"' . $selected_eval . '>' . $day_name . '</option>';
$selected_eval = ($matchday_eval && $row['matchday'] == $matchday_eval) ? ' selected="selected"' : ''; }
$day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']); }
$matchday_options .= '<option value="' . $row['matchday'] . '"' . $selected_matchday . '>' . $day_name . '</option>'; $db->sql_freeresult($result);
$matchday_eval_options .= '<option value="' . $row['matchday'] . '"' . $selected_eval . '>' . $day_name . '</option>'; $question_type_options = '';
} for($i = 1; $i<= 5; $i++)
} {
$selected = ($i == $extra_row['question_type']) ? ' selected="selected"' : '';
$question_type_options = ''; $question_type_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
for($i = 1; $i<= 5; $i++) }
{
$selected = ($i == $extra_row['question_type']) ? ' selected="selected"' : ''; $extra_status_options = '';
$question_type_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>'; for($i = 0; $i<= 3; $i++)
} {
$selected = ($i == $extra_row['extra_status']) ? ' selected="selected"' : '';
$extra_status_options = ''; $extra_status_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
for($i = 0; $i<= 3; $i++) }
{
$selected = ($i == $extra_row['extra_status']) ? ' selected="selected"' : '';
$extra_status_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>'; // Did we submit?
} if ($update)
{
$data = array();
// Did we submit? if (!check_form_key($form_key))
if ($update) {
{ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING);
$data = array(); }
if (!check_form_key($form_key)) $extra_row['extra_no'] = $extra_no;
{ $extra_row['question_type'] = $this->request->variable('question_type', $extra_row['question_type']);
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING); $extra_row['question'] = $this->request->variable('question', $extra_row['question'], true);
} $extra_row['matchday'] = $this->request->variable('matchday', $extra_row['matchday']);
$extra_row['extra_no'] = $extra_no; $extra_row['matchday_eval'] = $this->request->variable('matchday_eval', $extra_row['matchday_eval']);
$extra_row['question_type'] = $this->request->variable('question_type', $extra_row['question_type']); $extra_row['extra_points'] = $this->request->variable('extra_points', $extra_row['extra_points']);
$extra_row['question'] = $this->request->variable('question', $extra_row['question'], true); $extra_row['extra_status'] = $this->request->variable('extra_status', $extra_row['extra_status']);
$extra_row['matchday'] = $this->request->variable('matchday', $extra_row['matchday']);
$extra_row['matchday_eval'] = $this->request->variable('matchday_eval', $extra_row['matchday_eval']); $data['extra_points'] = (int) $extra_row['extra_points'];
$extra_row['extra_points'] = $this->request->variable('extra_points', $extra_row['extra_points']); $data['matchday'] = (int) $extra_row['matchday'];
$extra_row['extra_status'] = $this->request->variable('extra_status', $extra_row['extra_status']); $data['matchday_eval'] = (int) $extra_row['matchday_eval'];
$data['extra_points'] = (int) $extra_row['extra_points']; if ($data['matchday_eval'] < $data['matchday'])
$data['matchday'] = (int) $extra_row['matchday']; {
$data['matchday_eval'] = (int) $extra_row['matchday_eval']; $error[] = $user->lang['EVAL_BEFORE_DELIVERY'];
}
if ($data['matchday_eval'] < $data['matchday'])
{
$error[] = $user->lang['EVAL_BEFORE_DELIVERY']; if (!sizeof($error))
} {
$sql_ary = array(
'season' => (int) $season,
if (!sizeof($error)) 'league' => (int) $league,
{ 'extra_no' => (int) $extra_no,
$sql_ary = array( 'question_type' => (int) $extra_row['question_type'],
'season' => (int) $season, 'question' => strlen($extra_row['question']) ? $extra_row['question'] : '',
'league' => (int) $league, 'matchday' => (int) $extra_row['matchday'],
'extra_no' => (int) $extra_no, 'matchday_eval' => (int) $extra_row['matchday_eval'],
'question_type' => (int) $extra_row['question_type'], 'result' => $extra_row['result'],
'question' => strlen($extra_row['question']) ? $extra_row['question'] : '', 'extra_points' => (int) $extra_row['extra_points'],
'matchday' => (int) $extra_row['matchday'], 'extra_status' => (int) $extra_row['extra_status'],
'matchday_eval' => (int) $extra_row['matchday_eval'], );
'result' => $extra_row['result'],
'extra_points' => (int) $extra_row['extra_points'], $var_ary = array(
'extra_status' => (int) $extra_row['extra_status'], 'extra_points' => array('num', false, 0, 99),
); 'matchday' => array('num', false, 1),
'matchday_eval' => array('num', false, 1),
$var_ary = array( );
'extra_points' => array('num', false, 0, 99), if (!($error_vals = validate_data($data, $var_ary)))
'matchday' => array('num', false, 1), {
'matchday_eval' => array('num', false, 1), if ($action == 'add')
); {
if (!($error_vals = validate_data($data, $var_ary))) $sql = 'INSERT INTO ' . FOOTB_EXTRA . ' ' . $db->sql_build_array('INSERT', $sql_ary);
{ $db->sql_query($sql);
if ($action == 'add') }
{ else
$sql = 'INSERT INTO ' . FOOTB_EXTRA . ' ' . $db->sql_build_array('INSERT', $sql_ary); {
$db->sql_query($sql); $sql = 'UPDATE ' . FOOTB_EXTRA . '
} SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
else WHERE season = $season AND league = $league AND extra_no = $extra_no";
{ $db->sql_query($sql);
$sql = 'UPDATE ' . FOOTB_EXTRA . ' }
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " trigger_error($user->lang['EXTRA_UPDATED'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"));
WHERE season = $season AND league = $league AND extra_no = $extra_no"; }
$db->sql_query($sql); else
} {
trigger_error($user->lang['EXTRA_UPDATED'] . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league")); foreach ($error_vals as $error_val)
} {
else $error_msg[] = $user->lang[$error_val];
{ }
foreach ($error_vals as $error_val) $error[] = $user->lang['EXTRA_UPDATE_FAILED'];
{ $error = array_merge($error, $error_msg);
$error_msg[] = $user->lang[$error_val]; }
} }
$error[] = $user->lang['EXTRA_UPDATE_FAILED']; }
$error = array_merge($error, $error_msg); }
}
} $u_back = $this->u_action . "&amp;s=$season&amp;l=$league";
}
} $template->assign_vars(array(
'S_EDIT' => true,
$u_back = $this->u_action . "&amp;s=$season&amp;l=$league"; 'S_ADD_EXTRA' => ($action == 'add') ? true : false,
'S_ERROR' => (sizeof($error)) ? true : false,
$template->assign_vars(array( 'S_EDIT_EXTRAS' => ($existing_extra) ? false : true,
'S_EDIT' => true, 'S_QUESTION_TYPE_OPTIONS' => $question_type_options,
'S_ADD_EXTRA' => ($action == 'add') ? true : false, 'S_MATCHDAY_OPTIONS' => $matchday_options,
'S_ERROR' => (sizeof($error)) ? true : false, 'S_MATCHDAY_EVAL_OPTIONS' => $matchday_eval_options,
'S_EDIT_EXTRAS' => ($existing_extra) ? false : true, 'S_EXTRA_STATUS_OPTIONS' => $extra_status_options,
'S_QUESTION_TYPE_OPTIONS' => $question_type_options, 'S_VERSION_NO' => $this->config['football_version'],
'S_MATCHDAY_OPTIONS' => $matchday_options, 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'S_MATCHDAY_EVAL_OPTIONS' => $matchday_eval_options, 'SEASON' => $season,
'S_EXTRA_STATUS_OPTIONS' => $extra_status_options, 'SEASON_NAME' => $season_name,
'S_VERSION_NO' => $this->config['football_version'], 'LEAGUE' => $league,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', 'LEAGUE_NAME' => $league_name,
'SEASON' => $season, 'EXTRA_NO' => $extra_no,
'SEASON_NAME' => $season_name, 'QUESTION_TYPE' => $extra_row['question_type'],
'LEAGUE' => $league, 'QUESTION' => $extra_row['question'],
'LEAGUE_NAME' => $league_name, 'MATCHDAY' => $extra_row['matchday'],
'EXTRA_NO' => $extra_no, 'MATCHDAY_EVAL' => $extra_row['matchday_eval'],
'QUESTION_TYPE' => $extra_row['question_type'], 'MATCHDAY_OPTION' => $extra_row['matchday'],
'QUESTION' => $extra_row['question'], 'MATCHDAY_EVAL' => $extra_row['matchday_eval'],
'MATCHDAY' => $extra_row['matchday'], 'RESULT' => $extra_row['result'],
'MATCHDAY_EVAL' => $extra_row['matchday_eval'], 'EXTRA_POINTS' => $extra_row['extra_points'],
'MATCHDAY_OPTION' => $extra_row['matchday'], 'EXTRA_STATUS' => $extra_row['extra_status'],
'MATCHDAY_EVAL' => $extra_row['matchday_eval'], 'U_BACK' => $u_back,
'RESULT' => $extra_row['result'], 'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;s=$season&amp;l=$league",
'EXTRA_POINTS' => $extra_row['extra_points'], )
'EXTRA_STATUS' => $extra_row['extra_status'], );
'U_BACK' => $u_back, return;
'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;s=$season&amp;l=$league", break;
) }
);
return; // Check open matchday in league
break; $sql = 'SELECT *
} FROM ' . FOOTB_MATCHDAYS . "
WHERE season = $season
// Check open matchday in league AND league = $league
$sql = 'SELECT * AND status <= 0";
FROM ' . FOOTB_MATCHDAYS . " $result = $db->sql_query($sql);
WHERE season = $season $open_matchdays = sizeof($db->sql_fetchrowset($result));
AND league = $league $db->sql_freeresult($result);
AND status <= 0";
$result = $db->sql_query($sql); // Get us all the extra
$open_matchdays = sizeof($db->sql_fetchrowset($result)); $sql = "SELECT e.*,
$db->sql_freeresult($result); m1.matchday_name AS matchday_name,
m2.matchday_name AS matchday_eval_name
// Get us all the extra FROM " . FOOTB_EXTRA . ' AS e
$sql = "SELECT e.*, LEFT JOIN ' . FOOTB_MATCHDAYS . ' AS m1 ON (m1.season = e.season AND m1.league = e.league AND m1.matchday = e.matchday)
m1.matchday_name AS matchday_name, LEFT JOIN ' . FOOTB_MATCHDAYS . " AS m2 ON (m2.season = e.season AND m2.league = e.league AND m2.matchday = e.matchday_eval)
m2.matchday_name AS matchday_eval_name WHERE e.season = $season
FROM " . FOOTB_EXTRA . ' AS e AND e.league = $league
LEFT JOIN ' . FOOTB_MATCHDAYS . ' AS m1 ON (m1.season = e.season AND m1.league = e.league AND m1.matchday = e.matchday) ORDER BY e.extra_no ASC";
LEFT JOIN ' . FOOTB_MATCHDAYS . " AS m2 ON (m2.season = e.season AND m2.league = e.league AND m2.matchday = e.matchday_eval) $result = $db->sql_query($sql);
WHERE e.season = $season $rows_extra = $db->sql_fetchrowset($result);
AND e.league = $league $db->sql_freeresult($result);
ORDER BY e.extra_no ASC";
$result = $db->sql_query($sql); $template->assign_vars(array(
$rows_extra = $db->sql_fetchrowset($result); 'U_ACTION' => $this->u_action,
$db->sql_freeresult($result); 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)),
'S_SEASON' => $season,
$template->assign_vars(array( 'S_LEAGUE' => $league,
'U_ACTION' => $this->u_action, 'S_SEASON_OPTIONS' => $season_options,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), 'S_LEAGUE_OPTIONS' => $league_options,
'S_SEASON' => $season, 'S_EXTRA_ADD' => ($open_matchdays) ? true : false,
'S_LEAGUE' => $league, 'S_VERSION_NO' => $this->config['football_version'],
'S_SEASON_OPTIONS' => $season_options, )
'S_LEAGUE_OPTIONS' => $league_options, );
'S_EXTRA_ADD' => ($open_matchdays) ? true : false,
'S_VERSION_NO' => $this->config['football_version'], // Check if the user is allowed to delete a extra.
) if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete'])
); {
$allow_delete = false;
// Check if the user is allowed to delete a extra. }
if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) else
{ {
$allow_delete = false; $allow_delete = true;
} }
else
{ $row_number = 0;
$allow_delete = true; foreach ($rows_extra as $row_extra)
} {
$row_number++;
$row_number = 0; $row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
foreach ($rows_extra as $row_extra) $template->assign_block_vars('extras', array(
{ 'ROW_CLASS' => $row_class,
$row_number++; 'EXTRA_NO' => $row_extra['extra_no'],
$row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; 'QUESTION_TYPE' => $row_extra['question_type'],
$template->assign_block_vars('extras', array( 'QUESTION' => $row_extra['question'],
'ROW_CLASS' => $row_class, 'MATCHDAY' => (strlen($row_extra['matchday_name']) > 0) ? $row_extra['matchday_name'] : $row_extra['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']),
'EXTRA_NO' => $row_extra['extra_no'], 'MATCHDAY_EVAL' => (strlen($row_extra['matchday_name']) > 0) ? $row_extra['matchday_eval_name'] : $row_extra['matchday_eval'] . '. ' . sprintf($user->lang['MATCHDAY']),
'QUESTION_TYPE' => $row_extra['question_type'], 'EXTRA_POINTS' => $row_extra['extra_points'],
'QUESTION' => $row_extra['question'], 'EXTRA_STATUS' => $row_extra['extra_status'],
'MATCHDAY' => (strlen($row_extra['matchday_name']) > 0) ? $row_extra['matchday_name'] : $row_extra['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']), 'U_EDIT' => "{$this->u_action}&amp;action=edit&amp;s=" . $season . "&amp;l=" .$league . "&amp;e=" .$row_extra['extra_no'],
'MATCHDAY_EVAL' => (strlen($row_extra['matchday_name']) > 0) ? $row_extra['matchday_eval_name'] : $row_extra['matchday_eval'] . '. ' . sprintf($user->lang['MATCHDAY']), 'U_DELETE' => ($allow_delete) ? "{$this->u_action}&amp;action=delete&amp;s=" . $season . "&amp;l=" . $league . "&amp;e=" . $row_extra['extra_no'] : '',
'EXTRA_POINTS' => $row_extra['extra_points'], )
'EXTRA_STATUS' => $row_extra['extra_status'], );
'U_EDIT' => "{$this->u_action}&amp;action=edit&amp;s=" . $season . "&amp;l=" .$league . "&amp;e=" .$row_extra['extra_no'], }
'U_DELETE' => ($allow_delete) ? "{$this->u_action}&amp;action=delete&amp;s=" . $season . "&amp;l=" . $league . "&amp;e=" . $row_extra['extra_no'] : '', }
) }
);
}
}
}
?> ?>

View File

@@ -1,426 +1,438 @@
<?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_module class football_module
{ {
var $new_config = array(); var $new_config = array();
public $u_action; public $u_action;
protected $db, $user, $template, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; protected $db, $user, $template, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
protected $root_path, $request, $php_ext, $log, $phpbb_container, $version_check; protected $root_path, $request, $php_ext, $log, $phpbb_container, $version_check;
public function __construct() public function __construct()
{ {
global $db, $user, $request, $template, $phpbb_container; global $db, $user, $request, $template, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang_ext('football/football', 'help_football'); $user->add_lang_ext('football/football', 'help_football');
$user->add_lang_ext('football/football', 'football'); $user->add_lang_ext('football/football', 'football');
$user->add_lang_ext('football/football', 'info_acp_football'); $user->add_lang_ext('football/football', 'info_acp_football');
$this->root_path = $phpbb_root_path . 'ext/football/football/'; $this->root_path = $phpbb_root_path . 'ext/football/football/';
$this->config = $config; $this->config = $config;
$this->request = $request; $this->request = $request;
$this->phpbb_root_path = $phpbb_root_path; $this->phpbb_root_path = $phpbb_root_path;
$this->phpbb_admin_path = $phpbb_admin_path; $this->phpbb_admin_path = $phpbb_admin_path;
$this->php_ext = $phpEx; $this->php_ext = $phpEx;
$this->phpbb_container = $phpbb_container; $this->phpbb_container = $phpbb_container;
$this->version_check = $this->phpbb_container->get('football.football.version.check'); $this->version_check = $this->phpbb_container->get('football.football.version.check');
if(!function_exists('season_info')) if(!function_exists('season_info'))
{ {
include($this->root_path . 'includes/functions.' . $this->php_ext); include($this->root_path . 'includes/functions.' . $this->php_ext);
} }
if (!defined('FOOTB_SEASONS')) if (!defined('FOOTB_SEASONS'))
{ {
include($this->root_path . 'includes/constants.' . $this->php_ext); include($this->root_path . 'includes/constants.' . $this->php_ext);
} }
} }
function main($id, $mode) function main($id, $mode)
{ {
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $phpbb_log; global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info, $phpbb_log;
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
$provider = new \phpbb\controller\ provider();
$symphony_request = new \phpbb\ symfony_request($request); $helper = $phpbb_container->get('controller.helper');
$filesystem = new \phpbb\ filesystem();
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); $user->add_lang('acp/board');
$user->add_lang('acp/board'); $action = $this->request->variable('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
$action = $this->request->variable('action', '');
$submit = (isset($_POST['submit'])) ? true : false; $form_key = 'acp_football';
add_form_key($form_key);
$form_key = 'acp_football';
add_form_key($form_key); switch ($mode)
{
switch ($mode) case 'userguide':
{ $this->page_title = 'ACP_FOOTBALL_USERGUIDE';
case 'userguide': $this->tpl_name = 'acp_football_userguide';
$this->page_title = 'ACP_FOOTBALL_USERGUIDE';
$this->tpl_name = 'acp_football_userguide'; $template->assign_vars(array(
'S_IN_FOOTBALL_USERGUIDE' => true,
$template->assign_vars(array( 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet')),
'S_IN_FOOTBALL_USERGUIDE' => true, 'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'],
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet')), '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'] . '" />',
'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'], 'S_VERSION_NO' => $this->config['football_version'],
'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'],
)); // Pull the array data from the lang pack
foreach ($user->lang['FOOTBALL_HELP_FAQ'] as $help_ary)
// Pull the array data from the lang pack {
foreach ($user->help as $help_ary) if ($help_ary[0] == '--')
{ {
if ($help_ary[0] == '--') $template->assign_block_vars('userguide_block', array(
{ 'BLOCK_TITLE' => $help_ary[1])
$template->assign_block_vars('userguide_block', array( );
'BLOCK_TITLE' => $help_ary[1])
); continue;
}
continue;
} $template->assign_block_vars('userguide_block.userguide_row', array(
'USERGUIDE_QUESTION' => $help_ary[0],
$template->assign_block_vars('userguide_block.userguide_row', array( 'USERGUIDE_ANSWER' => $help_ary[1])
'USERGUIDE_QUESTION' => $help_ary[0], );
'USERGUIDE_ANSWER' => $help_ary[1]) }
); return;
} break;
return; case 'settings':
break; $display_vars = array(
case 'settings': 'title' => 'ACP_FOOTBALL_SETTINGS',
$display_vars = array( 'vars' => array(
'title' => 'ACP_FOOTBALL_SETTINGS', 'legend1' => 'ACP_FOOTBALL_SETTINGS',
'vars' => array( 'football_name' => array('lang' => 'FOOTBALL_NAME', 'validate' => 'string', 'type' => 'text:25:25', 'explain' => true),
'legend1' => 'ACP_FOOTBALL_SETTINGS', 'football_disable' => array('lang' => 'DISABLE_FOOTBALL', 'validate' => 'bool', 'type' => 'custom', 'method' => 'football_disable', 'explain' => true),
'football_name' => array('lang' => 'FOOTBALL_NAME', 'validate' => 'string', 'type' => 'text:25:25', 'explain' => true), 'football_disable_msg' => false,
'football_disable' => array('lang' => 'DISABLE_FOOTBALL', 'validate' => 'bool', 'type' => 'custom', 'method' => 'football_disable', 'explain' => true), 'football_fullscreen' => array('lang' => 'FOOTBALL_FULLSCREEN','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_disable_msg' => false, 'football_header_enable' => array('lang' => 'FOOTBALL_HEADER_ENABLE','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_fullscreen' => array('lang' => 'FOOTBALL_FULLSCREEN','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_guest_view' => array('lang' => 'GUEST_VIEW', '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_user_view' => array('lang' => 'USER_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_time_shift' => array('lang' => 'TIME_SHIFT', 'validate' => 'int', 'type' => 'select', 'method' => 'time_shift_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true),
'football_user_view' => array('lang' => 'USER_VIEW', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_info_display' => array('lang' => 'FOOTBALL_INFO', 'validate' => 'bool', 'type' => 'custom', 'method' => 'football_info', '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_info' => false,
'football_info_display' => array('lang' => 'FOOTBALL_INFO', 'validate' => 'bool', 'type' => 'custom', 'method' => 'football_info', 'explain' => true), 'football_win_name' => array('lang' => 'WIN_NAME', 'validate' => 'string', 'type' => 'text:6:6', 'explain' => true),
'football_info' => false, 'football_code' => array('lang' => 'FOOTBALL_CODE', 'validate' => 'string', 'type' => 'text:25:25', 'explain' => true),
'football_win_name' => array('lang' => 'WIN_NAME', 'validate' => 'string', 'type' => 'text:6:6', 'explain' => true), 'football_style' => array('lang' => 'FOOTBALL_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false),
'football_code' => array('lang' => 'FOOTBALL_CODE', 'validate' => 'string', 'type' => 'text:25:25', 'explain' => true), 'football_override_style' => array('lang' => 'FOOTBALL_OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_style' => array('lang' => 'FOOTBALL_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false), 'football_update_source' => array('lang' => 'FOOTBALL_UPDATE_SOURCE', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => true),
'football_override_style' => array('lang' => 'FOOTBALL_OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_update_code' => array('lang' => 'FOOTBALL_UPDATE_CODE', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true),
'football_update_source' => array('lang' => 'FOOTBALL_UPDATE_SOURCE', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => true),
'football_update_code' => array('lang' => 'FOOTBALL_UPDATE_CODE', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true), 'legend2' => 'GENERAL_SETTINGS',
'football_left_column_width' => array('lang' => 'LEFT_COLUMN', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'legend2' => 'GENERAL_SETTINGS', 'football_right_column_width' => array('lang' => 'RIGHT_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_display_last_users' => array('lang' => 'DISPLAY_LAST_USERS', '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_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),
'legend3' => 'ACP_SUBMIT_CHANGES', 'legend3' => 'ACP_SUBMIT_CHANGES',
) )
); );
// show the extension version check on Settings page // show the extension version check on Settings page
$this->version_check->check(); $this->version_check->check();
break; break;
case 'features': case 'features':
$display_vars = array( $display_vars = array(
'title' => 'ACP_FOOTBALL_FEATURES', 'title' => 'ACP_FOOTBALL_FEATURES',
'vars' => array( 'vars' => array(
'legend1' => 'ACP_FOOTBALL_FEATURES', 'legend1' => 'ACP_FOOTBALL_FEATURES',
'football_founder_delete' => array('lang' => 'FOUNDER_DELETE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_founder_delete' => array('lang' => 'FOUNDER_DELETE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_results_at_time' => array('lang' => 'RESULTS_AT_TIME', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_results_at_time' => array('lang' => 'RESULTS_AT_TIME', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_win_hits02' => array('lang' => 'WIN_HITS02', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_win_hits02' => array('lang' => 'WIN_HITS02', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_same_allowed' => array('lang' => 'SAME_ALLOWED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_same_allowed' => array('lang' => 'SAME_ALLOWED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_season_start' => array('lang' => 'FOOTBALL_SEASON_START', 'validate' => 'int', 'type' => 'select', 'method' => 'season_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true), 'football_season_start' => array('lang' => 'FOOTBALL_SEASON_START', 'validate' => 'int', 'type' => 'select', 'method' => 'season_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true),
'football_view_current' => array('lang' => 'VIEW_CURRENT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_view_current' => array('lang' => 'VIEW_CURRENT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_view_bets' => array('lang' => 'VIEW_BETS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_view_bets' => array('lang' => 'VIEW_BETS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_view_tendencies' => array('lang' => 'VIEW_TENDENCIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_view_tendencies' => array('lang' => 'VIEW_TENDENCIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_bank' => array('lang' => 'BANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_bank' => array('lang' => 'BANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_ult_points' => array('lang' => 'ULT_POINTS', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_up_method', 'explain' => true), 'football_ult_points' => array('lang' => 'ULT_POINTS', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_up_method', 'explain' => true),
'football_ult_points_factor'=> array('lang' => 'ULT_POINTS_FACTOR', 'validate' => 'dec:3:2','type' => 'text:4:10', 'explain' => true), 'football_ult_points_factor'=> array('lang' => 'ULT_POINTS_FACTOR', 'validate' => 'dec:3:2','type' => 'text:4:10', 'explain' => true),
'football_remember_enable' => array('lang' => 'FOOTBALL_REMEMBER_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_remember_enable' => array('lang' => 'FOOTBALL_REMEMBER_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_remember_next_run'=> array('lang' => 'FOOTBALL_REMEMBER_NEXT_RUN','validate' => 'int', 'type' => 'custom', 'method' => 'next_run', 'explain' => true), 'football_remember_next_run'=> array('lang' => 'FOOTBALL_REMEMBER_NEXT_RUN','validate' => 'int', 'type' => 'custom', 'method' => 'next_run', 'explain' => true),
'legend2' => 'ACP_SUBMIT_CHANGES', 'legend2' => 'ACP_SUBMIT_CHANGES',
) )
); );
break; break;
case 'menu': case 'menu':
$display_vars = array( $display_vars = array(
'title' => 'ACP_FOOTBALL_MENU', 'title' => 'ACP_FOOTBALL_MENU',
'vars' => array( 'vars' => array(
'legend1' => 'ACP_FOOTBALL_MENU', 'legend1' => 'ACP_FOOTBALL_MENU',
'football_breadcrumb' => array('lang' => 'FOOTBALL_BREADCRUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_breadcrumb' => array('lang' => 'FOOTBALL_BREADCRUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_side' => array('lang' => 'FOOTBALL_SIDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_side' => array('lang' => 'FOOTBALL_SIDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_menu' => array('lang' => 'FOOTBALL_MENU', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'football_menu' => array('lang' => 'FOOTBALL_MENU', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_menu_link1' => array('lang' => 'MENU_LINK1', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => true), 'football_menu_link1' => array('lang' => 'MENU_LINK1', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => true),
'football_menu_desc1' => array('lang' => 'MENU_DESC1', 'validate' => 'string', 'type' => 'text:20:20', 'explain' => true), 'football_menu_desc1' => array('lang' => 'MENU_DESC1', 'validate' => 'string', 'type' => 'text:20:20', 'explain' => true),
'football_menu_link2' => array('lang' => 'MENU_LINK2', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => false), 'football_menu_link2' => array('lang' => 'MENU_LINK2', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => false),
'football_menu_desc2' => array('lang' => 'MENU_DESC2', 'validate' => 'string', 'type' => 'text:20:20', 'explain' => false), 'football_menu_desc2' => array('lang' => 'MENU_DESC2', 'validate' => 'string', 'type' => 'text:20:20', 'explain' => false),
'football_menu_link3' => array('lang' => 'MENU_LINK3', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => false), 'football_menu_link3' => array('lang' => 'MENU_LINK3', 'validate' => 'string', 'type' => 'text:80:255', 'explain' => false),
'football_menu_desc3' => array('lang' => 'MENU_DESC3', 'validate' => 'string', 'type' => 'text:20:20', 'explain' => false), 'football_menu_desc3' => array('lang' => 'MENU_DESC3', 'validate' => 'string', 'type' => 'text:20:20', 'explain' => false),
) )
); );
break; break;
default: default:
trigger_error('NO_MODE', E_USER_ERROR); trigger_error('NO_MODE', E_USER_ERROR);
break; break;
} }
if (isset($display_vars['lang'])) if (isset($display_vars['lang']))
{ {
$user->add_lang($display_vars['lang']); $user->add_lang($display_vars['lang']);
} }
$this->new_config = $this->config; $this->new_config = $this->config;
$cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc($this->request->variable('config', array('' => ''), true)) : $this->new_config; $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc($this->request->variable('config', array('' => ''), true)) : $this->new_config;
$error = array(); $error = array();
// We validate the complete config if whished // We validate the complete config if whished
validate_config_vars($display_vars['vars'], $cfg_array, $error); validate_config_vars($display_vars['vars'], $cfg_array, $error);
if ($submit && !check_form_key($form_key)) if ($submit && !check_form_key($form_key))
{ {
$error[] = $user->lang['FORM_INVALID']; $error[] = $user->lang['FORM_INVALID'];
} }
// Do not write values if there is an error // Do not write values if there is an error
if (sizeof($error)) if (sizeof($error))
{ {
$submit = false; $submit = false;
} }
// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
foreach ($display_vars['vars'] as $this->config_name => $null) foreach ($display_vars['vars'] as $this->config_name => $null)
{ {
if (!isset($cfg_array[$this->config_name]) || strpos($this->config_name, 'legend') !== false) if (!isset($cfg_array[$this->config_name]) || strpos($this->config_name, 'legend') !== false)
{ {
continue; continue;
} }
$this->new_config[$this->config_name] = $this->config_value = $cfg_array[$this->config_name]; $this->new_config[$this->config_name] = $this->config_value = $cfg_array[$this->config_name];
if ($submit) if ($submit)
{ {
if ($this->config_name == 'football_ult_points' && $this->config_value) if ($this->config_name == 'football_ult_points' && $this->config_value)
{ {
$this->config->set('football_bank', 1); $this->config->set('football_bank', 1);
} }
if ($this->config_name == 'football_remember_enable') if ($this->config_name == 'football_remember_enable')
{ {
$day = $this->request->variable('next_run_day', 0); $day = $this->request->variable('next_run_day', 0);
$month = $this->request->variable('next_run_month', 0); $month = $this->request->variable('next_run_month', 0);
$year = $this->request->variable('next_run_year', 0); $year = $this->request->variable('next_run_year', 0);
$hour = $this->request->variable('next_run_hour', 0); $hour = $this->request->variable('next_run_hour', 0);
$minute = $this->request->variable('next_run_minute', 0); $minute = $this->request->variable('next_run_minute', 0);
$next_run = mktime($hour, $minute, 0, $month, $day, $year); $next_run = mktime($hour, $minute, 0, $month, $day, $year);
$this->config->set('football_remember_next_run', $next_run); $this->config->set('football_remember_next_run', $next_run);
} }
$this->config->set($this->config_name, $this->config_value); $this->config->set($this->config_name, $this->config_value);
} }
} }
if ($submit) if ($submit)
{ {
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FOOTBALL_' . strtoupper($mode)); $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FOOTBALL_' . strtoupper($mode));
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
} }
$this->tpl_name = 'acp_football'; $this->tpl_name = 'acp_football';
$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_main_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,
'ERROR_MSG' => implode('<br />', $error), 'ERROR_MSG' => implode('<br />', $error),
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'S_VERSION_NO' => $this->config['football_version'], 'S_VERSION_NO' => $this->config['football_version'],
) )
); );
// Output relevant page // Output relevant page
foreach ($display_vars['vars'] as $this->config_key => $vars) foreach ($display_vars['vars'] as $this->config_key => $vars)
{ {
if (!is_array($vars) && strpos($this->config_key, 'legend') === false) if (!is_array($vars) && strpos($this->config_key, 'legend') === false)
{ {
continue; continue;
} }
if (strpos($this->config_key, 'legend') !== false) if (strpos($this->config_key, 'legend') !== false)
{ {
$template->assign_block_vars('options', array( $template->assign_block_vars('options', array(
'S_LEGEND' => true, 'S_LEGEND' => true,
'LEGEND' => (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars, 'LEGEND' => (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars,
) )
); );
continue; continue;
} }
$type = explode(':', $vars['type']); $type = explode(':', $vars['type']);
$l_explain = ''; $l_explain = '';
if ($vars['explain'] && isset($vars['lang_explain'])) if ($vars['explain'] && isset($vars['lang_explain']))
{ {
$l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain']; $l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain'];
} }
else if ($vars['explain']) else if ($vars['explain'])
{ {
$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : ''; $l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
} }
$content = build_cfg_template($type, $this->config_key, $this->new_config, $this->config_key, $vars); $content = build_cfg_template($type, $this->config_key, $this->new_config, $this->config_key, $vars);
if (empty($content)) if (empty($content))
{ {
continue; continue;
} }
$template->assign_block_vars('options', array( $template->assign_block_vars('options', array(
'KEY' => $this->config_key, 'KEY' => $this->config_key,
'TITLE' => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'], 'TITLE' => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
'S_EXPLAIN' => $vars['explain'], 'S_EXPLAIN' => $vars['explain'],
'TITLE_EXPLAIN' => $l_explain, 'TITLE_EXPLAIN' => $l_explain,
'CONTENT' => $content, 'CONTENT' => $content,
) )
); );
unset($display_vars['vars'][$this->config_key]); unset($display_vars['vars'][$this->config_key]);
} }
} }
/** /**
* Football disable option and message * Football disable option and message
*/ */
function football_disable($value, $key) function football_disable($value, $key)
{ {
global $user; global $user;
$radio_ary = array(1 => 'YES', 0 => 'NO'); $radio_ary = array(1 => 'YES', 0 => 'NO');
return h_radio('config[football_disable]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[football_disable_msg]" maxlength="255" size="80" value="' . $this->new_config['football_disable_msg'] . '" />'; return h_radio('config[football_disable]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[football_disable_msg]" maxlength="255" size="80" value="' . $this->new_config['football_disable_msg'] . '" />';
} }
/** /**
* Football info option and message * Football info option and message
*/ */
function football_info($value, $key) function football_info($value, $key)
{ {
global $user; global $user;
$radio_ary = array(1 => 'YES', 0 => 'NO'); $radio_ary = array(1 => 'YES', 0 => 'NO');
return h_radio('config[football_info_display]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[football_info]" maxlength="255" size="80" value="' . $this->new_config['football_info'] . '" />'; return h_radio('config[football_info_display]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[football_info]" maxlength="255" size="80" value="' . $this->new_config['football_info'] . '" />';
} }
/** /**
* Select ultimate points method * Select ultimate points method
*/ */
function select_up_method($value, $key = '') function select_up_method($value, $key = '')
{ {
global $user, $config; global $user, $config;
$radio_ary = array(UP_NONE => 'UP_NONE', UP_WINS => 'UP_WINS', UP_POINTS => 'UP_POINTS'); $radio_ary = array(UP_NONE => 'UP_NONE', UP_WINS => 'UP_WINS', UP_POINTS => 'UP_POINTS');
return h_radio('config[football_ult_points]', $radio_ary, $value, $key); return h_radio('config[football_ult_points]', $radio_ary, $value, $key);
} }
function season_select($default = 0) function season_select($default = 0)
{ {
global $user, $db; global $user, $db;
$sql = 'SELECT DISTINCT s.season, s.season_name_short FROM ' . FOOTB_SEASONS . ' AS s $sql = 'SELECT DISTINCT s.season, s.season_name_short FROM ' . FOOTB_SEASONS . ' AS s
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 md ON (md.season = s.season AND md.league = l.league) INNER JOIN ' . FOOTB_MATCHDAYS . ' AS md ON (md.season = s.season AND md.league = l.league)
WHERE 1 WHERE 1
ORDER BY s.season DESC'; ORDER BY s.season DESC';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$selected = (0 == $default) ? ' selected="selected"' : ''; $selected = (0 == $default) ? ' selected="selected"' : '';
$season_options = '<option value="0"' . $selected . '>' . $user->lang['AUTO'] . '</option>'; $season_options = '<option value="0"' . $selected . '>' . $user->lang['AUTO'] . '</option>';
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
$selected = ($row['season'] == $default) ? ' selected="selected"' : ''; $selected = ($row['season'] == $default) ? ' selected="selected"' : '';
$season_options .= '<option value="' . $row['season'] . '"' . $selected . '>' . $row['season_name_short'] . '</option>'; $season_options .= '<option value="' . $row['season'] . '"' . $selected . '>' . $row['season_name_short'] . '</option>';
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
return $season_options; return $season_options;
} }
/** /**
* Adjust Cronjob EMail remember next un * Adjust Cronjob EMail remember next run
*/ */
function next_run($value, $key = '') function next_run($value, $key = '')
{ {
global $user, $db; global $user, $db;
$next_run = getdate($this->config['football_remember_next_run']); $next_run = getdate($this->config['football_remember_next_run']);
// Days // Days
$day_options = '<select name="next_run_day" id="next_run_day">'; $day_options = '<select name="next_run_day" id="next_run_day">';
for ($i = 1; $i < 32; $i++) for ($i = 1; $i < 32; $i++)
{ {
$selected = ($i == $next_run['mday']) ? ' selected="selected"' : ''; $selected = ($i == $next_run['mday']) ? ' selected="selected"' : '';
$day_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>'; $day_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
} }
$day_options .= '</select>'; $day_options .= '</select>';
// Months // Months
$month_options = '<select name="next_run_month" id="next_run_month">'; $month_options = '<select name="next_run_month" id="next_run_month">';
for ($i = 1; $i < 13; $i++) for ($i = 1; $i < 13; $i++)
{ {
$selected = ($i == $next_run['mon']) ? ' selected="selected"' : ''; $selected = ($i == $next_run['mon']) ? ' selected="selected"' : '';
$month_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>'; $month_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
} }
$month_options .= '</select>'; $month_options .= '</select>';
// Years // Years
$year_options = '<select name="next_run_year" id="next_run_year">'; $year_options = '<select name="next_run_year" id="next_run_year">';
for ($i = date("Y"); $i < (date("Y") + 1); $i++) for ($i = date("Y"); $i < (date("Y") + 1); $i++)
{ {
$selected = ($i == $next_run['year']) ? ' selected="selected"' : ''; $selected = ($i == $next_run['year']) ? ' selected="selected"' : '';
$year_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>'; $year_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
} }
$year_options .= '</select>'; $year_options .= '</select>';
// Hours // Hours
$hour_options = '<select name="next_run_hour" id="next_run_hour">'; $hour_options = '<select name="next_run_hour" id="next_run_hour">';
for ($i = 0; $i < 24; $i++) for ($i = 0; $i < 24; $i++)
{ {
$selected = ($i == $next_run['hours']) ? ' selected="selected"' : ''; $selected = ($i == $next_run['hours']) ? ' selected="selected"' : '';
$hour_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>'; $hour_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
} }
$hour_options .= '</select>'; $hour_options .= '</select>';
// Minutes // Minutes
$minute_options = '<select name="next_run_minute" id="next_run_minute">'; $minute_options = '<select name="next_run_minute" id="next_run_minute">';
for ($i = 0; $i < 60; $i++) for ($i = 0; $i < 60; $i++)
{ {
$selected = ($i == $next_run['minutes']) ? ' selected="selected"' : ''; $selected = ($i == $next_run['minutes']) ? ' selected="selected"' : '';
$minute_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>'; $minute_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
} }
$minute_options .= '</select>'; $minute_options .= '</select>';
return $user->lang['DAY'] . ': ' . $day_options . ' ' . $user->lang['MONTH'] . ': ' . $month_options . ' ' . $user->lang['YEAR'] . ': ' . return $user->lang['DAY'] . ': ' . $day_options . ' ' . $user->lang['MONTH'] . ': ' . $month_options . ' ' . $user->lang['YEAR'] . ': ' .
$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,257 +1,255 @@
<?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_module class ko_module
{ {
public $u_action; public $u_action;
protected $db, $user, $template, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; protected $db, $user, $template, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
protected $root_path, $request, $php_ext, $log; protected $root_path, $request, $php_ext, $log;
public function __construct() public function __construct()
{ {
global $db, $user, $request, $template; global $db, $user, $request, $template;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang_ext('football/football', 'football'); $user->add_lang_ext('football/football', 'football');
$user->add_lang_ext('football/football', 'info_acp_ko'); $user->add_lang_ext('football/football', 'info_acp_ko');
$this->root_path = $phpbb_root_path . 'ext/football/football/'; $this->root_path = $phpbb_root_path . 'ext/football/football/';
$this->config = $config; $this->config = $config;
$this->request = $request; $this->request = $request;
$this->phpbb_root_path = $phpbb_root_path; $this->phpbb_root_path = $phpbb_root_path;
$this->phpbb_admin_path = $phpbb_admin_path; $this->phpbb_admin_path = $phpbb_admin_path;
$this->php_ext = $phpEx; $this->php_ext = $phpEx;
if(!function_exists('season_info')) if(!function_exists('season_info'))
{ {
include($this->root_path . 'includes/functions.' . $this->php_ext); include($this->root_path . 'includes/functions.' . $this->php_ext);
} }
if (!defined('FOOTB_SEASONS')) if (!defined('FOOTB_SEASONS'))
{ {
include($this->root_path . 'includes/constants.' . $this->php_ext); include($this->root_path . 'includes/constants.' . $this->php_ext);
} }
} }
function main($id, $mode) function main($id, $mode)
{ {
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
$provider = new \phpbb\controller\ provider();
$symphony_request = new \phpbb\ symfony_request($request); $helper = $phpbb_container->get('controller.helper');
$filesystem = new \phpbb\ filesystem();
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); $this->tpl_name = 'acp_football_ko';
$this->page_title = 'ACP_FOOTBALL_KO_MANAGE';
$this->tpl_name = 'acp_football_ko';
$this->page_title = 'ACP_FOOTBALL_KO_MANAGE'; $form_key = 'acp_football_ko';
add_form_key($form_key);
$form_key = 'acp_football_ko';
add_form_key($form_key); include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); // Check and set some common vars
$action = (isset($_POST['update'])) ? 'update' : $this->request->variable('action', '');
// Check and set some common vars $season = $this->request->variable('s', 0);
$action = (isset($_POST['update'])) ? 'update' : $this->request->variable('action', ''); $league = $this->request->variable('l', 0);
$season = $this->request->variable('s', 0); $matchday_from = $this->request->variable('matchday_from', 0);
$league = $this->request->variable('l', 0); $matchday_to = $this->request->variable('matchday_to', 0);
$matchday_from = $this->request->variable('matchday_from', 0); $matchday_new = $this->request->variable('matchday_new', 0);
$matchday_to = $this->request->variable('matchday_to', 0); $check_rank = $this->request->variable('check_rank', 0);
$matchday_new = $this->request->variable('matchday_new', 0); $rank = $this->request->variable('rank', 2);
$check_rank = $this->request->variable('check_rank', 0); $move_rank = $this->request->variable('move_rank', 3);
$rank = $this->request->variable('rank', 2); $move_league = $this->request->variable('move_league', 0);
$move_rank = $this->request->variable('move_rank', 3); $move_matchday = $this->request->variable('move_matchday', 8);
$move_league = $this->request->variable('move_league', 0);
$move_matchday = $this->request->variable('move_matchday', 8); // Clear some vars
$error = array();
// Clear some vars $success = array();
$error = array();
$success = array(); $curr_season = curr_season();
// Grab current season
$curr_season = curr_season(); if (!$season)
// Grab current season {
if (!$season) $season = $curr_season;
{ }
$season = $curr_season;
} // Grab basic data for select season
if ($season)
// Grab basic data for select season {
if ($season) $sql = 'SELECT
{ DISTINCT s.*
$sql = 'SELECT FROM ' . FOOTB_SEASONS . ' AS s
DISTINCT s.* LEFT JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season)
FROM ' . FOOTB_SEASONS . ' AS s WHERE l.league_type = 2
LEFT JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season) ORDER BY s.season DESC';
WHERE l.league_type = 2 $result = $db->sql_query($sql);
ORDER BY s.season DESC';
$result = $db->sql_query($sql); $season_options = '';
while ($row = $db->sql_fetchrow($result))
$season_options = ''; {
while ($row = $db->sql_fetchrow($result)) $selected = ($season && $row['season'] == $season) ? ' selected="selected"' : '';
{ $season_options .= '<option value="' . $row['season'] . '"' . $selected . '>' . $row['season_name_short'] . '</option>';
$selected = ($season && $row['season'] == $season) ? ' selected="selected"' : ''; if ($selected <> '')
$season_options .= '<option value="' . $row['season'] . '"' . $selected . '>' . $row['season_name_short'] . '</option>'; {
if ($selected <> '') $season_name = $row['season_name_short'];
{ }
$season_name = $row['season_name_short']; }
} $db->sql_freeresult($result);
} }
$db->sql_freeresult($result); else
} {
else trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
{ }
trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
} // Grab basic data for select league
$sql = 'SELECT *
// Grab basic data for select league FROM ' . FOOTB_LEAGUES . '
$sql = 'SELECT * WHERE season = ' . $season . '
FROM ' . FOOTB_LEAGUES . ' AND league_type = ' . LEAGUE_KO . '
WHERE season = ' . $season . ' ORDER BY league ASC';
AND league_type = ' . LEAGUE_KO . ' $result = $db->sql_query($sql);
ORDER BY league ASC';
$result = $db->sql_query($sql); $league_options = '';
if ($move_league == 0)
$league_options = ''; {
if ($move_league == 0) $league_move_options = '<option value="0" selected="selected">' . sprintf($user->lang['CHOOSE_LEAGUE']) . '</option>';
{ }
$league_move_options = '<option value="0" selected="selected">' . sprintf($user->lang['CHOOSE_LEAGUE']) . '</option>'; else
} {
else $league_move_options = '<option value="0">' . sprintf($user->lang['CHOOSE_LEAGUE']) . '</option>';
{ }
$league_move_options = '<option value="0">' . sprintf($user->lang['CHOOSE_LEAGUE']) . '</option>'; while ($row = $db->sql_fetchrow($result))
} {
while ($row = $db->sql_fetchrow($result)) // Grab current league
{ if (!$league)
// Grab current league {
if (!$league) $league = $row['league'];
{ }
$league = $row['league']; $selected = ($league && $row['league'] == $league) ? ' selected="selected"' : '';
} $league_options .= '<option value="' . $row['league'] . '"' . $selected . '>' . $row['league_name'] . '</option>';
$selected = ($league && $row['league'] == $league) ? ' selected="selected"' : ''; if ($selected <> '')
$league_options .= '<option value="' . $row['league'] . '"' . $selected . '>' . $row['league_name'] . '</option>'; {
if ($selected <> '') $league_matchdays = $row['matchdays'];
{ $matches_matchday = $row['matches_on_matchday'];
$league_matchdays = $row['matchdays']; $league_name = $row['league_name'];
$matches_matchday = $row['matches_on_matchday']; }
$league_name = $row['league_name']; else
} {
else $selected_move = ($move_league && $row['league'] == $move_league) ? ' selected="selected"' : '';
{ $league_move_options .= '<option value="' . $row['league'] . '"' . $selected_move . '>' . $row['league_name'] . '</option>';
$selected_move = ($move_league && $row['league'] == $move_league) ? ' selected="selected"' : ''; }
$league_move_options .= '<option value="' . $row['league'] . '"' . $selected_move . '>' . $row['league_name'] . '</option>'; }
} $db->sql_freeresult($result);
}
$db->sql_freeresult($result); if (!$league)
{
if (!$league) trigger_error(sprintf($user->lang['NO_LEAGUE'], $season) . adm_back_link($this->u_action . "&amp;s=$season"), E_USER_WARNING);
{ }
trigger_error(sprintf($user->lang['NO_LEAGUE'], $season) . adm_back_link($this->u_action . "&amp;s=$season"), E_USER_WARNING);
} // Grab basic data for select matchday
if (!$matchday_from)
// Grab basic data for select matchday {
if (!$matchday_from) $matchday_from = curr_matchday($season, $league);
{ if ($matchday_from > 1)
$matchday_from = curr_matchday($season, $league); {
if ($matchday_from > 1) $matchday_from = $matchday_from - 1;
{ }
$matchday_from = $matchday_from - 1; }
} if (!$matchday_to)
} {
if (!$matchday_to) $matchday_to = $matchday_from;
{ }
$matchday_to = $matchday_from; if (!$matchday_new)
} {
if (!$matchday_new) $matchday_new = $matchday_to + 1;
{ }
$matchday_new = $matchday_to + 1;
} $sql = 'SELECT *
FROM ' . FOOTB_MATCHDAYS . "
$sql = 'SELECT * WHERE season = $season
FROM ' . FOOTB_MATCHDAYS . " AND league = $league
WHERE season = $season ORDER BY matchday ASC";
AND league = $league $result = $db->sql_query($sql);
ORDER BY matchday ASC";
$result = $db->sql_query($sql); $matchday_from_options = '';
$matchday_to_options = '';
$matchday_from_options = ''; $matchday_new_options = '';
$matchday_to_options = ''; while ($row = $db->sql_fetchrow($result))
$matchday_new_options = ''; {
while ($row = $db->sql_fetchrow($result)) $selected_from = ($matchday_from && $row['matchday'] == $matchday_from) ? ' selected="selected"' : '';
{ $selected_to = ($matchday_to && $row['matchday'] == $matchday_to) ? ' selected="selected"' : '';
$selected_from = ($matchday_from && $row['matchday'] == $matchday_from) ? ' selected="selected"' : ''; $selected_new = ($matchday_new && $row['matchday'] == $matchday_new) ? ' selected="selected"' : '';
$selected_to = ($matchday_to && $row['matchday'] == $matchday_to) ? ' selected="selected"' : ''; $day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']);
$selected_new = ($matchday_new && $row['matchday'] == $matchday_new) ? ' selected="selected"' : ''; $matchday_from_options .= '<option value="' . $row['matchday'] . '"' . $selected_from . '>' . $day_name . '</option>';
$day_name = (strlen($row['matchday_name']) > 0) ? $row['matchday_name'] : $row['matchday'] . '. ' . sprintf($user->lang['MATCHDAY']); $matchday_to_options .= '<option value="' . $row['matchday'] . '"' . $selected_to . '>' . $day_name . '</option>';
$matchday_from_options .= '<option value="' . $row['matchday'] . '"' . $selected_from . '>' . $day_name . '</option>'; $matchday_new_options .= '<option value="' . $row['matchday'] . '"' . $selected_new . '>' . $day_name . '</option>';
$matchday_to_options .= '<option value="' . $row['matchday'] . '"' . $selected_to . '>' . $day_name . '</option>'; }
$matchday_new_options .= '<option value="' . $row['matchday'] . '"' . $selected_new . '>' . $day_name . '</option>'; $db->sql_freeresult($result);
} if ($matchday_from_options == '')
$db->sql_freeresult($result); {
if ($matchday_from_options == '') trigger_error(sprintf($user->lang['NO_MATCHDAY'], $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_name, $season) . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING);
} // Which page?
switch ($action)
// Which page? {
switch ($action) case 'update':
{ {
case 'update': if ($matchday_from > $matchday_to)
{ {
if ($matchday_from > $matchday_to) $error[] = sprintf($user->lang['ERROR_FROM_TO']);
{ }
$error[] = sprintf($user->lang['ERROR_FROM_TO']); if ($matchday_new <= $matchday_to)
} {
if ($matchday_new <= $matchday_to) $error[] = sprintf($user->lang['ERROR_TARGET']);
{ }
$error[] = sprintf($user->lang['ERROR_TARGET']); if (!sizeof($error))
} {
if (!sizeof($error)) if (1 == $check_rank)
{ {
if (1 == $check_rank) $success = ko_group_next_round($season, $league, $matchday_from, $matchday_to, $matchday_new, $rank, $move_rank, $move_league, $move_matchday);
{ }
$success = ko_group_next_round($season, $league, $matchday_from, $matchday_to, $matchday_new, $rank, $move_rank, $move_league, $move_matchday); else
} {
else $success = ko_next_round($season, $league, $matchday_from, $matchday_to, $matchday_new);
{ }
$success = ko_next_round($season, $league, $matchday_from, $matchday_to, $matchday_new); trigger_error($success . adm_back_link($this->u_action));
} }
trigger_error($success . adm_back_link($this->u_action)); }
} break;
} }
break;
} $template->assign_vars(array(
'U_ACTION' => $this->u_action,
$template->assign_vars(array( 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)),
'U_ACTION' => $this->u_action, 'S_ERROR' => (sizeof($error)) ? true : false,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet', 's' => $season, 'l' => $league)), 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'S_ERROR' => (sizeof($error)) ? true : false, 'S_SUCCESS' => (sizeof($success)) ? true : false,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', 'SUCCESS_MSG' => (sizeof($success)) ? implode('<br />', $success) : '',
'S_SUCCESS' => (sizeof($success)) ? true : false, 'S_SEASON_OPTIONS' => $season_options,
'SUCCESS_MSG' => (sizeof($success)) ? implode('<br />', $success) : '', 'S_LEAGUE_OPTIONS' => $league_options,
'S_SEASON_OPTIONS' => $season_options, 'S_SEASON' => $season,
'S_LEAGUE_OPTIONS' => $league_options, 'S_LEAGUE' => $league,
'S_SEASON' => $season, 'S_MATCHDAY_FROM_OPTIONS'=> $matchday_from_options,
'S_LEAGUE' => $league, 'S_MATCHDAY_TO_OPTIONS' => $matchday_to_options,
'S_MATCHDAY_FROM_OPTIONS'=> $matchday_from_options, 'S_MATCHDAY_NEW_OPTIONS'=> $matchday_new_options,
'S_MATCHDAY_TO_OPTIONS' => $matchday_to_options, 'S_CHECK_RANK' => $check_rank,
'S_MATCHDAY_NEW_OPTIONS'=> $matchday_new_options, 'S_RANK' => $rank,
'S_CHECK_RANK' => $check_rank, 'S_MOVE_RANK' => $move_rank,
'S_RANK' => $rank, 'S_MOVE_LEAGUE_OPTIONS' => $league_move_options,
'S_MOVE_RANK' => $move_rank, 'S_MOVE_MATCHDAY' => $move_matchday,
'S_MOVE_LEAGUE_OPTIONS' => $league_move_options, 'S_VERSION_NO' => $this->config['football_version'],
'S_MOVE_MATCHDAY' => $move_matchday, )
'S_VERSION_NO' => $this->config['football_version'], );
) }
); }
}
}
?> ?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,396 +1,394 @@
<?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 seasons_module class seasons_module
{ {
public $u_action; public $u_action;
protected $db, $user, $template, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; protected $db, $user, $template, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
protected $root_path, $request, $php_ext, $log; protected $root_path, $request, $php_ext, $log;
public function __construct() public function __construct()
{ {
global $db, $user, $request, $template; global $db, $user, $request, $template;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang_ext('football/football', 'football'); $user->add_lang_ext('football/football', 'football');
$user->add_lang_ext('football/football', 'info_acp_seasons'); $user->add_lang_ext('football/football', 'info_acp_seasons');
$this->root_path = $phpbb_root_path . 'ext/football/football/'; $this->root_path = $phpbb_root_path . 'ext/football/football/';
$this->config = $config; $this->config = $config;
$this->request = $request; $this->request = $request;
$this->phpbb_root_path = $phpbb_root_path; $this->phpbb_root_path = $phpbb_root_path;
$this->phpbb_admin_path = $phpbb_admin_path; $this->phpbb_admin_path = $phpbb_admin_path;
$this->php_ext = $phpEx; $this->php_ext = $phpEx;
if(!function_exists('season_info')) if(!function_exists('season_info'))
{ {
include($this->root_path . 'includes/functions.' . $this->php_ext); include($this->root_path . 'includes/functions.' . $this->php_ext);
} }
if (!defined('FOOTB_SEASONS')) if (!defined('FOOTB_SEASONS'))
{ {
include($this->root_path . 'includes/constants.' . $this->php_ext); include($this->root_path . 'includes/constants.' . $this->php_ext);
} }
} }
function main($id, $mode) function main($id, $mode)
{ {
global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info; global $db, $auth, $phpbb_container, $phpbb_admin_path, $league_info;
global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx; global $template, $user, $config, $phpbb_extension_manager, $request, $phpbb_root_path, $phpEx;
$provider = new \phpbb\controller\ provider();
$symphony_request = new \phpbb\ symfony_request($request); $helper = $phpbb_container->get('controller.helper');
$filesystem = new \phpbb\ filesystem();
$helper = new \phpbb\controller\ helper($template, $user, $config, $provider, $phpbb_extension_manager, $symphony_request, $request, $filesystem, $phpbb_root_path, $phpEx); $this->tpl_name = 'acp_football_seasons';
$this->page_title = 'ACP_FOOTBALL_SEASONS_MANAGE';
$this->tpl_name = 'acp_football_seasons';
$this->page_title = 'ACP_FOOTBALL_SEASONS_MANAGE'; $form_key = 'acp_football_seasons';
add_form_key($form_key);
$form_key = 'acp_football_seasons';
add_form_key($form_key); include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
include($phpbb_root_path . 'includes/functions_user.' . $phpEx); // Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', '');
// Check and set some common vars $season = $this->request->variable('s', 0);
$action = (isset($_POST['add'])) ? 'add' : $this->request->variable('action', ''); $edit = $this->request->variable('edit', 0);
$season = $this->request->variable('s', 0); $update = (isset($_POST['update'])) ? true : false;
$edit = $this->request->variable('edit', 0);
$update = (isset($_POST['update'])) ? true : false; // Clear some vars
$season_row = array();
// Clear some vars $error = array();
$season_row = array();
$error = array(); // Grab basic data for season, if season is set and exists
if ($season)
// Grab basic data for season, if season is set and exists {
if ($season) $sql = 'SELECT *
{ FROM ' . FOOTB_SEASONS . "
$sql = 'SELECT * WHERE season = $season";
FROM ' . FOOTB_SEASONS . " $result = $db->sql_query($sql);
WHERE season = $season"; $season_row = $db->sql_fetchrow($result);
$result = $db->sql_query($sql); $db->sql_freeresult($result);
$season_row = $db->sql_fetchrow($result); }
$db->sql_freeresult($result);
} // Which page?
switch ($action)
// Which page? {
switch ($action) case 'delete':
{ if (!$season)
case 'delete': {
if (!$season) trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
{ }
trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
} if (confirm_box(true))
{
if (confirm_box(true)) $error = '';
{ if (!$auth->acl_get('a_football_delete'))
$error = ''; {
if (!$auth->acl_get('a_football_delete')) trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
{ }
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete'])
} {
if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) trigger_error($user->lang['SEASONS_NO_DELETE'] . adm_back_link($this->u_action), E_USER_WARNING);
{ }
trigger_error($user->lang['SEASONS_NO_DELETE'] . adm_back_link($this->u_action), E_USER_WARNING); // Delete season
} $sql = 'DELETE FROM ' . FOOTB_SEASONS . "
// Delete season WHERE season = $season";
$sql = 'DELETE FROM ' . FOOTB_SEASONS . " $db->sql_query($sql);
WHERE season = $season";
$db->sql_query($sql); // Delete leagues
$sql = 'DELETE FROM ' . FOOTB_LEAGUES . "
// Delete leagues WHERE season = $season";
$sql = 'DELETE FROM ' . FOOTB_LEAGUES . " $db->sql_query($sql);
WHERE season = $season";
$db->sql_query($sql); // Delete matchdays
$sql = 'DELETE FROM ' . FOOTB_MATCHDAYS . "
// Delete matchdays WHERE season = $season";
$sql = 'DELETE FROM ' . FOOTB_MATCHDAYS . " $db->sql_query($sql);
WHERE season = $season";
$db->sql_query($sql); // Delete matches
$sql = 'DELETE FROM ' . FOOTB_MATCHES . "
// Delete matches WHERE season = $season";
$sql = 'DELETE FROM ' . FOOTB_MATCHES . " $db->sql_query($sql);
WHERE season = $season";
$db->sql_query($sql); // Delete teams
$sql = 'DELETE FROM ' . FOOTB_TEAMS . "
// Delete teams WHERE season = $season";
$sql = 'DELETE FROM ' . FOOTB_TEAMS . " $db->sql_query($sql);
WHERE season = $season";
$db->sql_query($sql); // Delete ranks
$sql = 'DELETE FROM ' . FOOTB_RANKS . "
// Delete ranks WHERE season = $season";
$sql = 'DELETE FROM ' . FOOTB_RANKS . " $db->sql_query($sql);
WHERE season = $season";
$db->sql_query($sql); // Delete bets
$sql = 'DELETE FROM ' . FOOTB_BETS . "
// Delete bets WHERE season = $season";
$sql = 'DELETE FROM ' . FOOTB_BETS . " $db->sql_query($sql);
WHERE season = $season";
$db->sql_query($sql); trigger_error($user->lang['SEASON_DELETED'] . adm_back_link($this->u_action));
}
trigger_error($user->lang['SEASON_DELETED'] . adm_back_link($this->u_action)); else
} {
else confirm_box(false, sprintf($user->lang['SEASON_CONFIRM_DELETE'], $season), build_hidden_fields(array(
{ 's' => $season,
confirm_box(false, sprintf($user->lang['SEASON_CONFIRM_DELETE'], $season), build_hidden_fields(array( 'mode' => $mode,
's' => $season, 'action' => $action))
'mode' => $mode, );
'action' => $action)) }
); break;
}
break; case 'add':
if ($season >= 1963 AND $season <= 2099)
case 'add': {
if ($season >= 1963 AND $season <= 2099) if ($season_row)
{ {
if ($season_row) if ($edit)
{ {
if ($edit) $error[] = $user->lang['SEASON_TAKEN'];
{ }
$error[] = $user->lang['SEASON_TAKEN']; else
} {
else trigger_error($user->lang['SEASON_TAKEN'] . adm_back_link($this->u_action), E_USER_WARNING);
{ }
trigger_error($user->lang['SEASON_TAKEN'] . adm_back_link($this->u_action), E_USER_WARNING); }
} $season_row['season_name'] = utf8_normalize_nfc($this->request->variable('season_name', '', true));
} if ($season_row['season_name'] <> '')
$season_row['season_name'] = utf8_normalize_nfc($this->request->variable('season_name', '', true)); {
if ($season_row['season_name'] <> '') $sql = 'SELECT
{ season_name
$sql = 'SELECT FROM ' . FOOTB_SEASONS . "
season_name WHERE season_name = '" . $season_row['season_name'] . "'";
FROM ' . FOOTB_SEASONS . " $result = $db->sql_query($sql);
WHERE season_name = '" . $season_row['season_name'] . "'"; $row = $db->sql_fetchrow($result);
$result = $db->sql_query($sql); $db->sql_freeresult($result);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); if ($row)
{
if ($row) $error[] = $user->lang['SEASON_NAME_TAKEN'];
{ }
$error[] = $user->lang['SEASON_NAME_TAKEN']; }
} else
} {
else $intseason = ((int) $season) - 1;
{ $season_row['season_name'] = $user->lang['SEASON'] . ' ' . $intseason . '/' . $season;
$intseason = ((int) $season) - 1; }
$season_row['season_name'] = $user->lang['SEASON'] . ' ' . $intseason . '/' . $season;
} $season_row['season_name_short'] = utf8_normalize_nfc($this->request->variable('season_short', '', true));
if ($season_row['season_name_short'] <> '')
$season_row['season_name_short'] = utf8_normalize_nfc($this->request->variable('season_short', '', true)); {
if ($season_row['season_name_short'] <> '') $sql = 'SELECT
{ season_name_short
$sql = 'SELECT FROM ' . FOOTB_SEASONS . "
season_name_short WHERE season_name_short = '" . $season_row['season_name_short'] . "'";
FROM ' . FOOTB_SEASONS . " $result = $db->sql_query($sql);
WHERE season_name_short = '" . $season_row['season_name_short'] . "'"; $row = $db->sql_fetchrow($result);
$result = $db->sql_query($sql); $db->sql_freeresult($result);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); if ($row)
{
if ($row) $error[] = $user->lang['SEASON_SHORT_TAKEN'];
{ }
$error[] = $user->lang['SEASON_SHORT_TAKEN']; }
} else
} {
else $intseason = ((int) $season) - 1;
{ $season_row['season_name_short'] = $intseason . '/' . $season;
$intseason = ((int) $season) - 1; }
$season_row['season_name_short'] = $intseason . '/' . $season; }
} else
} {
else trigger_error($user->lang['SEASON_NUMBER'] . adm_back_link($this->u_action), E_USER_WARNING);
{ }
trigger_error($user->lang['SEASON_NUMBER'] . adm_back_link($this->u_action), E_USER_WARNING); // No break for edit add
} case 'edit':
// No break for edit add $data = array();
case 'edit':
$data = array(); if (!sizeof($error))
{
if (!sizeof($error)) if ($action == 'edit' && !$season)
{ {
if ($action == 'edit' && !$season) trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
{ }
trigger_error($user->lang['NO_SEASON'] . adm_back_link($this->u_action), E_USER_WARNING);
} // Did we submit?
if ($update)
// Did we submit? {
if ($update) if (!check_form_key($form_key))
{ {
if (!check_form_key($form_key)) trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
{ return;
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); }
return;
} $season_row['season_name'] = utf8_normalize_nfc($this->request->variable('season_name', '', true));
if ($season_row['season_name'] <> '')
$season_row['season_name'] = utf8_normalize_nfc($this->request->variable('season_name', '', true)); {
if ($season_row['season_name'] <> '') $sql = 'SELECT
{ season
$sql = 'SELECT FROM ' . FOOTB_SEASONS . "
season WHERE season_name = '" . $season_row['season_name'] . "'";
FROM ' . FOOTB_SEASONS . " $result = $db->sql_query($sql);
WHERE season_name = '" . $season_row['season_name'] . "'"; $row = $db->sql_fetchrow($result);
$result = $db->sql_query($sql); $db->sql_freeresult($result);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); if ($row)
{
if ($row) if ($row['season'] <> $season)
{ {
if ($row['season'] <> $season) $error[] = $user->lang['SEASON_NAME_TAKEN'];
{ }
$error[] = $user->lang['SEASON_NAME_TAKEN']; }
} }
} else
} {
else $error[] = $user->lang['SEASON_NAME_EMPTY'];
{ }
$error[] = $user->lang['SEASON_NAME_EMPTY'];
} $season_row['season_name_short'] = utf8_normalize_nfc($this->request->variable('season_short', '', true));
if ($season_row['season_name_short'] <> '')
$season_row['season_name_short'] = utf8_normalize_nfc($this->request->variable('season_short', '', true)); {
if ($season_row['season_name_short'] <> '') $sql = 'SELECT
{ season
$sql = 'SELECT FROM ' . FOOTB_SEASONS . "
season WHERE season_name_short = '" . $season_row['season_name_short'] . "'";
FROM ' . FOOTB_SEASONS . " $result = $db->sql_query($sql);
WHERE season_name_short = '" . $season_row['season_name_short'] . "'"; $row = $db->sql_fetchrow($result);
$result = $db->sql_query($sql); $db->sql_freeresult($result);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); if ($row)
{
if ($row) if ($row['season'] <> $season)
{ {
if ($row['season'] <> $season) $error[] = $user->lang['SEASON_SHORT_TAKEN'];
{ }
$error[] = $user->lang['SEASON_SHORT_TAKEN']; }
} }
} else
} {
else $error[] = $user->lang['SEASON_SHORT_EMPTY'];
{ }
$error[] = $user->lang['SEASON_SHORT_EMPTY']; if (!sizeof($error))
} {
if (!sizeof($error)) $sql_ary = array(
{ 'season' => (int) $season,
$sql_ary = array( 'season_name' => $season_row['season_name'],
'season' => (int) $season, 'season_name_short' => $season_row['season_name_short'],
'season_name' => $season_row['season_name'], );
'season_name_short' => $season_row['season_name_short'],
); $data['season'] = $season;
$data['season_name'] = $this->request->variable('season_name', '');
$data['season'] = $season; $data['season_short'] = $this->request->variable('season_short', '');
$data['season_name'] = $this->request->variable('season_name', '');
$data['season_short'] = $this->request->variable('season_short', ''); $var_ary = array(
'season' => array('num', false, 1963, 2099),
$var_ary = array( 'season_name' => array('string', false, 4, 20),
'season' => array('num', false, 1963, 2099), 'season_short' => array('string', false, 2, 10),
'season_name' => array('string', false, 4, 20), );
'season_short' => array('string', false, 2, 10), if (!($error_vals = validate_data($data, $var_ary)))
); {
if (!($error_vals = validate_data($data, $var_ary))) if ($action == 'add')
{ {
if ($action == 'add') $sql = 'INSERT INTO ' . FOOTB_SEASONS . ' ' . $db->sql_build_array('INSERT', $sql_ary);
{ $db->sql_query($sql);
$sql = 'INSERT INTO ' . FOOTB_SEASONS . ' ' . $db->sql_build_array('INSERT', $sql_ary); }
$db->sql_query($sql); else
} {
else $sql = 'UPDATE ' . FOOTB_SEASONS . '
{ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
$sql = 'UPDATE ' . FOOTB_SEASONS . ' WHERE season = $season";
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " $db->sql_query($sql);
WHERE season = $season"; }
$db->sql_query($sql); $message = ($action == 'edit') ? 'SEASON_UPDATED' : 'SEASON_CREATED';
} trigger_error($user->lang[$message] . adm_back_link($this->u_action));
$message = ($action == 'edit') ? 'SEASON_UPDATED' : 'SEASON_CREATED'; }
trigger_error($user->lang[$message] . adm_back_link($this->u_action)); else
} {
else foreach ($error_vals as $error_val)
{ {
foreach ($error_vals as $error_val) $error_msg[] = $user->lang[$error_val];
{ }
$error_msg[] = $user->lang[$error_val]; $message = ($action == 'edit') ? 'SEASON_UPDATE_FAILED' : 'SEASON_CREATE_FAILED';
} $error[] = $user->lang[$message];
$message = ($action == 'edit') ? 'SEASON_UPDATE_FAILED' : 'SEASON_CREATE_FAILED'; $error = array_merge($error, $error_msg);
$error[] = $user->lang[$message]; }
$error = array_merge($error, $error_msg); }
} }
} }
}
} $u_back = $this->u_action;
$u_back = $this->u_action; $template->assign_vars(array(
'S_EDIT' => true,
$template->assign_vars(array( 'S_ADD_SEASON' => ($action == 'add') ? true : false,
'S_EDIT' => true, 'S_ERROR' => (sizeof($error)) ? true : false,
'S_ADD_SEASON' => ($action == 'add') ? true : false, 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'S_ERROR' => (sizeof($error)) ? true : false, 'SEASON' => $season,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', 'SEASON_NAME' => $season_row['season_name'],
'SEASON' => $season, 'SEASON_SHORT' => $season_row['season_name_short'],
'SEASON_NAME' => $season_row['season_name'], 'U_BACK' => $u_back,
'SEASON_SHORT' => $season_row['season_name_short'], 'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;s=$season",
'U_BACK' => $u_back, )
'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;s=$season", );
) return;
); break;
return; }
break;
} $template->assign_vars(array(
'U_ACTION' => $this->u_action,
$template->assign_vars(array( 'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet')),
'U_ACTION' => $this->u_action, 'S_SEASON_ADD' => true,
'U_FOOTBALL' => $helper->route('football_main_controller',array('side' => 'bet')), )
'S_SEASON_ADD' => true, );
)
); // Get us all the seasons
$sql = 'SELECT
// Get us all the seasons s.season,
$sql = 'SELECT s.season_name,
s.season, s.season_name_short,
s.season_name, COUNT(l.league) AS leagues
s.season_name_short, FROM ' . FOOTB_SEASONS . ' s
COUNT(l.league) AS leagues LEFT JOIN ' . FOOTB_LEAGUES . ' l on l.season = s.season
FROM ' . FOOTB_SEASONS . ' s GROUP BY season
LEFT JOIN ' . FOOTB_LEAGUES . ' l on l.season = s.season ORDER BY season DESC';
GROUP BY season $result = $db->sql_query($sql);
ORDER BY season DESC'; $rows_seasons = $db->sql_fetchrowset($result);
$result = $db->sql_query($sql); $db->sql_freeresult($result);
$rows_seasons = $db->sql_fetchrowset($result);
$db->sql_freeresult($result); // Check if the user is allowed to delete a season.
if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete'])
// Check if the user is allowed to delete a season. {
if ($user->data['user_type'] != USER_FOUNDER && $this->config['football_founder_delete']) $allow_delete = false;
{ }
$allow_delete = false; else
} {
else $allow_delete = true;
{ }
$allow_delete = true;
} $row_number = 0;
foreach ($rows_seasons as $row_season)
$row_number = 0; {
foreach ($rows_seasons as $row_season) $row_number++;
{ $row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$row_number++; $template->assign_block_vars('seasons', array(
$row_class = (!($row_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; 'ROW_CLASS' => $row_class,
$template->assign_block_vars('seasons', array( 'SEASON' => $row_season['season'],
'ROW_CLASS' => $row_class, 'SEASON_NAME' => $row_season['season_name'],
'SEASON' => $row_season['season'], 'SEASON_SHORT' => $row_season['season_name_short'],
'SEASON_NAME' => $row_season['season_name'], 'LEAGUES' => $row_season['leagues'],
'SEASON_SHORT' => $row_season['season_name_short'], 'U_EDIT' => "{$this->u_action}&amp;action=edit&amp;s=" .$row_season['season'],
'LEAGUES' => $row_season['leagues'], 'U_DELETE' => ($allow_delete) ? "{$this->u_action}&amp;action=delete&amp;s=" . $row_season['season'] : '',
'U_EDIT' => "{$this->u_action}&amp;action=edit&amp;s=" .$row_season['season'], )
'U_DELETE' => ($allow_delete) ? "{$this->u_action}&amp;action=delete&amp;s=" . $row_season['season'] : '', );
) }
); }
} }
}
}
?> ?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -72,6 +72,7 @@
<th style="text-align:right">{L_GOALS_HOME}</th> <th style="text-align:right">{L_GOALS_HOME}</th>
<th></th> <th></th>
<th>{L_GOALS_GUEST}</th> <th>{L_GOALS_GUEST}</th>
<th>{L_BET_TIME}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -92,6 +93,7 @@
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td class="td_goals_guest"><input style="margin:0; width:30px;" type="number" <td class="td_goals_guest"><input style="margin:0; width:30px;" type="number"
name="goalsg{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_GUEST}" /></td> name="goalsg{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_GUEST}" /></td>
<td>{bet_edit.BET_TIME}</td>
</tr> </tr>
<!-- END bet_edit --> <!-- END bet_edit -->
</tbody> </tbody>

View File

@@ -78,7 +78,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)
@@ -183,7 +182,7 @@ foreach ($matches AS $match)
$total = 0; $total = 0;
} }
$bet_index++; $bet_index++;
$total += $user_bet['points']; $total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3) if ($user_bet['status'] < 3)
{ {
$colorstyle_total = ' color_provisionally'; $colorstyle_total = ' color_provisionally';
@@ -306,7 +305,7 @@ if ($count_matches > 0)
$total = 0; $total = 0;
} }
$bet_index++; $bet_index++;
$total += $user_bet['points']; $total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3) if ($user_bet['status'] < 3)
{ {
$colorstyle_total = ' color_provisionally'; $colorstyle_total = ' color_provisionally';
@@ -479,19 +478,14 @@ while ($row = $db->sql_fetchrow($result))
) )
); );
} }
$db->sql_freeresult($result_bet);
} }
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['ALL_BETS']); $sidename = sprintf($user->lang['ALL_BETS']);
$template->assign_vars(array( $template->assign_vars(array(
'S_DISPLAY_ALL_BETS' => true, 'S_DISPLAY_ALL_BETS' => true,
'S_SIDENAME' => $sidename, 'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['BET']),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => sprintf($user->lang['RESULTS']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_BET']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_RESULTS']),
'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday, 'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday,
'S_SPALTEN' => ($count_matches * 2) + 2, 'S_SPALTEN' => ($count_matches * 2) + 2,
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -1,391 +1,392 @@
<?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? // Can this user view Prediction Leagues pages?
if (!$config['football_guest_view']) if (!$config['football_guest_view'])
{ {
if ($user->data['user_id'] == ANONYMOUS) if ($user->data['user_id'] == ANONYMOUS)
{ {
trigger_error('NO_GUEST_VIEW'); trigger_error('NO_GUEST_VIEW');
} }
} }
if (!$config['football_user_view']) if (!$config['football_user_view'])
{ {
// Only Prediction League member should see this page // Only Prediction League member should see this page
// Check Prediction League authorisation // Check Prediction League authorisation
if ( !$this->auth->acl_get('u_use_football') ) if ( !$this->auth->acl_get('u_use_football') )
{ {
trigger_error('NO_AUTH_VIEW'); trigger_error('NO_AUTH_VIEW');
} }
} }
// Football disabled? // Football disabled?
if ($config['football_disable']) if ($config['football_disable'])
{ {
$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);
} }
$userid = $this->request->variable('u', 0); $userid = $this->request->variable('u', 0);
$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);
$error_message = ''; $error_message = '';
$username = '?'; $username = '?';
if (!$userid OR !$season OR !$league OR !$matchday) if (!$userid OR !$season OR !$league OR !$matchday)
{ {
$data_bet = false; $data_bet = false;
if (!$userid) if (!$userid)
{ {
$error_message .= sprintf($user->lang['NO_USERID']) . '<br />'; $error_message .= sprintf($user->lang['NO_USERID']) . '<br />';
} }
if (!$season) if (!$season)
{ {
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />'; $error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
} }
if (!$league) if (!$league)
{ {
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />'; $error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
} }
if (!$matchday) if (!$matchday)
{ {
$error_message .= sprintf($user->lang['NO_MATCHDAY']) . '<br />'; $error_message .= sprintf($user->lang['NO_MATCHDAY']) . '<br />';
} }
} }
else else
{ {
$season_info = season_info($season); $season_info = season_info($season);
if (sizeof($season_info)) if (sizeof($season_info))
{ {
$league_info = league_info($season, $league); $league_info = league_info($season, $league);
if (sizeof($league_info)) if (sizeof($league_info))
{ {
// Get username // Get username
$sql = 'SELECT username $sql = 'SELECT username
FROM ' . USERS_TABLE . " FROM ' . USERS_TABLE . "
WHERE user_id = $userid "; WHERE user_id = $userid ";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result)) if ($row = $db->sql_fetchrow($result))
{ {
$username = $row['username']; $username = $row['username'];
} }
else else
{ {
$data_bet = false; $data_bet = false;
$error_message .= sprintf($user->lang['NO_USERID']) . '<br />'; $error_message .= sprintf($user->lang['NO_USERID']) . '<br />';
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$display_group = false; $display_group = false;
$lang_dates = $user->lang['datetime']; $lang_dates = $user->lang['datetime'];
// Required for select_points function: // Required for select_points function:
$league_info = league_info($season, $league); $league_info = league_info($season, $league);
// Calculate matches and bets of matchday // Calculate matches and bets of matchday
$sql = "SELECT $sql = "SELECT
m.league, m.league,
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,
b.goals_home AS bet_home, b.goals_home AS bet_home,
b.goals_guest AS bet_guest, b.goals_guest AS bet_guest,
m.goals_home, m.goals_home,
m.goals_guest, m.goals_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,
" . select_points() . " " . select_points() . "
FROM " . FOOTB_MATCHES . ' AS m FROM " . FOOTB_MATCHES . ' AS m
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) 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)
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
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);
if ($row = $db->sql_fetchrow($result)) if ($row = $db->sql_fetchrow($result))
{ {
$data_bet = true; $data_bet = true;
$matchnumber = 0; $matchnumber = 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));
do do
{ {
$matchnumber++ ; $matchnumber++ ;
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$display_link = true; $display_link = true;
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];
} }
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'];
} }
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];
} }
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'];
} }
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['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 ($row['status'] < 1 && !$config['football_view_bets']) if ($row['status'] < 1 && !$config['football_view_bets'])
{ {
// hide bets // hide bets
$bet_home = ($row['bet_home'] == '') ? '&nbsp;' : '?'; $bet_home = ($row['bet_home'] == '') ? '&nbsp;' : '?';
$bet_guest = ($row['bet_guest'] == '') ? '&nbsp;' : '?'; $bet_guest = ($row['bet_guest'] == '') ? '&nbsp;' : '?';
} }
else else
{ {
$bet_home = ($row['bet_home'] == '') ? '&nbsp;' : $row['bet_home']; $bet_home = ($row['bet_home'] == '') ? '&nbsp;' : $row['bet_home'];
$bet_guest = ($row['bet_guest'] == '') ? '&nbsp;' : $row['bet_guest']; $bet_guest = ($row['bet_guest'] == '') ? '&nbsp;' : $row['bet_guest'];
} }
$colorstyle = color_style($row['status']); $colorstyle = color_style($row['status']);
$template->assign_block_vars('bet_view', array( $template->assign_block_vars('bet_view', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'LEAGUE_ID' => $row['league'], 'LEAGUE_ID' => $row['league'],
'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,
'BET_HOME' => $bet_home, 'BET_HOME' => $bet_home,
'BET_GUEST' => $bet_guest, 'BET_GUEST' => $bet_guest,
'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'],
'POINTS' => ($row['points'] == '') ? '&nbsp;' : $row['points'], 'POINTS' => ($row['points'] == '') ? '&nbsp;' : $row['points'],
'COLOR_STYLE' => $colorstyle, 'COLOR_STYLE' => $colorstyle,
) )
); );
} }
while ($row = $db->sql_fetchrow($result)); while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result); $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_BETS']) . '<br />';
} }
} }
else else
{ {
$data_bet = false; $data_bet = false;
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />'; $error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
} }
} }
else else
{ {
$data_bet = false; $data_bet = false;
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />'; $error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
} }
} }
// Calculate extra bets of matchday // Calculate extra bets of matchday
$sql = "SELECT e.*, $sql = "SELECT e.*,
eb.bet, eb.bet,
eb.bet_points, eb.bet_points,
t1.team_name AS result_team, t1.team_name AS result_team,
t2.team_name AS bet_team t2.team_name AS bet_team
FROM " . FOOTB_EXTRA . ' AS e FROM " . FOOTB_EXTRA . ' AS 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) 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)
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)
LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = e.season AND t2.league = e.league AND t2.team_id = eb.bet) LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = e.season AND t2.league = e.league AND t2.team_id = eb.bet)
WHERE e.season = $season WHERE e.season = $season
AND e.league = $league AND e.league = $league
AND e.matchday = $matchday AND e.matchday = $matchday
ORDER BY e.extra_no ASC"; ORDER BY e.extra_no ASC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$extra_bet = false; $extra_bet = false;
$extranumber = 0; $extranumber = 0;
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
$extra_bet = true; $extra_bet = true;
$extranumber++ ; $extranumber++ ;
$row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; $row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['extra_status'] < 1 && !$config['football_view_bets']) if ($row['extra_status'] < 1 && !$config['football_view_bets'])
{ {
// hide bets // hide bets
$bet = ($row['bet'] == '') ? '&nbsp;' : '?'; $bet = ($row['bet'] == '') ? '&nbsp;' : '?';
$bet_team = ($row['bet_team'] == NULL) ? '&nbsp;' : '?'; $bet_team = ($row['bet_team'] == NULL) ? '&nbsp;' : '?';
} }
else else
{ {
$bet = ($row['bet'] == '') ? '&nbsp;' : $row['bet']; $bet = ($row['bet'] == '') ? '&nbsp;' : $row['bet'];
$bet_team = ($row['bet_team'] == NULL) ? '&nbsp;' : $row['bet_team']; $bet_team = ($row['bet_team'] == NULL) ? '&nbsp;' : $row['bet_team'];
} }
$extra_colorstyle = color_style($row['extra_status']); $extra_colorstyle = color_style($row['extra_status']);
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':
{ {
$display_type = 2; $display_type = 2;
$eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']); $eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']);
} }
break; break;
case '5': case '5':
{ {
$display_type = 2; $display_type = 2;
$eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']); $eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']);
} }
break; break;
default : default :
{ {
$display_type = 2; $display_type = 2;
$eval_title = ''; $eval_title = '';
} }
break; break;
} }
$template->assign_block_vars('extra_view', array( $template->assign_block_vars('extra_view', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'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) ? $row['result_team'] : $row['result'], 'RESULT' => ($display_type == 1) ? $row['result_team'] : $row['result'],
'BET' => ($display_type == 1) ? $bet_team : $bet, 'BET' => ($display_type == 1) ? $bet_team : $bet,
'BET_POINTS' => $row['bet_points'], 'BET_POINTS' => $row['bet_points'],
'COLOR_STYLE' => $extra_colorstyle, 'COLOR_STYLE' => $extra_colorstyle,
) )
); );
} }
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['BET']);
if ($data_bet) $sidename = sprintf($user->lang['BET']);
{ if ($data_bet)
$template->assign_vars(array( {
'S_SIDENAME' => $sidename, $template->assign_vars(array(
'S_USER_NAME' => $username, 'S_SIDENAME' => $sidename,
'S_ERROR_MESSAGE' => $error_message, 'S_USER_NAME' => $username,
'S_FROM' => sprintf($user->lang['FROM_DAY_SEASON'], $matchday, $season), 'S_ERROR_MESSAGE' => $error_message,
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), 'S_FROM' => sprintf($user->lang['FROM_DAY_SEASON'], $matchday, $season),
'S_DATA_BET' => $data_bet, 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'S_DISPLAY_GROUP' => $display_group, 'S_DATA_BET' => $data_bet,
'S_EXTRA_BET' => $extra_bet, 'S_DISPLAY_GROUP' => $display_group,
) 'S_EXTRA_BET' => $extra_bet,
); )
);
// output page
page_header(sprintf($user->lang['BETS_OF']) . ' ' . $username); // output page
} page_header(sprintf($user->lang['BETS_OF']) . ' ' . $username);
else }
{ else
$template->assign_vars(array( {
'S_SIDENAME' => $sidename, $template->assign_vars(array(
'S_USER_NAME' => '', 'S_SIDENAME' => $sidename,
'S_ERROR_MESSAGE' => $error_message, 'S_USER_NAME' => '',
'S_FROM' => '', 'S_ERROR_MESSAGE' => $error_message,
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'), 'S_FROM' => '',
'S_DATA_BET' => $data_bet, 'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'S_DISPLAY_GROUP' => false, 'S_DATA_BET' => $data_bet,
) 'S_DISPLAY_GROUP' => false,
); )
);
// output page
page_header(sprintf($user->lang['BETS_OF'])); // output page
} page_header(sprintf($user->lang['BETS_OF']));
}
$template->set_filenames(array(
'body' => 'bet_popup.html') $template->set_filenames(array(
); 'body' => 'bet_popup.html')
);
page_footer();
page_footer();
?> ?>

View File

@@ -1,157 +1,75 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
exit; exit;
} }
$data_delivery = false;
$data_delivery = false; $user_id = $user->data['user_id'];
$user_id = $user->data['user_id']; $lang_dates = $user->lang['datetime'];
$lang_dates = $user->lang['datetime']; $index = 0;
$index = 0; $local_board_time = time() + ($config['football_time_shift'] * 3600);
$local_board_time = time() + (($config['board_timezone'] - $config['football_host_timezone']) * 3600); $sql = "SELECT
$sql = "(SELECT m.season,
m.season, m.league,
m.league, m.matchday,
m.matchday, l.league_name_short,
l.league_name_short, CASE m.matchday_name
CASE m.matchday_name WHEN ''
WHEN '' THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "')
THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "') ELSE m.matchday_name
ELSE m.matchday_name END AS matchday_name,
END AS matchday_name, IF(l.bet_in_time = 0, IF(ma.status = 0, m.delivery_date
CONCAT( , IF(ma.status = -1, m.delivery_date_2
CASE DATE_FORMAT(m.delivery_date,'%w') , m.delivery_date_3
WHEN 0 THEN '" . $lang_dates['Sun'] . "' )
WHEN 1 THEN '" . $lang_dates['Mon'] . "' )
WHEN 2 THEN '" . $lang_dates['Tue'] . "' , ma.match_datetime) AS delivery,
WHEN 3 THEN '" . $lang_dates['Wed'] . "' SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count,
WHEN 4 THEN '" . $lang_dates['Thu'] . "' COUNT(*) AS matches_count,
WHEN 5 THEN '" . $lang_dates['Fri'] . "' SUM(IF(eb.extra_no > 0, IF(eb.bet = '', 0, 1), 0)) AS extra_bets_count,
WHEN 6 THEN '" . $lang_dates['Sat'] . "' SUM(IF(e.extra_no > 0, 1, 0)) AS extra_count
ELSE 'Error' END, FROM " . FOOTB_MATCHDAYS . " AS m
DATE_FORMAT(m.delivery_date,' %d.%m.%y %H:%i') JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league)
) as delivery_time, JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = 0)
m.delivery_date AS delivery, JOIN " . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = ma.match_no AND b.user_id = $user_id)
SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count, 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)
COUNT(*) AS matches_count, 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)
SUM(IF(eb.extra_no > 0, IF(eb.bet = '', 0, 1), 0)) AS extra_bets_count, WHERE m.status <= 0
SUM(IF(e.extra_no > 0, 1, 0)) AS extra_count GROUP BY delivery, m.league
FROM " . FOOTB_MATCHDAYS . " AS m ORDER BY delivery, m.league";
JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league)
JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = 0) $result = $db->sql_query($sql);
JOIN " . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = ma.match_no AND b.user_id = $user_id) while($row = $db->sql_fetchrow($result) AND $index < 11)
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) $index++;
WHERE m.delivery_date > FROM_UNIXTIME('$local_board_time') $data_delivery = true;
AND m.status <= 0 $row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
GROUP BY m.delivery_date, m.league, b.user_id
) $template->assign_block_vars('delivery', array(
UNION 'ROW_CLASS' => $row_class,
(SELECT 'U_BET_LINK' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $row['season'], 'l' => $row['league'], 'm' => $row['matchday'])),
m.season, 'LEAGUE_SHORT' => $row['league_name_short'],
m.league, 'MATCHDAY_NAME' => $row['matchday_name'],
m.matchday, 'COLOR' => ($row['bets_count'] == $row['matches_count'] && $row['extra_bets_count'] == $row['extra_count']) ? 'green' : 'red',
l.league_name_short, 'TITLE' => ($row['bets_count'] == $row['matches_count']) ? sprintf($user->lang['DELIVERY_READY']) : sprintf($user->lang['DELIVERY_NOT_READY']),
CASE m.matchday_name 'DELIVERY' => $lang_dates[date("D", strtotime($row['delivery']))] . date(" d.m.y G:i", strtotime($row['delivery'])),
WHEN '' )
THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "') );
ELSE m.matchday_name }
END AS matchday_name, $db->sql_freeresult($result);
CONCAT(
CASE DATE_FORMAT(m.delivery_date_2,'%w') $template->assign_vars(array(
WHEN 0 THEN '" . $lang_dates['Sun'] . "' 'S_DISPLAY_DELIVERY' => $data_delivery,
WHEN 1 THEN '" . $lang_dates['Mon'] . "' 'S_DATA_DELIVERY' => $data_delivery,
WHEN 2 THEN '" . $lang_dates['Tue'] . "' )
WHEN 3 THEN '" . $lang_dates['Wed'] . "' );
WHEN 4 THEN '" . $lang_dates['Thu'] . "'
WHEN 5 THEN '" . $lang_dates['Fri'] . "'
WHEN 6 THEN '" . $lang_dates['Sat'] . "'
ELSE 'Error' END,
DATE_FORMAT(m.delivery_date_2,' %d.%m.%y %H:%i')
) as delivery_time,
m.delivery_date_2 AS delivery ,
SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count,
COUNT(*) AS matches_count,
0 AS extra_bets_count,
0 AS extra_count
FROM " . FOOTB_MATCHDAYS . " AS m
JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league)
JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = -1)
JOIN " . FOOTB_BETS . " AS b ON (b.season = ma.season AND b.league = ma.league AND b.match_no = ma.match_no AND b.user_id = $user_id)
WHERE m.delivery_date_2 > FROM_UNIXTIME('$local_board_time')
AND m.status <= 0
GROUP BY m.delivery_date, m.league, b.user_id
)
UNION
(SELECT
m.season,
m.league,
m.matchday,
l.league_name_short,
CASE m.matchday_name
WHEN ''
THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "')
ELSE m.matchday_name
END AS matchday_name,
CONCAT(
CASE DATE_FORMAT(m.delivery_date_3,'%w')
WHEN 0 THEN '" . $lang_dates['Sun'] . "'
WHEN 1 THEN '" . $lang_dates['Mon'] . "'
WHEN 2 THEN '" . $lang_dates['Tue'] . "'
WHEN 3 THEN '" . $lang_dates['Wed'] . "'
WHEN 4 THEN '" . $lang_dates['Thu'] . "'
WHEN 5 THEN '" . $lang_dates['Fri'] . "'
WHEN 6 THEN '" . $lang_dates['Sat'] . "'
ELSE 'Error' END,
DATE_FORMAT(m.delivery_date_3,' %d.%m.%y %H:%i')
) as delivery_time,
m.delivery_date_3 AS delivery,
SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count,
COUNT(*) AS matches_count,
0 AS extra_bets_count,
0 AS extra_count
FROM " . FOOTB_MATCHDAYS . " AS m
JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league)
JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = -2)
JOIN " . FOOTB_BETS . " AS b ON (b.season = ma.season AND b.league = ma.league AND b.match_no = ma.match_no AND b.user_id = $user_id)
WHERE m.delivery_date_3 > FROM_UNIXTIME('$local_board_time')
AND m.status <= 0
GROUP BY m.delivery_date, m.league, b.user_id
)
ORDER BY delivery, league";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result) AND $index < 11)
{
$index++;
$data_delivery = true;
$row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('delivery', array(
'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'])),
'LEAGUE_SHORT' => $row['league_name_short'],
'MATCHDAY_NAME' => $row['matchday_name'],
'COLOR' => ($row['bets_count'] == $row['matches_count'] && $row['extra_bets_count'] == $row['extra_count']) ? 'green' : 'red',
'TITLE' => ($row['bets_count'] == $row['matches_count']) ? sprintf($user->lang['DELIVERY_READY']) : sprintf($user->lang['DELIVERY_NOT_READY']),
'DELIVERY' => $row['delivery_time'],
)
);
}
$db->sql_freeresult($result);
$template->assign_vars(array(
'S_DISPLAY_DELIVERY' => $data_delivery,
'S_DATA_DELIVERY' => $data_delivery,
)
);
?> ?>

View File

@@ -1,134 +1,135 @@
<?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'); $this->user->add_lang_ext('football/football', 'info_acp_bank');
// Check Prediction League authorisation // Check Prediction League authorisation
if ( !$this->auth->acl_get('u_use_football') ) if ( !$this->auth->acl_get('u_use_football') )
{ {
trigger_error('NO_AUTH_VIEW'); trigger_error('NO_AUTH_VIEW');
} }
$action=''; $action='';
$phpbb_root_path = './../../'; $phpbb_root_path = './../../';
if (!$season OR !$league) if (!$season OR !$league)
{ {
redirect($this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league))); redirect($this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league)));
} }
else else
{ {
$season_info = season_info($season); $season_info = season_info($season);
if (!sizeof($season_info)) if (!sizeof($season_info))
{ {
$error_message = sprintf($user->lang['NO_SEASON']); $error_message = sprintf($user->lang['NO_SEASON']);
trigger_error($error_message); trigger_error($error_message);
} }
else else
{ {
$league_info = league_info($season, $league); $league_info = league_info($season, $league);
if (!sizeof($league_info)) if (!sizeof($league_info))
{ {
$error_message = sprintf($user->lang['NO_LEAGUE']); $error_message = sprintf($user->lang['NO_LEAGUE']);
trigger_error($error_message); trigger_error($error_message);
} }
else else
{ {
$bet_points = $league_info['bet_points']; $bet_points = $league_info['bet_points'];
$league_name =$league_info['league_name']; $league_name =$league_info['league_name'];
$league_short =$league_info['league_name_short']; $league_short =$league_info['league_name_short'];
$user_points = ''; $user_points = '';
global $phpbb_extension_manager; global $phpbb_extension_manager;
if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $config['points_enable']) if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $config['points_enable'])
{ {
$user_points = 'u.user_points,'; $user_points = 'u.user_points,';
} }
else else
{ {
$user_points = "0.00 AS user_points,"; $user_points = "0.00 AS user_points,";
} }
// Grab the members points // Grab the members points
$sql = "SELECT $sql = "SELECT
b.user_id, b.user_id,
u.username, u.username,
$user_points $user_points
$bet_points AS bet_points, $bet_points AS bet_points,
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_BET . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_bet_points,
SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_deposit, SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_deposit,
SUM(IF(p.points_type IN (' . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . '), SUM(IF(p.points_type IN (' . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . '),
IF(p.cash = 0, p.points, 0.00), IF(p.cash = 0, p.points, 0.00),
0.00)) AS no_cash_wins, 0.00)) AS no_cash_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 . ', IF(p.cash = 0, p.points, 0.00), 0.00)) AS no_cash_paid,
SUM(IF(p.points_type = ' . POINTS_DEPOSITED . ', p.points, 0.00)) AS deposit, 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, p.points * -1.0)) > 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, p.points * -1.0)), 0.00) AS new_deposit, SUM(IF(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points, p.points * -1.0)), 0.00) AS new_deposit,
SUM(IF(p.points_type IN (' . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . '), SUM(IF(p.points_type IN (' . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . '),
p.points, 0.00)) AS wins, p.points, 0.00)) AS wins,
SUM(IF(p.points_type = ' . POINTS_PAID . ', p.points, 0.00)) AS paid, SUM(IF(p.points_type = ' . POINTS_PAID . ', p.points, 0.00)) AS paid,
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 * -1.0, p.points)) > 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 * -1.0, p.points)), 0.00) AS new_pay
FROM ' . FOOTB_BETS . ' AS b FROM ' . FOOTB_BETS . ' AS b
JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id) JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id)
LEFT JOIN ' . FOOTB_POINTS . " AS p ON (p.season = $season AND p.league = $league AND p.user_id = b.user_id) 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 WHERE b.season = $season
AND b.league = $league AND b.league = $league
AND b.match_no = 1 AND b.match_no = 1
GROUP BY b.user_id GROUP BY b.user_id
ORDER BY u.username ASC"; ORDER BY u.username ASC";
if(!$result = $db->sql_query($sql)) if(!$result = $db->sql_query($sql))
{ {
trigger_error('NO_LEAGUE'); trigger_error('NO_LEAGUE');
} }
$user_rows = $db->sql_fetchrowset($result); $user_rows = $db->sql_fetchrowset($result);
$export_file = $league_short . '_' . $season . '_bank.csv'; $db->sql_freeresult($result);
$newline = "\r\n"; $export_file = $league_short . '_' . $season . '_bank.csv';
header('Pragma: no-cache'); $newline = "\r\n";
header("Content-Type: text/csv; name=\"$export_file\""); header('Pragma: no-cache');
header("Content-disposition: attachment; filename=$export_file"); header("Content-Type: text/csv; name=\"$export_file\"");
$export= ''; header("Content-disposition: attachment; filename=$export_file");
$export .= $league_name . ' ' . sprintf($user->lang['SEASON']) . ' ' . $season. $newline; $export= '';
$export .= sprintf($user->lang['NAME']) . ';' . $config['football_win_name'] . ';' . sprintf($user->lang['BET_POINTS']) . ';' . $export .= $league_name . ' ' . sprintf($user->lang['SEASON']) . ' ' . $season. $newline;
sprintf($user->lang['DEPOSITED']) . ';' . sprintf($user->lang['DEPOSIT']) . ';' . sprintf($user->lang['WINS']) . ';' . $export .= sprintf($user->lang['NAME']) . ';' . $config['football_win_name'] . ';' . sprintf($user->lang['BET_POINTS']) . ';' .
sprintf($user->lang['PAID']) . ';' . sprintf($user->lang['PAYOUT']) . ';' . $newline; sprintf($user->lang['DEPOSITED']) . ';' . sprintf($user->lang['DEPOSIT']) . ';' . sprintf($user->lang['WINS']) . ';' .
sprintf($user->lang['PAID']) . ';' . sprintf($user->lang['PAYOUT']) . ';' . $newline;
$curr_season = curr_season();
foreach ($user_rows as $user_row) $curr_season = curr_season();
{ foreach ($user_rows as $user_row)
if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $config['points_enable'] && $season == $curr_season) {
{ if ($phpbb_extension_manager->is_enabled('dmzx/ultimatepoints') && $config['points_enable'] && $season == $curr_season)
$no_cash_bet_points = ($user_row['no_cash_bet_points'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_bet_points']) . ')'; {
$no_cash_deposit = ($user_row['no_cash_deposit'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_deposit']) . ')'; $no_cash_bet_points = ($user_row['no_cash_bet_points'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_bet_points']) . ')';
$no_cash_wins = ($user_row['no_cash_wins'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_wins']) . ')'; $no_cash_deposit = ($user_row['no_cash_deposit'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_deposit']) . ')';
$no_cash_paid = ($user_row['no_cash_paid'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_paid']) . ')'; $no_cash_wins = ($user_row['no_cash_wins'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_wins']) . ')';
} $no_cash_paid = ($user_row['no_cash_paid'] == 0.00) ? '' : ' (' . str_replace('.', ',', $user_row['no_cash_paid']) . ')';
else }
{ else
$no_cash_bet_points = ''; {
$no_cash_deposit = ''; $no_cash_bet_points = '';
$no_cash_wins = ''; $no_cash_deposit = '';
$no_cash_paid = ''; $no_cash_wins = '';
} $no_cash_paid = '';
$export .= str_replace("\"", "\"\"", $user_row['username']) . ';' . }
str_replace('.', ',', $user_row['user_points']) . ';' . $export .= str_replace("\"", "\"\"", $user_row['username']) . ';' .
str_replace('.', ',', $user_row['bet_points']) . $no_cash_bet_points . ';' . str_replace('.', ',', $user_row['user_points']) . ';' .
str_replace('.', ',', $user_row['deposit']) . $no_cash_deposit . ';' . str_replace('.', ',', $user_row['bet_points']) . $no_cash_bet_points . ';' .
str_replace('.', ',', $user_row['new_deposit']) . ';' . str_replace('.', ',', $user_row['deposit']) . $no_cash_deposit . ';' .
str_replace('.', ',', $user_row['wins']) . $no_cash_wins . ';' . str_replace('.', ',', $user_row['new_deposit']) . ';' .
str_replace('.', ',', $user_row['paid']) . $no_cash_paid . ';' . str_replace('.', ',', $user_row['wins']) . $no_cash_wins . ';' .
str_replace('.', ',', $user_row['new_pay']) . ';' . $newline; str_replace('.', ',', $user_row['paid']) . $no_cash_paid . ';' .
} str_replace('.', ',', $user_row['new_pay']) . ';' . $newline;
echo utf8_decode($export); }
exit; echo utf8_decode($export);
} exit;
} }
} }
}
?> ?>

View File

@@ -1,87 +1,88 @@
<?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'); $this->user->add_lang_ext('football/football', 'info_acp_bank');
// Check Prediction League authorisation // Check Prediction League authorisation
if ( !$this->auth->acl_get('u_use_football') ) if ( !$this->auth->acl_get('u_use_football') )
{ {
trigger_error('NO_AUTH_VIEW'); trigger_error('NO_AUTH_VIEW');
} }
$action=''; $action='';
if (!$season) if (!$season)
{ {
redirect($this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season))); redirect($this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season)));
} }
else else
{ {
$season_info = season_info($season); $season_info = season_info($season);
if (!sizeof($season_info)) if (!sizeof($season_info))
{ {
$error_message = sprintf($user->lang['NO_SEASON']); $error_message = sprintf($user->lang['NO_SEASON']);
trigger_error($error_message); trigger_error($error_message);
} }
else else
{ {
// Grab the members points // Grab the members points
$sql = 'SELECT $sql = 'SELECT
u.username, u.username,
p.season, p.season,
p.league, p.league,
round(sum(if(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)),2) as saldo round(sum(if(p.points_type IN (' . POINTS_BET . ',' . POINTS_PAID . '), p.points * -1.0, p.points)),2) as saldo
FROM ' . FOOTB_POINTS . ' AS p FROM ' . FOOTB_POINTS . ' AS p
JOIN ' . USERS_TABLE . " AS u ON (u.user_id = p.user_id) JOIN ' . USERS_TABLE . " AS u ON (u.user_id = p.user_id)
WHERE p.season <= $season WHERE p.season <= $season
GROUP BY p.season, p.league, u.username GROUP BY p.season, p.league, u.username
HAVING saldo <> 0.00 HAVING saldo <> 0.00
ORDER BY u.username, p.season, p.league"; ORDER BY u.username, p.season, p.league";
if(!$result = $db->sql_query($sql)) if(!$result = $db->sql_query($sql))
{ {
trigger_error('NO_SEASON'); trigger_error('NO_SEASON');
} }
$user_rows = $db->sql_fetchrowset($result); $user_rows = $db->sql_fetchrowset($result);
$export_file = $season. '_bank.csv'; $db->sql_freeresult($result);
$newline = "\r\n"; $export_file = $season. '_bank.csv';
header('Pragma: no-cache'); $newline = "\r\n";
header("Content-Type: text/csv; name=\"$export_file\""); header('Pragma: no-cache');
header("Content-disposition: attachment; filename=$export_file"); header("Content-Type: text/csv; name=\"$export_file\"");
$export= ''; header("Content-disposition: attachment; filename=$export_file");
$export .= sprintf($user->lang['SEASON']) . ' ' . $season. $newline; $export= '';
$export .= sprintf($user->lang['NAME']) . ';' . sprintf($user->lang['SEASON']) . ';' . sprintf($user->lang['LEAGUE']) . ';Saldo;' . $newline; $export .= sprintf($user->lang['SEASON']) . ' ' . $season. $newline;
$export .= sprintf($user->lang['NAME']) . ';' . sprintf($user->lang['SEASON']) . ';' . sprintf($user->lang['LEAGUE']) . ';Saldo;' . $newline;
$last_username = '';
$sum_saldo = 0.0; $last_username = '';
foreach ($user_rows as $user_row) $sum_saldo = 0.0;
{ foreach ($user_rows as $user_row)
if ($last_username != '' AND $last_username != $user_row['username']) {
{ if ($last_username != '' AND $last_username != $user_row['username'])
$export .= str_replace("\"", "\"\"", $last_username) . ';Summe;;' . {
str_replace('.', ',', $sum_saldo) . ';' . $newline; $export .= str_replace("\"", "\"\"", $last_username) . ';Summe;;' .
$sum_saldo = 0.0; str_replace('.', ',', $sum_saldo) . ';' . $newline;
} $sum_saldo = 0.0;
$export .= str_replace("\"", "\"\"", $user_row['username']) . ';' . }
$user_row['season'] . ';' . $export .= str_replace("\"", "\"\"", $user_row['username']) . ';' .
$user_row['league'] . ';' . $user_row['season'] . ';' .
str_replace('.', ',', $user_row['saldo']) . ';' . $newline; $user_row['league'] . ';' .
$sum_saldo += $user_row['saldo']; str_replace('.', ',', $user_row['saldo']) . ';' . $newline;
$last_username = $user_row['username']; $sum_saldo += $user_row['saldo'];
} $last_username = $user_row['username'];
if ($last_username != '') }
{ if ($last_username != '')
$export .= str_replace("\"", "\"\"", $last_username) . ';Summe;;' . {
str_replace('.', ',', $sum_saldo) . ';' . $newline; $export .= str_replace("\"", "\"\"", $last_username) . ';Summe;;' .
} str_replace('.', ',', $sum_saldo) . ';' . $newline;
echo utf8_decode($export); }
exit; echo utf8_decode($export);
} exit;
} }
}
?> ?>

View File

@@ -91,6 +91,10 @@ else
$data_last_home = false; $data_last_home = false;
$data_last_away = false; $data_last_away = false;
$form_from = $matchday-5; $form_from = $matchday-5;
$percent_home = 0;
$percent_draw = 0;
$percent_guest = 0;
$stat_hist = '';
$value_h = 0; $value_h = 0;
$value_g = 0; $value_g = 0;
$value_hg = 0; $value_hg = 0;
@@ -115,7 +119,6 @@ else
{ {
$logo[$home_id] = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; $logo[$home_id] = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
} }
$db->sql_freeresult($result);
} }
else else
{ {
@@ -142,7 +145,6 @@ else
{ {
$logo[$guest_id] = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; $logo[$guest_id] = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
} }
$db->sql_freeresult($result);
} }
else else
{ {
@@ -245,7 +247,6 @@ else
) )
); );
} }
$db->sql_freeresult($result);
// Statistic and forecast-points for historie // Statistic and forecast-points for historie
$sql = "SELECT $sql = "SELECT
@@ -322,10 +323,6 @@ else
} }
} }
$stat_hist = '';
$percent_home = 0;
$percent_draw = 0;
$percent_guest = 0;
if (sizeof($row)) if (sizeof($row))
{ {
if ($history_count <= 2) if ($history_count <= 2)
@@ -1003,7 +1000,6 @@ else
); );
} }
} }
$db->sql_freeresult($result);
//last matches home hometeam //last matches home hometeam
$sql = '(SELECT $sql = '(SELECT
@@ -1074,7 +1070,6 @@ else
); );
} }
} }
$db->sql_freeresult($result);
//last game guestteam //last game guestteam
$sql = "(SELECT $sql = "(SELECT
@@ -1158,7 +1153,6 @@ else
); );
} }
} }
$db->sql_freeresult($result);
//last matches away guestteam //last matches away guestteam
$sql = '(SELECT $sql = '(SELECT
@@ -1226,7 +1220,6 @@ else
); );
} }
} }
$db->sql_freeresult($result);
if ($history_count == 0 and !($data_home and $data_guest)) if ($history_count == 0 and !($data_home and $data_guest))
{ {
@@ -1266,7 +1259,7 @@ else
$sql = 'UPDATE ' . FOOTB_MATCHES . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " $sql = 'UPDATE ' . FOOTB_MATCHES . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE season = $season AND league = $league AND match_no = $matchnumber"; WHERE season = $season AND league = $league AND match_no = $matchnumber";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$db->sql_freeresult($result);
$forecast_value = 0; $forecast_value = 0;

150
block/last_results.php Normal file
View File

@@ -0,0 +1,150 @@
<?php
/**
*
* @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL'))
{
exit;
}
$user_is_member = user_is_member($user->data['user_id'], $season, $league);
$edit_mode = false;
$display_group = false;
$display_ko = false;
$data_lastresults = false;
$curr_year = date("Y");
$matchnumber = 0;
$match_date = "";
$local_board_time = time() + ($config['football_time_shift'] * 3600);
$sql = 'SELECT * FROM ' . FOOTB_MATCHDAYS . " WHERE status = 0 AND delivery_date < FROM_UNIXTIME('$local_board_time')";
// Calculate matches AND results of matchday
$sql = "SELECT
m.season,
m.league,
m.matchday,
m.status,
m.match_datetime,
LEFT(m.match_datetime, 10) AS match_date,
l.league_name,
t1.team_symbol AS home_symbol,
t2.team_symbol AS guest_symbol,
t1.team_name AS home_name,
t2.team_name AS guest_name,
t1.team_name_short AS home_short,
t2.team_name_short AS guest_short,
m.goals_home,
m.goals_guest,
m.ko_match AS ko_match,
m.goals_overtime_home AS kogoals_home,
m.goals_overtime_guest AS kogoals_guest,
CONCAT(
CASE DATE_FORMAT(m.match_datetime,'%w')
WHEN 0 THEN '" . $lang_dates['Sun'] . "'
WHEN 1 THEN '" . $lang_dates['Mon'] . "'
WHEN 2 THEN '" . $lang_dates['Tue'] . "'
WHEN 3 THEN '" . $lang_dates['Wed'] . "'
WHEN 4 THEN '" . $lang_dates['Thu'] . "'
WHEN 5 THEN '" . $lang_dates['Fri'] . "'
WHEN 6 THEN '" . $lang_dates['Sat'] . "'
ELSE 'Error' END,
DATE_FORMAT(m.match_datetime,' %d.%m. %H:%i')
) AS match_time
FROM " . FOOTB_MATCHES . ' AS m
LEFT JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league)
LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home)
LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest)
WHERE m.match_datetime < FROM_UNIXTIME('$local_board_time')
ORDER BY m.match_datetime DESC, m.league ASC
LIMIT 100";
$result = $db->sql_query($sql);
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
while($row = $db->sql_fetchrow($result))
{
$data_lastresults = true;
$matchnumber++ ;
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($match_date <> $row['match_date'])
{
$match_date = ($match_date == "") ? $row['match_date'] : $match_date;
if ($matchnumber > $config['football_display_last_results'] )
{
break;
}
}
$homelogo = $row['home_symbol'];
$homename = $row['home_name'];
$homeshort = $row['home_short'];
$guestlogo = $row['guest_symbol'];
$guestname = $row['guest_name'];
$guestshort = $row['guest_short'];
if ($homelogo <> '')
{
$logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"20\" height=\"20\"/>" ;
}
else
{
$logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"20\" height=\"20\"/>" ;
}
if ($guestlogo <> '')
{
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"20\" height=\"20\"/>" ;
}
else
{
$logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"20\" height=\"20\"/>" ;
}
$goals_home = ($row['goals_home'] == '') ? '- ' : $row['goals_home'];
$goals_guest = ($row['goals_guest'] == '') ? ' -' : $row['goals_guest'];
$kogoals_home = ($row['kogoals_home'] == '') ? '- ' : $row['kogoals_home'];
$kogoals_guest = ($row['kogoals_guest'] == '') ? ' -' : $row['kogoals_guest'];
$colorstyle = color_style($row['status']);
$template->assign_block_vars('last_results', array(
'ROW_CLASS' => $row_class,
'U_RESULTS_LINK'=> $this->helper->route('football_main_controller', array('side' => 'results', 's' => $row['season'], 'l' => $row['league'], 'm' => $row['matchday'])),
'MATCH_DATE' => $row['match_date'],
'MATCH_TIME' => $row['match_time'],
'LEAGUE_NAME' => $row['league_name'],
'LOGO_HOME' => $logoH,
'LOGO_GUEST' => $logoG,
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'HOME_SHORT' => $homeshort,
'GUEST_SHORT' => $guestshort,
'GOALS_HOME' => $goals_home,
'GOALS_GUEST' => $goals_guest,
'COLOR_STYLE' => color_style($row['status']),
'KOGOALS_HOME' => $kogoals_home,
'KOGOALS_GUEST' => $kogoals_guest,
'COLOR_STYLE' => $colorstyle,
)
);
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['LAST_RESULTS']);
$template->assign_vars(array(
'S_DISPLAY_LAST_RESULTS' => true,
'S_SIDENAME' => $sidename,
'S_DATA_LAST_RESULTS' => $data_lastresults,
'S_USER_IS_MEMBER' => $user_is_member,
)
);
?>

View File

@@ -1,65 +1,66 @@
<?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
GROUP BY u.user_id AND u.user_type IN (0,3)
ORDER BY lastvisit DESC'; GROUP BY u.user_id
ORDER BY lastvisit DESC';
$result = $db->sql_query_limit($sql, 5);
$first = true; $result = $db->sql_query_limit($sql, $config['football_display_last_users']);
while ($row = $db->sql_fetchrow($result)) $first = true;
{ 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; {
if($row['lastvisit'] > 0) $display_last_users = true;
{ if($row['lastvisit'] > 0)
$browser = ''; {
if (preg_match('/iPad|iPhone|iOS|Opera Mobi|BlackBerry|Android|IEMobile|Symbian/', $row['session_browser'], $match_browser)) $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( }
'USER_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']) . $browser, $template->assign_block_vars('last_users', array(
'LAST_VISIT_DATE' => $user->format_date($row['lastvisit']), 'USER_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']) . $browser,
)); 'LAST_VISIT_DATE' => $user->format_date($row['lastvisit']),
} ));
} }
$first = false; }
} $first = false;
$db->sql_freeresult($result); }
$db->sql_freeresult($result);
// Assign specific vars
$template->assign_vars(array( // Assign specific vars
'LAST_USERS' => sprintf($user->lang['LAST_VISITORS'], 5), $template->assign_vars(array(
'S_DISPLAY_LAST_USERS' => $display_last_users, 'LAST_USERS' => sprintf($user->lang['LAST_VISITORS'], $config['football_display_last_users']),
'S_LAST_USERS' => true, 'S_DISPLAY_LAST_USERS' => $display_last_users,
)); 'S_LAST_USERS' => true,
));
?> ?>

View File

@@ -1,332 +1,324 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
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,334 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
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 SUM(r.points) 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 DESC, 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_RANKS . "
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_RANKS . "
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_RANKS . "
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_RANKS . "
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

@@ -98,7 +98,6 @@ else
$split_after = $count_matches; $split_after = $count_matches;
$splits = 1; $splits = 1;
} }
$db->sql_freeresult($result);
// Make sure $start is set to the last page if it exceeds the amount // Make sure $start is set to the last page if it exceeds the amount
if ($start < 0 || $start >= $total_users) if ($start < 0 || $start >= $total_users)
@@ -192,7 +191,7 @@ foreach ($matches AS $match)
$total = 0; $total = 0;
} }
$bet_index++; $bet_index++;
$total += $user_bet['points']; $total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 1 && !$config['football_view_bets']) if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{ {
// hide bets // hide bets
@@ -310,7 +309,7 @@ if ($count_matches > 0)
$total = 0; $total = 0;
} }
$bet_index++; $bet_index++;
$total += $user_bet['points']; $total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 1) if ($user_bet['status'] < 1)
{ {
if ($user_bet['bet_home'] == '') if ($user_bet['bet_home'] == '')
@@ -376,12 +375,6 @@ $sidename = sprintf($user->lang['MY_KOEFF']);
$template->assign_vars(array( $template->assign_vars(array(
'S_DISPLAY_MY_KOEFF' => true, 'S_DISPLAY_MY_KOEFF' => true,
'S_SIDENAME' => $sidename, 'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_chart', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_CHART']),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'stat_points', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => sprintf($user->lang['STAT_POINTS']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_CHART']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_STAT_POINTS']),
'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday, 'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday,
'S_SPALTEN' => ($count_matches * 2) + 2, 'S_SPALTEN' => ($count_matches * 2) + 2,
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),

View File

@@ -1,204 +1,198 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
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,173 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
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,438 +1,426 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
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
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";
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$result = $db->sql_query($sql); $lastGroup = '';
$lastGroup = ''; $sumdiff = 0;
$sumdiff = 0; while($row = $db->sql_fetchrow($result))
while($row = $db->sql_fetchrow($result)) {
{ if ($lastGroup != $row['group_id'])
if ($lastGroup != $row['group_id']) {
{ $lastGroup = $row['group_id'];
$lastGroup = $row['group_id']; $rank = 0;
$rank = 0; $template->assign_block_vars('total', array(
$template->assign_block_vars('total', array( 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], )
) );
); }
} if ($league_type != 2 OR $row['group_id'] != '')
if ($league_type != 2 OR $row['group_id'] != '') {
{ $data_table = true;
$data_table = true; $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\"/>" ; $pdiff = $row['points'] - $row['realpoints'];
$pdiff = $row['points'] - $row['realpoints']; if ($pdiff >= 0)
if ($pdiff >= 0) {
{ $sumdiff += $pdiff;
$sumdiff += $pdiff; $pdiff = ' (+' . $pdiff . ')';
$pdiff = ' (+' . $pdiff . ')';
}
} else
else {
{ $sumdiff -= $pdiff;
$sumdiff -= $pdiff; $pdiff = ' (' . $pdiff . ')';
$pdiff = ' (' . $pdiff . ')'; }
} if ($user_sel == 900)
if ($user_sel == 900) {
{ $pdiff = '';
$pdiff = ''; }
}
$template->assign_block_vars('total', array(
$template->assign_block_vars('total', array( 'RANK' => $rank . '.',
'RANK' => $rank . '.', 'ROW_CLASS' => $row_class,
'ROW_CLASS' => $row_class, 'LOGO' => $logo,
'LOGO' => $logo, 'TEAM_ID' => $row['team_id'],
'TEAM_ID' => $row['team_id'], 'TEAM' => $row['team_name_short'],
'TEAM' => $row['team_name_short'], 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league, 'tid' => $row['team_id'], 'mode' => 'played')),
'tid' => $row['team_id'], 'mode' => 'played')), 'GAMES' => $row['matches'],
'GAMES' => $row['matches'], 'WIN' => $row['win'],
'WIN' => $row['win'], 'DRAW' => $row['draw'],
'DRAW' => $row['draw'], 'LOST' => $row['lost'],
'LOST' => $row['lost'], 'GOALS' => $row['goals'],
'GOALS' => $row['goals'], 'GOALS_AGAINST' => $row['goals_against'],
'GOALS_AGAINST' => $row['goals_against'], 'GOALS_DIFF' => $row['goals_diff'],
'GOALS_DIFF' => $row['goals_diff'], 'POINTS' => $row['points'] . $pdiff,
'POINTS' => $row['points'] . $pdiff, )
) );
); }
} }
} $db->sql_freeresult($result);
$db->sql_freeresult($result);
$rank = 0;
$rank = 0; // Select formtable on selected user bets
// Select formtable 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, 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 >= $form_from
AND m.matchday >= $form_from GROUP BY t.team_id
AND m.status IN (2, 3,5,6) 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); while($row = $db->sql_fetchrow($result))
$lastGroup = ''; {
while($row = $db->sql_fetchrow($result)) $data_form = true;
{ if ($lastGroup != $row['group_id'])
$data_form = true; {
if ($lastGroup != $row['group_id']) $lastGroup = $row['group_id'];
{ $rank = 0;
$lastGroup = $row['group_id']; $template->assign_block_vars('form', array(
$rank = 0; 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
$template->assign_block_vars('form', 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'] != '') $rank++;
{ $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';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; $template->assign_block_vars('form', array(
'RANK' => $rank . '.',
$template->assign_block_vars('form', 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' => 'rest')),
'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' => 'rest')), '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'],
'GOALS_DIFF' => $row['goals_diff'], )
'POINTS' => $row['points'], );
) }
); }
} $db->sql_freeresult($result);
}
$db->sql_freeresult($result); $rank = 0;
// Select home-table on selected user bets
$rank = 0; $sql = 'SELECT
// Select home-table on selected user bets t.*,
$sql = 'SELECT SUM(1) AS matches,
t.*, SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS win,
SUM(1) AS matches, SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS win, SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS lost,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw, 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 lost, SUM(b.goals_home - b.goals_guest) AS goals_diff,
SUM(IF(b.goals_home + 0 > b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))) AS points, SUM(b.goals_home) AS goals,
SUM(b.goals_home - b.goals_guest) AS goals_diff, SUM(b.goals_guest) AS goals_against
SUM(b.goals_home) AS goals, FROM ' . FOOTB_TEAMS . ' AS t
SUM(b.goals_guest) 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 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 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 <= $matchday
AND b.goals_guest <> '' GROUP BY t.team_id
AND m.matchday <= $matchday ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
AND m.status IN (2, 3,5,6)
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 = ''; if ($lastGroup != $row['group_id'])
while($row = $db->sql_fetchrow($result)) {
{ $lastGroup = $row['group_id'];
if ($lastGroup != $row['group_id']) $rank = 0;
{ $template->assign_block_vars('home', array(
$lastGroup = $row['group_id']; 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $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++;
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('home', 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('home', 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' => 'home')),
'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' => 'home')), '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 away-table on selected user bets
$sql = 'SELECT
$rank = 0; t.*,
// Select away-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_guest - b.goals_home) AS goals_diff,
SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS lost, SUM(b.goals_guest) 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_home) AS goals_against
SUM(b.goals_guest - b.goals_home) AS goals_diff, FROM ' . FOOTB_TEAMS . ' AS t
SUM(b.goals_guest) AS goals, 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_home) AS goals_against LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no = m.match_no)
FROM ' . FOOTB_TEAMS . ' AS t WHERE $where_user
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) 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.status IN (2, 3,5,6) $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('away', array(
{ 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
$lastGroup = $row['group_id']; )
$rank = 0; );
$template->assign_block_vars('away', 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('away', 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('away', 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' => 'away')),
'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' => 'away')), '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);
);
} $sidename = sprintf($user->lang['MY_TABLE']);
} $template->assign_vars(array(
$db->sql_freeresult($result); 'S_DISPLAY_MY_TABLE' => true,
'S_SIDENAME' => $sidename,
$sidename = sprintf($user->lang['MY_TABLE']); 'S_DATA_MY_TABLE' => $data_table,
$template->assign_vars(array( 'S_DATA_FORM' => $data_form,
'S_DISPLAY_MY_TABLE' => true, 'SEASON' => $season,
'S_SIDENAME' => $sidename, 'LEAGUE' => $league,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_points', 's' => $season, 'l' => $league, 'm' => $matchday)), 'TEXT_FORM' => $text_form,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_TABLE']), 'S_PDIFF' => $sumdiff,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_POINTS']), 'USERNAME' => $username,
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_rank', 's' => $season, 'l' => $league, 'm' => $matchday)), )
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_TABLE']), );
'RIGHT_LINK' => sprintf($user->lang['MY_RANK']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_POINTS']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_RANKS']),
'S_DATA_MY_TABLE' => $data_table,
'S_DATA_FORM' => $data_form,
'SEASON' => $season,
'LEAGUE' => $league,
'TEXT_FORM' => $text_form,
'S_PDIFF' => $sumdiff,
'USERNAME' => $username,
)
);
?> ?>

View File

@@ -1,211 +1,205 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
exit; exit;
} }
$data_odds = false; $data_odds = false;
$matchnumber = 0; $matchnumber = 0;
$lang_dates = $user->lang['datetime']; $lang_dates = $user->lang['datetime'];
$sql = "SELECT $sql = "SELECT
m.league, m.league,
m.match_no, m.match_no,
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,
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_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,
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,
m.ko_match, m.ko_match,
m.group_id, m.group_id,
m.formula_home, m.formula_home,
m.formula_guest, m.formula_guest,
m.odd_1, m.odd_1,
m.odd_x, m.odd_x,
m.odd_2, m.odd_2,
m.trend FROM " . FOOTB_MATCHES . ' AS m m.trend 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);
$rows = $db->sql_fetchrowset($result); $rows = $db->sql_fetchrowset($result);
$league_info = league_info($season, $league); $league_info = league_info($season, $league);
$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))
foreach ($rows as $row) foreach ($rows as $row)
{ {
$data_odds = true; $data_odds = 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];
} }
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'];
} }
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];
} }
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'];
} }
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'];
} }
$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('odds', array( $template->assign_block_vars('odds', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'MATCH_NUMBER' => $row['match_no'], 'MATCH_NUMBER' => $row['match_no'],
'MATCHDAY' => $matchday, 'MATCHDAY' => $matchday,
'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,
'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' => '',
'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,
'TREND' => $row['trend'], 'TREND' => $row['trend'],
'U_MATCH_STATS' => $this->helper->route('football_football_popup', array('popside' => 'hist_popup', 's' => $season, 'l' => $league, 'U_MATCH_STATS' => $this->helper->route('football_football_popup', array('popside' => 'hist_popup', 's' => $season, 'l' => $league,
'hid' => $homeid, 'gid' => $guestid, 'm' => $matchday, 'hid' => $homeid, 'gid' => $guestid, 'm' => $matchday,
'mn' => $row['match_no'], 'gr' => $row['group_id'])), 'mn' => $row['match_no'], 'gr' => $row['group_id'])),
'ODD_1' => $row['odd_1'], 'ODD_1' => $row['odd_1'],
'ODD_X' => $row['odd_x'], 'ODD_X' => $row['odd_x'],
'ODD_2' => $row['odd_2'], 'ODD_2' => $row['odd_2'],
) )
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$sidename = 'Chancen'; $sidename = 'Chancen';
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;
} }
$template->assign_vars(array( $template->assign_vars(array(
'S_DISPLAY_ODDS' => true, 'S_DISPLAY_ODDS' => true,
'S_SIDENAME' => $sidename, 'S_SIDENAME' => $sidename,
'RESULT_EXPLAIN' => $result_explain, 'RESULT_EXPLAIN' => $result_explain,
'LABEL_FINALRESULT' => $label_finalresult, 'LABEL_FINALRESULT' => $label_finalresult,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)), 'S_DATA_ODDS' => $data_odds,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['BET']), )
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)), );
'RIGHT_LINK' => sprintf($user->lang['TABLE']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_BET']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_TABLE']),
'S_DATA_ODDS' => $data_odds,
)
);
?> ?>

View File

@@ -1,270 +1,261 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
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 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_main_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 = $rankof[$row['user_id']] - $prevrankof[$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

@@ -157,7 +157,6 @@ switch ($mode)
} }
$index++; $index++;
} }
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['RANK_TOTAL']); $sidename = sprintf($user->lang['RANK_TOTAL']);
$league_info = league_info($season, $league); $league_info = league_info($season, $league);
@@ -166,13 +165,6 @@ switch ($mode)
'S_DISPLAY_HITS02' => $config['football_win_hits02'], 'S_DISPLAY_HITS02' => $config['football_win_hits02'],
'S_DATA_RANKS' => $data_ranks, 'S_DATA_RANKS' => $data_ranks,
'S_SIDENAME' => $sidename, 'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['RANK_MATCHDAY']),
'U_RIGHT' => ($config['football_bank']) ? $this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)) :
$this->helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => ($config['football_bank']) ? sprintf($user->lang['FOOTBALL_BANK']) . ' &gt;' : sprintf($user->lang['MY_BETS']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_RANK_MATCHDAY']),
'RIGHT_TITLE' => ($config['football_bank']) ? sprintf($user->lang['TITLE_FOOTBALL_BANK']) : sprintf($user->lang['TITLE_MY_BETS']),
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users), 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
'S_WIN' => false, 'S_WIN' => false,
@@ -328,7 +320,6 @@ switch ($mode)
} }
$index++; $index++;
} }
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['RANK_TOTAL']); $sidename = sprintf($user->lang['RANK_TOTAL']);
$league_info = league_info($season, $league); $league_info = league_info($season, $league);
@@ -337,13 +328,6 @@ switch ($mode)
'S_DISPLAY_HITS02' => $config['football_win_hits02'], 'S_DISPLAY_HITS02' => $config['football_win_hits02'],
'S_DATA_RANKS' => $data_ranks, 'S_DATA_RANKS' => $data_ranks,
'S_SIDENAME' => $sidename, 'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['RANK_MATCHDAY']),
'U_RIGHT' => ($config['football_bank']) ? $this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)) :
$this->helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => ($config['football_bank']) ? sprintf($user->lang['FOOTBALL_BANK']) . ' &gt;' : sprintf($user->lang['MY_BETS']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_RANK_MATCHDAY']),
'RIGHT_TITLE' => ($config['football_bank']) ? sprintf($user->lang['TITLE_FOOTBALL_BANK']) : sprintf($user->lang['TITLE_MY_BETS']),
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users), 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
'S_WIN' => ($league_info['win_matchday'] == '0' and $league_info['win_season'] == '0') ? false : ($this->auth->acl_gets('a_')) ? true : false, 'S_WIN' => ($league_info['win_matchday'] == '0' and $league_info['win_season'] == '0') ? false : ($this->auth->acl_gets('a_')) ? true : false,
@@ -492,7 +476,6 @@ switch ($mode)
if ($rank == $prev_rank_of[$curr_rank['user_id']]) if ($rank == $prev_rank_of[$curr_rank['user_id']])
{ {
$change_sign = '='; $change_sign = '=';
$change_img = "<img src=\"" . $ext_path . "images/no_change.gif\" alt=\"" . $user->lang['NO_CHANGES'] . "\"/>";
$change_differ = ''; $change_differ = '';
} }
else else
@@ -500,14 +483,12 @@ switch ($mode)
if ($rank > $prev_rank_of[$curr_rank['user_id']]) if ($rank > $prev_rank_of[$curr_rank['user_id']])
{ {
$change_sign = '+'; $change_sign = '+';
$change_img = "<img src=\"" . $ext_path . "images/arrow_down.gif\" alt=\"" . $user->lang['WORSENED'] . "\"/>";
$differ = $rank - $prev_rank_of[$curr_rank['user_id']]; $differ = $rank - $prev_rank_of[$curr_rank['user_id']];
$change_differ = ' (' . $differ . ')'; $change_differ = ' (' . $differ . ')';
} }
else else
{ {
$change_sign = '-'; $change_sign = '-';
$change_img = "<img src=\"" . $ext_path . "images/arrow_up.gif\" alt=\"" . $user->lang['IMPROVED'] . "\"/>";
$differ = $prev_rank_of[$curr_rank['user_id']] - $rank; $differ = $prev_rank_of[$curr_rank['user_id']] - $rank;
$change_differ = ' (' . $differ . ')'; $change_differ = ' (' . $differ . ')';
} }
@@ -516,7 +497,6 @@ switch ($mode)
else else
{ {
$change_sign = ''; $change_sign = '';
$change_img = '';
$change_differ = ''; $change_differ = '';
} }
@@ -539,8 +519,10 @@ switch ($mode)
$template->assign_block_vars('rankstotal', array( $template->assign_block_vars('rankstotal', array(
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'RANK' => $rank, 'RANK' => $rank,
'NO_CHANGES' => ($change_sign == '=') ? true : false,
'WORSENED' => ($change_sign == '-') ? true : false,
'IMPROVED' => ($change_sign == '+') ? true : false,
'CHANGE_SIGN' => $change_sign, 'CHANGE_SIGN' => $change_sign,
'CHANGE_IMG' => $change_img,
'CHANGE_DIFFER' => $change_differ, 'CHANGE_DIFFER' => $change_differ,
'USERID' => $curr_rank['user_id'], 'USERID' => $curr_rank['user_id'],
'USERNAME' => $curr_rank['username'], 'USERNAME' => $curr_rank['username'],
@@ -558,7 +540,6 @@ switch ($mode)
} }
$index++; $index++;
} }
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['RANK_TOTAL']); $sidename = sprintf($user->lang['RANK_TOTAL']);
$league_info = league_info($season, $league); $league_info = league_info($season, $league);
@@ -567,13 +548,6 @@ switch ($mode)
'S_DISPLAY_HITS02' => $config['football_win_hits02'], 'S_DISPLAY_HITS02' => $config['football_win_hits02'],
'S_DATA_RANKS' => $data_ranks, 'S_DATA_RANKS' => $data_ranks,
'S_SIDENAME' => $sidename, 'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['RANK_MATCHDAY']),
'U_RIGHT' => ($config['football_bank']) ? $this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)) :
$this->helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => ($config['football_bank']) ? sprintf($user->lang['FOOTBALL_BANK']) . ' &gt;' : sprintf($user->lang['MY_BETS']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_RANK_MATCHDAY']),
'RIGHT_TITLE' => ($config['football_bank']) ? sprintf($user->lang['TITLE_FOOTBALL_BANK']) : sprintf($user->lang['TITLE_MY_BETS']),
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start), 'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users), 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
'S_WIN' => ($league_info['win_matchday'] == '0' and $league_info['win_season'] == '0') ? false : true, 'S_WIN' => ($league_info['win_matchday'] == '0' and $league_info['win_season'] == '0') ? false : true,

View File

@@ -1,433 +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') OR !defined('IN_FOOTBALL'))
{ {
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']) $sidename = sprintf($user->lang['RESULTS']);
{ switch ($league_info['bet_ko_type'])
case BET_KO_90: {
$result_explain = sprintf($user->lang['MIN90']); case BET_KO_90:
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); $result_explain = sprintf($user->lang['MIN90']);
break; $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
case BET_KO_EXTRATIME: break;
$result_explain = sprintf($user->lang['EXTRATIME_SHORT']); case BET_KO_EXTRATIME:
$label_finalresult = sprintf($user->lang['PENALTY']); $result_explain = sprintf($user->lang['EXTRATIME_SHORT']);
break; $label_finalresult = sprintf($user->lang['PENALTY']);
case BET_KO_PENALTY: break;
$result_explain = sprintf($user->lang['PENALTY']); case BET_KO_PENALTY:
$display_ko = false; $result_explain = sprintf($user->lang['PENALTY']);
break; $display_ko = false;
default: break;
$result_explain = sprintf($user->lang['MIN90']); default:
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']); $result_explain = sprintf($user->lang['MIN90']);
break; $label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
} break;
}
$template->assign_vars(array(
'S_DISPLAY_RESULTS' => true, $template->assign_vars(array(
'S_EXTRA_RESULTS' => $extra_results, 'S_DISPLAY_RESULTS' => true,
'S_SIDENAME' => $sidename, 'S_EXTRA_RESULTS' => $extra_results,
'RESULT_EXPLAIN' => $result_explain, 'S_SIDENAME' => $sidename,
'LABEL_FINALRESULT' => $label_finalresult, 'RESULT_EXPLAIN' => $result_explain,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)), 'LABEL_FINALRESULT' => $label_finalresult,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['ALL_BETS']), 'S_FORM_ACTION_RESULT' => $this->helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'result')),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)), 'S_DATA_RESULTS' => $data_results,
'RIGHT_LINK' => sprintf($user->lang['TABLE']) . ' &gt;', 'S_USER_IS_MEMBER' => $user_is_member,
'LEFT_TITLE' => sprintf($user->lang['TITLE_ALL_BETS']), 'S_DISPLAY_GROUP' => $display_group,
'RIGHT_TITLE' => sprintf($user->lang['TITLE_TABLE']), 'S_DISPLAY_KO' => $display_ko,
'S_FORM_ACTION_RESULT' => $this->helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'result')), 'S_EDIT_MODE' => $edit_mode,
'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

@@ -180,7 +180,8 @@ if ($data_rules)
'JOIN_MODE' => ($league_info['join_by_user']) ? (($league_info['join_in_season']) ? sprintf($user->lang['JOIN_IN_SEASON']) : sprintf($user->lang['JOIN_BY_USER'])) : sprintf($user->lang['JOIN_BY_ADMIN']), 'JOIN_MODE' => ($league_info['join_by_user']) ? (($league_info['join_in_season']) ? sprintf($user->lang['JOIN_IN_SEASON']) : sprintf($user->lang['JOIN_BY_USER'])) : sprintf($user->lang['JOIN_BY_ADMIN']),
'POINTS_HIT' => sprintf($user->lang['POINTS_HIT'], $league_info['points_result']) . '<br/>', 'POINTS_HIT' => sprintf($user->lang['POINTS_HIT'], $league_info['points_result']) . '<br/>',
'POINTS_TENDENCY' => $points_tendency . '<br/>', 'POINTS_TENDENCY' => $points_tendency . '<br/>',
'POINTS_DIFF' => ($league_info['points_mode'] == 4) ? sprintf($user->lang['POINTS_DIFFERENCE'], $league_info['points_diff']) . '<br/>' : '', 'POINTS_DIFF' => ($league_info['points_mode'] == 4) ? sprintf($user->lang['POINTS_DIFFERENCE'], $league_info['points_diff']) . '<br/>' :
(($league_info['points_mode'] == 5) ? sprintf($user->lang['POINTS_DIFFERENCE_DRAW'], $league_info['points_diff']) . '<br/>' : ''),
'POINTS_LAST' => ($league_info['points_last']) ? sprintf($user->lang['POINTS_NO_BET']) . '<br/>' : '', 'POINTS_LAST' => ($league_info['points_last']) ? sprintf($user->lang['POINTS_NO_BET']) . '<br/>' : '',
'LINK_RULES' => sprintf($user->lang['LINK_RULES'], $link_rules), 'LINK_RULES' => sprintf($user->lang['LINK_RULES'], $link_rules),
'SEASONNAME' => $season_info['season_name'], 'SEASONNAME' => $season_info['season_name'],

145
block/side_table.php Normal file
View File

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

View File

@@ -1,170 +1,164 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
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,140 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
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,420 +1,440 @@
<?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') OR !defined('IN_FOOTBALL'))
{ {
exit; exit;
} }
$data_table = false;
$data_form = false; $data_table = 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 *
FROM ' . FOOTB_LEAGUES . " $sql = 'SELECT *
WHERE season = $season FROM ' . FOOTB_LEAGUES . "
AND league = $league"; WHERE season = $season
$result = $db->sql_query($sql); AND league = $league";
$row = $db->sql_fetchrow($result); $result = $db->sql_query($sql);
$league_type = $row['league_type']; $row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $league_type = $row['league_type'];
$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;
// Get table-information $rank = 0;
$sql = "SELECT // Get table-information
t.*, $sql = "SELECT
SUM(1) AS matches, t.*,
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(1) AS matches,
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 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)) AS draw,
SUM(IF(m.team_id_home = t.team_id, 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,
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, 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, )
SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goals_diff, ) - 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)) AS goals, 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_guest , goals_home)) AS goals_against SUM(IF(m.team_id_home = t.team_id, goals_home , goals_guest)) AS goals,
FROM " . FOOTB_TEAMS . ' AS t SUM(IF(m.team_id_home = t.team_id, goals_guest , 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
WHERE t.season = $season AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id)
AND t.league = $league WHERE t.season = $season
AND m.matchday <= $matchday AND t.league = $league
AND m.status IN (2, 3,5,6) AND m.matchday <= $matchday
GROUP BY t.team_id AND m.status IN (2,3,5,6)
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; 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);
$last_group = ''; $result = $db->sql_query($sql);
$current_rank = 0;
$last_goals = 0; $table_ary = array();
$last_goals_againts = 0; $points_ary = array();
$last_points = 0; $ranks_ary = array();
while($row = $db->sql_fetchrow($result)) $rank = 0;
{ while( $row = $db->sql_fetchrow($result))
if ($last_group != $row['group_id']) {
{ $rank++;
$last_group = $row['group_id']; $table_ary[$row['team_id']] = $row;
$rank = 0; $points_ary[$row['group_id']][$row['points']][]=$row['team_id'];
$last_goals = 0; $ranks_ary[] = $row['team_id'];
$last_goals_againts = 0; }
$last_points = 0;
$template->assign_block_vars('total', array( $last_group = '';
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], $rank = 0;
) $current_rank = 0;
); $last_goals = 0;
} $last_goals_againts = 0;
if ($league_type != 2 OR $row['group_id'] != '') $last_points = 0;
{ foreach($points_ary as $group_id => $points)
$data_table = true; {
$rank++; $data_table = true;
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) if ($last_group != $group_id)
{ {
$current_rank = $rank . '.'; $last_group =$group_id;
} $rank = 0;
else $last_goals = 0;
{ $last_goals_againts = 0;
$current_rank = ''; $last_points = 0;
} $template->assign_block_vars('total', array(
$last_points = $row['points']; 'GROUP' => sprintf($user->lang['GROUP']) . ' ' .$group_id,
$last_goals = $row['goals']; )
$last_goals_againts = $row['goals_against']; );
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; }
if ($row['team_symbol'] <> '')
{ foreach($points as $point => $teams)
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; {
} if(count($teams) > 1 AND $group_id != '')
else {
{ // Compare teams with equal points and sort
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; $teams = get_order_team_compare($teams, $season, $league, $group_id, $ranks_ary, $matchday);
} }
foreach($teams as $key => $team)
$template->assign_block_vars('total', array( {
'RANK' => $current_rank, $row = $table_ary[$team];
'ROW_CLASS' => $row_class, $rank++;
'LOGO' => $logo, if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
'TEAM_ID' => $row['team_id'], {
'TEAM' => $row['team_name'], $current_rank = $rank . '.';
'TEAM_SHORT' => $row['team_name_short'], }
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'], else
'tid' => $row['team_id'], 'mode' => 'played')), {
'GAMES' => $row['matches'], $current_rank = '';
'WIN' => $row['win'], }
'DRAW' => $row['draw'], $last_points = $row['points'];
'LOST' => $row['lost'], $last_goals = $row['goals'];
'GOALS' => $row['goals'], $last_goals_againts = $row['goals_against'];
'GOALS_AGAINST' => $row['goals_against'], $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
'GOALS_DIFF' => $row['goals_diff'], if ($row['team_symbol'] <> '')
'POINTS' => $row['points'], {
) $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
); }
} else
} {
$db->sql_freeresult($result); $logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
$rank = 0; }
// Get form-table-information
$sql = 'SELECT $template->assign_block_vars('total', array(
t.*, 'RANK' => $current_rank,
SUM(1) AS matches, 'ROW_CLASS' => $row_class,
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, 'LOGO' => $logo,
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, 'TEAM_ID' => $row['team_id'],
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, 'TEAM' => $row['team_name'],
SUM(IF(m.team_id_home = t.team_id, 'TEAM_SHORT' => $row['team_name_short'],
IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)), 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'],
IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0)) 'tid' => $row['team_id'], 'mode' => 'played')),
) 'GAMES' => $row['matches'],
) AS points, 'WIN' => $row['win'],
SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goals_diff, 'DRAW' => $row['draw'],
SUM(IF(m.team_id_home = t.team_id, goals_home, goals_guest)) AS goals, 'LOST' => $row['lost'],
SUM(IF(m.team_id_home = t.team_id, goals_guest, goals_home)) AS goals_against 'GOALS' => $row['goals'],
FROM ' . FOOTB_TEAMS . ' AS t 'GOALS_AGAINST' => $row['goals_against'],
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league 'GOALS_DIFF' => $row['goals_diff'],
AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id) 'POINTS' => $row['points'],
WHERE t.season = $season )
AND t.league = $league );
AND m.matchday >= $form_from }
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";
$db->sql_freeresult($result);
$result = $db->sql_query($sql); $rank = 0;
$last_group = ''; // Get form-table-information
$current_rank = 0; $sql = 'SELECT
$last_goals = 0; t.*,
$last_goals_againts = 0; SUM(1) AS matches,
$last_points = 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))) AS win,
while($row = $db->sql_fetchrow($result)) 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,
if ($last_group != $row['group_id']) SUM(IF(m.team_id_home = t.team_id,
{ IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)),
$last_group = $row['group_id']; IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))
$rank = 0; )
$last_goals = 0; ) AS points,
$last_goals_againts = 0; SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest , goals_guest - goals_home)) AS goals_diff,
$last_points = 0; SUM(IF(m.team_id_home = t.team_id, goals_home, goals_guest)) AS goals,
$template->assign_block_vars('form', array( SUM(IF(m.team_id_home = t.team_id, goals_guest, goals_home)) AS goals_against
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], FROM ' . FOOTB_TEAMS . ' AS t
) LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league
); AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id)
} WHERE t.season = $season
if ($league_type != 2 OR $row['group_id'] != '') AND t.league = $league
{ AND m.matchday >= $form_from
$data_form = true; AND m.status IN (2, 3,5,6)
$rank++; GROUP BY t.team_id
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
{
$current_rank = $rank . '.'; $result = $db->sql_query($sql);
} $last_group = '';
else $current_rank = 0;
{ $last_goals = 0;
$current_rank = ''; $last_goals_againts = 0;
} $last_points = 0;
$last_points = $row['points']; while($row = $db->sql_fetchrow($result))
$last_goals = $row['goals']; {
$last_goals_againts = $row['goals_against']; if ($last_group != $row['group_id'])
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; {
if ($row['team_symbol'] <> '') $last_group = $row['group_id'];
{ $rank = 0;
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; $last_goals = 0;
} $last_goals_againts = 0;
else $last_points = 0;
{ $template->assign_block_vars('form', array(
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
} )
);
$template->assign_block_vars('form', array( }
'RANK' => $current_rank, if ($league_type != 2 OR $row['group_id'] != '')
'ROW_CLASS' => $row_class, {
'LOGO' => $logo, $data_form = true;
'TEAM_ID' => $row['team_id'], $rank++;
'TEAM' => $row['team_name'], if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
'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 = $rank . '.';
'tid' => $row['team_id'], 'mode' => 'rest')), }
'GAMES' => $row['matches'], else
'WIN' => $row['win'], {
'DRAW' => $row['draw'], $current_rank = '';
'LOST' => $row['lost'], }
'GOALS' => $row['goals'], $last_points = $row['points'];
'GOALS_AGAINST' => $row['goals_against'], $last_goals = $row['goals'];
'GOALS_DIFF' => $row['goals_diff'], $last_goals_againts = $row['goals_against'];
'POINTS' => $row['points'], $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
) if ($row['team_symbol'] <> '')
); {
} $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
} }
$db->sql_freeresult($result); else
$rank = 0; {
// Get home-table-information $logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
$sql = 'SELECT }
t.*,
SUM(1) AS matches, $template->assign_block_vars('form', array(
SUM(IF(goals_home + 0 > goals_guest, 1, 0)) AS win, 'RANK' => $current_rank,
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, 'ROW_CLASS' => $row_class,
SUM(IF(goals_home + 0 < goals_guest, 1, 0)) AS lost, 'LOGO' => $logo,
SUM(IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) AS points, 'TEAM_ID' => $row['team_id'],
SUM(goals_home - goals_guest) AS goals_diff, 'TEAM' => $row['team_name'],
SUM(goals_home) AS goals, 'TEAM_SHORT' => $row['team_name_short'],
SUM(goals_guest) AS goals_against 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'],
FROM ' . FOOTB_TEAMS . ' AS t 'tid' => $row['team_id'], 'mode' => 'rest')),
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league 'GAMES' => $row['matches'],
AND m.team_id_home = t.team_id AND m.group_id = t.group_id) 'WIN' => $row['win'],
WHERE t.season = $season 'DRAW' => $row['draw'],
AND t.league = $league 'LOST' => $row['lost'],
AND m.matchday <= $matchday 'GOALS' => $row['goals'],
AND m.status IN (2, 3,5,6) 'GOALS_AGAINST' => $row['goals_against'],
GROUP BY t.team_id 'GOALS_DIFF' => $row['goals_diff'],
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; 'POINTS' => $row['points'],
)
$result = $db->sql_query($sql); );
$last_group = ''; }
$current_rank = 0; }
$last_goals = 0; $db->sql_freeresult($result);
$last_goals_againts = 0; $rank = 0;
$last_points = 0; // Get home-table-information
while($row = $db->sql_fetchrow($result)) $sql = 'SELECT
{ t.*,
if ($last_group != $row['group_id']) SUM(1) AS matches,
{ SUM(IF(goals_home + 0 > goals_guest, 1, 0)) AS win,
$last_group = $row['group_id']; SUM(IF(goals_home = goals_guest, 1, 0)) AS draw,
$rank = 0; SUM(IF(goals_home + 0 < goals_guest, 1, 0)) AS lost,
$last_goals = 0; SUM(IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) AS points,
$last_goals_againts = 0; SUM(goals_home - goals_guest) AS goals_diff,
$last_points = 0; SUM(goals_home) AS goals,
$template->assign_block_vars('home', array( SUM(goals_guest) AS goals_against
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], 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
if ($league_type != 2 OR $row['group_id'] != '') AND t.league = $league
{ AND m.matchday <= $matchday
$rank++; AND m.status IN (2, 3,5,6)
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) GROUP BY t.team_id
{ ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
$current_rank = $rank . '.';
} $result = $db->sql_query($sql);
else $last_group = '';
{ $current_rank = 0;
$current_rank = ''; $last_goals = 0;
} $last_goals_againts = 0;
$last_points = $row['points']; $last_points = 0;
$last_goals = $row['goals']; while($row = $db->sql_fetchrow($result))
$last_goals_againts = $row['goals_against']; {
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; if ($last_group != $row['group_id'])
if ($row['team_symbol'] <> '') {
{ $last_group = $row['group_id'];
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; $rank = 0;
} $last_goals = 0;
else $last_goals_againts = 0;
{ $last_points = 0;
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; $template->assign_block_vars('home', array(
} 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
)
$template->assign_block_vars('home', array( );
'RANK' => $current_rank, }
'ROW_CLASS' => $row_class, if ($league_type != 2 OR $row['group_id'] != '')
'LOGO' => $logo, {
'TEAM_ID' => $row['team_id'], $rank++;
'TEAM' => $row['team_name'], if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
'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 = $rank . '.';
'tid' => $row['team_id'], 'mode' => 'home')), }
'GAMES' => $row['matches'], else
'WIN' => $row['win'], {
'DRAW' => $row['draw'], $current_rank = '';
'LOST' => $row['lost'], }
'GOALS' => $row['goals'], $last_points = $row['points'];
'GOALS_AGAINST' => $row['goals_against'], $last_goals = $row['goals'];
'GOALS_DIFF' => $row['goals_diff'], $last_goals_againts = $row['goals_against'];
'POINTS' => $row['points'], $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
) if ($row['team_symbol'] <> '')
); {
} $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
} }
$db->sql_freeresult($result); else
$rank = 0; {
// Get away-table-information $logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
$sql = 'SELECT }
t.*,
SUM(1) AS matches, $template->assign_block_vars('home', array(
SUM(IF(goals_home + 0 < goals_guest, 1, 0)) AS win, 'RANK' => $current_rank,
SUM(IF(goals_home = goals_guest, 1, 0)) AS draw, 'ROW_CLASS' => $row_class,
SUM(IF(goals_home + 0 > goals_guest, 1, 0)) AS lost, 'LOGO' => $logo,
SUM(IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) AS points, 'TEAM_ID' => $row['team_id'],
SUM(goals_guest - goals_home) AS goals_diff, 'TEAM' => $row['team_name'],
SUM(goals_guest) AS goals, 'TEAM_SHORT' => $row['team_name_short'],
SUM(goals_home) AS goals_against 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'],
FROM ' . FOOTB_TEAMS . ' AS t 'tid' => $row['team_id'], 'mode' => 'home')),
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league 'GAMES' => $row['matches'],
AND m.team_id_guest = t.team_id AND m.group_id = t.group_id) 'WIN' => $row['win'],
WHERE t.season = $season 'DRAW' => $row['draw'],
AND t.league = $league 'LOST' => $row['lost'],
AND m.matchday <= $matchday 'GOALS' => $row['goals'],
AND m.status IN (2, 3,5,6) 'GOALS_AGAINST' => $row['goals_against'],
GROUP BY t.team_id 'GOALS_DIFF' => $row['goals_diff'],
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC"; 'POINTS' => $row['points'],
)
$result = $db->sql_query($sql); );
$last_group = ''; }
$current_rank = 0; }
$last_goals = 0; $db->sql_freeresult($result);
$last_goals_againts = 0; $rank = 0;
$last_points = 0; // Get away-table-information
while($row = $db->sql_fetchrow($result)) $sql = 'SELECT
{ t.*,
if ($last_group != $row['group_id']) SUM(1) AS matches,
{ SUM(IF(goals_home + 0 < goals_guest, 1, 0)) AS win,
$last_group = $row['group_id']; SUM(IF(goals_home = goals_guest, 1, 0)) AS draw,
$rank = 0; SUM(IF(goals_home + 0 > goals_guest, 1, 0)) AS lost,
$last_goals = 0; SUM(IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))) AS points,
$last_goals_againts = 0; SUM(goals_guest - goals_home) AS goals_diff,
$last_points = 0; SUM(goals_guest) AS goals,
$template->assign_block_vars('away', array( SUM(goals_home) AS goals_against
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'], FROM ' . FOOTB_TEAMS . ' AS t
) LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league
); AND m.team_id_guest = t.team_id AND m.group_id = t.group_id)
} WHERE t.season = $season
if ($league_type != 2 OR $row['group_id'] != '') AND t.league = $league
{ AND m.matchday <= $matchday
$rank++; AND m.status IN (2, 3,5,6)
if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against']) GROUP BY t.team_id
{ ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC, t.team_name ASC";
$current_rank = $rank . '.';
} $result = $db->sql_query($sql);
else $last_group = '';
{ $current_rank = 0;
$current_rank = ''; $last_goals = 0;
} $last_goals_againts = 0;
$last_points = $row['points']; $last_points = 0;
$last_goals = $row['goals']; while($row = $db->sql_fetchrow($result))
$last_goals_againts = $row['goals_against']; {
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; if ($last_group != $row['group_id'])
if ($row['team_symbol'] <> '') {
{ $last_group = $row['group_id'];
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ; $rank = 0;
} $last_goals = 0;
else $last_goals_againts = 0;
{ $last_points = 0;
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ; $template->assign_block_vars('away', array(
} 'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
)
$template->assign_block_vars('away', array( );
'RANK' => $current_rank, }
'ROW_CLASS' => $row_class, if ($league_type != 2 OR $row['group_id'] != '')
'LOGO' => $logo, {
'TEAM_ID' => $row['team_id'], $rank++;
'TEAM' => $row['team_name'], if ($last_points <> $row['points'] OR $last_goals <> $row['goals'] OR $last_goals_againts <> $row['goals_against'])
'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 = $rank . '.';
'tid' => $row['team_id'], 'mode' => 'away')), }
'GAMES' => $row['matches'], else
'WIN' => $row['win'], {
'DRAW' => $row['draw'], $current_rank = '';
'LOST' => $row['lost'], }
'GOALS' => $row['goals'], $last_points = $row['points'];
'GOALS_AGAINST' => $row['goals_against'], $last_goals = $row['goals'];
'GOALS_DIFF' => $row['goals_diff'], $last_goals_againts = $row['goals_against'];
'POINTS' => $row['points'], $row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
) if ($row['team_symbol'] <> '')
); {
} $logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
} }
else
$db->sql_freeresult($result); {
$sidename = sprintf($user->lang['TABLE']); $logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
$template->assign_vars(array( }
'S_DISPLAY_TABLE' => true,
'S_SIDENAME' => $sidename, $template->assign_block_vars('away', array(
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday)), 'RANK' => $current_rank,
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['RESULTS']), 'ROW_CLASS' => $row_class,
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)), 'LOGO' => $logo,
'RIGHT_LINK' => sprintf($user->lang['RANK_MATCHDAY']) . ' &gt;', 'TEAM_ID' => $row['team_id'],
'LEFT_TITLE' => sprintf($user->lang['TITLE_RESULTS']), 'TEAM' => $row['team_name'],
'RIGHT_TITLE' => sprintf($user->lang['TITLE_RANK_MATCHDAY']), 'TEAM_SHORT' => $row['team_name_short'],
'S_DATA_TABLE' => $data_table, 'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $row['league'],
'S_DATA_FORM' => $data_form, 'tid' => $row['team_id'], 'mode' => 'away')),
'SEASON' => $season, 'GAMES' => $row['matches'],
'LEAGUE' => $league, 'WIN' => $row['win'],
'TEXT_FORM' => $text_form, 'DRAW' => $row['draw'],
) '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['TABLE']);
$template->assign_vars(array(
'S_DISPLAY_TABLE' => true,
'S_SIDENAME' => $sidename,
'S_DATA_TABLE' => $data_table,
'S_DATA_FORM' => $data_form,
'SEASON' => $season,
'LEAGUE' => $league,
'TEXT_FORM' => $text_form,
)
);
?> ?>

View File

@@ -1,10 +1,10 @@
{ {
"name": "football/football", "name": "football/football",
"type": "phpbb-extension", "type": "phpbb-extension",
"description": "Football Prediction League for phpBB 3.1", "description": "Football Prediction League",
"homepage": "http://football.bplaced.net", "homepage": "http://football.bplaced.net",
"version": "0.9.5", "version": "0.9.9",
"time": "2016-04-22", "time": "2017-09-09",
"license": "GPL-2.0", "license": "GPL-2.0",
"authors": [{ "authors": [{
"name": "J. Helmke", "name": "J. Helmke",
@@ -18,7 +18,7 @@
"extra": { "extra": {
"display-name": "Football Prediction League", "display-name": "Football Prediction League",
"soft-require": { "soft-require": {
"phpbb/phpbb": "3.1.*" "phpbb/phpbb": ">3.1.*"
}, },
"version-check": { "version-check": {
"host": "football.bplaced.net", "host": "football.bplaced.net",

View File

@@ -308,8 +308,8 @@ class main
$user_id = $user->data['user_id']; $user_id = $user->data['user_id'];
$sql = 'SELECT * FROM ' . FOOTB_MATCHES . " WHERE season = $season AND league = $league AND matchday = $matchday AND status <= 0"; $sql = 'SELECT * FROM ' . FOOTB_MATCHES . " WHERE season = $season AND league = $league AND matchday = $matchday AND status <= 0";
$resultopen = $db->sql_query($sql); $resultopen = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($resultopen); $rows = $db->sql_fetchrowset($resultopen);
$db->sql_freeresult($resultopen);
$count_matches = 0; $count_matches = 0;
$count_updates = 0; $count_updates = 0;
@@ -419,7 +419,6 @@ class main
{ {
$dbmsg = sprintf($user->lang['NO_BETS_SAVED']); $dbmsg = sprintf($user->lang['NO_BETS_SAVED']);
} }
$db->sql_freeresult($resultopen);
// extra bets // extra bets
$sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND matchday = $matchday AND extra_status <= 0"; $sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND matchday = $matchday AND extra_status <= 0";
@@ -479,6 +478,7 @@ class main
} }
} }
} }
$db->sql_freeresult($resultextra);
if ($count_extra_updates) if ($count_extra_updates)
{ {
$dbmsg = $dbmsg . ' ' . sprintf($user->lang['EXTRA_BET' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates); $dbmsg = $dbmsg . ' ' . sprintf($user->lang['EXTRA_BET' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates);
@@ -725,6 +725,7 @@ 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);
@@ -823,7 +824,7 @@ class main
$league_type = $row['league_type']; $league_type = $row['league_type'];
$db->sql_freeresult($result); $db->sql_freeresult($result);
$lang_dates = $user->lang['datetime']; $lang_dates = $user->lang['datetime'];
$local_board_time = time() + (($config['board_timezone'] - $config['football_host_timezone']) * 3600); $local_board_time = time() + ($config['football_time_shift'] * 3600);
$sql = "SELECT *, $sql = "SELECT *,
CONCAT( CONCAT(
CASE DATE_FORMAT(delivery_date,'%w') CASE DATE_FORMAT(delivery_date,'%w')
@@ -902,7 +903,14 @@ class main
if (!$user->data['football_mobile']) if (!$user->data['football_mobile'])
{ {
// Start matchday list // Start matchday list
include($this->football_root_path . 'block/rank_matchday.' . $this->php_ext); if ($side == 'bet')
{
include($this->football_root_path . 'block/side_table.' . $this->php_ext);
}
else
{
include($this->football_root_path . 'block/rank_matchday.' . $this->php_ext);
}
// End matchday list // End matchday list
//***************************************************************************** //*****************************************************************************
@@ -993,7 +1001,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

@@ -1,325 +1,336 @@
<?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\cron\task; namespace football\football\cron\task;
class football_remember extends \phpbb\cron\task\base class football_remember extends \phpbb\cron\task\base
{ {
/* @var string phpBB root path */ /* @var string phpBB root path */
protected $root_path; protected $root_path;
/* @var string phpEx */ /* @var string phpEx */
protected $php_ext; protected $php_ext;
/* @var \phpbb\extension\manager */ /* @var \phpbb\extension\manager */
protected $phpbb_extension_manager; protected $phpbb_extension_manager;
/* @var \phpbb\path_helper */ /* @var \phpbb\path_helper */
protected $phpbb_path_helper; protected $phpbb_path_helper;
/* @var \phpbb\db\driver\driver_interface */ /* @var \phpbb\db\driver\driver_interface */
protected $db; protected $db;
/* @var \phpbb\config\config */ /* @var \phpbb\config\config */
protected $config; protected $config;
/* @var \phpbb\log\log_interface */ /* @var \phpbb\log\log_interface */
protected $log; protected $log;
/* @var \phpbb\user */ /* @var \phpbb\user */
protected $user; protected $user;
/** /**
* Constructor * Constructor
* *
* @param string $root_path * @param string $root_path
* @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_interfacer $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
*/ */
public function __construct($root_path, $php_ext, \phpbb\extension\manager $phpbb_extension_manager, \phpbb\path_helper $phpbb_path_helper, \phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\log\log_interface $log, \phpbb\user $user) public function __construct($root_path, $php_ext, \phpbb\extension\manager $phpbb_extension_manager, \phpbb\path_helper $phpbb_path_helper, \phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\log\log_interface $log, \phpbb\user $user)
{ {
$this->root_path = $root_path; $this->root_path = $root_path;
$this->php_ext = $php_ext; $this->php_ext = $php_ext;
$this->phpbb_extension_manager = $phpbb_extension_manager; $this->phpbb_extension_manager = $phpbb_extension_manager;
$this->phpbb_path_helper = $phpbb_path_helper; $this->phpbb_path_helper = $phpbb_path_helper;
$this->db = $db; $this->db = $db;
$this->config = $config; $this->config = $config;
$this->phpbb_log = $log; $this->phpbb_log = $log;
$this->user = $user; $this->user = $user;
} }
/** /**
* Runs this cron task. * Runs this cron task.
* *
* @return null * @return null
*/ */
public function run() public function run()
{ {
global $request; global $request;
$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));
include($ext_path . 'includes/functions.' . $this->php_ext); include($ext_path . 'includes/functions.' . $this->php_ext);
include($ext_path . 'includes/constants.' . $this->php_ext); include($ext_path . 'includes/constants.' . $this->php_ext);
// Load extension language file // Load extension language file
$this->user->add_lang_ext('football/football', 'info_acp_football'); $this->user->setup();
$this->user->add_lang_ext('football/football', 'info_acp_football');
// mode=test ?
$mode = $request->variable('mode', ''); // mode=test ?
$days = $request->variable('days', 0); $mode = $request->variable('mode', '');
$days = $request->variable('days', 0);
//Mail Settings
$use_queue = false; //Mail Settings
$used_method = NOTIFY_EMAIL; $use_queue = false;
$priority = MAIL_NORMAL_PRIORITY; $used_method = NOTIFY_EMAIL;
$priority = MAIL_NORMAL_PRIORITY;
$season = curr_season();
//Matchdays to close in 24 hours and 24 hours later $season = curr_season();
$local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600); //Matchdays to close in 24 hours and 24 hours later
// shift days to test // shift days to test
$local_board_time = $local_board_time + ($days * 86400); $local_board_time = time() + ($days * 86400);
if ($mode <> 'test') if ($mode <> 'test')
{ {
// Update next run // Update next run
$run_time = getdate($this->config['football_remember_next_run']); $run_time = getdate($this->config['football_remember_next_run']);
$next_run = mktime($run_time['hours'], $run_time['minutes'], 0, date("n"), date("j") + 1, date("Y")); $next_run = mktime($run_time['hours'], $run_time['minutes'], 0, date("n"), date("j") + 1, date("Y"));
$this->config->set('football_remember_next_run', $next_run, true); $this->config->set('football_remember_next_run', $next_run, true);
} }
else else
{ {
$message = sprintf($this->user->lang['LOG_FOOTBALL_MSG_TEST' . (($days == 0) ? '' : '_TRAVEL')], date("d.m.Y H:i", $local_board_time)); $message = sprintf($this->user->lang['LOG_FOOTBALL_MSG_TEST' . (($days == 0) ? '' : '_TRAVEL')], date("d.m.Y H:i", $local_board_time));
$this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON_TEST', false, array($message)); $this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON_TEST', false, array($message));
} }
$sql = 'SELECT $sql = 'SELECT
m.*, m.*,
l.* l.*
FROM ' . FOOTB_MATCHDAYS . ' AS m FROM ' . FOOTB_MATCHDAYS . ' AS m
LEFT JOIN ' . FOOTB_LEAGUES . " AS l ON (l.season = m.season AND l.league = m.league) LEFT JOIN ' . FOOTB_LEAGUES . " AS l ON (l.season = m.season AND l.league = m.league)
WHERE m.season >= $season AND m.status = 0 WHERE m.season >= $season AND m.status = 0
AND (DATE_SUB(m.delivery_date, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time')) AND (DATE_SUB(m.delivery_date, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time'))
AND (DATE_SUB(m.delivery_date, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time'))"; AND (DATE_SUB(m.delivery_date, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time'))
$result = $this->db->sql_query($sql); GROUP BY m.season, m.league, m.matchday";
$toclose = $this->db->sql_fetchrowset($result); $result = $this->db->sql_query($sql);
$this->db->sql_freeresult($result); $toclose = $this->db->sql_fetchrowset($result);
$this->db->sql_freeresult($result);
// If we found matchdays to close, search missing bets and mail them
foreach ($toclose as $close) // If we found matchdays to close, search missing bets and mail them
{ foreach ($toclose as $close)
// prepare some variables {
$first_mail = true; // prepare some variables
$season = $close['season']; $first_mail = true;
$league = $close['league']; $season = $close['season'];
$league_name = $close['league_name']; $league = $close['league'];
$league_short = $close['league_name_short']; $league_name = $close['league_name'];
$delivery = $close['delivery_date']; $league_short = $close['league_name_short'];
$matchday = $close['matchday']; $delivery = $close['delivery_date'];
$subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_SUBJECT'], $league_short, $matchday); $matchday = $close['matchday'];
$usernames = ''; $subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_SUBJECT'], $league_short, $matchday);
$usernames = '';
// find missing users
$sql = 'SELECT // find missing users
u.user_email AS user_email, $sql = 'SELECT
u.username AS username, u.user_email AS user_email,
u.user_id AS userid, u.username AS username,
u.user_lang u.user_id AS userid,
FROM ' . FOOTB_MATCHES . ' AS m u.user_lang
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) FROM ' . FOOTB_MATCHES . ' AS m
LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id LEFT JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league)
LEFT JOIN ' . USERS_TABLE. " AS u ON u.user_id = b.user_id 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 AND m.league = $league AND m.matchday = $matchday LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id
AND ((b.goals_home = '') OR (b.goals_guest = '')) LEFT JOIN ' . USERS_TABLE. " AS u ON u.user_id = b.user_id
AND m.status = 0 AND p.pf_footb_rem_f = 1 WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday
GROUP BY b.user_id AND ((b.goals_home = '') OR (b.goals_guest = ''))
UNION AND m.status = 0 AND p.pf_footb_rem_f = 1
SELECT AND (l.bet_in_time = 0 OR
p.pf_footb_email AS user_email, (l.bet_in_time = 1
u.username AS username, AND (DATE_SUB(m.match_datetime, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time'))
u.user_id AS userid, AND (DATE_SUB(m.match_datetime, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time'))))
u.user_lang GROUP BY b.user_id
FROM " . FOOTB_MATCHES . ' AS m UNION
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) SELECT
LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id p.pf_footb_email AS user_email,
LEFT JOIN ' . USERS_TABLE. " AS u ON u.user_id = b.user_id u.username AS username,
WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday u.user_id AS userid,
AND ((b.goals_home = '') OR (b.goals_guest = '')) u.user_lang
AND m.status = 0 AND p.pf_footb_rem_s = 1 FROM " . FOOTB_MATCHES . ' AS m
GROUP BY b.user_id LEFT JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league)
"; LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
$result = $this->db->sql_query($sql); LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id
$row = $this->db->sql_fetchrow($result); LEFT JOIN ' . USERS_TABLE. " AS u ON u.user_id = b.user_id
WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday
if (!$row) AND ((b.goals_home = '') OR (b.goals_guest = ''))
{ AND m.status = 0 AND p.pf_footb_rem_s = 1
$this->db->sql_freeresult($result); AND (l.bet_in_time = 0 OR
} (l.bet_in_time = 1
else AND (DATE_SUB(m.match_datetime, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time'))
{ AND (DATE_SUB(m.match_datetime, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time'))))
GROUP BY b.user_id
// Send the messages ";
include_once($this->root_path . 'includes/functions_messenger.' . $this->php_ext); $result = $this->db->sql_query($sql);
$messenger = new \messenger($use_queue); $row = $this->db->sql_fetchrow($result);
include_once($this->root_path . 'includes/functions_user.' . $this->php_ext);
$errored = false; if (!$row)
$messenger->headers('X-AntiAbuse: Board servername - ' . $this->config['server_name']); {
$messenger->headers('X-AntiAbuse: User_id - ' . ANONYMOUS); $this->db->sql_freeresult($result);
$messenger->headers('X-AntiAbuse: Username - CRON TASK Football remember'); }
$messenger->headers('X-AntiAbuse: User IP - ' . $this->user->ip); else
$messenger->subject(htmlspecialchars_decode($subject)); {
$messenger->set_mail_priority($priority);
// Send the messages
do include_once($this->root_path . 'includes/functions_messenger.' . $this->php_ext);
{ $messenger = new \messenger($use_queue);
// Send the messages include_once($this->root_path . 'includes/functions_user.' . $this->php_ext);
$used_lang = $row['user_lang']; $errored = false;
$mail_template_path = $ext_path . 'language/' . $used_lang . '/email/'; $messenger->headers('X-AntiAbuse: Board servername - ' . $this->config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . ANONYMOUS);
if ($mode <> 'test') $messenger->headers('X-AntiAbuse: Username - CRON TASK Football remember');
{ $messenger->headers('X-AntiAbuse: User IP - ' . $this->user->ip);
$messenger->to($row['user_email'], $row['username']); $messenger->subject(htmlspecialchars_decode($subject));
} $messenger->set_mail_priority($priority);
else
{ do
// test send to board email {
$messenger->to($this->config['board_email'], $this->config['sitename']); // Send the messages
} $used_lang = $row['user_lang'];
$messenger->template('footb_send_remember', $used_lang, $mail_template_path); $mail_template_path = $ext_path . 'language/' . $used_lang . '/email/';
$messenger->assign_vars(array( if ($mode <> 'test')
'USERNAME' => $row['username'], {
'LEAGUE' => $league_name, $messenger->to($row['user_email'], $row['username']);
'MATCHDAY' => $matchday, }
'DELIVERY' => $delivery, else
'CONTACT_EMAIL' => $this->config['board_contact']) {
); // test send to board email
$messenger->to($this->config['board_email'], $this->config['sitename']);
if ($mode <> 'test') }
{ $messenger->template('footb_send_remember', $used_lang, $mail_template_path);
if (!($messenger->send($used_method)))
{ $messenger->assign_vars(array(
$message = '<strong>' . sprintf($this->user->lang['FOOTBALL_REMEMBER_ERROR_EMAIL'], $league_short, $row['user_email']) . '</strong>'; 'USERNAME' => $row['username'],
$this->phpbb_log->add('critical', ANONYMOUS, '', 'LOG_ERROR_EMAIL', false, array($message)); 'LEAGUE' => $league_name,
$usernames .= (($usernames != '') ? ', ' : '') . $row['username']. '!'; 'MATCHDAY' => $matchday,
} 'DELIVERY' => $delivery,
else 'CONTACT_EMAIL' => $this->config['board_contact'])
{ );
$usernames .= (($usernames != '') ? ', ' : '') . $row['username'];
} if ($mode <> 'test')
} {
else if (!($messenger->send($used_method)))
{ {
// Test mode $message = '<strong>' . sprintf($this->user->lang['FOOTBALL_REMEMBER_ERROR_EMAIL'], $league_short, $row['user_email']) . '</strong>';
if ($first_mail) $this->phpbb_log->add('critical', ANONYMOUS, '', 'LOG_ERROR_EMAIL', false, array($message));
{ $usernames .= (($usernames != '') ? ', ' : '') . $row['username']. '!';
// only send one mail }
if (!($messenger->send($used_method))) else
{ {
$message = '<strong>' . sprintf($this->user->lang['FOOTBALL_REMEMBER_ERROR_EMAIL'], $league_short, $row['user_email']) . '</strong>'; $usernames .= (($usernames != '') ? ', ' : '') . $row['username'];
$this->phpbb_log->add('critical', ANONYMOUS, '', 'LOG_ERROR_EMAIL', false, array($message)); }
$usernames .= (($usernames != '') ? ', ' : '') . $row['username']. '!'; }
} else
else {
{ // Test mode
$usernames .= (($usernames != '') ? ', ' : '') . $row['username']; if ($first_mail)
} {
$first_mail = false; // only send one mail
} if (!($messenger->send($used_method)))
else {
{ $message = '<strong>' . sprintf($this->user->lang['FOOTBALL_REMEMBER_ERROR_EMAIL'], $league_short, $row['user_email']) . '</strong>';
$usernames .= (($usernames != '') ? ', ' : '') . $row['username']; $this->phpbb_log->add('critical', ANONYMOUS, '', 'LOG_ERROR_EMAIL', false, array($message));
} $usernames .= (($usernames != '') ? ', ' : '') . $row['username']. '!';
} }
} else
while ($row = $this->db->sql_fetchrow($result)); {
$this->db->sql_freeresult($result); $usernames .= (($usernames != '') ? ', ' : '') . $row['username'];
}
// Only if mails have already been sent previously $first_mail = false;
if ($usernames <> '') }
{ else
// send mail to board administration {
$used_lang = $this->config['default_lang']; $usernames .= (($usernames != '') ? ', ' : '') . $row['username'];
$mail_template_path = $ext_path . 'language/' . $used_lang . '/email/'; }
$subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_SUBJECT_BOARD'], $league_short, $matchday); }
$messenger->to($this->config['board_email'], $this->config['sitename']); }
$messenger->subject(htmlspecialchars_decode($subject)); while ($row = $this->db->sql_fetchrow($result));
$messenger->template('footb_board_remember', $used_lang, $mail_template_path); $this->db->sql_freeresult($result);
$messenger->assign_vars(array(
'CONTACT_EMAIL' => $this->config['board_contact'], // Only if mails have already been sent previously
'REMEMBER_LIST' => $usernames, if ($usernames <> '')
) {
); // send mail to board administration
$used_lang = $this->config['default_lang'];
if (!($messenger->send($used_method))) $mail_template_path = $ext_path . 'language/' . $used_lang . '/email/';
{ $subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_SUBJECT_BOARD'], $league_short, $matchday);
$message = '<strong>' . sprintf($this->user->lang['FOOTBALL_REMEMBER_ERROR_EMAIL_BOARD'], $league_short, $this->config['board_email']) . '</strong>'; $messenger->to($this->config['board_email'], $this->config['sitename']);
$this->phpbb_log->add('critical', ANONYMOUS, '', 'LOG_ERROR_EMAIL', false, array($message)); $messenger->subject(htmlspecialchars_decode($subject));
} $messenger->template('footb_board_remember', $used_lang, $mail_template_path);
else $messenger->assign_vars(array(
{ 'CONTACT_EMAIL' => $this->config['board_contact'],
$log_subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_SEND'], $league_short, $usernames) ; 'REMEMBER_LIST' => $usernames,
$this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON', false, array($log_subject)); )
} );
}
else if (!($messenger->send($used_method)))
{ {
// Log the cronjob run $message = '<strong>' . sprintf($this->user->lang['FOOTBALL_REMEMBER_ERROR_EMAIL_BOARD'], $league_short, $this->config['board_email']) . '</strong>';
$log_subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_NOBODY']) ; $this->phpbb_log->add('critical', ANONYMOUS, '', 'LOG_ERROR_EMAIL', false, array($message));
$this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON', false, array($log_subject)); }
} else
} {
} $log_subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_SEND'], $league_short, $usernames) ;
if (sizeof($toclose) == 0) $this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON', false, array($log_subject));
{ }
// Log the cronjob run }
$log_subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_NO_DELIVERY']) ; else
$this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON', false, array($log_subject)); {
} // Log the cronjob run
$log_subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_NOBODY']) ;
return; $this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON', false, array($log_subject));
} }
}
/** }
* Returns whether this cron task can run, given current board configuration. if (sizeof($toclose) == 0)
* {
* @return bool // Log the cronjob run
*/ $log_subject = sprintf($this->user->lang['FOOTBALL_REMEMBER_NO_DELIVERY']) ;
public function is_runnable() $this->phpbb_log->add('admin', ANONYMOUS, '', 'LOG_FOOTBALL_REMEMBER_CRON', false, array($log_subject));
{ }
return (bool) $this->config['football_remember_enable'];
} return;
}
/**
* Returns whether this cron task should run now, because next run time /**
* has passed. * Returns whether this cron task can run, given current board configuration.
* *
* @return bool * @return bool
*/ */
public function should_run() public function is_runnable()
{ {
global $request; return (bool) $this->config['football_remember_enable'];
$mode = $request->variable('mode', ''); }
if ($mode <> 'test') /**
{ * Returns whether this cron task should run now, because next run time
return $this->config['football_remember_next_run'] < time(); * has passed.
} *
else * @return bool
{ */
return true; public function should_run()
} {
} global $request;
} $mode = $request->variable('mode', '');
if ($mode <> 'test')
{
return $this->config['football_remember_next_run'] < time();
}
else
{
return true;
}
}
}
?> ?>

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

View File

@@ -1,271 +1,271 @@
<?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;
} }
$sql = 'SELECT * $sql = 'SELECT *
FROM ' . FOOTB_LEAGUES . " FROM ' . FOOTB_LEAGUES . "
WHERE season = $season WHERE season = $season
AND league = $league"; AND league = $league";
if( !$result = $db->sql_query($sql) ) if( !$result = $db->sql_query($sql) )
{ {
trigger_error('NO_LEAGUE'); trigger_error('NO_LEAGUE');
} }
$league_short = $db->sql_fetchfield('league_name_short'); $league_short = $db->sql_fetchfield('league_name_short');
$db->sql_freeresult($result); $db->sql_freeresult($result);
$export_file = $league_short . '_'. $season. '_Tipps.csv'; $export_file = $league_short . '_'. $season. '_Tipps.csv';
$path_attachment = './../../files/' . $export_file; $path_attachment = './../../files/' . $export_file;
$newline = "\r\n"; $newline = "\r\n";
if (!isset($_POST['send'])) if (!isset($_POST['send']))
{ {
header('Pragma: no-cache'); header('Pragma: no-cache');
header("Content-Type: text/csv; name=\"$export_file\""); header("Content-Type: text/csv; name=\"$export_file\"");
header("Content-disposition: attachment; filename=$export_file"); header("Content-disposition: attachment; filename=$export_file");
// header('Content-Type: text/x-csv'); // header('Content-Type: text/x-csv');
// header('Expires: ' . gmdate('D, d M Y H:i:m') . ' GMT'); // header('Expires: ' . gmdate('D, d M Y H:i:m') . ' GMT');
// header('Content-Disposition: attachment; filename='. $export_file); // header('Content-Disposition: attachment; filename='. $export_file);
$phpbb_root_path = './../'; $phpbb_root_path = './../';
} }
else else
{ {
$phpbb_root_path = './../../'; $phpbb_root_path = './../../';
} }
$sql_users = 'SELECT DISTINCT $sql_users = 'SELECT DISTINCT
b.user_id, b.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 b.season = $season AND b.league = $league WHERE b.season = $season AND b.league = $league
ORDER BY b.user_id ASC"; ORDER BY b.user_id ASC";
$sql_results = "SELECT $sql_results = "SELECT
m.match_no, m.match_no,
DATE_FORMAT(m.match_datetime,'%d.%m.%Y') AS match_time, DATE_FORMAT(m.match_datetime,'%d.%m.%Y') AS match_time,
m.matchday, m.matchday,
m.formula_home, m.formula_home,
m.formula_guest, m.formula_guest,
t1.team_id AS hid, t1.team_id AS hid,
t2.team_id AS gid, t2.team_id AS gid,
t1.team_name_short AS team_home, t1.team_name_short AS team_home,
t2.team_name_short AS team_guest, t2.team_name_short AS team_guest,
m.status, m.status,
m.goals_home, m.goals_home,
m.goals_guest m.goals_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)
WHERE m.season = $season AND m.league = $league WHERE m.season = $season AND m.league = $league
ORDER BY m.match_no ASC"; ORDER BY m.match_no ASC";
$sql_bets = "SELECT $sql_bets = "SELECT
m.matchday, m.matchday,
m.match_no, m.match_no,
b.user_id, b.user_id,
IF(m.status > 0, b.goals_home, '') AS bet_home, IF(m.status > 0, b.goals_home, '') AS bet_home,
IF(m.status > 0, b.goals_guest, '') AS bet_guest IF(m.status > 0, b.goals_guest, '') AS bet_guest
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)
WHERE m.season = $season AND m.league = $league WHERE m.season = $season AND m.league = $league
ORDER BY matchday ASC, match_no ASC, user_id ASC"; ORDER BY matchday ASC, match_no ASC, user_id ASC";
if(!$result_users = $db->sql_query($sql_users)) if(!$result_users = $db->sql_query($sql_users))
{ {
trigger_error('NO_USER'); trigger_error('NO_USER');
} }
$rows_users = $db->sql_fetchrowset($result_users); $rows_users = $db->sql_fetchrowset($result_users);
$count_user = sizeof($rows_users); $count_user = sizeof($rows_users);
$db->sql_freeresult($result_users); $db->sql_freeresult($result_users);
$j = 0; $j = 0;
$column = array(); $column = array();
foreach ($rows_users as $row_user) foreach ($rows_users as $row_user)
{ {
$column[(8 + (3 * ($j)))] = str_replace("\"", "\"\"", $row_user['username']); $column[(8 + (3 * ($j)))] = str_replace("\"", "\"\"", $row_user['username']);
$lastcolumn = 8 + (3 * ($j)); $lastcolumn = 8 + (3 * ($j));
$bet_column[$row_user['user_id']] = $lastcolumn; $bet_column[$row_user['user_id']] = $lastcolumn;
$j++; $j++;
} }
$export_row_users = "\"\";\"\";\"\";\"\";\"\";\"\";"; $export_row_users = "\"\";\"\";\"\";\"\";\"\";\"\";";
for($j = 8; $j <= $lastcolumn; $j = $j + 3) for($j = 8; $j <= $lastcolumn; $j = $j + 3)
{ {
$export_row_users .= "\"\";\"\";\"" . $column[$j] . "\""; $export_row_users .= "\"\";\"\";\"" . $column[$j] . "\"";
if($j != $lastcolumn) if($j != $lastcolumn)
{ {
$export_row_users .= ';'; $export_row_users .= ';';
} }
} }
$export_row_users .= $newline; $export_row_users .= $newline;
if( !$result_results = $db->sql_query($sql_results) ) if( !$result_results = $db->sql_query($sql_results) )
{ {
trigger_error('NO_RESULTS'); trigger_error('NO_RESULTS');
} }
$rows_results = $db->sql_fetchrowset($result_results); $rows_results = $db->sql_fetchrowset($result_results);
$count_results = sizeof($rows_results); $count_results = sizeof($rows_results);
$db->sql_freeresult($result_results); $db->sql_freeresult($result_results);
if( !$result_bets = $db->sql_query($sql_bets) ) if( !$result_bets = $db->sql_query($sql_bets) )
{ {
trigger_error('NO_BETS'); trigger_error('NO_BETS');
} }
$rows_bets = $db->sql_fetchrowset($result_bets); $rows_bets = $db->sql_fetchrowset($result_bets);
$count_bets = sizeof($rows_bets); $count_bets = sizeof($rows_bets);
$db->sql_freeresult($result_results); $db->sql_freeresult($result_bets);
$column = array(); $column = array();
$lastcolumn = 0; $lastcolumn = 0;
$last_match_num = 0; $last_match_num = 0;
foreach ($rows_bets as $row_bet) foreach ($rows_bets as $row_bet)
{ {
if ($row_bet['match_no'] == $last_match_num) if ($row_bet['match_no'] == $last_match_num)
{ {
$column[$bet_column[$row_bet['user_id']]] = str_replace("\"", "\"\"", $row_bet['bet_home']); $column[$bet_column[$row_bet['user_id']]] = str_replace("\"", "\"\"", $row_bet['bet_home']);
$column[$bet_column[$row_bet['user_id']] + 1] = str_replace("\"", "\"\"", $row_bet['bet_guest']); $column[$bet_column[$row_bet['user_id']] + 1] = str_replace("\"", "\"\"", $row_bet['bet_guest']);
$column[$bet_column[$row_bet['user_id']] + 2] = ''; $column[$bet_column[$row_bet['user_id']] + 2] = '';
$lastcolumn = $bet_column[$row_bet['user_id']] + 2; $lastcolumn = $bet_column[$row_bet['user_id']] + 2;
} }
else else
{ {
if ($lastcolumn > 0) if ($lastcolumn > 0)
{ {
$export_bets[$last_match_num] = ''; $export_bets[$last_match_num] = '';
for($j=8; $j<=$lastcolumn; $j++) for($j=8; $j<=$lastcolumn; $j++)
{ {
$export_bets[$last_match_num] .= "\"" . $column[$j] . "\""; $export_bets[$last_match_num] .= "\"" . $column[$j] . "\"";
if($j!=$lastcolumn) if($j!=$lastcolumn)
{ {
$export_bets[$last_match_num] .= ';'; $export_bets[$last_match_num] .= ';';
} }
} }
$export_bets[$last_match_num] .= $newline; $export_bets[$last_match_num] .= $newline;
} }
$column = array(); $column = array();
$last_match_num = $row_bet['match_no']; $last_match_num = $row_bet['match_no'];
$column[$bet_column[$row_bet['user_id']]] = str_replace("\"", "\"\"", $row_bet['bet_home']); $column[$bet_column[$row_bet['user_id']]] = str_replace("\"", "\"\"", $row_bet['bet_home']);
$column[$bet_column[$row_bet['user_id']] + 1] = str_replace("\"", "\"\"", $row_bet['bet_guest']); $column[$bet_column[$row_bet['user_id']] + 1] = str_replace("\"", "\"\"", $row_bet['bet_guest']);
$column[$bet_column[$row_bet['user_id']] + 2] = ''; $column[$bet_column[$row_bet['user_id']] + 2] = '';
$lastcolumn = $bet_column[$row_bet['user_id']] + 2; $lastcolumn = $bet_column[$row_bet['user_id']] + 2;
} }
} }
$export_bets[$last_match_num] = ''; $export_bets[$last_match_num] = '';
for($j = 8; $j <= $lastcolumn; $j++) for($j = 8; $j <= $lastcolumn; $j++)
{ {
$export_bets[$last_match_num] .= "\"" . $column[$j] . "\""; $export_bets[$last_match_num] .= "\"" . $column[$j] . "\"";
if($j != $lastcolumn) if($j != $lastcolumn)
{ {
$export_bets[$last_match_num] .= ';'; $export_bets[$last_match_num] .= ';';
} }
} }
$export_bets[$last_match_num] .= $newline; $export_bets[$last_match_num] .= $newline;
$last_matchday = 0; $last_matchday = 0;
$export= ''; $export= '';
$export .= 'CSV;'. $league. ';'. $season. $newline; $export .= 'CSV;'. $league. ';'. $season. $newline;
$i = 0; $i = 0;
foreach ($rows_results as $row_result) foreach ($rows_results as $row_result)
{ {
if ($last_matchday != $row_result['matchday']) if ($last_matchday != $row_result['matchday'])
{ {
if ($last_matchday != 0) if ($last_matchday != 0)
{ {
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= ";;". str_replace("\"", "\"\"", $row_result['match_time']). $newline; $export .= ";;". str_replace("\"", "\"\"", $row_result['match_time']). $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
} }
else else
{ {
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= ";;". str_replace("\"", "\"\"", $row_result['match_time']). $newline; $export .= ";;". str_replace("\"", "\"\"", $row_result['match_time']). $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
$export .= $newline; $export .= $newline;
} }
$export .= $export_row_users; $export .= $export_row_users;
$column = array(); $column = array();
$last_matchday = $row_result['matchday']; $last_matchday = $row_result['matchday'];
} }
if (0 == $row_result['hid']) if (0 == $row_result['hid'])
{ {
$home_info = get_team($season, $league, $row_result['match_no'], 'team_id_home', $row_result['formula_home']); $home_info = get_team($season, $league, $row_result['match_no'], 'team_id_home', $row_result['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 = $row_result['team_home']; $homename = $row_result['team_home'];
} }
if (0 == $row_result['gid']) if (0 == $row_result['gid'])
{ {
$guest_info = get_team($season, $league, $row_result['match_no'], 'team_id_guest', $row_result['formula_guest']); $guest_info = get_team($season, $league, $row_result['match_no'], 'team_id_guest', $row_result['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 = $row_result['team_guest']; $guestname = $row_result['team_guest'];
} }
$column[0] = str_replace("\"", "\"\"", $homename); $column[0] = str_replace("\"", "\"\"", $homename);
$column[1] = str_replace("\"", "\"\"", $guestname); $column[1] = str_replace("\"", "\"\"", $guestname);
if ($row_result['status'] == 3) if ($row_result['status'] == 3)
{ {
$column[2] = str_replace("\"", "\"\"", $row_result['goals_home']); $column[2] = str_replace("\"", "\"\"", $row_result['goals_home']);
$column[4] = str_replace("\"", "\"\"", $row_result['goals_guest']); $column[4] = str_replace("\"", "\"\"", $row_result['goals_guest']);
} }
else else
{ {
$column[2] = ''; $column[2] = '';
$column[4] = ''; $column[4] = '';
} }
$export .= "\"" . $column[0] . "\";\"" . $column[1] . "\";\"" . $column[2] . "\";\"\";\"" . $column[4] . "\";\"\";\"\";\"\";"; $export .= "\"" . $column[0] . "\";\"" . $column[1] . "\";\"" . $column[2] . "\";\"\";\"" . $column[4] . "\";\"\";\"\";\"\";";
if ($export_bets[$row_result['match_no']] == '') if ($export_bets[$row_result['match_no']] == '')
{ {
$export .= $newline; $export .= $newline;
} }
else else
{ {
$export .= $export_bets[$row_result['match_no']]; $export .= $export_bets[$row_result['match_no']];
} }
$column = array(); $column = array();
$i++; $i++;
} }
if (isset($_POST['send'])) if (isset($_POST['send']))
{ {
$fp = fopen($path_attachment , "b"); $fp = fopen($path_attachment , "b");
ftruncate ($fp, 0); ftruncate ($fp, 0);
rewind($fp); rewind($fp);
fwrite ($fp, $export); fwrite ($fp, $export);
fclose($fp); fclose($fp);
} }
else else
{ {
echo utf8_decode($export); echo utf8_decode($export);
exit; exit;
} }
?> ?>

File diff suppressed because it is too large Load Diff

View File

@@ -58,6 +58,7 @@ $lang = array_merge($lang, array(
'BET_KOEFF' => 'Tippkoeffizient ', 'BET_KOEFF' => 'Tippkoeffizient ',
'BET_OF' => 'Tipp', 'BET_OF' => 'Tipp',
'BET_POINTS' => 'Einsatz', 'BET_POINTS' => 'Einsatz',
'BET_TIME' => 'Tipp Zeit',
'BET_UNTIL_DELIVERY' => 'Die Spiele eines Spieltags können nur bis zum Abgabetermin des Spieltags getippt werden. Danach werden die Tipps der anderen Tipper für alle sichtbar. ', 'BET_UNTIL_DELIVERY' => 'Die Spiele eines Spieltags können nur bis zum Abgabetermin des Spieltags getippt werden. Danach werden die Tipps der anderen Tipper für alle sichtbar. ',
'BETS' => 'Tipps', 'BETS' => 'Tipps',
'BETS_AND_RANKS' => 'Tipps und Ranglisten der', 'BETS_AND_RANKS' => 'Tipps und Ranglisten der',
@@ -192,6 +193,7 @@ $lang = array_merge($lang, array(
'LAST_GAMES' => 'Die letzten Spiele', 'LAST_GAMES' => 'Die letzten Spiele',
'LAST_GAMES_AWAY' => 'Die letzten Auswärtsspiele', 'LAST_GAMES_AWAY' => 'Die letzten Auswärtsspiele',
'LAST_GAMES_HOME' => 'Die letzten Heimspiele', 'LAST_GAMES_HOME' => 'Die letzten Heimspiele',
'LAST_RESULTS' => 'Die letzten Ergebnisse',
'LAST_VISITORS' => 'Die letzten %s Besuche', 'LAST_VISITORS' => 'Die letzten %s Besuche',
'LEAGUE' => 'Liga', 'LEAGUE' => 'Liga',
'LINK_PREDICTION_LEAGUE' => 'Zur Tipprunde', 'LINK_PREDICTION_LEAGUE' => 'Zur Tipprunde',
@@ -290,6 +292,7 @@ $lang = array_merge($lang, array(
'POINTS' => 'Punkte', 'POINTS' => 'Punkte',
'POINTS_DIFF' => 'Punktedifferenz', 'POINTS_DIFF' => 'Punktedifferenz',
'POINTS_DIFFERENCE' => 'Punkte für die richtige Tordifferenz: %s', 'POINTS_DIFFERENCE' => 'Punkte für die richtige Tordifferenz: %s',
'POINTS_DIFFERENCE_DRAW' => 'Punkte für die richtige Tordifferenz (außer bei Unentschieden): %s',
'POINTS_DOT' => 'Pk. ', 'POINTS_DOT' => 'Pk. ',
'POINTS_HIT' => 'Für die Vorhersage des richtigen Ergebnisses (Volltreffer) gibt es %s Punkte. ', 'POINTS_HIT' => 'Für die Vorhersage des richtigen Ergebnisses (Volltreffer) gibt es %s Punkte. ',
'POINTS_LAST' => 'Punkte des letzten für Nichttipper', 'POINTS_LAST' => 'Punkte des letzten für Nichttipper',

View File

@@ -37,7 +37,7 @@ if ( empty($lang) || !is_array($lang) )
// » „ “ — … // » „ “ — …
// //
$help = array( $lang = array_merge($lang, array('FOOTBALL_HELP_FAQ' => array(
array( array(
0 => '--', 0 => '--',
1 => 'Erste Schritte' 1 => 'Erste Schritte'
@@ -93,7 +93,8 @@ footb_rem_s = Schalter für Versand der Erinnerungsmail an die 2. E-Mail-Adresse
0 => 'Wie aktiviere ich die Erinnerungs-Mail Funktion?', 0 => 'Wie aktiviere ich die Erinnerungs-Mail Funktion?',
1 => 'Im Adminbereich muss unter den Tipprunden-Funktionalitäten der Cronjob für die Tipp-Erinnerungsmail aktiviert und der Termin der nächsten Ausführung gesetzt werden.<br /> 1 => 'Im Adminbereich muss unter den Tipprunden-Funktionalitäten der Cronjob für die Tipp-Erinnerungsmail aktiviert und der Termin der nächsten Ausführung gesetzt werden.<br />
Der Cron-Job wird beim ersten Zugriff nach diesem Termin ausgeführt und sendet eine Erinnerungs-Mail für die fehlenden Tippabgaben, die im Zeitraum 24-48 Stunden nach dem Cron-Termin liegen. Der Cron-Job wird beim ersten Zugriff nach diesem Termin ausgeführt und sendet eine Erinnerungs-Mail für die fehlenden Tippabgaben, die im Zeitraum 24-48 Stunden nach dem Cron-Termin liegen.
Falls nicht ausreichend Zugriffe auf die Seite erfolgen, sollte der Cronjob automatisch z.B. von www.cronjob.de durch das Script "cron.php?cron_type=football_remember" gestartet werden.<br /> Falls nicht ausreichend Zugriffe auf die Seite erfolgen, sollte der Cronjob automatisch z.B. von www.cronjob.de durch das Script
"DEINE_URL/cron.php?cron_type=football.football.cron.task.football_remember" gestartet werden.<br />
Das versenden der Email erfolgt nur einmalig. Nach Aufruf des Cronjobs wird der nächste automatisch für den Folgetag eingeplant. Das versenden der Email erfolgt nur einmalig. Nach Aufruf des Cronjobs wird der nächste automatisch für den Folgetag eingeplant.
Mit den angehängten parametern "&mode=test&days=n" kann der Versand für die um n Tage versetzte Tippabgabe getestet werden. Dabei werden nur Mails an Board-Email-Adresse versendet.' Mit den angehängten parametern "&mode=test&days=n" kann der Versand für die um n Tage versetzte Tippabgabe getestet werden. Dabei werden nur Mails an Board-Email-Adresse versendet.'
), ),
@@ -526,5 +527,5 @@ mit gleichem Status aktualisieren" zu wählen.'
Datenquelle erfolgen. Benötigt man innerhalb dieser Zeit trotzdem aktualisierte Daten, so muss man den Cache löschen um einen erneuten Download von der Datenquelle erfolgen. Benötigt man innerhalb dieser Zeit trotzdem aktualisierte Daten, so muss man den Cache löschen um einen erneuten Download von der
Datenquelle zu erzwingen.' Datenquelle zu erzwingen.'
), ),
); )));
?> ?>

View File

@@ -1,205 +1,210 @@
<?php <?php
/** /**
* *
* info_acp_football [Deutsch — Du] * info_acp_football [Deutsch — Du]
* *
* @package language * @package language
* @version $Id: info_acp_football.php 12 2011-03-13 08:03:31Z football $ * @version $Id: info_acp_football.php 12 2011-03-13 08:03:31Z 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
* *
*/ */
/** /**
* DO NOT CHANGE * DO NOT CHANGE
*/ */
if (!defined('IN_PHPBB')) if (!defined('IN_PHPBB'))
{ {
exit; exit;
} }
if (empty($lang) || !is_array($lang)) if (empty($lang) || !is_array($lang))
{ {
$lang = array(); $lang = array();
} }
// DEVELOPERS PLEASE NOTE // DEVELOPERS PLEASE NOTE
// //
// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // All language files should use UTF-8 as their encoding and the files must not contain a BOM.
// //
// Placeholders can now contain order information, e.g. instead of // Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct // translators to re-order the output of data while ensuring it remains correct
// //
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine // You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text // equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
// Football Settings // Football Settings
$lang = array_merge($lang, array( $lang = array_merge($lang, array(
'ACP_FOOTBALL' => 'Fussball', 'ACP_FOOTBALL' => 'Fussball',
'ACP_FOOTBALL_MANAGEMENT' => 'Tipprunde-Verwalten', 'ACP_FOOTBALL_MANAGEMENT' => 'Tipprunde-Verwalten',
'ACP_FOOTBALL_OPERATION' => 'Spielbetrieb', 'ACP_FOOTBALL_OPERATION' => 'Spielbetrieb',
'ACP_FOOTBALL_MANAGE' => 'Spielplan Verwaltung', 'ACP_FOOTBALL_MANAGE' => 'Spielplan Verwaltung',
'ACP_FOOTBALL_CONFIGURATION' => 'Tipprunden-Konfiguration', 'ACP_FOOTBALL_CONFIGURATION' => 'Tipprunden-Konfiguration',
'ACP_FOOTBALL_SETTINGS' => 'Tipprunden-Einstellungen', 'ACP_FOOTBALL_SETTINGS' => 'Tipprunden-Einstellungen',
'ACP_FOOTBALL_SETTINGS_EXPLAIN' => 'Hier kannst du einige grundlegende Einstellungen der Tipprunde vornehmen, ihr einen passenden Namen und eine Beschreibung geben und, neben anderen Werten, die Standard-Einstellungen für die Anzeige anpassen. ', 'ACP_FOOTBALL_SETTINGS_EXPLAIN' => 'Hier kannst du einige grundlegende Einstellungen der Tipprunde vornehmen, ihr einen passenden Namen und eine Beschreibung geben und, neben anderen Werten, die Standard-Einstellungen für die Anzeige anpassen. ',
'DISABLE_FOOTBALL' => 'Tipprunde deaktivieren', 'DISABLE_FOOTBALL' => 'Tipprunde deaktivieren',
'DISABLE_FOOTBALL_EXPLAIN' => 'Hiermit sperrst du die Tipprunde für alle Benutzer. Wenn du möchtest, kannst du eine kurze Nachricht (bis zu 255 Zeichen) angeben. ', 'DISABLE_FOOTBALL_EXPLAIN' => 'Hiermit sperrst du die Tipprunde für alle Benutzer. Wenn du möchtest, kannst du eine kurze Nachricht (bis zu 255 Zeichen) angeben. ',
'DISPLAY_RANKS' => 'Anzahl angezeigter Tipper in den Übersichts-Ranglisten', 'DISPLAY_LAST_USERS' => 'Anzahl anzuzeigender letzter Besucher des Forums',
'DISPLAY_RANKS_EXPLAIN' => 'Limitiert die Anzeige der Spieltags- und Gesamtrangliste in der Hauptansicht. Die eigene Platzierung wird ggf. unten angehängt. ', 'DISPLAY_LAST_USERS_EXPLAIN' => 'Limitiert die Anzeige der letzten Besucher im selbigen Tipprunden-Block. Mit 0 wird die Anzeige des Blocks unterdrückt. ',
'DISPLAY_LAST_RESULTS' => 'Anzahl maximal anzuzeigender letzter Spielergebnisse',
'FOOTBALL_CODE' => 'Tipprunden Code', 'DISPLAY_LAST_RESULTS_EXPLAIN' => 'Limitiert die Anzeige der letzten Spielergebnisse im selbigen Tipprunden-Block. Finden mehr Spiele am letzten Tag statt, werden alle Ergebnisse dieses Tages angezeigt. Mit 0 wird die Anzeige des Blocks unterdrückt. ',
'FOOTBALL_CODE_EXPLAIN' => 'Zugangscode zur Tipprunde z.B. für Cronjobs. ', 'DISPLAY_RANKS' => 'Anzahl angezeigter Tipper in den Übersichts-Ranglisten',
'FOOTBALL_FULLSCREEN' => 'Tipprunden-Seiten im Fullscreen-Modus', 'DISPLAY_RANKS_EXPLAIN' => 'Limitiert die Anzeige der Spieltags- und Gesamtrangliste in der Hauptansicht. Die eigene Platzierung wird ggf. unten angehängt. ',
'FOOTBALL_FULLSCREEN_EXPLAIN' => 'Hiermit kannst Du, abweichend vom Forum, die Tipprundenseiten mit minimalen Seitenrändern anzeigen lassen. ',
'FOOTBALL_HEADER_ENABLE' => 'Header-Bild je Liga verwenden', 'FOOTBALL_CODE' => 'Tipprunden Code',
'FOOTBALL_HEADER_ENABLE_EXPLAIN' => 'Hiermit kannst Du festlegen, ob je Liga die zugehöriges Bild im Header angezeigt werden soll. ', 'FOOTBALL_CODE_EXPLAIN' => 'Zugangscode zur Tipprunde z.B. für Cronjobs. ',
'FOOTBALL_INFO' => 'Tipprunden Information anzeigen', 'FOOTBALL_FULLSCREEN' => 'Tipprunden-Seiten im Fullscreen-Modus',
'FOOTBALL_INFO_EXPLAIN' => 'Hiermit kannst Du eine kurze Information (bis zu 255 Zeichen) oberhalb der Tippdaten anzeigen lassen. ', 'FOOTBALL_FULLSCREEN_EXPLAIN' => 'Hiermit kannst Du, abweichend vom Forum, die Tipprundenseiten mit minimalen Seitenrändern anzeigen lassen. ',
'FOOTBALL_NAME' => 'Name der Tipprunde', 'FOOTBALL_HEADER_ENABLE' => 'Header-Bild je Liga verwenden',
'FOOTBALL_NAME_EXPLAIN' => 'Name der im Tipprunden-Menu verwendet wird, um zur Hauptseite zu gelangen. ', 'FOOTBALL_HEADER_ENABLE_EXPLAIN' => 'Hiermit kannst Du festlegen, ob je Liga die zugehöriges Bild im Header angezeigt werden soll. ',
'FOOTBALL_OVERRIDE_STYLE' => 'Style überschreiben', 'FOOTBALL_INFO' => 'Tipprunden Information anzeigen',
'FOOTBALL_OVERRIDE_STYLE_EXPLAIN' => 'Verwendet für die Tipprunde immer den Standard-Tipprunden-Style. ', 'FOOTBALL_INFO_EXPLAIN' => 'Hiermit kannst Du eine kurze Information (bis zu 255 Zeichen) oberhalb der Tippdaten anzeigen lassen. ',
'FOOTBALL_STYLE' => 'Standard Tipprunden Style', 'FOOTBALL_NAME' => 'Name der Tipprunde',
'FOOTBALL_UPDATE_SOURCE' => 'Update Quelle', 'FOOTBALL_NAME_EXPLAIN' => 'Name der im Tipprunden-Menu verwendet wird, um zur Hauptseite zu gelangen. ',
'FOOTBALL_UPDATE_SOURCE_EXPLAIN' => 'Link zur Quelle des Updates. Falls leer, wird automatisch <var>http://football.bplaced.net/football/xml/football_xml_season.php</var> gewählt. ', 'FOOTBALL_OVERRIDE_STYLE' => 'Style überschreiben',
'FOOTBALL_UPDATE_CODE' => 'Update Code', 'FOOTBALL_OVERRIDE_STYLE_EXPLAIN' => 'Verwendet für die Tipprunde immer den Standard-Tipprunden-Style. ',
'FOOTBALL_UPDATE_CODE_EXPLAIN' => 'Nur mit diesem Code können Updates von dieser Seite heruntergeladen werden. ', 'FOOTBALL_STYLE' => 'Standard Tipprunden Style',
'FOOTBALL_UPDATE_SOURCE' => 'Update Quelle',
'GUEST_VIEW' => 'Tipprunde für Gäste sichtbar', 'FOOTBALL_UPDATE_SOURCE_EXPLAIN' => 'Link zur Quelle des Updates. Falls leer, wird automatisch <var>http://football.bplaced.net/football/xml/football_xml_season.php</var> gewählt. ',
'GUEST_VIEW_EXPLAIN' => 'Soll die Tipprunde für Gäste sichtbar sein?', 'FOOTBALL_UPDATE_CODE' => 'Update Code',
'FOOTBALL_UPDATE_CODE_EXPLAIN' => 'Nur mit diesem Code können Updates von dieser Seite heruntergeladen werden. ',
'USER_VIEW' => 'Tipprunde nur für Teilnehmer sichtbar',
'USER_VIEW_EXPLAIN' => 'Soll die Tipprunde nur für Tipprunden-Teilnehmer sichtbar sein?', 'GUEST_VIEW' => 'Tipprunde für Gäste sichtbar',
'GUEST_VIEW_EXPLAIN' => 'Soll die Tipprunde für Gäste sichtbar sein?',
'HOST_TIMEZONE' => 'Host Zeitzone',
'HOST_TIMEZONE_EXPLAIN' => 'Differenz zur Board Zeitzone wenn dein Host in einer anderen Zeitzone steht, damit die Tippabgabe korrekt funktioniert. ', 'USER_VIEW' => 'Tipprunde nur für Teilnehmer sichtbar',
'USER_VIEW_EXPLAIN' => 'Soll die Tipprunde nur für Tipprunden-Teilnehmer sichtbar sein?',
'LEFT_COLUMN' => 'Spaltenbreite Links in Pixeln',
'LEFT_COLUMN_EXPLAIN' => 'Optimale Breite 180 Pixel. Dieser Wert sollte nicht unterschritten werden. ', 'TIME_SHIFT' => 'Zeitverschiebung',
'TIME_SHIFT_EXPLAIN' => 'Differenz in Stunden zur Board Zeitzone wenn dein Host in einer anderen Zeitzone steht, damit die Tippabgabe korrekt funktioniert. ',
'PREDICTION_LEAGUE' => 'Tipprunde',
'LEFT_COLUMN' => 'Spaltenbreite Links in Pixeln',
'RIGHT_COLUMN' => 'Spaltenbreite Rechts in Pixeln', 'LEFT_COLUMN_EXPLAIN' => 'Optimale Breite 180 Pixel. Dieser Wert sollte nicht unterschritten werden. ',
'RIGHT_COLUMN_EXPLAIN' => 'Optimal 180 Pixel. Dieser Wert wird durch externe Einblendungen ggf. übersteuert. ',
'PREDICTION_LEAGUE' => 'Tipprunde',
'USERS_PAGE' => 'Tipper pro Seite',
'USERS_PAGE_EXPLAIN' => 'Anzahl der Tipper je Seite in der Hauptrangliste und Alle Tipps. ', 'RIGHT_COLUMN' => 'Spaltenbreite Rechts in Pixeln',
'RIGHT_COLUMN_EXPLAIN' => 'Optimal 180 Pixel. Dieser Wert wird durch externe Einblendungen ggf. übersteuert. ',
'WIN_NAME' => 'Gewinn Name (oder Währung)',
'WIN_NAME_EXPLAIN' => 'Der Name, der für die Gewinne in der Tipprunde angezeigt werden soll', 'USERS_PAGE' => 'Tipper pro Seite',
'USERS_PAGE_EXPLAIN' => 'Anzahl der Tipper je Seite in der Hauptrangliste und Alle Tipps. ',
'ANNOUNCEMENT_TOPIC' => 'Release Ankündigung',
'CURRENT_VERSION' => 'Derzeitige Version', 'WIN_NAME' => 'Gewinn Name (oder Währung)',
'DOWNLOAD_LATEST' => 'Neueste Version herunterladen', 'WIN_NAME_EXPLAIN' => 'Der Name, der für die Gewinne in der Tipprunde angezeigt werden soll',
'LATEST_VERSION' => 'Neueste Version',
'NOT_UP_TO_DATE' => '%s ist nicht aktuell', 'ANNOUNCEMENT_TOPIC' => 'Release Ankündigung',
'RELEASE_ANNOUNCEMENT' => 'Ankündigungsthema', 'CURRENT_VERSION' => 'Derzeitige Version',
'UP_TO_DATE' => '%s ist aktuell', 'DOWNLOAD_LATEST' => 'Neueste Version herunterladen',
'FOOTBALL_VERSION_CHECK' => 'Football Prediction League Extension Version Check', 'LATEST_VERSION' => 'Neueste Version',
'NOT_UP_TO_DATE' => '%s ist nicht aktuell',
)); 'RELEASE_ANNOUNCEMENT' => 'Ankündigungsthema',
'UP_TO_DATE' => '%s ist aktuell',
// Football Features 'FOOTBALL_VERSION_CHECK' => 'Football Prediction League Extension Version Check',
$lang = array_merge($lang, array(
'ACP_FOOTBALL_FEATURES' => 'Tipprunden-Funktionalitäten', ));
'ACP_FOOTBALL_FEATURES_EXPLAIN' => 'Hier kannst du einige Funktionen der Tipprunde aktivieren bzw. deaktivieren',
// Football Features
'AUTO' => 'Auto', $lang = array_merge($lang, array(
'ACP_FOOTBALL_FEATURES' => 'Tipprunden-Funktionalitäten',
'BANK' => 'Tipprunden Konto verwalten', 'ACP_FOOTBALL_FEATURES_EXPLAIN' => 'Hier kannst du einige Funktionen der Tipprunde aktivieren bzw. deaktivieren',
'BANK_EXPLAIN' => 'Sollen Tipprunden Konten mit Einsätzen und Gewinnen gepflegt werden?',
'AUTO' => 'Auto',
'FOOTBALL_SEASON_START' => 'Starte in Saison',
'FOOTBALL_SEASON_START_EXPLAIN' => 'Starte in dieser oder in der automatisch ermittelten Saison, wenn noch keine ausgewählt wurde. ', 'BANK' => 'Tipprunden Konto verwalten',
'BANK_EXPLAIN' => 'Sollen Tipprunden Konten mit Einsätzen und Gewinnen gepflegt werden?',
'FOOTBALL_REMEMBER_ENABLE' => 'Cronjob für die Tipp-Erinnerungsmail aktivieren',
'FOOTBALL_REMEMBER_ENABLE_EXPLAIN' => 'Hier kannst Du angeben, ob 1 Tag vor Tippabgabe eine Erinnerungsmail versendet werden soll.', 'FOOTBALL_SEASON_START' => 'Starte in Saison',
'FOOTBALL_SEASON_START_EXPLAIN' => 'Starte in dieser oder in der automatisch ermittelten Saison, wenn noch keine ausgewählt wurde. ',
'FOOTBALL_REMEMBER_NEXT_RUN' => 'Nächster Cronjoblauf für die Tipp-Erinnerungsmail',
'FOOTBALL_REMEMBER_NEXT_RUN_EXPLAIN'=> 'Hier kannst Du einstellen, wann der Cronjob für die Tipp-Erinnerungsmail frühestens wieder aufgerufen wird. Nach Ausführung wird der Cronjob für den Folgetag zur geichen Uhrzeit neu eingeplant.', 'FOOTBALL_REMEMBER_ENABLE' => 'Cronjob für die Tipp-Erinnerungsmail aktivieren',
'FOOTBALL_REMEMBER_ENABLE_EXPLAIN' => 'Hier kannst Du angeben, ob 1 Tag vor Tippabgabe eine Erinnerungsmail versendet werden soll.',
'FOUNDER_DELETE' => 'Nur Gründungsmitglieder dürfen löschen',
'FOUNDER_DELETE_EXPLAIN' => 'Löschung von Spielplandaten wie Saisons, Ligen, Teams, Spieltage und Spielpläne nur auf Gründungsmitglieder beschränken. ', 'FOOTBALL_REMEMBER_NEXT_RUN' => 'Nächster Cronjoblauf für die Tipp-Erinnerungsmail',
'FOOTBALL_REMEMBER_NEXT_RUN_EXPLAIN'=> 'Hier kannst Du einstellen, wann der Cronjob für die Tipp-Erinnerungsmail frühestens wieder aufgerufen wird. Nach Ausführung wird der Cronjob für den Folgetag zur gleichen Uhrzeit neu eingeplant.',
'RESULTS_AT_TIME' => 'Eingabe endgültiger Spielergebnisse erst nach Spielende',
'RESULTS_AT_TIME_EXPLAIN' => 'Eingabe der endgültigen Spielergebnisse im Adminbereich erst nach Spielende freigeben. Die Eingabe von vorläufigen Spielergebnissen durch die Tipper ist hiervon unabhängig. ', 'FOUNDER_DELETE' => 'Nur Gründungsmitglieder dürfen löschen',
'FOUNDER_DELETE_EXPLAIN' => 'Löschung von Spielplandaten wie Saisons, Ligen, Teams, Spieltage und Spielpläne nur auf Gründungsmitglieder beschränken. ',
'SAME_ALLOWED' => 'Alle Tipps an einem Spieltag gleich',
'SAME_ALLOWED_EXPLAIN' => 'Identische Tipps (Oma-Tipps) bei allen Spielen eines Spieltags erlauben bzw. verbieten. ', 'RESULTS_AT_TIME' => 'Eingabe endgültiger Spielergebnisse erst nach Spielende',
'RESULTS_AT_TIME_EXPLAIN' => 'Eingabe der endgültigen Spielergebnisse im Adminbereich erst nach Spielende freigeben. Die Eingabe von vorläufigen Spielergebnissen durch die Tipper ist hiervon unabhängig. ',
'ULT_POINTS' => 'Ultimate Points einbinden',
'ULT_POINTS_EXPLAIN' => 'Soll es möglich sein, die Punkte oder Gewinne in Ultimate Points verrechnen zu lassen? Dazu muss Ultimate Points installiert sein. ', 'SAME_ALLOWED' => 'Alle Tipps an einem Spieltag gleich',
'ULT_POINTS_FACTOR' => 'Ultimate Points Faktor', 'SAME_ALLOWED_EXPLAIN' => 'Identische Tipps (Oma-Tipps) bei allen Spielen eines Spieltags erlauben bzw. verbieten. ',
'ULT_POINTS_FACTOR_EXPLAIN' => 'Faktor mit dem die Punkte je Spieltag in Ultimate Points gutgeschrieben werden. ',
'UP_NONE' => 'Keine', 'ULT_POINTS' => 'Ultimate Points einbinden',
'UP_POINTS' => 'Punkte', 'ULT_POINTS_EXPLAIN' => 'Soll es möglich sein, die Punkte oder Gewinne in Ultimate Points verrechnen zu lassen? Dazu muss Ultimate Points installiert sein. ',
'UP_WINS' => 'Gewinne', 'ULT_POINTS_FACTOR' => 'Ultimate Points Faktor',
'ULT_POINTS_FACTOR_EXPLAIN' => 'Faktor mit dem die Punkte je Spieltag in Ultimate Points gutgeschrieben werden. ',
'VIEW_BETS' => 'Tipps immer Anzeigen', 'UP_NONE' => 'Keine',
'VIEW_BETS_EXPLAIN' => 'Sollen alle Tipps sofort angezeigt werden? Wenn Nein, dann werden sie erst nach Tippabgabeschluss angezeigt. ', 'UP_POINTS' => 'Punkte',
'VIEW_CURRENT' => 'Anzeige startet in aktueller Liga', 'UP_WINS' => 'Gewinne',
'VIEW_CURRENT_EXPLAIN' => 'Soll beim ersten Aufruf die Liga angezeigt werden, in der die nächsten Spiele stattfinden? Sonst wird immer die erste Liga angezeigt',
'VIEW_TENDENCIES' => 'Tipp-Tendenzen immer Anzeigen', 'VIEW_BETS' => 'Tipps immer Anzeigen',
'VIEW_TENDENCIES_EXPLAIN' => 'Sollen alle Tipp-Tendenzen sofort angezeigt werden? Wenn Nein, dann werden sie erst nach Tippabgabeschluss angezeigt. ', 'VIEW_BETS_EXPLAIN' => 'Sollen alle Tipps sofort angezeigt werden? Wenn Nein, dann werden sie erst nach Tippabgabeschluss angezeigt. ',
'VIEW_CURRENT' => 'Anzeige startet in aktueller Liga',
'WIN_HITS02' => 'Gewinne Volltreffer-Wertung mit Auswärtspunkten', 'VIEW_CURRENT_EXPLAIN' => 'Soll beim ersten Aufruf die Liga angezeigt werden, in der die nächsten Spiele stattfinden? Sonst wird immer die erste Liga angezeigt',
'WIN_HITS02_EXPLAIN' => 'Sollen Gewinne der Volltreffer-Wertung mit Auswärtspunkten angezeigt werden? Wenn Nein, muss sichergestellt werden, dass dazu keine Gewinne in den bestehenden Ligen hinterlegt wurden. ', 'VIEW_TENDENCIES' => 'Tipp-Tendenzen immer Anzeigen',
)); 'VIEW_TENDENCIES_EXPLAIN' => 'Sollen alle Tipp-Tendenzen sofort angezeigt werden? Wenn Nein, dann werden sie erst nach Tippabgabeschluss angezeigt. ',
// Football Menu 'WIN_HITS02' => 'Gewinne Volltreffer-Wertung mit Auswärtspunkten',
$lang = array_merge($lang, array( 'WIN_HITS02_EXPLAIN' => 'Sollen Gewinne der Volltreffer-Wertung mit Auswärtspunkten angezeigt werden? Wenn Nein, muss sichergestellt werden, dass dazu keine Gewinne in den bestehenden Ligen hinterlegt wurden. ',
'ACP_FOOTBALL_MENU' => 'Tipprunden-Menu', ));
'ACP_FOOTBALL_MENU_EXPLAIN' => 'Hier kannst du Links für das Tipprunden-Menu hinterlegen. Die Linkbeschriftung kannst du frei wählen. ',
// Football Menu
'FOOTBALL_BREADCRUMB' => 'Tipprunden breadcrumb anzeigen', $lang = array_merge($lang, array(
'FOOTBALL_BREADCRUMB_EXPLAIN' => 'Soll ein Breadcrumb-Link für die Tipprunden angezeigt werden? ', 'ACP_FOOTBALL_MENU' => 'Tipprunden-Menu',
'FOOTBALL_SIDE' => 'Tipprunden Sidebar anzeigen', 'ACP_FOOTBALL_MENU_EXPLAIN' => 'Hier kannst du Links für das Tipprunden-Menu hinterlegen. Die Linkbeschriftung kannst du frei wählen. ',
'FOOTBALL_SIDE_EXPLAIN' => 'Soll die Tipprunden Sidebar mit den Menüeinträgen angezeigt werden? ',
'FOOTBALL_MENU' => 'Tipprunden Menu anzeigen', 'FOOTBALL_BREADCRUMB' => 'Tipprunden breadcrumb anzeigen',
'FOOTBALL_MENU_EXPLAIN' => 'Soll das Tipprunden Dropdown Menü in der Navigationsleiste angezeigt werden? ', 'FOOTBALL_BREADCRUMB_EXPLAIN' => 'Soll ein Breadcrumb-Link für die Tipprunden angezeigt werden? ',
'MENU_DESC1' => 'Beschriftung http-Link 1', 'FOOTBALL_SIDE' => 'Tipprunden Sidebar anzeigen',
'MENU_DESC1_EXPLAIN' => 'Die Beschriftung des Links darf keine unzulässigen Sonderzeichen enthalten und höchsten 20 Zeichen lang sein. ', 'FOOTBALL_SIDE_EXPLAIN' => 'Soll die Tipprunden Sidebar mit den Menüeinträgen angezeigt werden? ',
'MENU_DESC2' => 'Beschriftung http-Link 2', 'FOOTBALL_MENU' => 'Tipprunden Menu anzeigen',
'MENU_DESC3' => 'Beschriftung http-Link 3', 'FOOTBALL_MENU_EXPLAIN' => 'Soll das Tipprunden Dropdown Menü in der Navigationsleiste angezeigt werden? ',
'MENU_LINK1' => 'Http-Link 1', 'MENU_DESC1' => 'Beschriftung http-Link 1',
'MENU_LINK1_EXPLAIN' => 'Bitte hier nur http Links eingeben. ', 'MENU_DESC1_EXPLAIN' => 'Die Beschriftung des Links darf keine unzulässigen Sonderzeichen enthalten und höchsten 20 Zeichen lang sein. ',
'MENU_LINK2' => 'Http-Link 2', 'MENU_DESC2' => 'Beschriftung http-Link 2',
'MENU_LINK3' => 'Http-Link 3', 'MENU_DESC3' => 'Beschriftung http-Link 3',
'MENU_NO_LINK' => 'Kein Link hinterlegt', 'MENU_LINK1' => 'Http-Link 1',
)); 'MENU_LINK1_EXPLAIN' => 'Bitte hier nur http Links eingeben. ',
'MENU_LINK2' => 'Http-Link 2',
'MENU_LINK3' => 'Http-Link 3',
// Football Help 'MENU_NO_LINK' => 'Kein Link hinterlegt',
$lang = array_merge($lang, array( ));
'ACP_FOOTBALL_USERGUIDE' => 'Benutzerhilfe',
'ACP_FOOTBALL_USERGUIDE_EXPLAIN' => 'Hier findest du Hilfe für die Einstellungen des phpBB3 Football MODs.<br />Wenn du Fragen hast, dann schaue bitte immer zuerst hier!',
)); // Football Help
$lang = array_merge($lang, array(
'ACP_FOOTBALL_USERGUIDE' => 'Benutzerhilfe',
#// Football Logs 'ACP_FOOTBALL_USERGUIDE_EXPLAIN' => 'Hier findest du Hilfe für die Einstellungen des phpBB3 Football MODs.<br />Wenn du Fragen hast, dann schaue bitte immer zuerst hier!',
$lang = array_merge($lang, array( ));
'LOG_FOOTBALL_FEATURES' => '<strong>Tipprunden-Funktionalitäten geändert</strong>',
'LOG_FOOTBALL_MENU' => '<strong>Tipprunden-Menu geändert</strong>',
'LOG_FOOTBALL_SETTINGS' => '<strong>Tipprunde-Einstellungen geändert</strong>', #// Football Logs
$lang = array_merge($lang, array(
'LOG_FOOTBALL_MSG_TEST' => 'Aufruf am %s.', 'LOG_FOOTBALL_FEATURES' => '<strong>Tipprunden-Funktionalitäten geändert</strong>',
'LOG_FOOTBALL_MSG_TEST_TRAVEL' => 'Aufruf mit Zeitreise zum %s.', 'LOG_FOOTBALL_MENU' => '<strong>Tipprunden-Menu geändert</strong>',
'LOG_FOOTBALL_SETTINGS' => '<strong>Tipprunde-Einstellungen geändert</strong>',
'LOG_FOOTBALL_REMEMBER_CRON' => '<strong>Cronjob Football remember ausgeführt</strong><br />» %s', 'LOG_PL_BACKUP' => '<strong>Tipprunden Backup</strong>',
'LOG_FOOTBALL_REMEMBER_CRON_TEST' => '<strong>Cronjob Football remember Testaufruf</strong><br />» %s',
'LOG_FOOTBALL_MSG_TEST' => 'Aufruf am %s.',
'FOOTBALL_REMEMBER_SUBJECT' => 'Bitte %1$s %2$d. Spieltag tippen', 'LOG_FOOTBALL_MSG_TEST_TRAVEL' => 'Aufruf mit Zeitreise zum %s.',
'FOOTBALL_REMEMBER_SUBJECT_BOARD' => 'Versendete Erinnerungs-Mails %1$s %2$d',
'FOOTBALL_REMEMBER_ERROR_EMAIL' => '%1$s Erinnerungs-Mail an: %2$s gescheitert', 'LOG_FOOTBALL_REMEMBER_CRON' => '<strong>Cronjob Football remember ausgeführt</strong><br />» %s',
'FOOTBALL_REMEMBER_ERROR_EMAIL_BOARD'=> '%1$s Versandliste Erinnerungs-Mail an: %2$s gescheitert', 'LOG_FOOTBALL_REMEMBER_CRON_TEST' => '<strong>Cronjob Football remember Testaufruf</strong><br />» %s',
'FOOTBALL_REMEMBER_NOBODY' => 'Es muss niemand erinnert werden.',
'FOOTBALL_REMEMBER_NO_DELIVERY' => 'Keine anstehende Tippabgabe im Zeitraum.', 'FOOTBALL_REMEMBER_SUBJECT' => 'Bitte %1$s %2$d. Spieltag tippen',
'FOOTBALL_REMEMBER_SEND' => '%1$s Erinnerungs-Mail an: %2$s', 'FOOTBALL_REMEMBER_SUBJECT_BOARD' => 'Versendete Erinnerungs-Mails %1$s %2$d',
'FOOTBALL_REMEMBER_ERROR_EMAIL' => '%1$s Erinnerungs-Mail an: %2$s gescheitert',
)); 'FOOTBALL_REMEMBER_ERROR_EMAIL_BOARD'=> '%1$s Versandliste Erinnerungs-Mail an: %2$s gescheitert',
'FOOTBALL_REMEMBER_NOBODY' => 'Es muss niemand erinnert werden.',
'FOOTBALL_REMEMBER_NO_DELIVERY' => 'Keine anstehende Tippabgabe im Zeitraum.',
'FOOTBALL_REMEMBER_SEND' => '%1$s Erinnerungs-Mail an: %2$s',
));
?> ?>

View File

@@ -60,6 +60,7 @@ $lang = array_merge($lang, array(
'BET_KOEFF' => 'Bet coefficient', 'BET_KOEFF' => 'Bet coefficient',
'BET_OF' => 'Bet', 'BET_OF' => 'Bet',
'BET_POINTS' => 'Bet', 'BET_POINTS' => 'Bet',
'BET_TIME' => 'Bet time',
'BET_UNTIL_DELIVERY' => 'The matches of a matchday can be entered only up to the deadline of the matchday. Then the bets of others Users become visible for everybody. ', 'BET_UNTIL_DELIVERY' => 'The matches of a matchday can be entered only up to the deadline of the matchday. Then the bets of others Users become visible for everybody. ',
'BETS' => 'Bets', 'BETS' => 'Bets',
'BETS_AND_RANKS' => 'Bets and ranking of', 'BETS_AND_RANKS' => 'Bets and ranking of',
@@ -184,6 +185,7 @@ $lang = array_merge($lang, array(
'LAST_GAMES' => 'The last matches', 'LAST_GAMES' => 'The last matches',
'LAST_GAMES_AWAY' => 'The last away matches', 'LAST_GAMES_AWAY' => 'The last away matches',
'LAST_GAMES_HOME' => 'The last home matches', 'LAST_GAMES_HOME' => 'The last home matches',
'LAST_RESULTS' => 'Last results',
'LAST_VISITORS' => 'Last %s visitors', 'LAST_VISITORS' => 'Last %s visitors',
'LEAGUE' => 'League', 'LEAGUE' => 'League',
'LINK_PREDICTION_LEAGUE' => 'To the WebtTip', 'LINK_PREDICTION_LEAGUE' => 'To the WebtTip',
@@ -277,6 +279,7 @@ $lang = array_merge($lang, array(
'POINTS' => 'Points', 'POINTS' => 'Points',
'POINTS_DIFF' => 'Point difference', 'POINTS_DIFF' => 'Point difference',
'POINTS_DIFFERENCE' => 'Points for the correct Goal difference: %s', 'POINTS_DIFFERENCE' => 'Points for the correct Goal difference: %s',
'POINTS_DIFFERENCE_DRAW' => 'Points for the correct Goal difference (except in case of draw): %s',
'POINTS_DOT' => 'Pt. ', 'POINTS_DOT' => 'Pt. ',
'POINTS_HIT' => 'For the prediction of the correct result (direct hit) there is %s points. ', 'POINTS_HIT' => 'For the prediction of the correct result (direct hit) there is %s points. ',
'POINTS_LAST' => 'Points of the last one for non-betting members', 'POINTS_LAST' => 'Points of the last one for non-betting members',

View File

@@ -40,7 +40,7 @@ if ( empty($lang) || !is_array($lang) )
// » „ “ — … // » „ “ — …
// //
$help = array( $lang = array_merge($lang, array('FOOTBALL_HELP_FAQ' => array(
array( array(
0 => '--', 0 => '--',
1 => 'First steps' 1 => 'First steps'
@@ -96,7 +96,7 @@ footb_rem_s = switch for sending the reminder email to the second E-mail address
0 => 'How do I activate the reminder e-mail function? ', 0 => 'How do I activate the reminder e-mail function? ',
1 => 'In the admin area in the Prediction League functionality the mail reminder cron job and the next run must be activated. <br /> 1 => 'In the admin area in the Prediction League functionality the mail reminder cron job and the next run must be activated. <br />
The cron job is run on the first access after this date and sends an e-mail reminder for the missing tip duties that lie in the period 24-48 hours after cron date . The cron job is run on the first access after this date and sends an e-mail reminder for the missing tip duties that lie in the period 24-48 hours after cron date .
If not sufficient accesses the page, the cron job should automatically run on script "cron.php?cron_type=football_remember". <br /> If not sufficient accesses the page, the cron job should automatically run on script "YOUR_URL/cron.php?cron_type=football.football.cron.task.football_remember". <br />
The ship of the email takes place only once . After calling up the cron job, the next scheduled is automatically planned for the following day . The ship of the email takes place only once . After calling up the cron job, the next scheduled is automatically planned for the following day .
With the appended parameters " & mode = test & days = n " can be tested the shipment for the offset to n days predictions . Only mails to board email address will be shipped . With the appended parameters " & mode = test & days = n " can be tested the shipment for the offset to n days predictions . Only mails to board email address will be shipped .
In ACP a user defined prediction leagues code is to define.<br /> In ACP a user defined prediction leagues code is to define.<br />
@@ -499,5 +499,5 @@ Preliminary results from the update are not used. If these should be taken, this
1 => 'The seasons- and the leagues-data are stored for 5 minutes in the cache, so that the data are downloaded from Source only once. If you need 1 => 'The seasons- and the leagues-data are stored for 5 minutes in the cache, so that the data are downloaded from Source only once. If you need
updated data within that time anyway, you have to delete the cache to force a new download from the Source.' updated data within that time anyway, you have to delete the cache to force a new download from the Source.'
), ),
); )));
?> ?>

View File

@@ -46,6 +46,10 @@ $lang = array_merge($lang, array(
'ACP_FOOTBALL_SETTINGS_EXPLAIN' => 'Here you can carry out some basic settings of the Prediction League, give it a suitable name and description and define a football side announcement and other values. ', 'ACP_FOOTBALL_SETTINGS_EXPLAIN' => 'Here you can carry out some basic settings of the Prediction League, give it a suitable name and description and define a football side announcement and other values. ',
'DISABLE_FOOTBALL' => 'Deactivate Prediction League', 'DISABLE_FOOTBALL' => 'Deactivate Prediction League',
'DISABLE_FOOTBALL_EXPLAIN' => 'You can disable the Prediction League for all users. If you wanted, you can display a short message (up to 255 signs). ', 'DISABLE_FOOTBALL_EXPLAIN' => 'You can disable the Prediction League for all users. If you wanted, you can display a short message (up to 255 signs). ',
'DISPLAY_LAST_USERS' => 'Number of board visitors to display',
'DISPLAY_LAST_USERS_EXPLAIN' => 'Limits the last visitors to display in block. 0 is used to suppress the display of the block. ',
'DISPLAY_LAST_RESULTS' => 'Number of match results to display',
'DISPLAY_LAST_RESULTS_EXPLAIN' => 'Limits the last match results to display in block. If more matches are played on the last day, all results of that day are displayed. 0 is used to suppress the display of the block. ',
'DISPLAY_RANKS' => 'Number of indicated User in total ranking', 'DISPLAY_RANKS' => 'Number of indicated User in total ranking',
'DISPLAY_RANKS_EXPLAIN' => 'Announcement of users in the ranking lists. The ownrank is suspended if necessary below. ', 'DISPLAY_RANKS_EXPLAIN' => 'Announcement of users in the ranking lists. The ownrank is suspended if necessary below. ',
'FOOTBALL_CODE' => 'Prediction League Code', 'FOOTBALL_CODE' => 'Prediction League Code',
@@ -71,8 +75,8 @@ $lang = array_merge($lang, array(
'GUEST_VIEW_EXPLAIN' => 'Should guests be able to see the Prediction League?', 'GUEST_VIEW_EXPLAIN' => 'Should guests be able to see the Prediction League?',
'USER_VIEW' => 'Prediction League only for participants visible', 'USER_VIEW' => 'Prediction League only for participants visible',
'USER_VIEW_EXPLAIN' => 'Should the Prediction League only to participants be visible?', 'USER_VIEW_EXPLAIN' => 'Should the Prediction League only to participants be visible?',
'HOST_TIMEZONE' => 'Host Timezone', 'TIME_SHIFT' => 'Time shift',
'HOST_TIMEZONE_EXPLAIN' => 'Difference to the Board time zone if your Host in another time zone stands, so that the tip delivery correctly functions. ', 'TIME_SHIFT_EXPLAIN' => 'Difference in hours to board time zone if host is in another time zone, so that the tip delivery works correctly. ',
'LEFT_COLUMN' => 'Left column width in pixels', 'LEFT_COLUMN' => 'Left column width in pixels',
'LEFT_COLUMN_EXPLAIN' => 'Optimum width 180 pixels. This value should not be fell short. ', 'LEFT_COLUMN_EXPLAIN' => 'Optimum width 180 pixels. This value should not be fell short. ',
'PREDICTION_LEAGUE' => 'Prediction League', 'PREDICTION_LEAGUE' => 'Prediction League',
@@ -146,6 +150,7 @@ $lang = array_merge($lang, array(
'LOG_FOOTBALL_MSG_TEST_TRAVEL' => 'Call with time travel to %s.', 'LOG_FOOTBALL_MSG_TEST_TRAVEL' => 'Call with time travel to %s.',
'LOG_FOOTBALL_REMEMBER_CRON' => 'Cronjob Football remember running %s', 'LOG_FOOTBALL_REMEMBER_CRON' => 'Cronjob Football remember running %s',
'LOG_FOOTBALL_REMEMBER_CRON_TEST' => 'Cronjob Football remember test call %s', 'LOG_FOOTBALL_REMEMBER_CRON_TEST' => 'Cronjob Football remember test call %s',
'LOG_PL_BACKUP' => '<strong>Prediction League backup</strong>',
'FOOTBALL_REMEMBER_SUBJECT' => 'Please bet %1$s %2$d. matchday', 'FOOTBALL_REMEMBER_SUBJECT' => 'Please bet %1$s %2$d. matchday',
'FOOTBALL_REMEMBER_SUBJECT_BOARD' => 'Sent reminder mails %1$s %2$d', 'FOOTBALL_REMEMBER_SUBJECT_BOARD' => 'Sent reminder mails %1$s %2$d',
'FOOTBALL_REMEMBER_ERROR_EMAIL' => '%1$s reminder email to: %2$d failed', 'FOOTBALL_REMEMBER_ERROR_EMAIL' => '%1$s reminder email to: %2$d failed',

View File

@@ -274,7 +274,6 @@ class v094_beta extends \phpbb\db\migration\migration
array('config.remove', array('football_menu_forumid4')), array('config.remove', array('football_menu_forumid4')),
array('config.remove', array('football_menu_forumid5')), array('config.remove', array('football_menu_forumid5')),
array('config.remove', array('football_menu_forumid6')), array('config.remove', array('football_menu_forumid6')),
array('config.remove', array('football_side')),
array('config.add', array('football_bank', '0', '0')), array('config.add', array('football_bank', '0', '0')),
array('config.add', array('football_code', '0000', '0')), array('config.add', array('football_code', '0000', '0')),
array('config.add', array('football_disable', '0', '0')), array('config.add', array('football_disable', '0', '0')),

View File

@@ -58,23 +58,13 @@ class v094_beta_update extends \phpbb\db\migration\migration
{ {
return array( return array(
'drop_columns' => array( 'drop_columns' => array(
$this->table_prefix . 'groups' => array(
'group_teampage',
),
$this->table_prefix . 'sessions' => array( $this->table_prefix . 'sessions' => array(
'football_season',
'football_league',
'football_matchday',
'football_mobile', 'football_mobile',
'football_mobile_device', 'football_mobile_device',
), ),
$this->table_prefix . 'footb_bets' => array(
'bet_time',
),
$this->table_prefix . 'footb_matches' => array(
'trend',
'odd_1',
'odd_x',
'odd_2',
'rating',
),
) )
); );
} }

30
migrations/v096_beta.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
/**
*
* @package Football Football v0.96
* @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace football\football\migrations;
class v096_beta extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
return isset($this->config['football_version']) && version_compare($this->config['football_version'], '0.9.6', '>=');
}
static public function depends_on()
{
return array('\football\football\migrations\v095_beta');
}
public function update_data()
{
return array(
array('config.update', array('football_version', '0.9.6', '0')),
);
}
}

30
migrations/v097_beta.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
/**
*
* @package Football Football v0.97
* @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace football\football\migrations;
class v097_beta extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
return isset($this->config['football_version']) && version_compare($this->config['football_version'], '0.9.7', '>=');
}
static public function depends_on()
{
return array('\football\football\migrations\v096_beta');
}
public function update_data()
{
return array(
array('config.update', array('football_version', '0.9.7', '0')),
);
}
}

30
migrations/v098_beta.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
/**
*
* @package Football Football v0.98
* @copyright (c) 2017 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace football\football\migrations;
class v098_beta extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
return isset($this->config['football_version']) && version_compare($this->config['football_version'], '0.9.8', '>=');
}
static public function depends_on()
{
return array('\football\football\migrations\v097_beta');
}
public function update_data()
{
return array(
array('config.update', array('football_version', '0.9.8', '0')),
);
}
}

34
migrations/v099_beta.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
/**
*
* @package Football Football v0.9.9
* @copyright (c) 2017 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace football\football\migrations;
class v099_beta extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
return isset($this->config['football_version']) && version_compare($this->config['football_version'], '0.9.9', '>=');
}
static public function depends_on()
{
return array('\football\football\migrations\v098_beta');
}
public function update_data()
{
return array(
array('config.remove', array('football_host_timezone')),
array('config.add', array('football_time_shift', '1', '0')),
array('config.add', array('football_display_last_users', '5', '0')),
array('config.add', array('football_display_last_results', '0', '0')),
array('config.update', array('football_version', '0.9.9', '0')),
);
}
}

View File

@@ -1,220 +1,220 @@
<!-- IF S_DATA_BET --> <!-- IF S_DATA_BET -->
<!-- IF S_EDIT_MODE --> <!-- IF S_EDIT_MODE -->
<form method="post" action="{S_FORM_ACTION_BET}" name="betform"> <form method="post" action="{S_FORM_ACTION_BET}" name="betform">
<!-- ELSE --> <!-- ELSE -->
<span class="color_finally">{L_FINALLY}</span> - <span class="color_provisionally">{L_PROVISIONALLY}</span> - <span class="color_not_rated">{L_NOT_RATED}</span><br /> <span class="color_finally">{L_FINALLY}</span> - <span class="color_provisionally">{L_PROVISIONALLY}</span> - <span class="color_not_rated">{L_NOT_RATED}</span><br />
<!-- ENDIF --> <!-- ENDIF -->
<div class="forabg"> <div class="forabg">
<table class="football"> <table class="football">
<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 style="text-align: center;" colspan="5">{L_VS}</th> <th style="text-align: center;" colspan="5">{L_VS}</th>
<th style="text-align: center;" colspan="4">{L_BET_OF} ({BET_EXPLAIN})</th> <th style="text-align: center;" colspan="4">{L_BET_OF} ({BET_EXPLAIN})</th>
<!-- IF S_DISPLAY_RATING --> <!-- IF S_DISPLAY_RATING -->
<th style="text-align: center;">{L_RATING}</th> <th style="text-align: center;">{L_RATING}</th>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DATA_BET_RESULTS --> <!-- IF S_DATA_BET_RESULTS -->
<th style="text-align: center;" colspan="3">{L_RESULT}</th> <th style="text-align: center;" colspan="3">{L_RESULT}</th>
<th>{L_POINTS}</th> <th>{L_POINTS}</th>
<!-- ENDIF --> <!-- ENDIF -->
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN bet_view --> <!-- BEGIN bet_view -->
<tr class="{bet_view.ROW_CLASS}"> <tr class="{bet_view.ROW_CLASS}">
<td>{bet_view.MATCH_TIME}</td> <td>{bet_view.MATCH_TIME}</td>
<td class="td_match_no">{bet_view.MATCH_NUMBER}</td> <td class="td_match_no">{bet_view.MATCH_NUMBER}</td>
<!-- IF S_DATA_GROUP --> <!-- IF S_DATA_GROUP -->
<td class="td_group">{bet_view.GROUP}</td> <td class="td_group">{bet_view.GROUP}</td>
<!-- ENDIF --> <!-- ENDIF -->
<td class="td_logo">{bet_view.LOGO_HOME}</td> <td class="td_logo">{bet_view.LOGO_HOME}</td>
<td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAN}" onclick="popup('{bet_view.U_PLAN_HOME}', 625,625);return false;"> <td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAN}" onclick="popup('{bet_view.U_PLAN_HOME}', 625,625);return false;">
{bet_view.HOME_NAME}</td> {bet_view.HOME_NAME}</td>
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td class="td_logo">{bet_view.LOGO_GUEST}</td> <td class="td_logo">{bet_view.LOGO_GUEST}</td>
<td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAN}" onclick="popup('{bet_view.U_PLAN_GUEST}', 625,625);return false;"> <td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAN}" onclick="popup('{bet_view.U_PLAN_GUEST}', 625,625);return false;">
{bet_view.GUEST_NAME}</td> {bet_view.GUEST_NAME}</td>
<td class="td_goals_home">{bet_view.BET_HOME}</td> <td class="td_goals_home">{bet_view.BET_HOME}</td>
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td class="td_goals_guest" title="{bet_view.TREND} {bet_view.ODDS}">{bet_view.BET_GUEST}</td> <td class="td_goals_guest" title="{bet_view.TREND} {bet_view.ODDS}">{bet_view.BET_GUEST}</td>
<td class="td_vs"></td> <td class="td_vs"></td>
<!-- IF S_DISPLAY_RATING --> <!-- IF S_DISPLAY_RATING -->
<td class="td_points">{bet_view.RATING}</td> <td class="td_points">{bet_view.RATING}</td>
<!-- ENDIF --> <!-- ENDIF -->
<td class="td_goals_home {bet_view.COLOR_STYLE}">{bet_view.GOALS_HOME}</td> <td class="td_goals_home {bet_view.COLOR_STYLE}">{bet_view.GOALS_HOME}</td>
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td class="td_goals_guest {bet_view.COLOR_STYLE}">{bet_view.GOALS_GUEST}</td> <td class="td_goals_guest {bet_view.COLOR_STYLE}">{bet_view.GOALS_GUEST}</td>
<td class="td_points {bet_view.COLOR_STYLE}">{bet_view.POINTS}</td> <td class="td_points {bet_view.COLOR_STYLE}">{bet_view.POINTS}</td>
<td class="td_button"> <td class="td_button">
<!-- IF S_VIEW <> 'print' and bet_view.DISPLAY_LINK --> <!-- IF S_VIEW <> 'print' and bet_view.DISPLAY_LINK -->
<a class="match_info" title="{L_MATCH_STATS}" href="{bet_view.U_MATCH_STATS}" onclick="javascript:popup(this.href, 818, 750, '_matchstats'); return false;"></a> <a title="{L_MATCH_STATS}" href="{bet_view.U_MATCH_STATS}" onclick="javascript:popup(this.href, 818, 750, '_matchstats'); return false;"><i class="icon fa-bar-chart fa-fw"></i></a>
<!-- ELSE --> <!-- ELSE -->
<img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" /> <img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" />
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
</tr> </tr>
<!-- END bet_view --> <!-- END bet_view -->
<!-- BEGIN bet_edit --> <!-- BEGIN bet_edit -->
<tr class="{bet_edit.ROW_CLASS}"> <tr class="{bet_edit.ROW_CLASS}">
<td class="td_datetime">{bet_edit.MATCH_TIME}</td> <td class="td_datetime">{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 class="td_logo">{bet_edit.LOGO_HOME}&nbsp;</td> <td class="td_logo">{bet_edit.LOGO_HOME}&nbsp;</td>
<td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAN}" onclick="popup('{bet_edit.U_PLAN_HOME}', 625,625);return false;"> <td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAN}" onclick="popup('{bet_edit.U_PLAN_HOME}', 625,625);return false;">
{bet_edit.HOME_NAME} {bet_edit.HOME_NAME}
</td> </td>
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td class="td_logo">{bet_edit.LOGO_GUEST}&nbsp;</td> <td class="td_logo">{bet_edit.LOGO_GUEST}&nbsp;</td>
<td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAN}" onclick="popup('{bet_edit.U_PLAN_GUEST}', 625,625);return false;"> <td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAN}" onclick="popup('{bet_edit.U_PLAN_GUEST}', 625,625);return false;">
{bet_edit.GUEST_NAME} {bet_edit.GUEST_NAME}
</td> </td>
<td class="td_goals_home"> <td class="td_goals_home">
<!-- IF S_VIEW <> 'print' --> <!-- IF S_VIEW <> 'print' -->
<input type="number" style="width:30px" name="goalsh{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_HOME}"> <input type="number" style="width:30px" name="goalsh{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_HOME}">
<!-- ELSE --> <!-- ELSE -->
_{bet_edit.BET_HOME}_ _{bet_edit.BET_HOME}_
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td class="td_goals_guest" title="{bet_edit.TREND} {bet_edit.ODDS}"> <td class="td_goals_guest" title="{bet_edit.TREND} {bet_edit.ODDS}">
<!-- IF S_VIEW <> 'print' --> <!-- IF S_VIEW <> 'print' -->
<input type="number" style="width:30px" name="goalsg{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_GUEST}"> <input type="number" style="width:30px" name="goalsg{bet_edit.MATCH_NUMBER}" min="0" max="20" size="2" value="{bet_edit.BET_GUEST}">
<!-- ELSE --> <!-- ELSE -->
_{bet_edit.BET_GUEST}_ _{bet_edit.BET_GUEST}_
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<td class="td_vs">{bet_edit.DELIVERTAG}</td> <td class="td_vs">{bet_edit.DELIVERTAG}</td>
<!-- IF S_DISPLAY_RATING --> <!-- IF S_DISPLAY_RATING -->
<td class="td_points"> <td class="td_points">
<input style="display:inline; margin:0; padding:0;" type="number" style="width:30px" name="rating{bet_edit.MATCH_NUMBER}" min="0" max="10" size="2" value="{bet_edit.RATING}"> <input style="display:inline; margin:0; padding:0;" type="number" style="width:30px" name="rating{bet_edit.MATCH_NUMBER}" min="0" max="10" size="2" value="{bet_edit.RATING}">
</td> </td>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF bet_edit.DATA_RESULTS --> <!-- IF bet_edit.DATA_RESULTS -->
<td class="td_goals_home">&nbsp;</td> <td class="td_goals_home">&nbsp;</td>
<td class="td_vs">&nbsp;</td> <td class="td_vs">&nbsp;</td>
<td class="td_goals_guest">&nbsp;</td> <td class="td_goals_guest">&nbsp;</td>
<td class="td_points">&nbsp;</td> <td class="td_points">&nbsp;</td>
<!-- ENDIF --> <!-- ENDIF -->
<td class="td_button"> <td class="td_button">
<!-- IF S_VIEW <> 'print' and bet_edit.DISPLAY_LINK --> <!-- IF S_VIEW <> 'print' and bet_edit.DISPLAY_LINK -->
<a class="match_info" title="{L_MATCH_STATS}" href="{bet_edit.U_MATCH_STATS}" onclick="javascript:popup(this.href, 818, 750, '_matchstats'); return false;"></a> <a title="{L_MATCH_STATS}" href="{bet_edit.U_MATCH_STATS}" onclick="javascript:popup(this.href, 818, 750, '_matchstats'); return false;"><i class="icon fa-bar-chart fa-fw"></i></a>
<!-- ELSE --> <!-- ELSE -->
<img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" /> <img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" />
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
</tr> </tr>
<!-- END bet_edit --> <!-- END bet_edit -->
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- IF S_DISPLAY_DELIVERY2 or S_DISPLAY_DELIVERY3 --> <!-- IF S_DISPLAY_DELIVERY2 or S_DISPLAY_DELIVERY3 -->
<div class="left-box" style="margin-bottom:5px"> <div class="left-box" style="margin-bottom:5px">
<!-- IF S_DISPLAY_DELIVERY2 --> <!-- IF S_DISPLAY_DELIVERY2 -->
<strong style='color:green'>*&nbsp; {L_DELIVERY_UNTIL} {S_DELIVERY2} </strong><br /> <strong style='color:green'>*&nbsp; {L_DELIVERY_UNTIL} {S_DELIVERY2} </strong><br />
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_DELIVERY3 --> <!-- IF S_DISPLAY_DELIVERY3 -->
<strong style='color:green'>**&nbsp; {L_DELIVERY_UNTIL} {S_DELIVERY3} </strong><br /> <strong style='color:green'>**&nbsp; {L_DELIVERY_UNTIL} {S_DELIVERY3} </strong><br />
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_EXTRA_BET --> <!-- IF S_EXTRA_BET -->
<br /> <br />
<div class="forabg"> <div class="forabg">
<table class="football"> <table class="football">
<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>
<!-- IF S_EXTRA_RESULTS --> <!-- IF S_EXTRA_RESULTS -->
<th>{L_RESULT}</th> <th>{L_RESULT}</th>
<th>{L_POINTS}</th> <th>{L_POINTS}</th>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN extra_view --> <!-- BEGIN extra_view -->
<tr class="{extra_view.ROW_CLASS}"> <tr class="{extra_view.ROW_CLASS}">
<td>{extra_view.QUESTION}</td> <td>{extra_view.QUESTION}</td>
<td style="text-align: center;">{extra_view.EXTRA_POINTS}</td> <td style="text-align: center;">{extra_view.EXTRA_POINTS}</td>
<td style="text-align: center;">{extra_view.EVALUATION}</td> <td style="text-align: center;">{extra_view.EVALUATION}</td>
<td style="text-align: center;">{extra_view.BET}</td> <td style="text-align: center;">{extra_view.BET}</td>
<td style="text-align: center;">{extra_view.RESULT}</td> <td style="text-align: center;">{extra_view.RESULT}</td>
<td class="td_points {extra_view.COLOR_STYLE}">{extra_view.BET_POINTS}</td> <td class="td_points {extra_view.COLOR_STYLE}">{extra_view.BET_POINTS}</td>
</tr> </tr>
<!-- END extra_view --> <!-- END extra_view -->
<!-- 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 -->
<!-- IF S_VIEW <> 'print' --> <!-- IF S_VIEW <> 'print' -->
<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>
<!-- ELSE --> <!-- ELSE -->
_{extra_edit.BET}_ _{extra_edit.BET}_
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF extra_edit.S_DISPLAY_TYPE == 2 --> <!-- IF extra_edit.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_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}">
<!-- ELSE --> <!-- ELSE -->
_{extra_edit.BET}_ _{extra_edit.BET}_
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
</tr> </tr>
<!-- END extra_edit --> <!-- END extra_edit -->
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_EDIT_MODE --> <!-- IF S_EDIT_MODE -->
<!-- IF S_VIEW <> 'print' --> <!-- IF S_VIEW <> 'print' -->
<div class="right-box" style="margin-bottom:5px"> <div class="right-box" style="margin-bottom:5px">
<div class="message">{S_DBMSG}&nbsp;&nbsp;&nbsp;<input class="button1" type="submit" value="{L_BET}"></div> <div class="message">{S_DBMSG}&nbsp;&nbsp;&nbsp;<input class="button1" type="submit" value="{L_BET}"></div>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
</form> </form>
<!-- ELSE --> <!-- ELSE -->
<br /> <br />
<!-- ENDIF --> <!-- ENDIF -->
<!-- INCLUDE nav_delivery.html --> <!-- INCLUDE nav_delivery.html -->
<!-- ELSE --> <!-- ELSE -->
<br /> <br />
<!-- IF S_USER_IS_MEMBER --> <!-- IF S_USER_IS_MEMBER -->
<div class="message">{L_NO_MATCHES_ON_MATCHDAY}</div> <div class="message">{L_NO_MATCHES_ON_MATCHDAY}</div>
<!-- ELSE --> <!-- ELSE -->
<div class="message">{L_NO_MEMBER}</div> <div class="message">{L_NO_MEMBER}</div>
<!-- IF S_JOIN_LEAGUE --> <!-- IF S_JOIN_LEAGUE -->
<br /> <br />
<br /> <br />
<div> <div>
<form method="post" action="{S_FORM_ACTION_JOIN}" name="joinform"> <form method="post" action="{S_FORM_ACTION_JOIN}" name="joinform">
<strong>{JOIN_LEAGUE} </strong><br /> <strong>{JOIN_LEAGUE} </strong><br />
<br /> <br />
<input class="button1" type="submit" value="{L_JOIN}"> <input class="button1" type="submit" value="{L_JOIN}">
</form> </form>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
<br /> <br />
<!-- ENDIF --> <!-- ENDIF -->

View File

@@ -1,11 +1,11 @@
<div class="panel"> <div class="panel">
<h3><span class="small-icon icon-bet"></span>&nbsp;{L_DELIVERY_LIST}</h3> <h3><i class="icon fa-calendar fa-fw"></i>{L_DELIVERY_LIST}</h3>
<!-- BEGIN delivery --> <!-- BEGIN delivery -->
<span style="cursor:pointer;" title="{delivery.TITLE}" onclick="location.href='{delivery.U_BET_LINK}'"> <span style="cursor:pointer;" title="{delivery.TITLE}" onclick="location.href='{delivery.U_BET_LINK}'">
<span> <strong style="color:{delivery.COLOR};">{delivery.DELIVERY} </strong></span> <br /> <span> <strong style="color:{delivery.COLOR};">{delivery.DELIVERY} </strong></span> <br />
<span class="gensmall"><strong>{delivery.LEAGUE_SHORT} </strong></span> <span class="gensmall"><strong>{delivery.LEAGUE_SHORT} </strong></span>
<span class="gensmall" >{delivery.MATCHDAY_NAME}</span> <span class="gensmall" >{delivery.MATCHDAY_NAME}</span>
</span><hr /> </span><hr />
<!-- END delivery --> <!-- END delivery -->
</div> </div>

View File

@@ -1 +1 @@
<!-- IF U_FOOTBALL and S_FOOTBALL_BREADCRUMB--><span class="crumb"><a href="{U_FOOTBALL}" data-navbar-reference="football">{S_FOOTBALL_NAME}</a></span><!-- ENDIF --> <!-- IF U_FOOTBALL and S_FOOTBALL_BREADCRUMB--><span class="crumb"><a href="{U_FOOTBALL}" data-navbar-reference="football"><i class="icon fa-futbol-o fa-fw"></i>{S_FOOTBALL_NAME}</a></span><!-- ENDIF -->

View File

@@ -1 +1 @@
<!-- IF U_FOOTBALL and S_FOOTBALL_BREADCRUMB--><span class="crumb"><a href="{U_FOOTBALL}" data-navbar-reference="football">{S_FOOTBALL_NAME}</a></span><!-- ENDIF --> <!-- IF U_FOOTBALL and S_FOOTBALL_BREADCRUMB--><span class="crumb"><a href="{U_FOOTBALL}" data-navbar-reference="football"><i class="icon fa-futbol-o fa-fw"></i>{S_FOOTBALL_NAME}</a></span><!-- ENDIF -->

View File

@@ -1,29 +1,36 @@
<!-- IF S_FOOTBALL_FULLSCREEN --> <!-- IF S_FOOTBALL_FULLSCREEN -->
<!-- INCLUDECSS @football_football/fullscreen.css --> <!-- INCLUDECSS @football_football/fullscreen.css -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_VIEW == 'print' --> <!-- IF S_VIEW == 'print' -->
<!-- INCLUDECSS @football_football/football_print.css --> <!-- INCLUDECSS @football_football/football_print.css -->
<!-- ELSE --> <!-- ELSE -->
<!-- INCLUDECSS @football_football/football.css --> <!-- INCLUDECSS @football_football/football.css -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- INCLUDECSS @football_football/football_side.css --> <!-- INCLUDECSS @football_football/football_side.css -->
<!-- IF S_FOOTBALL_HEADER_ENABLED --> <!-- IF S_FOOTBALL_HEADER_ENABLED -->
<style> <style>
@media screen and (min-width: 700px){ @media screen and (min-width: 700px){
.imageset.site_logo { .imageset.site_logo {
background-image: url({S_FOOTBALL_EXT_PATH}images/site_logo.gif); background-image: url({S_FOOTBALL_EXT_PATH}images/site_logo.gif);
padding-left: 0px; padding-left: 0px;
padding-top: 0px; padding-top: 0px;
height: 52px; height: 75px;
width: 52px; width: 75px;
} }
.headerbar { .headerbar {
background: url({S_FOOTBALL_EXT_PATH}styles/prosilver/theme/images/header{S_FOOTBALL_HEADER_LEAGUE}.gif) 300px 5px no-repeat, background: url({S_FOOTBALL_EXT_PATH}styles/prosilver/theme/images/header{S_FOOTBALL_HEADER_LEAGUE}.jpg) 0px 0px no-repeat;
url({S_FOOTBALL_EXT_PATH}styles/prosilver/theme/images/header.jpg) 0px 0px; background-color: #12A3EB;
background-color: #12A3EB; margin-bottom: 4px;
margin-bottom: 4px; width: auto;
width: auto; }
} }
} </style>
</style> <!-- ENDIF -->
<!-- ENDIF --> <style>
@media screen and (max-width: 700px){
li.tab i.icon {
display: none;
}
}
</style>

View File

@@ -1,53 +1,47 @@
<!-- IF not S_FOOTBALL_MOBILE --> <!-- IF not S_FOOTBALL_MOBILE -->
<li id="football-links" class="leftside no-bulletin <!-- IF not S_DISPLAY_FOOTBALL_MENU --> hidden<!-- ENDIF --> " data-skip-responsive="true"> <li id="football-links" class="leftside no-bulletin <!-- IF not S_DISPLAY_FOOTBALL_MENU --> hidden<!-- ENDIF --> " data-skip-responsive="true">
<div class="header-profile dropdown-container"> <div class="header-profile dropdown-container">
<a href="{U_BET}" class="header-avatar dropdown-trigger" title="{L_FOOTBALL_MENU}"> <a href="{U_BET}" class="header-avatar dropdown-trigger" title="{L_FOOTBALL_MENU}">
<img class="avatar" src="{ROOT_PATH}ext/football/football/styles/prosilver/theme/images/icon_football.gif" alt="Football-Icon"> <img class="avatar" src="{ROOT_PATH}ext/football/football/styles/prosilver/theme/images/icon_football.gif" alt="Football-Icon">
<span class="username">{S_FOOTBALL_NAME}</span></a> <span class="username">{S_FOOTBALL_NAME}</span></a>
<div class="dropdown hidden"> <div class="dropdown hidden">
<div class="pointer"><div class="pointer-inner"></div></div> <div class="pointer"><div class="pointer-inner"></div></div>
<ul class="dropdown-contents" role="menu"> <ul class="dropdown-contents" role="menu">
<!-- EVENT navbar_header_football_links_before --> <!-- EVENT navbar_header_football_links_before -->
<!-- IF not S_IS_BOT --> <!-- IF not S_IS_BOT -->
<li class="small-icon icon-bet"><a href="{U_BET}" role="menuitem">{L_BET}</a></li> <li><a href="{U_BET}" role="menuitem"><i class="icon fa-futbol-o fa-fw"></i>{L_BET}</a></li>
<li class="small-icon icon-allbets"><a href="{U_ALL_BETS}" role="menuitem">{L_ALL_BETS}</a></li> <li><a href="{U_ALL_BETS}" role="menuitem"><i class="icon fa-group fa-fw"></i>{L_ALL_BETS}</a></li>
<li class="small-icon icon-results"><a href="{U_RESULTS}" role="menuitem">{L_RESULTS}</a></li> <li><a href="{U_RESULTS}" role="menuitem"><i class="icon fa-check-square-o fa-fw"></i>{L_RESULTS}</a></li>
<li class="small-icon icon-list"><a href="{U_TABLE}" role="menuitem">{L_TABLE}</a></li> <li><a href="{U_RANKS_MATCHDAY}" role="menuitem"><i class="icon fa-trophy fa-fw"></i>{L_RANK_MATCHDAY}</a></li>
<li class="small-icon icon-rank"><a href="{U_RANKS_TOTAL}" role="menuitem">{L_RANK_TOTAL}</a></li> <li><a href="{U_RANKS_TOTAL}" role="menuitem"><i class="icon fa-trophy fa-fw"></i>{L_RANK_TOTAL}</a></li>
<li class="small-icon icon-rank"><a href="{U_RANKS_MATCHDAY}" role="menuitem">{L_RANK_MATCHDAY}</a></li> <li><a href="{U_TABLE}" role="menuitem"><i class="icon fa-list-ol fa-fw"></i>{L_TABLE}</a></li>
<li class="small-icon icon-points"><a href="{U_FOOTBALL_BANK}" role="menuitem">{L_FOOTBALL_BANK}</a></li> <li><a href="{U_FOOTBALL_BANK}" role="menuitem"><i class="icon fa-bank fa-fw"></i>{L_FOOTBALL_BANK}</a></li>
<li class="small-icon icon-rules"><a href="{U_RULES}" role="menuitem" target="popup" onclick="popup('{U_RULES}', 625,625);return false;">{L_RULES}</a></li> <li><a href="{U_RULES}" role="menuitem" target="popup" onclick="popup('{U_RULES}', 625,625);return false;"><i class="icon fa-paragraph fa-fw"></i>{L_RULES}</a></li>
<li class="small-icon icon-download"><a href="{U_EXPORT}" role="menuitem">{L_EXPORT}</a></li> <li><a href="{U_ODDS}" role="menuitem"><i class="icon fa-line-chart fa-fw"></i>{L_ODDS}</a></li>
<li class="small-icon icon-odds"><a href="{U_ODDS}" role="menuitem">{L_ODDS}</a></li> <li class="separator"></li>
<li class="separator"></li> <!-- IF S_MENU_LINK1-->
<!-- IF S_MENU_LINK1--> <li><a href="{U_MENU_LINK1}" role="menuitem" target="_blank"><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK1}</a></li>
<li class="small-icon icon-xml"><a href="{U_MENU_LINK1}" role="menuitem" target="_blank">{MENU_DESC_LINK1}</a></li> <!-- ENDIF -->
<!-- ENDIF --> <!-- IF S_MENU_LINK2-->
<!-- IF S_MENU_LINK2--> <li><a href="{U_MENU_LINK2}" role="menuitem" target="_blank"><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK2}</a></li>
<li class="small-icon icon-xml"><a href="{U_MENU_LINK2}" role="menuitem" target="_blank">{MENU_DESC_LINK2}</a></li> <!-- ENDIF -->
<!-- ENDIF --> <!-- IF S_MENU_LINK3-->
<!-- IF S_MENU_LINK3--> <li><a href="{U_MENU_LINK3}" role="menuitem" target="_blank"><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK3}</a></li>
<li class="small-icon icon-xml"><a href="{U_MENU_LINK3}" role="menuitem" target="_blank">{MENU_DESC_LINK3}</a></li> <!-- ENDIF -->
<!-- ENDIF --> <li class="separator"></li>
<li class="separator"></li> <li><a href="{U_MY_BETS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_BETS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_BETS}" role="menuitem">{L_MY_BETS}</a></li> <li><a href="{U_MY_POINTS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_POINTS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_POINTS}" role="menuitem">{L_MY_POINTS}</a></li> <li><a href="{U_MY_TABLE}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_TABLE}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_TABLE}" role="menuitem">{L_MY_TABLE}</a></li> <li><a href="{U_MY_RANK}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_RANK}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_RANK}" role="menuitem">{L_MY_RANK}</a></li> <li><a href="{U_MY_CHART}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_CHART}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_CHART}" role="menuitem">{L_MY_CHART}</a></li> <li><a href="{U_MY_KOEFF}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_KOEFF}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_KOEFF}" role="menuitem">{L_MY_KOEFF}</a></li> <li><a href="{U_STAT_POINTS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_STAT_POINTS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_STAT_POINTS}" role="menuitem">{L_STAT_POINTS}</a></li> <li><a href="{U_STAT_RESULTS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_STAT_RESULTS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_STAT_RESULTS}" role="menuitem">{L_STAT_RESULTS}</a></li> <li><a href="{U_EXPORT}" role="menuitem"><i class="icon fa-file-excel-o fa-fw"></i>{L_EXPORT}</a></li>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_FOOTBALL --> <!-- EVENT navbar_header_football_links_after -->
<li class="separator"></li> </ul>
<!-- IF U_TEAM --><li class="small-icon icon-odds"><a href="{U_FOOTBALL_ODDS}" role="menuitem">{L_FOOTBALL_ODDS}</a></li><!-- ENDIF --> </div>
<!-- ENDIF --> </div>
<li class="separator"></li> </li>
<!-- EVENT navbar_header_football_links_after -->
</ul>
</div>
</div>
</li>
<!-- ENDIF --> <!-- ENDIF -->

View File

@@ -1,64 +1,64 @@
<!-- IF S_FOOTBALL_SIDE --> <!-- IF S_FOOTBALL_SIDE -->
<!--[if lt IE 7]> <!--[if lt IE 7]>
<style type="text/css"> <style type="text/css">
/* hover fix for i6 < 7 */ /* hover fix for i6 < 7 */
#footballside { #footballside {
background-color: expression( background-color: expression(
this.onmouseover = new Function("this.className += ' iehover';"), this.onmouseover = new Function("this.className += ' iehover';"),
this.onmouseout = new Function("this.className = this.className.replace('iehover', '');") this.onmouseout = new Function("this.className = this.className.replace('iehover', '');")
); );
} }
</style> </style>
<![endif]--> <![endif]-->
<div id="footballside"> <div id="footballside">
<div class="forabg"> <div class="forabg">
<p id="dirty"><strong>{S_FOOTBALLSIDE}</strong></p> <p id="dirty"><strong>{S_FOOTBALLSIDE}</strong></p>
<ul class="topiclist"> <ul class="topiclist">
<li class="header"> <li class="header">
<dl class="icon"> <dl>
<dt><a href="{U_FOOTBALL}"><span>{S_FOOTBALL_NAME}</span></a></dt><dd></dd> <dt><a href="{U_FOOTBALL}"><span>{S_FOOTBALL_NAME}</span></a></dt><dd></dd>
</dl> </dl>
</li> </li>
</ul> </ul>
<ul class="topiclist forums" role="menu"> <ul class="topiclist forums" role="menu">
<li class="small-icon icon-bet"><a href="{U_BET}" role="menuitem">{L_BET}</a></li> <li><a href="{U_BET}" role="menuitem"><i class="icon fa-futbol-o fa-fw"></i>{L_BET}</a></li>
<li class="small-icon icon-allbets"><a href="{U_ALL_BETS}" role="menuitem">{L_ALL_BETS}</a></li> <li><a href="{U_ALL_BETS}" role="menuitem"><i class="icon fa-group fa-fw"></i>{L_ALL_BETS}</a></li>
<li class="small-icon icon-results"><a href="{U_RESULTS}" role="menuitem">{L_RESULTS}</a></li> <li><a href="{U_RESULTS}" role="menuitem"><i class="icon fa-check-square-o fa-fw"></i>{L_RESULTS}</a></li>
<li class="small-icon icon-list"><a href="{U_TABLE}" role="menuitem">{L_TABLE}</a></li> <li><a href="{U_TABLE}" role="menuitem"><i class="icon fa-list-ol fa-fw"></i>{L_TABLE}</a></li>
<li class="small-icon icon-rank"><a href="{U_RANKS_TOTAL}" role="menuitem">{L_RANK_TOTAL}</a></li> <li><a href="{U_RANKS_TOTAL}" role="menuitem"><i class="icon fa-trophy fa-fw"></i>{L_RANK_TOTAL}</a></li>
<li class="small-icon icon-rank"><a href="{U_RANKS_MATCHDAY}" role="menuitem">{L_RANK_MATCHDAY}</a></li> <li><a href="{U_RANKS_MATCHDAY}" role="menuitem"><i class="icon fa-trophy fa-fw"></i>{L_RANK_MATCHDAY}</a></li>
<li class="small-icon icon-points"><a href="{U_FOOTBALL_BANK}" role="menuitem">{L_FOOTBALL_BANK}</a></li> <li><a href="{U_FOOTBALL_BANK}" role="menuitem"><i class="icon fa-bank fa-fw"></i>{L_FOOTBALL_BANK}</a></li>
<li class="small-icon icon-rules"><a href="{U_RULES}" role="menuitem" target="popup" onclick="popup('{U_RULES}', 625,625);return false;">{L_RULES}</a></li> <li><a href="{U_RULES}" role="menuitem" target="popup" onclick="popup('{U_RULES}', 625,625);return false;"><i class="icon fa-paragraph fa-fw"></i>{L_RULES}</a></li>
<li class="small-icon icon-download"><a href="{U_EXPORT}" role="menuitem">{L_EXPORT}</a></li> <li><a href="{U_EXPORT}" role="menuitem"><i class="icon fa-file-excel-o fa-fw"></i>{L_EXPORT}</a></li>
<li class="small-icon icon-odds"><a href="{U_ODDS}" role="menuitem">{L_ODDS}</a></li> <li><a href="{U_ODDS}" role="menuitem"><i class="icon fa-line-chart fa-fw"></i>{L_ODDS}</a></li>
<li class="separator"></li> <li class="separator"></li>
<!-- IF S_MENU_LINK1--> <!-- IF S_MENU_LINK1-->
<li class="small-icon icon-xml"><a href="{U_MENU_LINK1}" role="menuitem" target="_blank">{MENU_DESC_LINK1}</a></li> <li><a href="{U_MENU_LINK1}" role="menuitem" target="_blank"><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK1}</a></li>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_MENU_LINK2--> <!-- IF S_MENU_LINK2-->
<li class="small-icon icon-xml"><a href="{U_MENU_LINK2}" role="menuitem" target="_blank">{MENU_DESC_LINK2}</a></li> <li><a href="{U_MENU_LINK2}" role="menuitem" target="_blank"><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK2}</a></li>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_MENU_LINK3--> <!-- IF S_MENU_LINK3-->
<li class="small-icon icon-xml"><a href="{U_MENU_LINK3}" role="menuitem" target="_blank">{MENU_DESC_LINK3}</a></li> <li><a href="{U_MENU_LINK3}" role="menuitem" target="_blank"><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK3}</a></li>
<!-- ENDIF --> <!-- ENDIF -->
</ul> </ul>
<ul class="topiclist cat"> <ul class="topiclist cat">
<li class="header"> <li class="header">
<dl class="icon"> <dl>
<dt>{L_STATISTICS}</dt><dd></dd> <dt>{L_STATISTICS}</dt><dd></dd>
</dl> </dl>
</li> </li>
</ul> </ul>
<ul class="topiclist forums" role="menu"> <ul class="topiclist forums" role="menu">
<li class="small-icon icon-statistics"><a href="{U_MY_BETS}" role="menuitem">{L_MY_BETS}</a></li> <li><a href="{U_MY_BETS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_BETS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_POINTS}" role="menuitem">{L_MY_POINTS}</a></li> <li><a href="{U_MY_POINTS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_POINTS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_TABLE}" role="menuitem">{L_MY_TABLE}</a></li> <li><a href="{U_MY_TABLE}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_TABLE}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_RANK}" role="menuitem">{L_MY_RANK}</a></li> <li><a href="{U_MY_RANK}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_RANK}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_CHART}" role="menuitem">{L_MY_CHART}</a></li> <li><a href="{U_MY_CHART}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_CHART}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_KOEFF}" role="menuitem">{L_MY_KOEFF}</a></li> <li><a href="{U_MY_KOEFF}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_MY_KOEFF}</a></li>
<li class="small-icon icon-statistics"><a href="{U_STAT_POINTS}" role="menuitem">{L_STAT_POINTS}</a></li> <li><a href="{U_STAT_POINTS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_STAT_POINTS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_STAT_RESULTS}" role="menuitem">{L_STAT_RESULTS}</a></li> <li><a href="{U_STAT_RESULTS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{L_STAT_RESULTS}</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->

View File

@@ -1,217 +1,220 @@
<!-- DEFINE $S_IN_FOOTBALL = 1 --> <!-- DEFINE $S_IN_FOOTBALL = 1 -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<!-- $Id: football_body.html 2 2010-06-05 22:09:02Z football $ //--> <!-- $Id: football_body.html 2 2010-06-05 22:09:02Z football $ //-->
<!-- IF S_FOOTBALL_INFO --> <!-- IF S_FOOTBALL_INFO -->
<div id="information" class="rules"> <div id="information" class="rules">
<strong>{L_INFORMATION}:</strong> {S_FOOTBALL_INFO} <strong>{L_INFORMATION}:</strong> {S_FOOTBALL_INFO}
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<div id="football-body"> <div id="football-body">
<!-- [+] center block area --> <!-- [+] center block area -->
<div id="football-center-wrapper"> <div id="football-center-wrapper">
<div id="football-center" style="margin: 0 {FOOTBALL_RIGHT_COLUMN}px 0 {FOOTBALL_LEFT_COLUMN}px; padding: 0 4px;"> <div id="football-center" style="margin: 0 {FOOTBALL_RIGHT_COLUMN}px 0 {FOOTBALL_LEFT_COLUMN}px; padding: 0 4px;">
<div id="tabs" style="margin-top: 0px; margin-left: 5px;"> <div id="tabs" class="tabs" style="margin-top: 0px; margin-left: 5px;">
<ul> <ul>
<li class="tab <!-- IF S_DISPLAY_BET -->activetab<!-- ENDIF --> small-icon icon-bet"><a href="{U_BET}"><span>{L_BET}</span></a></li> <li class="tab <!-- IF S_DISPLAY_BET -->activetab<!-- ENDIF -->"><a href="{U_BET}"><span><i class="icon fa-futbol-o fa-fw"></i>{L_BET}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_ALL_BETS -->activetab<!-- ENDIF --> small-icon icon-allbets"><a href="{U_ALL_BETS}"><span>{L_ALL_BETS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_ALL_BETS -->activetab<!-- ENDIF -->"><a href="{U_ALL_BETS}"><span><i class="icon fa-group fa-fw"></i>{L_ALL_BETS}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_RESULTS -->activetab<!-- ENDIF --> small-icon icon-results"><a href="{U_RESULTS}"><span>{L_RESULTS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_RESULTS -->activetab<!-- ENDIF -->"><a href="{U_RESULTS}"><span><i class="icon fa-check-square-o fa-fw"></i>{L_RESULTS}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_TABLE -->activetab<!-- ENDIF --> small-icon icon-list"><a href="{U_TABLE}"><span>{L_TABLE}</span></a></li> <li class="tab <!-- IF S_DISPLAY_RANKS_MATCHDAY -->activetab<!-- ENDIF -->"><a href="{U_RANKS_MATCHDAY}"><span><i class="icon fa-trophy fa-fw"></i>{L_RANK_MATCHDAY}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_RANKS_TOTAL -->activetab<!-- ENDIF --> small-icon icon-rank"><a href="{U_RANKS_TOTAL}"><span>{L_RANK_TOTAL}</span></a></li> <li class="tab <!-- IF S_DISPLAY_RANKS_TOTAL -->activetab<!-- ENDIF -->"><a href="{U_RANKS_TOTAL}"><span><i class="icon fa-trophy fa-fw"></i>{L_RANK_TOTAL}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_RANKS_MATCHDAY -->activetab<!-- ENDIF --> small-icon icon-rank"><a href="{U_RANKS_MATCHDAY}"><span>{L_RANK_MATCHDAY}</span></a></li> <li class="tab <!-- IF S_DISPLAY_TABLE -->activetab<!-- ENDIF -->"><a href="{U_TABLE}"><span><i class="icon fa-list-ol fa-fw"></i>{L_TABLE}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_BANK -->activetab<!-- ENDIF --> small-icon icon-points"><a href="{U_FOOTBALL_BANK}"><span>{L_FOOTBALL_BANK}</span></a></li> <li class="tab <!-- IF S_DISPLAY_BANK -->activetab<!-- ENDIF -->"><a href="{U_FOOTBALL_BANK}"><span><i class="icon fa-bank fa-fw"></i>{L_FOOTBALL_BANK}</span></a></li>
<li class="tab small-icon icon-rules"><a href="{U_RULES}" target="popup" onclick="popup('{U_RULES}', 625,625);return false;"><span>{L_RULES}</span></a></li> <li class="tab"><a href="{U_RULES}" target="popup" onclick="popup('{U_RULES}', 625,625);return false;"><span><i class="icon fa-paragraph fa-fw"></i>{L_RULES}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_ODDS -->activetab<!-- ENDIF --> small-icon icon-odds"><a href="{U_ODDS}"><span>{L_ODDS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_ODDS -->activetab<!-- ENDIF -->"><a href="{U_ODDS}"><span><i class="icon fa-line-chart fa-fw"></i>{L_ODDS}</span></a></li>
<li class="tab small-icon icon-print"><a href="{U_PRINT_FOOTBALL}" accesskey="d" target="_blank"><span>{L_PRINT_FOOTBALL}</span></a></li> <li class="tab"><a href="{U_PRINT_FOOTBALL}" accesskey="d" target="_blank"><span><i class="icon fa-print fa-fw"></i>{L_PRINT_FOOTBALL}</span></a></li>
<!-- IF S_MENU_LINK1--> <!-- IF S_MENU_LINK1-->
<li class="tab small-icon icon-xml"><a href="{U_MENU_LINK1}" target="_blank"><span>{MENU_DESC_LINK1}</span></a></li> <li class="tab"><a href="{U_MENU_LINK1}" target="_blank"><span><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK1}</span></a></li>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_MENU_LINK2--> <!-- IF S_MENU_LINK2-->
<li class="tab small-icon icon-xml"><a href="{U_MENU_LINK2}" target="_blank"><span>{MENU_DESC_LINK2}</span></a></li> <li class="tab"><a href="{U_MENU_LINK2}" target="_blank"><span><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK2}</span></a></li>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_MENU_LINK3--> <!-- IF S_MENU_LINK3-->
<li class="tab small-icon icon-xml"><a href="{U_MENU_LINK3}" target="_blank"><span>{MENU_DESC_LINK3}</span></a></li> <li class="tab"><a href="{U_MENU_LINK3}" target="_blank"><span><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK3}</span></a></li>
<!-- ENDIF --> <!-- ENDIF -->
<li class="tab <!-- IF S_DISPLAY_MY_BETS -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_BETS}"><span>{L_MY_BETS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_BETS -->activetab<!-- ENDIF -->"><a href="{U_MY_BETS}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_BETS}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_MY_POINTS -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_POINTS}"><span>{L_MY_POINTS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_POINTS -->activetab<!-- ENDIF -->"><a href="{U_MY_POINTS}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_POINTS}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_MY_TABLE -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_TABLE}"><span>{L_MY_TABLE}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_TABLE -->activetab<!-- ENDIF -->"><a href="{U_MY_TABLE}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_TABLE}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_MY_RANK -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_RANK}"><span>{L_MY_RANK}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_RANK -->activetab<!-- ENDIF -->"><a href="{U_MY_RANK}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_RANK}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_MY_CHART -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_CHART}"><span>{L_MY_CHART}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_CHART -->activetab<!-- ENDIF -->"><a href="{U_MY_CHART}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_CHART}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_MY_KOEFF -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_KOEFF}"><span>{L_MY_KOEFF}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_KOEFF -->activetab<!-- ENDIF -->"><a href="{U_MY_KOEFF}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_KOEFF}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_STAT_POINTS -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_STAT_POINTS}"><span>{L_STAT_POINTS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_STAT_POINTS -->activetab<!-- ENDIF -->"><a href="{U_STAT_POINTS}"><span><i class="icon fa-area-chart fa-fw"></i>{L_STAT_POINTS}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_STAT_RESULTS -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_STAT_RESULTS}"><span>{L_STAT_RESULTS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_STAT_RESULTS -->activetab<!-- ENDIF -->"><a href="{U_STAT_RESULTS}"><span><i class="icon fa-area-chart fa-fw"></i>{L_STAT_RESULTS}</span></a></li>
<li class="tab small-icon icon-download"><a href="{U_EXPORT}"><span>{L_EXPORT}</span></a></li> <li class="tab"><a href="{U_EXPORT}"><span><i class="icon fa-file-excel-o fa-fw"></i>{L_EXPORT}</span></a></li>
</ul> </ul>
</div> </div>
<div class="panel"> <div class="panel">
<!-- IF S_FOOTBALL_TABS --> <div class="navbar football_nav">
<div class="left-box football-h3" style="margin-left:5px; width:35%"><a title="{LEFT_TITLE}" href="{U_LEFT}">{LEFT_LINK}</a></div> <div>
<div class="right-box football-h3" style="margin-right:5px; width:35%"><a title="{RIGHT_TITLE}" href="{U_RIGHT}">{RIGHT_LINK}</a></div> <!-- IF .form_season -->
<div style="display:inline; text-align:center;"><div ><H3>{S_SIDENAME} <a href="{U_PRINT_FOOTBALL}" title="{L_PRINT_FOOTBALL}" accesskey="p" class="football_print" style="vertical-align: top;"></a></H3></div></div> <form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post">
<!-- ENDIF --> <div style="float:left;">
<div class="navbar football_bg"> <select name="s" onchange="this.form.submit();" title="{L_OPTION_SEASON}">
<!-- IF .form_season --> <!-- BEGIN form_season -->
<form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post"> <option {form_season.S_SELECTED} value="{form_season.S_SEASON}">{form_season.S_SEASONNAME}</option>
<div style="float:left;"> <!-- END form_season -->
<select name="s" onchange="this.form.submit();" title="{L_OPTION_SEASON}"> </select>
<!-- BEGIN form_season --> <input type="hidden" name="side" value="{S_SIDE}"/>
<option {form_season.S_SELECTED} value="{form_season.S_SEASON}">{form_season.S_SEASONNAME}</option> </div>
<!-- END form_season --> </form>
</select> <!-- ENDIF -->
<input type="hidden" name="side" value="{S_SIDE}"/> <!-- IF .form_league -->
</div> <form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post">
</form> <div style="float:left;">
<!-- ENDIF --> &nbsp;
<!-- IF .form_league --> <input type="hidden" name="side" value="{S_SIDE}"/>
<form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post"> <input type="hidden" name="s" value="{S_SEASON}"/>
<div style="float:left;"> <select name="l" onchange="this.form.submit();" title="{L_OPTION_LEAGUE}">
&nbsp; <!-- BEGIN form_league -->
<input type="hidden" name="side" value="{S_SIDE}"/> <option {form_league.S_SELECTED} value="{form_league.S_LEAGUE}">{form_league.S_LEAGUENAME}</option>
<input type="hidden" name="s" value="{S_SEASON}"/> <!-- END form_league -->
<select name="l" onchange="this.form.submit();" title="{L_OPTION_LEAGUE}"> </select>
<!-- BEGIN form_league --> &nbsp;
<option {form_league.S_SELECTED} value="{form_league.S_LEAGUE}">{form_league.S_LEAGUENAME}</option> </div>
<!-- END form_league --> </form>
</select> <!-- ENDIF -->
&nbsp; <!-- IF .form_matchday and not S_MATCHDAY_HIDE -->
</div> <div style="float:left;">
</form> <!-- IF S_PREV_LINK -->
<!-- ENDIF --> <a title="{L_SHOW_PREV}" href="{S_PREV_LINK}"><i class="icon fa-minus-square fa-fw" style="line-height: 2em; text-align: right;"></i></a>
<!-- IF .form_matchday and not S_MATCHDAY_HIDE --> <!-- ELSE -->
<div style="float:left;"> &nbsp;&nbsp;&nbsp;&nbsp;
<!-- IF S_PREV_LINK --> <!-- ENDIF -->
<a class="prev_matchday" title="{L_SHOW_PREV}" href="{S_PREV_LINK}"></a> </div>
<!-- ELSE --> <form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post">
&nbsp;&nbsp;&nbsp;&nbsp; <div style="float:left;">
<!-- ENDIF --> <select name="m" onchange="this.form.submit();" title="{L_OPTION_MATCHDAY}">
</div> <!-- BEGIN form_matchday -->
<form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post"> <option {form_matchday.S_SELECTED} value="{form_matchday.S_MATCHDAY}">{form_matchday.S_MATCHDAYNAME} {form_matchday.S_CURRENT}</option>
<div style="float:left;"> <!-- END form_matchday -->
<select name="m" onchange="this.form.submit();" title="{L_OPTION_MATCHDAY}"> </select>
<!-- BEGIN form_matchday --> <input type="hidden" name="side" value="{S_SIDE}"/>
<option {form_matchday.S_SELECTED} value="{form_matchday.S_MATCHDAY}">{form_matchday.S_MATCHDAYNAME} {form_matchday.S_CURRENT}</option> <input type="hidden" name="s" value="{S_SEASON}"/>
<!-- END form_matchday --> <input type="hidden" name="l" value="{S_LEAGUE}"/>
</select> <input type="hidden" name="u" value="{S_USER_SEL}"/>
<input type="hidden" name="side" value="{S_SIDE}"/> </div>
<input type="hidden" name="s" value="{S_SEASON}"/> </form>
<input type="hidden" name="l" value="{S_LEAGUE}"/> <div style="float:left;">
<input type="hidden" name="u" value="{S_USER_SEL}"/> <!-- IF S_NEXT_LINK -->
</div> <a title="{L_SHOW_NEXT}" href="{S_NEXT_LINK}"><i class="icon fa-plus-square fa-fw" style="line-height: 2em;"></i></a>
</form> <!-- ELSE -->
<div style="float:left;"> &nbsp;&nbsp;&nbsp;&nbsp;
<!-- IF S_NEXT_LINK --> <!-- ENDIF -->
<a class="next_matchday" title="{L_SHOW_NEXT}" href="{S_NEXT_LINK}"></a> &nbsp;
<!-- ELSE --> </div>
&nbsp;&nbsp;&nbsp;&nbsp; <div style="display:inline; margin:0; vertical-align:center; white-space:nowrap; line-height: 2em;">
<!-- ENDIF --> {S_DELIVERY}
&nbsp; </div>
</div> <!-- ENDIF -->
<div style="display:inline; margin:0; vertical-align:center; white-space:nowrap; line-height: 2em;"> </div>
{S_DELIVERY} </div>
</div>
<!-- ENDIF --> <!-- IF S_DISPLAY_UNDER_CONSTRUCTION -->
</div> <!-- INCLUDE under_construction.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_UNDER_CONSTRUCTION -->
<!-- INCLUDE under_construction.html --> <!-- IF S_DISPLAY_BET -->
<!-- ENDIF --> <!-- INCLUDE bet.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_BET -->
<!-- INCLUDE bet.html --> <!-- IF S_DISPLAY_ALL_BETS -->
<!-- ENDIF --> <!-- INCLUDE all_bets.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_ALL_BETS -->
<!-- INCLUDE all_bets.html --> <!-- IF S_DISPLAY_RESULTS -->
<!-- ENDIF --> <!-- INCLUDE results.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RESULTS -->
<!-- INCLUDE results.html --> <!-- IF S_DISPLAY_RANKS_MATCHDAY -->
<!-- ENDIF --> <!-- INCLUDE ranks.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RANKS_MATCHDAY -->
<!-- INCLUDE ranks.html --> <!-- IF S_DISPLAY_RANKS_TOTAL -->
<!-- ENDIF --> <!-- INCLUDE ranks.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RANKS_TOTAL -->
<!-- INCLUDE ranks.html --> <!-- IF S_DISPLAY_BANK -->
<!-- ENDIF --> <!-- INCLUDE bank.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_BANK -->
<!-- INCLUDE bank.html --> <!-- IF S_DISPLAY_TABLE -->
<!-- ENDIF --> <!-- INCLUDE table.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_TABLE -->
<!-- INCLUDE table.html --> <!-- IF S_DISPLAY_ODDS -->
<!-- ENDIF --> <!-- INCLUDE odds.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_ODDS -->
<!-- INCLUDE odds.html --> <!-- IF S_DISPLAY_MY_BETS -->
<!-- ENDIF --> <!-- INCLUDE my_bets.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_BETS -->
<!-- INCLUDE my_bets.html --> <!-- IF S_DISPLAY_MY_POINTS -->
<!-- ENDIF --> <!-- INCLUDE my_points.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_POINTS -->
<!-- INCLUDE my_points.html --> <!-- IF S_DISPLAY_MY_TABLE -->
<!-- ENDIF --> <!-- INCLUDE my_table.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_TABLE -->
<!-- INCLUDE my_table.html --> <!-- IF S_DISPLAY_MY_RANK -->
<!-- ENDIF --> <!-- INCLUDE my_rank.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_RANK -->
<!-- INCLUDE my_rank.html --> <!-- IF S_DISPLAY_MY_CHART -->
<!-- ENDIF --> <!-- INCLUDE my_chart.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_CHART -->
<!-- INCLUDE my_chart.html --> <!-- IF S_DISPLAY_MY_KOEFF -->
<!-- ENDIF --> <!-- INCLUDE my_koeff.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_KOEFF -->
<!-- INCLUDE my_koeff.html --> <!-- IF S_DISPLAY_STAT_RESULTS -->
<!-- ENDIF --> <!-- INCLUDE stat_results.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_STAT_RESULTS -->
<!-- INCLUDE stat_results.html --> <!-- IF S_DISPLAY_STAT_POINTS -->
<!-- ENDIF --> <!-- INCLUDE stat_points.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_STAT_POINTS --> </div>
<!-- INCLUDE stat_points.html --> <div class="copyright">
<!-- ENDIF --> <!-- IF S_FOOTBALL_COPY -->{S_FOOTBALL_COPY}<!-- ENDIF -->
</div> <br /><strong><a href="{U_MOBILE_SWITCH}">{L_SWITCH_MOBILE}</a></strong>
<div class="copyright"> </div>
<!-- IF S_FOOTBALL_COPY -->{S_FOOTBALL_COPY}<!-- ENDIF --> </div>
<br /><strong><a href="{U_MOBILE_SWITCH}">{L_SWITCH_MOBILE}</a></strong> </div>
</div> <!-- [-] center block area -->
</div> <!-- [+] left block area -->
</div> <div id="football-left" style="width: {FOOTBALL_LEFT_COLUMN}px;">
<!-- [-] center block area -->
<!-- [+] left block area --> <!-- IF S_DISPLAY_RANK_MATCHDAY -->
<div id="football-left" style="width: {FOOTBALL_LEFT_COLUMN}px;"> <!-- INCLUDE rank_matchday.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RANK_MATCHDAY --> <!-- IF S_DISPLAY_SIDE_TABLE -->
<!-- INCLUDE rank_matchday.html --> <!-- INCLUDE side_table.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_DELIVERY --> <!-- IF S_DISPLAY_DELIVERY -->
<!-- INCLUDE delivery.html --> <!-- INCLUDE delivery.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_LAST_USERS --> <!-- IF S_DISPLAY_LAST_USERS -->
<!-- INCLUDE last_users.html --> <!-- INCLUDE last_users.html -->
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>
<!-- [-] left block area --> <!-- [-] left block area -->
<!-- [+] right block area --> <!-- [+] right block area -->
<div id="football-right" style="width: {FOOTBALL_RIGHT_COLUMN}px; margin-<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->: -{FOOTBALL_RIGHT_COLUMN}px;"> <div id="football-right" style="width: {FOOTBALL_RIGHT_COLUMN}px; margin-<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->: -{FOOTBALL_RIGHT_COLUMN}px;">
<!-- IF S_DISPLAY_RANK_TOTAL --> <!-- IF S_DISPLAY_RANK_TOTAL -->
<!-- INCLUDE rank_total.html --> <!-- INCLUDE rank_total.html -->
<!-- ENDIF --> <!-- ENDIF -->
</div> <!-- IF S_DISPLAY_LAST_RESULTS -->
<!-- [-] right block area --> <!-- INCLUDE last_results.html -->
<br class="football-clear" /> <!-- ENDIF -->
</div> </div>
<!-- [-] right block area -->
<br class="football-clear" />
</div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,117 +1,116 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}"> <html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" /> <meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta name="resource-type" content="document" /> <meta name="resource-type" content="document" />
<meta name="distribution" content="global" /> <meta name="distribution" content="global" />
<meta name="copyright" content="phpBB3 Football Extension by football" /> <meta name="copyright" content="phpBB3 Football Extension by football" />
<meta name="keywords" content="phpBB3, Football, Extension, Tipprunde, Prediction, League, Soccer" /> <meta name="keywords" content="phpBB3, Football, Extension, Tipprunde, Prediction, League, Soccer" />
<meta name="description" content="" /> <meta name="description" content="" />
<meta name="robots" CONTENT="noindex" /> <meta name="robots" CONTENT="noindex" />
{META} {META}
<title>{SITENAME} &bull; {PAGE_TITLE}</title> <title>{SITENAME} &bull; {PAGE_TITLE}</title>
<link href="./../../ext/football/football/styles/prosilver/theme/football_print.css" rel="stylesheet" type="text/css" /> <link href="./../../ext/football/football/styles/prosilver/theme/football_print.css" rel="stylesheet" type="text/css" />
</head> </head>
<body id="phpbb" style="width:100%"> <body id="phpbb" style="width:100%">
<div id="wrap"> <div id="wrap">
<a id="top" accesskey="t"></a> <a id="top" accesskey="t"></a>
<div id="page-header"> <div id="page-header">
<!-- IF S_DISPLAY_BANK --> <!-- IF S_DISPLAY_BANK -->
<h2><a href="{U_SIDE_LINK}">{S_SIDENAME}</a> &bull; {S_SEASON_NAME} &bull; {S_LEAGUE_NAME}</h2> <h2><a href="{U_SIDE_LINK}">{S_SIDENAME}</a> &bull; {S_SEASON_NAME} &bull; {S_LEAGUE_NAME}</h2>
<!-- ELSE --> <!-- ELSE -->
<h2><a href="{U_SIDE_LINK}">{S_SIDENAME}</a> &bull; {S_SEASON_NAME} &bull; {S_LEAGUE_NAME} &bull; {S_MATCHDAY_NAME}</h2> <h2><a href="{U_SIDE_LINK}">{S_SIDENAME}</a> &bull; {S_SEASON_NAME} &bull; {S_LEAGUE_NAME} &bull; {S_MATCHDAY_NAME}</h2>
<p>{S_DELIVERY}</p> <p>{S_DELIVERY}</p>
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>
<div id="page-body"> <div id="page-body">
<div class="page-number">{PAGE_NUMBER}</div> <div class="page-number">{PAGE_NUMBER}</div>
<!-- IF S_DISPLAY_BET --> <!-- IF S_DISPLAY_BET -->
<!-- INCLUDE bet.html --> <!-- INCLUDE bet.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_ALL_BETS --> <!-- IF S_DISPLAY_ALL_BETS -->
<table class="football"> <table class="football">
<tr> <tr>
style="vertical-align: top;" <!-- INCLUDE all_bets.html -->
<!-- INCLUDE all_bets.html --> </td>
</td> <td style="width:4px; vertical-align: top;"></td>
<td style="width:4px; vertical-align: top;"></td> <td style="width:{FOOTBALL_RIGHT_COLUMN}px; vertical-align: top;">
<td style="width:{FOOTBALL_RIGHT_COLUMN}px; vertical-align: top;"> <!-- IF S_DISPLAY_RANK_TOTAL -->
<!-- IF S_DISPLAY_RANK_TOTAL --> <!-- INCLUDE rank_total.html -->
<!-- INCLUDE rank_total.html --> <!-- ENDIF -->
<!-- ENDIF --> </td>
</td> </tr>
</tr> </table>
</table> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RESULTS -->
<!-- IF S_DISPLAY_RESULTS --> <!-- INCLUDE results.html -->
<!-- INCLUDE results.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RANKS_MATCHDAY -->
<!-- IF S_DISPLAY_RANKS_MATCHDAY --> <!-- INCLUDE ranks.html -->
<!-- INCLUDE ranks.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RANKS_TOTAL -->
<!-- IF S_DISPLAY_RANKS_TOTAL --> <!-- INCLUDE ranks.html -->
<!-- INCLUDE ranks.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_TABLE -->
<!-- IF S_DISPLAY_TABLE --> <!-- INCLUDE table.html -->
<!-- INCLUDE table.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_ODDS -->
<!-- IF S_DISPLAY_ODDS --> <!-- INCLUDE odds.html -->
<!-- INCLUDE odds.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_BETS -->
<!-- IF S_DISPLAY_MY_BETS --> <!-- INCLUDE my_bets.html -->
<!-- INCLUDE my_bets.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_POINTS -->
<!-- IF S_DISPLAY_MY_POINTS --> <!-- INCLUDE my_points.html -->
<!-- INCLUDE my_points.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_TABLE -->
<!-- IF S_DISPLAY_MY_TABLE --> <!-- INCLUDE my_table.html -->
<!-- INCLUDE my_table.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_RANK -->
<!-- IF S_DISPLAY_MY_RANK --> <!-- INCLUDE my_rank.html -->
<!-- INCLUDE my_rank.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_CHART -->
<!-- IF S_DISPLAY_MY_CHART --> <!-- INCLUDE my_chart.html -->
<!-- INCLUDE my_chart.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_KOEFF -->
<!-- IF S_DISPLAY_MY_KOEFF --> <!-- INCLUDE my_koeff.html -->
<!-- INCLUDE my_koeff.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_STAT_RESULTS -->
<!-- IF S_DISPLAY_STAT_RESULTS --> <!-- INCLUDE stat_results.html -->
<!-- INCLUDE stat_results.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_STAT_POINTS -->
<!-- IF S_DISPLAY_STAT_POINTS --> <!-- INCLUDE stat_points.html -->
<!-- INCLUDE stat_points.html --> <!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_BANK -->
<!-- IF S_DISPLAY_BANK --> <!-- INCLUDE bank.html -->
<!-- INCLUDE bank.html --> <!-- ENDIF -->
<!-- ENDIF -->
</div>
</div>
<div id="page-footer">
<div id="page-footer"> <div class="copyright">
<div class="copyright"> <!-- IF S_FOOTBALL_COPY --><br />{S_FOOTBALL_COPY}<!-- ENDIF -->
<!-- IF S_FOOTBALL_COPY --><br />{S_FOOTBALL_COPY}<!-- ENDIF --> </div>
</div> </div>
</div> </div>
</div> </body>
</body> </html>
</html>

View File

@@ -0,0 +1,13 @@
<!-- IF S_DATA_LAST_RESULTS -->
<div class="panel"> <h3><i class="icon fa-check-square-o fa-fw"></i>{L_LAST_RESULTS}</h3>
<!-- BEGIN last_results -->
<div style="text-align:center;" class="{last_results.COLOR_STYLE}" title="{last_results.LEAGUE_NAME}: {last_results.MATCH_TIME}"
onclick="location.href='{last_results.U_RESULTS_LINK}'">
{last_results.LOGO_HOME} {last_results.GOALS_HOME}:{last_results.GOALS_GUEST} {last_results.LOGO_GUEST}
</div>
<!-- IF last_results.KOGOALS_HOME != '- ' -->
<div style="text-align:center;">({last_results.KOGOALS_HOME}:{last_results.KOGOALS_GUEST})</div>
<!-- ENDIF -->
<div style="text-align:center;">{last_results.HOME_SHORT} - {last_results.GUEST_SHORT}</div><hr />
<!-- END last_results --></div>
<!-- ENDIF -->

View File

@@ -1,4 +1,4 @@
<div class="panel"> <div class="panel"> <h3><i class="icon fa-sign-in fa-fw"></i>{LAST_USERS}</h3>
<h3><span class="small-icon icon-allbets"></span>&nbsp;{LAST_USERS}</h3> <!-- BEGIN last_users -->
<span class="genmed">{last_users.USER_NAME}</span> <br /> <span class="gensmall">{last_users.LAST_VISIT_DATE}</span><hr />
<!-- BEGIN last_users --> <!-- END last_users --></div>

View File

@@ -1,179 +1,179 @@
<!-- DEFINE $S_IN_FOOTBALL = 1 --> <!-- DEFINE $S_IN_FOOTBALL = 1 -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<!-- IF S_FOOTBALL_INFO --> <!-- IF S_FOOTBALL_INFO -->
<div id="information" class="rules"> <div id="information" class="rules">
<strong>{L_INFORMATION}:</strong> {S_FOOTBALL_INFO} <strong>{L_INFORMATION}:</strong> {S_FOOTBALL_INFO}
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<div id="tabs" style="margin-top: 0px; margin-left: 5px;"> <div id="tabs" class="tabs" style="margin-top: 0px; margin-left: 5px;">
<ul> <ul>
<li class="tab <!-- IF S_DISPLAY_BET -->activetab<!-- ENDIF --> small-icon icon-bet"><a href="{U_BET}"><span>{L_BET}</span></a></li> <li class="tab <!-- IF S_DISPLAY_BET -->activetab<!-- ENDIF -->"><a href="{U_BET}"><span><i class="icon fa-futbol-o fa-fw"></i>{L_BET}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_ALL_BETS -->activetab<!-- ENDIF --> small-icon icon-allbets"><a href="{U_ALL_BETS}"><span>{L_BETS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_ALL_BETS -->activetab<!-- ENDIF -->"><a href="{U_ALL_BETS}"><span><i class="icon fa-group fa-fw"></i>{L_BETS}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_RESULTS -->activetab<!-- ENDIF --> small-icon icon-results"><a href="{U_RESULTS}"><span>{L_RESULTS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_RESULTS -->activetab<!-- ENDIF -->"><a href="{U_RESULTS}"><span><i class="icon fa-check-square-o fa-fw"></i>{L_RESULTS_SHORT_DOT}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_TABLE -->activetab<!-- ENDIF --> small-icon icon-list"><a href="{U_TABLE}"><span>{L_TABLE}</span></a></li> <li class="tab <!-- IF S_DISPLAY_RANKS_MATCHDAY -->activetab<!-- ENDIF -->"><a href="{U_RANKS_MATCHDAY}"><span><i class="icon fa-trophy fa-fw"></i>{L_MATCHDAY_SHORT}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_RANKS_TOTAL -->activetab<!-- ENDIF --> small-icon icon-rank"><a href="{U_RANKS_TOTAL}"><span>{L_TOTAL}</span></a></li> <li class="tab <!-- IF S_DISPLAY_RANKS_TOTAL -->activetab<!-- ENDIF -->"><a href="{U_RANKS_TOTAL}"><span><i class="icon fa-trophy fa-fw"></i>{L_TOTAL}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_RANKS_MATCHDAY -->activetab<!-- ENDIF --> small-icon icon-rank"><a href="{U_RANKS_MATCHDAY}"><span>{L_MATCHDAY_SHORT}</span></a></li> <li class="tab <!-- IF S_DISPLAY_TABLE -->activetab<!-- ENDIF -->"><a href="{U_TABLE}"><span><i class="icon fa-list-ol fa-fw"></i>{L_TABLE}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_DELIVERY -->activetab<!-- ENDIF --> small-icon icon-bet"><a href="{U_DELIVERY_LIST}"><span>{L_DATES}</span></a></li> <li class="tab <!-- IF S_DISPLAY_DELIVERY -->activetab<!-- ENDIF -->"><a href="{U_DELIVERY_LIST}"><span><i class="icon fa-calendar fa-fw"></i>{L_DATES}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_LAST_USERS -->activetab<!-- ENDIF --> small-icon icon-allbets"><a href="{U_LAST_VISITORS}"><span>{L_USERS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_LAST_USERS -->activetab<!-- ENDIF -->"><a href="{U_LAST_VISITORS}"><span><i class="icon fa-sign-in fa-fw"></i>{L_USERS}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_BANK -->activetab<!-- ENDIF --> small-icon icon-points"><a href="{U_FOOTBALL_BANK}"><span>{L_FOOTBALL_BANK}</span></a></li> <li class="tab <!-- IF S_DISPLAY_BANK -->activetab<!-- ENDIF -->"><a href="{U_FOOTBALL_BANK}"><span><i class="icon fa-bank fa-fw"></i>{L_FOOTBALL_BANK}</span></a></li>
<li class="tab small-icon icon-rules"><a href="{U_RULES}" target="popup" onclick="popup('{U_RULES}', 625,625);return false;"><span>{L_RULES}</span></a></li> <li class="tab"><a href="{U_RULES}" target="popup" onclick="popup('{U_RULES}', 625,625);return false;"><span><i class="icon fa-paragraph fa-fw"></i>{L_RULES}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_ODDS -->activetab<!-- ENDIF --> small-icon icon-odds"><a href="{U_ODDS}"><span>{L_ODDS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_ODDS -->activetab<!-- ENDIF -->"><a href="{U_ODDS}"><span><i class="icon fa-line-chart fa-fw"></i>{L_ODDS}</span></a></li>
<li class="tab small-icon icon-print"><a href="{U_PRINT_FOOTBALL}" accesskey="d" target="_blank"><span>{L_PRINT_FOOTBALL}</span></a></li> <li class="tab"><a href="{U_PRINT_FOOTBALL}" accesskey="d" target="_blank"><span><i class="icon fa-print fa-fw"></i>{L_PRINT_FOOTBALL}</span></a></li>
<!-- IF S_MENU_LINK1--> <!-- IF S_MENU_LINK1-->
<li class="tab small-icon icon-xml"><a href="{U_MENU_LINK1}" target="_blank"><span>{MENU_DESC_LINK1}</span></a></li> <li class="tab"><a href="{U_MENU_LINK1}" target="_blank"><span><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK1}</span></a></li>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_MENU_LINK2--> <!-- IF S_MENU_LINK2-->
<li class="tab small-icon icon-xml"><a href="{U_MENU_LINK2}" target="_blank"><span>{MENU_DESC_LINK2}</span></a></li> <li class="tab"><a href="{U_MENU_LINK2}" target="_blank"><span><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK2}</span></a></li>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_MENU_LINK3--> <!-- IF S_MENU_LINK3-->
<li class="tab small-icon icon-xml"><a href="{U_MENU_LINK3}" target="_blank"><span>{MENU_DESC_LINK3}</span></a></li> <li class="tab"><a href="{U_MENU_LINK3}" target="_blank"><span><i class="icon fa-external-link fa-fw"></i>{MENU_DESC_LINK3}</span></a></li>
<!-- ENDIF --> <!-- ENDIF -->
<li class="tab <!-- IF S_DISPLAY_MY_BETS -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_BETS}"><span>{L_MY_BETS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_BETS -->activetab<!-- ENDIF -->"><a href="{U_MY_BETS}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_BETS}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_MY_POINTS -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_POINTS}"><span>{L_MY_POINTS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_POINTS -->activetab<!-- ENDIF -->"><a href="{U_MY_POINTS}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_POINTS}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_MY_TABLE -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_TABLE}"><span>{L_MY_TABLE}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_TABLE -->activetab<!-- ENDIF -->"><a href="{U_MY_TABLE}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_TABLE}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_MY_RANK -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_RANK}"><span>{L_MY_RANK}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_RANK -->activetab<!-- ENDIF -->"><a href="{U_MY_RANK}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_RANK}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_MY_CHART -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_CHART}"><span>{L_MY_CHART}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_CHART -->activetab<!-- ENDIF -->"><a href="{U_MY_CHART}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_CHART}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_MY_KOEFF -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_MY_KOEFF}"><span>{L_MY_KOEFF}</span></a></li> <li class="tab <!-- IF S_DISPLAY_MY_KOEFF -->activetab<!-- ENDIF -->"><a href="{U_MY_KOEFF}"><span><i class="icon fa-area-chart fa-fw"></i>{L_MY_KOEFF}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_STAT_POINTS -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_STAT_POINTS}"><span>{L_STAT_POINTS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_STAT_POINTS -->activetab<!-- ENDIF -->"><a href="{U_STAT_POINTS}"><span><i class="icon fa-area-chart fa-fw"></i>{L_STAT_POINTS}</span></a></li>
<li class="tab <!-- IF S_DISPLAY_STAT_RESULTS -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_STAT_RESULTS}"><span>{L_STAT_RESULTS}</span></a></li> <li class="tab <!-- IF S_DISPLAY_STAT_RESULTS -->activetab<!-- ENDIF -->"><a href="{U_STAT_RESULTS}"><span><i class="icon fa-area-chart fa-fw"></i>{L_STAT_RESULTS}</span></a></li>
</ul> </ul>
</div> </div>
<div class="panel"> <div class="panel">
<!-- IF !S_DISPLAY_LAST_USERS and !S_DISPLAY_DELIVERY --> <!-- IF !S_DISPLAY_LAST_USERS and !S_DISPLAY_DELIVERY -->
<div style="line-height: 0.7em;"> <div style="line-height: 0.7em;">
<br /> <br />
</div> </div>
<div class="navbar football_bg"> <div class="navbar football_bg">
<!-- IF .form_season --> <!-- IF .form_season -->
<form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post"> <form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post">
<div style="float:left;"> <div style="float:left;">
<select name="s" onchange="this.form.submit();" title="{L_OPTION_SEASON}"> <select name="s" onchange="this.form.submit();" title="{L_OPTION_SEASON}">
<!-- BEGIN form_season --> <!-- BEGIN form_season -->
<option {form_season.S_SELECTED} value="{form_season.S_SEASON}">{form_season.S_SEASON}</option> --> <option {form_season.S_SELECTED} value="{form_season.S_SEASON}">{form_season.S_SEASON}</option> -->
<!-- END form_season --> <!-- END form_season -->
</select> </select>
<input type="hidden" name="side" value="{S_SIDE}"/> <input type="hidden" name="side" value="{S_SIDE}"/>
</div> </div>
</form> </form>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF .form_league --> <!-- IF .form_league -->
<form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post"> <form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post">
<div style="float:left;"> <div style="float:left;">
<select name="l" onchange="this.form.submit();" title="{L_OPTION_LEAGUE}"> <select name="l" onchange="this.form.submit();" title="{L_OPTION_LEAGUE}">
<!-- BEGIN form_league --> <!-- BEGIN form_league -->
<option {form_league.S_SELECTED} value="{form_league.S_LEAGUE}">{form_league.S_LEAGUENAME}</option> <option {form_league.S_SELECTED} value="{form_league.S_LEAGUE}">{form_league.S_LEAGUENAME}</option>
<!-- END form_league --> <!-- END form_league -->
</select> </select>
<input type="hidden" name="side" value="{S_SIDE}"/> <input type="hidden" name="side" value="{S_SIDE}"/>
<input type="hidden" name="s" value="{S_SEASON}"/> <input type="hidden" name="s" value="{S_SEASON}"/>
</div> </div>
</form> </form>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF .form_matchday and not S_MATCHDAY_HIDE --> <!-- IF .form_matchday and not S_MATCHDAY_HIDE -->
<form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post"> <form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post">
<div style="float:left;"> <div style="float:left;">
<select name="m" onchange="this.form.submit();" title="{L_OPTION_MATCHDAY}"> <select name="m" onchange="this.form.submit();" title="{L_OPTION_MATCHDAY}">
<!-- BEGIN form_matchday --> <!-- BEGIN form_matchday -->
<option {form_matchday.S_SELECTED} value="{form_matchday.S_MATCHDAY}">{form_matchday.S_MATCHDAY}. {L_MATCHDAY}{form_matchday.S_CURRENT}</option> <option {form_matchday.S_SELECTED} value="{form_matchday.S_MATCHDAY}">{form_matchday.S_MATCHDAY}. {L_MATCHDAY}{form_matchday.S_CURRENT}</option>
<!-- END form_matchday --> <!-- END form_matchday -->
</select> </select>
<input type="hidden" name="side" value="{S_SIDE}"/> <input type="hidden" name="side" value="{S_SIDE}"/>
<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="u" value="{S_USER_SEL}"/> <input type="hidden" name="u" value="{S_USER_SEL}"/>
</div> </div>
</form> </form>
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>
<div style="clear: both; font-size: 0.6em; margin 0px; vertical-align:center; white-space:nowrap; line-height: 1.5em;"> <div style="clear: both; font-size: 0.6em; margin 0px; vertical-align:center; white-space:nowrap; line-height: 1.5em;">
<!-- IF .form_matchday and not S_MATCHDAY_HIDE --> <!-- IF .form_matchday and not S_MATCHDAY_HIDE -->
{S_DELIVERY} {S_DELIVERY}
<!-- ELSE --> <!-- ELSE -->
<br /> <br />
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_UNDER_CONSTRUCTION --> <!-- IF S_DISPLAY_UNDER_CONSTRUCTION -->
<!-- INCLUDE mobile_under_construction.html --> <!-- INCLUDE mobile_under_construction.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_BET --> <!-- IF S_DISPLAY_BET -->
<!-- INCLUDE mobile_bet.html --> <!-- INCLUDE mobile_bet.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_ALL_BETS --> <!-- IF S_DISPLAY_ALL_BETS -->
<!-- INCLUDE mobile_all_bets.html --> <!-- INCLUDE mobile_all_bets.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_RESULTS --> <!-- IF S_DISPLAY_RESULTS -->
<!-- INCLUDE mobile_results.html --> <!-- INCLUDE mobile_results.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_RANKS_MATCHDAY --> <!-- IF S_DISPLAY_RANKS_MATCHDAY -->
<!-- INCLUDE mobile_ranks.html --> <!-- INCLUDE mobile_ranks.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_RANKS_TOTAL --> <!-- IF S_DISPLAY_RANKS_TOTAL -->
<!-- INCLUDE mobile_ranks.html --> <!-- INCLUDE mobile_ranks.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_BANK --> <!-- IF S_DISPLAY_BANK -->
<!-- INCLUDE mobile_bank.html --> <!-- INCLUDE mobile_bank.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_TABLE --> <!-- IF S_DISPLAY_TABLE -->
<!-- INCLUDE mobile_table.html --> <!-- INCLUDE mobile_table.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_LAST_USERS --> <!-- IF S_DISPLAY_LAST_USERS -->
<!-- INCLUDE mobile_last_users.html --> <!-- INCLUDE mobile_last_users.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_ODDS --> <!-- IF S_DISPLAY_ODDS -->
<!-- INCLUDE mobile_odds.html --> <!-- INCLUDE mobile_odds.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_MY_BETS --> <!-- IF S_DISPLAY_MY_BETS -->
<!-- INCLUDE mobile_my_bets.html --> <!-- INCLUDE mobile_my_bets.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_MY_POINTS --> <!-- IF S_DISPLAY_MY_POINTS -->
<!-- INCLUDE mobile_my_points.html --> <!-- INCLUDE mobile_my_points.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_MY_TABLE --> <!-- IF S_DISPLAY_MY_TABLE -->
<!-- INCLUDE mobile_my_table.html --> <!-- INCLUDE mobile_my_table.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_MY_RANK --> <!-- IF S_DISPLAY_MY_RANK -->
<!-- INCLUDE mobile_my_rank.html --> <!-- INCLUDE mobile_my_rank.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_MY_CHART --> <!-- IF S_DISPLAY_MY_CHART -->
<!-- INCLUDE mobile_my_chart.html --> <!-- INCLUDE mobile_my_chart.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_MY_KOEFF --> <!-- IF S_DISPLAY_MY_KOEFF -->
<!-- INCLUDE mobile_my_koeff.html --> <!-- INCLUDE mobile_my_koeff.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_STAT_RESULTS --> <!-- IF S_DISPLAY_STAT_RESULTS -->
<!-- INCLUDE mobile_stat_results.html --> <!-- INCLUDE mobile_stat_results.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_STAT_POINTS --> <!-- IF S_DISPLAY_STAT_POINTS -->
<!-- INCLUDE mobile_stat_points.html --> <!-- INCLUDE mobile_stat_points.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_DISPLAY_DELIVERY --> <!-- IF S_DISPLAY_DELIVERY -->
<!-- INCLUDE mobile_delivery.html --> <!-- INCLUDE mobile_delivery.html -->
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>
<div class="copyright"> <div class="copyright">
<!-- IF S_FOOTBALL_COPY -->{S_FOOTBALL_COPY}<!-- ENDIF --> <!-- IF S_FOOTBALL_COPY -->{S_FOOTBALL_COPY}<!-- ENDIF -->
<br /><strong><a href="{U_MOBILE_SWITCH}">{L_SWITCH_DESKTOP}</a></strong> <br /><strong><a href="{U_MOBILE_SWITCH}">{L_SWITCH_DESKTOP}</a></strong>
</div> </div>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View File

@@ -1,57 +0,0 @@
<!-- INCLUDE simple_header.html -->
<!--//<link href="{T_THEME_PATH}/football.css" rel="stylesheet" type="text/css" media="screen, projection" /> -->
<div class="panel">
<br />
<div class="navbar football_bg">
<div class="maintitle">{MODE_DESC} {LOGO} {TEAM} <br /> {LEAGUE} {SEASON}</div>
</div>
<br />
<!-- IF S_DATA_PLAN -->
<span class="match_win">{L_WON}</span> - <span class="match_draw">{L_DRAW}</span> - <span class="match_lost">{L_LOST}</span>
<div class="forabg">
<table class="football">
<thead>
<tr>
<th>{L_DATE}</th>
<!-- IF S_DATA_GROUP -->
<th>{L_GR}</th>
<!-- ENDIF -->
<th colspan="5">{L_VS}</th>
<!-- IF S_DATA_RESULTS -->
<th colspan="3">{L_RESULT}</th>
<!-- ENDIF -->
</tr>
</thead>
<tbody>
<!-- BEGIN match -->
<tr class="{match.ROW_CLASS}">
<td>{match.MATCH_TIME}</td>
<!-- IF S_DATA_GROUP -->
<td class="td_group">{match.GROUP}</td>
<!-- ENDIF -->
<td class="td_logo">{match.LOGO_HOME}</td>
<td class="td_team {match.COLOR_HOME}">{match.HOME_NAME}</td>
<td class="td_vs">:</td>
<td class="td_logo">{match.LOGO_GUEST}</td>
<td class="td_team {match.COLOR_GUEST}">{match.GUEST_NAME}</td>
<!-- IF S_DATA_RESULTS -->
<td class="td_goals_home {match.COLOR_GOALS}">{match.GOALS_HOME}</td>
<td class="td_vs {match.COLOR_GOALS}">:</td>
<td class="td_goals_guest {match.COLOR_GOALS}">{match.GOALS_GUEST}</td>
<!-- ENDIF -->
</tr>
<!-- END match -->
</tbody>
</table>
</div>
<!-- ELSE -->
<br />
<div class="message">{S_ERROR_MESSAGE}</div>
<br />
<!-- ENDIF -->
<div style="text-align:center">
<a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
</div>
</div>
<!-- INCLUDE simple_footer.html -->

View File

@@ -1,68 +1,68 @@
<!-- IF S_DATA_ODDS --> <!-- IF S_DATA_ODDS -->
<div class="forabg"> <div class="forabg">
<table class="football"> <table class="football">
<thead> <thead>
<tr> <tr>
<th>{L_DATE}</th> <th>{L_DATE}</th>
<!-- IF S_DISPLAY_GROUP --> <!-- IF S_DISPLAY_GROUP -->
<th>{L_GR}</th> <th>{L_GR}</th>
<!-- ENDIF --> <!-- ENDIF -->
<th style="text-align: center;" colspan="5">{L_VS}</th> <th style="text-align: center;" colspan="5">{L_VS}</th>
<th style="text-align: center;" colspan="3">{L_RESULT} ({RESULT_EXPLAIN})</th> <th style="text-align: center;" colspan="3">{L_RESULT} ({RESULT_EXPLAIN})</th>
<!-- IF S_DISPLAY_KO --> <!-- IF S_DISPLAY_KO -->
<th style="text-align: center;" colspan="3">{LABEL_FINALRESULT}</th> <th style="text-align: center;" colspan="3">{LABEL_FINALRESULT}</th>
<!-- ENDIF --> <!-- ENDIF -->
<th>%</th> <th>%</th>
<th></th> <th></th>
<th style="text-align: center;" colspan="3">Quoten</th> <th style="text-align: center;" colspan="3">Quoten</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN odds --> <!-- BEGIN odds -->
<tr class="{odds.ROW_CLASS}"> <tr class="{odds.ROW_CLASS}">
<td class="td_datetime">{odds.MATCH_TIME}</td> <td class="td_datetime">{odds.MATCH_TIME}</td>
<!-- IF S_DISPLAY_GROUP --> <!-- IF S_DISPLAY_GROUP -->
<td class="td_group">{odds.GROUP}</td> <td class="td_group">{odds.GROUP}</td>
<!-- ENDIF --> <!-- ENDIF -->
<td class="td_logo">{odds.LOGO_HOME}</td> <td class="td_logo">{odds.LOGO_HOME}</td>
<td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAYED}" onclick="popup('{odds.U_PLAN_HOME}', 625,625);return false;"> <td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAYED}" onclick="popup('{odds.U_PLAN_HOME}', 625,625);return false;">
{odds.HOME_NAME}</td> {odds.HOME_NAME}</td>
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td class="td_logo">{odds.LOGO_GUEST}</td> <td class="td_logo">{odds.LOGO_GUEST}</td>
<td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAYED}" onclick="popup('{odds.U_PLAN_GUEST}', 625,625);return false;"> <td class="td_team" style="cursor:pointer;" title="{L_SHOW_PLAYED}" onclick="popup('{odds.U_PLAN_GUEST}', 625,625);return false;">
{odds.GUEST_NAME}</td> {odds.GUEST_NAME}</td>
<td class="td_goals_home {odds.COLOR_STYLE}">{odds.GOALS_HOME}</td> <td class="td_goals_home {odds.COLOR_STYLE}">{odds.GOALS_HOME}</td>
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td class="td_goals_guest {odds.COLOR_STYLE}">{odds.GOALS_GUEST}</td> <td class="td_goals_guest {odds.COLOR_STYLE}">{odds.GOALS_GUEST}</td>
<!-- IF S_DISPLAY_KO --> <!-- IF S_DISPLAY_KO -->
<td class="td_goals_home {odds.COLOR_STYLE}">{odds.KOGOALS_HOME}</td> <td class="td_goals_home {odds.COLOR_STYLE}">{odds.KOGOALS_HOME}</td>
<td class="td_vs">:</td> <td class="td_vs">:</td>
<td class="td_goals_guest {odds.COLOR_STYLE}">{odds.KOGOALS_GUEST}</td> <td class="td_goals_guest {odds.COLOR_STYLE}">{odds.KOGOALS_GUEST}</td>
<!-- ENDIF --> <!-- ENDIF -->
<td style="text-align: center;">{odds.TREND}</td> <td style="text-align: center;">{odds.TREND}</td>
<td class="td_button"> <td class="td_button">
<!-- IF S_VIEW <> 'print' --> <!-- IF S_VIEW <> 'print' -->
<a class="match_info" title="{L_MATCH_STATS}" href="{odds.U_MATCH_STATS}" onclick="popup(this.href, 818, 450, '_matchstats'); return false;"></a> <a title="{L_MATCH_STATS}" href="{odds.U_MATCH_STATS}" onclick="popup(this.href, 818, 450, '_matchstats'); return false;"><i class="icon fa-bar-chart fa-fw"></i></a>
<!-- ELSE --> <!-- ELSE -->
<img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" /> <img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" />
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<td class="td_group">{odds.ODD_1}</td> <td class="td_group">{odds.ODD_1}</td>
<td style="text-align: center;">{odds.ODD_X}</td> <td style="text-align: center;">{odds.ODD_X}</td>
<td class="td_group">{odds.ODD_2}</td> <td class="td_group">{odds.ODD_2}</td>
</tr> </tr>
<!-- END odds --> <!-- END odds -->
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="right-box" style="margin-bottom:5px; height:2em"> <div class="right-box" style="margin-bottom:5px; height:2em">
</div> </div>
<br /> <br />
<!-- INCLUDE nav_delivery.html --> <!-- INCLUDE nav_delivery.html -->
<!-- ELSE --> <!-- ELSE -->
<br /> <br />
<div class="message">{L_NO_PLAN}</div> <div class="message">{L_NO_PLAN}</div>
<br /> <br />
<br /> <br />
<!-- ENDIF --> <!-- ENDIF -->

View File

@@ -1,32 +1,32 @@
<div class="panel"> <div class="panel">
<h3><span class="small-icon icon-rank"></span>&nbsp;{L_RANK_MATCHDAY}</h3> <h3><i class="icon fa-trophy fa-fw"></i>{L_RANK_MATCHDAY}</h3>
<!-- IF S_DATA_RANK_MATCHDAY --> <!-- IF S_DATA_RANK_MATCHDAY -->
<table class="forabg rank"> <table class="forabg rank">
<thead> <thead>
<tr> <tr>
<th>{L_RANK_SHORT_DOT}</th> <th>{L_RANK_SHORT_DOT}</th>
<th style="text-align: left;">{L_NAME}</th> <th style="text-align: left;">{L_NAME}</th>
<th>{L_POINTS_SHORT_DOT}</th> <th>{L_POINTS_SHORT_DOT}</th>
<!-- IF S_WIN --> <!-- IF S_WIN -->
<th style="text-align: right;">{WIN_NAME}</th> <th style="text-align: right;">{WIN_NAME}</th>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN rank --> <!-- BEGIN rank -->
<tr class="{rank.ROW_CLASS}" style="cursor:pointer;" title="{L_SHOW_BETS}" onclick="popup('{rank.U_BET_USER}', 725,500,'_{rank.USERNAME}');return false;"> <tr class="{rank.ROW_CLASS}" style="cursor:pointer;" title="{L_SHOW_BETS}" onclick="popup('{rank.U_BET_USER}', 725,500,'_{rank.USERNAME}');return false;">
<td class="td_rank">{rank.RANK}</td> <td class="td_rank">{rank.RANK}</td>
<td class="td_name">{rank.USERNAME}</td> <td class="td_name">{rank.USERNAME}</td>
<td class="td_pts {rank.COLOR_STYLE}">{rank.POINTS}</td> <td class="td_pts {rank.COLOR_STYLE}">{rank.POINTS}</td>
<!-- IF S_WIN --> <!-- IF S_WIN -->
<td class="td_wins">{rank.WIN}</td> <td class="td_wins">{rank.WIN}</td>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
<!-- END rank --> <!-- END rank -->
</tbody> </tbody>
</table> </table>
<!-- ELSE --> <!-- ELSE -->
<div class="message">{L_NO_RESULTS}</div> <div class="message">{L_NO_RESULTS}</div>
<br /> <br />
<!-- ENDIF --> <!-- ENDIF -->
</div > </div >

View File

@@ -1,37 +1,33 @@
<div class="panel"> <div class="panel">
<h3><!-- IF S_VIEW <> 'print' --> <h3><i class="icon fa-trophy fa-fw"></i>{L_RANK_TOTAL}</h3>
<span class="small-icon icon-rank"></span>&nbsp; <!-- IF S_DATA_RANK_TOTAL -->
<!-- ENDIF --> <table class="forabg rank">
{L_RANK_TOTAL} <thead>
</h3> <tr>
<!-- IF S_DATA_RANK_TOTAL --> <th>{L_RANK_SHORT_DOT}</th>
<table class="forabg rank"> <th style="text-align: left;">{L_NAME}</th>
<thead> <th>{L_POINTS_SHORT_DOT}</th>
<tr> <!-- IF S_WIN -->
<th>{L_RANK_SHORT_DOT}</th> <th style="text-align: right;">{WIN_NAME}</th>
<th style="text-align: left;">{L_NAME}</th> <!-- ENDIF -->
<th>{L_POINTS_SHORT_DOT}</th> </tr>
<!-- IF S_WIN --> </thead>
<th style="text-align: right;">{WIN_NAME}</th> <tbody>
<!-- ENDIF --> <!-- BEGIN ranktotal -->
</tr> <tr class="{ranktotal.ROW_CLASS}" style="cursor:pointer;" title="{L_SHOW_PROFILE}"
</thead> onclick="window.location.href='{ranktotal.U_PROFILE}';">
<tbody> <td class="td_rank">{ranktotal.RANK}</td>
<!-- BEGIN ranktotal --> <td class="td_name">{ranktotal.USERNAME}</td>
<tr class="{ranktotal.ROW_CLASS}" style="cursor:pointer;" title="{L_SHOW_PROFILE}" <td class="td_pts {ranktotal.COLOR_STYLE}">{ranktotal.POINTS}</td>
onclick="window.location.href='{ranktotal.U_PROFILE}';"> <!-- IF S_WIN -->
<td class="td_rank">{ranktotal.RANK}</td> <td class="td_wins">{ranktotal.WIN}</td>
<td class="td_name">{ranktotal.USERNAME}</td> <!-- ENDIF -->
<td class="td_pts {ranktotal.COLOR_STYLE}">{ranktotal.POINTS}</td> </tr>
<!-- IF S_WIN --> <!-- END ranktotal -->
<td class="td_wins">{ranktotal.WIN}</td> </tbody>
<!-- ENDIF --> </table>
</tr> <!-- ELSE -->
<!-- END ranktotal --> <div class="message">{L_NO_RESULTS}</div>
</tbody> <br />
</table> <!-- ENDIF -->
<!-- ELSE -->
<div class="message">{L_NO_RESULTS}</div>
<br />
<!-- ENDIF -->
</div> </div>

View File

@@ -1,108 +1,113 @@
<!-- IF S_DATA_RANKS --> <!-- IF S_DATA_RANKS -->
<!-- IF S_HEADER --> <!-- IF S_HEADER -->
<div style="text-align:center"> <div style="text-align:center">
<h3>{S_HEADER}</h3> <h3>{S_HEADER}</h3>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<div class="left-box"> <div class="left-box">
<span class="color_finally">{L_FINALLY}</span> - <span class="color_provisionally">{L_PROVISIONALLY}</span> <span class="color_finally">{L_FINALLY}</span> - <span class="color_provisionally">{L_PROVISIONALLY}</span>
</div> </div>
<!-- IF S_VIEW <> 'print' --> <!-- IF S_VIEW <> 'print' -->
<!-- IF S_VIEW <> 'print' --> <!-- IF S_VIEW <> 'print' -->
<!-- IF .pagination --> <!-- IF .pagination -->
<div class="pagination top-pagination"> <div class="pagination top-pagination">
<!-- INCLUDE pagination.html --> <!-- INCLUDE pagination.html -->
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
<br style="clear:both"/> <br style="clear:both"/>
<div class="forabg"> <div class="forabg">
<table class="football"> <table class="football">
<thead> <thead>
<tr> <tr>
<th>{L_PLACE}</th> <th>{L_PLACE}</th>
<!-- IF not S_HEADER --> <!-- IF not S_HEADER -->
<th title="{L_TEND_RANK}">{L_TENDENCY}</th> <th title="{L_TEND_RANK}">{L_TENDENCY}</th>
<!-- ENDIF --> <!-- ENDIF -->
<th style="text-align:left">{L_NAME}</th> <th style="text-align:left">{L_NAME}</th>
<!-- IF S_LINK_RANKING <> '' and S_LINK_ALL_TIME <> '' --> <!-- IF S_LINK_RANKING <> '' and S_LINK_ALL_TIME <> '' -->
<th>{L_SEASON}</th> <th>{L_SEASON}</th>
<th>{L_PLACE}</th> <th>{L_PLACE}</th>
<!-- ENDIF --> <!-- ENDIF -->
<th title="{L_CNT_BET}">{L_BETS}</th> <th title="{L_CNT_BET}">{L_BETS}</th>
<th title="{L_CNT_NO_BET}">{L_NO_BET}</th> <th title="{L_CNT_NO_BET}">{L_NO_BET}</th>
<th title="{L_CNT_TEND}">{L_TENDENCIES}</th> <th title="{L_CNT_TEND}">{L_TENDENCIES}</th>
<th title="{L_CNT_HIT}">{L_DIRECTHITS}</th> <th title="{L_CNT_HIT}">{L_DIRECTHITS}</th>
<!-- IF not S_HEADER and S_DISPLAY_HITS02 --> <!-- IF not S_HEADER and S_DISPLAY_HITS02 -->
<th title="{L_CNT_HIT02}">{L_DIRECTHITS02}</th> <th title="{L_CNT_HIT02}">{L_DIRECTHITS02}</th>
<!-- ENDIF --> <!-- ENDIF -->
<th style="text-align: right;">{L_POINTS}</th> <th style="text-align: right;">{L_POINTS}</th>
<!-- IF S_WIN --> <!-- IF S_WIN -->
<th style="text-align: right;">{WIN_NAME}</th> <th style="text-align: right;">{WIN_NAME}</th>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- BEGIN rankstotal --> <!-- BEGIN rankstotal -->
<tr class="{rankstotal.ROW_CLASS}" style="cursor:pointer;" title="{L_SHOW_PROFILE}" <tr class="{rankstotal.ROW_CLASS}" style="cursor:pointer;" title="{L_SHOW_PROFILE}"
onclick="window.location.href='{rankstotal.U_PROFILE}';"> onclick="window.location.href='{rankstotal.U_PROFILE}';">
<td class="td_rank">{rankstotal.RANK}</td> <td class="td_rank">{rankstotal.RANK}</td>
<!-- IF not S_HEADER --> <!-- IF not S_HEADER -->
<td><!-- IF S_VIEW == 'print' -->{rankstotal.CHANGE_SIGN}<!-- ELSE -->{rankstotal.CHANGE_IMG}<!-- ENDIF -->{rankstotal.CHANGE_DIFFER}</td> <td><!-- IF S_VIEW == 'print' -->{rankstotal.CHANGE_SIGN}
<!-- ENDIF --> <!-- ELSE --> <!-- IF rankstotal.WORSENED --> <i class="icon fa-arrow-down fa-fw icon-red" aria-hidden="true"></i><!-- ENDIF -->
<td class="td_name">{rankstotal.USERNAME}</td> <!-- IF rankstotal.NO_CHANGES --><i class="icon fa-circle fa-fw icon-gray" aria-hidden="true"></i><!-- ENDIF -->
<!-- IF S_LINK_RANKING <> '' and S_LINK_ALL_TIME <> '' --> <!-- IF rankstotal.IMPROVED --><i class="icon fa-arrow-up fa-fw icon-green" aria-hidden="true"></i><!-- ENDIF -->
<td class="td_hits">{rankstotal.SEASON}</td> <!-- ENDIF -->{rankstotal.CHANGE_DIFFER}
<td class="td_rank">{rankstotal.SEASON_RANK}</td> </td>
<!-- ENDIF --> <!-- ENDIF -->
<td class="td_hits">{rankstotal.BETS}</td> <td class="td_name">{rankstotal.USERNAME}</td>
<td class="td_hits">{rankstotal.NOBETS}</td> <!-- IF S_LINK_RANKING <> '' and S_LINK_ALL_TIME <> '' -->
<td class="td_hits">{rankstotal.TENDENCIES}</td> <td class="td_hits">{rankstotal.SEASON}</td>
<td class="td_hits">{rankstotal.DIRECTHITS}</td> <td class="td_rank">{rankstotal.SEASON_RANK}</td>
<!-- IF not S_HEADER and S_DISPLAY_HITS02 --> <!-- ENDIF -->
<td class="td_hits">{rankstotal.DIRECTHITS02}</td> <td class="td_hits">{rankstotal.BETS}</td>
<!-- ENDIF --> <td class="td_hits">{rankstotal.NOBETS}</td>
<td class="td_pts {rankstotal.COLOR_STYLE}">{rankstotal.POINTS}</td> <td class="td_hits">{rankstotal.TENDENCIES}</td>
<!-- IF S_WIN --> <td class="td_hits">{rankstotal.DIRECTHITS}</td>
<td class="td_wins">{rankstotal.WIN}</td> <!-- IF not S_HEADER and S_DISPLAY_HITS02 -->
<!-- ENDIF --> <td class="td_hits">{rankstotal.DIRECTHITS02}</td>
</tr> <!-- ENDIF -->
<!-- END rankstotal --> <td class="td_pts {rankstotal.COLOR_STYLE}">{rankstotal.POINTS}</td>
</tbody> <!-- IF S_WIN -->
</table> <td class="td_wins">{rankstotal.WIN}</td>
</div> <!-- ENDIF -->
<!-- IF S_SHOW_OTHER_LINKS --> </tr>
<div class="left-box"> <!-- END rankstotal -->
<!-- IF S_LINK_RANKING <> '' --> </tbody>
<a href="{S_LINK_RANKING}" title="{L_TITLE_RANKING}"><strong>{L_RANKING}</strong></a> &bull; </table>
<!-- ENDIF --> </div>
<!-- IF S_LINK_ALL_TIME <> '' --> <!-- IF S_SHOW_OTHER_LINKS -->
<a href="{S_LINK_ALL_TIME}" title="{L_TITLE_RANKING_All_TIME}"><strong>{L_RANKING_ALL_TIME}</strong></a> <div class="left-box">
<!-- ENDIF --> <!-- IF S_LINK_RANKING <> '' -->
<!-- IF S_LINK_ALL_TIME <> '' and S_LINK_COMPARE <> '' --> &bull; <!-- ENDIF --> <a href="{S_LINK_RANKING}" title="{L_TITLE_RANKING}"><strong>{L_RANKING}</strong></a> &bull;
<!-- IF S_LINK_COMPARE <> '' --> <!-- ENDIF -->
<a href="{S_LINK_COMPARE}" title="{L_TITLE_RANKING_COMPARE}"><strong>{L_RANKING_COMPARE}</strong></a> <!-- IF S_LINK_ALL_TIME <> '' -->
<!-- ENDIF --> <a href="{S_LINK_ALL_TIME}" title="{L_TITLE_RANKING_All_TIME}"><strong>{L_RANKING_ALL_TIME}</strong></a>
</div> <!-- ENDIF -->
<!-- ENDIF --> <!-- IF S_LINK_ALL_TIME <> '' and S_LINK_COMPARE <> '' --> &bull; <!-- ENDIF -->
<!-- IF S_LINK_COMPARE <> '' -->
<!-- IF S_VIEW <> 'print' --> <a href="{S_LINK_COMPARE}" title="{L_TITLE_RANKING_COMPARE}"><strong>{L_RANKING_COMPARE}</strong></a>
<!-- IF .pagination or TOTAL_USERS --> <!-- ENDIF -->
<div class="pagination"> </div>
{TOTAL_USERS} <!-- ENDIF -->
<!-- IF .pagination -->
<!-- INCLUDE pagination.html --> <!-- IF S_VIEW <> 'print' -->
<!-- ELSE --> <!-- IF .pagination or TOTAL_USERS -->
&bull; {PAGE_NUMBER} <div class="pagination">
<!-- ENDIF --> {TOTAL_USERS}
</div> <!-- IF .pagination -->
<!-- ENDIF --> <!-- INCLUDE pagination.html -->
<!-- ENDIF --> <!-- ELSE -->
<!-- INCLUDE nav_delivery.html --> &bull; {PAGE_NUMBER}
<!-- ENDIF -->
<!-- ELSE --> </div>
<br /> <!-- ENDIF -->
<div class="message">{L_NO_RESULTS}</div> <!-- ENDIF -->
<br /> <!-- INCLUDE nav_delivery.html -->
<!-- ENDIF -->
<!-- ELSE -->
<br />
<div class="message">{L_NO_RESULTS}</div>
<br />
<!-- ENDIF -->

View File

@@ -0,0 +1,36 @@
<div class="panel">
<h3><i class="icon fa-list-ol fa-fw"></i>{L_TABLE_TOTAL}</h3>
<!-- IF S_DATA_SIDE_TABLE -->
<table class="forabg rank">
<thead>
<tr>
<th>{L_RANK_SHORT}</th>
<th colspan="2" style="text-align: center;">{L_TEAM}</th>
<th>{L_GAMES_SHORT}</th>
<th style="text-align: right;">{L_POINTS_SHORT}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN side_total -->
<!-- IF side_total.GROUP <> '' -->
<tr class="row_group">
<td colspan="12" style="text-align: center;">{side_total.GROUP}</td>
</tr>
<!-- ELSE -->
<tr class="{side_total.ROW_CLASS}" style="cursor:pointer;" title="{L_SHOW_PLAYED}" onclick="popup('{side_total.U_PLAN_TEAM}');return false;">
<td class="td_rank">{side_total.RANK}</td>
<td class="td_logo">{side_total.LOGO}</td>
<td class="td_team">{side_total.TEAM_SHORT}</td>
<td class="td_hits">{side_total.GAMES}</td>
<td class="td_pts">{side_total.POINTS}</td>
</tr>
<!-- ENDIF -->
<!-- END side_total -->
</tbody>
</table>
<!-- ELSE -->
<div class="message">{L_NO_TABLE}</div>
<br />
<!-- ENDIF -->
</div>

View File

@@ -3,6 +3,15 @@
* @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
* ----------------------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------------------- */
.fa-paragraph:before {
font-weight: bold;
content: '§';
}
ul.dropdown-contents i.icon {
display: inline;
float: left;
}
.football-table-scroll { .football-table-scroll {
overflow-x:auto; overflow-x:auto;
@@ -31,34 +40,6 @@
font-size: 0; font-size: 0;
} }
span.small-icon {
display: inline-block;
vertical-align: top;
overflow: hidden;
width: 16px;
height: 14px;
}
.icon-allbets { background-image: url("./images/icon_allbets.gif"); }
.icon-ball { background-image: url("./images/icon_ball.gif"); }
.icon-ball2 { background-image: url("./images/icon_ball2.gif"); }
.icon-bet { background-image: url("./images/icon_bet.gif"); }
.icon-bookmark { background-image: url("./images/icon_bookmark.gif"); }
.icon-download { background-image: url("./images/icon_download.gif"); }
.icon-football { background-image: url("./images/icon_football.gif"); background-repeat: no-repeat; }
.icon-info { background-image: url("./images/icon_info.gif"); }
.icon-list { background-image: url("./images/icon_list.gif"); }
.icon-mark { background-image: url("./images/icon_mark.gif"); }
.icon-odds { background-image: url("./images/icon_odds.gif"); }
.icon-points { background-image: url("./images/icon_points.gif"); }
.icon-print { background-image: url("./images/icon_print.gif"); }
.icon-rank { background-image: url("./images/icon_rank.gif"); }
.icon-results { background-image: url("./images/icon_results.gif"); }
.icon-rules { background-image: url("./images/icon_rules.gif"); }
.icon-statistics { background-image: url("./images/icon_statistics.gif"); }
.icon-xml { background-image: url("./images/icon_xml.gif"); }
/** /**
* Replacement for table layout * Replacement for table layout
*/ */
@@ -163,6 +144,13 @@ div.info {
width: 155px; width: 155px;
} }
.football_nav {
margin-bottom: 5px;
padding: 5px 5px;
clear: both;
line-height:2em;
}
.football_bg { .football_bg {
margin-bottom: 5px; margin-bottom: 5px;
padding: 0 5px; padding: 0 5px;
@@ -266,42 +254,6 @@ a.pastlink:hover, a.futurelink:hover {
text-decoration: underline; text-decoration: underline;
} }
a.football_print {
background-image: url("./images/icon_print.gif");
display: inline-block;
vertical-align: top;
overflow: hidden;
width: 16px;
height: 14px;
}
a.match_info {
display: block;
overflow: hidden;
width: 28px;
height: 28px;
text-indent: -5000px;
text-align: left;
background-repeat: no-repeat;
background-image: url("./images/icon_statistic.gif");
}
a.prev_matchday {
background: transparent url("./images/left_arrow.png") no-repeat scroll 50% 0;
display: inline-block;
overflow: hidden;
width: 16px;
height: 16px;
}
a.next_matchday {
background: transparent url("./images/right_arrow.png") no-repeat scroll 0 0;
display: inline-block;
overflow: hidden;
width: 16px;
height: 16px;
}
.message { .message {
font-weight: bold; font-weight: bold;
color: #AA0000; color: #AA0000;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1022 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1013 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B