diff --git a/include/admin/overview.inc.php b/include/admin/overview.inc.php index 104f2331..f5c7899b 100644 --- a/include/admin/overview.inc.php +++ b/include/admin/overview.inc.php @@ -28,8 +28,18 @@ $comments = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPref ORDER BY c.id DESC LIMIT 5"); if (count($comments) > 1) { foreach ($comments as &$comment) { - $entrylink = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id']; - $comment['entrylink'] = $entrylink; + $comment['entrylink'] = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id']; + + $comment['fullBody'] = $comment['body']; + $comment['summary'] = serendipity_mb('substr', $comment['body'], 0, 100); + + if (strlen($comment['fullBody']) > strlen($comment['summary']) ) { + $comment['excerpt'] = true; + + // When summary is not the full body, strip HTML tags from summary, as it might break and leave unclosed HTML. + $comment['fullBody'] = nl2br(htmlspecialchars($comment['fullBody'])); + $comment['summary'] = nl2br(strip_tags($comment['summary'])); + } } } diff --git a/templates/2k11/admin/overview.inc.tpl b/templates/2k11/admin/overview.inc.tpl index 2cb47571..26d510f6 100644 --- a/templates/2k11/admin/overview.inc.tpl +++ b/templates/2k11/admin/overview.inc.tpl @@ -17,11 +17,15 @@
  • #{$comment.id} - {$comment.body|truncate:100:"…"}
    +
    {$comment.fullBody}