From: garvinhicking Date: Mon, 27 Jun 2005 10:26:39 +0000 (+0000) Subject: fixed Bugs #1226439 and 1226440 X-Git-Tag: 0.9~385 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f7043189140a880a797b06427db7d2ecfee60820;p=s9y.git fixed Bugs #1226439 and 1226440 comment deletion return to sender, comment type threestate toggle --- diff --git a/docs/NEWS b/docs/NEWS index dd6474f..0174afc 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,10 @@ Version 0.9 () ------------------------------------------------------------------------ + * Make comment deletion return to the originating page, allow to + display trackbacks and normal comments at once (new default). + Bugs #1226440, #1226439 (garvinhicking) + * Fix multi-category selector for Konqueror (garvinhicking) * Support use of Boolean search mode in MySQL. Is activated when using diff --git a/include/admin/comments.inc.php b/include/admin/comments.inc.php index 53a5b0f..74a9340 100644 --- a/include/admin/comments.inc.php +++ b/include/admin/comments.inc.php @@ -18,7 +18,6 @@ if ( $serendipity['POST']['formAction'] == 'multiDelete' && sizeof($serendipity[ serendipity_deleteComment($k, $v); echo DONE . ': '. sprintf(COMMENT_DELETED, $k) . '
'; } - return true; } @@ -35,7 +34,6 @@ if ( isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminActi entry_id = " . (int)$serendipity['POST']['entry_id']; serendipity_db_query($sql); echo COMMENT_EDITED; - return true; } @@ -50,19 +48,16 @@ if ( isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminActi if ($rs === false) { echo ERROR .': '. sprintf(COMMENT_ALREADY_APPROVED, $serendipity['GET']['id']); - return true; + } else { + serendipity_approveComment($serendipity['GET']['id'], $rs['entry_id']); + echo DONE . ': '. sprintf(COMMENT_APPROVED, $serendipity['GET']['id']); } - - serendipity_approveComment($serendipity['GET']['id'], $rs['entry_id']); - echo DONE . ': '. sprintf(COMMENT_APPROVED, $serendipity['GET']['id']); - return true; } /* We are asked to delete a comment */ if ( isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminAction'] == 'delete' ) { serendipity_deleteComment($serendipity['GET']['id'], $serendipity['GET']['entry_id']); echo DONE . ': '. sprintf(COMMENT_DELETED, $serendipity['GET']['id']); - return true; } /* We are either in edit mode, or preview mode */ @@ -137,12 +132,15 @@ if ($serendipity['GET']['filter']['show'] == 'approved') { if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') { $c_type = 'TRACKBACK'; $searchString .= "&serendipity[filter][type]=TRACKBACK"; -} else { +} elseif ($serendipity['GET']['filter']['type'] == 'NORMAL') { $c_type = 'NORMAL'; + $searchString .= "&serendipity[filter][type]=NORMAL"; +} else { + $c_type = null; } /* Paging */ -$sql = serendipity_db_query("SELECT COUNT(*) AS total FROM {$serendipity['dbPrefix']}comments c WHERE c.type = '$c_type' ". $and, true); +$sql = serendipity_db_query("SELECT COUNT(*) AS total FROM {$serendipity['dbPrefix']}comments c WHERE 1 " . ($c_type !== null ? " AND c.type = '$c_type' " : '') . $and, true); $totalComments = $sql['total']; $pages = ($commentsPerPage == COMMENTS_FILTER_ALL ? 1 : ceil($totalComments/(int)$commentsPerPage)); @@ -162,9 +160,8 @@ if ($commentsPerPage == COMMENTS_FILTER_ALL) { $sql = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPrefix']}comments c LEFT JOIN {$serendipity['dbPrefix']}entries e ON (e.id = c.entry_id) - WHERE type = '$c_type' - ". $and ." - " . (!serendipity_checkPermission('adminEntriesMaintainOthers') ? 'AND e.authorid = ' . (int)$serendipity['authorid'] : '') . " + WHERE 1 " . ($c_type !== null ? " AND c.type = '$c_type' " : '') . $and + . (!serendipity_checkPermission('adminEntriesMaintainOthers') ? 'AND e.authorid = ' . (int)$serendipity['authorid'] : '') . " ORDER BY c.id DESC $limit"); ?>