You are here

function _facebook_wall_page_likes in Facebook Wall 7

Admin configure form for Facebook Page Likes.

1 call to _facebook_wall_page_likes()
facebook_wall_block_view in ./facebook_wall.module
Implements hook_block_view().

File

./facebook_wall.module, line 348
Get the current facebook wall posts of the given user or page.

Code

function _facebook_wall_page_likes() {

  // FB Graph API CURL calls request.
  $user_likes = _facebook_wall_error_msg(facebook_wall_build_likes_url());
  if ($user_likes != FALSE) {

    // Gettings people likes list.
    for ($i = 0; $i < count($user_likes->data); $i++) {
      $rows[] = array(
        l($user_likes->data[$i]->name, $user_likes->data[$i]->link) . '<img src=' . $user_likes->data[$i]->picture->data->url . '" width="50" />',
      );
    }
    $header = array(
      'key' => array(
        'data' => t('Username'),
        'field' => 'role',
        'sort' => 'desc',
      ),
      'value' => array(
        'data' => t('Picture'),
      ),
    );
    $variables = array(
      'header' => $header,
      'rows' => $rows,
      'attributes' => array(),
      'sticky' => FALSE,
      'caption' => '',
      'colgroups' => array(),
      'empty' => t('No records available!'),
    );
    return theme('table', $variables);
  }
}