/** * return html code for not playing teams * * @param array $games * @param array $teams * @param array $config * @param array $favteams * @param object $project * @return string html */ public function showNotPlayingTeams(&$games, &$teams, &$config, &$favteams, &$project) { $output = ''; $playing_teams = array(); foreach ($games as $game) { self::addPlayingTeams($playing_teams, $game->projectteam1_id, $game->projectteam2_id, $game->published); } $x = 0; $not_playing = count($teams) - count($playing_teams); if ($not_playing > 0) { $output .= '<b>' . JText::sprintf('COM_JOOMLEAGUE_RESULTS_TEAMS_NOT_PLAYING', $not_playing) . '</b> '; foreach ($teams as $id => $team) { if (isset($team->projectteamid) && in_array($team->projectteamid, $playing_teams)) { continue; //if team is playing,go to next } if ($x > 0) { $output .= ', '; } if ($config['show_logo_small'] > 0 && $config['show_dnp_teams_icons']) { $output .= self::getTeamClubIcon($team, $config['show_logo_small']) . ' '; } $isFavTeam = in_array($team->id, $favteams); $output .= JoomleagueHelper::formatTeamName($team, 't' . $team->id, $config, $isFavTeam); $x++; } } return $output; }
$config['team_picture_height'],3); */ } echo '</td>'; echo "\n"; } //**************Team name echo '<td class="rankingrow_teamname" nowrap="nowrap"'; if ($color != '' && $config['use_background_row_color']) { echo ' style="background-color: ' . $color . '"'; } echo ">"; $isFavTeam = in_array($team->team->id, explode(",", $this->project->fav_team)); // TODO: ranking deviates from the other views, regarding highlighting of the favorite team(s). Align this... $config['highlight_fav'] = $isFavTeam; echo JoomleagueHelper::formatTeamName($team->team, 'tr' . $team->team->id, $config, $isFavTeam); echo '</td>'; echo "\n"; //**********START OPTIONAL COLUMNS DISPLAY foreach ($columns as $c) { switch (trim(strtoupper($c))) { case 'PLAYED': echo '<td class="rankingrow_played" '; if ($color != '' && $config['use_background_row_color']) { echo 'style="background-color:' . $color . '"'; } echo '>'; printf($format, $team->cnt_matches); echo '</td>'; echo "\n"; break;
$teamB .= '<td class="' . $class2 . '">'; $teamB .= Countries::getCountryFlag($guestteam->country); $teamB .= '</td>'; break; case 3: $teamA .= '<td class="' . $class1 . '">'; $teamA .= JoomleagueHelper::getPictureThumb($hometeam->picture, $hometeam->name, $this->config['team_picture_width'], $this->config['team_picture_height'], 1); $teamA .= '</td>'; $teamB .= '<td class="' . $class2 . '">'; $teamB .= JoomleagueHelper::getPictureThumb($guestteam->picture, $guestteam->name, $this->config['team_picture_width'], $this->config['team_picture_height'], 1); $teamB .= '</td>'; break; } $seperator = '<td width="10">' . $this->config['seperator'] . '</td>'; $isFavTeam = in_array($guestteam->id, $this->favteams); $away = JoomleagueHelper::formatTeamName($guestteam, "g" . $match->id . "t" . $guestteam->id, $this->config, $isFavTeam, $awaylink); $teamB .= '<td class="' . $class2 . '">' . $away . '</td>'; if (!$match->cancel) { // In case show_part_results is true, then first check if the part results are available; // 'No part results available' occurs when teamX_result_split ONLY consists of zero or more ";" // (zero for projects with a single playing period, one or more for projects with two or more playing periods) $team1_result_split_present = preg_match('/^;*$/', $match->team1_result_split) == 0; $team2_result_split_present = preg_match('/^;*$/', $match->team2_result_split) == 0; if ($this->config['switch_home_guest']) { $result = $match->team2_result . ' ' . $this->config['seperator'] . ' ' . $match->team1_result; $part_results_left = explode(";", $match->team2_result_split); $part_results_right = explode(";", $match->team1_result_split); $leftResultOT = $match->team2_result_ot; $rightResultOT = $match->team1_result_ot; $leftResultSO = $match->team2_result_so; $rightResultSO = $match->team1_result_so;
echo Countries::getCountryFlag($row->country); ?> </td> <?php } ?> <td class="td_l playerteam" width="30%"> <?php $team = $this->teams[$row->tid]; if ($this->config['link_to_team'] == 1 && $this->project->id > 0 && $row->tid > 0) { $link = JoomleagueHelperRoute::getTeamInfoRoute($this->project->id, $row->tid); } else { $link = null; } $teamName = JoomleagueHelper::formatTeamName($team, "t" . $row->tid, $this->config, $highlightFavTeam, $link); echo $teamName; ?> </td> <?php $value = $row->p > 9 ? $row->p : ' ' . $row->p; ?> <td class="td_c playertotal"><?php echo $value; ?> </td> </tr> <?php $k = 1 - $k; }
<?php echo $this->getTeamClubIcon($team1, $this->config['show_logo_small'], array('class' => 'teamlogo')); ?> </td> <td width='5'> - </td> <td width='20'> <?php echo $this->getTeamClubIcon($team2, $this->config['show_logo_small'], array('class' => 'teamlogo')); ?> </td> <td class='left'> <?php $isFavTeam = in_array($team2->id, $this->favteams); echo JoomleagueHelper::formatTeamName($team2, 'g' . $game->id, $this->config, $isFavTeam); ?> </td> <!-- show match score --> <td width='5' class='score' nowrap='nowrap'> <?php echo ' '; echo $this->formatResult($this->teams[$game->projectteam1_id], $this->teams[$game->projectteam2_id], $game, $report_link); echo ' '; ?> </td> <?php } //-------------------------------------------------------------------------------------------------------------- ?>
$hometeam->club_slug = $game->club1_slug; $hometeam->team_slug = $game->team1_slug; $tname1 = JoomleagueHelper::formatTeamName($hometeam, 'clubplanhome' . $cnt++, $this->config, $isFavTeam, $link1); $isFavTeam = false; $isFavTeam = in_array($game->team2_id, $favteams); $awayteam->name = $game->tname2; $awayteam->team_id = $game->team2_id; $awayteam->id = $game->team2_id; $awayteam->short_name = $game->tname2_short; $awayteam->middle_name = $game->tname2_middle; $awayteam->project_id = $game->prid; $awayteam->club_id = $game->t2club_id; $awayteam->projectteamid = $game->projectteam2_id; $awayteam->club_slug = $game->club2_slug; $awayteam->team_slug = $game->team2_slug; $tname2 = JoomleagueHelper::formatTeamName($awayteam, 'clubplanaway' . $cnt++, $this->config, $isFavTeam, $link2); $favStyle = ''; if ($this->config['highlight_fav'] == 1 && !$club_id) { $isFavTeam = in_array($game->team1_id, $favteams) || in_array($game->team2_id, $favteams); if ($isFavTeam && $favs->fav_team_highlight_type == 1) { if (trim($favs->fav_team_color) != "") { $color = trim($favs->fav_team_color); } $format = "%s"; $favStyle = ' style="'; $favStyle .= $favs->fav_team_text_bold != '' ? 'font-weight:bold;' : ''; $favStyle .= trim($favs->fav_team_text_color) != '' ? 'color:' . trim($favs->fav_team_text_color) . ';' : ''; $favStyle .= $color != '' ? 'background-color:' . $color . ';' : ''; if ($favStyle != ' style="') { $favStyle .= '"'; } else {
<?php } ?> <?php if ($this->config['show_team'] == 1) { ?> <td class="td_l playerteam"> <?php $team = $this->teams[$row->team_id]; if ($this->config['link_to_team'] == 1 && $this->project->id > 0 && $row->team_id > 0) { $link = JoomleagueHelperRoute::getTeamInfoRoute($this->project->id, $row->team_id); } else { $link = null; } $teamName = JoomleagueHelper::formatTeamName($team, "t" . $row->team_id, $this->config, $isFavTeam, $link); echo $teamName; ?> </td> <?php } ?> <td class="td_r playertotal"><?php echo $row->total; ?> </td> </tr> <?php $k = 1 - $k; }
continue; } $team = JArrayHelper::toObject($v); if (empty($team->id)) { continue; } ?> <tr class="<?php echo $k == 0 ? $this->config['style_class1'] : $this->config['style_class2']; ?> "> <td class="name_row"><?php $isFavTeam = in_array($team->id, explode(",", $this->project->fav_team)); // TODO: ranking deviates from the other views, regarding highlighting of the favorite team(s). Align this... $config['highlight_fav'] = $isFavTeam; echo JoomleagueHelper::formatTeamName($team, 'tr' . $k, $this->config, $isFavTeam); //echo $v['name']; ?> </td> <td class="match_row"><?php echo $v['match']; ?> </td> <td class="win_row"><?php echo $v['win'] != 0 ? $v['win'] : 0; ?> </td> <td class="tie_row"><?php echo $v['tie'] != 0 ? $v['tie'] : 0; ?> </td>
$hometeam->middle_name = $game->tname1_middle; $hometeam->project_id = $game->prid; $hometeam->club_id = $game->t1club_id; $hometeam->projectteamid = $game->projectteam1_id; $tname1 = JoomleagueHelper::formatTeamName($hometeam, "c" . $counter . "g" . $game->id, $this->config, $isFavTeam); $isFavTeam = false; $isFavTeam = in_array($game->team2_id, $this->favteams); $awayteam->name = $game->tname2; $awayteam->team_id = $game->team2_id; $awayteam->id = $game->team2_id; $awayteam->short_name = $game->tname2_short; $awayteam->middle_name = $game->tname2_middle; $awayteam->project_id = $game->prid; $awayteam->club_id = $game->t2club_id; $awayteam->projectteamid = $game->projectteam2_id; $tname2 = JoomleagueHelper::formatTeamName($awayteam, "c" . $counter . "g" . $game->id, $this->config, $isFavTeam); $favStyle = ''; if ($this->config['highlight_fav'] == 1 && !$club_id) { $isFavTeam = in_array($game->team1_id, $this->favteams) ? 1 : in_array($game->team2_id, $this->favteams); if ($isFavTeam && $this->project->fav_team_highlight_type == 1) { if (trim($this->project->fav_team_color) != "") { $color = trim($this->project->fav_team_color); } $format = "%s"; $favStyle = ' style="'; $favStyle .= $this->project->fav_team_text_bold != '' ? 'font-weight:bold;' : ''; $favStyle .= trim($this->project->fav_team_text_color) != '' ? 'color:' . trim($this->project->fav_team_text_color) . ';' : ''; $favStyle .= $color != '' ? 'background-color:' . $color . ';' : ''; if ($favStyle != ' style="') { $favStyle .= '"'; } else {
$hometeam->middle_name = $game->tname1_middle; $hometeam->project_id = $game->prid; $hometeam->club_id = $game->t1club_id; $hometeam->projectteamid = $game->projectteam1_id; $tname1 = JoomleagueHelper::formatTeamName($hometeam, 'clubplan', $this->config, $isFavTeam); $isFavTeam = false; $isFavTeam = in_array($game->team2_id, $this->favteams); $awayteam->name = $game->tname2; $awayteam->team_id = $game->team2_id; $awayteam->id = $game->team2_id; $awayteam->short_name = $game->tname2_short; $awayteam->middle_name = $game->tname2_middle; $awayteam->project_id = $game->prid; $awayteam->club_id = $game->t2club_id; $awayteam->projectteamid = $game->projectteam2_id; $tname2 = JoomleagueHelper::formatTeamName($awayteam, 'clubplan', $this->config, $isFavTeam); $favStyle = ''; if ($this->config['highlight_fav'] == 1 && !$club_id) { $isFavTeam = in_array($game->team1_id, $this->favteams) ? 1 : in_array($game->team2_id, $this->favteams); if ($isFavTeam && $this->project->fav_team_highlight_type == 1) { if (trim($this->project->fav_team_color) != "") { $color = trim($this->project->fav_team_color); } $format = "%s"; $favStyle = ' style="'; $favStyle .= $this->project->fav_team_text_bold != '' ? 'font-weight:bold;' : ''; $favStyle .= trim($this->project->fav_team_text_color) != '' ? 'color:' . trim($this->project->fav_team_text_color) . ';' : ''; $favStyle .= $color != '' ? 'background-color:' . $color . ';' : ''; if ($favStyle != ' style="') { $favStyle .= '"'; } else {