Also, Pokalanzeige für die ersten 3 Plätze einbauen
Demo:
[ externes Bild ]
So wie ich den Code hier reinstelle, stimmt er nur für die aktuelle Version des F1 Webtipp Mod's
(Version 0.3.5 - Formel 1 WebTipp - phpBB3)
Er geht auch für ältere (hatte Ihn ja auch vorher schon

), muss aber angepasst werden, da sich ein paar Kleinigkeiten in der formel.php geändert haben.
Das hier runterladen (die Pokale) rar-Datei,
http://ofcomputer.de/download/Pokale.rar
die Bilder selbst müssen wie in der Ordnerstrucktur der rar-Datei, in den Ordner ->Verzeichniss des Webtipps/(wo die formel.php liegt) /images/formel
dann die formel.php SICHERN, falls was schiefläuft!
Jetzt die formel.php öffnen,
suche:
Code: Alles auswählen
// Get all tips 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 LIMIT 5';
$result = $db->sql_query($sql);
DANACH (neue Zeile(n)) einfügen:
Code: Alles auswählen
$first_rank = $phpbb_root_path . "images/formel/goldpokal.gif";
$secound_rank = $phpbb_root_path . "images/formel/silberpokal.gif";
$third_rank = $phpbb_root_path . "images/formel/bronzepokal.gif";
suche
Code: Alles auswählen
if ($row['total_points'] <> $previous_points)
{
$rank = $real_rank;
$previous_points = $row['total_points'];
}
$tipp_user_row = get_formel_userdata($row['tipp_user']);
$tipp_username_link = get_username_string('full', $tipp_user_row['user_id'], $tipp_user_row['username'], $tipp_user_row['user_colour']);
$template->assign_block_vars('top_tippers', array(
'TIPPER_NAME' => $tipp_username_link,
'RANK' => $rank,
'TIPPER_POINTS' => $row['total_points'],
)
);
}
und ERSETZE:
Code: Alles auswählen
if ($row['total_points'] <> $previous_points)
{
$rank = $real_rank;
$previous_points = $row['total_points'];
}
if ($rank === 1)
{
$rank_img = '<img src="' . $first_rank . '" alt="1. Platz" title="1. Platz" />';
}
elseif ($rank === 2)
{
$rank_img = '<img src="' . $secound_rank . '" alt="2. Platz" title="2. Platz" />';
}
elseif ($rank === 3)
{
$rank_img = '<img src="' . $third_rank . '" alt="3. Platz" title="3. Platz" />';
}
else
{
$rank_img = $rank;
}
$tipp_user_row = get_formel_userdata($row['tipp_user']);
$tipp_username_link = get_username_string('full', $tipp_user_row['user_id'], $tipp_user_row['username'], $tipp_user_row['user_colour']);
$template->assign_block_vars('top_tippers', array(
'TIPPER_NAME' => $tipp_username_link,
'RANK' => $rank_img,
'TIPPER_POINTS' => $row['total_points'],
)
);
}
Suche
Code: Alles auswählen
// re-sort the drivers. Big points first ;-)
arsort($recalc_drivers);
Danach einfügen:
Code: Alles auswählen
$first_rank = $phpbb_root_path . "images/formel/goldpokal.gif";
$secound_rank = $phpbb_root_path . "images/formel/silberpokal.gif";
$third_rank = $phpbb_root_path . "images/formel/bronzepokal.gif";
suche:
Code: Alles auswählen
foreach ($recalc_drivers as $driver_id => $driver)
{
if ($limit == 5)
{
break;
}
++$rank;
$wm_drivername = $driver['driver_name'];
$template->assign_block_vars('top_drivers', array(
'RANK' => $rank,
'WM_DRIVERNAME' => $wm_drivername,
'WM_POINTS' => $driver['total_points'],
)
);
++$limit;
}
ersetze mit:
Code: Alles auswählen
foreach ($recalc_drivers as $driver_id => $driver)
{
if ($limit == 5)
{
break;
}
++$rank;
if ($rank === 1)
{
$rank_img = '<img src="' . $first_rank . '" alt="1. Platz" title="1. Platz" />';
}
elseif ($rank === 2)
{
$rank_img = '<img src="' . $secound_rank . '" alt="2. Platz" title="2. Platz" />';
}
elseif ($rank === 3)
{
$rank_img = '<img src="' . $third_rank . '" alt="3. Platz" title="3. Platz" />';
}
else
{
$rank_img = $rank;
}
$wm_drivername = $driver['driver_name'];
$template->assign_block_vars('top_drivers', array(
'RANK' => $rank_img,
'WM_DRIVERNAME' => $wm_drivername,
'WM_POINTS' => $driver['total_points'],
)
);
++$limit;
}
suche:
Code: Alles auswählen
// re-sort the teams. Big points first ;-)
arsort($recalc_teams);
Danach einfügen:
Code: Alles auswählen
$first_rank = $phpbb_root_path . "images/formel/goldpokal.gif";
$secound_rank = $phpbb_root_path . "images/formel/silberpokal.gif";
$third_rank = $phpbb_root_path . "images/formel/bronzepokal.gif";
Suche:
Code: Alles auswählen
foreach ($recalc_teams as $team_id => $team)
{
if ($limit == 5)
{
break;
}
++$real_rank;
if ($team['total_points'] <> $previous_points)
{
$rank = $real_rank;
$previous_points = $team['total_points'];
}
$wm_teamname = $team['team_name'];
$template->assign_block_vars('top_teams', array(
'RANK' => $rank,
'WM_TEAMNAME' => $wm_teamname,
'WM_POINTS' => $team['total_points'],
)
);
++$limit;
}
und ERSETZE hiermit:
Code: Alles auswählen
foreach ($recalc_teams as $team_id => $team)
{
if ($limit == 5)
{
break;
}
++$real_rank;
if ($team['total_points'] <> $previous_points)
{
$rank = $real_rank;
$previous_points = $team['total_points'];
}
if ($rank === 1)
{
$rank_img = '<img src="' . $first_rank . '" alt="1. Platz" title="1. Platz" />';
}
elseif ($rank === 2)
{
$rank_img = '<img src="' . $secound_rank . '" alt="2. Platz" title="2. Platz" />';
}
elseif ($rank === 3)
{
$rank_img = '<img src="' . $third_rank . '" alt="3. Platz" title="3. Platz" />';
}
else
{
$rank_img = $rank;
}
$wm_teamname = $team['team_name'];
$template->assign_block_vars('top_teams', array(
'RANK' => $rank_img,
'WM_TEAMNAME' => $wm_teamname,
'WM_POINTS' => $team['total_points'],
)
);
++$limit;
}
Nun Foren - Cache leeren ...und freuen ...
Die Pokal werdet Ihr erst nach den ersten eingetragenen Rennergebnissen bewundern können, aber wenn Ihr einfach mal für das erste Rennen ein Test-Rennergebniss eintragt und schon ein paar user bei euch getippt haben, könnt Ihr überprüfen ob es klappt.
Danach nur wieder das Test-Rennergebniss löschen.
Hoffe das alles so richtig ist und ich keinen Fehler eingebaut habe.
Bitte um Feedback ob alles funzt, damit auch andere User bescheid wissen.
Danke und lG.bacci