/** * Return directory contents for the silo path * * @param string $path The path to retrieve the contents of * @return array An array of MediaAssets describing the contents of the directory */ public function silo_contents() { $flickr = new Flickr(); $token = Options::get( 'flickr_token_' . User::identify()->id ); $result = $flickr->call( 'flickr.auth.checkToken', array( 'api_key' => $flickr->key, 'auth_token' => $token ) ); $photos = $flickr->GetPublicPhotos( $result->auth->user['nsid'], null, 5 ); foreach( $photos['photos'] as $photo ){ $url = $flickr->getPhotoURL( $photo ); echo '<img src="' . $url . '" width="150px" alt="' . ( isset( $photo['title'] ) ? $photo['title'] : _t('This photo has no title') ) . '">'; } }