Ik heb een vraag over de google picasa api.
Voorbeeld kan je zien op: http://www.kristofdebleu.net/25frfui...p?pagina=fotos
URL naar de foto's: http://picasaweb.google.com/kristofdebleu
Google picasa api: http://code.google.com/apis/picasaweb/gdata.html
De code van het script:
Mijn vraag is nu:PHP Code:
<?php
require_once('curl.php');
$gebruikersnaam = 'kristofdebleu';
$curl = new CURL();
$curl->enableCache();
echo '<a name="fotoalbum"></a>';
if(isset($_GET['album']) && !empty($_GET['album']))
{
$xml = $curl->get('http://picasaweb.google.com/data/feed/api/user/'.$gebruikersnaam.'/album/'.$_GET['album']);
if($xml != 'No album found.')
{
$xml = new SimpleXMLElement($xml);
echo '>> <a href="index.php?pagina=fotos#fotoalbum" class="text_darkblue_12">Fotoalbum</a> >> <a href="index.php?pagina=fotos&album='.$_GET['album'].'#fotoalbum" class="text_darkblue_12">'.$xml->title.'</a> (<a href="'.$xml->link[2]['href'].'" target="_blank" class="text_darkblue_12">Presentatie</a>)<br>';
if(count($xml->entry) > 0)
{
echo '<hr><div style="text-align: center">';
if(isset($_GET['foto']) && !empty($_GET['foto']))
{
for ($i = 0; $i <= count($xml->entry)-1; $i++)
{
if($xml->entry[$i]->title == $_GET['foto'])
{
$tmp = $i;
}
}
if($tmp == 0)
{
echo '<< Vorige';
}else{
echo '<< <a href="index.php?pagina=fotos&album='.$_GET['album'].'&foto='.$xml->entry[$tmp-1]->title.'#fotoalbum" class="text_darkblue_12">Vorige</a>';
}
echo ' Foto '.($tmp+1).' van '.count($xml->entry).' ';
if($tmp == count($xml->entry)-1)
{
echo 'Volgende >><br><br>';
}else{
echo '<a href="index.php?pagina=fotos&album='.$_GET['album'].'&foto='.$xml->entry[$tmp+1]->title.'#fotoalbum" class="text_darkblue_12">Volgende</a> >><br><br>';
}
echo '<img src="'.$xml->entry[$tmp]->content['src'].'?imgmax=576" title="'.$xml->title.' - '.$xml->entry[$tmp]->title.'" alt="'.$xml->title.' - '.$xml->entry[$tmp]->title.'">';
}else{
foreach($xml->entry as $album)
{
echo '<a href="index.php?pagina=fotos&album='.$_GET['album'].'&foto='.$album->title.'#fotoalbum" class="thumbnail"><img src="'.$album->content['src'].'?imgmax=400" class="thumbnail" title="'.$album->title.'" border="0" alt="'.$album->title.'"></a><br>';
}
}
echo '</div>';
}else{
echo '<p>Sorry, er zijn op dit moment nog geen fotos aan dit album toegevoegd</p>';
}
}else{
echo '<p>Sorry, ik heb dit album niet kunnen vinden!</p>';
}
}else{
echo '<p>Fotos komen zo snel mogelijk na de fuif online te staan !</p>';
$xml = $curl->get('http://picasaweb.google.com/data/feed/api/user/'.$gebruikersnaam);
$xml = new SimpleXMLElement($xml);
if(count($xml->entry) > 0)
{
foreach ($xml->entry as $album)
{
echo '<img src="https://www.sitedeals.nl/images/folder.gif" style="vertical-align : middle; margin-right: 10px;">';
echo '<b><a href="index.php?pagina=fotos&album='.strtolower(str_replace(' ','',$album->title)).'#fotoalbum" class="text_darkblue_12">'.$album->title.'</a></b>';
echo ' Laatst geupdate op '.strftime("%e %B %Y om %H:%M", strtotime($album->updated)).'<br>';
}
}else{
echo '<p>Sorry, er zijn op dit moment nog geen albums toegevoegd!</p>';
}
}
?>
Ik zou in plaats van "Laatst geupdate op 19 January 2008 om 16:07" er "30 foto's aanwezig (20mb)" willen plaatsen ...
Ik zie in de api dat dit volgende gegevens zijn:
Dit is de url die je nodig hebt: http://picasaweb.google.com/data/fee...leu?kind=albumPHP Code:
<gphoto:numphotos>184</gphoto:numphotos>
<gphoto:numphotosremaining>316</gphoto:numphotosremaining>
<gphoto:bytesUsed>11060624</gphoto:bytesUsed>
Kan iemand hiervan de php code (script) aanpassen dvm een xml parser?
Mvg
Kristof
- [HULP]Picasa webalbum probleem
-
1197 × bekeken sinds 20-04-2008, 10:36 #1Particulier
- Ik accepteer betaling via
- Bank
- Berichten
- 327
- Lid sinds
- 17 Jaar
[HULP]Picasa webalbum probleem
-
29-04-2008, 12:40 #2
- Berichten
- 327
- Lid sinds
- 17 Jaar
Niemand die hier iets van af kent???
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic