function html_bracket_team_cell($teams, $content, $score, $container_class = '') { global $pref; //echo "html_bracket_team_cell: $teams, $content, $score, $container_class<br>"; $text = '<td><div class="container ' . $container_class . '">'; //$text .= '<div>'.$content.'</div>'; if ($container_class == 'victor') { $victor_image = 'images/awards/trophy_gold.png'; $victor_str = '<img src="' . $victor_image . '" alt=""/>'; } $score_class = 'score'; if (preg_match("/^\\d+\\+\$/", $score)) { $score_class = 'score win'; } if (preg_match("/^\\d+\\-\$/", $score)) { $score_class = 'score loss'; } $score = preg_replace("/[\\+\\-]/", "", $score); switch ($content[0]) { case 'E': $text .= '<div class="player"> </div>'; break; case 'N': $text .= '<div class="player">Not needed</div>'; break; case 'F': $text .= '<div class="player"> </div>'; break; case 'W': $text .= '<div class="player"> </div>'; break; case 'L': $teams = substr($content, 1); $text .= EB_EVENT_L85 . ' ' . $teams; break; case 'P': $teams = substr($content, 1); $text .= EB_EVENT_L85 . ' ' . $teams . ' ' . EB_EVENT_L86; break; case 'T': $team = substr($content, 1); $team_name = $teams[$team - 1]['Name']; $team_uniqueid = $teams[$team - 1]['UniqueGameID']; $team_seed = $teams[$team - 1]['seed']; $team_avatar = $teams[$team - 1]['Avatar']; //Get the lenght of the string. $team_name_short = $team_name; $str_length = strlen($team_name_short); $total_str_length = 12; $team_image = ""; if ($pref['eb_avatar_enable_playersstandings'] == 1) { if ($team_avatar) { $team_image = '<img ' . getImageResize(avatar($team_avatar), 16) . ' alt="' . $team_avatar . '"' . '/>'; $total_str_length -= 3; } } if ($str_length > $total_str_length) { //displaying the replaced string. $team_name_short = substr($team_name_short, 0, $total_str_length - 3) . "..."; } $text .= '<table class="player"><tbody><tr>'; $text .= '<td class="seed"><div class="seed">'; $text .= $team_seed; $text .= '</div></td>'; $text .= '<td class="player"><div class="player" title="' . $team_name . '.' . $team_uniqueid . '">'; $text .= $team_image; $text .= $team_name_short; $text .= '</div></td>'; $text .= '<td class="wins">'; switch ($container_class) { case 'winner': //$text .= '<div class="wins">W</div>'; break; case 'loser': //$text .= '<div class="wins">L</div>'; break; case 'victor': $text .= '<div class="wins">' . $victor_str . '</div>'; break; } $text .= '</td>'; if ($score != '') { $text .= '<td class="' . $score_class . '"><div class="' . $score_class . '">'; $text .= $score; $text .= '</div></td>'; } $text .= '</tr></tbody></table>'; break; default: break; } $text .= '</div></td>'; return $text; }
function getMapImageResize($mimage) { global $pref; return 'class="eb_map_image" ' . getImageResize(getImagePath($mimage, 'games_maps'), $pref['eb_max_map_image_size'], $pref['eb_max_map_image_size_check']) . ' alt="' . $mimage . '"'; }