Flickr Search
A simple flickr search snipplet that you can add into any existing webpage.
New Version [Nov 2009]: This latest version has 3 new features.
- Search in a specific flickr account.
- Customize total photos to return.
- Caching engine included to save bandwidth!
Note: You will need a flickr API key for this to work. Apply for one: http://www.flickr.com/services/api/keys/apply/
Features:
- Configurable default search term(s).
- Configurable image size output.
- Multi queries and tags can be handled.
- Search within specific flickr account user.
- Configurable photos to be returned and displayed.
- Caching engine built-in!
Easy HTML/CSS customization, code and view are within separate files.
Files in this webapp:
- index.php
- style.css
- config.php
- flickr_search.php
If there are questions, comments, or custom request, feel free to contact me directly through this form
Live Demo can be found here.
you can to paginate the results as in the other script: http://scriptillusion.com/scripts/flickr_v2/ ?
Can you rephrase the question? Are you wanting pagination function into the script?
Yes Robert.
Sorry for my english
Yes, you can pass the page attribute into the url string and it will return the results of page 1, 2, 3, etc.
So in flickr_search.php, line 19, you can add the page attrib like this:
$url = “http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=$api_key&tags=$q&page=1”;
and for something like page 5:$url = “http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=$api_key&tags=$q&page=5”;
Feel free to contact me through email if this doesn’t make sense… it’s my fullname [at] gmail [dot] com
how can i limit results to …say about 10 images?
You can use the per_page option.
Open up flickr_search.php, line 19, add the per_page option like this:
$url = “http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=$api_key&tags=$q&per_page=10”;
That will return only 10 images at a time.
Awesome thanks. Anyway you can release a new version of this with caching?
That’s a great idea! I just need to add 2-3 lines of code… shoot me an email and I’ll get that to you. Once it’s verified working, then I’ll make an update to themeforest.
robertbanh[at]gmail[dot]com
Thanks so much for adding the caching feature so quickly. Good to know that you reply very quickly to your buyers and actually do the updates. I look forward to buying more of your stuff!
Nice, but i’m getting this error…
Warning: filemtime() [function.filemtime]: stat failed for r /mnt/98230/domains/domain.com/html/caches/flickr_search+term in /mnt/98230/domains/domain.com/html/flickr_search.php on line 23
Looks like replacing line 23 with these 2 will fix it:
$filemtime = @filemtime($cache);if (($filemtime === false) || ($filemtime < (time() – $cache_timer)))
I am getting the same error as landomiller and added
$filemtime = @filemtime($cache); if ($filetime < (time() – $cache_timer))
and it appears to work fine with php 5
Hi Robert,
I have a following error:
Warning: filemtime() [function.filemtime]: stat failed for …..caches/flickr_objectified in ……flickr_search.php on line 21
Fatal error: Call to undefined function curl_init() in ….. flickr_search.php on line 32
Is there a solution for that ? Thank you.
I believe your server doesn’t have CURL . If you do echo phpinfo(); … is CURL listed?
Your script is good, but when someone make a search this not specific for multi word.
Example : If you search “Big Cat” your script will show all images with big OR cat. I want know if it’s possible to make big AND cat for show pictures with this 2 tags
Thank You
Sorry, i’m ok I found by myself on the flickr api website… For people who are interested.
1. Open the file “flickr_search.php” 2. Edit the $URL line3. Add the variable tag_mode …&tag_mode=all
And you will have pictures with multi tags
Hi Robert,Is it possible to search a specific user account with this code?Can I limit the search for ONLY tags? exclude title, description and etc? And the most important, how the photos will be in the results page, can I organize them by post date?
Sorry for all this questions and my english, but I need them to be a couple of photos by line! And must be specific photos side by side! (they gonna have the same tags, title and description, so I guess this won’t be a problem)
Hi, all your demo’s are down… let me know when fixed… Thx
No answer = do not buy this script…
GREAT little script. SO easy to install. AMAZING support from Robert. HIGHLY RECOMMEND this author!!!
no demo.
Download PHP Scripts Flickr Search CodeCanyon Free
http://www.xvcz.com/download-php-scripts-flickr-search-codecanyon-free/
No comments:
Post a Comment