Hallo
Ich bräuchte mal eure Hilfe. Und zwar geht es um einen teil meiner blätterfunktion. Ich sollte irgendwie eine 2 schleife einbauen (nach dem <tr>).
So wie es jetzt is wird das bild einfach wiederholt. Aber ich weiss nicht wie.
Hier mal der Quelltext.
Hoffe das ist verständlich und das mir jemand helfen kann. Danke schon mal.
Ich bräuchte mal eure Hilfe. Und zwar geht es um einen teil meiner blätterfunktion. Ich sollte irgendwie eine 2 schleife einbauen (nach dem <tr>).
So wie es jetzt is wird das bild einfach wiederholt. Aber ich weiss nicht wie.
Hier mal der Quelltext.
PHP-Code:
<?php
$bild = array();
$bild[0]['bild'] = "fotos/mexico/apan/IMG_3422.jpg";
$bild[0]['thumb'] = "fotos/mexico/apan/thumbs/IMG_3422.jpg";
$bild[1]['bild'] = "fotos/mexico/apan/IMG_3425.jpg";
$bild[1]['thumb'] = "fotos/mexico/apan/thumbs/IMG_3425.jpg";
$bild[2]['bild'] = "fotos/mexico/apan/IMG_3472.jpg";
$bild[2]['thumb'] = "fotos/mexico/apan/thumbs/IMG_3472.jpg";
$bild[3]['bild'] = "fotos/mexico/apan/IMG_3412.jpg";
$bild[3]['thumb'] = "fotos/mexico/apan/thumbs/IMG_3412.jpg";
$bild[4]['bild'] = "fotos/mexico/apan/P_0109.jpg";
$bild[4]['thumb'] = "fotos/mexico/apan/thumbs/P_0109.jpg";
$bild[5]['bild'] = "fotos/mexico/apan/IMG_3484.jpg";
$bild[5]['thumb'] = "fotos/mexico/apan/thumbs/IMG_3484.jpg";
$self = "index2.php?site=fotos&"; //Name der Datei
$pp = 2; //Angezeigte Elemente pro Seite
$pagelinks = "";
$spalten = 2;
if(isset($_GET['bildpage']))
$bildpage = $_GET['bildpage'];
else $bildpage = 1;
$pageanz = ceil(count($bild)/$pp);
//Pagelinks
for($i=1; $i<=$pageanz; $i++){
if($i == $bildpage)
$pagelinks .= "[b]".$i."[/b] ";
else
$pagelinks .= "<a href=\"".$self."bildpage=".$i."\">".$i."</a>";
}
//Bildausgabe
echo "<table border=\"1\" bordercolor=\"#FFFFFF\" width=\"100%\">\n";
for($i=(($bildpage-1)*$pp); $i<=(((($bildpage-1)*$pp)+$pp)-1); $i++){
if(isset($bild[$i])){
echo "<tr>\n";
echo "<td border=\"1\" bordercolor=\"#333333\" width=\"115\" height=\"115\" align=\"center\" valign=\"middle\">\n";
echo "<a href=\"".$bild[$i]['bild']."\">";
echo "<img src=\"".$bild[$i]['thumb']."\" border=\"0\">";
echo "</a>\n";
echo "</td>\n";
echo "<td></td>\n";
echo '</tr>';
}
}
echo '</table>';
echo $pagelinks;
?>
Kommentar