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
serendipity_deleteComment($k, $v);
echo DONE . ': '. sprintf(COMMENT_DELETED, $k) . '<br />';
}
- return true;
}
entry_id = " . (int)$serendipity['POST']['entry_id'];
serendipity_db_query($sql);
echo COMMENT_EDITED;
- return true;
}
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 */
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));
$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");
?>
<script type="text/javascript">
</select></td>
<td><?php echo TYPE; ?></td>
<td><select name="serendipity[filter][type]">
+ <option value=""><?php echo COMMENTS_FILTER_ALL ?></option>
<option value="NORMAL"<?php if ($c_type == 'NORMAL') echo ' selected="selected"' ?>><?php echo COMMENTS; ?></option>
<option value="TRACKBACK"<?php if ($c_type == 'TRACKBACK') echo ' selected="selected"' ?>><?php echo TRACKBACKS; ?></option>
</select></td>