1
0

Add expand to dashboard-comment

temporary, to be replaced with a nice solution, same like for the normal comment view
This commit is contained in:
onli
2013-10-01 01:57:42 +02:00
parent 1e8d3a58e4
commit eadc5bc027
2 changed files with 16 additions and 2 deletions

View File

@ -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']));
}
}
}