Jump to content

Build A Photo Gallery Using Cakephp And Flickr


mdvignesh

Recommended Posts

I am doing Photo gallery using cakephp and flickr by seeing this link

 

http://www.sitepoint.com/photo-gallery-cakephp-flickr/#

 

I am getting

 

Error: Class 'phpFlickr' not found

File: C:\wamp\www\cake\app\Controller\Component\flickrComponent.php

Line: 28

 

This is my flickrComponent.php

<?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’;

var $_api_key='55d16262ee69f739466b7c45b073cc8a';
function startup(&$controller)
{
App::import('Vendor', 'phpFlickr', array('file' => 'phpflickr'.DS.'phpFlickr'.DS.'phpFlickr.php'));
 //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);
}
}
?>

 

This is my gallerycontroller.php

 

<?php
class GalleryController extends AppController {
var $name = 'Gallery';
var $components = array('Flickr');
var $uses = null;

}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.