From 24f3f2f0d304254451c46a3b28a8e1f4678bc02f Mon Sep 17 00:00:00 2001 From: Greg Froese Date: Thu, 8 Oct 2009 04:38:19 +0000 Subject: flickr integration --- pages/lists/flickr.php | 60 ++++++++++++++++++++++++++++++++++++++++ pages/lists/mostrecentimages.php | 4 ++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 pages/lists/flickr.php (limited to 'pages/lists') diff --git a/pages/lists/flickr.php b/pages/lists/flickr.php new file mode 100644 index 000000000..b9886042b --- /dev/null +++ b/pages/lists/flickr.php @@ -0,0 +1,60 @@ +guid, "flickr_username" ); +if( empty( $flickr_username )) { + register_error( "No Flickr username set"); + echo "
No flickr username set: $temp_user->guid"; die;
+	forward( "/" );
+	die;
+}
+$flickr_user = $f->people_findByUsername( $flickr_username->value );
+
+// Get the friendly URL of the user's photos
+$photos_url = $f->urls_getUserPhotos( $flickr_user["id"] );
+
+if( !empty( $flickr_user )) {
+	$recent = $f->people_getPublicPhotos( $flickr_user['id'], NULL, NULL, 5 );
+} else {
+	echo "user not found"; die;
+}
+//echo "
"; var_dump( $recent ); echo "
"; + +//echo "
"; var_dump( $user ); echo "
"; +$body = elgg_view_title( "Flickr photos for $flickr_user[username]" ); + +$count = 0; +foreach ($recent['photos']['photo'] as $photo) { + + $photo_info = $f->photos_getInfo( $photo["id"], $photo["secret"] ); + $body .= "
"; + $body .= "$photo_info[title]
Views: $photo_info[views]
"; + $body .= ""; + $body .= "$photo[title]"; + $body .= ""; + + $tag_count = 0; + $body .= "
Tags:
"; + foreach( $photo_info["tags"]["tag"] as $tag ) { + if( $tag_count ) $body .= ", "; + $body .= "$tag[_content]"; + $tag_count++; + } + + $body .= "
"; + $count++; +} +page_draw( "Flickr photos for $flickr_user[username]", elgg_view_layout("two_column_left_sidebar", '', $body)); + +?> \ No newline at end of file diff --git a/pages/lists/mostrecentimages.php b/pages/lists/mostrecentimages.php index 32320a5d2..615b05340 100644 --- a/pages/lists/mostrecentimages.php +++ b/pages/lists/mostrecentimages.php @@ -31,12 +31,14 @@ // grab the html to display the images $images = tp_list_entities("object", "image", $user_id, $max, false, false, true); +// echo "
"; var_dump( $images ); echo "
"; $images .= '
'; // hack until elgg fixes problem with css/list entities html // this view takes care of the title on the main column and the content wrapper $area2 = elgg_view('tidypics/content_wrapper', array('title' => $title, 'content' => $images,)); - + if( empty( $area2 )) $area2 = $images; + $body = elgg_view_layout('two_column_left_sidebar', '', $area2); page_draw($title, $body); -- cgit v1.2.3