You are here

function fbconnect_block in Facebook Connect 5

Same name and namespace in other branches
  1. 6 fbconnect.module \fbconnect_block()

Implementation of hook_block().

File

./fbconnect.module, line 570
This module allows site visitors to connect and register with facebook account

Code

function fbconnect_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks[0]['info'] = t('Fbconnect friend list');
      $blocks[0]['cache'] = BLOCK_NO_CACHE;
      return $blocks;
    case 'view':
      global $user;
      $fbuid = fbconnect_get_fbuid();
      if ($user->uid && $fbuid) {
        $query = 'SELECT uid FROM {fbconnect_users} WHERE uid = %d AND fbuid = %d';
        if ($res = db_result(db_query($query, $user->uid, $fbuid))) {
          $blocks['content'] = fbconnect_block_render($user);
        }
      }
      return $blocks;
  }
}