Flickr Gallery 0.7
January 8th, 2005This project is now closed. Please use the much superior FAlbum if you want to integrate Wordpress and Flickr.
This plugin allows users of WordPress (and other clever people who can figure out how to make it work without WP) to display their Flickr photos on their own site. It is advised that users of previous versions of the plugin upgrade to this one. New features in this version:
- “Friendly” URI generation
- Link to Flickr slideshow of photosets
- Support for new Flickr image URLs
- Security conscious cache file names
Features that were already there include:
- Flickr photosets as “albums” - complete with descriptions and meta
- Support for Flickr “notes” feature - just this plugin uses all CSS and Javascript instead of Flash (the plugin’s output looks like this)
- EXIF data support to display camera settings the photo was snapped with — in addition to the description and meta info from Flickr
- Valid XHTML output
- Option to respect photos marked “private”
- Thumbnail size choices
- Pagination of albums and photos in albums
Get the latest version in .tar.gz format here or .zip format here.
Ryan has posted a guide for using this plugin with WP 1.5. Unfortunately I still haven’t gotten arround to making it easier to integrate with WP 1.5, but Ryan’s writeup sums it up pretty well.
If you are having issues with the new Flickr authentication API please consider the FAlbum project over at RandomByte. It is a branch of this project, and contains some neat features I simply haven’t had time to implement.
I know some people might be wondering where the interface for adding notes to photos is. For a while I worked at incorporating something like FotoBuzz or FotoNoter into the plugin, but in the end decided it was too hackish because both of those solutions are meant to actually store the notes in the JPEG. To store the notes in Flickr we just have to pass them to an API method. So, if anyone is a Flash guru (I’m not) with a little extra time maybe we could work together to create an interface that doesn’t feel so hackish, both from a usability standpoint and from an integration with this plugin standpoint.
Installation instruction remain approximately the same, but here is a rehash of them anyway.
- Put your Flickr photos into photosets
- Extract flickr-gallery.php from the archive you download into your WP-content/plugins directory
- Configure the settings in flickr-gallery.php to fit your situation
- Make a flickr-cache directory, preferably in your WP-content directory. Make sure it is writable by the web server
- Make a copy of your index.php and call it gallery.php (or whatever you want)
- Extract annimg.js into your site root and put
<script type="text/javascript" src="<?php echo get_settings('siteurl'); ?>/annimg.js"></script>in the head of your newly created gallery.php - Add the following to your CSS file and edit it to fit your liking:
[The requested file http://www.worrad.com/flickr-gallery.css could not be found]
- Add the following to your .htaccess file if you want to use “friendly” URLs:
RewriteRule ^photos/?(album|page)?/?([_0-9a-z-]+)?/?(photo|page)?/?([_0-9a-z-]+)?/?(page)?/?([0-9]+)?/?$ /flickr-gallery.php?$1=$2&$3=$4&$5=$6 [QSA] - Clear out your flickr-cache directory if you had a previous version of this plugin installed (the old cache filenames weren’t very secure)
Somewhat more detailed installation instructions can be found in README.txt in the download.
If you need more help post a comment here and I’ll help you out, or look through previous comments and discussion here, here, and here.
System Requirements:
PHP 4.1 or greater - with allow_url_fopen enabled (to make remote API/REST calls and download images)
Of course this code comes with no guarantee. If you need support I’ll be glad to help (within reason) — just shoot me an email. If you want to suggest future features or just tell me that you are using my plugin I’d appreciate that feedback too.
Copyright (c) 2005
Released under the GPL license
January 8th, 2005 at 1/8/2005 8:27 pm
Dude, you rock! Thanks for adding the EXIF on/off switch in there. This is simply the best WP plugin I’ve found to date… I think it trumps my own WP-Amazon plugin!
Thanks for all your work on this.
BTW, just FYI, I’m using this plugin coupled with WP 1.5 to build websites for my clients that include a gallery sourced directly off of flickr… a great solution for clients who don’t have much space on their host. And much better than installing something like Gallery (which in my opinion bloated and overkill in many situations). Flickr buys my clients simple photo management without the hassle.
January 9th, 2005 at 1/9/2005 10:33 am
Who knows how long flickr will store pics free. Is there a way to store these photos on your own server?
January 9th, 2005 at 1/9/2005 4:37 pm
D. Goodmanson, http://www.flickr.com/help.gne#3
January 9th, 2005 at 1/9/2005 10:43 pm
Take another look at step 6… doesn’t look right. need to add “/annimg.js” to the end, I think.
January 9th, 2005 at 1/9/2005 10:48 pm
Also, the “nice” permalinks are quite crufty. /album/ and /photo/ are totally uncessary. /photos/albumname/photonumber/ would be really nice!
January 10th, 2005 at 1/10/2005 7:39 am
I just setup the plug-in in my WP 1.5 , but system was show this message “http://www.hkmons.com/index.php?page_id=19″ , can you give me some advise?
January 11th, 2005 at 1/11/2005 8:39 am
It seems this version can’t work anymore outside of WordPress because it uses the sanitize_title() function.
It would be nice to have a slightly modfied version of functions-formatting.php included in the download and a little explanation on how to use the plugin standalone: require this, require that, call the function, voilà. Maybe even a small example (it would be just a couple rows of code).
January 11th, 2005 at 1/11/2005 8:46 am
Also, I found a bug: at line 217
set_id={$album_id}
should be:
set_id={$album}
or the slide show won’t work.
January 14th, 2005 at 1/14/2005 3:58 pm
Is it just me, or did you forget to change the version number in the header information? Maybe I’m missing something.
January 14th, 2005 at 1/14/2005 6:16 pm
Ian,
Yes, initially I forgot to change the version number in the header comments of flickr-gallery.php. It’s been fixed for a couple of days now though. You can change it yourself or redownload it. Goes to show you I need to implement some sort of code repository/versioning system to help manage silly things like that. I’ve used CVS before, but really wasn’t satisfied. I felt like it was kludgy, and overkill for the small projects I do. However, it does seem to be the de facto standard in OSS projects (for better or worse).
January 17th, 2005 at 1/17/2005 8:51 am
I’ve noticed a slight bug with Safari - when you click through to get the full sized image, the link to the flickr page (when you click the big pic) ‘leaks’ onto the rest of the page, so that all plain text on the page links there too. Sorry if this isn’t clear, maybe someone else with Safari can explain better. Great plugin by the way!
January 18th, 2005 at 1/18/2005 8:10 pm
Hey, I’ve followed the instructions to a T and I am getting this error message:
You can see it here
Do you know what the problem might be?
Thanks.
January 18th, 2005 at 1/18/2005 9:29 pm
Hi,
I’ve followed the directions as best as I can. I’ve made the photosets, I’ve created a new folder “flickr-cache” and made it accessible and I’ve placed the plugin into the right folder and I’ve also activated it through WP-admin. And when I go to http://www.lagerstatten.ca/gallery.php this is what I get:
Parse error: parse error, unexpected T_ENDWHILE in /home/virtual/site18/fst/var/www/html/gallery.php on line 14
Any help? Thanks in advance.
January 19th, 2005 at 1/19/2005 3:12 pm
Oh well, after I thought I dotted all i’s and crossed all t’s I’m getting the same error that William reported:
An error occurred. Here is the response from Flickr:
And here is the response after passing through the parser:
array (
)
For him a chmod 777 on the flickr-cache directory did the trick, but not for me. Any other thoughts to solve this?
Thanks.
January 19th, 2005 at 1/19/2005 10:07 pm
Flickr and Tags all over the Place
Today I finally received my API key from Flickr, so I could test and finish my work of last weekend. This is version 0.2 of a Wordpress plugin I put together - it’s based on (and heavily re-uses the work of) Ramon Darrow’s flickr gallery plugin that …
January 21st, 2005 at 1/21/2005 12:23 pm
I have some problems. When I got to my gallery.php page, it is blank. No errors, no nothing. I am using a recent 1.5 nightly build, but it does not work. Can you update for 1.5 please?
January 21st, 2005 at 1/21/2005 12:35 pm
Now I got it to show something at least, but now I have the error:
An error occurred. Here is the response from Flickr:
And here is the response after passing through the parser:
array (
)
How do you fix this? My flickr-cache is already 777.
January 21st, 2005 at 1/21/2005 8:38 pm
I can’t get the friendly URL’s to work. Any advice if my wordpress directory is outside of my main home directory. (IE. my flickr gallery is at http://el-oso.net/blog/gallery.php, but when I put in the rewrite rule into my .htaccess file, nothing shows up at http://el-oso.net/blog/photos/
Thanks for the help.
January 21st, 2005 at 1/21/2005 10:03 pm
Got it working. Had to add “/blog” before “gallery.php” in the rewrite rule. Amazing plugin.
January 23rd, 2005 at 1/23/2005 10:19 pm
Hi, I’m getting the sets shown on my page but when I click on a set nothing happens, the page just reloads - http://www.matandkerry.com/gallery.php/
January 23rd, 2005 at 1/23/2005 10:28 pm
please ignore - I changed friendly urls to false and it works - fantastic plugin
January 23rd, 2005 at 1/23/2005 11:11 pm
Just noticed when I click on ‘view as slide show’ it is not showing my photoset but the latest photos uploaded by everyone at Flickr! How do I get it to show only my slideshow?
January 23rd, 2005 at 1/23/2005 11:18 pm
In the POP up window that has the slideshow the album number is not being past on:
e.g. when I click on ‘View as slide show’ URL in popup window is
http://www.flickr.com/slideShow/index.gne?set_id=
no id number
should be for example:
http://www.flickr.com/slideShow/index.gne?set_id=93458
January 25th, 2005 at 1/25/2005 7:04 pm
has anyone gotten this to work with WP 1.5+?
January 26th, 2005 at 1/26/2005 5:15 am
Photos no longer show their description.
January 26th, 2005 at 1/26/2005 3:01 pm
[...] €ŒFlickr-galleryè¨ç½®ãƒ¡ãƒ¢ã€ï¼ˆZazie@Tokyo) Flickrã®Wordpress用ã®ãƒ—ラグイン「flickr-galleryã€ã¨ã„ã†ã®ã‚’
January 26th, 2005 at 1/26/2005 3:01 pm
[...] €ŒFlickr-galleryè¨ç½®ãƒ¡ãƒ¢ã€ï¼ˆZazie@Tokyo) Flickrã®Wordpress用ã®ãƒ—ラグイン「flickr-galleryã€ã¨ã„ã†ã®ã‚’
January 26th, 2005 at 1/26/2005 6:59 pm
Someone mentioned the problem with Safari and the rest of the page text becoming a link. The problem is on line 367 of the plugin file. It reads:
when it should read:
The anchor tag needed to be closed.
On another note, I’ve been getting this error from the EXIF data loader: Warning\: exif_read_data(1421487_a97b8d742b_o.jpg): illegal IFD size: 2 + x0B00*12 = x8402 > x0196 in /my/path/to/my/public_html/word/wp-content/plugins/flickr-gallery.php on line 361.
January 26th, 2005 at 1/26/2005 7:01 pm
ack… it rendered the code… should read:
$output .= "<img src="$image" alt="" usemap="imgmap" class="flickr-photo annotated" />\n";changed to:
$output .= "<img src="$image" alt="" usemap="imgmap" class="flickr-photo annotated" /></a>\n";January 27th, 2005 at 1/27/2005 12:05 am
[...] ostro amatissimo blogghino? Ebbene, proprio oggi leggevo da Hanzo dell’esistenza del Flickr Gallery Plugin per WordPress. Ho detto [...]
January 27th, 2005 at 1/27/2005 12:06 am
[...] ostro amatissimo blogghino? Ebbene, proprio oggi leggevo da Hanzo dell’esistenza del Flickr Gallery Plugin per WordPress. Ho detto [...]
January 28th, 2005 at 1/28/2005 4:56 am
http://www.striatic.net/blog/gallery.php
gives:
Warning: file_get_contents(/home/.calyx/redelement/striatic.net/blog/wp-content/flickr-cache/089aba578a84d343a377cea644065b1378e752f7.cached): failed to open stream: No such file or directory in /home/.calyx/redelement/striatic.net/blog/wp-content/plugins/flickr-gallery.php on line 522
An error occurred. Here is the response from Flickr:
And here is the response after passing through the parser:
array (
)
i’ve chmodded the cache folder to 777 .. maybe i’m not fromatting the cache path properly?
January 28th, 2005 at 1/28/2005 11:45 am
Striatic and other with the same probem, I think that might be caused by your PHP host not allowing open() to external URIs.
Sorry but I can test and verify at the moment…
January 28th, 2005 at 1/28/2005 9:37 pm
whoa ok i think i’m way behind everyone in doing this. i don’t know CSS at all but i followed all the instructions but nothing is being created at my gallery.php page.
its exactly the same as my index.php page except with that addtion line of javascript in it (properly configured too i this, replacing “siteurl” with the actually URL, right?
http://www.fish8me.com/gallery
yup sorry to just push the problm to others but anyone can help me out here?
thanks.
Ronny
January 28th, 2005 at 1/28/2005 11:37 pm
you can check the gallery link i included earlier.
i’ve put the include for PHP info in there and i’m pretty sure it is open.
January 29th, 2005 at 1/29/2005 12:27 pm
whoa ok i think i’m way behind everyone in doing this. i don’t know CSS at all but i followed all the instructions but nothing is being created at my gallery.php page.
its exactly the same as my index.php page except with that addtion line of javascript in it (properly configured too i this, replacing “siteurl” with the actually URL, right?
http://www.fish8me.com/gallery.php
yup sorry to just push the problm to others but anyone can help me out here?
thanks.
Ronny
January 29th, 2005 at 1/29/2005 10:20 pm
I’d love the plugin to work for me but here is the message I get…
Warning: file_get_contents(http://covonline.net/wp-content/flickr-cache//652738947475080503063f1fe851caf99f5bccc0.cached): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/ccf/covonet/wp-content/plugins/flickr-gallery.php on line 522
An error occurred. Here is the response from Flickr:
And here is the response after passing through the parser:
array (
)
The URL is http://covonline.net/gallery.php
Thanks for any help you can give me
January 30th, 2005 at 1/30/2005 5:39 am
hi thanks for the plugins..
but i have some error after installing this plugin..the error is :
Warning: Invalid argument supplied for foreach() in /home/something/public_html/weblog/wp-content/plugins/flickr-gallery.php on line 78
what can i do?
thanks and sorry for my english
January 30th, 2005 at 1/30/2005 7:57 am
updated all its ok i clear my problem,
bu i have new problem , even i try to explorer my album via flickr-gallery.php i get 404 error …
I get my pic link http://mydomain.com/weblog/gallery.php/album/seseorang
January 30th, 2005 at 1/30/2005 8:26 am
sorry for the URI
http://kusaeni.com/weblog/gallery.php/album/kawan
and I cant found all my pic in that set
January 31st, 2005 at 1/31/2005 3:31 pm
kusaeni - I think that it is due to recent changes in WP1.5. It works perfectly on my 6th Jan (alpha) version, but I have the same problem as you on a 31st Jan (beta) version.
February 1st, 2005 at 2/1/2005 6:22 pm
After hassling with my PHP host to open calls to external URLS and fiddling with file paths, I’ve FINALLY got this plugin to work, mostly. I need to deal with formatting, but that’s the least of my worries. The only real remaining problem is that when I click “View as a slide show” I get code spewed alongside the actual slideshow. Try it yourself: http://goyaboy.org/blog/gallery.php
Any ideas why this is happening?
February 1st, 2005 at 2/1/2005 6:32 pm
UPDATE to my above post about slideshow and spewed code: This condition only happens with Safari. Firefox does the popup window fine.
February 1st, 2005 at 2/1/2005 6:45 pm
Is there a workaround so that the popup slideshow works properly in Safari? If I can solve that, I’d be content.
February 1st, 2005 at 2/1/2005 9:34 pm
Ignore both above posts. The problem with Safari was that I’m using Saft to open new windows in tabs automatically–that messes up the slideshow popup window. Except for some small formatting issues (and Flickr going off and on!), all’s well here.
February 3rd, 2005 at 2/3/2005 6:18 am
Any reason why the total number of photos per set that is outputted is always one more than the actual number? For example, it’ll say “This photset has 17 pictures” when in fact it only has 16.
February 3rd, 2005 at 2/3/2005 6:38 am
Answer to my own question: line 83 should be:
$album_details['photos'] = count($count_tree['rsp'][$album_id]) - 1;
instead of:
$album_details['photos'] = count($count_tree['rsp'][$album_id]) ;
February 3rd, 2005 at 2/3/2005 7:40 am
I have given up on using this for a gallery. I guess I’ll have to try some other plugin. It just hasn’t worked for me…
February 5th, 2005 at 2/5/2005 10:57 am
To all the people who are getting this error
“An error occurred. Here is the response from Flickr:
And here is the response after passing through the parser:
array (
)”
The problemis most likely because the path to the Flickr Cache folder is wrong. You’ll need to find this full path info from whoever hosts your site mine is /usr/local/psa/home/vhosts/yourdomain/httpdocs/wp-content/plugins/flickr_cache/ yours wll be something different (unless you host with 34spin the UK). HTH
February 6th, 2005 at 2/6/2005 9:57 pm
Great plugin, thanks.
February 7th, 2005 at 2/7/2005 2:10 am
Flickr Photo Gallery
Like many out in the blogosphere, I was an early convert to Flickr, particularly when I discovered how easy it was to post photoblog messages from my phone with it. Since then, I’ve been experimenting with it a bit, using…
February 9th, 2005 at 2/9/2005 11:21 pm
Fantastic plugin, is there any development on a version that will work with wordpress 1.5 ?
I was looking to set up some kind of gallery, and this integration of wordpress and flickr is IDEAL.
February 9th, 2005 at 2/9/2005 11:22 pm
Great Plugin, exactly what I was looking for, but I can’t seem to get it to work with wordpress 1.5. Are there any plans for future development ?
February 10th, 2005 at 2/10/2005 12:58 am
Chris,
I do eventually have plans for compatibility with WP 1.5, but life is kind of crazy right now (awaiting a new baby, actually due today!). WP 1.5 is still considered bleeding edge, so I’m not in a real hurry to get to work on it either. If you have any specific information about incompatibilities I may be able to crank out some fixes more quickly though.
Ray
February 10th, 2005 at 2/10/2005 10:17 am
Great stuff Ray, though I wish you would have left it as standalone-capable, since v.07 now requires WP.
One bug I think is probably in this version… if you have a photoset that consists entirely of private photos the set will still show up as an album, but produces a
Warning: Invalid argument supplied for foreach() in...error because it looks like an empty set. Also, the set photo is shown in the main gallery page even though it is marked private.thanks!
February 11th, 2005 at 2/11/2005 8:50 am
I’m having the same problem with the photo count as others seems to have. Although my only album at the moment contains only one picture the plugin claims that there are two, and shows a link to the previous picture. When I click it the gallery of course fails with an error message (err code 1 “Photo not found”). The photo id is very strange as well (”server”). Does anybody know what the problem is?
February 12th, 2005 at 2/12/2005 11:23 pm
Fatal error: Call to undefined function: flickr_show_photos() in /home/tany/public_html/dynachrome/gallery.php on line 32
what IM doing bad?????
February 14th, 2005 at 2/14/2005 1:13 am
I had been unable to get the friendly URL’s to work in Wordpress 1.5 until I modified the source of the plug-in so that each URL that was being built ended up having a trailing slash. Example URL: http://www.jarkolicious.com/gallery/album/mobilecam/
The default plug-in, when simply turning on friendly URL’s, did not work without the trailing slash, such as: http://www.jarkolicious.com/gallery/album/mobilecam
I can send you the file I have if you desire as everything appears to work without issue in Wordpress 1.5. Just holler and I will be glad to send along what I’ve worked on, which granted, is not much.
February 15th, 2005 at 2/15/2005 7:46 pm
hi, could you help me ?
yesterday i successfully installed the flickr-gallery on my wp122-installation.
today i installed wp15 and liked it, but i am unable to find out, how to install the gallery. point 5 tells me to copy my index.php and rename it gallery.php
first of all WHICH index.php ? the one in the root-folder or in the themes-folder.
i would be glad if you could tell me how you installed your gallery. thxia.
February 15th, 2005 at 2/15/2005 8:54 pm
ok, i solved this.
now i am getting the same error as striatic. it cannot be the host, as yesterday the plugin worked perfectly on wp122.
February 19th, 2005 at 2/19/2005 3:00 am
Okay, so to all the people who did get it working with wordpress 1.5, what did you do?
February 19th, 2005 at 2/19/2005 11:33 am
Copy Your index.php from template You are using to WP root directory and name it gallery.php
Then edit and change as descibed.
February 19th, 2005 at 2/19/2005 11:36 am
Changes I did:
added
unset($count_tree['rsp'][$album_id]['server']);
to fickr-gallery.php (94 row)
because plugin counts not images, but array item count.
February 20th, 2005 at 2/20/2005 4:31 pm
Trying to get this working on my site using friendly URLs… I’ve gotten the main page to show up, but whenever I click a collection I get a 404. Not sure what I’ve got set wrong, possible something in my htaccess. My site is here: http://www.seanw.com/index.php/flickr-gallery/
Any ideas?
February 20th, 2005 at 2/20/2005 7:23 pm
I have the WP 1.5 strayhorn installed and working and installed flickr 0.7. The blog from flickr function works and I`m able to blog individual images from within flickr. The gallery part doesnt work though.
I modified the index.php found in the themes/default folder and saved as gallery.php in my root dir ( my web root dir and wordpress root dir is the same )
When pointing to the gallert.php I get this error:
Fatal error: Call to undefined function get_header() in /usr/home/web/wno55017/gallery.php on line 1Am I running into a flickr 0.7/WP1.5 problem here or may it be a problem with my host ?
Any advice would be appreciated.
BTW: Very nice plugin, hopefully you will find time making a version for WP ?
February 21st, 2005 at 2/21/2005 1:58 am
Ray,
In my photo gallery at http://www.idowens.com/photo-gallery/ the initial album view is in a single line down the left margin but if you enter a gallery the thumbnails are spread across the entire content column. I am trying to have the initial album view spread atleast two across but changing .flickr-album in my CSS changed not only the main album view but the individual albums as well…I was thinking about something like
`< ?php
if ($thisPage=="http://www.idowens.com/photo-gallery/") {
echo "