当前位置: 首页>>代码示例>>PHP>>正文


PHP phpFlickr::galleries_getPhotos方法代码示例

本文整理汇总了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)
开发者ID:jlederman,项目名称:subproj,代码行数:67,代码来源:flickr-photostream.php

示例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";
开发者ID:emirpprime,项目名称:flickr-justified-gallery,代码行数:67,代码来源:flickr-justified-gallery.php


注:本文中的phpFlickr::galleries_getPhotos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。