You are here

function fb_app_block in Drupal for Facebook 5

File

./fb_app.module, line 334
Defines a custom node type that stores a facebook application configuration.

Code

function fb_app_block($op = 'list', $delta = 0, $edit = array()) {
  if ($op == 'list') {
    for ($i = 0; $i < _fb_app_num_blocks(); $i++) {
      $items[$i]['info'] = t('Facebook Application block !num', array(
        '!num' => $i + 1,
      ));
    }
    return $items;
  }
  else {
    if ($op == 'view') {
      global $fb_app;
      $result = db_query("SELECT * FROM {fb_app_block} WHERE nid=%d AND delta='%s'", $fb_app->nid, $delta);
      $data = db_fetch_object($result);
      if ($data) {
        $output = check_markup($data->body, $data->format, FALSE);
        return array(
          'content' => $output,
        );
      }
    }
  }
}