You are here

function _guestbook_user_profile_link in Guestbook 5

Same name and namespace in other branches
  1. 5.2 guestbook.module \_guestbook_user_profile_link()
  2. 6.2 guestbook.module \_guestbook_user_profile_link()
  3. 6 guestbook.module \_guestbook_user_profile_link()
  4. 7.2 guestbook.module \_guestbook_user_profile_link()

Return a link to $uid's profile if context allows it.

1 call to _guestbook_user_profile_link()
theme_guestbook in ./guestbook.module
Render a guestbook.

File

./guestbook.module, line 839

Code

function _guestbook_user_profile_link($uid) {
  global $user;
  $guestbook_mode = variable_get('guestbook_mode', GUESTBOOK_SITE_GUESTBOOK | GUESTBOOK_USER_GUESTBOOKS);
  $output = '';
  if ($guestbook_mode & GUESTBOOK_USER_GUESTBOOKS && user_access('access user profiles') && $uid != $user->uid) {
    $guestbook_user = user_load(array(
      'uid' => $uid,
      'status' => 1,
    ));
    if ($guestbook_user->uid && $guestbook_user->guestbook_status == 0) {
      $namelink = l($guestbook_user->name, "user/{$uid}", array(
        'title' => t('View user profile.'),
      ));
      $output .= '<div class="submitted">' . t("Visit !username's profile", array(
        '!username' => $namelink,
      )) . '</div>';
    }
  }
  return $output;
}