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


PHP phpFlickr::photosets_getList方法代码示例

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


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

示例1: UserID_sets_List

function UserID_sets_List($user_id)
{
    $o = new phpFlickr('6791ccf468e1c2276c1ba1e0c41683a4');
    $d = $o->photosets_getList($user_id);
    #print_r($d);
    print_r("total Sets :" . $d['total'] . "\n");
    $total_sets = $d['total'];
    for ($set = 0; $total_sets > $set; $set++) {
        print "Set : {$set} ";
        print $d['photoset'][$set]['id'];
        $dir_name = $d['photoset'][$set]['title'];
        print $dir_name . "\n";
        $dir_name = str_replace(" ", "\\ ", $dir_name);
        $dir_name = str_replace("'", "\\'", $dir_name);
        $dir_name = str_replace("/", "\\/", $dir_name);
        $dir_name = str_replace("(", "-", $dir_name);
        $dir_name = str_replace(")", "-", $dir_name);
        $dir_name = str_replace("|", "-", $dir_name);
        $dir_name = str_replace("&", "-", $dir_name);
        $dir_name = trim($dir_name);
        system("mkdir -p {$user_id}/{$dir_name}");
        system("touch {$user_id}/log");
        $path = $user_id . "/" . $dir_name;
        system("echo  '{$path}'  >>  {$user_id}/log ");
        UserSets_Get_Photos($d['photoset'][$set]['id'], $path);
    }
}
开发者ID:hannibal0112,项目名称:php_flickr_download,代码行数:27,代码来源:download_ID_Sets_V1.php

示例2: get_data_source

function get_data_source($data_type, $type = '')
{
    $arr = array();
    if ($data_type == 'data-2') {
        $arr = get_categories();
    } elseif ($data_type == 'data-2-formats') {
        $post_formats = get_theme_support('post-formats');
        $arr = $post_formats[0];
        array_unshift($arr, "Select Filter");
    } elseif ($data_type == 'data-3') {
        if (is_admin()) {
            global $ph_sets;
            if (!empty($ph_sets)) {
                $arr = $ph_sets['photoset'];
            } else {
                if (of_get_option('flickr_userid') != '') {
                    require_once NV_FILES . "/adm/inc/phpFlickr/phpFlickr.php";
                    $f = new phpFlickr('7caca0370ede756c26832c28b266ead5');
                    $user = of_get_option('flickr_userid');
                    $ph_sets = $f->photosets_getList($user);
                    $arr = $ph_sets['photoset'];
                }
            }
            if ($arr != '' && $type == 'shortcode') {
                array_unshift($arr, "Select Flickr Set");
            }
        }
    } elseif ($data_type == 'data-4') {
        $args = array('numberposts' => -1, 'post_type' => 'slide-sets', 'post_status' => 'publish');
        $arr = get_posts($args);
    } elseif ($data_type == 'data-5') {
        if (class_exists('Woocommerce')) {
            $arr = get_terms('product_cat', 'orderby=name&hide_empty=0');
        } else {
            $arr = get_terms('wpsc_product_category', 'orderby=name&hide_empty=0');
        }
    } elseif ($data_type == 'data-5-tags') {
        $arr = get_terms('product_tag', 'orderby=name&hide_empty=1');
    } elseif ($data_type == 'data-6') {
        $arr = get_terms('portfolio-category', 'orderby=name&hide_empty=0');
    }
    // Set the options array
    if (is_array($arr)) {
        foreach ($arr as $val) {
            if ($data_type == 'data-2') {
                if ($type == 'shortcode') {
                    $options_array[htmlspecialchars($val->cat_name)] = $val->cat_name;
                } else {
                    $options_array[htmlspecialchars($val->term_id)] = $val->cat_name;
                }
            } elseif ($data_type == 'data-3') {
                if ($type == 'shortcode') {
                    if ($val == 'Select Flickr Set') {
                        $options_array[htmlspecialchars($val)] = '';
                    } else {
                        $options_array[$val['title']['_content']] = $val['id'];
                    }
                } else {
                    $options_array[$val['id']] = $val['title']['_content'];
                }
            } elseif ($data_type == 'data-4') {
                if ($type == 'shortcode') {
                    $options_array[htmlspecialchars($val->post_title)] = $val->post_title;
                } else {
                    $options_array[htmlspecialchars($val->ID)] = $val->post_title;
                }
            } elseif ($data_type == 'data-2-formats') {
                if ($type == 'shortcode') {
                    if ($val == 'Select Filter') {
                        $options_array[htmlspecialchars($val)] = '';
                    } else {
                        $options_array[htmlspecialchars($val)] = $val;
                    }
                } elseif ($type == 'blog') {
                    if ($val != 'Select Filter') {
                        $options_array[htmlspecialchars($val)] = $val;
                    }
                } else {
                    if ($val == 'Select Filter') {
                        $options_array[] = array('name' => $val, 'value' => '');
                    } else {
                        $options_array[] = array('name' => $val, 'value' => $val);
                    }
                }
            } else {
                $options_array[htmlspecialchars($val->name)] = $val->name;
            }
        }
    }
    if (empty($options_array)) {
        $options_array[''] = 'No Data Found';
    }
    return $options_array;
}
开发者ID:ConceptHaus,项目名称:backup,代码行数:94,代码来源:core.php

示例3: form


//.........这里部分代码省略.........
        <div id="<?php 
            echo $this->get_field_id('data-3');
            ?>
" class="datasource">

<?php 
            /* ------------------------------------
            		:: FLICKR SET
            		------------------------------------ */
            ?>
         
        	<p>
			<label for="<?php 
            echo $this->get_field_id('flickrset');
            ?>
"><strong><?php 
            _e('Select Flickr Set:', 'themeva');
            ?>
</strong></label><br />
			<select name="<?php 
            echo $this->get_field_name('flickrset');
            ?>
" id="<?php 
            echo $this->get_field_id('flickrset');
            ?>
">
			<?php 
            if (is_admin()) {
                require_once NV_FILES . "/adm/inc/phpFlickr/phpFlickr.php";
                //$f = new phpFlickr( of_get_option('flickr_apikey') ); // API
                $f = new phpFlickr('7caca0370ede756c26832c28b266ead5');
                // API
                $user = of_get_option('flickr_userid');
                $ph_sets = $f->photosets_getList($user);
                foreach ($ph_sets['photoset'] as $ph_set) {
                    if (!$ph_set) {
                        ?>
							<option value="">No Sets Found</option>            	
					<?php 
                    } else {
                        ?>
							<option value="">Select Set</option>
							<option value="<?php 
                        echo $ph_set['id'];
                        ?>
" <?php 
                        if ($instance['flickrset'] == $ph_set['id']) {
                            ?>
 selected="selected" <?php 
                        }
                        ?>
><?php 
                        echo $ph_set['title'];
                        ?>
</option>     
							<?php 
                    }
                }
            }
            ?>
 			</select>
        	</p>
        </div>
		<?php 
        }
        ?>
开发者ID:ConceptHaus,项目名称:backup,代码行数:67,代码来源:custom-widgets.php

示例4: unset

 case 'logout':
     unset($_SESSION['phpFlickr_auth_token']);
     $_SESSION['page_infos'][] = l10n('Logged out');
     redirect(FLICKR_ADMIN . '-import');
     break;
     // main menu
 // main menu
 case 'main':
     $u = $flickr->people_getInfo($u['id']);
     $template->assign(array('username' => $u['username'], 'profile_url' => $u['profileurl'], 'logout_url' => FLICKR_ADMIN . '-import&amp;action=logout', 'list_albums_url' => FLICKR_ADMIN . '-import&amp;action=list_albums', 'import_all_url' => FLICKR_ADMIN . '-import&amp;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&amp;action=list_photos&amp;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&amp;action=list_photos&amp;album=not_in_set');
     }
     $template->assign(array('total_albums' => $total_albums, 'albums' => $albums));
     break;
     // list photos of an album
 // list photos of an album
开发者ID:biffhero,项目名称:Flickr2Piwigo,代码行数:31,代码来源:import.php

示例5: phpFlickr

							</div>
							<div class="es-carousel">
			<style>.es-carousel ul li a img{			
			margin-top: -30px !important;
			}
		</style>
		<?php 
    require_once "flickr/phpFlickr.php";
    if ($flickrPrivate == "privatephotosetYes") {
        $f = new phpFlickr("{$flickrAPI}", "{$flickrSecret}");
        $f->setToken("{$flickrToken}");
    }
    if ($flickrPrivate == "privatephotosetNo") {
        $f = new phpFlickr("{$flickrAPI}");
    }
    $ph_sets = $f->photosets_getList();
    if ($flickrCache == "1") {
        $cacheFolderPath = JPATH_SITE . DS . 'cache' . DS . 'ResponsivePhotoGallery-' . $moduleTitle . '';
        if (file_exists($cacheFolderPath) && is_dir($cacheFolderPath)) {
            // all OK
        } else {
            mkdir($cacheFolderPath);
        }
        $lifetime = 860 * 860;
        // 60 * 60=One hour
        $f->enableCache("fs", "{$cacheFolderPath}", "{$lifetime}");
    }
    ?>

		<?php 
    if ($flickrCaption == "1") {
开发者ID:greyhat777,项目名称:vuslinterliga,代码行数:31,代码来源:default.php

示例6: forward

$viewer = elgg_get_logged_in_user_entity();
/* Deprecated 
	
	$flickr_username = get_metadata_byname( $viewer->guid, "flickr_username" );
	$flickr_id = get_metadata_byname( $viewer->guid, "flickr_id" );
	$album_id = get_metadata_byname( $viewer->guid, "flickr_album_id" );
	
	*/
$flickr_username = elgg_get_metadata(array('guid' => $viewer->guid, 'metadata_name' => 'flickr_username'));
$flickr_id = elgg_get_metadata(array('guid' => $viewer->guid, 'metadata_name' => 'flickr_id'));
$album_id = elgg_get_metadata(array('guid' => $viewer->guid, 'metadata_name' => 'flickr_album_id'));
if (intval($album_id[0]->value) <= 0) {
    register_error(sprintf(elgg_echo('flickr:errornoalbum'), $album_id[0]->value));
    forward("/mib/mod/tidypics/pages/flickr/setup.php");
}
$photosets = $f->photosets_getList($flickr_id[0]->value);
foreach ($photosets["photoset"] as $photoset) {
    $content .= "<div class='tidypics_album_images'>";
    $content .= "{$photoset['title']}<br />";
    $count = 0;
    $looper = 0;
    //create links to import photos 10 at a time
    while ($photoset["photos"] > $count) {
        $looper++;
        $content .= " <a href='/mib/mod/tidypics/actions/flickrImportPhotoset.php?set_id={$photoset['id']}&page={$looper}&album_id=" . $album_id[0]->value . "'>{$looper}</a>";
        $count = $count + 10;
    }
    $content .= "<br />{$photoset['photos']} images";
    $content .= "</div>";
    //		echo "<pre>"; var_dump( $photoset ); echo "</pre>"; die;
}
开发者ID:rijojoy,项目名称:MyIceBerg,代码行数:31,代码来源:importPhotosets.php

示例7: phpFlickr

define('API_KEY', '');
define('API_SECRET', '');
define('API_TOKEN', '');
// === S T E P  2 ===
// Fill in your Flickr user ID. You can find it here: http://idgettr.com
define('UID', '');
// === S T E P 3 ===
// Download and include the phpFlickr project from http://code.google.com/p/phpflickr/
require 'phpFlickr/phpFlickr.php';
// === S T E P 4 ===
// Run the script via the command line using: "php download-all.php"
// Connect to Flickr
$f = new phpFlickr(API_KEY, API_SECRET, true);
$f->setToken(API_TOKEN);
// Get all of our photosets
$sets = $f->photosets_getList(UID);
foreach ($sets['photoset'] as $set) {
    echo "### " . $set['title'] . "\n";
    @mkdir("photos/{$set['title']}", 0777, true);
    // Get all the photos in this set
    $photos = $f->photosets_getPhotos($set['id']);
    // And download each one...
    foreach ($photos['photoset']['photo'] as $photo) {
        $url = null;
        $sizes = $f->photos_getSizes($photo['id']);
        foreach ($sizes as $size) {
            if ($size['label'] == 'Original') {
                $url = $size['source'];
            }
        }
        if (!is_null($url)) {
开发者ID:airpwn,项目名称:tylerhall,代码行数:31,代码来源:download-all.php

示例8: phpFlickr

<?php

require_once "phpFlickr/phpFlickr.php";
$f = new phpFlickr("44449d9d74ed80abe095ab2a6f137dbe", "abde3a1309b8d8e1");
/*
$f->enableCache(
	"db",
	"mysql://[username]:[password]@[server]/[database]"
);
*/
$photos_url = $f->urls_getUserPhotos('28973605@N00');
$photos = $f->people_getPublicPhotos('28973605@N00', NULL, NULL, 11);
$sets = $f->photosets_getList('28973605@N00');
?>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="./css/reset-min.css" type="text/css" media="screen" /> 
<link rel="stylesheet" href="./css/style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="./css/jquery.lightbox-0.5.css" type="text/css" media="screen" />
<title>上禾友</title>
<script type="text/javascript" src="./js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="./js/jquery.lightbox-0.5.min.js"></script>
<script type="text/javascript">
(function() {
	$(document).ready(function() {
		$('#gallery a').lightBox({fixedNavigation:true});
		$('.setBox a.more').click(function() {
			alert($(this).attr('set_id'));
			return false;
开发者ID:jimmytp,项目名称:PhotoCat,代码行数:31,代码来源:index.bak.php

示例9: showFlickrPhotos

function showFlickrPhotos($target)
{
    global $blogURL, $pluginURL, $configVal;
    requireComponent('Textcube.Function.misc');
    require_once "lib/phpFlickr.php";
    $data = misc::fetchConfigVal($configVal);
    $flickruserid = isset($data['flickruserid']) ? $data['flickruserid'] : "";
    $flickr_api_key = "d1038f051000214af2bf694014ca8f98";
    //It's key for plugin. It does not change.
    $f = new phpFlickr($flickr_api_key);
    ob_start();
    ?>
	<script type="text/javascript">
	//<![CDDA[
		function actionFlickr(flag){
			var person = document.getElementById("person").value;
			var photoSets = (document.getElementById("photoSets")==undefined) ? "" : document.getElementById("photoSets").value;
			var length = 16;
			var searchKey = document.getElementById("searchKey").value;
			var srcTarget = document.getElementById("flickrview");

			switch(flag) {
				case "search":
					var flickrQueryString = "?person=" + person + "&photoSets=" + photoSets + "&length=" + length + "&search=" + encodeURIComponent(searchKey) + "&page=1";
					srcTarget.src = "<?php 
    echo $blogURL;
    ?>
/plugin/flickrPhotos" + flickrQueryString;
				break;
				case "allview":
					var flickrQueryString = "?person=" + person + "&length=" + length + "&page=1";
					srcTarget.src = "<?php 
    echo $blogURL;
    ?>
/plugin/flickrPhotos" + flickrQueryString;
				break;
				case "refresh":
				default:
					parent.frames['flickrview'].location.reload();
				break;
			}
		}
	//]]>
	</script>
	<div style="margin-top:10px;clear:both;"><strong>&bull; Flickr Photos</strong></div>
	<?php 
    if (!empty($flickruserid)) {
        ?>
		<div id="photosToyHeader" style="margin-top:15px;background-color:#eee;">
		<?php 
        $userInfo = $f->people_getInfo($flickruserid);
        echo '&nbsp;Hello!&nbsp;<strong style="color: #36f;">', $userInfo['username'], '</strong>';
        $photosUrl = $userInfo['photosurl'];
        ?>
		</div>
		<?php 
    }
    ?>
	
	<div style="margin-top:5px;background-color:#fff;"><iframe name="flickrview" id="flickrview" src="<?php 
    echo $blogURL;
    ?>
/plugin/flickrPhotos" scrolling="no" style="width:100%;height:200px;margin:0;padding:0;border:0;"></iframe></div>
	<div id="photosToolbar" style="background-color:#eee;white-space:nowrap;padding:4px;overflow:hidden;">
	<?php 
    if (!empty($flickruserid)) {
        $mySets = $f->photosets_getList($flickruserid);
        echo 'Flickr Photosets&nbsp;<select id="photoSets" name="photoSets" size="1">';
        foreach ((array) $mySets['photoset'] as $row) {
            echo '<option label="', $row['title'], '" value="', $row['id'], '">', $row['title'], '(', $row['photos'], ')</option>';
        }
        echo '</select>&nbsp;&nbsp;';
    }
    ?>
	Search&nbsp;<select name="person" id="person" value="1"><option label="My" value="my">My</option><option label="All" value="all">All</option></select>&nbsp;<input type="text" name="searchKey" id="searchKey" value="" maxlength="255" /><br /><br />
	<img src="<?php 
    echo $pluginURL;
    ?>
/images/refresh.gif" width="82" height="16" border="0" alt="" style="cursor:pointer;" onclick="actionFlickr('refresh');return false;" />&nbsp;<img src="<?php 
    echo $pluginURL;
    ?>
/images/search.gif" width="82" height="16" border="0" alt="" style="cursor:pointer;" onclick="actionFlickr('search');return false;" />&nbsp;<img src="<?php 
    echo $pluginURL;
    ?>
/images/allview.gif" width="82" height="16" border="0" alt="" style="cursor:pointer;" onclick="actionFlickr('allview');return false;" />
	</div>
	<?php 
    $script = ob_get_contents();
    ob_end_clean();
    return $target . $script;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:91,代码来源:index.php

示例10: elseif

            echo $photo['id'];
            ?>
" style="margin: 0px; margin-top: 3px; margin-right: 10px; width: 300px" value="<?php 
            echo $description;
            ?>
" />
				</li>
			<?php 
        }
    }
} elseif ($_POST['method'] == "getPhotosets") {
    $nsid = $f->people_findByUsername($_POST['username']);
    if ($f->getErrorCode()) {
        echo "Username \"" . $_POST['username'] . "\" not found on Flickr.";
    } else {
        $photosets = $f->photosets_getList($nsid);
        if (!isset($_POST['photoset_id'])) {
            $_POST['photoset_id'] = 0;
        }
        if (count($photosets['photoset'])) {
            echo '<h2>Photosets of ' . $_POST['username'] . "</h2>";
            echo '<input type="hidden" id="photoset_count" value="' . count($photosets['photoset']) . '">';
            echo '<input type="hidden" id="photoset_owner" value="' . $nsid . '">';
            echo "<table cellpadding='3' style='border: none; width: 100%'>\n<tr>";
            foreach ($photosets['photoset'] as $key => $photoset) {
                ?>
				<td style="vertical-align: top; text-align: center; width: 33%">
					<a target="_blank" href="http://flickr.com/photos/<?php 
                echo $nsid;
                ?>
/sets/<?php 
开发者ID:bscofield,项目名称:movielist,代码行数:31,代码来源:flickr.php


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