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


PHP phpFlickr::photos_getNotInSet方法代码示例

本文整理汇总了PHP中phpFlickr::photos_getNotInSet方法的典型用法代码示例。如果您正苦于以下问题:PHP phpFlickr::photos_getNotInSet方法的具体用法?PHP phpFlickr::photos_getNotInSet怎么用?PHP phpFlickr::photos_getNotInSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phpFlickr的用法示例。


在下文中一共展示了phpFlickr::photos_getNotInSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

     $u = $flickr->people_getInfo($u['id']);
     $template->assign(array('username' => $u['username'], 'profile_url' => $u['profileurl'], 'logout_url' => FLICKR_ADMIN . '-import&action=logout', 'list_albums_url' => FLICKR_ADMIN . '-import&action=list_albums', 'import_all_url' => FLICKR_ADMIN . '-import&action=list_all'));
     break;
     // list user albums
 // list user albums
 case 'list_albums':
     // all albums
     $albums = $flickr->photosets_getList($u['id']);
     $total_albums = $albums['total'];
     $albums = $albums['photoset'];
     foreach ($albums as &$album) {
         $album['U_LIST'] = FLICKR_ADMIN . '-import&action=list_photos&album=' . $album['id'];
     }
     unset($album);
     // not classed
     $wo_albums = $flickr->photos_getNotInSet(NULL, NULL, NULL, NULL, 'photos', NULL, NULL, 1);
     if ($wo_albums['photos']['total'] > 0) {
         $albums[] = array('id' => 'not_in_set', 'title' => l10n('Pictures without album'), 'description' => null, 'photos' => $wo_albums['photos']['total'], 'U_LIST' => FLICKR_ADMIN . '-import&action=list_photos&album=not_in_set');
     }
     $template->assign(array('total_albums' => $total_albums, 'albums' => $albums));
     break;
     // list photos of an album
 // list photos of an album
 case 'list_photos':
     $self_url = FLICKR_ADMIN . '-import&action=list_photos&album=' . $_GET['album'];
     $flickr_prefix = 'flickr-' . $u['username'] . '-';
     $flickr_root_url = $flickr->urls_getUserPhotos($u['id']);
     // pagination
     if (isset($_GET['start'])) {
         $page['start'] = intval($_GET['start']);
     } else {
开发者ID:biffhero,项目名称:Flickr2Piwigo,代码行数:31,代码来源:import.php

示例2: escapeshellarg

        }
        if (!is_null($url)) {
            $dir = escapeshellarg("photos/{$set['title']}");
            $filename = parse_url($url, PHP_URL_PATH);
            // Only download if file does not exist...
            if (!file_exists("photos/{$set['title']}/{$filename}")) {
                shell_exec("cd {$dir}; /usr/bin/curl -O {$url}");
            }
        }
        // This helps stop the Flickr API from getting angry
        sleep(1);
    }
}
// Download all photos not in a set
echo "### No Set\n";
$photos = $f->photos_getNotInSet();
foreach ($photos['photos']['photo'] as $photo) {
    $url = null;
    $sizes = $f->photos_getSizes($photo['id']);
    foreach ($sizes as $size) {
        if ($size['label'] == 'Original') {
            $url = $size['source'];
        }
    }
    if (isset($url)) {
        @mkdir("photos/No Set", 0777, true);
        $dir = escapeshellarg("photos/No Set");
        shell_exec("cd {$dir}; /usr/bin/curl -O {$url}");
    }
}
echo "Done!\n";
开发者ID:airpwn,项目名称:tylerhall,代码行数:31,代码来源:download-all.php


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