Fix warning in all bets when no bets are shown.

This commit is contained in:
2022-08-11 16:29:35 +02:00
parent abf7e95d08
commit 41397ffbdc
6 changed files with 92 additions and 57 deletions

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

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

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

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

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

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

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

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

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

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

View File

@@ -214,64 +214,67 @@ foreach ($matches AS $match)
$count_user = 0; $count_user = 0;
$bet_index = 0; $bet_index = 0;
$last_match_index = 0; $last_match_index = 0;
foreach ($bet_line[$split_index] AS $user_bet) if(!empty($bet_line))
{ {
if ($bet_index == 0) foreach ($bet_line[$split_index] AS $user_bet)
{ {
$count_user++; if ($bet_index == 0)
$league_info = league_info($season, $league); {
if ($league_info['bet_type']) $count_user++;
{ $league_info = league_info($season, $league);
$row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark'; if ($league_info['bet_type'])
} {
else $row_class = (!($count_user % 2)) ? 'bg1 row_light' : 'bg2 row_dark';
{ }
$row_class = (!(($count_user + ($count_user % 2)) % 4)) ? 'bg1 row_light' : 'bg2 row_dark'; else
} {
if ($user_bet['user_id'] == $user->data['user_id']) $row_class = (!(($count_user + ($count_user % 2)) % 4)) ? 'bg1 row_light' : 'bg2 row_dark';
{ }
$row_class = 'bg3 row_user'; if ($user_bet['user_id'] == $user->data['user_id'])
} {
$template->assign_block_vars('match_panel.user_row', array( $row_class = 'bg3 row_user';
'ROW_CLASS' => $row_class, }
'USER_NAME' => $user_bet['username'], $template->assign_block_vars('match_panel.user_row', array(
) 'ROW_CLASS' => $row_class,
); 'USER_NAME' => $user_bet['username'],
$total = 0; )
} );
$bet_index++; $total = 0;
$total += ($user_bet['points'] == '') ? 0 : $user_bet['points']; }
if ($user_bet['status'] < 3) $bet_index++;
{ $total += ($user_bet['points'] == '') ? 0 : $user_bet['points'];
$colorstyle_total = ' color_provisionally'; if ($user_bet['status'] < 3)
} {
if ($user_bet['status'] < 1 && !$config['football_view_bets']) $colorstyle_total = ' color_provisionally';
{ }
// hide bets if ($user_bet['status'] < 1 && !$config['football_view_bets'])
$bet_home = ($user_bet['bet_home'] == '') ? '&nbsp;' : '?'; {
$bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?'; // hide bets
} $bet_home = ($user_bet['bet_home'] == '') ? '&nbsp;' : '?';
else $bet_guest = ($user_bet['bet_guest'] == '') ? '&nbsp;' : '?';
{ }
$bet_home = $user_bet['bet_home']; else
$bet_guest = $user_bet['bet_guest']; {
} $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) $colorstyle_bet = color_style($user_bet['status']);
{ $template->assign_block_vars('match_panel.user_row.bet', array(
$sum_total[$user_bet['username']] += $total; 'BET' => $bet_home. ':'. $bet_guest,
$matchday_sum_total += $total; 'COLOR_STYLE' => $colorstyle_bet,
$bet_index = 0; 'POINTS' => ($user_bet['points'] == '') ? '&nbsp;' : $user_bet['points'],
} )
} );
if ($bet_index == $split_after)
{
$sum_total[$user_bet['username']] += $total;
$matchday_sum_total += $total;
$bet_index = 0;
}
}
}
$template->assign_block_vars('match_panel.tendency_footer', array( $template->assign_block_vars('match_panel.tendency_footer', array(
'S_TOTAL' => false, 'S_TOTAL' => false,