You are here

function disqus_user_view in Disqus 7

Implements hook_user_view().

File

./disqus.module, line 453
The Disqus Drupal module.

Code

function disqus_user_view($account, $view_mode, $langcode) {
  if (isset($account->disqus) && $view_mode == 'full') {

    // Inject Disqus into the user object.
    switch (variable_get('disqus_location', 'content_area')) {
      case 'content_area':
        $account->content['disqus'] = array(
          '#type' => 'disqus',
          '#disqus' => $account->disqus,
          '#weight' => variable_get('disqus_weight', 50),
          '#access' => user_access('view disqus comments'),
        );
        break;
    }
  }
}