You are here

function fbconnect_login_comment_view in Facebook Connect 8.2

Same name and namespace in other branches
  1. 7.2 fbconnect_login/fbconnect_login.module \fbconnect_login_comment_view()

Implements hook_comment_view().

File

fbconnect_login/fbconnect_login.module, line 135
Login functionality for Facebook Connect module

Code

function fbconnect_login_comment_view($comment) {
  if (theme_get_setting('toggle_comment_user_picture')) {

    // If this is a comment preview, we need to manually add $comment->picture.
    if (!empty($comment->uid)) {
      $query = db_select('users', 'u');
      $query
        ->fields('u', array(
        'picture',
      ));
      $query
        ->condition('uid', $comment->uid);
      $comment->picture = $query
        ->execute()
        ->fetchField();
    }
    if ($preset = variable_get('fbconnect_pic_size_comments', '')) {
      $comment->fbconnect_picture_preset = $preset;
    }
  }
}