You are here

function theme_guestbook_entry_comment in Guestbook 7.2

Same name and namespace in other branches
  1. 5.2 guestbook.module \theme_guestbook_entry_comment()
  2. 5 guestbook.module \theme_guestbook_entry_comment()
  3. 6.2 guestbook.module \theme_guestbook_entry_comment()
  4. 6 guestbook.module \theme_guestbook_entry_comment()
1 theme call to theme_guestbook_entry_comment()
theme_guestbook_entry in ./guestbook.module

File

./guestbook.module, line 1035

Code

function theme_guestbook_entry_comment($variables) {
  $uid = $variables['uid'];
  $entry = $variables['entry'];
  $comment_entry = $variables['comment_entry'];
  $display = (array) variable_get('guestbook_display', array(
    'date',
    'email',
    'website',
    'comments',
  ));
  $output = '';
  if ($comment_entry == $entry['id']) {

    // Display owner comment edit form.
    $build = guestbook_form_comment($uid, $entry);
    $output .= drupal_render($build);
  }
  else {
    if (in_array('comments', $display) && $entry['comment'] != '') {

      // Display owner comment.
      $author = user_access('access user profiles') ? l($entry['commentby'], "user/{$entry['commentauthor']}") : $entry['commentby'];
      $output .= '<div class="guestbook-comment-submitted">';
      $output .= t('Comment by') . ' ' . $author;
      $output .= '</div>';
      $output .= '<div class="guestbook-comment-content">';
      $output .= check_markup($entry['comment'], $entry['comment_format'], '', TRUE);
      $output .= '</div>';
    }
  }
  return !empty($output) ? '<div class="guestbook-comment">' . $output . '</div>' : '';
}