1) { foreach ($comments as &$comment) { $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'])); } } } $data['comments'] = $comments; $entries = serendipity_fetchEntries( false, false, 5, true, false, 'timestamp DESC', 'e.timestamp >= ' . serendipity_serverOffsetHour() ); $entriesAmount = count($entries); if ($entriesAmount < 5) { // there is still space for drafts $drafts = serendipity_fetchEntries( false, false, 5- $entriesAmount, true, false, 'timestamp DESC', 'isdraft = "true" AND e.timestamp <= ' . serendipity_serverOffsetHour() ); if (is_array($entries) && is_array($drafts)) { $entries = array_merge($entries, $drafts); } else { if (is_array($drafts)) { // $entries is not an array, thus empty $entries = $drafts; } } } $data['entries'] = $entries; $data['token'] = serendipity_setFormToken('url'); echo serendipity_smarty_show('admin/overview.inc.tpl', $data); /* vim: set sts=4 ts=4 expandtab : */