You are here

function _vkxp_post_to_wall in VK CrossPoster 6.2

Same name and namespace in other branches
  1. 6.3 vkxp.module \_vkxp_post_to_wall()
  2. 6 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_nodeapi in ./vkxp.module
Implementation of hook_nodeapi().

File

./vkxp.module, line 349

Code

function _vkxp_post_to_wall($message, $images, $url, $node) {
  $params = array();
  $params['from_group'] = variable_get('vkxp_official', 1);
  if (variable_get('vkxp_wall_owner', 'group') == 'group') {
    $params['owner_id'] = '-' . variable_get('vkxp_group_id', '');
  }
  else {
    $params['owner_id'] = variable_get('vkxp_group_id', '');
  }
  $params['message'] = $message;
  $params['attachments'] = $images;
  if (variable_get('vkxp_add_link', 0)) {
    if ($images) {
      $params['attachments'] .= ',' . $url;
    }
    else {
      $params['attachments'] = $url;
    }
  }
  $params['application_id'] = variable_get('vkxp_app_id', '');

  // Add script that will be shown on the first node load.
  $_SESSION['vkxp'][$node->nid] = $params;
}