// Flickr CodeIgniter Library

On my blog, here… I have a little grid of my latest flickr pictures in the footer.
It’s quite nice, I like people to see what I’ve been up to recently in the ‘real world’.

That’s why I decided to build a library to do this in CodeIgniter!

The basic library parses an RSS feed of photos according to your options, and then returns the image data.

So… this is how you use it in your controller:

$this->load->library('flickr');
 
$config = array(
	'type'				=> 'user',
	'user'				=> '56471355@N00',
	'num_items'		=> 10,
	'rss_cache_path'		=> APPPATH.'cache/flickr-rss-cache',
	'cache_time'		=> 3600,
	'img_cache_path'		=> APPPATH.'cache/flickr-image-cache',
	'img_cache_url'		=> $this->config->item('base_url').'application/cache/flickr-image-cache',
	'use_cache'			=> false,
	'image_size'		=> 'square',
	'tags'				=> 'london'
);
 
$this->flickr->init($config);
 
$data['photos'] = $this->flickr->get_photos();

Note: Your ‘user’ must be your flickr id, you can get it from idgettr

In you view files, display your images like so:

<?php foreach ($photos as $photo):?>
<img src="<?=$photo['image_url']?>" />
<?php endforeach; ?>

Download Flickr CodeIgniter Library

REQUIRES SIMPLEPIE CODEIGNITER LIBRARY

Version: 1.0