Flickr-PHP API v1.0 INSTALL DOCUMENTATION Copyright (C) 2009 Pedro Venda pjvenda at pjvenda org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License ------------------------------------- see LICENSE file for more information ------------------------------------- A full copy of this program along with this file can be downloaded from my website http://www.pjvenda.org 0. REQUIREMENTS ------------ - A webserver that can interpret php code: * I recommend apache 2.0 or above with php 5 in the form of mod_php. * Alternatively, PHP 4 should work, but I haven't tested it! If not, a few tweaks should be enough to get it going, so don't give up! - Connectivity to flickr services (this is a Flickr-PHP API, remember?); 1. INSTALLATION ------------ This document lists instructions to install the application. See the USAGE file for more information. 1.1. PHP INCLUDE LOCATION -------------------- The following files need to be put in some place that can be accessed by all PHP code that will use the library. - flickr_config.php - flickr.php - flickr_http.php - flickr_display.php (*) (*): This file is not necessary for the correct function of the library. But it could reveal handy to use it every now and then. I recommend using the "include_path" configuration in php.ini to include the location of these files. Example: Suppose /home/httpd/htdocs/common will be the common include directory. In php.ini, the include_path directive will be appended with this path: include_path = ".:/usr/lib/php:/home/httpd/htdocs/common" 1.2. API TEST -------- For your convenience (and mine) I've included a self test file: apitest.php. It is meant to be executed before installing and making changes to the library to make sure that things are working. It contains test cases that cover most of the library's functionality. The file includes common/flickr.php and common/flickr_display.php and *requires* the configuration of one flickr username and a corresponding API key. This can be done directly on the file apitest.php or permanently on the common/flickr_config.php - either case works well. Feedback will be given on screen along with the results of the test cases. The self test will fail completely if you haven't configured your flickr username and api key (on apitest.php or on flickr_config.php). If you haven't configured a specific photo id, set id and tag name (see apitest.php) then three of the test cases won't be executed. Should you run it and be happy with the results, then proceed to run a complete example of the library in action, following the PHP code included in the original Satellite v1.5. 1.3. CONFIGURATION ------------- It is necessary to configure the library before using it for the first time. At the very least, you need to have a flickr account. You also need to request an API key. Both of these values must be put on the library's configuration file flickr_config.php under the variables $flickr["user"] and $flickr["apikey"]. 1.4. PHP CODE -------- Every PHP code file that uses Flickr-PHP must include the main library file flickr.php. Usually, this will be done in the following way: require_once("flickr.php"); or require_once("common/flickr.php"); You should bear in mind that everything related to Flickr-PHP is stored in a global array called $flickr - so don't overwrite it! Example: 2. FURTHER HELP ------------ Read the USAGE file.