本文整理汇总了PHP中phpFlickr::people_getPublicPhotos方法的典型用法代码示例。如果您正苦于以下问题:PHP phpFlickr::people_getPublicPhotos方法的具体用法?PHP phpFlickr::people_getPublicPhotos怎么用?PHP phpFlickr::people_getPublicPhotos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpFlickr
的用法示例。
在下文中一共展示了phpFlickr::people_getPublicPhotos方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_images
/**
* get images from flickr
* @author - Henry Addo
* @access - public
* @return - Array of images
*/
public function get_images()
{
$username = "";
$photo_urls = "http://www.flickr.com/photos/eyedol/";
$tags = "tedglobal2007";
// create instance of phpFlickr class
$flickr = new phpFlickr('');
//enable caching
$flickr->enableCache("");
//authenticate
//$flickr->auth();
//get token
//$token = $token['user']['nsid'];
// get NSID of the username
$nsid = $token['user']['nsid'];
$user = $flickr->people_findByUsername($username);
//get the friendly URL of the the users' photos
$photos_url = $flickr->urls_getUserPhotos($username);
// get 20 images of public images of the user
//$photos = $flickr->photos_search( array( 'tags'=>$tags,
//'per_page'=> 200 ) );
$photos = $flickr->people_getPublicPhotos($username, NULL, 36);
// loop through the photos
foreach ((array) $photos['photo'] as $photo) {
$this->images[] = "<li><a href=\"#\">\n <img alt='{$photo['title']}' title='{$photo['title']}'\n src=\"" . $flickr->buildPhotoURL($photo, 'Square') . "\" \n onclick=\"get_image_id('" . $flickr->buildPhotoURL($photo) . "','{$photo['title']}')\"/></a></li>";
$owner = $flickr->people_getInfo($photo[owner]);
$this->owner = $owner['username'];
}
return $this->images;
}
示例2: flickr_stream
function flickr_stream($username, $api_key)
{
require_once "phpflickr/phpFlickr.php";
$phpFlickrObj = new phpFlickr($api_key);
$phpFlickrObj->enableCache("fs", TEMPLATEPATH . "/cache");
$user = $phpFlickrObj->people_findByUsername($username);
$user_url = $phpFlickrObj->urls_getUserPhotos($user['id']);
$photos = $phpFlickrObj->people_getPublicPhotos($user['id'], NULL, NULL, 9);
foreach ($photos['photos']['photo'] as $photo) {
echo '<a href="' . $user_url . $photo['id'] . '" title="' . $photo['title'] . ' (on Flickr)" target="_blank">';
echo '<img style="width: 64px; height: 64px; margin: 1px; padding: 2px; border: 3px solid #ddd; background: #fff;" class="wp-image" alt="' . $photo['title'] . '" src="' . $phpFlickrObj->buildPhotoURL($photo, "square") . '" />';
echo '</a>';
}
}
示例3: jeg_get_flickr_photo
function jeg_get_flickr_photo($flickrapi, $flickrid, $totalimage)
{
require_once JEG_PLUGIN_DIR . "util/phpFlickr/phpFlickr.php";
$f = new phpFlickr($flickrapi);
$result = $f->people_getPublicPhotos($flickrid, null, null, $totalimage, null);
$photos = array();
if (empty($result)) {
echo $f->getErrorMsg();
} else {
$photosUrl = $f->urls_getUserPhotos($flickrid);
foreach ($result['photos']['photo'] as $photo) {
$photos[] = array('s' => $f->buildPhotoURL($photo, 'square'), 'url' => $photosUrl . $photo['id'], 'title' => $photo['title']);
}
}
return $photos;
}
示例4: phpFlickr
function afsp_flickr_embed($photo)
{
// define outputs
$flickr_gallery = '';
$flickr_nav = '';
$flickr_display = '';
// define access
$api = '238309aa246837711a82e3616d5666b1';
$username = $photo;
require_once get_template_directory() . '/inc/flickr/phpFlickr.php';
$photo_count = 20;
$nav_width = 100 / $photo_count . '%';
$f = new phpFlickr($api);
$user = $f->people_findByUsername($username);
$nsid = $user['nsid'];
$photos = $f->people_getPublicPhotos($nsid, 1, '', $photo_count);
$flickr_gallery .= '<div class="gallery gallery--flickr js-flickity" data-flickity-options=\'{ "wrapAround": true, "pageDots": false, "autoPlay": true }\'>';
foreach ($photos['photos']['photo'] as $photo) {
$src = 'https://farm' . $photo['farm'] . '.staticflickr.com/' . $photo['server'] . '/' . $photo['id'] . '_' . $photo['secret'] . '_c.jpg';
$flickr_gallery .= '<div class="gallery-cell gallery-cell__carousel">';
$flickr_gallery .= '<a target="_blank" href="https://www.flickr.com/photos/' . $nsid . '/' . $photo['id'] . '">';
$flickr_gallery .= '<img src="' . $src . '" />';
$flickr_gallery .= '</a>';
$flickr_gallery .= '</div>';
}
$flickr_gallery .= '</div>';
$flickr_nav .= '<div class="gallery-nav gallery-nav--flickr js-flickity" data-flickity-options=\'{"asNavFor": ".gallery--flickr", "contain": true, "prevNextButtons": false, "pageDots": false}\'>';
foreach ($photos['photos']['photo'] as $photo) {
$src = 'https://farm' . $photo['farm'] . '.staticflickr.com/' . $photo['server'] . '/' . $photo['id'] . '_' . $photo['secret'] . '_c.jpg';
$flickr_nav .= '<div class="gallery-cell" style="width:' . $nav_width . ';">';
$flickr_nav .= '<img src="' . $src . '" />';
$flickr_nav .= '</div>';
}
$flickr_nav .= '</div>';
$flickr_display .= $flickr_gallery;
$flickr_display .= $flickr_nav;
echo $flickr_display;
}
示例5: retornaGaleriaflickr
public function retornaGaleriaflickr()
{
$site = site_dados();
require_once "flickr/phpFlickr.php";
$f = new phpFlickr("KEY", "SECRET");
$person = $f->people_findByUsername($flickr_channel);
// Get the friendly URL of the user's photos
$photos_url = $f->urls_getUserPhotos($person['id']);
// Get the user's first 36 public photos
$photos = $f->people_getPublicPhotos($person['id'], NULL, NULL, 9);
$i = 0;
foreach ((array) $photos['photos']['photo'] as $photo) {
$retorno[$i]['photo'] = $photo;
$retorno[$i]['photos_url'] = $photos_url;
$retorno[$i]['url']['square'] = $f->buildPhotoURL($photo, "square");
$retorno[$i]['url']['thumbnail'] = $f->buildPhotoURL($photo, "thumbnail");
$retorno[$i]['url']['small'] = $f->buildPhotoURL($photo, "small");
$retorno[$i]['url']['medium'] = $f->buildPhotoURL($photo, "medium");
$retorno[$i]['url']['large'] = $f->buildPhotoURL($photo, "large");
$retorno[$i]['url']['original'] = $f->buildPhotoURL($photo, "original");
$i++;
}
return $retorno;
}
示例6: switch
//.........这里部分代码省略.........
// display possible options for sort order
foreach($flickr_goodSortOrders as $value => $description) {
echo '<option value="'.$value.'"';
if($sortOrder == $value) echo(' selected="true"');
echo '>'.$description.'</option>';
}
?>
</select>
</div>
</form>
<?php
// in the second step, we show latest photos (thumbs) for given username
if ($serendipity['POST']['adminAction'] == 'flickr') {
// make use of phpFlikr lib (http://www.phpflickr.com/)
require_once dirname(__FILE__) . '/phpFlickr/phpFlickr.php';
$f = new phpFlickr($this->get_config('api_key'));
$i = 0;
if (!empty($serendipity['POST']['flickr_username'])) {
// Find the NSID of the username inputted via the form
$nsid = $f->people_findByUsername($serendipity['POST']['flickr_username']);
// Get the friendly URL of the user's photos
$photos_url = $f->urls_getUserPhotos($nsid);
echo '<h4 style="margin-bottom: 0; padding-bottom: 0;">Photos of <em>';
echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($serendipity['POST']['flickr_username']) : htmlspecialchars($serendipity['POST']['flickr_username'], ENT_COMPAT, LANG_CHARSET)) . '</em> at ';
echo '<a href="' . $photos_url . '" target="_blank">' . $photos_url . '</a></h4>';
// default page is number one
if (empty($serendipity['POST']['flickr_page']) || !is_numeric($serendipity['POST']['flickr_page'])) {
$serendipity['POST']['flickr_page'] = 1;
}
// make sure page is a number between 1 and 500 (range allowed by flickr API)
$serendipity['POST']['flickr_page'] = min(500, max(1, (int) $serendipity['POST']['flickr_page']));
echo '<h5 style="margin-top: 0; padding-top: 0;">Displaying page ' . (function_exists('serendipity_specialchars') ? serendipity_specialchars($serendipity['POST']['flickr_page']) : htmlspecialchars($serendipity['POST']['flickr_page'], ENT_COMPAT, LANG_CHARSET)) . '</h5>';
// Search is made depending on selected criterias
$searchCriteria = array();
// make sure sort order is non empty AND valid
if (isset($serendipity['POST']['flickr_sort']) && strlen(trim($serendipity['POST']['flickr_sort'])) && array_key_exists($serendipity['POST']['flickr_keywords'], $flickr_goodSortOrders)) {
$searchCriteria['sort'] = function_exists('serendipity_specialchars') ? serendipity_specialchars($serendipity['POST']['flickr_sort']) : htmlspecialchars($serendipity['POST']['flickr_sort'], ENT_COMPAT, LANG_CHARSET);
}
// TODO: clean up tags of unwanted characters (keep only [a-zA-Z0-9_-])
if (isset($serendipity['POST']['flickr_tags']) && strlen(trim($serendipity['POST']['flickr_tags']))) {
$searchCriteria['tags'] = implode(',', explode(' ', function_exists('serendipity_specialchars') ? serendipity_specialchars($serendipity['POST']['flickr_tags']) : htmlspecialchars($serendipity['POST']['flickr_tags'], ENT_COMPAT, LANG_CHARSET)));
}
// TODO: cleanup keywords
if (isset($serendipity['POST']['flickr_keywords']) && strlen(trim($serendipity['POST']['flickr_keywords']))) {
$searchCriteria['text'] = function_exists('serendipity_specialchars') ? serendipity_specialchars($serendipity['POST']['flickr_keywords']) : htmlspecialchars($serendipity['POST']['flickr_keywords'], ENT_COMPAT, LANG_CHARSET);
}
if (count($searchCriteria)) {
// It seems the user wants an advanced search
$searchCriteria['user_id'] = $nsid;
$photos = $f->photos_search($searchCriteria);
} else {
// No extra criteria, get the user's next 12 public photos (+1 to show > next or not !)
$photos = $f->people_getPublicPhotos($nsid, NULL, 13, $serendipity['POST']['flickr_page']);
// Get user's tags (if any)
/*$tags = $f->tags_getListUser($nsid);
if(is_array($tags['tags']['tag'])) {
echo implode(',', $tags['tags']['tag']);
echo "<br />\n";
}*/
}
// Loop through the photos and output the html
foreach ($photos['photo'] as $photo) {
echo '<a title="Add to library" href="javascript:flickr_doImport(\'' . $f->buildPhotoURL($photo, 'Original') . '\');" ';
echo 'onclick="return confirm(\'Import this photo into the media library ?\');">';
echo '<img border="0" alt="' . $photo['title'] . '" src=' . $f->buildPhotoURL($photo, 'Square') . ' />';
echo '</a>';
// break before the 13th photo (if any)
if (++$i == 12) {
break;
}
// If it reaches the sixth photo, insert a line break
if ($i % 6 == 0) {
echo "<br />\n";
}
}
// end foreach
echo "<br />\n";
// navigate through pages of photos
if ($serendipity['POST']['flickr_page'] > 1) {
echo '<a href="javascript:flickr_showPage(' . (int) ($serendipity['POST']['flickr_page'] - 1) . ');">Previous</a>';
}
echo ' ';
if (count($photos['photo']) > 12) {
echo '<a href="javascript:flickr_showPage(' . (int) ($serendipity['POST']['flickr_page'] + 1) . ');">Next</a>';
}
}
// end if
}
// end if
return true;
break;
default:
return false;
break;
}
} else {
return false;
}
}
示例7: phpFlickr
<?php
/* Last updated with phpFlickr 1.3.2
*
* This example file shows you how to call the 100 most recent public
* photos. It parses through them and prints out a link to each of them
* along with the owner's name.
*
* Most of the processing time in this file comes from the 100 calls to
* flickr.people.getInfo. Enabling caching will help a whole lot with
* this as there are many people who post multiple photos at once.
*
* Obviously, you'll want to replace the "<api key>" with one provided
* by Flickr: http://www.flickr.com/services/api/key.gne
*/
require_once "phpFlickr.php";
$f = new phpFlickr("3077891bafd02f95795c02a20be57144");
$recent = $f->people_getPublicPhotos('31446365@N05', null, null, 2);
$photos = array();
if (empty($recent)) {
echo $f->getErrorMsg();
} else {
foreach ($recent['photos']['photo'] as $photo) {
$photos[] = array('s' => $f->buildPhotoURL($photo, 'square'), 'o' => $f->buildPhotoURL($photo, 'original'), 'title' => $photo['title']);
}
}
示例8: forward
} else {
$temp_user = get_loggedin_user();
}
$flickr_username = get_metadata_byname($temp_user->guid, "flickr_username");
if (empty($flickr_username)) {
register_error("No Flickr username set");
echo "<pre>No flickr username set: {$temp_user->guid}";
die;
forward("/");
die;
}
$flickr_user = $f->people_findByUsername($flickr_username->value);
// Get the friendly URL of the user's photos
$photos_url = $f->urls_getUserPhotos($flickr_user["id"]);
if (!empty($flickr_user)) {
$recent = $f->people_getPublicPhotos($flickr_user['id'], NULL, NULL, 5);
} else {
echo "user not found";
die;
}
//echo "<pre>"; var_dump( $recent ); echo "</pre>";
//echo "<pre>"; var_dump( $user ); echo "</pre>";
$body = elgg_view_title("Flickr photos for {$flickr_user['username']}");
$count = 0;
foreach ($recent['photos']['photo'] as $photo) {
$photo_info = $f->photos_getInfo($photo["id"], $photo["secret"]);
$body .= "<div class='tidypics_album_images'>";
$body .= "{$photo_info['title']}<br />Views: {$photo_info['views']}<br />";
$body .= "<a href={$photos_url}{$photo['id']}>";
$body .= "<img border='0' alt='{$photo['title']}' " . "src=" . $f->buildPhotoURL($photo, "Square") . ">";
$body .= "</a>";
示例9: getMyRecent
function getMyRecent($userid = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
{
global $photos;
$f = new phpFlickr("6cb8b950ac1b34c2300dc789c8da52af");
$photos = $f->people_getPublicPhotos($userid, $extras, $per_page, $page);
//print_r($photos);
//return $return;
//print_r($return);
}
示例10: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
$username = esc_attr($instance['username']);
$api_key = esc_attr($instance['api_key']);
$nos = esc_attr($instance['nos']);
echo $before_widget;
include HPATH . "/lib/phpFlickr.php";
if ($title != "") {
echo $before_title . " " . $title . $after_title;
}
if (!$api_key) {
echo '<h4> No API KEY ADDED </h4>';
} else {
$f = new phpFlickr($api_key);
$person = $f->people_findByUsername($username);
$photos_url = $f->urls_getUserPhotos($person['id']);
$photos = $f->people_getPublicPhotos($person['id'], NULL, NULL, 16);
?>
<div class="flickr-pictures clearfix">
<?php
$i = 0;
foreach ((array) $photos['photos']['photo'] as $photo) {
if ($i >= $nos) {
break;
}
$theImageSrc = $f->buildPhotoURL($photo, "thumbnail");
$lb = $f->buildPhotoURL($photo, "large");
echo "<a href='" . $lb . "' class='lightbox' rel='prettyPhoto[pp_gal]' title='{$photo['title']}' ><img src='" . $theImageSrc . "' alt=\"" . $photos_url . $photo["id"] . "\" title='' /></a>";
$i++;
}
?>
</div>
<?php
}
echo $after_widget;
}
示例11: 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;
示例12: elseif
<div class="entry-top">
<a href="' . $urlimgori . '" title="' . $title . '" rel="lightbox">
' . colabs_image('width=280&link=img&return=true&src=' . $urlimg) . '
</a>
</div>';
echo '<h3 class="entry-title"><a href="' . $urlimgori . '" target="_blank">' . $title . '</a></h3>
<p class="entry-likes"><i class="icon-heart "></i> <span>' . $likes . '</span> Loves</p>
';
echo '</div>
</article>';
$piccounter++;
}
}
} elseif (get_post_meta($post->ID, 'meta_style_gallery', true) == 'flickr') {
$f = new phpFlickr(get_option('colabs_api_flickr'), get_option('colabs_secret_flickr'));
$recent = $f->people_getPublicPhotos(get_post_meta($post->ID, 'colabs_username_flickr', true), NULL, NULL, get_post_meta($post->ID, 'colabs_piccount_flickr', true), $paged);
foreach ($recent['photos']['photo'] as $photo) {
$title = $photo['title'];
$urlimg = $f->buildPhotoURL($photo, "small");
$urlimgori = $f->buildPhotoURL($photo, "large");
$info = $f->photos_getInfo($photo['id']);
$date = date(get_option('date_format'), $info['photo']['dateuploaded']);
$view = $info['photo']['views'];
echo '<article class="entry-post">
<div class="innercontainer">
<div class="entry-top">
<a href="' . $urlimgori . '" title="' . $title . '" rel="lightbox">
' . colabs_image('width=280&link=img&return=true&src=' . $urlimg) . '
</a>
</div>
<h3 class="entry-title"><a href="' . $urlimgori . '" target="_blank">' . $title . '</a></h3>
示例13: getFlickrPhotos
function getFlickrPhotos($target)
{
global $blogURL, $pluginURL, $configVal;
requireModel('reader.common');
requireComponent('Textcube.Model.Paging');
requireComponent('Textcube.Function.misc');
$data = misc::fetchConfigVal($configVal);
$flickruserid = isset($data['flickruserid']) ? $data['flickruserid'] : "";
require_once "lib/phpFlickr.php";
$flickr_api_key = "d1038f051000214af2bf694014ca8f98";
//It's key for plugin. It does not change.
$f = new phpFlickr($flickr_api_key);
$listLength = isset($_GET['length']) ? $_GET['length'] : 16;
$searchKey = isset($_GET['search']) && !empty($_GET['search']) ? urldecode($_GET['search']) : "";
$photoSets = isset($_GET['photoSets']) && !empty($_GET['photoSets']) ? $_GET['photoSets'] : "";
$personMode = isset($_GET['person']) ? $_GET['person'] : "my";
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$zoomStyle = "flickr";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="<?php
echo $pluginURL;
?>
/style/default.css" />
</head>
<script type="text/javascript">
//<![CDDA[
function insertPhoto(_link, _src_m, _src_l, _title, _style){
var linkTag_A = '', linkTag_B = '', imgTag = '';
linkTag_A = '<a href="' + _link + '" title="' + _title + '" target="_blank">';
linkTag_B = '</a>';
imgTag = '<img src="' + _src_m + '" border="0" />';
var isWYSIWYG = false;
try{
if(parent.editor.editMode == 'WYSIWYG')
isWYSIWYG = true;
}
catch(e){ }
if(isWYSIWYG) {
parent.editor.command('Raw', (linkTag_A + imgTag), linkTag_B);
}else{
parent.insertTag(parent.editor.textarea, (linkTag_A + imgTag), linkTag_B);
}
}
//]]>
</script>
<body style="margin:0;padding:0;border:none;background-color:#ffffff;">
<div id="photosBody" style="height:200px;width:100%;overflow-x:hidden;overflow-y:auto;background-color:#fff;">
<?php
if ($personMode == "my" && !empty($flickruserid) && empty($searchKey)) {
if (!empty($photoSets)) {
$photoset = $f->photosets_getPhotos($photoSets, "owner_name", NULL, $listLength, $page);
$photos['photos'] = $photoset['photoset'];
} else {
$photos = $f->people_getPublicPhotos($flickruserid, NULL, NULL, $listLength, $page);
}
foreach ($photos['photos']['photo'] as $photo) {
$_output = getFlickrPhotosInfo($photo, $zoomStyle, $flickruserid);
echo $_output;
}
} else {
if (($personMode == "my" || $personMode == "all") && !empty($searchKey)) {
if ($personMode == "my" && !empty($flickruserid)) {
$searchArray = array("user_id" => $flickruserid, "text" => $searchKey, "sort" => "date-posted-desc", "per_page" => $listLength, "page" => $page);
} else {
$searchArray = array("text" => $searchKey, "sort" => "date-posted-desc", "per_page" => $listLength, "page" => $page);
}
$photos['photos'] = $f->photos_search($searchArray);
if ($photos['photos']['total'] > 0) {
foreach ($photos['photos']['photo'] as $photo) {
$_output = getFlickrPhotosInfo($photo, $zoomStyle);
echo $_output;
}
} else {
echo '<p style="margin-top:30px; text-align:center; font-size:9pt;">Flickr did not find any photos. Please input title, description or tags.</p>';
}
} else {
if ($personMode == "all" && empty($searchKey)) {
$photos['photos'] = $f->photos_getRecent(NULL, $listLength, $page);
foreach ($photos['photos']['photo'] as $photo) {
$_output = getFlickrPhotosInfo($photo, $zoomStyle);
echo $_output;
}
} else {
echo '<p style="margin-top:30px; text-align:center; font-size:9pt;">Flickr did not find any photos.', !$nickName ? '(Input title, description or tags.)' : '', '</p>';
}
}
}
$pageLink = '?person=' . $personMode . '&photoSets=' . $photoSets . '&length=' . $listLength . '&search=' . rawurlencode($searchKey);
//$photos['total'] = $photos['total'] > 996 ? 996 : $photos['total'];
$paging = HC_getFetchWithPaging($photos['photos']['total'], $page, $listLength, "{$blogURL}/plugin/flickrPhotos", $pageLink . "&page=");
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##] class="num">[##_paging_rep_link_num_##]</a>';
$prev_page = isset($paging['prev']) ? " href=\"{$pageLink}&page={$paging['prev']}\" " : '';
$next_page = isset($paging['next']) ? " href=\"{$pageLink}&page={$paging['next']}\" " : '';
$no_more_prev = isset($paging['prev']) ? '' : 'no-more-prev';
//.........这里部分代码省略.........
示例14: fjgwpp_createGallery
//.........这里部分代码省略.........
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";
//thumbnail (longest side:100)
} else {
if ($images_height <= 180) {
$imgSize = "small";
//small (longest side:240)
} else {
//if <= 240
$imgSize = "small_320";
//small (longest side:320)
}
}
$ris .= '<!-- Flickr Justified Gallery Wordpress Plugin by Miro Mannino -->' . "\n" . '<div id="' . $flickrGalID . '" class="justified-gallery" >';
$r = 0;
$use_large_thumbnails = true;
示例15: phpFlickr
*/
$todo = $_REQUEST['todo'];
/************************************************************************************************/
/**
* Show page with photos
*/
if ($todo == "show") {
$page = $_REQUEST['page'] == "" ? 1 : $_REQUEST['page'];
$viewsize = $_REQUEST['viewsize'] == "" ? "thumbnail" : $_REQUEST['viewsize'];
require_once "phpFlickr.php";
$f = new phpFlickr($api_key);
$person = $f->people_findByUsername($username);
// Get the friendly URL of the user's photos
$photos_url = $f->urls_getUserPhotos($person['id']);
// Get person's public photos
$photos = $f->people_getPublicPhotos($person['id'], NULL, NULL, 18, $page);
// Loop through the photos and output the html
//var_dump($f);
echo '<center id="paging">';
$paging = 1;
while ($paging < $photos['photos']['pages'] + 1) {
if ($paging == $page) {
echo '<a class="active" href="javascript:getPage(' . $paging . ');">' . $paging . '</a>';
} else {
echo '<a class="link" href="javascript:getPage(' . $paging . ');">' . $paging . '</a>';
}
$paging++;
}
echo '</center>';
echo '<table width="100%" cellspacing="0" cellpadding="5" border="0">';
echo '<tr>';