You are here

function _vkxp_post_to_wall in VK CrossPoster 6.3

Same name and namespace in other branches
  1. 6 vkxp.module \_vkxp_post_to_wall()
  2. 6.2 vkxp.module \_vkxp_post_to_wall()
  3. 7.2 vkxp.module \_vkxp_post_to_wall()
  4. 7 vkxp.module \_vkxp_post_to_wall()

Post node message with uploaded images to wall.

Parameters

$message: Text to post.

$images: String with photo IDs to post.

$url: Absolute link to posted node.

Return value

array Server response.

1 call to _vkxp_post_to_wall()
_vkxp_process_node in ./vkxp.module
Process node and send it to VK if needed.

File

./vkxp.module, line 372

Code

function _vkxp_post_to_wall($message, $images, $url) {
  $params = array();
  $params['from_group'] = variable_get('vkxp_official', TRUE);
  if (variable_get('vkxp_wall_owner', 'group') == 'group') {
    $params['owner_id'] = '-' . variable_get('vkxp_owner_id', '');
  }
  else {
    $params['owner_id'] = variable_get('vkxp_owner_id', '');
  }
  $params['message'] = $message;
  $params['attachments'] = $images;
  if (variable_get('vkxp_add_link', FALSE)) {
    $params['attachments'] .= !empty($images) ? ',' . $url : $url;
  }
  $params['access_token'] = variable_get('vkxp_access_token', '');

  // Send query to VK and return result.
  return vkxp_query('wall.post', $params);
}