/
frontpage.php
47 lines (38 loc) · 1.2 KB
/
frontpage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<h1>Galleri</h1>
<p>Välkommen till hd.se fotogalleri. Välj ett galleri nedan.</p>
<div class="results">
<h2 class="sep">Tillgängliga gallerier</h2>
<?php
$photosets = $flickr->getPhotosetsXML();
foreach($photosets->photoset as $ps) {
$i++;
$set_id = $ps["id"];
$div_class = "story";
if($i == 1)
$div_class .= " first";
$thumb_url = "#";
$num_images_text = "Inga bilder";
$photoset_photos = $flickr->getPhotosXML($ps["id"]);
if($photoset_photos !== FALSE && count($photoset_photos->photo) > 0) {
$thumb_url = $flickr->getPhotoURL($photoset_photos->photo[0], "t");
$num_images_text = count($photoset_photos->photo);
if($num_images_text != 1)
$num_images_text .= " bilder";
else
$num_images_text .= " bild";
}
?>
<div class="<?= $div_class ?>">
<p>
<a href="./?set=<?= $ps["id"] ?>"><img src="<?= $thumb_url ?>" alt="" /></a>
</p>
<h3><a href="./?set=<?= $ps["id"] ?>"><?= htmlspecialchars($ps->title, ENT_NOQUOTES, "UTF-8") ?></a></h3>
<ul class="meta">
<li><strong><?= $num_images_text ?></strong></li>
<li><?= htmlspecialchars($ps->description, ENT_NOQUOTES, "UTF-8") ?></li>
</ul>
</div>
<?php
}
?>
</div> <!-- / results -->