diff --git a/docs/NEWS b/docs/NEWS index afaf46a0..4bb08542 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,13 +3,14 @@ Version 1.6 () ------------------------------------------------------------------------ - * Upgraded to PEAR Cache_Lite 1.7.8 - * Added experimental global variable $i18n_filename_utf8 that can be set in a serendipity_config_local.inc.php or language include file, which will return Unicode-Permalinks. (http://board.s9y.org/viewtopic.php?f=11&t=15896) + * Added event hook backend_sendcomment for sending comments and + being able to chang via plugin API (onli) + Version 1.5 () ------------------------------------------------------------------------ diff --git a/include/functions_comments.inc.php b/include/functions_comments.inc.php index 371963c0..3ab41fd1 100644 --- a/include/functions_comments.inc.php +++ b/include/functions_comments.inc.php @@ -1110,6 +1110,21 @@ function serendipity_sendComment($comment_id, $to, $fromName, $fromEmail, $fromU $deleteURI = serendipity_rewriteURL(PATH_DELETE . '/'. $path .'/' . $comment_id . '/' . $id . '-' . serendipity_makeFilename($title) . '.html', 'baseURL'); $approveURI = serendipity_rewriteURL(PATH_APPROVE . '/'. $path .'/' . $comment_id . '/' . $id . '-' . serendipity_makeFilename($title) . '.html', 'baseURL'); + $eventData = array( 'comment_id' => $comment_id, + 'entry_id' => $id, + 'entryURI' => $entryURI, + '$path' => $path, + 'deleteURI' => $deleteURI, + 'approveURI' => $approveURI, + 'moderate_comment' => $moderate_comment, + 'action_more' => array()); + serendipity_plugin_api::hook_event('backend_sendcomment', $eventData); + + $action_more = ''; + foreach($eventData['action_more'] as $action) { + $action_more .= "\n" . str_repeat(' ', 3) . $action; + } + if ($type == 'TRACKBACK') { /******************* TRACKBACKS *******************/ @@ -1129,7 +1144,8 @@ function serendipity_sendComment($comment_id, $to, $fromName, $fromEmail, $fromU . (($moderate_comment) ? "\n" . str_repeat(' ', 2) . THIS_TRACKBACK_NEEDS_REVIEW : '') . "\n" . str_repeat(' ', 3) . str_pad(VIEW_ENTRY, 15) . ' -- '. $entryURI . "\n" . str_repeat(' ', 3) . str_pad(DELETE_TRACKBACK, 15) . ' -- '. $deleteURI - . (($moderate_comment) ? "\n" . str_repeat(' ', 3) . str_pad(APPROVE_TRACKBACK, 15) . ' -- '. $approveURI : ''); + . (($moderate_comment) ? "\n" . str_repeat(' ', 3) . str_pad(APPROVE_TRACKBACK, 15) . ' -- '. $approveURI : '') + . $action_more; } else { @@ -1152,7 +1168,8 @@ function serendipity_sendComment($comment_id, $to, $fromName, $fromEmail, $fromU . (($moderate_comment) ? "\n" . str_repeat(' ', 2) . THIS_COMMENT_NEEDS_REVIEW : '') . "\n" . str_repeat(' ', 3) . str_pad(VIEW_COMMENT, 15) . ' -- '. $entryURI .'#c'. $comment_id . "\n" . str_repeat(' ', 3) . str_pad(DELETE_COMMENT, 15) . ' -- '. $deleteURI - . (($moderate_comment) ? "\n" . str_repeat(' ', 3) . str_pad(APPROVE_COMMENT, 15) . ' -- '. $approveURI : ''); + . (($moderate_comment) ? "\n" . str_repeat(' ', 3) . str_pad(APPROVE_COMMENT, 15) . ' -- '. $approveURI : '') + . $action_more; } return serendipity_sendMail($to, $subject, $text, $fromEmail, null, $fromName);