Flickr Component June 4, 2006
Posted by rossoft in CakePHP.trackback
Flickr component for easy integration of phpFlickr
You will have access to phpflickr instance in your controllers: $this->flickr, and in your views: $flickr.
It will use the dir app/tmp/cache/flickr for caching
1. Copy phpFlickr to app/vendors/phpflickr/
2. Copy this to app/controllers/components/flickr.php and change the api key to yours (you can get your api key in https://sourceforge.net/project/showfiles.php?group_id=139987 )
<?php
/**
* Flickr Component
* @author RosSoft
* @license MIT
* @version 0.1
*/
define(’FLICKR_CACHE_DIR’,CACHE . ‘flickr/’);
class FlickrComponent extends Object
{
/**
* Api Key. Change to your own
* @var string
* @link http://www.flickr.com/services/api/misc.api_keys.html
*/
var $_api_key=’CHANGE_TO_YOUR_KEY’;
function startup(&$controller)
{
vendor(’phpflickr/phpFlickr’);
//FlickrComponent instance of controller is replaced by a phpFlickr instance
$controller->flickr =& new phpFlickr($this->_api_key);
if (!is_dir(FLICKR_CACHE_DIR))
{
mkdir(FLICKR_CACHE_DIR,0777);
}
$controller->flickr->enableCache(’fs’, FLICKR_CACHE_DIR);
$controller->set(’flickr’,$controller->flickr);
}
}
?>
[...] RosSoft » Flickr Component A CakePHP component for working with flickr (tags: cakephp component flickr) [...]
buy oxycontin online
[...] steps the reader through the tools needed (including the Flickr Component for CakePHP) and how to get things set up and working together. With just a few simple calls to the [...]
are there any other free alternatives for flickr to build photogalery?
I got this error.
Fatal error: Cannot instantiate non-existent class: phpflickr in /home/www/app/controllers/components/flickr.php on line 25
I am using CakePHP 1.2
hi. do you have any idea how to use authentication on this?
thanks