PHP-Code:
<?php
echo '<table width="853" cellspacing="10" cellpadding="0" align="center">';
$fp = fopen('data/ascii_db.txt','r');
if (!$fp) {echo 'ERROR: Unable to open file.</table></body></html>';
exit;
}
$row = 0;
while (!feof($fp)) {
$row++;
$line = fgets($fp,2048);
$field[$row] = explode('|', $line);
if ($sortby == 'videolink') {$sortkey = strtolower($field[$row][0]);} //link
if ($sortby == 'titel') {$sortkey = strtolower($field[$row][1]);} //titel
if ($sortby == 'info') {$sortkey = strtolower($field[$row][2]);} //info
if ($sortby == 'id') {$sortkey = $field[$row][3];}
array_unshift($field[$row], $sortkey); //add sortkey to start of array
}
fclose($fp);
sort($field);
reset($field);
$arrays = count($field) - 1;
$loop = -1;
echo '<tr>';
while ($loop < $arrays) {
$loop++;
echo '
<td valign="top">'.$field[$loop][4].'
<a href="show.php?link='.$field[$loop][1].'&info='.$field[$loop][3].'&name='.$field[$loop][2].'">'.$field[$loop][2].'</a>'.$field[$loop][3].'</td>
';
if($loop%3==0 & $loop>0) echo '</tr><tr>';
}
echo '</tr>';
echo '</table>';
?>
Ich schätze es liegt daran, dass $loop / 3 eben auch 0 ergibt und deshalb entsteht eine leere Zeile. Ich habe die Abfrage um den Zusatz $loop>0 erweitert, probier es damit mal aus, wenn es dann immer noch nicht besser aussieht, weiß ich leider auch nicht mehr weiter.