return;
}
-$commentsPerPage = (!empty($serendipity['GET']['filter']['perpage']) ? $serendipity['GET']['filter']['perpage'] : 10);
+$commentsPerPage = (int)(!empty($serendipity['GET']['filter']['perpage']) ? $serendipity['GET']['filter']['perpage'] : 10);
$summaryLength = 200;
if ( $serendipity['POST']['formAction'] == 'multiDelete' && sizeof($serendipity['POST']['delete']) != 0 && serendipity_checkFormToken()) {
$filters = array('author', 'email', 'ip', 'url', 'body', 'referer');
/* Compress the filters into an "AND" SQL query, and a querystring */
-foreach ( $filters as $filter ) {
+foreach ($filters as $filter) {
$and .= (!empty($serendipity['GET']['filter'][$filter]) ? "AND c.". $filter ." LIKE '%". serendipity_db_escape_string($serendipity['GET']['filter'][$filter]) ."%'" : "");
$searchString .= (!empty($serendipity['GET']['filter'][$filter]) ? "&serendipity[filter][". $filter ."]=". $serendipity['GET']['filter'][$filter] : "");
}
$c_type = null;
}
+if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') {
+ $c_type = 'TRACKBACK';
+ $searchString .= "&serendipity[filter][type]=TRACKBACK";
+} elseif ($serendipity['GET']['filter']['type'] == 'NORMAL') {
+ $c_type = 'NORMAL';
+ $searchString .= "&serendipity[filter][type]=NORMAL";
+} else {
+ $c_type = null;
+}
+
+if ($commentsPerPage != 10) {
+ $searchString .= '&serendipity[filter][perpage]=' . $commentsPerPage;
+}
+
$searchString .= '&' . serendipity_setFormToken('url');
/* Paging */
if ( document.getElementById(id + '_full').style.display == '' ) {
document.getElementById(id + '_full').style.display='none';
document.getElementById(id + '_summary').style.display='';
- document.getElementById(id + '_text').innerHTML = '<?php echo VIEW ?>';
+ document.getElementById(id + '_text').innerHTML = '<?php echo TOGGLE_ALL ?>';
} else {
document.getElementById(id + '_full').style.display='';
document.getElementById(id + '_summary').style.display='none';
<tr>
<td><?php echo COMMENTS; ?>:</td>
<td><select name="serendipity[filter][perpage]">
- <?php
+ <?php
$filter_vals = array(10, 20, 50, COMMENTS_FILTER_ALL);
foreach($filter_vals AS $filter_val) { ?>
<option value="<?php echo $filter_val; ?>" <?php echo ($commentsPerPage == $filter_val ? ' selected="selected"' : ''); ?>><?php echo $filter_val; ?></option>
'referer' => $rs['referer'],
'url' => $rs['url'],
'ip' => $rs['ip'],
+ 'entry_url' => serendipity_archiveURL($rs['entry_id'], $rs['title']),
'email' => $rs['email'],
'author' => (empty($rs['author']) ? ANONYMOUS : $rs['author']),
'entry_id' => $rs['entry_id']
);
+ $entrylink = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id'];
if (strlen($comment['fullBody']) > strlen($comment['summary']) ) {
$comment['summary'] .= ' ...';
$comment['excerpt'] = true;
$comment['fullBody'] = $comment['summary'] = nl2br(htmlspecialchars($comment['fullBody']));
}
-
- serendipity_plugin_api::hook_event('backend_view_comment', $comment);
+
+ serendipity_plugin_api::hook_event('backend_view_comment', $comment, '&serendipity[page]='. $page . $searchString);
$class = 'serendipity_admin_list_item_' . (($i % 2 == 0 ) ? 'even' : 'uneven');
$header_class = ($comment['status'] == 'pending' ? 'serendipityAdminMsgNote' : '');
?>
<tr>
<td class="<?php echo $header_class; ?>"><a name="c<?php echo $comment['id'] ?>"></a>
- <?php echo ($comment['type'] == 'NORMAL' ? COMMENT : TRACKBACK) . ' #'. $comment['id'] .', '. IN_REPLY_TO .' <strong>'. $comment['title'] .'</strong>, '. ON . ' ' . serendipity_mb('ucfirst', serendipity_strftime('%b %e %Y, %H:%M', $comment['timestamp']))?>
+ <?php echo ($comment['type'] == 'NORMAL' ? COMMENT : TRACKBACK) . ' #'. $comment['id'] .', '. IN_REPLY_TO .' <strong><a href="' . $comment['entry_url'] . '">'. $comment['title'] .'</a></strong>, '. ON . ' ' . serendipity_mb('ucfirst', serendipity_strftime('%b %e %Y, %H:%M', $comment['timestamp']))?>
</td>
</tr>
<tr>
<a href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=approve&serendipity[id]=<?php echo $comment['id'] ?>&<?php echo serendipity_setFormToken('url'); ?>" class="serendipityIconLink" title="<?php echo APPROVE; ?>"><img src="<?php echo serendipity_getTemplateFile('admin/img/accept.png'); ?>" alt="<?php echo APPROVE ?>" /><?php echo APPROVE ?></a>
<?php } ?>
<?php if ($comment['excerpt']) { ?>
- <a href="#c<?php echo $comment['id'] ?>" onclick="FT_toggle(<?php echo $comment['id'] ?>); return false;" title="<?php echo VIEW; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo VIEW; ?>" /><span id="<?php echo $comment['id'] ?>_text"><?php echo VIEW ?></span></a>
+ <a href="#c<?php echo $comment['id'] ?>" onclick="FT_toggle(<?php echo $comment['id'] ?>); return false;" title="<?php echo VIEW; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo TOGGLE_ALL; ?>" /><span id="<?php echo $comment['id'] ?>_text"><?php echo TOGGLE_ALL ?></span></a>
<?php } ?>
+ <a target="_blank" href="<?php echo $entrylink; ?>" title="<?php echo VIEW; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo VIEW; ?>" /><?php echo VIEW ?></a>
<a href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=edit&serendipity[id]=<?php echo $comment['id'] ?>&serendipity[entry_id]=<?php echo $comment['entry_id'] ?>&<?php echo serendipity_setFormToken('url'); ?>" title="<?php echo EDIT; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/edit.png'); ?>" alt="<?php echo EDIT; ?>" /><?php echo EDIT ?></a>
<a href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=delete&serendipity[id]=<?php echo $comment['id'] ?>&serendipity[entry_id]=<?php echo $comment['entry_id'] ?>&<?php echo serendipity_setFormToken('url'); ?>" onclick='return confirm("<?php echo sprintf(COMMENT_DELETE_CONFIRM, $comment['id'], htmlspecialchars($comment['author'])) ?>")' title="<?php echo DELETE ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/delete.png'); ?>" alt="<?php echo DELETE; ?>" /><?php echo DELETE ?></a>
<?php echo $comment['action_more']; ?>