source: trunk/web/app/out/dist/views/flickr_bloc.php @ 9

Last change on this file since 9 was 6, checked in by dj3c1t, 13 years ago

mise a jour du trunk

File size: 1.1 KB
RevLine 
[6]1            <div class="bloc" id="flickr_bloc">
2              <h2>
3                <a id="flickr_bloc_link" href="http://www.flickr.com/photos/revolutionsoundrecords/">
4                  En images <img src="<?= $env->out_file("icons/social/flickr_mini.png") ?>" />
5                </a>
6              </h2>
7              <div class="bloc_content">
8<?php
9
10
11if($flux = simplexml_load_file('http://api.flickr.com/services/feeds/photos_public.gne?id=43300075@N07&lang=fr-fr&format=rss_200'))
12{
13   $donnee = $flux->channel;
14   $n = 0;
15   foreach($donnee->item as $valeur)
16   { $n++;
17     $description = utf8_decode($valeur->description);
18     $description = substr($description, strpos($description, "<img"));
19     $description = substr($description, strpos($description, "src=") + 5);
20     $description = substr($description, 0, strpos($description, "\""));
21?>
22     <a href="<?= utf8_decode($valeur->link) ?>"><img src="<?= $description ?>" /></a>
23<?php
24     if($n == 4) break;
25   }
26}else echo 'Erreur de lecture du flux RSS';
27
28
29
30?>
31                <div class="clear"><!-- --></div>
32              </div>
33            </div>
Note: See TracBrowser for help on using the repository browser.