Clean code xD

main
radiskull 13 years ago
parent d06da00865
commit 6dea512555

@ -115,14 +115,13 @@ function displayHeader($top, $bottom, $challenge, $clans) {
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>'; echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$max = 0; $max = 0;
$i = 0; $i = 0;
While($max != $top) { for ($i = 0; $max != $top; $i++) {
if($chars[$i]['clan_id'] == $right) { if($chars[$i]['clan_id'] == $right) {
echo '<td width="'.$width.'%" valign="middle" align="center">'; echo '<td width="'.$width.'%" valign="middle" align="center">';
displayChar($chars[$i]); displayChar($chars[$i]);
echo '</td>'; echo '</td>';
$max++; $max++;
} }
$i++;
} }
echo '</tr></table></td>'; echo '</tr></table></td>';
echo '</tr>'; echo '</tr>';
@ -131,36 +130,34 @@ function displayHeader($top, $bottom, $challenge, $clans) {
echo '<tr height = "150">'; echo '<tr height = "150">';
//Darstellen der Bilder auf der linken Seite //Darstellen der Bilder auf der linken Seite
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>'; echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$used = $top; $showed = $top;
$max = 0; $max = 0;
$i = 0; $i = 0;
$width = 100 / $bottom; $width = 100 / $bottom;
While($max != ($bottom+$used)) { for ($i = 0; $max != ($bottom+$showed); $i++) {
if($chars[$i]['clan_id'] == $left) { if($chars[$i]['clan_id'] == $left) {
if($max >= $used) { if($max >= $showed) {
echo '<td width="'.$width.'%" valign="middle" align="center">'; echo '<td width="'.$width.'%" valign="middle" align="center">';
displayChar($chars[$i]); displayChar($chars[$i]);
echo '</td>'; echo '</td>';
} }
$max++; $max++;
} }
$i++;
} }
echo '</tr></table></td>'; echo '</tr></table></td>';
//Darstellen der Bilder auf der rechten Seite //Darstellen der Bilder auf der rechten Seite
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>'; echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$max = 0; $max = 0;
$i = 0; $i = 0;
While($max != ($bottom+$used)) { for ($i = 0; $max != ($bottom+$showed); $i++) {
if($chars[$i]['clan_id'] == $right) { if($chars[$i]['clan_id'] == $right) {
if($max >= $used) { if($max >= $showed) {
echo '<td width="'.$width.'%" valign="middle" align="center">'; echo '<td width="'.$width.'%" valign="middle" align="center">';
displayChar($chars[$i]); displayChar($chars[$i]);
echo '</td>'; echo '</td>';
} }
$max++; $max++;
} }
$i++;
} }
echo '</tr></table></td>'; echo '</tr></table></td>';
echo '</tr>'; echo '</tr>';

Loading…
Cancel
Save