function _vkxp_get_upload_server in VK CrossPoster 7
Same name and namespace in other branches
- 6.3 vkxp.module \_vkxp_get_upload_server()
- 6 vkxp.module \_vkxp_get_upload_server()
- 6.2 vkxp.module \_vkxp_get_upload_server()
- 7.2 vkxp.module \_vkxp_get_upload_server()
Makes http query to api server to get upload uri.
Return value
string|bool Upload url on success or FALSE on failure.
1 call to _vkxp_get_upload_server()
- _vkxp_process_node in ./
vkxp.module - Process node and send it to vk.com if needed.
File
- ./
vkxp.module, line 332
Code
function _vkxp_get_upload_server() {
$params = array();
if (variable_get('vkxp_wall_owner', 'group') == 'group') {
$params['gid'] = variable_get('vkxp_group_id', '');
}
else {
$params['uid'] = variable_get('vkxp_group_id', '');
}
$params['access_token'] = variable_get('vkxp_access_token', '');
$result = vkxp_query('photos.getWallUploadServer', $params);
if ($result['response']['upload_url']) {
return $result['response']['upload_url'];
}
elseif ($result['error']) {
_vkxp_watchdog(array(
'text' => t('Unable to recieve upload server. Error: !error', array(
'!error' => $result['error']['error_msg'],
)),
'severity' => 'error',
));
}
return FALSE;
}