當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。