Jump to content

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;

}
?>

Edited by mdvignesh
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.