Created
March 11, 2012 07:46
-
-
Save 65/2015469 to your computer and use it in GitHub Desktop.
BlogCFC Flickr Images Pod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfsetting enablecfoutputonly=true> | |
<cfprocessingdirective pageencoding="utf-8"> | |
<cfmodule template="../../tags/scopecache.cfm" cachename="pod_images" scope="application" timeout="#application.timeout#"> | |
<cfmodule template="../../tags/podlayout.cfm" title="Recent Flickr"> | |
<cfoutput> | |
</cfoutput> | |
</cfmodule> | |
</cfmodule> | |
<cfsetting enablecfoutputonly=false> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfinclude template="../includes/pods/images.cfm"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="text-align:center;"> | |
<!--- Loop over the photos and output a thumbnail of each ---> | |
<cfloop from="1" to="#arraylen(arrayPhotos)#" index="i"> | |
<cfset photo = arrayPhotos[i]> | |
<a href="http://www.flickr.com/photos/length" title="#photo.getTitle()#"><img src="#photo.getPhotoUrl(photo.SIZE_SMALL_SQUARE)#" border="0" alt="#photo.getTitle()#"/></a> | |
</cfloop> | |
<a href="http://www.flickr.com/photos/length">More from Length @ Flickr</a> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Create an instance of the Flickr class---> | |
<cfset flickr = createobject("component", "CFlickr.Flickr")> | |
<!--- change to use your API key ---> | |
<cfset flickr.init("123456789123456789")> | |
<!--- Get the interface we want to work with ---> | |
<cfset usrInterface = flickr.getPeopleInterface()> | |
<!--- Find the nsid for the user length ---> | |
<cfset nsid = usrInterface.findByUsername("length").getID()> | |
<!--- Get the 4 most recent photos ---> | |
<cfset photoList = usrInterface.getPublicPhotos(user_id=nsid,per_page=4,page=1)> | |
<cfset arrayPhotos = photoList.getPhotos()> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment