You are here

function facebook_wall_display_posts in Facebook Wall 7

Facebook wall post content fetcher.

1 string reference to 'facebook_wall_display_posts'
facebook_wall_menu in ./facebook_wall.module
Implements hook_menu().

File

./facebook_wall.pages.inc, line 11
Extra pages for the Facebook Wall module.

Code

function facebook_wall_display_posts() {
  $api_url = facebook_wall_build_feed_url();

  // HTML Contains FB current wall post.
  $html = _facebook_wall_theme_html_content($api_url);
  if (facebook_wall_access_token() == '') {
    return;
  }
  elseif ($html != FALSE) {
    $form['facebook_wall'] = array(
      '#markup' => $html,
    );
    if (variable_get('facebook_wall_older_post_button') == 1) {

      // This will be append by wth an updated wall post value.
      $form['div_append_next_wall_post'] = array(
        '#markup' => '',
        '#prefix' => '<div style="float:left; width: ' . variable_get('facebook_wall_width_size') . 'px;"  id="div_append_next_wall_post">',
        '#suffix' => '</div>',
      );
      $form['facebook_wall_next_wall_post'] = array(
        '#type' => 'button',
        '#value' => t('Get older Posts'),
        '#ajax' => array(
          'callback' => '_facebook_wall_ajax_next_wall_post',
          'wrapper' => 'div_append_next_wall_post',
          'method' => 'append',
        ),
        '#prefix' => '<div style="clear:both; margin-top:10px;">',
        '#suffix' => '</div>',
      );
    }
    return $form;
  }
  else {
    $message = t("Facebook wall post is not available ! This may caused due to user's content privacy policy.");
    watchdog('facebook wall', $message, array(), WATCHDOG_DEBUG);
    if (variable_get('facebook_wall_message_show', 1)) {
      drupal_set_message($message, 'warning');
    }
  }
}