Ich möchte Bilder (jeweils 12 Stck., diese werden automatisch per phpFlickr abgeholt) im alt Tag nummeriert haben. Es soll demnach wie folgt aussehen:
<img alt='Photo 0' src=xyz.jpg>
<img alt='Photo 1' src=xyz.jpg>
<img alt='Photo 2' src=xyz.jpg>
etc.
Der Code hierzu sieht momentan wie folgt aus:
Alles anzeigen
Die Bilder werden abgeholt und ausgegeben, nur mit der nummerierung im alt Tag komme ich nicht voran, bislang lasse ich dort den Fllickr Titel des Bildes anzeigen Vielleicht kann mir jemand auf die Sprünge helfen mit welchem Befehl man dies per PHP realisieren kann? Die Nummerierung für das erste abgeholte Bild sollte bei 0 anfangen!
<img alt='Photo 0' src=xyz.jpg>
<img alt='Photo 1' src=xyz.jpg>
<img alt='Photo 2' src=xyz.jpg>
etc.
Der Code hierzu sieht momentan wie folgt aus:
Quellcode
- <?php
- $f = new phpFlickr("4a5f25049999daa03b5ad773b0383cb8");
- $username = 'jwildefeld';
- // Find the NSID of the username inputted via the form
- $person = $f->people_findByUsername($username);
- // Get the friendly URL of the your photos
- $photos_url = $f->urls_getUserPhotos($person['id']);
- // Get the user's first 12 public photos
- $photos = $f->people_getPublicPhotos($person['id'], NULL, 12);
- echo "<div id=\"example_6\">";
- echo "<ul id=\"example_6_content\">";
- // Loop through the photos and output the html
- foreach ($photos['photo'] as $photo) {
- echo "<li class=\"example_6_item\"><a href=$photos_url$photo[id]>";
- echo "<img border='0' alt='$photo[title]' ".
- "src=grey.php?url=" . $f->buildPhotoURL($photo, "Medium") . ">";
- echo "</a></li>";
- $i++;
- // If it reaches the sixth photo, insert a line break
- if ($i % 12 == 0) {
- echo "<p>\n";
- }
- }
- echo "</ul>";
- echo "</div>";
- ?>
Die Bilder werden abgeholt und ausgegeben, nur mit der nummerierung im alt Tag komme ich nicht voran, bislang lasse ich dort den Fllickr Titel des Bildes anzeigen Vielleicht kann mir jemand auf die Sprünge helfen mit welchem Befehl man dies per PHP realisieren kann? Die Nummerierung für das erste abgeholte Bild sollte bei 0 anfangen!