From c8c8659085b769bde45c74fd3301bbc367ee3d4c Mon Sep 17 00:00:00 2001 From: garvinhicking <garvinhicking> Date: Tue, 27 Jun 2006 12:13:32 +0000 Subject: [PATCH] Improve comment spam toglging usability. --- docs/NEWS | 4 ++++ include/admin/comments.inc.php | 2 +- .../serendipity_event_spamblock.php | 9 ++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index ebde8f7..05a37d7 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,10 @@ Version 1.1-alpha7() ------------------------------------------------------------------------ + * Comment moderation panel, usability improvement: Blocking authors/ + URLs will lead to the originating page. Thanks to Tanel Raja! + (garvinhicking) + * Patch mb-functions to better work on foreign/japanese charsets (thanks to deminy!) diff --git a/include/admin/comments.inc.php b/include/admin/comments.inc.php index fd2fca5..b7898cd 100644 --- a/include/admin/comments.inc.php +++ b/include/admin/comments.inc.php @@ -316,7 +316,7 @@ foreach ($sql as $rs) { $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' : ''); ?> diff --git a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php index dbafb0e..5b96391 100644 --- a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php +++ b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php @@ -34,7 +34,7 @@ var $filter_defaults; 'smarty' => '2.6.7', 'php' => '4.1.0' )); - $propbag->add('version', '1.52'); + $propbag->add('version', '1.53'); $propbag->add('event_hooks', array( 'frontend_saveComment' => true, 'external_plugin' => true, @@ -1058,11 +1058,14 @@ var $filter_defaults; case 'backend_view_comment': $author_is_filtered = $this->checkFilter('authors', $eventData['author']); - $eventData['action_author'] .= ' <a class="serendipityIconLink" title="' . ($author_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_AUTHOR : PLUGIN_EVENT_SPAMBLOCK_ADD_AUTHOR) . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamBlockAuthor]=' . $eventData['id'] . '"><img src="' . serendipity_getTemplateFile('admin/img/' . ($author_is_filtered ? 'un' : '') . 'configure.png') . '" /></a>'; + $clink1 = 'clink1' . $eventData['id']; + $clink2 = 'clink2' . $eventData['id']; + + $eventData['action_author'] .= ' <a id="' . $clink1 . '" class="serendipityIconLink" title="' . ($author_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_AUTHOR : PLUGIN_EVENT_SPAMBLOCK_ADD_AUTHOR) . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamBlockAuthor]=' . $eventData['id'] . $addData . '#' . $clink1 . '"><img src="' . serendipity_getTemplateFile('admin/img/' . ($author_is_filtered ? 'un' : '') . 'configure.png') . '" /></a>'; if (!empty($eventData['url'])) { $url_is_filtered = $this->checkFilter('urls', $eventData['url']); - $eventData['action_url'] .= ' <a class="serendipityIconLink" title="' . ($url_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_URL : PLUGIN_EVENT_SPAMBLOCK_ADD_URL) . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamBlockURL]=' . $eventData['id'] . '"><img src="' . serendipity_getTemplateFile('admin/img/' . ($url_is_filtered ? 'un' : '') . 'configure.png') . '" /></a>'; + $eventData['action_url'] .= ' <a id="' . $clink2 . '" class="serendipityIconLink" title="' . ($url_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_URL : PLUGIN_EVENT_SPAMBLOCK_ADD_URL) . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamBlockURL]=' . $eventData['id'] . $addData . '#' . $clink2 . '"><img src="' . serendipity_getTemplateFile('admin/img/' . ($url_is_filtered ? 'un' : '') . 'configure.png') . '" /></a>'; } return true; -- 2.39.5