You are here

function photos_theme_photos_comment_count in Album Photos 7.3

Same name and namespace in other branches
  1. 8.5 photos.module \photos_theme_photos_comment_count()
  2. 8.4 photos.module \photos_theme_photos_comment_count()

Theme photos comment count.

1 string reference to 'photos_theme_photos_comment_count'
photos_theme in ./photos.module
Implememtns hook_theme().

File

./photos.module, line 2175
Implementation of photos.module.

Code

function photos_theme_photos_comment_count($variables) {
  $url = $variables['url'];
  $comcount = $variables['comcount'];
  if (empty($comcount)) {
    if (!user_access('post comments')) {
      $comment = t('<a href="@login">Login</a> to post comments', array(
        '@login' => url('user/login', array(
          'query' => array(
            drupal_get_destination(),
          ),
        )),
      ));
    }
    else {
      $comment = '<a href="' . (isset($url) ? $url . '#comment-form' : '#comment-form') . '">' . t('Add new comment') . '</a>';
    }
  }
  elseif ($comcount > 1) {
    $comment = '<a href="' . (isset($url) ? $url . '#comments' : '#comments') . '">' . t('!con comments', array(
      '!con' => $comcount,
    )) . '</a>';
  }
  else {
    $comment = '<a href="' . (isset($url) ? $url . '#comments' : '#comments') . '">' . t('!con comment', array(
      '!con' => $comcount,
    )) . '</a>';
  }
  return $comment;
}