You are here

function fb_feed_view in Drupal for Facebook 5.2

File

./fb_feed.module, line 488
Helpers for Facebook feeds (http://wiki.developers.facebook.com/index.php/New_Design_Feed_Wall)

Code

function fb_feed_view($node, $teaser = FALSE, $page = FALSE) {
  $node = node_prepare($node, $teaser);
  $fb_app = fb_get_app(array(
    'nid' => $node->fb_app_nid,
  ));
  if (!$node->bundle_id) {
    drupal_set_message(t('The template shown must be registered with Facebook before it can be used.'), 'error');
  }
  $items = array(
    t('Application') => l($fb_app->title, 'node/' . $fb_app->nid),
    t('Template Bundle ID') => $node->bundle_id ? $node->bundle_id : '<em>' . t('Template bundle not registered') . '</em>',
  );
  $items[t('One-line templates')] = implode("<br />\n", $node->fb_feed_data['line']);
  foreach ($node->fb_feed_data['short'] as $key => $template) {
    if (is_array($template)) {
      $items[t('Short template %num', array(
        '%num' => $key + 1,
      ))] = implode("<br />\n", $node->fb_feed_data['short'][$key]);
    }
  }
  if ($node->fb_feed_data['full']['template_title']) {
    $items[t('Full template')] = implode("<br />\n", $node->fb_feed_data['full']);
  }
  $node->content['fb_feed'] = array(
    '#value' => theme('dl', $items),
  );
  return $node;
}