1
0

Fix Dashboard comments by authors entries

Closes 
This commit is contained in:
Ian
2016-01-22 18:29:49 +01:00
parent 797da0eae1
commit 97c43af83e
2 changed files with 14 additions and 3 deletions
docs
include/admin

@ -1,5 +1,8 @@
Version 2.1 ()
------------------------------------------------------------------------
* Fix Dashboard comments by authors entries (#385)
* Use CDATA encoded body for ATOM feed
* Fix: Ajax upload to ML now also works for non-images

@ -63,9 +63,17 @@ if (!isset($serendipity['dashboardDraftLimit'])) {
$serendipity['dashboardDraftLimit'] = 5;
}
$comments = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPrefix']}comments c
$cjoin = ($serendipity['authorid'] > 1) ? "
LEFT JOIN {$serendipity['dbPrefix']}authors a ON (e.authorid = a.authorid)
WHERE e.authorid = {$serendipity['authorid']}
" : '';
$cquery = "SELECT c.*, e.title
FROM {$serendipity['dbPrefix']}comments c
LEFT JOIN {$serendipity['dbPrefix']}entries e ON (e.id = c.entry_id)
ORDER BY c.id DESC LIMIT " . (int)$serendipity['dashboardCommentsLimit']);
" . $cjoin ."
ORDER BY c.id DESC LIMIT " . (int)$serendipity['dashboardCommentsLimit'];
$comments = serendipity_db_query($cquery);
if (is_array($comments) && count($comments) > 0) {
foreach ($comments as &$comment) {
$comment['entrylink'] = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id'];