You are here

function sharedblocks_fetch_block in Shared Blocks 7

Same name and namespace in other branches
  1. 6 sharedblocks.module \sharedblocks_fetch_block()

Fetch block contents from a published site.

Parameters

$url: The URL to the published block, for example: http://pubtest.lulladev.com/sharedblocks/comment/0

Return value

Returns block data from the published site, or FALSE if block was invalid.

2 calls to sharedblocks_fetch_block()
sharedblocks_cron in ./sharedblocks.module
Implements hook_cron().
sharedblocks_subscribe_form_submit in ./sharedblocks.module
Submit callback for subscription block add/edit form.

File

./sharedblocks.module, line 402

Code

function sharedblocks_fetch_block($url) {
  $response = drupal_http_request($url);
  if (isset($response->error)) {
    $block_data = FALSE;
  }
  else {

    // Block exists: pull its information into an array.
    $block_data = drupal_json_decode($response->data);
  }
  return $block_data;
}