query(" SELECT ribbonName, image, awardCode, awardCount FROM hlstats_Ribbons WHERE hlstats_Ribbons.ribbonId=$ribbon "); $actiondata = $db->fetch_array(); $db->free_result(); $act_name = $actiondata['ribbonName']; $awardmin = $actiondata['awardCount']; $awardcode = $actiondata['awardCode']; $image = $actiondata['image']; $db->query("SELECT name FROM hlstats_Games WHERE code='$game'"); if ($db->num_rows() < 1) { error("No such game '$game'."); } list($gamename) = $db->fetch_row(); $db->free_result(); pageHeader( array($gamename, 'Ribbon Details', $act_name), array( $gamename => $g_options['scripturl']."?game=$game", 'Ribbons' => $g_options['scripturl']."mode=awards&game=$game&tab=ribbons", 'Ribbon Details' => '' ), $act_name ); $table = new Table( array( new TableColumn ( 'playerName', 'Player', 'width=45&align=left&flag=1&link=' . urlencode('mode=playerinfo&player=%k') ), new TableColumn ( 'numawards', 'Daily awards', 'width=10&align=right&append=' . urlencode(' times') ), new TableColumn ( 'awardName', '', 'width=40&align=left' ) ), 'playerId', 'numawards', 'playerName', true, 50 ); $result = $db->query(" SELECT flag, lastName AS playerName, hlstats_Players.playerId, hlstats_Awards.name as awardName, COUNT(hlstats_Awards.name) AS numawards FROM hlstats_Players INNER JOIN hlstats_Players_Awards ON ( hlstats_Players_Awards.playerId=hlstats_Players.playerId AND hlstats_Players_Awards.game=hlstats_Players.game ) INNER JOIN hlstats_Awards ON ( hlstats_Players_Awards.awardId=hlstats_Awards.awardId AND hlstats_Players_Awards.game=hlstats_Awards.game ) WHERE hlstats_Awards.code = '$awardcode' AND hlstats_Players.game = '$game' AND hlstats_Players.hideranking<>'1' GROUP BY flag, lastName, hlstats_Players.playerId HAVING COUNT(hlstats_Awards.name) >= $awardmin ORDER BY $table->sort $table->sortorder, $table->sort2 $table->sortorder LIMIT $table->startitem,$table->numperpage "); $resultCount = $db->query(" SELECT flag, lastName AS playerName, hlstats_Players.playerId, hlstats_Awards.name as awardName, COUNT(hlstats_Awards.name) AS numawards FROM hlstats_Players INNER JOIN hlstats_Players_Awards ON ( hlstats_Players_Awards.playerId=hlstats_Players.playerId AND hlstats_Players_Awards.game=hlstats_Players.game ) INNER JOIN hlstats_Awards ON ( hlstats_Players_Awards.awardId=hlstats_Awards.awardId AND hlstats_Players_Awards.game=hlstats_Awards.game ) WHERE hlstats_Awards.code = '$awardcode' AND hlstats_Players.game = '$game' AND hlstats_Players.hideranking<>'1' GROUP BY flag, lastName, hlstats_Players.playerId HAVING COUNT(hlstats_Awards.name) >= $awardmin "); $numitems = mysql_num_rows($resultCount); ?>