Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8409
Modified Files:
serendipity_functions.inc.php
serendipity_admin_comments.inc.php NEWS
Log Message:
Trackback moderation support in admin panel, make captcha plugin only work for comments (garvinhicking)
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.237
retrieving revision 1.238
diff -u -d -r1.237 -r1.238
--- NEWS 6 Oct 2004 10:30:47 -0000 1.237
+++ NEWS 7 Oct 2004 10:31:23 -0000 1.238
@@ -3,6 +3,9 @@
Version 0.7 ()
------------------------------------------------------------------------
+ * Trackback moderation support in admin panel, make captcha plugin
+ only work for comments (garvinhicking)
+
* Bug #1037122: BlogPDF plugin will me less strict in file inclusion
(garvinhicking)
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.438
retrieving revision 1.439
diff -u -d -r1.438 -r1.439
--- serendipity_functions.inc.php 6 Oct 2004 09:53:46 -0000 1.438
+++ serendipity_functions.inc.php 7 Oct 2004 10:31:23 -0000 1.439
@@ -1787,6 +1787,7 @@
$query = "SELECT id, allow_comments, moderate_comments, last_modified, timestamp FROM {$serendipity['dbPrefix']}entries WHERE id = '". (int)$id ."'";
$ca = serendipity_db_query($query, true);
+ $commentInfo['type'] = $type;
serendipity_plugin_api::hook_event('frontend_saveComment', $ca, $commentInfo);
if (!is_array($ca) || serendipity_db_bool($ca['allow_comments'])) {
$title = serendipity_db_escape_string(isset($commentInfo['title']) ? $commentInfo['title'] : '');
Index: serendipity_admin_comments.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_comments.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- serendipity_admin_comments.inc.php 24 Sep 2004 22:01:26 -0000 1.22
+++ serendipity_admin_comments.inc.php 7 Oct 2004 10:31:23 -0000 1.23
@@ -113,16 +113,25 @@
$searchString .= (!empty($serendipity['GET']['filter'][$filter]) ? "&serendipity[filter][". $filter ."]=". $serendipity['GET']['filter'][$filter] : "");
}
-if ( $serendipity['GET']['filter']['show'] == 'approved' ) {
- $and .= "AND status = 'approved'";
-} elseif ( $serendipity['GET']['filter']['show'] == 'pending' ) {
- $and .= "AND status = 'pending'";
+if ($serendipity['GET']['filter']['show'] == 'approved') {
+ $and .= "AND status = 'approved'";
+ $searchString .= "&serendipity[filter][show]=approved";
+} elseif ($serendipity['GET']['filter']['show'] == 'pending') {
+ $and .= "AND status = 'pending'";
+ $searchString .= "&serendipity[filter][show]=pending";
} else {
$serendipity['GET']['filter']['show'] = 'all';
}
+if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') {
+ $c_type = 'TRACKBACK';
+ $searchString .= "&serendipity[filter][type]=TRACKBACK";
+} else {
+ $c_type = 'NORMAL';
+}
+
/* Paging */
-$sql = serendipity_db_query("SELECT COUNT(*) AS total FROM {$serendipity['dbPrefix']}comments c WHERE c.type = 'NORMAL' ". $and, true);
+$sql = serendipity_db_query("SELECT COUNT(*) AS total FROM {$serendipity['dbPrefix']}comments c WHERE c.type = '$c_type' ". $and, true);
$totalComments = $sql['total'];
$pages = ceil($totalComments/$commentsPerPage);
@@ -146,7 +155,7 @@
$limit = serendipity_db_limit_sql(serendipity_db_limit(($page-1)*$commentsPerPage, $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 = 'NORMAL'
+ WHERE type = '$c_type'
". $and ."
" . (($serendipity['serendipityUserlevel'] != USERLEVEL_ADMIN) ? 'AND e.authorid = ' . $serendipity['authorId'] : '') . "
ORDER BY id DESC $limit");
@@ -205,9 +214,17 @@
<td><input type="text" name="serendipity[filter][body]" size="15" value="<?php echo $serendipity['GET']['filter']['body'] ?>" /></td>
<td><?php echo COMMENTS_FILTER_SHOW ?>:</td>
<td><select name="serendipity[filter][show]">
- <option value="all"<?php if ( $serendipity['GET']['filter']['show'] == 'all' ) echo ' SELECTED' ?>><?php echo COMMENTS_FILTER_ALL ?></option>
- <option value="approved"<?php if ( $serendipity['GET']['filter']['show'] == 'approved' ) echo ' SELECTED' ?>><?php echo COMMENTS_FILTER_APPROVED_ONLY ?></option>
- <option value="pending"<?php if ( $serendipity['GET']['filter']['show'] == 'pending' ) echo ' SELECTED' ?>><?php echo COMMENTS_FILTER_NEED_APPROVAL ?></option>
+ <option value="all"<?php if ( $serendipity['GET']['filter']['show'] == 'all' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_ALL ?></option>
+ <option value="approved"<?php if ( $serendipity['GET']['filter']['show'] == 'approved' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_APPROVED_ONLY ?></option>
+ <option value="pending"<?php if ( $serendipity['GET']['filter']['show'] == 'pending' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_NEED_APPROVAL ?></option>
+ </select></td>
+ </tr>
+ <tr>
+ <td colspan="4"> </td>
+ <td><?php echo TYPE; ?></td>
+ <td><select name="serendipity[filter][type]">
+ <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>
</tr>
<tr>
@@ -263,7 +280,7 @@
?>
<tr>
<td><a name="c<?php echo $rs['id'] ?>"></a>
- <?php echo '#'. $rs['id'] .', '. IN_REPLY_TO .' <strong>'. $rs['title'] .'</strong>, '. ON . ' ' . ucfirst(strftime('%b %e %Y, %H:%M', $rs['timestamp']))?>
+ <?php echo ($rs['type'] == 'NORMAL' ? COMMENT : TRACKBACK) . ' #'. $rs['id'] .', '. IN_REPLY_TO .' <strong>'. $rs['title'] .'</strong>, '. ON . ' ' . ucfirst(strftime('%b %e %Y, %H:%M', $rs['timestamp']))?>
</td>
</tr>
<tr>
@@ -315,4 +332,4 @@
</tr>
</table>
</form>
-<?php } ?>
+<?php } ?>
\ No newline at end of file
|