本文整理汇总了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 {
示例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";