query(" SELECT hlstats_Ribbons.ribbonId, ribbonName, image, name as awardName, awardCount, count(playerId) as achievedcount FROM hlstats_Ribbons INNER JOIN hlstats_Awards ON ( awardCode=code AND hlstats_Ribbons.game=hlstats_Awards.game ) LEFT JOIN hlstats_Players_Ribbons ON ( hlstats_Ribbons.ribbonId=hlstats_Players_Ribbons.ribbonId ) WHERE hlstats_Ribbons.game='$game' AND hlstats_Ribbons.special=0 GROUP BY hlstats_Ribbons.ribbonId ORDER BY awardCount, ribbonName, awardCode "); ?>
10) { $cols = 5; } $colwidth = round(100 / $cols); while ($r = $db->fetch_array()) { if ($cnt != $r['awardCount']) { $cnt = $r['awardCount']; $i1++; if ($i == $cols) { echo ''; } $i = 0; echo ""; } if ($i == $cols) { echo ''; $i = 0; } if ($i == 0) { echo ''; } $link = '"; if (file_exists(IMAGE_PATH."/games/$game/ribbons/".$r['image'])) { $image = IMAGE_PATH."/games/$game/ribbons/".$r['image']; } elseif (file_exists(IMAGE_PATH."/games/$realgame/ribbons/".$r['image'])) { $image = IMAGE_PATH."/games/$realgame/ribbons/".$r['image']; } else { $image = IMAGE_PATH."/award.png"; } $image = ''.$r['ribbonName'].''; $achvd = ''; if ($r['achievedcount'] > 0) { $image = "$link$image"; $achvd = 'Achieved by '.$r['achievedcount'].' players'; } echo ""; $i++; } if ($i != 0) { for ($i = $i; $i < $cols; $i++) { echo ''; } echo ''; } ?>
Ribbon Class #$i1 ($cnt awards required)
".$r['ribbonName'].'

' ."$achvd
$image