本文整理汇总了PHP中phpFlickr::galleries_getPhotos方法的典型用法代码示例。如果您正苦于以下问题:PHP phpFlickr::galleries_getPhotos方法的具体用法?PHP phpFlickr::galleries_getPhotos怎么用?PHP phpFlickr::galleries_getPhotos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpFlickr
的用法示例。
在下文中一共展示了phpFlickr::galleries_getPhotos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flickrps_createGallery
//.........这里部分代码省略.........
}
}
if ($action === 'grp') {
if (!isset($id) || strlen($id) == 0) {
return flickrps_formatError(__('You must specify the id of the group, using the "id" attribute', 'flickr-photostream'));
}
}
if ($pagination !== 'none' && $pagination !== 'prevnext' && $pagination !== 'numbers') {
return flickrps_formatError(__('The pagination attribute can be only "none", "prevnext" or "numbers".', 'flickr-photostream'));
}
if ($last_row !== 'hide' && $last_row !== 'justify' && $last_row !== 'nojustify') {
return flickrps_formatError(__('The last_row attribute can be only "hide", "justify" or "nojustify".', 'flickr-photostream'));
}
if ($lightbox !== 'none' && $lightbox !== 'colorbox' && $lightbox !== 'swipebox') {
return flickrps_formatError(__('The lightbox attribute can be only "none", "colorbox" or "swipebox".', 'flickr-photostream'));
}
//Photo loading----------------
$extras = "description, original_format, url_l, url_z";
if ($action === 'set') {
//Show the photos of a particular photoset
$photos = $f->photosets_getPhotos($id, $extras, 1, $max_num_photos, $page_num, NULL);
$photos_main_index = 'photoset';
} else {
if ($action === 'gal') {
//Show the photos of a particular gallery
$photos_url[$user_id] = $f->urls_getUserPhotos($user_id);
if ($f->getErrorCode() != NULL) {
return flickrps_formatFlickrAPIError($f->getErrorMsg());
}
$gallery_info = $f->urls_lookupGallery($photos_url[$user_id] . 'galleries/' . $id);
if ($f->getErrorCode() != NULL) {
return flickrps_formatFlickrAPIError($f->getErrorMsg());
}
$photos = $f->galleries_getPhotos($gallery_info['gallery']['id'], $extras, $max_num_photos, $page_num);
$photos_main_index = 'photos';
} else {
if ($action === 'tag') {
$photos = $f->photos_search(array('user_id' => $user_id, 'tags' => $tags, 'tag_mode' => $tags_mode, 'extras' => $extras, 'per_page' => $max_num_photos, 'page' => $page_num));
$photos_main_index = 'photos';
} else {
if ($action === 'grp') {
//Show the photos of a particular group pool
//groups_pools_getPhotos ($group_id, $tags = NULL, $user_id = NULL, $jump_to = NULL, $extras = NULL, $per_page = NULL, $page = NULL) {
$photos = $f->groups_pools_getPhotos($id, $tags, NULL, NULL, $extras, $max_num_photos, $page_num);
$photos_main_index = 'photos';
} else {
//Show the classic photostream
$photos = $f->people_getPublicPhotos($user_id, NULL, $extras, $max_num_photos, $page_num);
//Need the authentication (TODO)
//$photos = $f->people_getPhotos($user_id,
// array("privacy_filter" => "1", "extras" => "description", "per_page" => $max_num_photos, "page" => $page_num));
$photos_main_index = 'photos';
}
}
}
}
if ($f->getErrorCode() != NULL) {
return flickrps_formatFlickrAPIError($f->getErrorMsg());
}
if (count((array) $photos[$photos_main_index]['photo']) == 0) {
return __('No photos', 'flickr-photostream');
}
//we calculate that the aspect ratio has an average of 4:3
if ($images_height <= 75) {
$imgSize = "thumbnail";
//thumbnail (longest side:100)
示例2: fjgwpp_createGallery
//.........这里部分代码省略.........
}
}
if ($action === 'grp') {
if (!isset($id) || strlen($id) == 0) {
return fjgwpp_formatError(__('You must specify the id of the group, using the "id" attribute', 'fjgwpp'));
}
}
if ($pagination !== 'none' && $pagination !== 'prevnext' && $pagination !== 'numbers') {
return fjgwpp_formatError(__('The pagination attribute can be only "none", "prevnext" or "numbers".', 'fjgwpp'));
}
if ($last_row !== 'hide' && $last_row !== 'justify' && $last_row !== 'nojustify') {
return fjgwpp_formatError(__('The last_row attribute can be only "hide", "justify" or "nojustify".', 'fjgwpp'));
}
if ($lightbox !== 'none' && $lightbox !== 'colorbox' && $lightbox !== 'swipebox') {
return fjgwpp_formatError(__('The lightbox attribute can be only "none", "colorbox" or "swipebox".', 'fjgwpp'));
}
//Photo loading----------------
$extras = "description, original_format, url_l, url_z";
if ($action === 'set') {
//Show the photos of a particular photoset
$photos = $f->photosets_getPhotos($id, $extras, NULL, $max_num_photos, $page_num, NULL);
$photos_main_index = 'photoset';
} else {
if ($action === 'gal') {
//Show the photos of a particular gallery
$photos_url[$user_id] = $f->urls_getUserPhotos($user_id);
if ($f->getErrorCode() != NULL) {
return fjgwpp_formatFlickrAPIError($f->getErrorMsg());
}
$gallery_info = $f->urls_lookupGallery($photos_url[$user_id] . 'galleries/' . $id);
if ($f->getErrorCode() != NULL) {
return fjgwpp_formatFlickrAPIError($f->getErrorMsg());
}
$photos = $f->galleries_getPhotos($gallery_info['gallery']['id'], $extras, $max_num_photos, $page_num);
$photos_main_index = 'photos';
} else {
if ($action === 'tag') {
$photos = $f->photos_search(array('user_id' => $user_id, 'tags' => $tags, 'tag_mode' => $tags_mode, 'extras' => $extras, 'per_page' => $max_num_photos, 'page' => $page_num));
$photos_main_index = 'photos';
} else {
if ($action === 'grp') {
//Show the photos of a particular group pool
//groups_pools_getPhotos ($group_id, $tags = NULL, $user_id = NULL, $jump_to = NULL, $extras = NULL, $per_page = NULL, $page = NULL) {
$photos = $f->groups_pools_getPhotos($id, $tags, NULL, NULL, $extras, $max_num_photos, $page_num);
$photos_main_index = 'photos';
} else {
//Show the classic photostream
$photos = $f->people_getPublicPhotos($user_id, NULL, $extras, $max_num_photos, $page_num);
//Need the authentication (TODO)
//$photos = $f->people_getPhotos($user_id,
// array("privacy_filter" => "1", "extras" => "description", "per_page" => $max_num_photos, "page" => $page_num));
$photos_main_index = 'photos';
}
}
}
}
if ($f->getErrorCode() != NULL) {
return fjgwpp_formatFlickrAPIError($f->getErrorMsg());
}
$photos_pool = $photos[$photos_main_index];
if (count((array) $photos_pool['photo']) == 0) {
return __('No photos', 'fjgwpp');
}
//we calculate that the aspect ratio has an average of 4:3
if ($images_height <= 75) {
$imgSize = "thumbnail";