本文整理汇总了PHP中phpFlickr::urls_lookupUser方法的典型用法代码示例。如果您正苦于以下问题:PHP phpFlickr::urls_lookupUser方法的具体用法?PHP phpFlickr::urls_lookupUser怎么用?PHP phpFlickr::urls_lookupUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpFlickr
的用法示例。
在下文中一共展示了phpFlickr::urls_lookupUser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
function save_settings()
{
global $wpdb;
check_admin_referer('flickr-gallery');
$options = explode(',', $_POST['page_options']);
$out = array();
include_once dirname(__FILE__) . '/phpFlickr.php';
$phpFlickr = new phpFlickr($_POST['fg-API-key'], empty($_POST['fg-secret']) ? null : $_POST['fg-secret']);
switch ($_POST['fg-user_id-type']) {
case 'name':
$user = $phpFlickr->people_findByUsername($_POST['fg-user_id']);
$_POST['fg-user_id'] = $user['id'];
break;
case 'email':
$user = $phpFlickr->people_findByEmail($_POST['fg-user_id']);
$_POST['fg-user_id'] = $user['id'];
break;
case 'url':
$user = $phpFlickr->urls_lookupUser($_POST['fg-user_id']);
$_POST['fg-user_id'] = $user['id'];
break;
}
if ($_POST['fg-db-cache'] == 1) {
if (isset($wpdb->charset) && !empty($wpdb->charset)) {
$charset = ' DEFAULT CHARSET=' . $wpdb->charset;
} elseif (defined(DB_CHARSET) && DB_CHARSET != '') {
$charset = ' DEFAULT CHARSET=' . DB_CHARSET;
} else {
$charset = '';
}
$query = '
CREATE TABLE IF NOT EXISTS `' . $wpdb->prefix . 'phpflickr_cache` (
`request` CHAR( 35 ) NOT NULL ,
`response` MEDIUMTEXT NOT NULL ,
`expiration` DATETIME NOT NULL ,
PRIMARY KEY ( `request` )
) ' . $charset . '
';
$wpdb->query($query);
}
/*
if ( empty($_POST['fg-token']) && !empty($_POST['fg-frob']) ) {
$token = $phpFlickr->auth_getToken($_POST['fg-frob']);
$_POST['fg-token'] = $token['token'];
}
*/
foreach ($options as $o) {
if (get_option($o) === false) {
add_option($o, $_POST[$o], null, no);
} else {
update_option($o, $_POST[$o]);
}
if (is_array($_POST[$o])) {
$out[] = '"' . $o . '":["' . implode('","', $_POST[$o]) . '"]';
} else {
$out[] = '"' . $o . '":"' . addslashes($_POST[$o]) . '"';
}
}
echo '{' . implode(', ', $out) . '}';
exit;
}