本文整理汇总了PHP中phpFlickr::getErrorCode方法的典型用法代码示例。如果您正苦于以下问题:PHP phpFlickr::getErrorCode方法的具体用法?PHP phpFlickr::getErrorCode怎么用?PHP phpFlickr::getErrorCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpFlickr
的用法示例。
在下文中一共展示了phpFlickr::getErrorCode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Flickr
margin-top: 10px; border-top: 1px solid #000;">
<div style="margin-bottom: 10px; padding: 5px;">
<h2>Enter links to photo pages on Flickr (one per line)</h2>
Example: http://www.flickr.com/photos/bees/61752182/
<textarea name="bulkLoader" id="bulkLoader" rows="5" cols="50"></textarea>
<input type="button" value="Go" onclick="return checkPhotos()" />
</div>
<ul id="bulkList">
<?php
if (isset($module->details['photos'])) {
require_once "lib/phpFlickr/phpFlickr.php";
$f = new phpFlickr("91463f56021a88799ecbf0eb105a08fd ", NULL, false);
foreach (split(",", $module->details['photos']) as $photoID) {
$photo = $f->photos_getInfo($photoID);
if ($f->getErrorCode()) {
continue;
} else {
?>
<li><input type="checkbox" name="modules[id<?php
echo $module->lens_module_id;
?>
][details][photos][]" value="<?php
echo $photo['id'];
?>
" checked="checked" />
<img src="http://static.flickr.com/<?php
echo $photo['server'] . "/" . $photo['id'] . "_" . $photo['secret'];
?>
_s.jpg" align="middle" style="border:1px solid black; padding:1px; margin-right: 10px">
<?php
示例2: phpFlickr
/* 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
*/
//f1a96744921d43a0
require_once "/phpFlickr.php";
$f->setProxy("localhost", "8080");
$f = new phpFlickr("\nbf5d0953f69b3386edc3760d784955f5", "16d906ea4207bafc");
//var_dump($f);
$f->getErrorCode();
$f->getErrorMsg();
$recent = $f->photos_getRecent();
var_dump($recent);
foreach ((array) $recent['photo'] as $photo) {
$owner = $f->people_getInfo($photo['owner']);
echo "<a href='http://www.flickr.com/photos/" . $photo['owner'] . "/" . $photo['id'] . "/'>";
echo $photo['title'];
echo "</a> Owner: ";
echo "<a href='http://www.flickr.com/people/" . $photo['owner'] . "/'>";
echo $owner['username'];
echo "</a><br>";
}
示例3: fjgwpp_createGallery
//.........这里部分代码省略.........
}
if ($action === 'tag') {
if (!isset($tags) || strlen($tags) == 0) {
return fjgwpp_formatError(__('You must specify the tags using the "tags" attribute', 'fjgwpp'));
}
if ($tags_mode !== 'any' && $tags_mode !== 'all') {
return fjgwpp_formatError(__('You must specify a valid tags_mode: "any" or "all"', 'fjgwpp'));
}
}
if ($action === 'grp') {
if (!isset($id) || strlen($id) == 0) {
return fjgwpp_formatError(__('You must specify the id of the group, using the "id" attribute', 'fjgwpp'));
}
}
if ($pagination !== 'none' && $pagination !== 'prevnext' && $pagination !== 'numbers') {
return fjgwpp_formatError(__('The pagination attribute can be only "none", "prevnext" or "numbers".', 'fjgwpp'));
}
if ($last_row !== 'hide' && $last_row !== 'justify' && $last_row !== 'nojustify') {
return fjgwpp_formatError(__('The last_row attribute can be only "hide", "justify" or "nojustify".', 'fjgwpp'));
}
if ($lightbox !== 'none' && $lightbox !== 'colorbox' && $lightbox !== 'swipebox') {
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());
}
示例4: flickrps_createGallery
//.........这里部分代码省略.........
}
if ($action === 'tag') {
if (!isset($tags) || strlen($tags) == 0) {
return flickrps_formatError(__('You must specify the tags using the "tags" attribute', 'flickr-photostream'));
}
if ($tags_mode !== 'any' && $tags_mode !== 'all') {
return flickrps_formatError(__('You must specify a valid tags_mode: "any" or "all"', 'flickr-photostream'));
}
}
if ($action === 'grp') {
if (!isset($id) || strlen($id) == 0) {
return flickrps_formatError(__('You must specify the id of the group, using the "id" attribute', 'flickr-photostream'));
}
}
if ($pagination !== 'none' && $pagination !== 'prevnext' && $pagination !== 'numbers') {
return flickrps_formatError(__('The pagination attribute can be only "none", "prevnext" or "numbers".', 'flickr-photostream'));
}
if ($last_row !== 'hide' && $last_row !== 'justify' && $last_row !== 'nojustify') {
return flickrps_formatError(__('The last_row attribute can be only "hide", "justify" or "nojustify".', 'flickr-photostream'));
}
if ($lightbox !== 'none' && $lightbox !== 'colorbox' && $lightbox !== 'swipebox') {
return flickrps_formatError(__('The lightbox attribute can be only "none", "colorbox" or "swipebox".', 'flickr-photostream'));
}
//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, 1, $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 flickrps_formatFlickrAPIError($f->getErrorMsg());
}
$gallery_info = $f->urls_lookupGallery($photos_url[$user_id] . 'galleries/' . $id);
if ($f->getErrorCode() != NULL) {
return flickrps_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 flickrps_formatFlickrAPIError($f->getErrorMsg());
}
示例5: flickrsync_vardump
}
function flickrsync_vardump($var)
{
ob_start();
var_dump($var);
flickrsync_log_mesmo(ob_get_clean());
}
flickrsync_log('iniciando');
$f = new phpFlickr(FLICKR_API_KEY, FLICKR_API_SECRET);
flickrsync_log('instanciado');
$f->setToken(FLICKR_API_AUTH_TOKEN);
flickrsync_log('setado token');
$f->auth();
flickrsync_log('autenticado');
//change this to the permissions you will need
// $f->auth("read");
//echo "Copy this token into your code: " . $_SESSION['phpFlickr_auth_token'];
echo 'listanddo flickr';
//Parameterless searches have been disabled. Please use flickr.photos.getRecent instead.
$photos = $f->photos_search(array('user_id' => FLICKR_USER_ID));
//$photos = $this->phpFlickr->photos_getRecent();
if (false === $photos) {
print_r($f->getErrorCode());
echo "\n";
print_r($f->getErrorMsg());
echo "\n";
}
var_dump($photos);
print_r($photos);
echo ob_get_clean();
exit;