dmdeller/hnPhotoAlbumPlugin
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
hnPhotoAlbumPlugin Copyright (c) 2009-2010 D. M. Deller This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program (in the file LICENSE). If not, see <http://www.gnu.org/licenses/>. Requirements ------------ - Symfony 1.3 or 1.4 - Prototype 1.6.1 - Scriptaculous 1.8.3 - Zend GData 1.9.6 Versions listed are the ones I tested with. It should also work with newer versions. It *may* work with older versions (maybe even Symfony 1.2), but if you try that, you're on your own. Installation ------------ 1. Unpack hnPhotoAlbumPlugin to your project's /plugins directory. 2. If you don't already have it, get Scriptaculous: http://script.aculo.us (We no longer use the deprecated sfProtoculousPlugin) Prototype is included with Scriptaculous. Move the files out of the 'lib' and 'src' directories and put them somewhere in your /web/js directory. 3. If you don't already have it, get the Zend GData library: http://framework.zend.com/download/gdata Move the 'Zend' folder out of the 'library' folder and put it somewhere in /lib/vendor. I haven't been able to get this library to work with Symfony's autoloading mechanism. If you find a way, please let me know. Otherwise, add this to your /config/ProjectConfiguration.class.php: set_include_path(get_include_path().':'.sfConfig::get('sf_lib_dir').'/vendor'); 4. Run 'symfony plugin:publish-assets' so your site can find the stylesheets, etc. Configuration ------------- 1. Enable the plugin in your /config/ProjectConfiguration.class.php. If you are using $this->enablePlugins(), add it to the array. If you are using $this->enableAllPluginsExcept(), you probably don't need to do anything. 2. Enable the 'photos' module in your app's settings.yml: all: .settings: enabled_modules: [photos] 3. Configure some settings in your app's app.yml: all: hnPhotoAlbumPlugin: path_js_prototype: /js # web-accessible path where your prototype.js resides path_js_scriptaculous: /js # web-accessible path where your builder.js, effects.js, etc. reside picasa_username: picasateam # change this to your username. 'picasateam' has a bunch of sample photos. # for valid thumb values, see http://code.google.com/apis/picasaweb/reference.html#Parameters album_thumb_size: 160c # size (width) for album thumbnails. default is 160px, cropped. photo_thumb_size: 160u # size (width) for photo thumbnails. default is 160px, uncropped. photo_display_size: 800 # maximum size (width) for photos. default is 800px. note, no 'u' or 'c' is needed/allowed here. 4. Optionally style the output. All of the plugin's HTML is wrapped in a div with the ID 'hnPhotoAlbumPlugin', so you can use that to target CSS rules for this particular plugin. 5. <?php echo link_to('photos/index'); ?> somewhere on your site so visitors can find it! :) Overriding stuff ---------------- You can override most settings, classes, etc. just like any other Symfony plugin. In case you don't know, this is done by creating the appropriate files in your local application structure. For example, if you wanted to override: /plugins/hnPhotoAlbumPlugin/modules/photos/config/view.yml You would create a new file: /apps/frontend/modules/photos/config/view.yml And put your desired settings there.