$points = $row['points']; $player_sql = "SELECT approved from $playerstable where name = '$name'"; $player_row = mysql_fetch_array(mysql_query($player_sql)); $nameClass = colorNameClass($name, $player_row['approved']); $imgRank = getImgForRank($position, ""); $cup_points = 7 - $position; if (array_key_exists($name, $overall)) { $overall_player = $overall[$name]; $overall_player['points'] += $cup_points; $overall_player['seasonpos'] = addSeasonAndPos($overall_player['seasonpos'], $cur, $position); $overall[$name] = $overall_player; } else { $overall_player = array(); $overall_player['points'] = $cup_points; $overall_player['seasonpos'] = addSeasonAndPos(array(), $cur, $position); $overall[$name] = $overall_player; } echo "<tr style='height:19px;'>". "<td align='center'>".$imgRank ."</td>". "<td width='80%' $nameClass><a href='$directory/profile.php?name=$name' title='view profile'>$name</a>". "</td><td align='right' nowrap><b>".$points."</b> pts</td></tr>"; if ($count == 3) { echo '</table></td><td width="50%"><table class="layouttable">'; } }
function GetAwards($player_id, $name) { require('variables.php'); require('variablesdb.php'); $awards = ""; // ladder awards $ladderAwards = ""; $awards_sql = "SELECT position, season from $historytable ". "WHERE player_id = '$player_id' order by season"; $awards_result = mysql_query($awards_sql); $seasonPosArray = array(); while($awards_row = mysql_fetch_array($awards_result)) { $position = $awards_row['position']; $db_season = $awards_row['season']; if ($position < 7 && $position > 0) { $seasonPosArray = addSeasonAndPos($seasonPosArray, $db_season, $position); } } foreach ($seasonPosArray as $position => $seasonArray) { $ladderAwards .= getImgForPosAndSeasonArray($position, $seasonArray, "bottom"); } if (!empty($ladderAwards)) { $awards .= "<p>".$ladderAwards."</p>"; } // sixserver awards $sixAwards = ""; $awards_sql = "SELECT position, season from six_history ". "WHERE playerId = '$player_id' ORDER BY season"; $awards_result = mysql_query($awards_sql); $sixSeasonPosArray = array(); while($awards_row = mysql_fetch_array($awards_result)) { $position = $awards_row['position']; $db_season = $awards_row['season']; if ($position < 7 && $position > 0) { $sixSeasonPosArray = addSeasonAndPos($sixSeasonPosArray, $db_season, $position); } } foreach ($sixSeasonPosArray as $position => $seasonArray) { $sixAwards .= getSixImgForPosAndSeasonArray($position, $seasonArray, "bottom"); } if (!empty($sixAwards)) { $awards .= "<p>".$sixAwards."</p>"; } // tournament awards $tournamentAwards = ""; $cup_sql = "SELECT profileImage, cupName from $tournamenttable ". "WHERE firstPlace = '$name'"; $cup_result = mysql_query($cup_sql); while($cup_row = mysql_fetch_array($cup_result)) { $profileImage = $cup_row['profileImage']; $cupName = $cup_row['cupName']; $img = '<img style="vertical-align:bottom;padding:0 0 0 2px;margin:0 0 0 2px;" src="'. $directory.'/Cup/'.$profileImage.'" />'; $tournamentAwards .= '<span style="cursor:help;" title="Winner of '.$cupName.'">'.$img.'</span>'; } // mini tournament wins $mini_sql = "SELECT count(*) AS cou FROM $minitournamenttable where PLAYER_ID = '$player_id'"; $mini_result = mysql_query($mini_sql); $mini_row = mysql_fetch_array($mini_result); $miniTournamentWins = $mini_row['cou']; if ($miniTournamentWins > 0) { $profileImage = $gfx_mini_tournament_prefix.$miniTournamentWins.".gif"; $titleText = $miniTournamentWins." mini tournament win"; if ($miniTournamentWins > 1) { $titleText .= "s"; } $img = '<img style="vertical-align:bottom; padding:0 0 0 2px;margin:0 0 0 2px; margin-bottom:-2px;padding-bottom:-2px;" src="'. $directory.'/gfx/awards/'.$profileImage.'" />'; $tournamentAwards .= '<span style="cursor:help;" title="'.$titleText.'">'.$img.'</span>'; } // team ladder - player $sql = "SELECT playerId from $teamladdertable where type='player' ORDER BY timestamp DESC LIMIT 0, 1"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $playerIdSaved = $row["playerId"]; if ($playerIdSaved == $player_id) { $tournamentAwards .= '<span style="cursor:help;" title="Team Standings - Best player"><img style="vertical-align:bottom;padding:0 0 0 2px;margin:0 0 0 2px;" src="'.$directory.'/gfx/teamLadderPlayer.gif" /></span>'; } } // team ladder - team $sql = "SELECT playerId, playerId2 from $teamladdertable where type='team' ORDER BY timestamp DESC LIMIT 0, 1"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $playerIdSaved = $row["playerId"]; $playerId2Saved = $row["playerId2"]; if ($playerIdSaved == $player_id || $playerId2Saved == $player_id) { if ($playerIdSaved == $player_id) { $teammateId = $playerId2Saved; } else { $teammateId = $playerIdSaved; } $teammate = getPlayerNameForId($teammateId); $tournamentAwards .= '<span style="cursor:help;" title="Team Standings - Best team with '.$teammate.'"><img style="vertical-align:bottom;padding:0 0 0 2px;margin:0 0 0 2px;" src="'.$directory.'/gfx/teamLadderTeam.gif" /></span>'; } } // special awards $special_sql = "SELECT profileImage, titleText from $awardstable where playerId = '$player_id'"; $special_result = mysql_query($special_sql); $specialHtml = ""; while($special_row = mysql_fetch_array($special_result)) { $profileImage = $special_row['profileImage']; $titleText = $special_row['titleText']; $img = '<img style="vertical-align:bottom;padding:0 0 0 2px;margin:0 0 0 2px;" src="'. $directory.'/gfx/awards/'.$profileImage.'" />'; $specialHtml .= '<span style="cursor:help;" title="'.$titleText.'">'.$img.'</span>'; } $tournamentAwards .= $specialHtml; // donators $donate_sql = "SELECT id from $donationstable where name = '$name'"; $donate_result = mysql_query($donate_sql); if (mysql_num_rows($donate_result)) { $img = '<img style="vertical-align:bottom;padding:0 0 0 2px;margin:0 0 0 2px;" src="'. $directory.'/gfx/awards/donator.gif" />'; $tournamentAwards .= '<span style="cursor:help;" title="'.$name.' donated to '.$leaguename.', thank you!">'.$img.'</span>'; } if (!empty($tournamentAwards)) { $awards .= "<p>".$tournamentAwards."</p>"; } return $awards; }