You are here

function theme_guestbook_entry_comment in Guestbook 6.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 guestbook.module \theme_guestbook_entry_comment()
  4. 7.2 guestbook.module \theme_guestbook_entry_comment()
1 theme call to theme_guestbook_entry_comment()
theme_guestbook_entry in ./guestbook.module

File

./guestbook.module, line 895

Code

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

    // Display owner comment edit form.
    $output .= guestbook_form_comment($uid, $entry);
  }
  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'], variable_get('guestbook_input_format', 1), FALSE);
      $output .= '</div>';
    }
  }
  return !empty($output) ? '<div class="guestbook-comment">' . $output . '</div>' : '';
}