Files
phpbb_football_tlw/block/rank_matchday.php
Julian Arndt c9b4372b34 Merge remote-tracking branch 'football/master'
# Conflicts:
#	acp/matches_module.php
#	adm/style/acp_football_leagues.html
#	adm/style/acp_football_matches.html
#	block/all_bets.php
#	block/rank_matchday.php
#	block/ranks_total.php
#	config/services.yml
#	controller/main.php
#	event/main_listener.php
#	includes/constants.php
#	includes/functions.php
#	language/de/football.php
#	language/de/info_acp_leagues.php
#	language/de/info_acp_matches.php
#	styles/prosilver/template/all_bets.html
#	styles/prosilver/template/results.html
#	styles/prosilver/template/table.html
#	styles/prosilver/theme/football.css
2023-06-07 20:40:50 +02:00

81 lines
2.1 KiB
PHP

<?php
/**
*
* @package phpBB Extension - Football Football
* @copyright (c) 2016 football (http://football.bplaced.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if ($league > 50)
{
$league_corr = $league - 50;
}
else
{
$league_corr = $league;
}
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_corr
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_corr,
'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_corr);
$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'],
));
}