Version 0.9.9

- several bugfixes
- Code cleaning
This commit is contained in:
football
2021-04-04 22:15:15 +02:00
parent 7d8b92f1df
commit a2ea3364a4
154 changed files with 16463 additions and 16463 deletions

View File

@@ -1,495 +1,494 @@
<?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);
$matches_on_matchday = false;
$sql = 'SELECT COUNT(DISTINCT user_id) AS num_users
FROM ' . FOOTB_BETS . "
WHERE season = $season AND league = $league";
$result = $db->sql_query($sql);
$total_users = (int) $db->sql_fetchfield('num_users');
$db->sql_freeresult($result);
$sql = "SELECT
m.match_no,
m.status,
m.formula_home,
m.formula_guest,
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,
SUM(IF(b.goals_home + 0 > b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS home,
SUM(IF(b.goals_home = b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS draw,
SUM(IF(b.goals_home + 0 < b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS 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)
LEFT JOIN ' . FOOTB_BETS . " AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
GROUP BY m.match_no
ORDER BY m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query($sql);
$matches = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$count_matches = sizeof($matches);
if ($user->data['football_mobile'])
{
if ($count_matches > 3)
{
$split_after = 3;
$splits = ceil($count_matches / 3);
}
else
{
$split_after = $count_matches;
$splits = 1;
}
}
else
{
if ($count_matches > 11)
{
$split_after = 8;
$splits = ceil($count_matches / 8);
}
else
{
$split_after = $count_matches;
$splits = 1;
}
}
// Make sure $start is set to the last page if it exceeds the amount
if ($start < 0 || $start >= $total_users)
{
$start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page'];
}
else
{
$start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page'];
}
$sql_start = $start * $count_matches;
$sql_limit = $config['football_users_per_page'] * $count_matches;
// If we've got a hightlight set pass it on to pagination.
// handle pagination.
$base_url = $this->helper->route('football_main_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday));
$pagination = $phpbb_container->get('pagination');
if ($user->data['football_mobile'])
{
$sql_start = 0;
$sql_limit = 99999;
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $sql_limit, $start);
}
else
{
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
}
$bet_line = array();
if ($count_matches > 0)
{
$matches_on_matchday = true;
$sql = "SELECT
u.user_id,
u.username,
m.status,
b.goals_home AS bet_home,
b.goals_guest AS bet_guest,
" . select_points() . '
FROM ' . FOOTB_MATCHES . ' AS m
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
ORDER BY LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
$user_bets = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$bet_index = 0;
$split_index = 0;
foreach ($user_bets AS $user_bet)
{
if ($bet_index == $count_matches)
{
$bet_index = 0;
$split_index = 0;
}
if (!($bet_index % $split_after))
{
$split_index++;
}
$sum_total[$user_bet['username']] = 0;
$bet_line[$split_index][] = $user_bet;
$bet_index++;
}
}
$match_index = 0;
$last_match_index = 0;
$split_index = 0;
$matchday_sum_total = 0;
$colorstyle_total = ' color_finally';
foreach ($matches AS $match)
{
if (!($match_index % $split_after))
{
if ($match_index > 0)
{
$total = 0;
$count_user = 0;
$bet_index = 0;
$last_match_index = 0;
foreach ($bet_line[$split_index] AS $user_bet)
{
if ($bet_index == 0)
{
$count_user++;
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_bet['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
)
);
$total = 0;
}
$bet_index++;
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
}
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet_home = ($user_bet['bet_home'] == '') ? '&nbsp;' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
if ($bet_index == $split_after)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$bet_index = 0;
}
}
$template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => false,
)
);
foreach ($matches_tendency AS $match_tendency)
{
$template->assign_block_vars('match_panel.tendency_footer.tendency', array(
'TENDENCY' => $match_tendency,
)
);
}
}
$matches_tendency = array();
$split_index++;
if ($split_index == $splits)
{
$display_total = true;
}
else
{
$display_total = false;
}
$template->assign_block_vars('match_panel', array(
'S_TOTAL' => $display_total,
)
);
}
if (0 == $match['home_id'])
{
$home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']);
$home_in_array = explode("#",$home_info);
$homename = $home_in_array[3];
}
else
{
$homename = $match['home_name'];
}
if (0 == $match['guest_id'])
{
$guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']);
$guest_in_array = explode("#",$guest_info);
$guestname = $guest_in_array[3];
}
else
{
$guestname = $match['guest_name'];
}
$colorstyle_match = color_style($match['status']);
$template->assign_block_vars('match_panel.match_entry', array(
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'RESULT' => $match['goals_home']. ':'.$match['goals_guest'],
'COLOR_STYLE' => $colorstyle_match,
)
);
if ($match['status'] < 1 && !$config['football_view_tendencies'])
{
// hide tendencies
$matches_tendency[] = '?-?-?';
}
else
{
$matches_tendency[] = $match['home']. '-'.$match['draw']. '-'.$match['guest'];
}
$match_index++;
$last_match_index++;
}
if ($count_matches > 0)
{
$total = 0;
$count_user = 0;
$bet_index = 0;
foreach ($bet_line[$split_index] AS $user_bet)
{
if ($bet_index == 0)
{
$count_user++;
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_bet['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
)
);
$total = 0;
}
$bet_index++;
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
}
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet_home = ($user_bet['bet_home'] == '') ? '' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
if ($bet_index == $last_match_index)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$template->assign_block_vars('match_panel.user_row.points', array(
'COLOR_STYLE' => $colorstyle_total,
'POINTS_TOTAL' => $sum_total[$user_bet['username']],
)
);
$bet_index = 0;
}
}
$template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => true,
'COLOR_STYLE' => $colorstyle_total, //currently ignored
'SUMTOTAL' => $matchday_sum_total,
)
);
foreach ($matches_tendency AS $match_tendency)
{
$template->assign_block_vars('match_panel.tendency_footer.tendency', array(
'TENDENCY' => $match_tendency,
)
);
}
}
//extra bets
// Calculate extra bets of matchday
$sql_start = $start;
$sql_limit = $config['football_users_per_page'];
$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 = $matchday OR e.matchday_eval = $matchday)
ORDER BY e.extra_no ASC";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$extra_no = $row['extra_no'];
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_MULTI_HIT']);
}
break;
case '5':
{
$display_type = 2;
$eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']);
}
break;
default :
{
$display_type = 2;
$eval_title = '';
}
break;
}
$extra_colorstyle = color_style($row['extra_status']);
$template->assign_block_vars('extra_panel', array(
'QUESTION' => $row['question'],
'RESULT' => ($display_type == 1) ? $row['result_team'] : $row['result'],
'POINTS' => $row['extra_points'],
'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
'EVALUATION_TITLE' => $eval_title,
'COLOR_STYLE' => $extra_colorstyle,
)
);
// Get all extra bets of matchday
$bet_number = 0;
$sql = "SELECT u.user_id,
u.username,
e.*,
eb.bet,
eb.bet_points,
t2.team_name AS bet_team
FROM " . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id)
LEFT JOIN ' . FOOTB_EXTRA . " AS e ON (e.season = b.season AND e.league = b.league AND (e.matchday = $matchday OR e.matchday_eval = $matchday) AND e.extra_no = $extra_no)
LEFT JOIN " . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = b.season AND eb.league = b.league AND eb.extra_no = $extra_no AND eb.user_id = b.user_id)
LEFT JOIN " . FOOTB_TEAMS . " AS t2 ON (t2.season = b.season AND t2.league = b.league AND t2.team_id = eb.bet)
WHERE b.season = $season
AND b.league = $league
AND b.match_no = 1
GROUP by b.user_id
ORDER BY LOWER(u.username) ASC";
$result_bet = $db->sql_query_limit($sql, $sql_limit, $sql_start);
while ($user_row = $db->sql_fetchrow($result_bet))
{
$bet_number++ ;
$row_class = (!($bet_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
if ($user_row['extra_status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet = ($user_row['bet'] == '') ? '&nbsp;' : '?';
$bet_team = ($user_row['bet_team'] == NULL) ? '&nbsp;' : '?';
}
else
{
$bet = ($user_row['bet'] == '') ? '&nbsp;' : $user_row['bet'];
$bet_team = ($user_row['bet_team'] == NULL) ? '&nbsp;' : $user_row['bet_team'];
}
$template->assign_block_vars('extra_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_row['username'],
'BET' => ($display_type == 1) ? $bet_team : $bet,
'BET_POINTS' => $user_row['bet_points'],
'COLOR_STYLE' => $extra_colorstyle,
)
);
}
$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,
'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday,
'S_SPALTEN' => ($count_matches * 2) + 2,
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
)
);
?>
<?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);
$matches_on_matchday = false;
$sql = 'SELECT COUNT(DISTINCT user_id) AS num_users
FROM ' . FOOTB_BETS . "
WHERE season = $season AND league = $league";
$result = $db->sql_query($sql);
$total_users = (int) $db->sql_fetchfield('num_users');
$db->sql_freeresult($result);
$sql = "SELECT
m.match_no,
m.status,
m.formula_home,
m.formula_guest,
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,
SUM(IF(b.goals_home + 0 > b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS home,
SUM(IF(b.goals_home = b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS draw,
SUM(IF(b.goals_home + 0 < b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS 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)
LEFT JOIN ' . FOOTB_BETS . " AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
GROUP BY m.match_no
ORDER BY m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query($sql);
$matches = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$count_matches = sizeof($matches);
if ($user->data['football_mobile'])
{
if ($count_matches > 3)
{
$split_after = 3;
$splits = ceil($count_matches / 3);
}
else
{
$split_after = $count_matches;
$splits = 1;
}
}
else
{
if ($count_matches > 11)
{
$split_after = 8;
$splits = ceil($count_matches / 8);
}
else
{
$split_after = $count_matches;
$splits = 1;
}
}
// Make sure $start is set to the last page if it exceeds the amount
if ($start < 0 || $start >= $total_users)
{
$start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page'];
}
else
{
$start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page'];
}
$sql_start = $start * $count_matches;
$sql_limit = $config['football_users_per_page'] * $count_matches;
// If we've got a hightlight set pass it on to pagination.
// handle pagination.
$base_url = $this->helper->route('football_football_controller', array('side' => 'all_bets', 's' => $season, 'l' => $league, 'm' => $matchday));
$pagination = $phpbb_container->get('pagination');
if ($user->data['football_mobile'])
{
$sql_start = 0;
$sql_limit = 99999;
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $sql_limit, $start);
}
else
{
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
}
$bet_line = array();
if ($count_matches > 0)
{
$matches_on_matchday = true;
$sql = "SELECT
u.user_id,
u.username,
m.status,
b.goals_home AS bet_home,
b.goals_guest AS bet_guest,
" . select_points() . '
FROM ' . FOOTB_MATCHES . ' AS m
LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
LEFT JOIN ' . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
ORDER BY LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
$user_bets = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$bet_index = 0;
$split_index = 0;
foreach ($user_bets AS $user_bet)
{
if ($bet_index == $count_matches)
{
$bet_index = 0;
$split_index = 0;
}
if (!($bet_index % $split_after))
{
$split_index++;
}
$sum_total[$user_bet['username']] = 0;
$bet_line[$split_index][] = $user_bet;
$bet_index++;
}
}
$match_index = 0;
$last_match_index = 0;
$split_index = 0;
$matchday_sum_total = 0;
$colorstyle_total = ' color_finally';
foreach ($matches AS $match)
{
if (!($match_index % $split_after))
{
if ($match_index > 0)
{
$total = 0;
$count_user = 0;
$bet_index = 0;
$last_match_index = 0;
foreach ($bet_line[$split_index] AS $user_bet)
{
if ($bet_index == 0)
{
$count_user++;
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_bet['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
)
);
$total = 0;
}
$bet_index++;
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
}
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet_home = ($user_bet['bet_home'] == '') ? '&nbsp;' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
if ($bet_index == $split_after)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$bet_index = 0;
}
}
$template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => false,
)
);
foreach ($matches_tendency AS $match_tendency)
{
$template->assign_block_vars('match_panel.tendency_footer.tendency', array(
'TENDENCY' => $match_tendency,
)
);
}
}
$matches_tendency = array();
$split_index++;
if ($split_index == $splits)
{
$display_total = true;
}
else
{
$display_total = false;
}
$template->assign_block_vars('match_panel', array(
'S_TOTAL' => $display_total,
)
);
}
if (0 == $match['home_id'])
{
$home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']);
$home_in_array = explode("#",$home_info);
$homename = $home_in_array[3];
}
else
{
$homename = $match['home_name'];
}
if (0 == $match['guest_id'])
{
$guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']);
$guest_in_array = explode("#",$guest_info);
$guestname = $guest_in_array[3];
}
else
{
$guestname = $match['guest_name'];
}
$colorstyle_match = color_style($match['status']);
$template->assign_block_vars('match_panel.match_entry', array(
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'RESULT' => $match['goals_home']. ':'.$match['goals_guest'],
'COLOR_STYLE' => $colorstyle_match,
)
);
if ($match['status'] < 1 && !$config['football_view_tendencies'])
{
// hide tendencies
$matches_tendency[] = '?-?-?';
}
else
{
$matches_tendency[] = $match['home']. '-'.$match['draw']. '-'.$match['guest'];
}
$match_index++;
$last_match_index++;
}
if ($count_matches > 0)
{
$total = 0;
$count_user = 0;
$bet_index = 0;
foreach ($bet_line[$split_index] AS $user_bet)
{
if ($bet_index == 0)
{
$count_user++;
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_bet['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
)
);
$total = 0;
}
$bet_index++;
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 3)
{
$colorstyle_total = ' color_provisionally';
}
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet_home = ($user_bet['bet_home'] == '') ? '' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
if ($bet_index == $last_match_index)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$template->assign_block_vars('match_panel.user_row.points', array(
'COLOR_STYLE' => $colorstyle_total,
'POINTS_TOTAL' => $sum_total[$user_bet['username']],
)
);
$bet_index = 0;
}
}
$template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => true,
'COLOR_STYLE' => $colorstyle_total, //currently ignored
'SUMTOTAL' => $matchday_sum_total,
)
);
foreach ($matches_tendency AS $match_tendency)
{
$template->assign_block_vars('match_panel.tendency_footer.tendency', array(
'TENDENCY' => $match_tendency,
)
);
}
}
//extra bets
// Calculate extra bets of matchday
$sql_start = $start;
$sql_limit = $config['football_users_per_page'];
$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 = $matchday OR e.matchday_eval = $matchday)
ORDER BY e.extra_no ASC";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$extra_no = $row['extra_no'];
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_MULTI_HIT']);
}
break;
case '5':
{
$display_type = 2;
$eval_title = sprintf($user->lang['EXTRA_DIFFERENCE']);
}
break;
default :
{
$display_type = 2;
$eval_title = '';
}
break;
}
$extra_colorstyle = color_style($row['extra_status']);
$template->assign_block_vars('extra_panel', array(
'QUESTION' => $row['question'],
'RESULT' => ($display_type == 1) ? $row['result_team'] : $row['result'],
'POINTS' => $row['extra_points'],
'EVALUATION' => ($row['matchday'] == $row['matchday_eval']) ? sprintf($user->lang['MATCHDAY']) : sprintf($user->lang['TOTAL']),
'EVALUATION_TITLE' => $eval_title,
'COLOR_STYLE' => $extra_colorstyle,
)
);
// Get all extra bets of matchday
$bet_number = 0;
$sql = "SELECT u.user_id,
u.username,
e.*,
eb.bet,
eb.bet_points,
t2.team_name AS bet_team
FROM " . FOOTB_BETS . ' AS b
LEFT JOIN ' . USERS_TABLE . ' AS u ON (u.user_id = b.user_id)
LEFT JOIN ' . FOOTB_EXTRA . " AS e ON (e.season = b.season AND e.league = b.league AND (e.matchday = $matchday OR e.matchday_eval = $matchday) AND e.extra_no = $extra_no)
LEFT JOIN " . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = b.season AND eb.league = b.league AND eb.extra_no = $extra_no AND eb.user_id = b.user_id)
LEFT JOIN " . FOOTB_TEAMS . " AS t2 ON (t2.season = b.season AND t2.league = b.league AND t2.team_id = eb.bet)
WHERE b.season = $season
AND b.league = $league
AND b.match_no = 1
GROUP by b.user_id
ORDER BY LOWER(u.username) ASC";
$result_bet = $db->sql_query_limit($sql, $sql_limit, $sql_start);
while ($user_row = $db->sql_fetchrow($result_bet))
{
$bet_number++ ;
$row_class = (!($bet_number % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_row['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
if ($user_row['extra_status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet = ($user_row['bet'] == '') ? '&nbsp;' : '?';
$bet_team = ($user_row['bet_team'] == NULL) ? '&nbsp;' : '?';
}
else
{
$bet = ($user_row['bet'] == '') ? '&nbsp;' : $user_row['bet'];
$bet_team = ($user_row['bet_team'] == NULL) ? '&nbsp;' : $user_row['bet_team'];
}
$template->assign_block_vars('extra_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_row['username'],
'BET' => ($display_type == 1) ? $bet_team : $bet,
'BET_POINTS' => $user_row['bet_points'],
'COLOR_STYLE' => $extra_colorstyle,
)
);
}
$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,
'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday,
'S_SPALTEN' => ($count_matches * 2) + 2,
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
)
);

View File

@@ -508,8 +508,8 @@ $template->assign_vars(array(
'S_SIDENAME' => $sidename,
'BET_EXPLAIN' => $bet_explain,
'JOIN_LEAGUE' => ($link_rules == '') ? '' : sprintf($user->lang['JOIN_LEAGUE'], $link_rules),
'S_FORM_ACTION_BET' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'bet')),
'S_FORM_ACTION_JOIN' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'join')),
'S_FORM_ACTION_BET' => $this->helper->route('football_football_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'bet')),
'S_FORM_ACTION_JOIN' => $this->helper->route('football_football_controller', array('side' => 'bet', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'join')),
'S_USER_IS_MEMBER' => $user_is_member,
'S_DATA_BET' => $data_bet,
'S_DATA_GROUP' => $data_group,

View File

@@ -43,8 +43,8 @@ $sql = "SELECT
LEFT JOIN " . FOOTB_EXTRA . " AS e ON (e.season = m.season AND e.league = m.league AND e.matchday = m.matchday AND e.extra_status = 0)
LEFT JOIN " . FOOTB_EXTRA_BETS . " AS eb ON (eb.season = m.season AND eb.league = m.league AND eb.extra_no = e.extra_no AND eb.user_id = $user_id)
WHERE m.status <= 0
GROUP BY delivery, m.league
ORDER BY delivery, m.league";
GROUP BY m.season, m.league, m.matchday, l.league_name_short, matchday_name, delivery
ORDER BY delivery, m.season, m.league";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result) AND $index < 11)
@@ -55,7 +55,7 @@ while($row = $db->sql_fetchrow($result) AND $index < 11)
$template->assign_block_vars('delivery', array(
'ROW_CLASS' => $row_class,
'U_BET_LINK' => $this->helper->route('football_main_controller', array('side' => 'bet', 's' => $row['season'], 'l' => $row['league'], 'm' => $row['matchday'])),
'U_BET_LINK' => $this->helper->route('football_football_controller', array('side' => 'bet', 's' => $row['season'], 'l' => $row['league'], 'm' => $row['matchday'])),
'LEAGUE_SHORT' => $row['league_name_short'],
'MATCHDAY_NAME' => $row['matchday_name'],
'COLOR' => ($row['bets_count'] == $row['matches_count'] && $row['extra_bets_count'] == $row['extra_count']) ? 'green' : 'red',

View File

@@ -20,7 +20,7 @@ $action='';
if (!$season OR !$league)
{
redirect($this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season, 'l' => $league)));
redirect($this->helper->route('football_football_controller', array('side' => 'bank', 's' => $season, 'l' => $league)));
}
else
{

View File

@@ -19,7 +19,7 @@ $action='';
if (!$season)
{
redirect($this->helper->route('football_main_controller', array('side' => 'bank', 's' => $season)));
redirect($this->helper->route('football_football_controller', array('side' => 'bank', 's' => $season)));
}
else
{

View File

@@ -1,52 +1,50 @@
<?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');
}
$action='';
if (!$season OR !$league)
{
redirect($this->helper->route('football_main_controller', array('side' => 'bet')));
}
else
{
if (user_is_member($user->data['user_id'], $season, $league))
{
$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
{
include($this->football_includes_path . 'export.' . $this->php_ext);
}
}
}
else
{
redirect($this->helper->route('football_main_controller', array('side' => 'bet')));
}
}
?>
<?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');
}
$action='';
if (!$season OR !$league)
{
redirect($this->helper->route('football_football_controller', array('side' => 'bet')));
}
else
{
if (user_is_member($user->data['user_id'], $season, $league))
{
$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
{
include($this->football_includes_path . 'export.' . $this->php_ext);
}
}
}
else
{
redirect($this->helper->route('football_football_controller', array('side' => 'bet')));
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,150 +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,
)
);
<?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_football_controller', array('side' => 'results', 's' => $row['season'], 'l' => $row['league'], 'm' => $row['matchday'])),
'MATCH_DATE' => $row['match_date'],
'MATCH_TIME' => $row['match_time'],
'LEAGUE_NAME' => $row['league_name'],
'LOGO_HOME' => $logoH,
'LOGO_GUEST' => $logoG,
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'HOME_SHORT' => $homeshort,
'GUEST_SHORT' => $guestshort,
'GOALS_HOME' => $goals_home,
'GOALS_GUEST' => $goals_guest,
'COLOR_STYLE' => color_style($row['status']),
'KOGOALS_HOME' => $kogoals_home,
'KOGOALS_GUEST' => $kogoals_guest,
'COLOR_STYLE' => $colorstyle,
)
);
}
$db->sql_freeresult($result);
$sidename = sprintf($user->lang['LAST_RESULTS']);
$template->assign_vars(array(
'S_DISPLAY_LAST_RESULTS' => true,
'S_SIDENAME' => $sidename,
'S_DATA_LAST_RESULTS' => $data_lastresults,
'S_USER_IS_MEMBER' => $user_is_member,
)
);
?>

View File

@@ -1,386 +1,386 @@
<?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);
$matches_on_matchday = false;
if (!$user_sel)
{
if (user_is_member($user->data['user_id'], $season, $league))
{
$user_sel = $user->data['user_id'];
}
}
$username = '';
$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
AND league = $league
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);
// Select matches with results and tendencies
$sql = "SELECT
m.match_no,
m.status,
m.formula_home,
m.formula_guest,
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,
SUM(IF(b.goals_home + 0 > b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS home,
SUM(IF(b.goals_home = b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS draw,
SUM(IF(b.goals_home + 0 < b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS 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)
LEFT JOIN ' . FOOTB_BETS . " AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
GROUP BY m.match_no
ORDER BY m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query($sql);
$matches = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$count_matches = sizeof($matches);
if ($count_matches > 11)
{
$split_after = 8;
$splits = floor($count_matches / 8);
}
else
{
$split_after = $count_matches;
$splits = 1;
}
// Make sure $start is set to the last page if it exceeds the amount
if ($start < 0 || $start >= $total_users)
{
$start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page'];
}
else
{
$start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page'];
}
$sql_start = $start * $count_matches;
$sql_limit = $config['football_users_per_page'] * $count_matches;
// handle pagination.
$base_url = $this->helper->route('football_main_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday, 'u' => "$user_sel"));
$pagination = $phpbb_container->get('pagination');
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
$bet_line = array();
if ($count_matches > 0)
{
$matches_on_matchday = true;
// Select user bets and points on user results
$sql = "SELECT
u.user_id,
u.username,
m.status,
b.goals_home AS bet_home,
b.goals_guest AS bet_guest,
" . select_points("bu") . "
FROM " . FOOTB_MATCHES . ' AS m
LEFT JOIN ' . FOOTB_BETS . ' AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
LEFT JOIN ' . FOOTB_BETS . " AS bu ON(bu.season = m.season AND bu.league = m.league AND bu.match_no = m.match_no AND bu.user_id = $user_sel)
LEFT JOIN " . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
ORDER BY LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
$user_bets = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$bet_index = 0;
$split_index = 0;
foreach ($user_bets AS $user_bet)
{
$data = true;
if ($bet_index == $count_matches)
{
$bet_index = 0;
$split_index = 0;
}
if (!($bet_index % $split_after))
{
$split_index++;
}
$sum_total[$user_bet['username']] = 0;
$bet_line[$split_index][] = $user_bet;
$bet_index++;
}
}
$match_index = 0;
$split_index = 0;
$matchday_sum_total = 0;
$colorstyle_total = ' color_finally';
foreach ($matches AS $match)
{
if (!($match_index % $split_after))
{
if ($match_index > 0)
{
$total = 0;
$count_user = 0;
$bet_index = 0;
foreach ($bet_line[$split_index] AS $user_bet)
{
if ($bet_index == 0)
{
$count_user++;
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_bet['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
)
);
$total = 0;
}
$bet_index++;
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet_home = ($user_bet['bet_home'] == '') ? '&nbsp;' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
if ($bet_index == $split_after)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$bet_index = 0;
}
}
$template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => false,
)
);
foreach ($matches_tendency AS $match_tendency)
{
$template->assign_block_vars('match_panel.tendency_footer.tendency', array(
'TENDENCY' => $match_tendency,
)
);
}
}
$matches_tendency = array();
$split_index++;
if ($split_index == $splits)
{
$display_total = true;
}
else
{
$display_total = false;
}
$template->assign_block_vars('match_panel', array(
'S_TOTAL' => $display_total,
)
);
}
if (0 == $match['home_id'])
{
$home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']);
$home_in_array = explode("#",$home_info);
$homename = $home_in_array[3];
}
else
{
$homename = $match['home_name'];
}
if (0 == $match['guest_id'])
{
$guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']);
$guest_in_array = explode("#",$guest_info);
$guestname = $guest_in_array[3];
}
else
{
$guestname = $match['guest_name'];
}
$colorstyle_match = color_style($match['status']);
$template->assign_block_vars('match_panel.match_entry', array(
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'RESULT' => $match['goals_home'] . ':' . $match['goals_guest'],
'COLOR_STYLE' => $colorstyle_match,
)
);
if ($match['status'] < 1 && !$config['football_view_tendencies'])
{
// hide tendencies
$matches_tendency[] = '?-?-?';
}
else
{
$matches_tendency[] = $match['home'] . '-' . $match['draw'] . '-' . $match['guest'];
}
$match_index++;
}
if ($count_matches > 0)
{
$total = 0;
$count_user = 0;
$bet_index = 0;
foreach ($bet_line[$split_index] AS $user_bet)
{
if ($bet_index == 0)
{
$count_user++;
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_bet['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
)
);
$total = 0;
}
$bet_index++;
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 1)
{
if ($user_bet['bet_home'] == '')
{
$bet_home = '';
}
else
{
$bet_home = '?';
}
if ($user_bet['bet_guest'] == '')
{
$bet_guest = '';
}
else
{
$bet_guest = '?';
}
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
if ($bet_index == $split_after)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$template->assign_block_vars('match_panel.user_row.points', array(
'COLOR_STYLE' => $colorstyle_total,
'POINTS_TOTAL' => $sum_total[$user_bet['username']],
)
);
$bet_index = 0;
}
}
$template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => true,
'COLOR_STYLE' => $colorstyle_total, //currently ignored
'SUMTOTAL' => $matchday_sum_total,
)
);
foreach ($matches_tendency AS $match_tendency)
{
$template->assign_block_vars('match_panel.tendency_footer.tendency', array(
'TENDENCY' => $match_tendency,
)
);
}
}
$sidename = sprintf($user->lang['MY_KOEFF']);
$template->assign_vars(array(
'S_DISPLAY_MY_KOEFF' => true,
'S_SIDENAME' => $sidename,
'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday,
'S_SPALTEN' => ($count_matches * 2) + 2,
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
'USERNAME' => $username,
)
);
<?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);
$matches_on_matchday = false;
if (!$user_sel)
{
if (user_is_member($user->data['user_id'], $season, $league))
{
$user_sel = $user->data['user_id'];
}
}
$username = '';
$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
AND league = $league
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);
// Select matches with results and tendencies
$sql = "SELECT
m.match_no,
m.status,
m.formula_home,
m.formula_guest,
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,
SUM(IF(b.goals_home + 0 > b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS home,
SUM(IF(b.goals_home = b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS draw,
SUM(IF(b.goals_home + 0 < b.goals_guest AND b.goals_home <> '' AND b.goals_guest <> '', 1, 0)) AS 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)
LEFT JOIN ' . FOOTB_BETS . " AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
GROUP BY m.match_no
ORDER BY m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query($sql);
$matches = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$count_matches = sizeof($matches);
if ($count_matches > 11)
{
$split_after = 8;
$splits = floor($count_matches / 8);
}
else
{
$split_after = $count_matches;
$splits = 1;
}
// Make sure $start is set to the last page if it exceeds the amount
if ($start < 0 || $start >= $total_users)
{
$start = ($start < 0) ? 0 : floor(($total_users - 1) / $config['football_users_per_page']) * $config['football_users_per_page'];
}
else
{
$start = floor($start / $config['football_users_per_page']) * $config['football_users_per_page'];
}
$sql_start = $start * $count_matches;
$sql_limit = $config['football_users_per_page'] * $count_matches;
// handle pagination.
$base_url = $this->helper->route('football_football_controller', array('side' => 'my_koeff', 's' => $season, 'l' => $league, 'm' => $matchday, 'u' => "$user_sel"));
$pagination = $phpbb_container->get('pagination');
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_users, $this->config['football_users_per_page'], $start);
$bet_line = array();
if ($count_matches > 0)
{
$matches_on_matchday = true;
// Select user bets and points on user results
$sql = "SELECT
u.user_id,
u.username,
m.status,
b.goals_home AS bet_home,
b.goals_guest AS bet_guest,
" . select_points("bu") . "
FROM " . FOOTB_MATCHES . ' AS m
LEFT JOIN ' . FOOTB_BETS . ' AS b ON(b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
LEFT JOIN ' . FOOTB_BETS . " AS bu ON(bu.season = m.season AND bu.league = m.league AND bu.match_no = m.match_no AND bu.user_id = $user_sel)
LEFT JOIN " . USERS_TABLE . " AS u ON (u.user_id = b.user_id)
WHERE m.season = $season
AND m.league = $league
AND m.matchday = $matchday
ORDER BY LOWER(u.username) ASC, m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
$user_bets = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$bet_index = 0;
$split_index = 0;
foreach ($user_bets AS $user_bet)
{
$data = true;
if ($bet_index == $count_matches)
{
$bet_index = 0;
$split_index = 0;
}
if (!($bet_index % $split_after))
{
$split_index++;
}
$sum_total[$user_bet['username']] = 0;
$bet_line[$split_index][] = $user_bet;
$bet_index++;
}
}
$match_index = 0;
$split_index = 0;
$matchday_sum_total = 0;
$colorstyle_total = ' color_finally';
foreach ($matches AS $match)
{
if (!($match_index % $split_after))
{
if ($match_index > 0)
{
$total = 0;
$count_user = 0;
$bet_index = 0;
foreach ($bet_line[$split_index] AS $user_bet)
{
if ($bet_index == 0)
{
$count_user++;
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_bet['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
)
);
$total = 0;
}
$bet_index++;
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 1 && !$config['football_view_bets'])
{
// hide bets
$bet_home = ($user_bet['bet_home'] == '') ? '&nbsp;' : '?';
$bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?';
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
if ($bet_index == $split_after)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$bet_index = 0;
}
}
$template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => false,
)
);
foreach ($matches_tendency AS $match_tendency)
{
$template->assign_block_vars('match_panel.tendency_footer.tendency', array(
'TENDENCY' => $match_tendency,
)
);
}
}
$matches_tendency = array();
$split_index++;
if ($split_index == $splits)
{
$display_total = true;
}
else
{
$display_total = false;
}
$template->assign_block_vars('match_panel', array(
'S_TOTAL' => $display_total,
)
);
}
if (0 == $match['home_id'])
{
$home_info = get_team($season, $league, $match['match_no'], 'team_id_home', $match['formula_home']);
$home_in_array = explode("#",$home_info);
$homename = $home_in_array[3];
}
else
{
$homename = $match['home_name'];
}
if (0 == $match['guest_id'])
{
$guest_info = get_team($season, $league, $match['match_no'], 'team_id_guest', $match['formula_guest']);
$guest_in_array = explode("#",$guest_info);
$guestname = $guest_in_array[3];
}
else
{
$guestname = $match['guest_name'];
}
$colorstyle_match = color_style($match['status']);
$template->assign_block_vars('match_panel.match_entry', array(
'HOME_NAME' => $homename,
'GUEST_NAME' => $guestname,
'RESULT' => $match['goals_home'] . ':' . $match['goals_guest'],
'COLOR_STYLE' => $colorstyle_match,
)
);
if ($match['status'] < 1 && !$config['football_view_tendencies'])
{
// hide tendencies
$matches_tendency[] = '?-?-?';
}
else
{
$matches_tendency[] = $match['home'] . '-' . $match['draw'] . '-' . $match['guest'];
}
$match_index++;
}
if ($count_matches > 0)
{
$total = 0;
$count_user = 0;
$bet_index = 0;
foreach ($bet_line[$split_index] AS $user_bet)
{
if ($bet_index == 0)
{
$count_user++;
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
if ($user_bet['user_id'] == $user->data['user_id'])
{
$row_class = 'bg3 row_user';
}
$template->assign_block_vars('match_panel.user_row', array(
'ROW_CLASS' => $row_class,
'USER_NAME' => $user_bet['username'],
)
);
$total = 0;
}
$bet_index++;
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
if ($user_bet['status'] < 1)
{
if ($user_bet['bet_home'] == '')
{
$bet_home = '';
}
else
{
$bet_home = '?';
}
if ($user_bet['bet_guest'] == '')
{
$bet_guest = '';
}
else
{
$bet_guest = '?';
}
}
else
{
$bet_home = $user_bet['bet_home'];
$bet_guest = $user_bet['bet_guest'];
}
$colorstyle_bet = color_style($user_bet['status']);
$template->assign_block_vars('match_panel.user_row.bet', array(
'BET' => $bet_home. ':'. $bet_guest,
'COLOR_STYLE' => $colorstyle_bet,
'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
)
);
if ($bet_index == $split_after)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$template->assign_block_vars('match_panel.user_row.points', array(
'COLOR_STYLE' => $colorstyle_total,
'POINTS_TOTAL' => $sum_total[$user_bet['username']],
)
);
$bet_index = 0;
}
}
$template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => true,
'COLOR_STYLE' => $colorstyle_total, //currently ignored
'SUMTOTAL' => $matchday_sum_total,
)
);
foreach ($matches_tendency AS $match_tendency)
{
$template->assign_block_vars('match_panel.tendency_footer.tendency', array(
'TENDENCY' => $match_tendency,
)
);
}
}
$sidename = sprintf($user->lang['MY_KOEFF']);
$template->assign_vars(array(
'S_DISPLAY_MY_KOEFF' => true,
'S_SIDENAME' => $sidename,
'S_MATCHES_ON_MATCHDAY' => $matches_on_matchday,
'S_SPALTEN' => ($count_matches * 2) + 2,
'PAGE_NUMBER' => $pagination->on_page($total_users, $this->config['football_users_per_page'], $start),
'TOTAL_USERS' => ($total_users == 1) ? $user->lang['VIEW_BET_USER'] : sprintf($user->lang['VIEW_BET_USERS'], $total_users),
'USERNAME' => $username,
)
);
?>

View File

@@ -13,6 +13,8 @@ if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL'))
}
$data_odds = false;
$userid = $user->data['user_id'];
$user_is_member = user_is_member($userid, $season, $league);
$matchnumber = 0;
$lang_dates = $user->lang['datetime'];
@@ -37,6 +39,8 @@ $sql = "SELECT
t2.team_name_short AS guest_name,
t1.team_id AS home_id,
t2.team_id AS guest_id,
b.goals_home AS bet_home,
b.goals_guest AS bet_guest,
m.goals_home,
m.goals_guest,
m.goals_overtime_home AS kogoals_home,
@@ -48,13 +52,15 @@ $sql = "SELECT
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";
m.trend
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 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
ORDER BY m.match_datetime ASC, m.match_no ASC";
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
@@ -137,6 +143,8 @@ foreach ($rows as $row)
$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'];
$bet_home = ($row['bet_home'] == '') ? '&nbsp;' : $row['bet_home'];
$bet_guest = ($row['bet_guest'] == '') ? '&nbsp;' : $row['bet_guest'];
$template->assign_block_vars('odds', array(
'ROW_CLASS' => $row_class,
@@ -154,12 +162,15 @@ foreach ($rows as $row)
'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')),
'BET_HOME' => $bet_home,
'BET_GUEST' => $bet_guest,
'GOALS_HOME' => $goals_home,
'GOALS_GUEST' => $goals_guest,
'COLOR_STYLE' => '',
'KOGOALS_HOME' => $kogoals_home,
'KOGOALS_GUEST' => $kogoals_guest,
'S_KO_MATCH' => $ko_match,
'S_USER_IS_MEMBER' => $user_is_member,
'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,

View File

@@ -1,72 +1,71 @@
<?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 ($league <> 0)
{
$data_rank_matchday = false;
$index = 0;
$sql = "SELECT
r.status,
r.rank,
r.user_id,
u.username,
r.points,
IF(r.win=0, '', r.win) AS win
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 rank ASC, LOWER(u.username) ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$index++;
if (($index <= $config['football_display_ranks']) OR ($row['user_id'] == $user->data['user_id']))
{
$data_rank_matchday = true;
$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('rank', array(
'RANK' => $row['rank'],
'ROW_CLASS' => $row_class,
'USERID' => $row['user_id'],
'USERNAME' => $row['username'],
'U_BET_USER' => $this->helper->route('football_football_popup', array('popside' => 'bet_popup', 's' => $season, 'l' => $league,
'm' => $matchday, 'u' => $row['user_id'])),
'POINTS' => $row['points'],
'COLOR_STYLE' => $colorstyle,
'WIN' => $row['win'],
)
);
}
}
$db->sql_freeresult($result);
$league_info = league_info($season, $league);
$template->assign_vars(array(
'S_DISPLAY_RANK_MATCHDAY' => true,
'S_DATA_RANK_MATCHDAY' => $data_rank_matchday,
'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true,
'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;
}
if ($league <> 0)
{
$data_rank_matchday = false;
$index = 0;
$sql = "SELECT
r.status,
r.rank,
r.user_id,
u.username,
r.points,
IF(r.win=0, '', r.win) AS win
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, LOWER(u.username) ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$index++;
if (($index <= $config['football_display_ranks']) OR ($row['user_id'] == $user->data['user_id']))
{
$data_rank_matchday = true;
$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('rank', array(
'RANK' => $row['rank'],
'ROW_CLASS' => $row_class,
'USERID' => $row['user_id'],
'USERNAME' => $row['username'],
'U_BET_USER' => $this->helper->route('football_football_popup', array('popside' => 'bet_popup', 's' => $season, 'l' => $league,
'm' => $matchday, 'u' => $row['user_id'])),
'POINTS' => $row['points'],
'COLOR_STYLE' => $colorstyle,
'WIN' => $row['win'],
)
);
}
}
$db->sql_freeresult($result);
$league_info = league_info($season, $league);
$template->assign_vars(array(
'S_DISPLAY_RANK_MATCHDAY' => true,
'S_DATA_RANK_MATCHDAY' => $data_rank_matchday,
'S_WIN' => ($league_info['win_matchday'] == '0') ? false : true,
'WIN_NAME' => $config['football_win_name'],
));
}

View File

@@ -1,94 +1,94 @@
<?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 ($league <> 0)
{
$sql = 'SELECT
r.matchday AS last_matchday
FROM '. FOOTB_RANKS . " AS r
WHERE r.season = $season
AND r.league = $league
AND r.status IN (2,3)
ORDER BY r.matchday DESC";
$result = $db->sql_query_limit($sql, 1);
if($row = $db->sql_fetchrow($result))
{
$last_matchday = $row['last_matchday'];
$db->sql_freeresult($result);
$rank_matchday = ($last_matchday < $matchday) ? $last_matchday : $matchday;
$sql = 'SELECT
r.rank_total AS rank,
r.user_id,
u.username,
u.user_colour,
r.status AS status,
r.points_total AS points,
r.win_total AS win
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 = $rank_matchday
AND r.status IN (2,3)
ORDER BY points DESC, LOWER(u.username) ASC";
$result = $db->sql_query($sql);
$index = 0;
while($row = $db->sql_fetchrow($result))
{
$index++;
$data_rank_total = true;
if (($index <= $config['football_display_ranks']) OR ($row['user_id'] == $user->data['user_id']))
{
$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("ranktotal", array(
'RANK' => $row['rank'],
'ROW_CLASS' => $row_class,
'USERID' => $row['user_id'],
'USERNAME' => $row['username'],
'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
'URL' => $phpbb_root_path . "profile.php?mode=viewprofile&u=" . $row['user_id'],
'POINTS' => $row['points'],
'COLOR_STYLE' => $colorstyle,
'WIN' => $row['win'] ,
)
);
}
}
$db->sql_freeresult($result);
}
else
{
$data_rank_total = false;
}
$league_info = league_info($season, $league);
$template->assign_vars(array(
'S_DISPLAY_RANK_TOTAL' => true,
'S_DATA_RANK_TOTAL' => $data_rank_total,
'S_WIN' => ($league_info['win_matchday'] == '0' and $league_info['win_season'] == '0') ? false : true,
'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;
}
if ($league <> 0)
{
$sql = 'SELECT
r.matchday AS last_matchday
FROM '. FOOTB_RANKS . " AS r
WHERE r.season = $season
AND r.league = $league
AND r.status IN (2,3)
ORDER BY r.matchday DESC";
$result = $db->sql_query_limit($sql, 1);
if($row = $db->sql_fetchrow($result))
{
$last_matchday = $row['last_matchday'];
$db->sql_freeresult($result);
$rank_matchday = ($last_matchday < $matchday) ? $last_matchday : $matchday;
$sql = 'SELECT
r.rank_total AS rank,
r.user_id,
u.username,
u.user_colour,
r.status AS status,
r.points_total AS points,
r.win_total AS win
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 = $rank_matchday
AND r.status IN (2,3)
ORDER BY points DESC, LOWER(u.username) ASC";
$result = $db->sql_query($sql);
$index = 0;
while($row = $db->sql_fetchrow($result))
{
$index++;
$data_rank_total = true;
if (($index <= $config['football_display_ranks']) OR ($row['user_id'] == $user->data['user_id']))
{
$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("ranktotal", array(
'RANK' => $row['rank'],
'ROW_CLASS' => $row_class,
'USERID' => $row['user_id'],
'USERNAME' => $row['username'],
'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
'URL' => $phpbb_root_path . "profile.php?mode=viewprofile&u=" . $row['user_id'],
'POINTS' => $row['points'],
'COLOR_STYLE' => $colorstyle,
'WIN' => $row['win'] ,
)
);
}
}
$db->sql_freeresult($result);
}
else
{
$data_rank_total = false;
}
$league_info = league_info($season, $league);
$template->assign_vars(array(
'S_DISPLAY_RANK_TOTAL' => true,
'S_DATA_RANK_TOTAL' => $data_rank_total,
'S_WIN' => ($league_info['win_matchday'] == '0' and $league_info['win_season'] == '0') ? false : true,
'WIN_NAME' => $config['football_win_name'],
)
);
}
?>

View File

@@ -53,7 +53,7 @@ $sql = "SELECT
AND b.league = $league
AND m.status IN (2,3)
AND m.matchday = $matchday
GROUP BY user_id";
GROUP BY b.user_id";
$result = $db->sql_query($sql);
$usersstats = $db->sql_fetchrowset($result);
@@ -126,7 +126,7 @@ else
$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));
$base_url = $this->helper->route('football_football_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;
@@ -224,8 +224,8 @@ while($row = $db->sql_fetchrow($result))
'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,
'WORSENED' => ($change_sign == '+') ? true : false,
'IMPROVED' => ($change_sign == '-') ? true : false,
'CHANGE_SIGN' => $change_sign,
'CHANGE_DIFFER' => $change_differ,
'USERID' => $row['user_id'],
@@ -257,5 +257,3 @@ $template->assign_vars(array(
'WIN_NAME' => $config['football_win_name'],
)
);
?>

File diff suppressed because it is too large Load Diff

View File

@@ -416,7 +416,7 @@ $template->assign_vars(array(
'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_FORM_ACTION_RESULT' => $this->helper->route('football_football_controller', array('side' => 'results', 's' => $season, 'l' => $league, 'm' => $matchday, 'action' => 'result')),
'S_DATA_RESULTS' => $data_results,
'S_USER_IS_MEMBER' => $user_is_member,
'S_DISPLAY_GROUP' => $display_group,

View File

@@ -1,227 +1,228 @@
<?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);
}
$season = $this->request->variable('s', 0);
$league = $this->request->variable('l', 0);
// Check parms
$error_message = '';
if (!$season OR !$league)
{
$data_rules = false;
if (!$season)
{
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
}
if (!$league)
{
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
}
}
else
{
$season_info = season_info($season);
if (sizeof($season_info))
{
$season_name = $season_info['season_name'];
$league_info = league_info($season, $league);
if (sizeof($league_info))
{
$data_rules = true;
$matchdays = $league_info['matchdays'];
$league_name = $league_info['league_name'];
if ($user->data['is_registered'] and !$user->data['is_bot'])
{
$win_hits = '';
$win_hits02 = '';
$win_matchday = explode(';', "0;" . $league_info['win_matchday']);
$win_season = explode(';',"0;" . $league_info['win_season']);
$win_hits = $league_info['win_result'];
$win_hits02 = $league_info['win_result_02'];
if($win_hits != '' AND $win_hits != 0)
{
$template->assign_block_vars('wintable', array(
'WIN_DESC' => sprintf($user->lang['WIN_HITS']),
)
);
$template->assign_block_vars('wintable.entry', array(
'ROW_CLASS' => 'bg1 row_light',
'RANK' => '1. ' . sprintf($user->lang['PLACE']),
'WIN' => $win_hits,
)
);
}
if($win_hits02 != '' AND $win_hits02 != 0 AND $config['football_win_hits02'])
{
$template->assign_block_vars('wintable', array(
'WIN_DESC' => sprintf($user->lang['WIN_HITS02']),
)
);
$template->assign_block_vars('wintable.entry', array(
'ROW_CLASS' => 'bg1 row_light',
'RANK' => '1. ' . sprintf($user->lang['PLACE']),
'WIN' => $win_hits02,
)
);
}
if($win_matchday[1] != '' AND $win_matchday[1] != 0)
{
$template->assign_block_vars('wintable', array(
'WIN_DESC' => sprintf($user->lang['WINS_MATCHDAY']),
)
);
$rank = 1;
while ($win_matchday[$rank] != '')
{
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('wintable.entry', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank . '. ' . sprintf($user->lang['PLACE']),
'WIN' => $win_matchday[$rank],
)
);
$rank++ ;
if ($rank > sizeof($win_matchday)-1)
{
break;
}
}
}
if($win_season[1] != '' AND $win_season[1] != 0)
{
$template->assign_block_vars('wintable', array(
'WIN_DESC' => sprintf($user->lang['WINS_SEASON']),
)
);
$rank = 1;
while ($win_season[$rank] != '')
{
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('wintable.entry', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank. '. ' . sprintf($user->lang['PLACE']),
'WIN' => $win_season[$rank],
)
);
$rank++ ;
if ($rank > sizeof($win_season)-1)
{
break;
}
}
}
}
}
else
{
$data_rules = false;
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
$league_name = '';
}
}
else
{
$data_rules = false;
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
$season_name = '';
}
}
$sidename = sprintf($user->lang['FOOTBALL_RULES']);
if ($data_rules)
{
$link_rules = append_sid($phpbb_root_path . "viewtopic.$phpEx?p=" . $league_info["rules_post_id"]);
$points_tendency = ($league_info['points_mode'] < 3) ? sprintf($user->lang['POINTS_TENDENCY' . $league_info['points_mode']], $league_info['points_tendency']) : sprintf($user->lang['POINTS_TENDENCY'], $league_info['points_tendency']);
$template->assign_vars(array(
'S_SIDENAME' => $sidename,
'S_DATA_RULES' => $data_rules,
'S_BET_IN_TIME' => $league_info['bet_in_time'],
'S_RULES_POST_ID' => $league_info['rules_post_id'],
'S_ERROR_MESSAGE' => $error_message,
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'WIN_NAME' => $config['football_win_name'],
'JOIN_MODE' => ($league_info['join_by_user']) ? (($league_info['join_in_season']) ? sprintf($user->lang['JOIN_IN_SEASON']) : sprintf($user->lang['JOIN_BY_USER'])) : sprintf($user->lang['JOIN_BY_ADMIN']),
'POINTS_HIT' => sprintf($user->lang['POINTS_HIT'], $league_info['points_result']) . '<br/>',
'POINTS_TENDENCY' => $points_tendency . '<br/>',
'POINTS_DIFF' => ($league_info['points_mode'] == 4) ? sprintf($user->lang['POINTS_DIFFERENCE'], $league_info['points_diff']) . '<br/>' :
(($league_info['points_mode'] == 5) ? sprintf($user->lang['POINTS_DIFFERENCE_DRAW'], $league_info['points_diff']) . '<br/>' : ''),
'POINTS_LAST' => ($league_info['points_last']) ? sprintf($user->lang['POINTS_NO_BET']) . '<br/>' : '',
'LINK_RULES' => sprintf($user->lang['LINK_RULES'], $link_rules),
'SEASONNAME' => $season_info['season_name'],
'LEAGUENAME' => $league_name,
)
);
// output page
page_header(sprintf($user->lang['FOOTBALL_RULES' ]) . ' ' . $league_info['league_name'] . ' ' . $season_info['season_name']);
}
else
{
$template->assign_vars(array(
'S_SIDENAME' => $sidename,
'S_DATA_RULES' => $data_rules,
'S_BET_IN_TIME' => false,
'S_RULES_POST_ID' => 0,
'S_ERROR_MESSAGE' => $error_message,
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'WIN_NAME' => $config['football_win_name'],
'JOIN_MODE' => '',
'POINTS_HIT' => '',
'POINTS_TENDENCY' => '',
'POINTS_DIFF' => '',
'POINTS_LAST' => '',
'LINK_RULES' => '',
'SEASONNAME' => '',
'LEAGUENAME' => '',
)
);
// output page
page_header(sprintf($user->lang['FOOTBALL_RULES' ]));
}
$template->set_filenames(array(
'body' => 'rules_popup.html'
)
);
// $template->display('popup');
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);
}
$season = $this->request->variable('s', 0);
$league = $this->request->variable('l', 0);
// Check parms
$error_message = '';
if (!$season OR !$league)
{
$data_rules = false;
if (!$season)
{
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
}
if (!$league)
{
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
}
}
else
{
$season_info = season_info($season);
if (sizeof($season_info))
{
$season_name = $season_info['season_name'];
$league_info = league_info($season, $league);
if (sizeof($league_info))
{
$data_rules = true;
$matchdays = $league_info['matchdays'];
$league_name = $league_info['league_name'];
if ($user->data['is_registered'] and !$user->data['is_bot'])
{
$win_hits = '';
$win_hits02 = '';
$win_matchday = explode(';', "0;" . $league_info['win_matchday']);
$win_season = explode(';',"0;" . $league_info['win_season']);
$win_hits = $league_info['win_result'];
$win_hits02 = $league_info['win_result_02'];
if($win_hits != '' AND $win_hits != 0)
{
$template->assign_block_vars('wintable', array(
'WIN_DESC' => sprintf($user->lang['WIN_HITS']),
)
);
$template->assign_block_vars('wintable.entry', array(
'ROW_CLASS' => 'bg1 row_light',
'RANK' => '1. ' . sprintf($user->lang['PLACE']),
'WIN' => $win_hits,
)
);
}
if($win_hits02 != '' AND $win_hits02 != 0 AND $config['football_win_hits02'])
{
$template->assign_block_vars('wintable', array(
'WIN_DESC' => sprintf($user->lang['WIN_HITS02']),
)
);
$template->assign_block_vars('wintable.entry', array(
'ROW_CLASS' => 'bg1 row_light',
'RANK' => '1. ' . sprintf($user->lang['PLACE']),
'WIN' => $win_hits02,
)
);
}
if($win_matchday[1] != '' AND $win_matchday[1] != 0)
{
$template->assign_block_vars('wintable', array(
'WIN_DESC' => sprintf($user->lang['WINS_MATCHDAY']),
)
);
$rank = 1;
while ($win_matchday[$rank] != '')
{
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('wintable.entry', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank . '. ' . sprintf($user->lang['PLACE']),
'WIN' => $win_matchday[$rank],
)
);
$rank++ ;
if ($rank > sizeof($win_matchday)-1)
{
break;
}
}
}
if($win_season[1] != '' AND $win_season[1] != 0)
{
$template->assign_block_vars('wintable', array(
'WIN_DESC' => sprintf($user->lang['WINS_SEASON']),
)
);
$rank = 1;
while ($win_season[$rank] != '')
{
$row_class = (!($rank % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
$template->assign_block_vars('wintable.entry', array(
'ROW_CLASS' => $row_class,
'RANK' => $rank. '. ' . sprintf($user->lang['PLACE']),
'WIN' => $win_season[$rank],
)
);
$rank++ ;
if ($rank > sizeof($win_season)-1)
{
break;
}
}
}
}
}
else
{
$data_rules = false;
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
$league_name = '';
}
}
else
{
$data_rules = false;
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
$season_name = '';
}
}
$sidename = sprintf($user->lang['FOOTBALL_RULES']);
if ($data_rules)
{
$link_rules = append_sid($phpbb_root_path . "viewtopic.$phpEx?p=" . $league_info["rules_post_id"]);
$points_tendency = ($league_info['points_mode'] < 3) ? sprintf($user->lang['POINTS_TENDENCY' . $league_info['points_mode']], $league_info['points_tendency']) : sprintf($user->lang['POINTS_TENDENCY'], $league_info['points_tendency']);
$template->assign_vars(array(
'S_SIDENAME' => $sidename,
'S_DATA_RULES' => $data_rules,
'S_BET_IN_TIME' => $league_info['bet_in_time'],
'S_BET_POINTS' => true,
'S_RULES_POST_ID' => $league_info['rules_post_id'],
'S_ERROR_MESSAGE' => $error_message,
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'WIN_NAME' => $config['football_win_name'],
'JOIN_MODE' => ($league_info['join_by_user']) ? (($league_info['join_in_season']) ? sprintf($user->lang['JOIN_IN_SEASON']) : sprintf($user->lang['JOIN_BY_USER'])) : sprintf($user->lang['JOIN_BY_ADMIN']),
'POINTS_HIT' => sprintf($user->lang['POINTS_HIT'], $league_info['points_result']) . '<br/>',
'POINTS_TENDENCY' => $points_tendency . '<br/>',
'POINTS_DIFF' => ($league_info['points_mode'] == 4) ? sprintf($user->lang['POINTS_DIFFERENCE'], $league_info['points_diff']) . '<br/>' :
(($league_info['points_mode'] == 5) ? sprintf($user->lang['POINTS_DIFFERENCE_DRAW'], $league_info['points_diff']) . '<br/>' : ''),
'POINTS_LAST' => ($league_info['points_last']) ? sprintf($user->lang['POINTS_NO_BET']) . '<br/>' : '',
'LINK_RULES' => sprintf($user->lang['LINK_RULES'], $link_rules),
'SEASONNAME' => $season_info['season_name'],
'LEAGUENAME' => $league_name,
'BET_POINTS' => $league_info['bet_points'],
)
);
// output page
page_header(sprintf($user->lang['FOOTBALL_RULES' ]) . ' ' . $league_info['league_name'] . ' ' . $season_info['season_name']);
}
else
{
$template->assign_vars(array(
'S_SIDENAME' => $sidename,
'S_DATA_RULES' => $data_rules,
'S_BET_IN_TIME' => false,
'S_BET_POINTS' => false,
'S_RULES_POST_ID' => 0,
'S_ERROR_MESSAGE' => $error_message,
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'WIN_NAME' => $config['football_win_name'],
'JOIN_MODE' => '',
'POINTS_HIT' => '',
'POINTS_TENDENCY' => '',
'POINTS_DIFF' => '',
'POINTS_LAST' => '',
'LINK_RULES' => '',
'SEASONNAME' => '',
'LEAGUENAME' => '',
)
);
// output page
page_header(sprintf($user->lang['FOOTBALL_RULES' ]));
}
$template->set_filenames(array(
'body' => 'rules_popup.html'
)
);
// $template->display('popup');
page_footer();

View File

@@ -151,7 +151,7 @@ foreach($points_ary as $group_id => $points)
)
);
}
}
}
}
$db->sql_freeresult($result);

View File

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

View File

@@ -1,297 +1,297 @@
<?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);
}
$mode = $this->request->variable('mode', '');
$season = $this->request->variable('s', 0);
$league = $this->request->variable('l', 0);
$team_id = $this->request->variable('tid', 0);
switch($mode)
{
case 'played':
$mode_desc = sprintf($user->lang['PLAYED_MATCHES']);
$where = ' AND m.status IN (3,6) ';
$data_results = true;
break;
case 'rest':
$mode_desc = sprintf($user->lang['REST_MATCHES']);
$where = ' AND m.status IN (0,1,2,4,5) ';
$data_results = false;
break;
case 'home':
$mode_desc = sprintf($user->lang['HOME_MATCHES']);
$where = " AND m.team_id_home = $team_id AND m.status IN (3,6) ";
$data_results = true;
break;
case 'away':
$mode_desc = sprintf($user->lang['AWAY_MATCHES']);
$where = " AND m.team_id_guest = $team_id AND m.status IN (3,6) ";
$data_results = true;
break;
// ALL is Default
default:
$mode_desc = sprintf($user->lang['ALL_MATCHES']);
$where = '';
$data_results = true;
break;
}
// Check parms
$error_message = '';
if (!$season OR !$league OR !$team_id)
{
$data_plan = false;
if (!$season)
{
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
}
if (!$league)
{
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
}
if (!$team_id)
{
$error_message .= sprintf($user->lang['NO_TEAM_ID']) . '<br />';
}
}
else
{
$data_group = false;
$lang_dates = $user->lang['datetime'];
// Calculate matches and bets of matchday
$sql = "SELECT
IF(m.team_id_home = $team_id, 'H', 'A') AS match_place,
IF(((m.status=3) OR (m.status=6)),
IF(m.team_id_home = $team_id,
IF(m.goals_home + 0 > m.goals_guest, 'match_win', IF(m.goals_home = m.goals_guest, 'match_draw', 'match_lost')),
IF(m.goals_home + 0 < m.goals_guest, 'match_win', IF(m.goals_home = m.goals_guest, 'match_draw', 'match_lost'))),
'') AS match_style,
m.match_no,
m.matchday,
m.status,
m.group_id,
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,
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.team_id_home = $team_id OR m.team_id_guest = $team_id)
$where
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_plan = 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;
$homelogo = $row['home_symbol'];
$guestlogo = $row['guest_symbol'];
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
{
$data_group = true;
$group_id = $row['group_id'];
}
if ($row['match_place'] == 'H')
{
$color_home = $row['match_style'];
$color_guest = '';
}
else
{
$color_home = '';
$color_guest = $row['match_style'];
}
$color_goals = $row['match_style'];
$template->assign_block_vars('match', array(
'ROW_CLASS' => $row_class,
'MATCH_TIME' => $row['match_time'],
'GROUP' => $group_id,
'LOGO_HOME' => $logoH,
'LOGO_GUEST' => $logoG,
'HOME_NAME' => $row['home_short'],
'GUEST_NAME' => $row['guest_short'],
'GOALS_HOME' => ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'],
'GOALS_GUEST' => ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'],
'COLOR_HOME' => $color_home,
'COLOR_GUEST' => $color_guest,
'COLOR_GOALS' => $color_goals,
)
);
}
while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
}
else
{
$data_plan = false;
}
$season_info = season_info($season);
if (sizeof($season_info) == 0)
{
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
$season_name = '';
}
else
{
$season_name = $season_info["season_name"];
$league_info = league_info($season, $league);
if (sizeof($league_info) == 0)
{
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
$league_name = '';
}
else
{
$league_name = $league_info["league_name"];
$team_info = team_info($season, $league, $team_id);
if (sizeof($team_info) == 0)
{
$error_message .= sprintf($user->lang['NO_TEAM_ID']) . '<br />';
$team_name = '';
$logo = '';
}
else
{
$team_name = $team_info["team_name"];
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $team_info["team_symbol"] . "\" alt=\"" . $team_info["team_symbol"] . "\" width=\"28\" height=\"28\"/>" ;
}
}
}
}
$sidename = sprintf($user->lang['PLAN']);
if ($data_plan)
{
$template->assign_vars(array(
'S_SIDENAME' => $sidename,
'S_DATA_PLAN' => $data_plan,
'S_DATA_GROUP' => $data_group,
'S_ERROR_MESSAGE' => $error_message,
'MODE_DESC' => $mode_desc,
'LOGO' => $logo,
'TEAM' => $team_name,
'SEASON' => $season_name,
'LEAGUE' => $league_name,
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'S_DATA_RESULTS' => $data_results,
)
);
// output page
page_header($mode_desc . ' ' . $team_name);
}
else
{
$template->assign_vars(array(
'S_SIDENAME' => $sidename,
'S_DATA_PLAN' => $data_plan,
'S_DATA_GROUP' => false,
'S_ERROR_MESSAGE' => $error_message,
'MODE_DESC' => $mode_desc,
'LOGO' => '',
'TEAM' => '',
'SEASON' => '',
'LEAGUE' => '',
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'S_DATA_RESULTS' => false,
)
);
// output page
page_header($mode_desc);
}
$template->set_filenames(array(
'body' => 'viewplan_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);
}
$mode = $this->request->variable('mode', '');
$season = $this->request->variable('s', 0);
$league = $this->request->variable('l', 0);
$team_id = $this->request->variable('tid', 0);
switch($mode)
{
case 'played':
$mode_desc = sprintf($user->lang['PLAYED_MATCHES']);
$where = ' AND m.status IN (3,6) ';
$data_results = true;
break;
case 'rest':
$mode_desc = sprintf($user->lang['REST_MATCHES']);
$where = ' AND m.status IN (0,1,2,4,5) ';
$data_results = false;
break;
case 'home':
$mode_desc = sprintf($user->lang['HOME_MATCHES']);
$where = " AND m.team_id_home = $team_id AND m.status IN (3,6) ";
$data_results = true;
break;
case 'away':
$mode_desc = sprintf($user->lang['AWAY_MATCHES']);
$where = " AND m.team_id_guest = $team_id AND m.status IN (3,6) ";
$data_results = true;
break;
// ALL is Default
default:
$mode_desc = sprintf($user->lang['ALL_MATCHES']);
$where = '';
$data_results = true;
break;
}
// Check parms
$error_message = '';
if (!$season OR !$league OR !$team_id)
{
$data_plan = false;
if (!$season)
{
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
}
if (!$league)
{
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
}
if (!$team_id)
{
$error_message .= sprintf($user->lang['NO_TEAM_ID']) . '<br />';
}
}
else
{
$data_group = false;
$lang_dates = $user->lang['datetime'];
// Calculate matches and bets of matchday
$sql = "SELECT
IF(m.team_id_home = $team_id, 'H', 'A') AS match_place,
IF(((m.status=3) OR (m.status=6)),
IF(m.team_id_home = $team_id,
IF(m.goals_home + 0 > m.goals_guest, 'match_win', IF(m.goals_home = m.goals_guest, 'match_draw', 'match_lost')),
IF(m.goals_home + 0 < m.goals_guest, 'match_win', IF(m.goals_home = m.goals_guest, 'match_draw', 'match_lost'))),
'') AS match_style,
m.match_no,
m.matchday,
m.status,
m.group_id,
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,
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.team_id_home = $team_id OR m.team_id_guest = $team_id)
$where
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_plan = 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;
$homelogo = $row['home_symbol'];
$guestlogo = $row['guest_symbol'];
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
{
$data_group = true;
$group_id = $row['group_id'];
}
if ($row['match_place'] == 'H')
{
$color_home = $row['match_style'];
$color_guest = '';
}
else
{
$color_home = '';
$color_guest = $row['match_style'];
}
$color_goals = $row['match_style'];
$template->assign_block_vars('match', array(
'ROW_CLASS' => $row_class,
'MATCH_TIME' => $row['match_time'],
'GROUP' => $group_id,
'LOGO_HOME' => $logoH,
'LOGO_GUEST' => $logoG,
'HOME_NAME' => $row['home_short'],
'GUEST_NAME' => $row['guest_short'],
'GOALS_HOME' => ($row['goals_home'] == '') ? '&nbsp;' : $row['goals_home'],
'GOALS_GUEST' => ($row['goals_guest'] == '') ? '&nbsp;' : $row['goals_guest'],
'COLOR_HOME' => $color_home,
'COLOR_GUEST' => $color_guest,
'COLOR_GOALS' => $color_goals,
)
);
}
while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
}
else
{
$data_plan = false;
}
$season_info = season_info($season);
if (sizeof($season_info) == 0)
{
$error_message .= sprintf($user->lang['NO_SEASON']) . '<br />';
$season_name = '';
}
else
{
$season_name = $season_info["season_name"];
$league_info = league_info($season, $league);
if (sizeof($league_info) == 0)
{
$error_message .= sprintf($user->lang['NO_LEAGUE']) . '<br />';
$league_name = '';
}
else
{
$league_name = $league_info["league_name"];
$team_info = team_info($season, $league, $team_id);
if (sizeof($team_info) == 0)
{
$error_message .= sprintf($user->lang['NO_TEAM_ID']) . '<br />';
$team_name = '';
$logo = '';
}
else
{
$team_name = $team_info["team_name"];
$logo = "<img src=\"" . $ext_path . 'images/flags/' . $team_info["team_symbol"] . "\" alt=\"" . $team_info["team_symbol"] . "\" width=\"28\" height=\"28\"/>" ;
}
}
}
}
$sidename = sprintf($user->lang['PLAN']);
if ($data_plan)
{
$template->assign_vars(array(
'S_SIDENAME' => $sidename,
'S_DATA_PLAN' => $data_plan,
'S_DATA_GROUP' => $data_group,
'S_ERROR_MESSAGE' => $error_message,
'MODE_DESC' => $mode_desc,
'LOGO' => $logo,
'TEAM' => $team_name,
'SEASON' => $season_name,
'LEAGUE' => $league_name,
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'S_DATA_RESULTS' => $data_results,
)
);
// output page
page_header($mode_desc . ' ' . $team_name);
}
else
{
$template->assign_vars(array(
'S_SIDENAME' => $sidename,
'S_DATA_PLAN' => $data_plan,
'S_DATA_GROUP' => false,
'S_ERROR_MESSAGE' => $error_message,
'MODE_DESC' => $mode_desc,
'LOGO' => '',
'TEAM' => '',
'SEASON' => '',
'LEAGUE' => '',
'S_FOOTBALL_COPY' => sprintf($user->lang['FOOTBALL_COPY'], $config['football_version'], $phpbb_root_path . 'football/'),
'S_DATA_RESULTS' => false,
)
);
// output page
page_header($mode_desc);
}
$template->set_filenames(array(
'body' => 'viewplan_popup.html')
);
page_footer();
?>