tacker.org


Picasaembed: Embed and browse your Picasa Web Albums

30.11.2006

Yesterday evening I discovered that Google’s Picasa Web Albums have RSS feeds. This led me to a script in PHP5, which enables you to embed the thumbnails of a whole album in any site — you may even browse through them. The browsing is done with Ajax to give a fast experience but there is a fallback solution which works without javascript.

Multiple embedded albums per page are also supported.

The usage of Picasaembed is not limited to Wordpress — it’s designed as a standalone library.

Download

Example

You are just seeing an example. You may also check out the example (source code) which is provided with the script.

Installation

Let’s assume that you want Picasaembed in your Wordpress blog.

Copy the files to a new folder named picasaembed in Wordpress’ plugins folder and make sure that the webserver has write permission to the cache folder.

Just make sure that the prototype.js is loaded somewhere. You would add it to your header.php file.

<script type="text/javascript" src="/blog/wp-content/plugins/picasaembed/prototype-1.4.0.js"></script>

As Picasaembed requires a RSS-URL to display the album we need set up a custom field for our post. Let’s assume that we name it picasaembed_rss_url.

In the theme files index.php and single.php (which display the post) we have to add these lines before the the_content() tag to display the album:

<?php
$picasaembed = (get_post_meta($post->ID, 'picasaembed_rss_url', true)) ? get_post_meta($post->ID, 'picasaembed_rss_url', true) : false;
if ($picasaembed) {
require_once './wp-content/plugins/picasaembed/Picasaembed.php';
Picasaembed::$location = './wp-content/plugins/picasaembed/Picasaembed.php';
echo Picasaembed::getContainer($picasaembed);
}
?>

That’s it. Now everytime a post has the custom field picasaembed_rss_url the value will be used as a RSS-URL for Picasaembed. Happy time!

Uses

License

Released under the LGPL.

30
11
2006

Kommentare 4 | Permalink

Kategorien > Projekte

Tags >

Lesezeichen > Als Lesezeichen bei Digg abspeichern Als Lesezeichen bei del.icio.us abspeichern Als Lesezeichen bei MisterWong abspeichern Als Lesezeichen bei Technorati abspeichern

 

nächster > AlbumEmbed / PicasaEmbed

voriger > Bad - Das kurze Wort mit den vielen Möglichkeiten

Dein Kommentar





Kommentare

Kommentare als RSS

[...] PicasaEmbed, bzw. inzwischen AlbumEmbed ist ein universelle PHP5-Bibliothek und Fotos aus Bilder-Galerien, die einen RSS-Feed anbieten, in eine Webseite einzubinden. [...]

Markus Tacker Kommentar

23. Dezember 2006 | 09:47

Luis Medina wrote:
> it Only works in php5?

True. Today there is no need for PHP4 anymore. PHP5 is available for over two years and stable. You are strongly encouraged to migrate your applications to PHP5 which is no hassle due to PHP5’s backward compatibility.

Luis Medina Kommentar

23. Dezember 2006 | 04:33

it Only works in php5?

Philipp Lenssen Kommentar

30. November 2006 | 23:50

Nice. Sometimes the image, while loading, will make the box collapse though, maybe you need to specify its height or something. Also, it might be nicer to be able to include this as a one-liner in JavaScript, though of course then your server would need to carry the load.

PS: A double arrow like you used “>>” often indicates “move to end” whereas a single arrow “>” indicates “next”, which is what happens…

Markus TackerÜber

Markus Tacker ist professioneller Webentwickler aus Offenbach am Main, Deutschland.

Der Schwerpunkt seiner Tätigkeiten ist die Entwicklung von browserbasierten Anwendungen in PHP.

Kontakt

Markus Tacker
Senefelderstr. 63
63069 Offenbach
(0 69) 83 83 57 73
(0 32 21) 1 14 32 97

mehr

http://m.tacker.org/blog/595.picasaembed-embed-and-browse-your-picasa-web-albums.html