You are here

function realname_comment in Real Name 5

Same name and namespace in other branches
  1. 6 realname.module \realname_comment()

Implementation of hook_comment().

File

./realname.module, line 161
The RealName module allows the admin to choose fields from the user profile that will be used to add a "realname" element (method) to a user object. Hook_user is used to automatically add this to any user object that is loaded.

Code

function realname_comment(&$comment, $op) {
  switch ($op) {
    case 'view':
      if (!$comment->homepage) {
        $account = user_load(array(
          'uid' => $comment->uid,
        ));
        realname_make_name($account);
        $comment->homepage = isset($account->homepage) ? $account->homepage : NULL;
      }
      break;
  }
  return;
}