
Ich möchte im Formel1 Mod das die ersten 3 Ränge eine Grafik anstelle der Nummerierung angezeigt bekommen. Für den 1. Platz habe ich das mittlerweile hinbekommen:
Code: Alles auswählen
//
// Get all tipps and fill Top10
//
$sql = "SELECT sum(tipp_points) AS total_points, tipp_user FROM " . FORMEL_TIPPS_TABLE . "
GROUP BY tipp_user
ORDER BY total_points DESC";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query tipps', '', __LINE__, __FILE__, $sql);
}
$first_rank = $phpbb_root_path . "images/formel/goldpokal.gif";
$rank = 0;
while ($row = $db->sql_fetchrow($result)) {
$rank++;
$tipp_user_row = get_userdata($row['tipp_user']);
$tipp_username = $tipp_user_row['username'];
$template->assign_block_vars('top_tippers', array(
'TIPPER_NAME' => $tipp_username,
// 'RANK' => $rank,
'RANK' => ($rank == 1) ? '<img src="' . $first_rank . '" alt="" />' : $rank,
'TIPPER_POINTS' => $row['total_points'])
);
}
$db->sql_freeresult($result);
}
unter
Code: Alles auswählen
$first_rank = $phpbb_root_path . "images/formel/goldpokal.gif";
Code: Alles auswählen
$secound_rank = $phpbb_root_path . images/formel/silberpokal.gif";
$third_rank = $phpbb_root_path . images/formel/bronzepokal.gif";
Code: Alles auswählen
'RANK' => ($rank == 1) ? '<img src="' . $first_rank . '" alt="" />' : $rank,
Code: Alles auswählen
($rank == 2) ? '<img src="' . $secound_rank . '" alt="" />'
($rank == 3) ? '<img src="' . $third_rank . '" alt="" />'