3 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
87 changed files with 6034 additions and 5938 deletions

24
.gitignore vendored
View File

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

View File

@@ -219,7 +219,6 @@ class all_bets_module
$split_after = $count_matches;
$splits = 1;
}
$db->sql_freeresult($result);
// Make sure $start is set to the last page if it exceeds the amount
if ($start < 0 || $start >= $total_users)
@@ -311,7 +310,7 @@ class all_bets_module
$total = 0;
}
$bet_index++;
$total += $user_bet['points'];
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
@@ -419,7 +418,7 @@ class all_bets_module
$total = 0;
}
$bet_index++;
$total += $user_bet['points'];
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
@@ -573,7 +572,9 @@ class all_bets_module
)
);
}
$db->sql_freeresult($result_bet);
}
$db->sql_freeresult($result);
$legend = delivery($season, $league, $matchday);

View File

@@ -184,6 +184,7 @@ class bank_module
AND points_type IN (" . POINTS_MATCHDAY . ',' . POINTS_SEASON . ',' . POINTS_MOST_HITS . ',' . POINTS_MOST_HITS_AWAY . ')';
$result = $db->sql_query($sql);
$count_updates += $db->sql_affectedrows();
$db->sql_freeresult($result);
}
else
{
@@ -199,6 +200,7 @@ class bank_module
HAVING win > 0";
$result = $db->sql_query($sql);
$points_ary = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
if (!$default_matchday)
{
$matchday = (curr_matchday($season, $league) > 0) ? curr_matchday($season, $league) : 1;
@@ -351,6 +353,7 @@ class bank_module
AND points_type = $type";
$result = $db->sql_query($sql);
$count_updates += $db->sql_affectedrows();
$db->sql_freeresult($result);
}
$back_link = $this->u_action . '&amp;action=list&amp;s=' . $season . '&amp;l=' . $league . '&amp;t=' . $type . '&amp;start=' . $start;
trigger_error(sprintf($user->lang['LEAGUE_' . $points_var . ($count_updates == 1 ? '' : 'S')], $count_updates) . adm_back_link($back_link));

View File

@@ -325,6 +325,7 @@ class bets_module
}
}
}
$db->sql_freeresult($resultopen);
if ($count_updates > 0)
{
if ($same AND ($count_matches > 6) AND $this->config['football_same_allowed'] == 0)
@@ -358,7 +359,6 @@ class bets_module
{
$success[] = sprintf($user->lang['NO_BETS_SAVED']);
}
$db->sql_freeresult($resultopen);
// extra bets
$sql = 'SELECT * FROM ' . FOOTB_EXTRA . " WHERE season = $season AND league = $league AND matchday = $matchday";
@@ -418,6 +418,7 @@ class bets_module
}
}
}
$db->sql_freeresult($resultextra);
if ($count_extra_updates)
{
$success[] = sprintf($user->lang['EXTRA_BET' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates);
@@ -582,7 +583,8 @@ class bets_module
)
);
}
$db->sql_freeresult($resultopen);
// Calculate extra bets of matchday
// Start select team
$sql = 'SELECT

View File

@@ -151,8 +151,6 @@ class extra_module
$existing_extra = sizeof($extra_row);
$db->sql_freeresult($result);
}
$db->sql_freeresult($result);
// Which page?
switch ($action)
@@ -265,7 +263,7 @@ class extra_module
$matchday_eval_options .= '<option value="' . $row['matchday'] . '"' . $selected_eval . '>' . $day_name . '</option>';
}
}
$db->sql_freeresult($result);
$question_type_options = '';
for($i = 1; $i<= 5; $i++)
{

View File

@@ -77,7 +77,7 @@ class football_module
));
// Pull the array data from the lang pack
foreach ($user->help as $help_ary)
foreach ($user->lang['FOOTBALL_HELP_FAQ'] as $help_ary)
{
if ($help_ary[0] == '--')
{
@@ -107,7 +107,7 @@ class football_module
'football_header_enable' => array('lang' => 'FOOTBALL_HEADER_ENABLE','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_guest_view' => array('lang' => 'GUEST_VIEW', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_user_view' => array('lang' => 'USER_VIEW', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'football_host_timezone' => array('lang' => 'HOST_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'phpbb_timezone_select', 'params' => array($template, $user, '{CONFIG_VALUE}', true), 'explain' => true),
'football_time_shift' => array('lang' => 'TIME_SHIFT', 'validate' => 'int', 'type' => 'select', 'method' => 'time_shift_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true),
'football_info_display' => array('lang' => 'FOOTBALL_INFO', 'validate' => 'bool', 'type' => 'custom', 'method' => 'football_info', 'explain' => true),
'football_info' => false,
'football_win_name' => array('lang' => 'WIN_NAME', 'validate' => 'string', 'type' => 'text:6:6', 'explain' => true),
@@ -120,6 +120,8 @@ class football_module
'legend2' => 'GENERAL_SETTINGS',
'football_left_column_width' => array('lang' => 'LEFT_COLUMN', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'football_right_column_width' => array('lang' => 'RIGHT_COLUMN', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'football_display_last_users' => array('lang' => 'DISPLAY_LAST_USERS', 'validate' => 'int','type' => 'text:3:3', 'explain' => true),
'football_display_last_results' => array('lang' => 'DISPLAY_LAST_RESULTS', 'validate' => 'int','type' => 'text:3:3', 'explain' => true),
'football_display_ranks' => array('lang' => 'DISPLAY_RANKS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'football_users_per_page' => array('lang' => 'USERS_PAGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
@@ -362,7 +364,7 @@ class football_module
}
/**
* Adjust Cronjob EMail remember next un
* Adjust Cronjob EMail remember next run
*/
function next_run($value, $key = '')
{
@@ -419,6 +421,18 @@ class football_module
$year_options . ' ' . $user->lang['HOURS'] . ': ' . $hour_options . ' ' . $user->lang['MINUTES'] . ': ' . $minute_options;
}
function time_shift_select($default = 0)
{
$time_shift_options = "";
for ($i = -23; $i < 24; $i++)
{
$selected = ($i == $default) ? ' selected="selected"' : '';
$time_shift_options .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
}
return $time_shift_options;
}
}
?>

View File

@@ -153,7 +153,6 @@ class leagues_module
$result = $db->sql_query($sql);
if (!($row = $db->sql_fetchrow($result)))
{
$db->sql_freeresult($result);
trigger_error($user->lang['NO_MEMBERS_SELECTED'] . adm_back_link($this->u_action . "&amp;action=list&amp;s=$season&amp;l=$league"), E_USER_WARNING);
}

View File

@@ -323,6 +323,7 @@ class matchdays_module
ORDER BY matchday ASC, number ASC";
$result = $db->sql_query($sql);
$rows_matchdays = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$row_number = 0;
foreach ($rows_matchdays as $row_matchday)
{
@@ -710,7 +711,7 @@ class matchdays_module
if ($data['dday1_day'] <> '--' and $data['dday1_month'] <> '--' and $data['dday1_year'] <> '--')
{
$delivery_timestamp = mktime($data['dday1_hour'], $data['dday1_min'], 0, $data['dday1_month'], $data['dday1_day'], $data['dday1_year']);
$local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600);
$local_board_time = time() + ($this->config['football_time_shift'] * 3600);
if ($delivery_timestamp > $local_board_time AND $matchday_row['status'] == 0)
{
// check if delivery is before all open matches
@@ -764,6 +765,7 @@ class matchdays_module
// reopen matchday
$matchday_row['status'] = 0;
}
$db->sql_freeresult($result);
}
}
else

View File

@@ -413,7 +413,7 @@ class matches_module
if ($data['mday_day'] <> '--' and $data['mday_month'] <> '--' and $data['mday_year'] <> '--')
{
$match_timestamp = mktime($data['mday_hour'], $data['mday_min'], 0, $data['mday_month'], $data['mday_day'], $data['mday_year']);
$local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600);
$local_board_time = time() + ($this->config['football_time_shift'] * 3600);
if ($match_timestamp > $local_board_time AND $match_row['status'] < 3 AND $league_info['bet_in_time'] == 1)
{
// Bet in time and match moved to future
@@ -627,7 +627,7 @@ class matches_module
$selected_home = ($home_id && $row['team_id'] == $home_id) ? ' selected="selected"' : '';
$team_home_options .= '<option value="' . $row['group_id'] . ';' . $row['team_id'] .'"' . $selected_home . '>' . $row['team_name'] . '</option>';
}
$db->sql_freeresult($result);
$u_back = $this->u_action . "&amp;s=$season&amp;l=$league&amp;m=$matchday";
$template->assign_vars(array(

View File

@@ -192,7 +192,7 @@ class results_module
{
trigger_error(sprintf($user->lang['NO_MATCHDAY'], $league_info['league_name'], $season) . adm_back_link($this->u_action . "&amp;s=$season&amp;l=$league"), E_USER_WARNING);
}
$local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600);
$local_board_time = time() + ($this->config['football_time_shift'] * 3600);
// Which page?
switch ($action)
@@ -382,6 +382,7 @@ class results_module
}
}
}
$db->sql_freeresult($resultextra);
if ($count_extra_updates)
{
$success[] = sprintf($user->lang['EXTRA_RESULT' . (($count_extra_updates == 1) ? '' : 'S') . '_SAVED'], $count_extra_updates);
@@ -768,6 +769,7 @@ class results_module
);
}
}
$db->sql_freeresult($result);
switch ($league_info['bet_ko_type'])
{

View File

@@ -397,6 +397,7 @@ class update_module
{
$error[] = sprintf($user->lang['MISMATCH_MATCHDAYS'], $row['matchdays']);
}
$db->sql_freeresult($result);
$sql = 'SELECT COUNT(match_no) as matches
FROM ' . FOOTB_MATCHES . "
@@ -414,6 +415,7 @@ class update_module
{
$error[] = sprintf($user->lang['MISMATCH_MATCHES'], $row['matches']);
}
$db->sql_freeresult($result);
if (!sizeof($error))
{
@@ -547,6 +549,7 @@ class update_module
$count_updates++;
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
}
$db->sql_freeresult($result);
if ($effected_matchdays <> '')
{
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
@@ -591,6 +594,7 @@ class update_module
$count_updates++;
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
}
$db->sql_freeresult($result);
if ($effected_matchdays <> '')
{
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
@@ -635,6 +639,7 @@ class update_module
$count_updates++;
$effected_matchdays = ($effected_matchdays == '') ? $row['matchday'] : $effected_matchdays . ', ' . $row['matchday'];
}
$db->sql_freeresult($result);
if ($effected_matchdays <> '')
{
$sql = 'REPLACE INTO ' . FOOTB_MATCHDAYS . ' (season, league, matchday, status, delivery_date, delivery_date_2, delivery_date_3, matchday_name, matches)
@@ -662,7 +667,7 @@ class update_module
}
// check status of matchdays
$local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600);
$local_board_time = time() + ($this->config['football_time_shift'] * 3600);
$sql = $sql = 'UPDATE ' . FOOTB_MATCHDAYS . " AS target
INNER JOIN
(
@@ -1382,6 +1387,7 @@ class update_module
}
}
}
$db->sql_freeresult($result);
return $count_updates;
}

View File

@@ -78,7 +78,6 @@ else
$splits = 1;
}
}
$db->sql_freeresult($result);
// Make sure $start is set to the last page if it exceeds the amount
if ($start < 0 || $start >= $total_users)
@@ -183,7 +182,7 @@ foreach ($matches AS $match)
$total = 0;
}
$bet_index++;
$total += $user_bet['points'];
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
@@ -306,7 +305,7 @@ if ($count_matches > 0)
$total = 0;
}
$bet_index++;
$total += $user_bet['points'];
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
@@ -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']);
$template->assign_vars(array(
'S_DISPLAY_ALL_BETS' => true,
'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&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_SPALTEN' => ($count_matches * 2) + 2,
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -15,7 +15,7 @@ $data_delivery = false;
$user_id = $user->data['user_id'];
$lang_dates = $user->lang['datetime'];
$index = 0;
$local_board_time = time() + (($config['board_timezone'] - $config['football_host_timezone']) * 3600);
$local_board_time = time() + ($config['football_time_shift'] * 3600);
$sql = "SELECT
m.season,
m.league,

View File

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

View File

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

View File

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

150
block/last_results.php Normal file
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,66 +1,66 @@
<?php
/**
*
* @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
$display_last_users = false;
// Last 5 users
$sql = 'SELECT s.session_user_id
, u.username
, u.user_colour
, u.user_lastvisit
, 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(CONCAT(s.session_time,s.session_browser)), "") AS session_browser
FROM ' . USERS_TABLE . ' AS u
LEFT JOIN ' . SESSIONS_TABLE . ' AS s ON (u.user_id = s.session_user_id)
WHERE u.user_lastvisit > 0
AND u.user_type IN (0,3)
GROUP BY u.user_id
ORDER BY lastvisit DESC';
$result = $db->sql_query_limit($sql, 5);
$first = true;
while ($row = $db->sql_fetchrow($result))
{
if (!$row['lastvisit'] && $first == true)
{
$display_last_users = false;
}
else
{
$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 = ' (' . $match_browser[0] . ')';
}
$template->assign_block_vars('last_users', array(
'USER_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']) . $browser,
'LAST_VISIT_DATE' => $user->format_date($row['lastvisit']),
));
}
}
$first = false;
}
$db->sql_freeresult($result);
// Assign specific vars
$template->assign_vars(array(
'LAST_USERS' => sprintf($user->lang['LAST_VISITORS'], 5),
'S_DISPLAY_LAST_USERS' => $display_last_users,
'S_LAST_USERS' => true,
));
<?php
/**
*
* @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
$display_last_users = false;
// Last users
$sql = 'SELECT s.session_user_id
, u.username
, u.user_colour
, u.user_lastvisit
, 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(CONCAT(s.session_time,s.session_browser)), "") AS session_browser
FROM ' . USERS_TABLE . ' AS u
LEFT JOIN ' . SESSIONS_TABLE . ' AS s ON (u.user_id = s.session_user_id)
WHERE u.user_lastvisit > 0
AND u.user_type IN (0,3)
GROUP BY u.user_id
ORDER BY lastvisit DESC';
$result = $db->sql_query_limit($sql, $config['football_display_last_users']);
$first = true;
while ($row = $db->sql_fetchrow($result))
{
if (!$row['lastvisit'] && $first == true)
{
$display_last_users = false;
}
else
{
$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 = ' (' . $match_browser[0] . ')';
}
$template->assign_block_vars('last_users', array(
'USER_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']) . $browser,
'LAST_VISIT_DATE' => $user->format_date($row['lastvisit']),
));
}
}
$first = false;
}
$db->sql_freeresult($result);
// Assign specific vars
$template->assign_vars(array(
'LAST_USERS' => sprintf($user->lang['LAST_VISITORS'], $config['football_display_last_users']),
'S_DISPLAY_LAST_USERS' => $display_last_users,
'S_LAST_USERS' => true,
));
?>

View File

@@ -1,332 +1,324 @@
<?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;
}
if (!$user_sel)
{
if (user_is_member($user->data['user_id'], $season, $league))
{
$user_sel = $user->data['user_id'];
}
}
$username = '';
$data = false;
// select user
$sql = 'SELECT DISTINCT
u.user_id,
u.username
FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE season = $season AND league = $league
ORDER BY LOWER(u.username) ASC";
$numb_users = 0;
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$numb_users++;
$data = true;
if ($user_sel == $row['user_id'] OR !$user_sel)
{
$selectid = ' selected="selected"';
$username = $row['username'];
$user_sel = $row['user_id'];
}
else
{
$selectid = '';
}
$template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid,
)
);
}
$db->sql_freeresult($result);
// All bets of selected user group by bet
$rank = 0;
$bets_home_win = 0;
$bets_draw = 0;
$bets_guest_win = 0;
$win_home_win = 0;
$win_draw = 0;
$win_guest_win = 0;
$points_home_win = 0;
$points_draw = 0;
$points_guest_win = 0;
$sql = 'SELECT
COUNT(b.match_no) AS bets,
b.goals_home,
b.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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)
)
) AS hits,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
)
) AS tendencies,
' . select_points('m',true) . '
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)
WHERE b.season = $season
AND b.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.status = 3
AND b.user_id = $user_sel
AND m.matchday <= $matchday
GROUP by b.goals_home, b.goals_guest
ORDER by bets DESC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
if ($row['goals_home'] > $row['goals_guest'])
{
$bets_home_win += $row['bets'];
$win_home_win += $row['hits'] + $row['tendencies'];
$points_home_win += $row['points'];
}
if ($row['goals_home'] == $row['goals_guest'])
{
$bets_draw += $row['bets'];
$win_draw += $row['hits'] + $row['tendencies'];
$points_draw += $row['points'];
}
if ($row['goals_home'] < $row['goals_guest'])
{
$bets_guest_win += $row['bets'];
$win_guest_win += $row['hits'] + $row['tendencies'];
$points_guest_win += $row['points'];
}
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('bets', array(
'ROW_CLASS' => $row_class,
'GOALSHOME' => $row['goals_home'],
'GOALSGUEST' => $row['goals_guest'],
'COUNT' => $row['bets'],
'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'],
'AVERAGE' => round($row['points'] / $row['bets'],1),
)
);
}
$db->sql_freeresult($result);
// Tendencies of all results
$sql = "SELECT
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 + 0 < goals_guest,1,0)) AS SUM_GUEST_WIN
FROM " . FOOTB_MATCHES . "
WHERE season = $season
AND league = $league
AND status = 3
AND matchday <= $matchday";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['PLAYED']),
'HOMEWIN' => $row['SUM_HOME_WIN'],
'DRAW' => $row['SUM_DRAW'],
'GUESTWIN' => $row['SUM_GUEST_WIN'],
)
);
// Muliply with user of this league
$template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['PLAYED']),
'HOMEWIN' => $row['SUM_HOME_WIN'] * $numb_users,
'DRAW' => $row['SUM_DRAW'] * $numb_users,
'GUESTWIN' => $row['SUM_GUEST_WIN'] * $numb_users,
)
);
}
$db->sql_freeresult($result);
// Count tendencies (bets of selected user)
$template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg1 row_light',
'SCORE' => sprintf($user->lang['GUESSED']),
'HOMEWIN' => $bets_home_win,
'DRAW' => $bets_draw,
'GUESTWIN' => $bets_guest_win,
)
);
// Scored with tendency (bets of selected user)
$template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['SCORED']),
'HOMEWIN' => $win_home_win,
'DRAW' => $win_draw,
'GUESTWIN' => $win_guest_win,
)
);
// Points with tendency (bets of selected user)
$template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg1 row_light',
'SCORE' => sprintf($user->lang['POINTS']),
'HOMEWIN' => $points_home_win,
'DRAW' => $points_draw,
'GUESTWIN' => $points_guest_win,
)
);
// All bets of all users group by bet
$rank = 0;
$bets_home_win = 0;
$bets_draw = 0;
$bets_guest_win = 0;
$win_home_win = 0;
$win_draw = 0;
$win_guest_win = 0;
$points_home_win = 0;
$points_draw = 0;
$points_guest_win = 0;
$sql = 'SELECT
COUNT(b.match_no) AS bets,
b.goals_home,
b.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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)
)
) AS hits,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
)
) AS tendencies,
' . select_points('m',true) . '
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)
WHERE b.season = $season
AND b.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.status = 3
AND m.matchday <= $matchday
GROUP by b.goals_home, b.goals_guest
ORDER by bets DESC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
if ($row['goals_home'] > $row['goals_guest'])
{
$bets_home_win += $row['bets'];
$win_home_win += $row['hits'] + $row['tendencies'];
$points_home_win += $row['points'];
}
if ($row['goals_home'] == $row['goals_guest'])
{
$bets_draw += $row['bets'];
$win_draw += $row['hits'] + $row['tendencies'];
$points_draw += $row['points'];
}
if ($row['goals_home'] < $row['goals_guest'])
{
$bets_guest_win += $row['bets'];
$win_guest_win += $row['hits'] + $row['tendencies'];
$points_guest_win += $row['points'];
}
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('allbets', array(
'ROW_CLASS' => $row_class,
'GOALSHOME' => $row['goals_home'],
'GOALSGUEST' => $row['goals_guest'],
'COUNT' => $row['bets'],
'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'],
'AVERAGE' => round($row['points'] / $row['bets'],1),
)
);
}
$db->sql_freeresult($result);
// Count tendencies (bets of all user)
$template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['GUESSED']),
'HOMEWIN' => $bets_home_win,
'DRAW' => $bets_draw,
'GUESTWIN' => $bets_guest_win,
)
);
// Scored with tendency (bets of all user)
$template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg1 row_light',
'SCORE' => sprintf($user->lang['SCORED']),
'HOMEWIN' => $win_home_win,
'DRAW' => $win_draw,
'GUESTWIN' => $win_guest_win,
)
);
// Points with tendency (bets of all user)
$template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['POINTS']),
'HOMEWIN' => $points_home_win,
'DRAW' => $points_draw,
'GUESTWIN' => $points_guest_win,
)
);
$sidename = sprintf($user->lang['MY_BETS']);
$template->assign_vars(array(
'S_DISPLAY_MY_BETS' => true,
'S_SIDENAME' => $sidename,
'U_LEFT' => ($config['football_bank']) ? $this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league, 'm' => $matchday)) :
$this->helper->route('football_main_controller', array('side' => 'ranks_total', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => ($config['football_bank']) ? '&lt; ' . sprintf($user->lang['FOOTBALL_BANK']) :
'&lt; ' . sprintf($user->lang['RANK_TOTAL']),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_points', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => sprintf($user->lang['MY_POINTS']) . ' &gt;',
'LEFT_TITLE' => ($config['football_bank']) ? sprintf($user->lang['TITLE_FOOTBALL_BANK']) : sprintf($user->lang['TITLE_RANK_TOTAL']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_POINTS']),
'S_DATA_MY_BETS' => $data,
'SEASON' => $season,
'LEAGUE' => $league,
'USERNAME' => $username,
)
);
<?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;
}
if (!$user_sel)
{
if (user_is_member($user->data['user_id'], $season, $league))
{
$user_sel = $user->data['user_id'];
}
}
$username = '';
$data = false;
// select user
$sql = 'SELECT DISTINCT
u.user_id,
u.username
FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE season = $season AND league = $league
ORDER BY LOWER(u.username) ASC";
$numb_users = 0;
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$numb_users++;
$data = true;
if ($user_sel == $row['user_id'] OR !$user_sel)
{
$selectid = ' selected="selected"';
$username = $row['username'];
$user_sel = $row['user_id'];
}
else
{
$selectid = '';
}
$template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid,
)
);
}
$db->sql_freeresult($result);
// All bets of selected user group by bet
$rank = 0;
$bets_home_win = 0;
$bets_draw = 0;
$bets_guest_win = 0;
$win_home_win = 0;
$win_draw = 0;
$win_guest_win = 0;
$points_home_win = 0;
$points_draw = 0;
$points_guest_win = 0;
$sql = 'SELECT
COUNT(b.match_no) AS bets,
b.goals_home,
b.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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)
)
) AS hits,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
)
) AS tendencies,
' . select_points('m',true) . '
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)
WHERE b.season = $season
AND b.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.status = 3
AND b.user_id = $user_sel
AND m.matchday <= $matchday
GROUP by b.goals_home, b.goals_guest
ORDER by bets DESC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
if ($row['goals_home'] > $row['goals_guest'])
{
$bets_home_win += $row['bets'];
$win_home_win += $row['hits'] + $row['tendencies'];
$points_home_win += $row['points'];
}
if ($row['goals_home'] == $row['goals_guest'])
{
$bets_draw += $row['bets'];
$win_draw += $row['hits'] + $row['tendencies'];
$points_draw += $row['points'];
}
if ($row['goals_home'] < $row['goals_guest'])
{
$bets_guest_win += $row['bets'];
$win_guest_win += $row['hits'] + $row['tendencies'];
$points_guest_win += $row['points'];
}
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('bets', array(
'ROW_CLASS' => $row_class,
'GOALSHOME' => $row['goals_home'],
'GOALSGUEST' => $row['goals_guest'],
'COUNT' => $row['bets'],
'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'],
'AVERAGE' => round($row['points'] / $row['bets'],1),
)
);
}
$db->sql_freeresult($result);
// Tendencies of all results
$sql = "SELECT
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 + 0 < goals_guest,1,0)) AS SUM_GUEST_WIN
FROM " . FOOTB_MATCHES . "
WHERE season = $season
AND league = $league
AND status = 3
AND matchday <= $matchday";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['PLAYED']),
'HOMEWIN' => $row['SUM_HOME_WIN'],
'DRAW' => $row['SUM_DRAW'],
'GUESTWIN' => $row['SUM_GUEST_WIN'],
)
);
// Muliply with user of this league
$template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['PLAYED']),
'HOMEWIN' => $row['SUM_HOME_WIN'] * $numb_users,
'DRAW' => $row['SUM_DRAW'] * $numb_users,
'GUESTWIN' => $row['SUM_GUEST_WIN'] * $numb_users,
)
);
}
$db->sql_freeresult($result);
// Count tendencies (bets of selected user)
$template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg1 row_light',
'SCORE' => sprintf($user->lang['GUESSED']),
'HOMEWIN' => $bets_home_win,
'DRAW' => $bets_draw,
'GUESTWIN' => $bets_guest_win,
)
);
// Scored with tendency (bets of selected user)
$template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['SCORED']),
'HOMEWIN' => $win_home_win,
'DRAW' => $win_draw,
'GUESTWIN' => $win_guest_win,
)
);
// Points with tendency (bets of selected user)
$template->assign_block_vars('bets_wdl', array(
'ROW_CLASS' => 'bg1 row_light',
'SCORE' => sprintf($user->lang['POINTS']),
'HOMEWIN' => $points_home_win,
'DRAW' => $points_draw,
'GUESTWIN' => $points_guest_win,
)
);
// All bets of all users group by bet
$rank = 0;
$bets_home_win = 0;
$bets_draw = 0;
$bets_guest_win = 0;
$win_home_win = 0;
$win_draw = 0;
$win_guest_win = 0;
$points_home_win = 0;
$points_draw = 0;
$points_guest_win = 0;
$sql = 'SELECT
COUNT(b.match_no) AS bets,
b.goals_home,
b.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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)
)
) AS hits,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
)
) AS tendencies,
' . select_points('m',true) . '
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)
WHERE b.season = $season
AND b.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.status = 3
AND m.matchday <= $matchday
GROUP by b.goals_home, b.goals_guest
ORDER by bets DESC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
if ($row['goals_home'] > $row['goals_guest'])
{
$bets_home_win += $row['bets'];
$win_home_win += $row['hits'] + $row['tendencies'];
$points_home_win += $row['points'];
}
if ($row['goals_home'] == $row['goals_guest'])
{
$bets_draw += $row['bets'];
$win_draw += $row['hits'] + $row['tendencies'];
$points_draw += $row['points'];
}
if ($row['goals_home'] < $row['goals_guest'])
{
$bets_guest_win += $row['bets'];
$win_guest_win += $row['hits'] + $row['tendencies'];
$points_guest_win += $row['points'];
}
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('allbets', array(
'ROW_CLASS' => $row_class,
'GOALSHOME' => $row['goals_home'],
'GOALSGUEST' => $row['goals_guest'],
'COUNT' => $row['bets'],
'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'],
'AVERAGE' => round($row['points'] / $row['bets'],1),
)
);
}
$db->sql_freeresult($result);
// Count tendencies (bets of all user)
$template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['GUESSED']),
'HOMEWIN' => $bets_home_win,
'DRAW' => $bets_draw,
'GUESTWIN' => $bets_guest_win,
)
);
// Scored with tendency (bets of all user)
$template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg1 row_light',
'SCORE' => sprintf($user->lang['SCORED']),
'HOMEWIN' => $win_home_win,
'DRAW' => $win_draw,
'GUESTWIN' => $win_guest_win,
)
);
// Points with tendency (bets of all user)
$template->assign_block_vars('bets_wdl_all', array(
'ROW_CLASS' => 'bg2 row_dark',
'SCORE' => sprintf($user->lang['POINTS']),
'HOMEWIN' => $points_home_win,
'DRAW' => $points_draw,
'GUESTWIN' => $points_guest_win,
)
);
$sidename = sprintf($user->lang['MY_BETS']);
$template->assign_vars(array(
'S_DISPLAY_MY_BETS' => true,
'S_SIDENAME' => $sidename,
'S_DATA_MY_BETS' => $data,
'SEASON' => $season,
'LEAGUE' => $league,
'USERNAME' => $username,
)
);
?>

View File

@@ -1,339 +1,334 @@
<?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 = false;
$user1 = '';
$user2 = '';
$user3 = '';
$user4 = '';
$username = '';
$username2 = '';
$username3 = '';
$username4 = '';
// Calculate rank total
$sql = 'SELECT
r.user_id,
u.username,
SUM(r.points) AS points_total
FROM ' . FOOTB_RANKS . ' AS r
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
WHERE r.season = $season
AND r.league = $league
AND r.matchday <= $matchday
GROUP BY r.user_id
ORDER BY points_total DESC, LOWER(u.username) ASC";
$result = $db->sql_query($sql);
$current_ranks = $db->sql_fetchrowset($result);
$total_users = sizeof($current_ranks);
if ($total_users > 3 AND $total_users <= 50)
{
$data = true;
$middle = round($total_users / 2,0);
// If user = leader then first = seconde
$user_first = $current_ranks[0]['user_id'];
if ($user_first == $user->data['user_id'])
$user_first = $current_ranks[1]['user_id'];
// If user = middle then middle = middle - 1
$user_middle = $current_ranks[$middle-1]['user_id'];
if ($user_middle == $user->data['user_id'])
$user_middle = $current_ranks[$middle]['user_id'];
// If user = last then last = last but one
$user_last = $current_ranks[$total_users - 1]['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))
{
// Take user, leader, middle and last
$user1 = $this->request->variable('user1', $user->data['user_id']);
$user2 = $this->request->variable('user2', $user_first);
$user3 = $this->request->variable('user3', $user_middle);
$user4 = $this->request->variable('user4', $user_last);
}
else
{
// Only take leader, middle and last
$user1 = $this->request->variable('user1', $user_first);
$user2 = $this->request->variable('user2', $user_middle);
$user3 = $this->request->variable('user3', $user_last);
$user4 = $this->request->variable('user4', 0);
}
// Add empty choice
$template->assign_block_vars('form_user2', array(
'S_USERNAME' => sprintf($user->lang['OPTION_USER']),
'S_USERID' => 0,
'S_SELECTEDID2' => '',
)
);
$template->assign_block_vars('form_user3', array(
'S_USERNAME' => sprintf($user->lang['OPTION_USER']),
'S_USERID' => 0,
'S_SELECTEDID3' => '',
)
);
$template->assign_block_vars('form_user4', array(
'S_USERNAME' => sprintf($user->lang['OPTION_USER']),
'S_USERID' => 0,
'S_SELECTEDID4' => '',
)
);
// Start select user
foreach ($current_ranks as $rank_user)
{
$curr_userid =$rank_user['user_id'];
if ($user1 == $curr_userid)
{
$selectid1 = ' selected="selected"';
$username = $rank_user['username'];
}
else
{
$selectid1 = '';
}
if ($user2 == $curr_userid)
{
$selectid2 = ' selected="selected"';
$username2 = $rank_user['username'];
}
else
{
$selectid2 = '';
}
if ($user3 == $curr_userid)
{
$selectid3 = ' selected="selected"';
$username3 = $rank_user['username'];
}
else
{
$selectid3 = '';
}
if ($user4 == $curr_userid)
{
$selectid4 = ' selected="selected"';
$username4 = $rank_user['username'];
}
else
{
$selectid4 = '';
}
if ($curr_userid != $user2 AND $curr_userid != $user3 AND $curr_userid != $user4)
$template->assign_block_vars('form_user1', array(
'S_USERNAME' => $rank_user['username'],
'S_USERID' => $curr_userid,
'S_SELECTEDID' => $selectid1));
if ($curr_userid != $user1 AND $curr_userid != $user3 AND $curr_userid != $user4)
$template->assign_block_vars('form_user2', array(
'S_USERNAME' => $rank_user['username'],
'S_USERID' => $curr_userid,
'S_SELECTEDID' => $selectid2));
if ($curr_userid != $user1 AND $curr_userid != $user2 AND $curr_userid != $user4)
$template->assign_block_vars('form_user3', array(
'S_USERNAME' => $rank_user['username'],
'S_USERID' => $curr_userid,
'S_SELECTEDID' => $selectid3));
if ($curr_userid != $user1 AND $curr_userid != $user2 AND $curr_userid != $user3)
$template->assign_block_vars('form_user4', array(
'S_USERNAME' => $rank_user['username'],
'S_USERID' => $curr_userid,
'S_SELECTEDID' => $selectid4));
}
$ranks_total_1 = '';
$ranks_dayl_1 = '';
$points_1 = '';
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
AND user_id = $user1
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$points_1 = $points_1. $row['points']. ',';
$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);
$ranks_dayl_1 = substr($ranks_dayl_1, 0, strlen($ranks_dayl_1) - 1);
$db->sql_freeresult($result);
$ranks_total_2 = '';
$ranks_dayl_2 = '';
$points_2 = '';
if ($user2 != 0)
{
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
AND user_id = $user2
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$points_2 = $points_2 . $row['points']. ',';
$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);
$ranks_dayl_2 = substr($ranks_dayl_2, 0, strlen($ranks_dayl_2) - 1);
$db->sql_freeresult($result);
}
$ranks_total_3 = '';
$ranks_dayl_3 = '';
$points_3 = '';
if ($user3 != 0)
{
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
AND user_id = $user3
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$points_3 = $points_3. $row['points']. ',';
$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);
$ranks_dayl_3 = substr($ranks_dayl_3,0,strlen($ranks_dayl_3)-1);
$db->sql_freeresult($result);
}
$ranks_total_4 = '';
$ranks_dayl_4 = '';
$points_4 = '';
if ($user4 != 0)
{
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
AND user_id = $user4
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$points_4 = $points_4. $row['points']. ',';
$sptagplatz = $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);
$ranks_dayl_4 = substr($ranks_dayl_4,0,strlen($ranks_dayl_4)-1);
$db->sql_freeresult($result);
}
$min = '';
$max = '';
if ($user1 != 0)
{
$sql = 'SELECT
MIN(points) As points_min,
MAX(points) As points_max
FROM ' . FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
GROUP BY matchday
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$min = $min. $row['points_min']. ',';
$max = $max. $row['points_max']. ',';
}
$min = substr($min,0,strlen($min)-1);
$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
. "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['PLACE']) . "' alt='"
. sprintf($user->lang['CHART_TOTAL'])
. "'/>";
$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="
. sprintf($user->lang['PLACE']) . "' alt='"
. sprintf($user->lang['CHART_MATCHDAY'])
. "'/>";
$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="
. sprintf($user->lang['POINTS']) . ',' . sprintf($user->lang['BANDWIDTH']) . "' alt='"
. sprintf($user->lang['CHART_POINTS'])
. "'/>";
$template->assign_block_vars('chart_points', array(
'CHARTIMAGE' => $chart,
)
);
}
$sidename = sprintf($user->lang['MY_CHART']);
$template->assign_vars(array(
'S_DISPLAY_MY_CHART' => true,
'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_rank', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_RANK']),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => sprintf($user->lang['MY_KOEFF']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_RANKS']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_KOEFF']),
'S_DATA_MY_CHART' => $data,
'SEASON' => $season,
'LEAGUE' => $league,
'S_USER1' => $user1,
'S_USER2' => $user2,
'S_USER3' => $user3,
'S_USER4' => $user4,
'USERNAME1' => $username,
'USERNAME2' => $username2,
'USERNAME3' => $username3,
'USERNAME4' => $username4,
)
);
<?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 = false;
$user1 = '';
$user2 = '';
$user3 = '';
$user4 = '';
$username = '';
$username2 = '';
$username3 = '';
$username4 = '';
// Calculate rank total
$sql = 'SELECT
r.user_id,
u.username,
SUM(r.points) AS points_total
FROM ' . FOOTB_RANKS . ' AS r
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
WHERE r.season = $season
AND r.league = $league
AND r.matchday <= $matchday
GROUP BY r.user_id
ORDER BY points_total DESC, LOWER(u.username) ASC";
$result = $db->sql_query($sql);
$current_ranks = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$total_users = sizeof($current_ranks);
if ($total_users > 3 AND $total_users <= 50)
{
$data = true;
$middle = round($total_users / 2,0);
// If user = leader then first = seconde
$user_first = $current_ranks[0]['user_id'];
if ($user_first == $user->data['user_id'])
$user_first = $current_ranks[1]['user_id'];
// If user = middle then middle = middle - 1
$user_middle = $current_ranks[$middle-1]['user_id'];
if ($user_middle == $user->data['user_id'])
$user_middle = $current_ranks[$middle]['user_id'];
// If user = last then last = last but one
$user_last = $current_ranks[$total_users - 1]['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))
{
// Take user, leader, middle and last
$user1 = $this->request->variable('user1', $user->data['user_id']);
$user2 = $this->request->variable('user2', $user_first);
$user3 = $this->request->variable('user3', $user_middle);
$user4 = $this->request->variable('user4', $user_last);
}
else
{
// Only take leader, middle and last
$user1 = $this->request->variable('user1', $user_first);
$user2 = $this->request->variable('user2', $user_middle);
$user3 = $this->request->variable('user3', $user_last);
$user4 = $this->request->variable('user4', 0);
}
// Add empty choice
$template->assign_block_vars('form_user2', array(
'S_USERNAME' => sprintf($user->lang['OPTION_USER']),
'S_USERID' => 0,
'S_SELECTEDID2' => '',
)
);
$template->assign_block_vars('form_user3', array(
'S_USERNAME' => sprintf($user->lang['OPTION_USER']),
'S_USERID' => 0,
'S_SELECTEDID3' => '',
)
);
$template->assign_block_vars('form_user4', array(
'S_USERNAME' => sprintf($user->lang['OPTION_USER']),
'S_USERID' => 0,
'S_SELECTEDID4' => '',
)
);
// Start select user
foreach ($current_ranks as $rank_user)
{
$curr_userid =$rank_user['user_id'];
if ($user1 == $curr_userid)
{
$selectid1 = ' selected="selected"';
$username = $rank_user['username'];
}
else
{
$selectid1 = '';
}
if ($user2 == $curr_userid)
{
$selectid2 = ' selected="selected"';
$username2 = $rank_user['username'];
}
else
{
$selectid2 = '';
}
if ($user3 == $curr_userid)
{
$selectid3 = ' selected="selected"';
$username3 = $rank_user['username'];
}
else
{
$selectid3 = '';
}
if ($user4 == $curr_userid)
{
$selectid4 = ' selected="selected"';
$username4 = $rank_user['username'];
}
else
{
$selectid4 = '';
}
if ($curr_userid != $user2 AND $curr_userid != $user3 AND $curr_userid != $user4)
$template->assign_block_vars('form_user1', array(
'S_USERNAME' => $rank_user['username'],
'S_USERID' => $curr_userid,
'S_SELECTEDID' => $selectid1));
if ($curr_userid != $user1 AND $curr_userid != $user3 AND $curr_userid != $user4)
$template->assign_block_vars('form_user2', array(
'S_USERNAME' => $rank_user['username'],
'S_USERID' => $curr_userid,
'S_SELECTEDID' => $selectid2));
if ($curr_userid != $user1 AND $curr_userid != $user2 AND $curr_userid != $user4)
$template->assign_block_vars('form_user3', array(
'S_USERNAME' => $rank_user['username'],
'S_USERID' => $curr_userid,
'S_SELECTEDID' => $selectid3));
if ($curr_userid != $user1 AND $curr_userid != $user2 AND $curr_userid != $user3)
$template->assign_block_vars('form_user4', array(
'S_USERNAME' => $rank_user['username'],
'S_USERID' => $curr_userid,
'S_SELECTEDID' => $selectid4));
}
$ranks_total_1 = '';
$ranks_dayl_1 = '';
$points_1 = '';
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
AND user_id = $user1
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$points_1 = $points_1. $row['points']. ',';
$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);
$ranks_dayl_1 = substr($ranks_dayl_1, 0, strlen($ranks_dayl_1) - 1);
$db->sql_freeresult($result);
$ranks_total_2 = '';
$ranks_dayl_2 = '';
$points_2 = '';
if ($user2 != 0)
{
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
AND user_id = $user2
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$points_2 = $points_2 . $row['points']. ',';
$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);
$ranks_dayl_2 = substr($ranks_dayl_2, 0, strlen($ranks_dayl_2) - 1);
$db->sql_freeresult($result);
}
$ranks_total_3 = '';
$ranks_dayl_3 = '';
$points_3 = '';
if ($user3 != 0)
{
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
AND user_id = $user3
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$points_3 = $points_3. $row['points']. ',';
$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);
$ranks_dayl_3 = substr($ranks_dayl_3,0,strlen($ranks_dayl_3)-1);
$db->sql_freeresult($result);
}
$ranks_total_4 = '';
$ranks_dayl_4 = '';
$points_4 = '';
if ($user4 != 0)
{
$sql = 'SELECT *
FROM ' . FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
AND user_id = $user4
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$points_4 = $points_4. $row['points']. ',';
$sptagplatz = $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);
$ranks_dayl_4 = substr($ranks_dayl_4,0,strlen($ranks_dayl_4)-1);
$db->sql_freeresult($result);
}
$min = '';
$max = '';
if ($user1 != 0)
{
$sql = 'SELECT
MIN(points) As points_min,
MAX(points) As points_max
FROM ' . FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday <= $matchday
GROUP BY matchday
ORDER BY matchday ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$min = $min. $row['points_min']. ',';
$max = $max. $row['points_max']. ',';
}
$min = substr($min,0,strlen($min)-1);
$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
. "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['PLACE']) . "' alt='"
. sprintf($user->lang['CHART_TOTAL'])
. "'/>";
$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="
. sprintf($user->lang['PLACE']) . "' alt='"
. sprintf($user->lang['CHART_MATCHDAY'])
. "'/>";
$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="
. sprintf($user->lang['POINTS']) . ',' . sprintf($user->lang['BANDWIDTH']) . "' alt='"
. sprintf($user->lang['CHART_POINTS'])
. "'/>";
$template->assign_block_vars('chart_points', array(
'CHARTIMAGE' => $chart,
)
);
}
$sidename = sprintf($user->lang['MY_CHART']);
$template->assign_vars(array(
'S_DISPLAY_MY_CHART' => true,
'S_SIDENAME' => $sidename,
'S_DATA_MY_CHART' => $data,
'SEASON' => $season,
'LEAGUE' => $league,
'S_USER1' => $user1,
'S_USER2' => $user2,
'S_USER3' => $user3,
'S_USER4' => $user4,
'USERNAME1' => $username,
'USERNAME2' => $username2,
'USERNAME3' => $username3,
'USERNAME4' => $username4,
)
);
?>

View File

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

View File

@@ -1,204 +1,198 @@
<?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;
}
if (!$user_sel)
{
if (user_is_member($user->data['user_id'], $season, $league))
{
$user_sel = $user->data['user_id'];
}
}
$username = '';
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$data = false;
// Select user
$sql = 'SELECT DISTINCT
u.user_id,
u.username
FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE season = $season
AND league = $league
ORDER BY LOWER(u.username) ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$data = true;
if ($user_sel == $row['user_id'] OR !$user_sel)
{
$selectid = ' selected="selected"';
$username = $row['username'];
$user_sel = $row['user_id'];
}
else
{
$selectid = '';
}
$template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid,
)
);
}
$db->sql_freeresult($result);
$rank = 0;
// Select sum of users points group by team
$sql = "SELECT
t.*,
SUM(1) AS bets,
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)
)
) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
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)
)
) AS lost,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest=m.goals_guest),
0,1
)
)
)AS tendencies,
SUM(IF((b.goals_home = m.goals_home) AND (b.goals_guest=m.goals_guest),1,0))AS hits,
" . select_points('m',true) . "
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_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no=m.match_no)
WHERE t.season = $season
AND t.league = $league
AND m.status IN (3,6)
AND b.user_id = $user_sel
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY points DESC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('points', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank,
'LOGO' => $logo,
'TEAM' => $row['team_name_short'],
'COUNT' => $row['bets'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'],
)
);
}
$db->sql_freeresult($result);
$rank = 0;
// Select sum of all users points group by team
$sql = "SELECT
t.*,
SUM(1) AS bets,
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)
)
) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
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)
)
) AS lost,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
)
)AS tendencies,
SUM(IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)) AS hits,
" . select_points('m',true) . "
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_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no=m.match_no)
WHERE t.season = $season
AND t.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.status IN (3,6)
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY points DESC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('allpoints', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank,
'LOGO' => $logo,
'TEAM' => $row['team_name_short'],
'COUNT' => $row['bets'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'],
)
);
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['MY_POINTS']);
$template->assign_vars(array(
'S_DISPLAY_MY_POINTS' => true,
'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_bets', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_BETS']),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_table', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => sprintf($user->lang['MY_TABLE']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_BETS']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_TABLE']),
'S_DATA_MY_POINTS' => $data,
'SEASON' => $season,
'LEAGUE' => $league,
'USERNAME' => $username,
)
);
<?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;
}
if (!$user_sel)
{
if (user_is_member($user->data['user_id'], $season, $league))
{
$user_sel = $user->data['user_id'];
}
}
$username = '';
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$data = false;
// Select user
$sql = 'SELECT DISTINCT
u.user_id,
u.username
FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE season = $season
AND league = $league
ORDER BY LOWER(u.username) ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$data = true;
if ($user_sel == $row['user_id'] OR !$user_sel)
{
$selectid = ' selected="selected"';
$username = $row['username'];
$user_sel = $row['user_id'];
}
else
{
$selectid = '';
}
$template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid,
)
);
}
$db->sql_freeresult($result);
$rank = 0;
// Select sum of users points group by team
$sql = "SELECT
t.*,
SUM(1) AS bets,
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)
)
) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
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)
)
) AS lost,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest=m.goals_guest),
0,1
)
)
)AS tendencies,
SUM(IF((b.goals_home = m.goals_home) AND (b.goals_guest=m.goals_guest),1,0))AS hits,
" . select_points('m',true) . "
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_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no=m.match_no)
WHERE t.season = $season
AND t.league = $league
AND m.status IN (3,6)
AND b.user_id = $user_sel
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY points DESC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('points', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank,
'LOGO' => $logo,
'TEAM' => $row['team_name_short'],
'COUNT' => $row['bets'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'],
)
);
}
$db->sql_freeresult($result);
$rank = 0;
// Select sum of all users points group by team
$sql = "SELECT
t.*,
SUM(1) AS bets,
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)
)
) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
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)
)
) AS lost,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
)
)AS tendencies,
SUM(IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)) AS hits,
" . select_points('m',true) . "
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_BETS . " AS b ON (b.season = t.season AND b.league = t.league AND b.match_no=m.match_no)
WHERE t.season = $season
AND t.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.status IN (3,6)
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY points DESC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('allpoints', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank,
'LOGO' => $logo,
'TEAM' => $row['team_name_short'],
'COUNT' => $row['bets'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'DIRECTHITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'],
)
);
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['MY_POINTS']);
$template->assign_vars(array(
'S_DISPLAY_MY_POINTS' => true,
'S_SIDENAME' => $sidename,
'S_DATA_MY_POINTS' => $data,
'SEASON' => $season,
'LEAGUE' => $league,
'USERNAME' => $username,
)
);
?>

View File

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

View File

@@ -1,434 +1,426 @@
<?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;
}
if (!$user_sel)
{
if (user_is_member($user->data['user_id'], $season, $league))
{
$user_sel = $user->data['user_id'];
}
}
$username = '';
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
// select user
$sql = 'SELECT DISTINCT
u.user_id,
u.username
FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE season = $season
AND league = $league
ORDER BY LOWER(u.username) ASC";
$result = $db->sql_query($sql);
if ($user_sel == 900)
{
$selectid = ' selected="selected"';
$username = 'Alle';
$user_sel = 900;
$where_user = "";
}
else
{
$selectid = '';
$where_user = "b.user_id = $user_sel AND ";
}
$template->assign_block_vars('form_user', array(
'S_USER' => 900,
'S_USERNAME' => 'Alle',
'S_SELECTEDID' => $selectid,
)
);
while($row = $db->sql_fetchrow($result))
{
if ($user_sel == $row['user_id'] OR !$user_sel)
{
$selectid = ' selected="selected"';
$username = $row['username'];
$user_sel = $row['user_id'];
}
else
{
$selectid = '';
}
$template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid,
)
);
}
$db->sql_freeresult($result);
$data_table = false;
$data_form = false;
if ($matchday > 5)
{
$form_from = $matchday - 5;
}
else
{
$form_from = 1;
}
$sql = '
SELECT *
FROM ' . FOOTB_LEAGUES . "
WHERE season = $season
AND league = $league";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$league_type = $row['league_type'];
$db->sql_freeresult($result);
$text_form = sprintf($user->lang['TABLE_FORM_FROM'], $form_from);
$rank = 0;
// Select table on selected user bets
$sql = 'SELECT
t.*,
SUM(1) AS matches,
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)
)
) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
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)
)
) AS lost,
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))
)
) AS points,
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))
)
) 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)) AS goals,
SUM(IF(m.team_id_home = t.team_id, b.goals_guest, b.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)
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
t.season = $season
AND t.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$lastGroup = '';
$sumdiff = 0;
while($row = $db->sql_fetchrow($result))
{
if ($lastGroup != $row['group_id'])
{
$lastGroup = $row['group_id'];
$rank = 0;
$template->assign_block_vars('total', array(
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
)
);
}
if ($league_type != 2 OR $row['group_id'] != '')
{
$data_table = true;
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$pdiff = $row['points'] - $row['realpoints'];
if ($pdiff >= 0)
{
$sumdiff += $pdiff;
$pdiff = ' (+' . $pdiff . ')';
}
else
{
$sumdiff -= $pdiff;
$pdiff = ' (' . $pdiff . ')';
}
if ($user_sel == 900)
{
$pdiff = '';
}
$template->assign_block_vars('total', array(
'RANK' => $rank . '.',
'ROW_CLASS' => $row_class,
'LOGO' => $logo,
'TEAM_ID' => $row['team_id'],
'TEAM' => $row['team_name_short'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $row['team_id'], 'mode' => 'played')),
'GAMES' => $row['matches'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'] . $pdiff,
)
);
}
}
$db->sql_freeresult($result);
$rank = 0;
// Select formtable on selected user bets
$sql = 'SELECT
t.*,
SUM(1) AS matches,
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)
)
) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
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)
)
) AS lost,
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))
)
) 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)) AS goals,
SUM(IF(m.team_id_home = t.team_id, b.goals_guest, b.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)
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
t.season = $season
AND t.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday >= $form_from
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$lastGroup = '';
while($row = $db->sql_fetchrow($result))
{
$data_form = true;
if ($lastGroup != $row['group_id'])
{
$lastGroup = $row['group_id'];
$rank = 0;
$template->assign_block_vars('form', array(
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
)
);
}
if ($league_type != 2 OR $row['group_id'] != '')
{
$rank++;
$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 . '.',
'ROW_CLASS' => $row_class,
'LOGO' => $logo,
'TEAM_ID' => $row['team_id'],
'TEAM' => $row['team_name_short'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $row['team_id'], 'mode' => 'rest')),
'GAMES' => $row['matches'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'],
)
);
}
}
$db->sql_freeresult($result);
$rank = 0;
// Select home-table on selected user bets
$sql = 'SELECT
t.*,
SUM(1) AS matches,
SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS lost,
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 - b.goals_guest) AS goals_diff,
SUM(b.goals_home) AS goals,
SUM(b.goals_guest) AS goals_against
FROM ' . FOOTB_TEAMS . ' AS t
LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league
AND m.team_id_home = t.team_id AND m.group_id = t.group_id)
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
t.season = $season
AND t.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$lastGroup = '';
while($row = $db->sql_fetchrow($result))
{
if ($lastGroup != $row['group_id'])
{
$lastGroup = $row['group_id'];
$rank = 0;
$template->assign_block_vars('home', array(
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
)
);
}
if ($league_type != 2 OR $row['group_id'] != '')
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('home', array(
'RANK' => $rank . '.',
'ROW_CLASS' => $row_class,
'LOGO' => $logo,
'TEAM_ID' => $row['team_id'],
'TEAM' => $row['team_name_short'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $row['team_id'], 'mode' => 'home')),
'GAMES' => $row['matches'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'],
)
);
}
}
$db->sql_freeresult($result);
$rank = 0;
// Select away-table on selected user bets
$sql = 'SELECT
t.*,
SUM(1) AS matches,
SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS lost,
SUM(IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))) AS points,
SUM(b.goals_guest - b.goals_home) AS goals_diff,
SUM(b.goals_guest) AS goals,
SUM(b.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_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)
WHERE $where_user
t.season = $season
AND t.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$lastGroup = '';
while($row = $db->sql_fetchrow($result))
{
if ($lastGroup != $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';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('away', array(
'RANK' => $rank . '.',
'ROW_CLASS' => $row_class,
'LOGO' => $logo,
'TEAM_ID' => $row['team_id'],
'TEAM' => $row['team_name_short'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $row['team_id'], 'mode' => 'away')),
'GAMES' => $row['matches'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'],
)
);
}
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['MY_TABLE']);
$template->assign_vars(array(
'S_DISPLAY_MY_TABLE' => true,
'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_points', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_TABLE']),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_POINTS']),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'my_rank', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_TABLE']),
'RIGHT_LINK' => sprintf($user->lang['MY_RANK']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_POINTS']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_MY_RANKS']),
'S_DATA_MY_TABLE' => $data_table,
'S_DATA_FORM' => $data_form,
'SEASON' => $season,
'LEAGUE' => $league,
'TEXT_FORM' => $text_form,
'S_PDIFF' => $sumdiff,
'USERNAME' => $username,
)
);
<?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;
}
if (!$user_sel)
{
if (user_is_member($user->data['user_id'], $season, $league))
{
$user_sel = $user->data['user_id'];
}
}
$username = '';
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
// select user
$sql = 'SELECT DISTINCT
u.user_id,
u.username
FROM ' . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE season = $season
AND league = $league
ORDER BY LOWER(u.username) ASC";
$result = $db->sql_query($sql);
if ($user_sel == 900)
{
$selectid = ' selected="selected"';
$username = 'Alle';
$user_sel = 900;
$where_user = "";
}
else
{
$selectid = '';
$where_user = "b.user_id = $user_sel AND ";
}
$template->assign_block_vars('form_user', array(
'S_USER' => 900,
'S_USERNAME' => 'Alle',
'S_SELECTEDID' => $selectid,
)
);
while($row = $db->sql_fetchrow($result))
{
if ($user_sel == $row['user_id'] OR !$user_sel)
{
$selectid = ' selected="selected"';
$username = $row['username'];
$user_sel = $row['user_id'];
}
else
{
$selectid = '';
}
$template->assign_block_vars('form_user', array(
'S_USER' => $row['user_id'],
'S_USERNAME' => $row['username'],
'S_SELECTEDID' => $selectid,
)
);
}
$db->sql_freeresult($result);
$data_table = false;
$data_form = false;
if ($matchday > 5)
{
$form_from = $matchday - 5;
}
else
{
$form_from = 1;
}
$sql = '
SELECT *
FROM ' . FOOTB_LEAGUES . "
WHERE season = $season
AND league = $league";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$league_type = $row['league_type'];
$db->sql_freeresult($result);
$text_form = sprintf($user->lang['TABLE_FORM_FROM'], $form_from);
$rank = 0;
// Select table on selected user bets
$sql = 'SELECT
t.*,
SUM(1) AS matches,
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)
)
) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
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)
)
) AS lost,
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))
)
) AS points,
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))
)
) 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)) AS goals,
SUM(IF(m.team_id_home = t.team_id, b.goals_guest, b.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)
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
t.season = $season
AND t.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$lastGroup = '';
$sumdiff = 0;
while($row = $db->sql_fetchrow($result))
{
if ($lastGroup != $row['group_id'])
{
$lastGroup = $row['group_id'];
$rank = 0;
$template->assign_block_vars('total', array(
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
)
);
}
if ($league_type != 2 OR $row['group_id'] != '')
{
$data_table = true;
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$pdiff = $row['points'] - $row['realpoints'];
if ($pdiff >= 0)
{
$sumdiff += $pdiff;
$pdiff = ' (+' . $pdiff . ')';
}
else
{
$sumdiff -= $pdiff;
$pdiff = ' (' . $pdiff . ')';
}
if ($user_sel == 900)
{
$pdiff = '';
}
$template->assign_block_vars('total', array(
'RANK' => $rank . '.',
'ROW_CLASS' => $row_class,
'LOGO' => $logo,
'TEAM_ID' => $row['team_id'],
'TEAM' => $row['team_name_short'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $row['team_id'], 'mode' => 'played')),
'GAMES' => $row['matches'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'] . $pdiff,
)
);
}
}
$db->sql_freeresult($result);
$rank = 0;
// Select formtable on selected user bets
$sql = 'SELECT
t.*,
SUM(1) AS matches,
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)
)
) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
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)
)
) AS lost,
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))
)
) 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)) AS goals,
SUM(IF(m.team_id_home = t.team_id, b.goals_guest, b.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)
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
t.season = $season
AND t.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday >= $form_from
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$lastGroup = '';
while($row = $db->sql_fetchrow($result))
{
$data_form = true;
if ($lastGroup != $row['group_id'])
{
$lastGroup = $row['group_id'];
$rank = 0;
$template->assign_block_vars('form', array(
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
)
);
}
if ($league_type != 2 OR $row['group_id'] != '')
{
$rank++;
$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 . '.',
'ROW_CLASS' => $row_class,
'LOGO' => $logo,
'TEAM_ID' => $row['team_id'],
'TEAM' => $row['team_name_short'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $row['team_id'], 'mode' => 'rest')),
'GAMES' => $row['matches'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'],
)
);
}
}
$db->sql_freeresult($result);
$rank = 0;
// Select home-table on selected user bets
$sql = 'SELECT
t.*,
SUM(1) AS matches,
SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS lost,
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 - b.goals_guest) AS goals_diff,
SUM(b.goals_home) AS goals,
SUM(b.goals_guest) AS goals_against
FROM ' . FOOTB_TEAMS . ' AS t
LEFT JOIN ' . FOOTB_MATCHES . ' AS m ON (m.season = t.season AND m.league = t.league
AND m.team_id_home = t.team_id AND m.group_id = t.group_id)
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
t.season = $season
AND t.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$lastGroup = '';
while($row = $db->sql_fetchrow($result))
{
if ($lastGroup != $row['group_id'])
{
$lastGroup = $row['group_id'];
$rank = 0;
$template->assign_block_vars('home', array(
'GROUP' => sprintf($user->lang['GROUP']) . ' ' . $row['group_id'],
)
);
}
if ($league_type != 2 OR $row['group_id'] != '')
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('home', array(
'RANK' => $rank . '.',
'ROW_CLASS' => $row_class,
'LOGO' => $logo,
'TEAM_ID' => $row['team_id'],
'TEAM' => $row['team_name_short'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $row['team_id'], 'mode' => 'home')),
'GAMES' => $row['matches'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'],
)
);
}
}
$db->sql_freeresult($result);
$rank = 0;
// Select away-table on selected user bets
$sql = 'SELECT
t.*,
SUM(1) AS matches,
SUM(IF(b.goals_home + 0 < b.goals_guest, 1, 0)) AS win,
SUM(IF(b.goals_home = b.goals_guest, 1, 0)) AS draw,
SUM(IF(b.goals_home + 0 > b.goals_guest, 1, 0)) AS lost,
SUM(IF(b.goals_home + 0 < b.goals_guest, 3, IF(b.goals_home = b.goals_guest, 1, 0))) AS points,
SUM(b.goals_guest - b.goals_home) AS goals_diff,
SUM(b.goals_guest) AS goals,
SUM(b.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_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)
WHERE $where_user
t.season = $season
AND t.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$lastGroup = '';
while($row = $db->sql_fetchrow($result))
{
if ($lastGroup != $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';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('away', array(
'RANK' => $rank . '.',
'ROW_CLASS' => $row_class,
'LOGO' => $logo,
'TEAM_ID' => $row['team_id'],
'TEAM' => $row['team_name_short'],
'U_PLAN_TEAM' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $row['team_id'], 'mode' => 'away')),
'GAMES' => $row['matches'],
'WIN' => $row['win'],
'DRAW' => $row['draw'],
'LOST' => $row['lost'],
'GOALS' => $row['goals'],
'GOALS_AGAINST' => $row['goals_against'],
'GOALS_DIFF' => $row['goals_diff'],
'POINTS' => $row['points'],
)
);
}
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['MY_TABLE']);
$template->assign_vars(array(
'S_DISPLAY_MY_TABLE' => true,
'S_SIDENAME' => $sidename,
'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
/**
*
* @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_odds = false;
$matchnumber = 0;
$lang_dates = $user->lang['datetime'];
$sql = "SELECT
m.league,
m.match_no,
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,
t1.team_symbol AS home_symbol,
t2.team_symbol AS guest_symbol,
t1.team_name_short AS home_name,
t2.team_name_short AS guest_name,
t1.team_id AS home_id,
t2.team_id AS guest_id,
m.goals_home,
m.goals_guest,
m.goals_overtime_home AS kogoals_home,
m.goals_overtime_guest AS kogoals_guest,
m.ko_match,
m.group_id,
m.formula_home,
m.formula_guest,
m.odd_1,
m.odd_x,
m.odd_2,
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 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
AND m.matchday = $matchday
ORDER BY m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
$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));
//while($row = $db->sql_fetchrow($result))
foreach ($rows as $row)
{
$data_odds = true;
$matchnumber++ ;
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if (0 == $row['home_id'])
{
$home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']);
$home_in_array = explode("#",$home_info);
$homelogo = $home_in_array[0];
$homeid = $home_in_array[1];
$homename = $home_in_array[2];
}
else
{
$homelogo = $row['home_symbol'];
$homeid = $row['home_id'];
$homename = $row['home_name'];
}
if (0 == $row['guest_id'])
{
$guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']);
$guest_in_array = explode("#",$guest_info);
$guestlogo = $guest_in_array[0];
$guestid = $guest_in_array[1];
$guestname = $guest_in_array[2];
}
else
{
$guestlogo = $row['guest_symbol'];
$guestid = $row['guest_id'];
$guestname = $row['guest_name'];
}
if ($homelogo <> '')
{
$logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ;
}
else
{
$logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
}
if ($guestlogo <> '')
{
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ;
}
else
{
$logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
}
if ($row['ko_match'])
{
$display_ko = true;
$ko_match = true;
}
else
{
$ko_match = false;
}
if ($row['group_id'] == '')
{
$group_id = '&nbsp;';
}
else
{
$display_group = true;
$group_id = $row['group_id'];
}
$edit_match = false;
$goals_home = ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'];
$goals_guest = ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'];
$kogoals_home = ($row['kogoals_home'] == '') ? '&nbsp;' : $row['kogoals_home'];
$kogoals_guest = ($row['kogoals_guest'] == '') ? '&nbsp;' : $row['kogoals_guest'];
$template->assign_block_vars('odds', array(
'ROW_CLASS' => $row_class,
'MATCH_NUMBER' => $row['match_no'],
'MATCHDAY' => $matchday,
'MATCH_TIME' => $row['match_time'],
'GROUP' => $group_id,
'HOME_ID' => $homeid,
'GUEST_ID' => $guestid,
'LOGO_HOME' => $logoH,
'LOGO_GUEST' => $logoG,
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $homeid, 'mode' => 'all')),
'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $guestid, 'mode' => 'all')),
'GOALS_HOME' => $goals_home,
'GOALS_GUEST' => $goals_guest,
'COLOR_STYLE' => '',
'KOGOALS_HOME' => $kogoals_home,
'KOGOALS_GUEST' => $kogoals_guest,
'S_KO_MATCH' => $ko_match,
'TREND' => $row['trend'],
'U_MATCH_STATS' => $this->helper->route('football_football_popup', array('popside' => 'hist_popup', 's' => $season, 'l' => $league,
'hid' => $homeid, 'gid' => $guestid, 'm' => $matchday,
'mn' => $row['match_no'], 'gr' => $row['group_id'])),
'ODD_1' => $row['odd_1'],
'ODD_X' => $row['odd_x'],
'ODD_2' => $row['odd_2'],
)
);
}
$db->sql_freeresult($result);
$sidename = 'Chancen';
switch ($league_info['bet_ko_type'])
{
case BET_KO_90:
$result_explain = sprintf($user->lang['MIN90']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
break;
case BET_KO_EXTRATIME:
$result_explain = sprintf($user->lang['EXTRATIME_SHORT']);
$label_finalresult = sprintf($user->lang['PENALTY']);
break;
case BET_KO_PENALTY:
$result_explain = sprintf($user->lang['PENALTY']);
$display_ko = false;
break;
default:
$result_explain = sprintf($user->lang['MIN90']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
break;
}
$template->assign_vars(array(
'S_DISPLAY_ODDS' => true,
'S_SIDENAME' => $sidename,
'RESULT_EXPLAIN' => $result_explain,
'LABEL_FINALRESULT' => $label_finalresult,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&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,
)
);
<?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_odds = false;
$matchnumber = 0;
$lang_dates = $user->lang['datetime'];
$sql = "SELECT
m.league,
m.match_no,
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,
t1.team_symbol AS home_symbol,
t2.team_symbol AS guest_symbol,
t1.team_name_short AS home_name,
t2.team_name_short AS guest_name,
t1.team_id AS home_id,
t2.team_id AS guest_id,
m.goals_home,
m.goals_guest,
m.goals_overtime_home AS kogoals_home,
m.goals_overtime_guest AS kogoals_guest,
m.ko_match,
m.group_id,
m.formula_home,
m.formula_guest,
m.odd_1,
m.odd_x,
m.odd_2,
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 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
AND m.matchday = $matchday
ORDER BY m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
$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));
//while($row = $db->sql_fetchrow($result))
foreach ($rows as $row)
{
$data_odds = true;
$matchnumber++ ;
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if (0 == $row['home_id'])
{
$home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']);
$home_in_array = explode("#",$home_info);
$homelogo = $home_in_array[0];
$homeid = $home_in_array[1];
$homename = $home_in_array[2];
}
else
{
$homelogo = $row['home_symbol'];
$homeid = $row['home_id'];
$homename = $row['home_name'];
}
if (0 == $row['guest_id'])
{
$guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']);
$guest_in_array = explode("#",$guest_info);
$guestlogo = $guest_in_array[0];
$guestid = $guest_in_array[1];
$guestname = $guest_in_array[2];
}
else
{
$guestlogo = $row['guest_symbol'];
$guestid = $row['guest_id'];
$guestname = $row['guest_name'];
}
if ($homelogo <> '')
{
$logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ;
}
else
{
$logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
}
if ($guestlogo <> '')
{
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ;
}
else
{
$logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
}
if ($row['ko_match'])
{
$display_ko = true;
$ko_match = true;
}
else
{
$ko_match = false;
}
if ($row['group_id'] == '')
{
$group_id = '&nbsp;';
}
else
{
$display_group = true;
$group_id = $row['group_id'];
}
$edit_match = false;
$goals_home = ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'];
$goals_guest = ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'];
$kogoals_home = ($row['kogoals_home'] == '') ? '&nbsp;' : $row['kogoals_home'];
$kogoals_guest = ($row['kogoals_guest'] == '') ? '&nbsp;' : $row['kogoals_guest'];
$template->assign_block_vars('odds', array(
'ROW_CLASS' => $row_class,
'MATCH_NUMBER' => $row['match_no'],
'MATCHDAY' => $matchday,
'MATCH_TIME' => $row['match_time'],
'GROUP' => $group_id,
'HOME_ID' => $homeid,
'GUEST_ID' => $guestid,
'LOGO_HOME' => $logoH,
'LOGO_GUEST' => $logoG,
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $homeid, 'mode' => 'all')),
'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $guestid, 'mode' => 'all')),
'GOALS_HOME' => $goals_home,
'GOALS_GUEST' => $goals_guest,
'COLOR_STYLE' => '',
'KOGOALS_HOME' => $kogoals_home,
'KOGOALS_GUEST' => $kogoals_guest,
'S_KO_MATCH' => $ko_match,
'TREND' => $row['trend'],
'U_MATCH_STATS' => $this->helper->route('football_football_popup', array('popside' => 'hist_popup', 's' => $season, 'l' => $league,
'hid' => $homeid, 'gid' => $guestid, 'm' => $matchday,
'mn' => $row['match_no'], 'gr' => $row['group_id'])),
'ODD_1' => $row['odd_1'],
'ODD_X' => $row['odd_x'],
'ODD_2' => $row['odd_2'],
)
);
}
$db->sql_freeresult($result);
$sidename = 'Chancen';
switch ($league_info['bet_ko_type'])
{
case BET_KO_90:
$result_explain = sprintf($user->lang['MIN90']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
break;
case BET_KO_EXTRATIME:
$result_explain = sprintf($user->lang['EXTRATIME_SHORT']);
$label_finalresult = sprintf($user->lang['PENALTY']);
break;
case BET_KO_PENALTY:
$result_explain = sprintf($user->lang['PENALTY']);
$display_ko = false;
break;
default:
$result_explain = sprintf($user->lang['MIN90']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
break;
}
$template->assign_vars(array(
'S_DISPLAY_ODDS' => true,
'S_SIDENAME' => $sidename,
'RESULT_EXPLAIN' => $result_explain,
'LABEL_FINALRESULT' => $label_finalresult,
'S_DATA_ODDS' => $data_odds,
)
);
?>

View File

@@ -1,270 +1,261 @@
<?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;
}
$start = $this->request->variable('start', 0);
$win_user_most_hits = array();
$win_user_most_hits_away = array();
$season_wins = array();
$win_user_most_hits = win_user_most_hits($season, $league, $matchday);
$win_user_most_hits_away = win_user_most_hits_away($season, $league, $matchday);
// Statistics of matchday
$sql = "SELECT
b.user_id,
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 <> '',
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0),
0
)
) AS hits,
SUM(IF(b.goals_home <> '' AND b.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),
0
),
0
)
) AS hits02,
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
(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),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
),
0
)
) AS tendency
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)
WHERE b.season = $season
AND b.league = $league
AND m.status IN (2,3)
AND m.matchday = $matchday
GROUP BY user_id";
$result = $db->sql_query($sql);
$usersstats = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
foreach ($usersstats AS $userstats)
{
$betsof[$userstats['user_id']] = $userstats['bets'];
$nobetsof[$userstats['user_id']] = $userstats['matches'] - $userstats['bets'];
$tendenciesof[$userstats['user_id']] = $userstats['tendency'];
$hitsof[$userstats['user_id']] = $userstats['hits'];
$hits02of[$userstats['user_id']] = $userstats['hits02'];
}
// ranks of matchday
$sql = 'SELECT
rank,
user_id
FROM '. FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday = $matchday
AND status IN (2,3)
ORDER BY rank ASC, user_id ASC";
$result = $db->sql_query($sql);
$ranks = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$total_users = sizeof($ranks);
foreach ($ranks AS $rank)
{
$rankof[$rank['user_id']] = $rank['rank'];
}
if ($matchday > 1)
{
// rank previous matchday
$sql = 'SELECT
rank AS last_rang,
user_id
FROM '. FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday = ($matchday-1)
AND status IN (2,3)
ORDER BY last_rang ASC, user_id ASC";
$result = $db->sql_query($sql);
$ranks = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
foreach ($ranks AS $rank)
{
$prevrankof[$rank['user_id']] = $rank['last_rang'];
}
}
if ($matchday == $maxmatchday)
{
$season_wins = season_wins($season, $league, $matchday);
}
// Make sure $start is set to the last page if it exceeds the amount
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'];
}
else
{
$sql_start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page'];
}
$sql_limit = $config['football_users_per_page'];
// handle pagination.
$base_url = $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday));
$pagination = $phpbb_container->get('pagination');
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
$data_ranks = false;
$index = 0;
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$sql = 'SELECT
r.rank,
r.status,
r.user_id,
r.points,
r.win AS wins,
u.user_colour,
u.username
FROM '. FOOTB_RANKS . ' AS r
LEFT Join '. USERS_TABLE . " AS u ON (r.user_id = u.user_id)
WHERE r.season = $season
AND r.league = $league
AND r.matchday = $matchday
AND r.status IN (2,3)
ORDER BY r.rank ASC, r.points DESC, LOWER(u.username) ASC";
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
while($row = $db->sql_fetchrow($result))
{
$index++;
$data_ranks = true;
if (isset($prevrankof[$row['user_id']]))
{
if ($rankof[$row['user_id']] == '')
{
$change_sign = '';
$change_img = '';
$change_differ = '&nbsp;';
}
else
{
if ($rankof[$row['user_id']] == $prevrankof[$row['user_id']])
{
$change_sign = '=';
$change_img = "<img src=\"" . $ext_path . "images/no_change.gif\" alt=\"" . $user->lang['NO_CHANGES'] . "\"/>";
$change_differ = '&nbsp;';
}
else
{
if ($rankof[$row['user_id']] > $prevrankof[$row['user_id']])
{
$change_sign = '+';
$change_img = "<img src=\"" . $ext_path . "images/arrow_down.gif\" alt=\"" . $user->lang['WORSENED'] . "\"/>";
$differ = $rankof[$row['user_id']] - $prevrankof[$row['user_id']];
$change_differ = ' (' . $differ . ')';
}
else
{
$change_sign = '-';
$change_img = "<img src=\"" . $ext_path . "images/arrow_up.gif\" alt=\"" . $user->lang['IMPROVED'] . "\"/>";
$differ = $prevrankof[$row['user_id']] - $rankof[$row['user_id']];
$change_differ = ' (' . $differ . ')';
}
}
}
}
else
{
$change_sign = '';
$change_img = '';
$change_differ = '&nbsp;';
}
if ($matchday == $maxmatchday)
{
// if someone didn't bet the hole Season
if(!isset($win_user_most_hits[$row['user_id']]['win']))
{
$win_user_most_hits[$row['user_id']]['win'] = 0;
}
if(!isset($win_user_most_hits_away[$row['user_id']]['win']))
{
$win_user_most_hits_away[$row['user_id']]['win'] = 0;
}
if(!isset($season_wins[$row['user_id']]['win']))
{
$season_wins[$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']
+ $season_wins[$row['user_id']]['win']);
}
else
{
$win_total = sprintf('%01.2f',$row['wins']);
}
$row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$colorstyle = color_style($row['status']);
$template->assign_block_vars('rankstotal', array(
'ROW_CLASS' => $row_class,
'RANK' => $rankof[$row['user_id']],
'CHANGE_SIGN' => $change_sign,
'CHANGE_IMG' => $change_img,
'CHANGE_DIFFER' => $change_differ,
'USERID' => $row['user_id'],
'USERNAME' => $row['username'],
'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
'BETS' => $betsof[$row['user_id']],
'NOBETS' => ($nobetsof[$row['user_id']] == 0) ? '&nbsp;' : $nobetsof[$row['user_id']],
'TENDENCIES' => ($tendenciesof[$row['user_id']] == 0) ? '&nbsp;' : $tendenciesof[$row['user_id']],
'DIRECTHITS' => ($hitsof[$row['user_id']] == 0) ? '&nbsp;' : $hitsof[$row['user_id']],
'DIRECTHITS02' => ($hits02of[$row['user_id']] == 0) ? '&nbsp;' : $hits02of[$row['user_id']],
'POINTS' => $row['points'],
'COLOR_STYLE' => $colorstyle,
'WIN' => $win_total,
)
);
}
$db->sql_freeresult($result);
$league_info = league_info($season, $league);
$sidename = sprintf($user->lang['RANK_MATCHDAY']);
$template->assign_vars(array(
'S_DISPLAY_RANKS_MATCHDAY' => true,
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
'S_SIDENAME' => $sidename,
'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&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'],
)
);
<?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;
}
$start = $this->request->variable('start', 0);
$win_user_most_hits = array();
$win_user_most_hits_away = array();
$season_wins = array();
$win_user_most_hits = win_user_most_hits($season, $league, $matchday);
$win_user_most_hits_away = win_user_most_hits_away($season, $league, $matchday);
// Statistics of matchday
$sql = "SELECT
b.user_id,
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 <> '',
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0),
0
)
) AS hits,
SUM(IF(b.goals_home <> '' AND b.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),
0
),
0
)
) AS hits02,
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
(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),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
),
0
)
) AS tendency
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)
WHERE b.season = $season
AND b.league = $league
AND m.status IN (2,3)
AND m.matchday = $matchday
GROUP BY user_id";
$result = $db->sql_query($sql);
$usersstats = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
foreach ($usersstats AS $userstats)
{
$betsof[$userstats['user_id']] = $userstats['bets'];
$nobetsof[$userstats['user_id']] = $userstats['matches'] - $userstats['bets'];
$tendenciesof[$userstats['user_id']] = $userstats['tendency'];
$hitsof[$userstats['user_id']] = $userstats['hits'];
$hits02of[$userstats['user_id']] = $userstats['hits02'];
}
// ranks of matchday
$sql = 'SELECT
rank,
user_id
FROM '. FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday = $matchday
AND status IN (2,3)
ORDER BY rank ASC, user_id ASC";
$result = $db->sql_query($sql);
$ranks = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$total_users = sizeof($ranks);
foreach ($ranks AS $rank)
{
$rankof[$rank['user_id']] = $rank['rank'];
}
if ($matchday > 1)
{
// rank previous matchday
$sql = 'SELECT
rank AS last_rang,
user_id
FROM '. FOOTB_RANKS . "
WHERE season = $season
AND league = $league
AND matchday = ($matchday-1)
AND status IN (2,3)
ORDER BY last_rang ASC, user_id ASC";
$result = $db->sql_query($sql);
$ranks = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
foreach ($ranks AS $rank)
{
$prevrankof[$rank['user_id']] = $rank['last_rang'];
}
}
if ($matchday == $maxmatchday)
{
$season_wins = season_wins($season, $league, $matchday);
}
// Make sure $start is set to the last page if it exceeds the amount
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'];
}
else
{
$sql_start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page'];
}
$sql_limit = $config['football_users_per_page'];
// handle pagination.
$base_url = $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday));
$pagination = $phpbb_container->get('pagination');
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
$data_ranks = false;
$index = 0;
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$sql = 'SELECT
r.rank,
r.status,
r.user_id,
r.points,
r.win AS wins,
u.user_colour,
u.username
FROM '. FOOTB_RANKS . ' AS r
LEFT Join '. USERS_TABLE . " AS u ON (r.user_id = u.user_id)
WHERE r.season = $season
AND r.league = $league
AND r.matchday = $matchday
AND r.status IN (2,3)
ORDER BY r.rank ASC, r.points DESC, LOWER(u.username) ASC";
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
while($row = $db->sql_fetchrow($result))
{
$index++;
$data_ranks = true;
if (isset($prevrankof[$row['user_id']]))
{
if ($rankof[$row['user_id']] == '')
{
$change_sign = '';
$change_differ = '&nbsp;';
}
else
{
if ($rankof[$row['user_id']] == $prevrankof[$row['user_id']])
{
$change_sign = '=';
$change_differ = '&nbsp;';
}
else
{
if ($rankof[$row['user_id']] > $prevrankof[$row['user_id']])
{
$change_sign = '+';
$differ = $rankof[$row['user_id']] - $prevrankof[$row['user_id']];
$change_differ = ' (' . $differ . ')';
}
else
{
$change_sign = '-';
$differ = $prevrankof[$row['user_id']] - $rankof[$row['user_id']];
$change_differ = ' (' . $differ . ')';
}
}
}
}
else
{
$change_sign = '';
$change_differ = '&nbsp;';
}
if ($matchday == $maxmatchday)
{
// if someone didn't bet the hole Season
if(!isset($win_user_most_hits[$row['user_id']]['win']))
{
$win_user_most_hits[$row['user_id']]['win'] = 0;
}
if(!isset($win_user_most_hits_away[$row['user_id']]['win']))
{
$win_user_most_hits_away[$row['user_id']]['win'] = 0;
}
if(!isset($season_wins[$row['user_id']]['win']))
{
$season_wins[$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']
+ $season_wins[$row['user_id']]['win']);
}
else
{
$win_total = sprintf('%01.2f',$row['wins']);
}
$row_class = (!($index % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$colorstyle = color_style($row['status']);
$template->assign_block_vars('rankstotal', array(
'ROW_CLASS' => $row_class,
'RANK' => $rankof[$row['user_id']],
'NO_CHANGES' => ($change_sign == '=') ? true : false,
'WORSENED' => ($change_sign == '-') ? true : false,
'IMPROVED' => ($change_sign == '+') ? true : false,
'CHANGE_SIGN' => $change_sign,
'CHANGE_DIFFER' => $change_differ,
'USERID' => $row['user_id'],
'USERNAME' => $row['username'],
'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
'BETS' => $betsof[$row['user_id']],
'NOBETS' => ($nobetsof[$row['user_id']] == 0) ? '&nbsp;' : $nobetsof[$row['user_id']],
'TENDENCIES' => ($tendenciesof[$row['user_id']] == 0) ? '&nbsp;' : $tendenciesof[$row['user_id']],
'DIRECTHITS' => ($hitsof[$row['user_id']] == 0) ? '&nbsp;' : $hitsof[$row['user_id']],
'DIRECTHITS02' => ($hits02of[$row['user_id']] == 0) ? '&nbsp;' : $hits02of[$row['user_id']],
'POINTS' => $row['points'],
'COLOR_STYLE' => $colorstyle,
'WIN' => $win_total,
)
);
}
$db->sql_freeresult($result);
$league_info = league_info($season, $league);
$sidename = sprintf($user->lang['RANK_MATCHDAY']);
$template->assign_vars(array(
'S_DISPLAY_RANKS_MATCHDAY' => true,
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
'S_SIDENAME' => $sidename,
'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true,
'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++;
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['RANK_TOTAL']);
$league_info = league_info($season, $league);
@@ -166,13 +165,6 @@ switch ($mode)
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
'S_DATA_RANKS' => $data_ranks,
'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&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),
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
'S_WIN' => false,
@@ -328,7 +320,6 @@ switch ($mode)
}
$index++;
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['RANK_TOTAL']);
$league_info = league_info($season, $league);
@@ -337,13 +328,6 @@ switch ($mode)
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
'S_DATA_RANKS' => $data_ranks,
'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&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),
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
'S_WIN' => ($league_info['win_matchday'] == '0' and $league_info['win_season'] == '0') ? false : ($this->auth->acl_gets('a_')) ? true : false,
@@ -492,7 +476,6 @@ switch ($mode)
if ($rank == $prev_rank_of[$curr_rank['user_id']])
{
$change_sign = '=';
$change_img = "<img src=\"" . $ext_path . "images/no_change.gif\" alt=\"" . $user->lang['NO_CHANGES'] . "\"/>";
$change_differ = '';
}
else
@@ -500,14 +483,12 @@ switch ($mode)
if ($rank > $prev_rank_of[$curr_rank['user_id']])
{
$change_sign = '+';
$change_img = "<img src=\"" . $ext_path . "images/arrow_down.gif\" alt=\"" . $user->lang['WORSENED'] . "\"/>";
$differ = $rank - $prev_rank_of[$curr_rank['user_id']];
$change_differ = ' (' . $differ . ')';
}
else
{
$change_sign = '-';
$change_img = "<img src=\"" . $ext_path . "images/arrow_up.gif\" alt=\"" . $user->lang['IMPROVED'] . "\"/>";
$differ = $prev_rank_of[$curr_rank['user_id']] - $rank;
$change_differ = ' (' . $differ . ')';
}
@@ -516,7 +497,6 @@ switch ($mode)
else
{
$change_sign = '';
$change_img = '';
$change_differ = '';
}
@@ -539,8 +519,10 @@ switch ($mode)
$template->assign_block_vars('rankstotal', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank,
'NO_CHANGES' => ($change_sign == '=') ? true : false,
'WORSENED' => ($change_sign == '-') ? true : false,
'IMPROVED' => ($change_sign == '+') ? true : false,
'CHANGE_SIGN' => $change_sign,
'CHANGE_IMG' => $change_img,
'CHANGE_DIFFER' => $change_differ,
'USERID' => $curr_rank['user_id'],
'USERNAME' => $curr_rank['username'],
@@ -558,7 +540,6 @@ switch ($mode)
}
$index++;
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['RANK_TOTAL']);
$league_info = league_info($season, $league);
@@ -567,13 +548,6 @@ switch ($mode)
'S_DISPLAY_HITS02' => $config['football_win_hits02'],
'S_DATA_RANKS' => $data_ranks,
'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'ranks_matchday', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&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),
'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,

View File

@@ -1,433 +1,428 @@
<?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_results = false;
$lang_dates = $user->lang['datetime'];
$matchnumber = 0;
$editstatus = array(1, 2, 4, 5);
$league_info = league_info($season, $league);
// Calculate matches AND results of matchday
$sql = "SELECT
m.match_no,
m.matchday,
m.status,
m.group_id,
m.formula_home,
m.formula_guest,
t1.team_symbol AS home_symbol,
t2.team_symbol AS guest_symbol,
t1.team_id AS home_id,
t2.team_id AS guest_id,
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_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.season = $season
AND m.league = $league
AND m.matchday = $matchday
ORDER BY m.match_datetime ASC, m.match_no ASC";
$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_results = true;
$matchnumber++ ;
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if (0 == $row['home_id'])
{
$home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']);
$home_in_array = explode("#",$home_info);
$homelogo = $home_in_array[0];
$homeid = $home_in_array[1];
$homename = $home_in_array[2];
$homeshort = $home_in_array[2];
}
else
{
$homelogo = $row['home_symbol'];
$homeid = $row['home_id'];
$homename = $row['home_name'];
$homeshort = $row['home_short'];
}
if (0 == $row['guest_id'])
{
$guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']);
$guest_in_array = explode("#",$guest_info);
$guestlogo = $guest_in_array[0];
$guestid = $guest_in_array[1];
$guestname = $guest_in_array[2];
$guestshort = $guest_in_array[2];
}
else
{
$guestlogo = $row['guest_symbol'];
$guestid = $row['guest_id'];
$guestname = $row['guest_name'];
$guestshort = $row['guest_short'];
}
if ($homelogo <> '')
{
$logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ;
}
else
{
$logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
}
if ($guestlogo <> '')
{
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ;
}
else
{
$logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
}
if ($row['ko_match'])
{
$display_ko = true;
$ko_match = true;
}
else
{
$ko_match = false;
}
if ($row['group_id'] == '')
{
$group_id = '&nbsp;';
}
else
{
$display_group = true;
$group_id = $row['group_id'];
}
if (in_array($row['status'], $editstatus) AND $user_is_member)
{
$edit_mode = true;
$edit_match = true;
$goals_home = $row['goals_home'];
$goals_guest = $row['goals_guest'];
$kogoals_home = $row['kogoals_home'];
$kogoals_guest = $row['kogoals_guest'];
}
else
{
$edit_match = false;
$goals_home = ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'];
$goals_guest = ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'];
$kogoals_home = ($row['kogoals_home'] == '') ? '&nbsp;' : $row['kogoals_home'];
$kogoals_guest = ($row['kogoals_guest'] == '') ? '&nbsp;' : $row['kogoals_guest'];
}
$template->assign_block_vars('result', array(
'ROW_CLASS' => $row_class,
'MATCH_NUMBER' => $row['match_no'],
'MATCHDAY' => $row['matchday'],
'STATUS' => $row['status'],
'MATCH_TIME' => $row['match_time'],
'GROUP' => $group_id,
'HOME_ID' => $homeid,
'GUEST_ID' => $guestid,
'LOGO_HOME' => $logoH,
'LOGO_GUEST' => $logoG,
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'HOME_SHORT' => $homeshort,
'GUEST_SHORT' => $guestshort,
'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $homeid, 'mode' => 'all')),
'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $guestid, 'mode' => 'all')),
'GOALS_HOME' => $goals_home,
'GOALS_GUEST' => $goals_guest,
'COLOR_STYLE' => color_style($row['status']),
'KOGOALS_HOME' => $kogoals_home,
'KOGOALS_GUEST' => $kogoals_guest,
'S_KO_MATCH' => $ko_match,
'S_EDIT_MATCH' => $edit_match,
)
);
}
$db->sql_freeresult($result);
// Calculate extra bets of matchday
// Start select team
$sql = 'SELECT
team_id AS option_value,
team_name AS option_name
FROM ' . FOOTB_TEAMS . "
WHERE season = $season
AND league = $league
ORDER BY team_name ASC";
$result = $db->sql_query($sql);
$option_rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
if ($edit_mode)
{
$template->assign_block_vars('worldfootball', array('LEAGUE' => $league-1,));
}
$sql = "SELECT e.*,
t1.team_name AS result_team
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)
WHERE e.season = $season
AND e.league = $league
AND e.matchday_eval = $matchday
ORDER BY e.extra_no ASC";
$result = $db->sql_query($sql);
$extra_results = false;
$extranumber = 0;
while ($row = $db->sql_fetchrow($result))
{
$extra_results = true;
$extranumber++ ;
$row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
switch($row['question_type'])
{
case '1':
{
$display_type = 1;
$eval_title = sprintf($user->lang['EXTRA_HIT']);
}
break;
case '2':
{
$display_type = 1;
$eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']);
}
break;
case '3':
{
$display_type = 2;
$eval_title = sprintf($user->lang['EXTRA_HIT']);
}
break;
case '4':
case '5':
{
$display_type = 2;
$eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']);
}
break;
default :
{
$display_type = 2;
$eval_title = '';
}
break;
}
if ($row['extra_status'] > 0 && $row['extra_status'] < 3 && $user_is_member)
{
$edit_mode = true;
$result_extra = ($row['result_team'] == NULL) ? '' : $row['result_team'];
$multiple = '';
switch($row['question_type'])
{
case '2':
{
$multiple = ' multiple="multiple" size="3" ';
}
break;
case '4':
{
$option_arr = array();
for ($i = 65; $i <= 72; $i++)
{
if (strstr($row['question'], chr($i) . ':'))
{
$option_arr[] = array(
'option_value' => chr($i),
'option_name' => chr($i),
);
}
}
if (sizeof($option_arr) > 1)
{
$display_type = 1;
$option_rows = $option_arr;
$result_extra = $row['result'];
$multiple = ' multiple="multiple" size="3" ';
}
}
break;
case '3':
{
$option_arr = array();
for ($i = 65; $i <= 72; $i++)
{
if (strstr($row['question'], chr($i) . ':'))
{
$option_arr[] = array(
'option_value' => chr($i),
'option_name' => chr($i),
);
}
}
if (sizeof($option_arr) > 1)
{
$display_type = 1;
$option_rows = $option_arr;
$result_extra = $row['result'];
}
}
break;
}
$template->assign_block_vars('extra_result', array(
'ROW_CLASS' => $row_class,
'EXTRA_NO' => $row['extra_no'],
'S_EDIT_EXTRA' => true,
'QUESTION' => $row['question'],
'EXTRA_POINTS' => $row['extra_points'],
'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
'EVALUATION_TITLE' => $eval_title,
'RESULT' => ($display_type == 1) ? $result_extra : $row['result'],
'S_DISPLAY_TYPE' => $display_type,
)
);
if ($display_type == 1)
{
$selected = ($row['result'] == '') ? ' selected="selected"' : '';
$template->assign_block_vars('extra_result.extra_option', array(
'OPTION_VALUE' => '',
'OPTION_NAME' => sprintf($user->lang['SELECT']),
'S_SELECTED' => $selected));
foreach ($option_rows as $option_row)
{
if (strstr($row['result'], ';'))
{
$selected = '';
$result_arr = explode(';', $row['result']);
foreach($result_arr AS $result_value)
{
if ($result_value <> '')
{
if ($option_row['option_value'] == $result_value)
{
$selected = ' selected="selected"';
}
}
}
}
else
{
$selected = ($option_row['option_value'] == $row['result']) ? ' selected="selected"' : '';
}
$template->assign_block_vars('extra_result.extra_option', array(
'OPTION_VALUE' => $option_row['option_value'],
'OPTION_NAME' => $option_row['option_name'],
'S_SELECTED' => $selected));
}
}
}
else
{
$extra_colorstyle = color_style($row['extra_status']);
$extra_result = ($row['result'] == '') ? '&nbsp;' : $row['result'];
$result_extra = ($row['result_team'] == NULL) ? '&nbsp;' : $row['result_team'];
$template->assign_block_vars('extra_result', array(
'ROW_CLASS' => $row_class,
'S_EDIT_EXTRA' => false,
'QUESTION' => $row['question'],
'EXTRA_POINTS' => $row['extra_points'],
'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
'RESULT' => ($display_type == 1) ? $result_extra : $extra_result,
'COLOR_STYLE' => $extra_colorstyle,
)
);
}
}
$sidename = sprintf($user->lang['RESULTS']);
switch ($league_info['bet_ko_type'])
{
case BET_KO_90:
$result_explain = sprintf($user->lang['MIN90']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
break;
case BET_KO_EXTRATIME:
$result_explain = sprintf($user->lang['EXTRATIME_SHORT']);
$label_finalresult = sprintf($user->lang['PENALTY']);
break;
case BET_KO_PENALTY:
$result_explain = sprintf($user->lang['PENALTY']);
$display_ko = false;
break;
default:
$result_explain = sprintf($user->lang['MIN90']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
break;
}
$template->assign_vars(array(
'S_DISPLAY_RESULTS' => true,
'S_EXTRA_RESULTS' => $extra_results,
'S_SIDENAME' => $sidename,
'RESULT_EXPLAIN' => $result_explain,
'LABEL_FINALRESULT' => $label_finalresult,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['ALL_BETS']),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'table', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => sprintf($user->lang['TABLE']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_ALL_BETS']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_TABLE']),
'S_FORM_ACTION_RESULT' => $this->helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'result')),
'S_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,
)
);
<?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_results = false;
$lang_dates = $user->lang['datetime'];
$matchnumber = 0;
$editstatus = array(1, 2, 4, 5);
$league_info = league_info($season, $league);
// Calculate matches AND results of matchday
$sql = "SELECT
m.match_no,
m.matchday,
m.status,
m.group_id,
m.formula_home,
m.formula_guest,
t1.team_symbol AS home_symbol,
t2.team_symbol AS guest_symbol,
t1.team_id AS home_id,
t2.team_id AS guest_id,
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_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.season = $season
AND m.league = $league
AND m.matchday = $matchday
ORDER BY m.match_datetime ASC, m.match_no ASC";
$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_results = true;
$matchnumber++ ;
$row_class = (!($matchnumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if (0 == $row['home_id'])
{
$home_info = get_team($season, $league, $row['match_no'], 'team_id_home', $row['formula_home']);
$home_in_array = explode("#",$home_info);
$homelogo = $home_in_array[0];
$homeid = $home_in_array[1];
$homename = $home_in_array[2];
$homeshort = $home_in_array[2];
}
else
{
$homelogo = $row['home_symbol'];
$homeid = $row['home_id'];
$homename = $row['home_name'];
$homeshort = $row['home_short'];
}
if (0 == $row['guest_id'])
{
$guest_info = get_team($season, $league, $row['match_no'], 'team_id_guest', $row['formula_guest']);
$guest_in_array = explode("#",$guest_info);
$guestlogo = $guest_in_array[0];
$guestid = $guest_in_array[1];
$guestname = $guest_in_array[2];
$guestshort = $guest_in_array[2];
}
else
{
$guestlogo = $row['guest_symbol'];
$guestid = $row['guest_id'];
$guestname = $row['guest_name'];
$guestshort = $row['guest_short'];
}
if ($homelogo <> '')
{
$logoH = "<img src=\"" . $ext_path . 'images/flags/' . $homelogo . "\" alt=\"" . $homelogo . "\" width=\"28\" height=\"28\"/>" ;
}
else
{
$logoH = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
}
if ($guestlogo <> '')
{
$logoG = "<img src=\"" . $ext_path . 'images/flags/' . $guestlogo . "\" alt=\"" . $guestlogo . "\" width=\"28\" height=\"28\"/>" ;
}
else
{
$logoG = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
}
if ($row['ko_match'])
{
$display_ko = true;
$ko_match = true;
}
else
{
$ko_match = false;
}
if ($row['group_id'] == '')
{
$group_id = '&nbsp;';
}
else
{
$display_group = true;
$group_id = $row['group_id'];
}
if (in_array($row['status'], $editstatus) AND $user_is_member)
{
$edit_mode = true;
$edit_match = true;
$goals_home = $row['goals_home'];
$goals_guest = $row['goals_guest'];
$kogoals_home = $row['kogoals_home'];
$kogoals_guest = $row['kogoals_guest'];
}
else
{
$edit_match = false;
$goals_home = ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'];
$goals_guest = ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'];
$kogoals_home = ($row['kogoals_home'] == '') ? '&nbsp;' : $row['kogoals_home'];
$kogoals_guest = ($row['kogoals_guest'] == '') ? '&nbsp;' : $row['kogoals_guest'];
}
$template->assign_block_vars('result', array(
'ROW_CLASS' => $row_class,
'MATCH_NUMBER' => $row['match_no'],
'MATCHDAY' => $row['matchday'],
'STATUS' => $row['status'],
'MATCH_TIME' => $row['match_time'],
'GROUP' => $group_id,
'HOME_ID' => $homeid,
'GUEST_ID' => $guestid,
'LOGO_HOME' => $logoH,
'LOGO_GUEST' => $logoG,
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'HOME_SHORT' => $homeshort,
'GUEST_SHORT' => $guestshort,
'U_PLAN_HOME' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $homeid, 'mode' => 'all')),
'U_PLAN_GUEST' => $this->helper->route('football_football_popup', array('popside' => 'viewplan_popup', 's' => $season, 'l' => $league,
'tid' => $guestid, 'mode' => 'all')),
'GOALS_HOME' => $goals_home,
'GOALS_GUEST' => $goals_guest,
'COLOR_STYLE' => color_style($row['status']),
'KOGOALS_HOME' => $kogoals_home,
'KOGOALS_GUEST' => $kogoals_guest,
'S_KO_MATCH' => $ko_match,
'S_EDIT_MATCH' => $edit_match,
)
);
}
$db->sql_freeresult($result);
// Calculate extra bets of matchday
// Start select team
$sql = 'SELECT
team_id AS option_value,
team_name AS option_name
FROM ' . FOOTB_TEAMS . "
WHERE season = $season
AND league = $league
ORDER BY team_name ASC";
$result = $db->sql_query($sql);
$option_rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
if ($edit_mode)
{
$template->assign_block_vars('worldfootball', array('LEAGUE' => $league-1,));
}
$sql = "SELECT e.*,
t1.team_name AS result_team
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)
WHERE e.season = $season
AND e.league = $league
AND e.matchday_eval = $matchday
ORDER BY e.extra_no ASC";
$result = $db->sql_query($sql);
$extra_results = false;
$extranumber = 0;
while ($row = $db->sql_fetchrow($result))
{
$extra_results = true;
$extranumber++ ;
$row_class = (!($extranumber % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
switch($row['question_type'])
{
case '1':
{
$display_type = 1;
$eval_title = sprintf($user->lang['EXTRA_HIT']);
}
break;
case '2':
{
$display_type = 1;
$eval_title = sprintf($user->lang['EXTRA_MULTI_HIT']);
}
break;
case '3':
{
$display_type = 2;
$eval_title = sprintf($user->lang['EXTRA_HIT']);
}
break;
case '4':
case '5':
{
$display_type = 2;
$eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']);
}
break;
default :
{
$display_type = 2;
$eval_title = '';
}
break;
}
if ($row['extra_status'] > 0 && $row['extra_status'] < 3 && $user_is_member)
{
$edit_mode = true;
$result_extra = ($row['result_team'] == NULL) ? '' : $row['result_team'];
$multiple = '';
switch($row['question_type'])
{
case '2':
{
$multiple = ' multiple="multiple" size="3" ';
}
break;
case '4':
{
$option_arr = array();
for ($i = 65; $i <= 72; $i++)
{
if (strstr($row['question'], chr($i) . ':'))
{
$option_arr[] = array(
'option_value' => chr($i),
'option_name' => chr($i),
);
}
}
if (sizeof($option_arr) > 1)
{
$display_type = 1;
$option_rows = $option_arr;
$result_extra = $row['result'];
$multiple = ' multiple="multiple" size="3" ';
}
}
break;
case '3':
{
$option_arr = array();
for ($i = 65; $i <= 72; $i++)
{
if (strstr($row['question'], chr($i) . ':'))
{
$option_arr[] = array(
'option_value' => chr($i),
'option_name' => chr($i),
);
}
}
if (sizeof($option_arr) > 1)
{
$display_type = 1;
$option_rows = $option_arr;
$result_extra = $row['result'];
}
}
break;
}
$template->assign_block_vars('extra_result', array(
'ROW_CLASS' => $row_class,
'EXTRA_NO' => $row['extra_no'],
'S_EDIT_EXTRA' => true,
'QUESTION' => $row['question'],
'EXTRA_POINTS' => $row['extra_points'],
'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
'EVALUATION_TITLE' => $eval_title,
'RESULT' => ($display_type == 1) ? $result_extra : $row['result'],
'S_DISPLAY_TYPE' => $display_type,
)
);
if ($display_type == 1)
{
$selected = ($row['result'] == '') ? ' selected="selected"' : '';
$template->assign_block_vars('extra_result.extra_option', array(
'OPTION_VALUE' => '',
'OPTION_NAME' => sprintf($user->lang['SELECT']),
'S_SELECTED' => $selected));
foreach ($option_rows as $option_row)
{
if (strstr($row['result'], ';'))
{
$selected = '';
$result_arr = explode(';', $row['result']);
foreach($result_arr AS $result_value)
{
if ($result_value <> '')
{
if ($option_row['option_value'] == $result_value)
{
$selected = ' selected="selected"';
}
}
}
}
else
{
$selected = ($option_row['option_value'] == $row['result']) ? ' selected="selected"' : '';
}
$template->assign_block_vars('extra_result.extra_option', array(
'OPTION_VALUE' => $option_row['option_value'],
'OPTION_NAME' => $option_row['option_name'],
'S_SELECTED' => $selected));
}
}
}
else
{
$extra_colorstyle = color_style($row['extra_status']);
$extra_result = ($row['result'] == '') ? '&nbsp;' : $row['result'];
$result_extra = ($row['result_team'] == NULL) ? '&nbsp;' : $row['result_team'];
$template->assign_block_vars('extra_result', array(
'ROW_CLASS' => $row_class,
'S_EDIT_EXTRA' => false,
'QUESTION' => $row['question'],
'EXTRA_POINTS' => $row['extra_points'],
'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
'RESULT' => ($display_type == 1) ? $result_extra : $extra_result,
'COLOR_STYLE' => $extra_colorstyle,
)
);
}
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['RESULTS']);
switch ($league_info['bet_ko_type'])
{
case BET_KO_90:
$result_explain = sprintf($user->lang['MIN90']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
break;
case BET_KO_EXTRATIME:
$result_explain = sprintf($user->lang['EXTRATIME_SHORT']);
$label_finalresult = sprintf($user->lang['PENALTY']);
break;
case BET_KO_PENALTY:
$result_explain = sprintf($user->lang['PENALTY']);
$display_ko = false;
break;
default:
$result_explain = sprintf($user->lang['MIN90']);
$label_finalresult = sprintf($user->lang['EXTRATIME_SHORT']) . '/' . sprintf($user->lang['PENALTY_SHORT']);
break;
}
$template->assign_vars(array(
'S_DISPLAY_RESULTS' => true,
'S_EXTRA_RESULTS' => $extra_results,
'S_SIDENAME' => $sidename,
'RESULT_EXPLAIN' => $result_explain,
'LABEL_FINALRESULT' => $label_finalresult,
'S_FORM_ACTION_RESULT' => $this->helper->route('football_main_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'result')),
'S_DATA_RESULTS' => $data_results,
'S_USER_IS_MEMBER' => $user_is_member,
'S_DISPLAY_GROUP' => $display_group,
'S_DISPLAY_KO' => $display_ko,
'S_EDIT_MODE' => $edit_mode,
)
);
?>

View File

@@ -1,145 +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=\"28\" height=\"28\"/>" ;
}
else
{
$logo = "<img src=\"" . $ext_path . "images/flags/blank.gif\" alt=\"\" width=\"28\" height=\"28\"/>" ;
}
$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,
)
);
}
<?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
/**
*
* @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 = false;
$data_all = false;
$rank = 0;
$sql = 'SELECT
r.user_id,
u.username,
r.*
FROM ' . FOOTB_RANKS . ' AS r
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
WHERE season = $season
AND league = $league
ORDER BY r.points DESC";
$result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result))
{
$data = true;
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('top20', array(
'ROW_CLASS' => $row_class,
'NAME' => $row['username'],
'MATCHDAY' => $row['matchday'],
'POINTS' => $row['points'],
'WIN' => $row['win'],
'DIRECTHITS' => $row['correct_result'],
'TENDENCIES' => $row['tendencies'] - $row['correct_result'],
'TOTAL' => $row['tendencies'],
)
);
}
$db->sql_freeresult($result);
$rank = 0;
$sql = 'SELECT
r.user_id,
u.username,
r.*
FROM ' . FOOTB_RANKS . ' AS r
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
WHERE r.season = $season
AND r.league = $league
ORDER BY r.points ASC";
$result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result))
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('flop20', array(
'ROW_CLASS' => $row_class,
'NAME' => $row['username'],
'MATCHDAY' => $row['matchday'],
'POINTS' => $row['points'],
'DIRECTHITS' => $row['correct_result'],
'TENDENCIES' => $row['tendencies'] - $row['correct_result'],
'TOTAL' => $row['tendencies'],
)
);
}
$db->sql_freeresult($result);
$rank = 0;
$sql = 'SELECT
r.user_id,
u.username,
r.*
FROM ' . FOOTB_RANKS . ' AS r
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
WHERE league = $league
ORDER BY r.points DESC";
$result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result))
{
$data_all = true;
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('alltop20', array(
'ROW_CLASS' => $row_class,
'NAME' => $row['username'],
'SEASON' => $row['season'],
'MATCHDAY' => $row['matchday'],
'POINTS' => $row['points'],
'WIN' => $row['win'],
'DIRECTHITS' => $row['correct_result'],
'TENDENCIES' => $row['tendencies'] - $row['correct_result'],
'TOTAL' => $row['tendencies'],
)
);
}
$db->sql_freeresult($result);
$rank = 0;
$sql = 'SELECT
r.user_id,
u.username,
COUNT(points) AS count_zero
FROM ' . FOOTB_RANKS . ' AS r
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
WHERE r.league = $league
AND r.points = 0
GROUP BY r.user_id
ORDER BY count_zero DESC";
$result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result))
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('allflop20', array(
'ROW_CLASS' => $row_class,
'NAME' => $row['username'],
'COUNTZERO' => $row['count_zero'],
)
);
}
$db->sql_freeresult($result);
$league_info = league_info($season, $league);
$sidename = sprintf($user->lang['STAT_POINTS']);
$template->assign_vars(array(
'S_DISPLAY_STAT_POINTS' => true,
'S_MATCHDAY_HIDE' => true,
'S_SIDENAME' => $sidename,
'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['MY_KOEFF']),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'stat_results', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => sprintf($user->lang['STAT_RESULTS']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_MY_KOEFF']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_STAT_RESULTS']),
'S_DATA_STAT_POINTS' => $data,
'S_DATA_ALL_POINTS' => $data_all,
'SEASON' => $season,
'LEAGUE' => $league,
)
);
<?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 = false;
$data_all = false;
$rank = 0;
$sql = 'SELECT
r.user_id,
u.username,
r.*
FROM ' . FOOTB_RANKS . ' AS r
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
WHERE season = $season
AND league = $league
ORDER BY r.points DESC";
$result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result))
{
$data = true;
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('top20', array(
'ROW_CLASS' => $row_class,
'NAME' => $row['username'],
'MATCHDAY' => $row['matchday'],
'POINTS' => $row['points'],
'WIN' => $row['win'],
'DIRECTHITS' => $row['correct_result'],
'TENDENCIES' => $row['tendencies'] - $row['correct_result'],
'TOTAL' => $row['tendencies'],
)
);
}
$db->sql_freeresult($result);
$rank = 0;
$sql = 'SELECT
r.user_id,
u.username,
r.*
FROM ' . FOOTB_RANKS . ' AS r
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
WHERE r.season = $season
AND r.league = $league
ORDER BY r.points ASC";
$result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result))
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('flop20', array(
'ROW_CLASS' => $row_class,
'NAME' => $row['username'],
'MATCHDAY' => $row['matchday'],
'POINTS' => $row['points'],
'DIRECTHITS' => $row['correct_result'],
'TENDENCIES' => $row['tendencies'] - $row['correct_result'],
'TOTAL' => $row['tendencies'],
)
);
}
$db->sql_freeresult($result);
$rank = 0;
$sql = 'SELECT
r.user_id,
u.username,
r.*
FROM ' . FOOTB_RANKS . ' AS r
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
WHERE league = $league
ORDER BY r.points DESC";
$result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result))
{
$data_all = true;
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('alltop20', array(
'ROW_CLASS' => $row_class,
'NAME' => $row['username'],
'SEASON' => $row['season'],
'MATCHDAY' => $row['matchday'],
'POINTS' => $row['points'],
'WIN' => $row['win'],
'DIRECTHITS' => $row['correct_result'],
'TENDENCIES' => $row['tendencies'] - $row['correct_result'],
'TOTAL' => $row['tendencies'],
)
);
}
$db->sql_freeresult($result);
$rank = 0;
$sql = 'SELECT
r.user_id,
u.username,
COUNT(points) AS count_zero
FROM ' . FOOTB_RANKS . ' AS r
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = r.user_id)
WHERE r.league = $league
AND r.points = 0
GROUP BY r.user_id
ORDER BY count_zero DESC";
$result = $db->sql_query_limit($sql, 20);
while($row = $db->sql_fetchrow($result))
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('allflop20', array(
'ROW_CLASS' => $row_class,
'NAME' => $row['username'],
'COUNTZERO' => $row['count_zero'],
)
);
}
$db->sql_freeresult($result);
$league_info = league_info($season, $league);
$sidename = sprintf($user->lang['STAT_POINTS']);
$template->assign_vars(array(
'S_DISPLAY_STAT_POINTS' => true,
'S_MATCHDAY_HIDE' => true,
'S_SIDENAME' => $sidename,
'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true,
'S_DATA_STAT_POINTS' => $data,
'S_DATA_ALL_POINTS' => $data_all,
'SEASON' => $season,
'LEAGUE' => $league,
)
);
?>

View File

@@ -1,146 +1,140 @@
<?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 = false;
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$rank = 0;
// Select results and count
$sql = 'SELECT
COUNT(DISTINCT(m.match_no)) AS count_result,
COUNT(m.match_no) AS count_bets,
m.goals_home,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)
)
) AS hits,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
)
) AS tendencies,
' . select_points('m',true) . '
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)
WHERE m.season = $season
AND m.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND (m.status IN (3,6))
AND m.matchday <= $matchday
GROUP BY m.goals_home, m.goals_guest
ORDER BY count_bets DESC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$data = true;
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('result', array(
'ROW_CLASS' => $row_class,
'GOALS_HOME' => $row['goals_home'],
'GOALS_GUEST' => $row['goals_guest'],
'RESULTS' => $row['count_result'],
'BETS' => $row['count_bets'],
'HITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'],
'AVERAGE' => round($row['points'] / $row['count_bets'],1),
)
);
}
$db->sql_freeresult($result);
// Get goaldifferences by team
$sql = "SELECT
t.*,
SUM(1) AS matches,
SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS wins,
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 = (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 + 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 + 0 > (goals_guest + 2), 1, 0))) AS minus3,
SUM(IF(m.team_id_home = t.team_id,
IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)),
IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))
)
) AS points,
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_guest , goals_home)) AS goals_get
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))
WHERE t.season = $season
AND t.league = $league
AND m.season = $season
AND m.league = $league
AND m.status IN (3,6)
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY points DESC, goal_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$rank = 0;
while($row = $db->sql_fetchrow($result))
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('points', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank,
'LOGO' => $logo,
'TEAM' => $row['team_name_short'],
'MATCHES' => $row['matches'],
'PLUS3' => $row['plus3'],
'PLUS2' => $row['plus2'],
'PLUS1' => $row['plus1'],
'DRAW' => $row['draw'],
'MINUS1' => $row['minus1'],
'MINUS2' => $row['minus2'],
'MINUS3' => $row['minus3'],
'GOALS_DIFF' => $row['goal_diff'],
'POINTS' => $row['points'],
)
);
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['STAT_RESULTS']);
$template->assign_vars(array(
'S_DISPLAY_STAT_RESULTS' => true,
'S_SIDENAME' => $sidename,
'U_LEFT' => $this->helper->route('football_main_controller', array('side' => 'stat_points', 's' => $season, 'l' => $league, 'm' => $matchday)),
'LEFT_LINK' => '&lt; ' . sprintf($user->lang['STAT_POINTS']),
'U_RIGHT' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday)),
'RIGHT_LINK' => sprintf($user->lang['BET']) . ' &gt;',
'LEFT_TITLE' => sprintf($user->lang['TITLE_STAT_POINTS']),
'RIGHT_TITLE' => sprintf($user->lang['TITLE_BET']),
'S_DATA_STAT_RESULTS' => $data,
'SEASON' => $season,
'LEAGUE' => $league,
)
);
<?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 = false;
$ext_path = $this->phpbb_path_helper->update_web_root_path($this->phpbb_extension_manager->get_extension_path('football/football', true));
$rank = 0;
// Select results and count
$sql = 'SELECT
COUNT(DISTINCT(m.match_no)) AS count_result,
COUNT(m.match_no) AS count_bets,
m.goals_home,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 1, 0)
)
) AS hits,
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 + 0 > b.goals_guest) <> (m.goals_home + 0 > m.goals_guest),
0,
IF((b.goals_home = m.goals_home) AND (b.goals_guest = m.goals_guest), 0, 1)
)
) AS tendencies,
' . select_points('m',true) . '
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)
WHERE m.season = $season
AND m.league = $league
AND b.goals_home <> ''
AND b.goals_guest <> ''
AND (m.status IN (3,6))
AND m.matchday <= $matchday
GROUP BY m.goals_home, m.goals_guest
ORDER BY count_bets DESC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$data = true;
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('result', array(
'ROW_CLASS' => $row_class,
'GOALS_HOME' => $row['goals_home'],
'GOALS_GUEST' => $row['goals_guest'],
'RESULTS' => $row['count_result'],
'BETS' => $row['count_bets'],
'HITS' => $row['hits'],
'TENDENCIES' => $row['tendencies'],
'TOTAL' => $row['hits'] + $row['tendencies'],
'POINTS' => $row['points'],
'AVERAGE' => round($row['points'] / $row['count_bets'],1),
)
);
}
$db->sql_freeresult($result);
// Get goaldifferences by team
$sql = "SELECT
t.*,
SUM(1) AS matches,
SUM(IF((m.team_id_home = t.team_id), IF(goals_home + 0 > goals_guest, 1, 0), IF(goals_home + 0 < goals_guest, 1, 0))) AS wins,
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 = (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 + 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 + 0 > (goals_guest + 2), 1, 0))) AS minus3,
SUM(IF(m.team_id_home = t.team_id,
IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)),
IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))
)
) AS points,
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_guest , goals_home)) AS goals_get
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))
WHERE t.season = $season
AND t.league = $league
AND m.season = $season
AND m.league = $league
AND m.status IN (3,6)
AND m.matchday <= $matchday
GROUP BY t.team_id
ORDER BY points DESC, goal_diff DESC, goals DESC";
$result = $db->sql_query($sql);
$rank = 0;
while($row = $db->sql_fetchrow($result))
{
$rank++;
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $row['team_symbol'] . "\" alt=\"" . $row['team_symbol'] . "\" width=\"28\" height=\"28\"/>" ;
$template->assign_block_vars('points', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank,
'LOGO' => $logo,
'TEAM' => $row['team_name_short'],
'MATCHES' => $row['matches'],
'PLUS3' => $row['plus3'],
'PLUS2' => $row['plus2'],
'PLUS1' => $row['plus1'],
'DRAW' => $row['draw'],
'MINUS1' => $row['minus1'],
'MINUS2' => $row['minus2'],
'MINUS3' => $row['minus3'],
'GOALS_DIFF' => $row['goal_diff'],
'POINTS' => $row['points'],
)
);
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['STAT_RESULTS']);
$template->assign_vars(array(
'S_DISPLAY_STAT_RESULTS' => true,
'S_SIDENAME' => $sidename,
'S_DATA_STAT_RESULTS' => $data,
'SEASON' => $season,
'LEAGUE' => $league,
)
);
?>

View File

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

@@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "Football Prediction League",
"homepage": "http://football.bplaced.net",
"version": "0.9.8",
"time": "2017-02-19",
"version": "0.9.9",
"time": "2017-09-09",
"license": "GPL-2.0",
"authors": [{
"name": "J. Helmke",
@@ -18,7 +18,7 @@
"extra": {
"display-name": "Football Prediction League",
"soft-require": {
"phpbb/phpbb": "3.1.*"
"phpbb/phpbb": ">3.1.*"
},
"version-check": {
"host": "football.bplaced.net",

View File

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

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

View File

@@ -126,13 +126,14 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
{
$matchday_status = 2;
}
$db->sql_freeresult($result);
}
if ($matchday_status == 0 OR $matchday_status == 1)
{
// No matches played, so we can delete the ranking
$sql = 'DELETE FROM ' . FOOTB_RANKS . " WHERE season = $season AND league = $league AND matchday = $matchday";
$result = $db->sql_query($sql);
$db->sql_query($sql);
}
else
{
@@ -280,7 +281,7 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
,0
,0
)";
$result = $db->sql_query($sql);
$db->sql_query($sql);
}
if ( sizeof($ranking_ary) == 0 )
{
@@ -288,7 +289,7 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
WHERE season = $season
AND league = $league
AND matchday = $matchday";
$result = $db->sql_query($sql);
$db->sql_query($sql);
}
else
{
@@ -389,7 +390,7 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
points_total = $points_total,
win_total = $win_total
WHERE season = $season AND league = $league AND matchday = $matchday AND user_id = $curr_userid";
$result = $db->sql_query($sql);
$db->sql_query($sql);
}
}
}
@@ -427,9 +428,9 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
$result = $db->sql_query($sql);
if ( $next_matchday = (int) $db->sql_fetchfield('matchday'))
{
$db->sql_freeresult($result);
save_ranking_matchday($season, $league, $next_matchday, $cash);
}
$db->sql_freeresult($result);
}
}
@@ -480,7 +481,7 @@ function rollback_points($points_type, $season, $league, $matchday, $cash)
}
$sql = 'DELETE FROM ' . FOOTB_POINTS . " WHERE season = $season AND league = $league AND matchday = $matchday AND points_type = $points_type";
$result = $db->sql_query($sql);
$db->sql_query($sql);
}
function set_footb_points($points_type, $season, $league, $matchday, $wins, $cash)
@@ -897,7 +898,7 @@ function set_bet_in_time_delivery($season, $league)
'goals_overtime_home' => '',
'goals_overtime_guest' => '',
);
$local_board_time = time() + (($config['board_timezone'] - $config['football_host_timezone']) * 3600);
$local_board_time = time() + ($config['football_time_shift'] * 3600);
$sql = 'UPDATE ' . FOOTB_MATCHES . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE season = $season AND league = $league AND matchday =" . $row['matchday'] . " AND match_datetime > FROM_UNIXTIME('$local_board_time')";
@@ -1166,7 +1167,7 @@ function close_open_matchdays()
{
global $db, $lang, $config;
$local_board_time = time() + (($config['board_timezone'] - $config['football_host_timezone']) * 3600);
$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')";
$result = $db->sql_query($sql);
$toclose = $db->sql_fetchrowset($result);

View File

@@ -193,6 +193,7 @@ $lang = array_merge($lang, array(
'LAST_GAMES' => 'Die letzten Spiele',
'LAST_GAMES_AWAY' => 'Die letzten Auswärtsspiele',
'LAST_GAMES_HOME' => 'Die letzten Heimspiele',
'LAST_RESULTS' => 'Die letzten Ergebnisse',
'LAST_VISITORS' => 'Die letzten %s Besuche',
'LEAGUE' => 'Liga',
'LINK_PREDICTION_LEAGUE' => 'Zur Tipprunde',

View File

@@ -37,7 +37,7 @@ if ( empty($lang) || !is_array($lang) )
// » „ “ — …
//
$help = array(
$lang = array_merge($lang, array('FOOTBALL_HELP_FAQ' => array(
array(
0 => '--',
1 => 'Erste Schritte'
@@ -527,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 zu erzwingen.'
),
);
)));
?>

View File

@@ -48,6 +48,10 @@ $lang = array_merge($lang, array(
'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. ',
'DISPLAY_LAST_USERS' => 'Anzahl anzuzeigender letzter Besucher des Forums',
'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',
'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. ',
'DISPLAY_RANKS' => 'Anzahl angezeigter Tipper in den Übersichts-Ranglisten',
'DISPLAY_RANKS_EXPLAIN' => 'Limitiert die Anzeige der Spieltags- und Gesamtrangliste in der Hauptansicht. Die eigene Platzierung wird ggf. unten angehängt. ',
@@ -75,8 +79,8 @@ $lang = array_merge($lang, array(
'USER_VIEW' => 'Tipprunde nur für Teilnehmer sichtbar',
'USER_VIEW_EXPLAIN' => 'Soll die Tipprunde nur für Tipprunden-Teilnehmer 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. ',
'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. ',
'LEFT_COLUMN' => 'Spaltenbreite Links in Pixeln',
'LEFT_COLUMN_EXPLAIN' => 'Optimale Breite 180 Pixel. Dieser Wert sollte nicht unterschritten werden. ',

View File

@@ -185,6 +185,7 @@ $lang = array_merge($lang, array(
'LAST_GAMES' => 'The last matches',
'LAST_GAMES_AWAY' => 'The last away matches',
'LAST_GAMES_HOME' => 'The last home matches',
'LAST_RESULTS' => 'Last results',
'LAST_VISITORS' => 'Last %s visitors',
'LEAGUE' => 'League',
'LINK_PREDICTION_LEAGUE' => 'To the WebtTip',

View File

@@ -40,7 +40,7 @@ if ( empty($lang) || !is_array($lang) )
// » „ “ — …
//
$help = array(
$lang = array_merge($lang, array('FOOTBALL_HELP_FAQ' => array(
array(
0 => '--',
1 => 'First steps'
@@ -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
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. ',
'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). ',
'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_EXPLAIN' => 'Announcement of users in the ranking lists. The ownrank is suspended if necessary below. ',
'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?',
'USER_VIEW' => 'Prediction League only for participants visible',
'USER_VIEW_EXPLAIN' => 'Should the Prediction League only to participants be visible?',
'HOST_TIMEZONE' => 'Host Timezone',
'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' => 'Time shift',
'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_EXPLAIN' => 'Optimum width 180 pixels. This value should not be fell short. ',
'PREDICTION_LEAGUE' => 'Prediction League',

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_EDIT_MODE -->
<form method="post" action="{S_FORM_ACTION_BET}" name="betform">
<!-- 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 />
<!-- ENDIF -->
<div class="forabg">
<table class="football">
<thead>
<tr>
<th>{L_DATE}</th>
<th style="text-align: right;">{L_NR}</th>
<!-- IF S_DATA_GROUP -->
<th>{L_GR}</th>
<!-- ENDIF -->
<th style="text-align: center;" colspan="5">{L_VS}</th>
<th style="text-align: center;" colspan="4">{L_BET_OF} ({BET_EXPLAIN})</th>
<!-- IF S_DISPLAY_RATING -->
<th style="text-align: center;">{L_RATING}</th>
<!-- ENDIF -->
<!-- IF S_DATA_BET_RESULTS -->
<th style="text-align: center;" colspan="3">{L_RESULT}</th>
<th>{L_POINTS}</th>
<!-- ENDIF -->
<th></th>
</tr>
</thead>
<tbody>
<!-- BEGIN bet_view -->
<tr class="{bet_view.ROW_CLASS}">
<td>{bet_view.MATCH_TIME}</td>
<td class="td_match_no">{bet_view.MATCH_NUMBER}</td>
<!-- IF S_DATA_GROUP -->
<td class="td_group">{bet_view.GROUP}</td>
<!-- ENDIF -->
<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;">
{bet_view.HOME_NAME}</td>
<td class="td_vs">:</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;">
{bet_view.GUEST_NAME}</td>
<td class="td_goals_home">{bet_view.BET_HOME}</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_vs"></td>
<!-- IF S_DISPLAY_RATING -->
<td class="td_points">{bet_view.RATING}</td>
<!-- ENDIF -->
<td class="td_goals_home {bet_view.COLOR_STYLE}">{bet_view.GOALS_HOME}</td>
<td class="td_vs">:</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_button">
<!-- 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>
<!-- ELSE -->
<img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" />
<!-- ENDIF -->
</td>
</tr>
<!-- END bet_view -->
<!-- BEGIN bet_edit -->
<tr class="{bet_edit.ROW_CLASS}">
<td class="td_datetime">{bet_edit.MATCH_TIME}</td>
<td class="td_match_no">{bet_edit.MATCH_NUMBER}</td>
<!-- IF S_DATA_GROUP -->
<td class="td_group">{bet_edit.GROUP}</td>
<!-- ENDIF -->
<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;">
{bet_edit.HOME_NAME}
</td>
<td class="td_vs">:</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;">
{bet_edit.GUEST_NAME}
</td>
<td class="td_goals_home">
<!-- 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}">
<!-- ELSE -->
_{bet_edit.BET_HOME}_
<!-- ENDIF -->
</td>
<td class="td_vs">:</td>
<td class="td_goals_guest" title="{bet_edit.TREND} {bet_edit.ODDS}">
<!-- 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}">
<!-- ELSE -->
_{bet_edit.BET_GUEST}_
<!-- ENDIF -->
</td>
<td class="td_vs">{bet_edit.DELIVERTAG}</td>
<!-- IF S_DISPLAY_RATING -->
<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}">
</td>
<!-- ENDIF -->
<!-- IF bet_edit.DATA_RESULTS -->
<td class="td_goals_home">&nbsp;</td>
<td class="td_vs">&nbsp;</td>
<td class="td_goals_guest">&nbsp;</td>
<td class="td_points">&nbsp;</td>
<!-- ENDIF -->
<td class="td_button">
<!-- 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>
<!-- ELSE -->
<img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" />
<!-- ENDIF -->
</td>
</tr>
<!-- END bet_edit -->
</tbody>
</table>
</div>
<!-- IF S_DISPLAY_DELIVERY2 or S_DISPLAY_DELIVERY3 -->
<div class="left-box" style="margin-bottom:5px">
<!-- IF S_DISPLAY_DELIVERY2 -->
<strong style='color:green'>*&nbsp; {L_DELIVERY_UNTIL} {S_DELIVERY2} </strong><br />
<!-- ENDIF -->
<!-- IF S_DISPLAY_DELIVERY3 -->
<strong style='color:green'>**&nbsp; {L_DELIVERY_UNTIL} {S_DELIVERY3} </strong><br />
<!-- ENDIF -->
</div>
<!-- ENDIF -->
<!-- IF S_EXTRA_BET -->
<br />
<div class="forabg">
<table class="football">
<thead>
<tr>
<th style="text-align: left;">{L_QUESTION}</th>
<th>{L_POSSIBLE_POINTS}</th>
<th>{L_EVALUATION}</th>
<th>{L_BET_OF}</th>
<!-- IF S_EXTRA_RESULTS -->
<th>{L_RESULT}</th>
<th>{L_POINTS}</th>
<!-- ENDIF -->
</tr>
</thead>
<tbody>
<!-- BEGIN extra_view -->
<tr class="{extra_view.ROW_CLASS}">
<td>{extra_view.QUESTION}</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.BET}</td>
<td style="text-align: center;">{extra_view.RESULT}</td>
<td class="td_points {extra_view.COLOR_STYLE}">{extra_view.BET_POINTS}</td>
</tr>
<!-- END extra_view -->
<!-- BEGIN extra_edit -->
<tr class="{extra_edit.ROW_CLASS}" style="height:30px">
<td>{extra_edit.QUESTION}</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;">
<!-- IF extra_edit.S_DISPLAY_TYPE == 1 -->
<!-- IF S_VIEW <> 'print' -->
<select name="extra{extra_edit.EXTRA_NO}">
<!-- BEGIN extra_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 -->
</select>
<!-- ELSE -->
_{extra_edit.BET}_
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF extra_edit.S_DISPLAY_TYPE == 2 -->
<!-- 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}">
<!-- ELSE -->
_{extra_edit.BET}_
<!-- ENDIF -->
<!-- ENDIF -->
</td>
</tr>
<!-- END extra_edit -->
</tbody>
</table>
</div>
<!-- ENDIF -->
<!-- IF S_EDIT_MODE -->
<!-- IF S_VIEW <> 'print' -->
<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>
<!-- ENDIF -->
</form>
<!-- ELSE -->
<br />
<!-- ENDIF -->
<!-- INCLUDE nav_delivery.html -->
<!-- ELSE -->
<br />
<!-- IF S_USER_IS_MEMBER -->
<div class="message">{L_NO_MATCHES_ON_MATCHDAY}</div>
<!-- ELSE -->
<div class="message">{L_NO_MEMBER}</div>
<!-- IF S_JOIN_LEAGUE -->
<br />
<br />
<div>
<form method="post" action="{S_FORM_ACTION_JOIN}" name="joinform">
<strong>{JOIN_LEAGUE} </strong><br />
<br />
<input class="button1" type="submit" value="{L_JOIN}">
</form>
</div>
<!-- ENDIF -->
<!-- ENDIF -->
<br />
<!-- ENDIF -->
<!-- IF S_DATA_BET -->
<!-- IF S_EDIT_MODE -->
<form method="post" action="{S_FORM_ACTION_BET}" name="betform">
<!-- 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 />
<!-- ENDIF -->
<div class="forabg">
<table class="football">
<thead>
<tr>
<th>{L_DATE}</th>
<th style="text-align: right;">{L_NR}</th>
<!-- IF S_DATA_GROUP -->
<th>{L_GR}</th>
<!-- ENDIF -->
<th style="text-align: center;" colspan="5">{L_VS}</th>
<th style="text-align: center;" colspan="4">{L_BET_OF} ({BET_EXPLAIN})</th>
<!-- IF S_DISPLAY_RATING -->
<th style="text-align: center;">{L_RATING}</th>
<!-- ENDIF -->
<!-- IF S_DATA_BET_RESULTS -->
<th style="text-align: center;" colspan="3">{L_RESULT}</th>
<th>{L_POINTS}</th>
<!-- ENDIF -->
<th></th>
</tr>
</thead>
<tbody>
<!-- BEGIN bet_view -->
<tr class="{bet_view.ROW_CLASS}">
<td>{bet_view.MATCH_TIME}</td>
<td class="td_match_no">{bet_view.MATCH_NUMBER}</td>
<!-- IF S_DATA_GROUP -->
<td class="td_group">{bet_view.GROUP}</td>
<!-- ENDIF -->
<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;">
{bet_view.HOME_NAME}</td>
<td class="td_vs">:</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;">
{bet_view.GUEST_NAME}</td>
<td class="td_goals_home">{bet_view.BET_HOME}</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_vs"></td>
<!-- IF S_DISPLAY_RATING -->
<td class="td_points">{bet_view.RATING}</td>
<!-- ENDIF -->
<td class="td_goals_home {bet_view.COLOR_STYLE}">{bet_view.GOALS_HOME}</td>
<td class="td_vs">:</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_button">
<!-- IF S_VIEW <> 'print' and bet_view.DISPLAY_LINK -->
<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 -->
<img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" />
<!-- ENDIF -->
</td>
</tr>
<!-- END bet_view -->
<!-- BEGIN bet_edit -->
<tr class="{bet_edit.ROW_CLASS}">
<td class="td_datetime">{bet_edit.MATCH_TIME}</td>
<td class="td_match_no">{bet_edit.MATCH_NUMBER}</td>
<!-- IF S_DATA_GROUP -->
<td class="td_group">{bet_edit.GROUP}</td>
<!-- ENDIF -->
<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;">
{bet_edit.HOME_NAME}
</td>
<td class="td_vs">:</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;">
{bet_edit.GUEST_NAME}
</td>
<td class="td_goals_home">
<!-- 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}">
<!-- ELSE -->
_{bet_edit.BET_HOME}_
<!-- ENDIF -->
</td>
<td class="td_vs">:</td>
<td class="td_goals_guest" title="{bet_edit.TREND} {bet_edit.ODDS}">
<!-- 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}">
<!-- ELSE -->
_{bet_edit.BET_GUEST}_
<!-- ENDIF -->
</td>
<td class="td_vs">{bet_edit.DELIVERTAG}</td>
<!-- IF S_DISPLAY_RATING -->
<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}">
</td>
<!-- ENDIF -->
<!-- IF bet_edit.DATA_RESULTS -->
<td class="td_goals_home">&nbsp;</td>
<td class="td_vs">&nbsp;</td>
<td class="td_goals_guest">&nbsp;</td>
<td class="td_points">&nbsp;</td>
<!-- ENDIF -->
<td class="td_button">
<!-- IF S_VIEW <> 'print' and bet_edit.DISPLAY_LINK -->
<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 -->
<img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" />
<!-- ENDIF -->
</td>
</tr>
<!-- END bet_edit -->
</tbody>
</table>
</div>
<!-- IF S_DISPLAY_DELIVERY2 or S_DISPLAY_DELIVERY3 -->
<div class="left-box" style="margin-bottom:5px">
<!-- IF S_DISPLAY_DELIVERY2 -->
<strong style='color:green'>*&nbsp; {L_DELIVERY_UNTIL} {S_DELIVERY2} </strong><br />
<!-- ENDIF -->
<!-- IF S_DISPLAY_DELIVERY3 -->
<strong style='color:green'>**&nbsp; {L_DELIVERY_UNTIL} {S_DELIVERY3} </strong><br />
<!-- ENDIF -->
</div>
<!-- ENDIF -->
<!-- IF S_EXTRA_BET -->
<br />
<div class="forabg">
<table class="football">
<thead>
<tr>
<th style="text-align: left;">{L_QUESTION}</th>
<th>{L_POSSIBLE_POINTS}</th>
<th>{L_EVALUATION}</th>
<th>{L_BET_OF}</th>
<!-- IF S_EXTRA_RESULTS -->
<th>{L_RESULT}</th>
<th>{L_POINTS}</th>
<!-- ENDIF -->
</tr>
</thead>
<tbody>
<!-- BEGIN extra_view -->
<tr class="{extra_view.ROW_CLASS}">
<td>{extra_view.QUESTION}</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.BET}</td>
<td style="text-align: center;">{extra_view.RESULT}</td>
<td class="td_points {extra_view.COLOR_STYLE}">{extra_view.BET_POINTS}</td>
</tr>
<!-- END extra_view -->
<!-- BEGIN extra_edit -->
<tr class="{extra_edit.ROW_CLASS}" style="height:30px">
<td>{extra_edit.QUESTION}</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;">
<!-- IF extra_edit.S_DISPLAY_TYPE == 1 -->
<!-- IF S_VIEW <> 'print' -->
<select name="extra{extra_edit.EXTRA_NO}">
<!-- BEGIN extra_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 -->
</select>
<!-- ELSE -->
_{extra_edit.BET}_
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF extra_edit.S_DISPLAY_TYPE == 2 -->
<!-- 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}">
<!-- ELSE -->
_{extra_edit.BET}_
<!-- ENDIF -->
<!-- ENDIF -->
</td>
</tr>
<!-- END extra_edit -->
</tbody>
</table>
</div>
<!-- ENDIF -->
<!-- IF S_EDIT_MODE -->
<!-- IF S_VIEW <> 'print' -->
<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>
<!-- ENDIF -->
</form>
<!-- ELSE -->
<br />
<!-- ENDIF -->
<!-- INCLUDE nav_delivery.html -->
<!-- ELSE -->
<br />
<!-- IF S_USER_IS_MEMBER -->
<div class="message">{L_NO_MATCHES_ON_MATCHDAY}</div>
<!-- ELSE -->
<div class="message">{L_NO_MEMBER}</div>
<!-- IF S_JOIN_LEAGUE -->
<br />
<br />
<div>
<form method="post" action="{S_FORM_ACTION_JOIN}" name="joinform">
<strong>{JOIN_LEAGUE} </strong><br />
<br />
<input class="button1" type="submit" value="{L_JOIN}">
</form>
</div>
<!-- ENDIF -->
<!-- ENDIF -->
<br />
<!-- ENDIF -->

View File

@@ -1,11 +1,11 @@
<div class="panel">
<h3><span class="small-icon icon-bet"></span>&nbsp;{L_DELIVERY_LIST}</h3>
<!-- BEGIN delivery -->
<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 class="gensmall"><strong>{delivery.LEAGUE_SHORT} </strong></span>
<span class="gensmall" >{delivery.MATCHDAY_NAME}</span>
</span><hr />
<!-- END delivery -->
</div>
<div class="panel">
<h3><i class="icon fa-calendar fa-fw"></i>{L_DELIVERY_LIST}</h3>
<!-- BEGIN delivery -->
<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 class="gensmall"><strong>{delivery.LEAGUE_SHORT} </strong></span>
<span class="gensmall" >{delivery.MATCHDAY_NAME}</span>
</span><hr />
<!-- END delivery -->
</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

@@ -10,16 +10,15 @@
<!-- IF S_FOOTBALL_HEADER_ENABLED -->
<style>
@media screen and (min-width: 700px){
.site_logo {
.imageset.site_logo {
background-image: url({S_FOOTBALL_EXT_PATH}images/site_logo.gif);
padding-left: 0px;
padding-top: 0px;
height: 52px;
width: 52px;
height: 75px;
width: 75px;
}
.headerbar {
background: url({S_FOOTBALL_EXT_PATH}styles/prosilver/theme/images/header{S_FOOTBALL_HEADER_LEAGUE}.gif) 300px 5px no-repeat,
url({S_FOOTBALL_EXT_PATH}styles/prosilver/theme/images/header.jpg) 0px 0px;
background: url({S_FOOTBALL_EXT_PATH}styles/prosilver/theme/images/header{S_FOOTBALL_HEADER_LEAGUE}.jpg) 0px 0px no-repeat;
background-color: #12A3EB;
margin-bottom: 4px;
width: auto;
@@ -27,3 +26,11 @@
}
</style>
<!-- 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 -->
<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">
<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">
<span class="username">{S_FOOTBALL_NAME}</span></a>
<div class="dropdown hidden">
<div class="pointer"><div class="pointer-inner"></div></div>
<ul class="dropdown-contents" role="menu">
<!-- EVENT navbar_header_football_links_before -->
<!-- IF not S_IS_BOT -->
<li class="small-icon icon-bet"><a href="{U_BET}" role="menuitem">{L_BET}</a></li>
<li class="small-icon icon-allbets"><a href="{U_ALL_BETS}" role="menuitem">{L_ALL_BETS}</a></li>
<li class="small-icon icon-results"><a href="{U_RESULTS}" role="menuitem">{L_RESULTS}</a></li>
<li class="small-icon icon-rank"><a href="{U_RANKS_MATCHDAY}" role="menuitem">{L_RANK_MATCHDAY}</a></li>
<li class="small-icon icon-rank"><a href="{U_RANKS_TOTAL}" role="menuitem">{L_RANK_TOTAL}</a></li>
<li class="small-icon icon-list"><a href="{U_TABLE}" role="menuitem">{L_TABLE}</a></li>
<li class="small-icon icon-points"><a href="{U_FOOTBALL_BANK}" role="menuitem">{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 class="small-icon icon-odds"><a href="{U_ODDS}" role="menuitem">{L_ODDS}</a></li>
<li class="separator"></li>
<!-- IF S_MENU_LINK1-->
<li class="small-icon icon-xml"><a href="{U_MENU_LINK1}" role="menuitem" target="_blank">{MENU_DESC_LINK1}</a></li>
<!-- ENDIF -->
<!-- IF S_MENU_LINK2-->
<li class="small-icon icon-xml"><a href="{U_MENU_LINK2}" role="menuitem" target="_blank">{MENU_DESC_LINK2}</a></li>
<!-- ENDIF -->
<!-- IF S_MENU_LINK3-->
<li class="small-icon icon-xml"><a href="{U_MENU_LINK3}" role="menuitem" target="_blank">{MENU_DESC_LINK3}</a></li>
<!-- ENDIF -->
<li class="separator"></li>
<li class="small-icon icon-statistics"><a href="{U_MY_BETS}" role="menuitem">{L_MY_BETS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_POINTS}" role="menuitem">{L_MY_POINTS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_TABLE}" role="menuitem">{L_MY_TABLE}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_RANK}" role="menuitem">{L_MY_RANK}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_CHART}" role="menuitem">{L_MY_CHART}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_KOEFF}" role="menuitem">{L_MY_KOEFF}</a></li>
<li class="small-icon icon-statistics"><a href="{U_STAT_POINTS}" role="menuitem">{L_STAT_POINTS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_STAT_RESULTS}" role="menuitem">{L_STAT_RESULTS}</a></li>
<li class="small-icon icon-download"><a href="{U_EXPORT}" role="menuitem">{L_EXPORT}</a></li>
<!-- ENDIF -->
<!-- IF S_DISPLAY_FOOTBALL -->
<li class="separator"></li>
<!-- IF U_TEAM --><li class="small-icon icon-odds"><a href="{U_FOOTBALL_ODDS}" role="menuitem">{L_FOOTBALL_ODDS}</a></li><!-- ENDIF -->
<!-- ENDIF -->
<li class="separator"></li>
<!-- EVENT navbar_header_football_links_after -->
</ul>
</div>
</div>
</li>
<!-- 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">
<div class="header-profile dropdown-container">
<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">
<span class="username">{S_FOOTBALL_NAME}</span></a>
<div class="dropdown hidden">
<div class="pointer"><div class="pointer-inner"></div></div>
<ul class="dropdown-contents" role="menu">
<!-- EVENT navbar_header_football_links_before -->
<!-- IF not S_IS_BOT -->
<li><a href="{U_BET}" role="menuitem"><i class="icon fa-futbol-o fa-fw"></i>{L_BET}</a></li>
<li><a href="{U_ALL_BETS}" role="menuitem"><i class="icon fa-group fa-fw"></i>{L_ALL_BETS}</a></li>
<li><a href="{U_RESULTS}" role="menuitem"><i class="icon fa-check-square-o fa-fw"></i>{L_RESULTS}</a></li>
<li><a href="{U_RANKS_MATCHDAY}" role="menuitem"><i class="icon fa-trophy fa-fw"></i>{L_RANK_MATCHDAY}</a></li>
<li><a href="{U_RANKS_TOTAL}" role="menuitem"><i class="icon fa-trophy fa-fw"></i>{L_RANK_TOTAL}</a></li>
<li><a href="{U_TABLE}" role="menuitem"><i class="icon fa-list-ol fa-fw"></i>{L_TABLE}</a></li>
<li><a href="{U_FOOTBALL_BANK}" role="menuitem"><i class="icon fa-bank fa-fw"></i>{L_FOOTBALL_BANK}</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><a href="{U_ODDS}" role="menuitem"><i class="icon fa-line-chart fa-fw"></i>{L_ODDS}</a></li>
<li class="separator"></li>
<!-- 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>
<!-- ENDIF -->
<!-- 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>
<!-- ENDIF -->
<!-- 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>
<!-- ENDIF -->
<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><a href="{U_MY_POINTS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{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><a href="{U_MY_RANK}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{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><a href="{U_MY_KOEFF}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{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><a href="{U_STAT_RESULTS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{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 -->
<!-- EVENT navbar_header_football_links_after -->
</ul>
</div>
</div>
</li>
<!-- ENDIF -->

View File

@@ -21,25 +21,25 @@
</li>
</ul>
<ul class="topiclist forums" role="menu">
<li class="small-icon icon-bet"><a href="{U_BET}" role="menuitem">{L_BET}</a></li>
<li class="small-icon icon-allbets"><a href="{U_ALL_BETS}" role="menuitem">{L_ALL_BETS}</a></li>
<li class="small-icon icon-results"><a href="{U_RESULTS}" role="menuitem">{L_RESULTS}</a></li>
<li class="small-icon icon-rank"><a href="{U_RANKS_MATCHDAY}" role="menuitem">{L_RANK_MATCHDAY}</a></li>
<li class="small-icon icon-rank"><a href="{U_RANKS_TOTAL}" role="menuitem">{L_RANK_TOTAL}</a></li>
<li class="small-icon icon-list"><a href="{U_TABLE}" role="menuitem">{L_TABLE}</a></li>
<li class="small-icon icon-points"><a href="{U_FOOTBALL_BANK}" role="menuitem">{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 class="small-icon icon-download"><a href="{U_EXPORT}" role="menuitem">{L_EXPORT}</a></li>
<li class="small-icon icon-odds"><a href="{U_ODDS}" role="menuitem">{L_ODDS}</a></li>
<li><a href="{U_BET}" role="menuitem"><i class="icon fa-futbol-o fa-fw"></i>{L_BET}</a></li>
<li><a href="{U_ALL_BETS}" role="menuitem"><i class="icon fa-group fa-fw"></i>{L_ALL_BETS}</a></li>
<li><a href="{U_RESULTS}" role="menuitem"><i class="icon fa-check-square-o fa-fw"></i>{L_RESULTS}</a></li>
<li><a href="{U_TABLE}" role="menuitem"><i class="icon fa-list-ol fa-fw"></i>{L_TABLE}</a></li>
<li><a href="{U_RANKS_TOTAL}" role="menuitem"><i class="icon fa-trophy fa-fw"></i>{L_RANK_TOTAL}</a></li>
<li><a href="{U_RANKS_MATCHDAY}" role="menuitem"><i class="icon fa-trophy fa-fw"></i>{L_RANK_MATCHDAY}</a></li>
<li><a href="{U_FOOTBALL_BANK}" role="menuitem"><i class="icon fa-bank fa-fw"></i>{L_FOOTBALL_BANK}</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><a href="{U_EXPORT}" role="menuitem"><i class="icon fa-file-excel-o fa-fw"></i>{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="separator"></li>
<!-- 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 -->
<!-- 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 -->
<!-- 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 -->
</ul>
<ul class="topiclist cat">
@@ -50,14 +50,14 @@
</li>
</ul>
<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 class="small-icon icon-statistics"><a href="{U_MY_POINTS}" role="menuitem">{L_MY_POINTS}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_TABLE}" role="menuitem">{L_MY_TABLE}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_RANK}" role="menuitem">{L_MY_RANK}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_CHART}" role="menuitem">{L_MY_CHART}</a></li>
<li class="small-icon icon-statistics"><a href="{U_MY_KOEFF}" role="menuitem">{L_MY_KOEFF}</a></li>
<li class="small-icon icon-statistics"><a href="{U_STAT_POINTS}" role="menuitem">{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_MY_BETS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{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><a href="{U_MY_TABLE}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{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><a href="{U_MY_CHART}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{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><a href="{U_STAT_POINTS}" role="menuitem"><i class="icon fa-area-chart fa-fw"></i>{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>
</ul>
</div>
</div>

View File

@@ -16,44 +16,40 @@
<div id="football-center" style="margin: 0 {FOOTBALL_RIGHT_COLUMN}px 0 {FOOTBALL_LEFT_COLUMN}px; padding: 0 4px;">
<div id="tabs" class="tabs" style="margin-top: 0px; margin-left: 5px;">
<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_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_RESULTS -->activetab<!-- ENDIF --> small-icon icon-results"><a href="{U_RESULTS}"><span>{L_RESULTS}</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_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_TABLE -->activetab<!-- ENDIF --> small-icon icon-list"><a href="{U_TABLE}"><span>{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 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 <!-- IF S_DISPLAY_ODDS -->activetab<!-- ENDIF --> small-icon icon-odds"><a href="{U_ODDS}"><span>{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 <!-- 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 -->"><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 -->"><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_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 -->"><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_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 -->"><a href="{U_FOOTBALL_BANK}"><span><i class="icon fa-bank fa-fw"></i>{L_FOOTBALL_BANK}</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 -->"><a href="{U_ODDS}"><span><i class="icon fa-line-chart fa-fw"></i>{L_ODDS}</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-->
<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 -->
<!-- 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 -->
<!-- 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 -->
<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_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_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_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_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_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_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_RESULTS -->activetab<!-- ENDIF --> small-icon icon-statistics"><a href="{U_STAT_RESULTS}"><span>{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 <!-- 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 -->"><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 -->"><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 -->"><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 -->"><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 -->"><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 -->"><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 -->"><a href="{U_STAT_RESULTS}"><span><i class="icon fa-area-chart fa-fw"></i>{L_STAT_RESULTS}</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>
</div>
<div class="panel">
<!-- IF S_FOOTBALL_TABS -->
<div class="left-box football-h3" style="margin-left:5px; width:35%"><a title="{LEFT_TITLE}" href="{U_LEFT}">{LEFT_LINK}</a></div>
<div class="right-box football-h3" style="margin-right:5px; width:35%"><a title="{RIGHT_TITLE}" href="{U_RIGHT}">{RIGHT_LINK}</a></div>
<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>
<!-- ENDIF -->
<div class="navbar football_bg">
<div class="navbar football_nav">
<div>
<!-- IF .form_season -->
<form style="display:inline; margin:0; padding:0;" action="{S_FORMSELF}" method="post">
<div style="float:left;">
@@ -84,7 +80,7 @@
<!-- IF .form_matchday and not S_MATCHDAY_HIDE -->
<div style="float:left;">
<!-- IF S_PREV_LINK -->
<a class="prev_matchday" title="{L_SHOW_PREV}" href="{S_PREV_LINK}"></a>
<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>
<!-- ELSE -->
&nbsp;&nbsp;&nbsp;&nbsp;
<!-- ENDIF -->
@@ -104,7 +100,7 @@
</form>
<div style="float:left;">
<!-- IF S_NEXT_LINK -->
<a class="next_matchday" title="{L_SHOW_NEXT}" href="{S_NEXT_LINK}"></a>
<a title="{L_SHOW_NEXT}" href="{S_NEXT_LINK}"><i class="icon fa-plus-square fa-fw" style="line-height: 2em;"></i></a>
<!-- ELSE -->
&nbsp;&nbsp;&nbsp;&nbsp;
<!-- ENDIF -->
@@ -114,6 +110,7 @@
{S_DELIVERY}
</div>
<!-- ENDIF -->
</div>
</div>
<!-- IF S_DISPLAY_UNDER_CONSTRUCTION -->
@@ -213,6 +210,9 @@
<!-- IF S_DISPLAY_RANK_TOTAL -->
<!-- INCLUDE rank_total.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_LAST_RESULTS -->
<!-- INCLUDE last_results.html -->
<!-- ENDIF -->
</div>
<!-- [-] right block area -->
<br class="football-clear" />

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">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="phpBB3 Football Extension by football" />
<meta name="keywords" content="phpBB3, Football, Extension, Tipprunde, Prediction, League, Soccer" />
<meta name="description" content="" />
<meta name="robots" CONTENT="noindex" />
{META}
<title>{SITENAME} &bull; {PAGE_TITLE}</title>
<link href="./../../ext/football/football/styles/prosilver/theme/football_print.css" rel="stylesheet" type="text/css" />
</head>
<body id="phpbb" style="width:100%">
<div id="wrap">
<a id="top" accesskey="t"></a>
<div id="page-header">
<!-- IF S_DISPLAY_BANK -->
<h2><a href="{U_SIDE_LINK}">{S_SIDENAME}</a> &bull; {S_SEASON_NAME} &bull; {S_LEAGUE_NAME}</h2>
<!-- ELSE -->
<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>
<!-- ENDIF -->
</div>
<div id="page-body">
<div class="page-number">{PAGE_NUMBER}</div>
<!-- IF S_DISPLAY_BET -->
<!-- INCLUDE bet.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_ALL_BETS -->
<table class="football">
<tr>
style="vertical-align: top;"
<!-- INCLUDE all_bets.html -->
</td>
<td style="width:4px; vertical-align: top;"></td>
<td style="width:{FOOTBALL_RIGHT_COLUMN}px; vertical-align: top;">
<!-- IF S_DISPLAY_RANK_TOTAL -->
<!-- INCLUDE rank_total.html -->
<!-- ENDIF -->
</td>
</tr>
</table>
<!-- ENDIF -->
<!-- IF S_DISPLAY_RESULTS -->
<!-- INCLUDE results.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RANKS_MATCHDAY -->
<!-- INCLUDE ranks.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RANKS_TOTAL -->
<!-- INCLUDE ranks.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_TABLE -->
<!-- INCLUDE table.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_ODDS -->
<!-- INCLUDE odds.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_BETS -->
<!-- INCLUDE my_bets.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_POINTS -->
<!-- INCLUDE my_points.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_TABLE -->
<!-- INCLUDE my_table.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_RANK -->
<!-- INCLUDE my_rank.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_CHART -->
<!-- INCLUDE my_chart.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_KOEFF -->
<!-- INCLUDE my_koeff.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_STAT_RESULTS -->
<!-- INCLUDE stat_results.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_STAT_POINTS -->
<!-- INCLUDE stat_points.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_BANK -->
<!-- INCLUDE bank.html -->
<!-- ENDIF -->
</div>
<div id="page-footer">
<div class="copyright">
<!-- IF S_FOOTBALL_COPY --><br />{S_FOOTBALL_COPY}<!-- ENDIF -->
</div>
</div>
</div>
</body>
</html>
<!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}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="phpBB3 Football Extension by football" />
<meta name="keywords" content="phpBB3, Football, Extension, Tipprunde, Prediction, League, Soccer" />
<meta name="description" content="" />
<meta name="robots" CONTENT="noindex" />
{META}
<title>{SITENAME} &bull; {PAGE_TITLE}</title>
<link href="./../../ext/football/football/styles/prosilver/theme/football_print.css" rel="stylesheet" type="text/css" />
</head>
<body id="phpbb" style="width:100%">
<div id="wrap">
<a id="top" accesskey="t"></a>
<div id="page-header">
<!-- IF S_DISPLAY_BANK -->
<h2><a href="{U_SIDE_LINK}">{S_SIDENAME}</a> &bull; {S_SEASON_NAME} &bull; {S_LEAGUE_NAME}</h2>
<!-- ELSE -->
<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>
<!-- ENDIF -->
</div>
<div id="page-body">
<div class="page-number">{PAGE_NUMBER}</div>
<!-- IF S_DISPLAY_BET -->
<!-- INCLUDE bet.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_ALL_BETS -->
<table class="football">
<tr>
<!-- INCLUDE all_bets.html -->
</td>
<td style="width:4px; vertical-align: top;"></td>
<td style="width:{FOOTBALL_RIGHT_COLUMN}px; vertical-align: top;">
<!-- IF S_DISPLAY_RANK_TOTAL -->
<!-- INCLUDE rank_total.html -->
<!-- ENDIF -->
</td>
</tr>
</table>
<!-- ENDIF -->
<!-- IF S_DISPLAY_RESULTS -->
<!-- INCLUDE results.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RANKS_MATCHDAY -->
<!-- INCLUDE ranks.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RANKS_TOTAL -->
<!-- INCLUDE ranks.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_TABLE -->
<!-- INCLUDE table.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_ODDS -->
<!-- INCLUDE odds.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_BETS -->
<!-- INCLUDE my_bets.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_POINTS -->
<!-- INCLUDE my_points.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_TABLE -->
<!-- INCLUDE my_table.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_RANK -->
<!-- INCLUDE my_rank.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_CHART -->
<!-- INCLUDE my_chart.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_MY_KOEFF -->
<!-- INCLUDE my_koeff.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_STAT_RESULTS -->
<!-- INCLUDE stat_results.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_STAT_POINTS -->
<!-- INCLUDE stat_points.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_BANK -->
<!-- INCLUDE bank.html -->
<!-- ENDIF -->
</div>
<div id="page-footer">
<div class="copyright">
<!-- IF S_FOOTBALL_COPY --><br />{S_FOOTBALL_COPY}<!-- ENDIF -->
</div>
</div>
</div>
</body>
</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">
<h3><span class="small-icon icon-allbets"></span>&nbsp;{LAST_USERS}</h3>
<!-- BEGIN last_users -->
<div class="panel"> <h3><i class="icon fa-sign-in fa-fw"></i>{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 />
<!-- END last_users --></div>

View File

@@ -8,35 +8,35 @@
<!-- ENDIF -->
<div id="tabs" class="tabs" style="margin-top: 0px; margin-left: 5px;">
<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_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_RESULTS -->activetab<!-- ENDIF --> small-icon icon-results"><a href="{U_RESULTS}"><span>{L_RESULTS_SHORT_DOT}</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_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_TABLE -->activetab<!-- ENDIF --> small-icon icon-list"><a href="{U_TABLE}"><span>{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_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_BANK -->activetab<!-- ENDIF --> small-icon icon-points"><a href="{U_FOOTBALL_BANK}"><span>{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 <!-- IF S_DISPLAY_ODDS -->activetab<!-- ENDIF --> small-icon icon-odds"><a href="{U_ODDS}"><span>{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 <!-- 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 -->"><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 -->"><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_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 -->"><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_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 -->"><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 -->"><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 -->"><a href="{U_FOOTBALL_BANK}"><span><i class="icon fa-bank fa-fw"></i>{L_FOOTBALL_BANK}</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 -->"><a href="{U_ODDS}"><span><i class="icon fa-line-chart fa-fw"></i>{L_ODDS}</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-->
<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 -->
<!-- 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 -->
<!-- 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 -->
<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_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_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_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_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_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_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_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_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 -->"><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 -->"><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 -->"><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 -->"><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 -->"><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 -->"><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 -->"><a href="{U_STAT_RESULTS}"><span><i class="icon fa-area-chart fa-fw"></i>{L_STAT_RESULTS}</span></a></li>
</ul>
</div>
<div class="panel">

View File

@@ -1,68 +1,68 @@
<!-- IF S_DATA_ODDS -->
<div class="forabg">
<table class="football">
<thead>
<tr>
<th>{L_DATE}</th>
<!-- IF S_DISPLAY_GROUP -->
<th>{L_GR}</th>
<!-- ENDIF -->
<th style="text-align: center;" colspan="5">{L_VS}</th>
<th style="text-align: center;" colspan="3">{L_RESULT} ({RESULT_EXPLAIN})</th>
<!-- IF S_DISPLAY_KO -->
<th style="text-align: center;" colspan="3">{LABEL_FINALRESULT}</th>
<!-- ENDIF -->
<th>%</th>
<th></th>
<th style="text-align: center;" colspan="3">Quoten</th>
</tr>
</thead>
<tbody>
<!-- BEGIN odds -->
<tr class="{odds.ROW_CLASS}">
<td class="td_datetime">{odds.MATCH_TIME}</td>
<!-- IF S_DISPLAY_GROUP -->
<td class="td_group">{odds.GROUP}</td>
<!-- ENDIF -->
<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;">
{odds.HOME_NAME}</td>
<td class="td_vs">:</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;">
{odds.GUEST_NAME}</td>
<td class="td_goals_home {odds.COLOR_STYLE}">{odds.GOALS_HOME}</td>
<td class="td_vs">:</td>
<td class="td_goals_guest {odds.COLOR_STYLE}">{odds.GOALS_GUEST}</td>
<!-- IF S_DISPLAY_KO -->
<td class="td_goals_home {odds.COLOR_STYLE}">{odds.KOGOALS_HOME}</td>
<td class="td_vs">:</td>
<td class="td_goals_guest {odds.COLOR_STYLE}">{odds.KOGOALS_GUEST}</td>
<!-- ENDIF -->
<td style="text-align: center;">{odds.TREND}</td>
<td class="td_button">
<!-- 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>
<!-- ELSE -->
<img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" />
<!-- ENDIF -->
</td>
<td class="td_group">{odds.ODD_1}</td>
<td style="text-align: center;">{odds.ODD_X}</td>
<td class="td_group">{odds.ODD_2}</td>
</tr>
<!-- END odds -->
</tbody>
</table>
</div>
<div class="right-box" style="margin-bottom:5px; height:2em">
</div>
<br />
<!-- INCLUDE nav_delivery.html -->
<!-- ELSE -->
<br />
<div class="message">{L_NO_PLAN}</div>
<br />
<br />
<!-- IF S_DATA_ODDS -->
<div class="forabg">
<table class="football">
<thead>
<tr>
<th>{L_DATE}</th>
<!-- IF S_DISPLAY_GROUP -->
<th>{L_GR}</th>
<!-- ENDIF -->
<th style="text-align: center;" colspan="5">{L_VS}</th>
<th style="text-align: center;" colspan="3">{L_RESULT} ({RESULT_EXPLAIN})</th>
<!-- IF S_DISPLAY_KO -->
<th style="text-align: center;" colspan="3">{LABEL_FINALRESULT}</th>
<!-- ENDIF -->
<th>%</th>
<th></th>
<th style="text-align: center;" colspan="3">Quoten</th>
</tr>
</thead>
<tbody>
<!-- BEGIN odds -->
<tr class="{odds.ROW_CLASS}">
<td class="td_datetime">{odds.MATCH_TIME}</td>
<!-- IF S_DISPLAY_GROUP -->
<td class="td_group">{odds.GROUP}</td>
<!-- ENDIF -->
<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;">
{odds.HOME_NAME}</td>
<td class="td_vs">:</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;">
{odds.GUEST_NAME}</td>
<td class="td_goals_home {odds.COLOR_STYLE}">{odds.GOALS_HOME}</td>
<td class="td_vs">:</td>
<td class="td_goals_guest {odds.COLOR_STYLE}">{odds.GOALS_GUEST}</td>
<!-- IF S_DISPLAY_KO -->
<td class="td_goals_home {odds.COLOR_STYLE}">{odds.KOGOALS_HOME}</td>
<td class="td_vs">:</td>
<td class="td_goals_guest {odds.COLOR_STYLE}">{odds.KOGOALS_GUEST}</td>
<!-- ENDIF -->
<td style="text-align: center;">{odds.TREND}</td>
<td class="td_button">
<!-- IF S_VIEW <> 'print' -->
<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 -->
<img src="./../../ext/football/football/images/spacer.gif" alt="" width="28" height="28" />
<!-- ENDIF -->
</td>
<td class="td_group">{odds.ODD_1}</td>
<td style="text-align: center;">{odds.ODD_X}</td>
<td class="td_group">{odds.ODD_2}</td>
</tr>
<!-- END odds -->
</tbody>
</table>
</div>
<div class="right-box" style="margin-bottom:5px; height:2em">
</div>
<br />
<!-- INCLUDE nav_delivery.html -->
<!-- ELSE -->
<br />
<div class="message">{L_NO_PLAN}</div>
<br />
<br />
<!-- ENDIF -->

View File

@@ -1,32 +1,32 @@
<div class="panel">
<h3><span class="small-icon icon-rank"></span>&nbsp;{L_RANK_MATCHDAY}</h3>
<!-- IF S_DATA_RANK_MATCHDAY -->
<table class="forabg rank">
<thead>
<tr>
<th>{L_RANK_SHORT_DOT}</th>
<th style="text-align: left;">{L_NAME}</th>
<th>{L_POINTS_SHORT_DOT}</th>
<!-- IF S_WIN -->
<th style="text-align: right;">{WIN_NAME}</th>
<!-- ENDIF -->
</tr>
</thead>
<tbody>
<!-- 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;">
<td class="td_rank">{rank.RANK}</td>
<td class="td_name">{rank.USERNAME}</td>
<td class="td_pts {rank.COLOR_STYLE}">{rank.POINTS}</td>
<!-- IF S_WIN -->
<td class="td_wins">{rank.WIN}</td>
<!-- ENDIF -->
</tr>
<!-- END rank -->
</tbody>
</table>
<!-- ELSE -->
<div class="message">{L_NO_RESULTS}</div>
<br />
<!-- ENDIF -->
</div >
<div class="panel">
<h3><i class="icon fa-trophy fa-fw"></i>{L_RANK_MATCHDAY}</h3>
<!-- IF S_DATA_RANK_MATCHDAY -->
<table class="forabg rank">
<thead>
<tr>
<th>{L_RANK_SHORT_DOT}</th>
<th style="text-align: left;">{L_NAME}</th>
<th>{L_POINTS_SHORT_DOT}</th>
<!-- IF S_WIN -->
<th style="text-align: right;">{WIN_NAME}</th>
<!-- ENDIF -->
</tr>
</thead>
<tbody>
<!-- 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;">
<td class="td_rank">{rank.RANK}</td>
<td class="td_name">{rank.USERNAME}</td>
<td class="td_pts {rank.COLOR_STYLE}">{rank.POINTS}</td>
<!-- IF S_WIN -->
<td class="td_wins">{rank.WIN}</td>
<!-- ENDIF -->
</tr>
<!-- END rank -->
</tbody>
</table>
<!-- ELSE -->
<div class="message">{L_NO_RESULTS}</div>
<br />
<!-- ENDIF -->
</div >

View File

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

View File

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

View File

@@ -1,36 +1,36 @@
<div class="panel">
<h3><span class="small-icon icon-rank"></span>&nbsp;{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>
<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)
* @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 {
overflow-x:auto;
@@ -31,34 +40,6 @@
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
*/
@@ -163,6 +144,13 @@ div.info {
width: 155px;
}
.football_nav {
margin-bottom: 5px;
padding: 5px 5px;
clear: both;
line-height:2em;
}
.football_bg {
margin-bottom: 5px;
padding: 0 5px;
@@ -266,42 +254,6 @@ a.pastlink:hover, a.futurelink:hover {
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 {
font-weight: bold;
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