From: garvinhicking Date: Mon, 24 Jul 2006 14:18:21 +0000 (+0000) Subject: fix missing to fetch *_comments X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=886d3f3e421643140a406439086640a75ec2c1c5;p=s9y.git fix missing to fetch *_comments --- diff --git a/docs/NEWS b/docs/NEWS index 95dc6c0..0f36b04 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 1.1-alpha7() ------------------------------------------------------------------------ + * Fix not fetching allow_comments/moderate_comments value when + inside search function. Thanks to stm! (garvinhicking) + * Add new links to check for upgradable SPARTACUS plugins (garvinhicking) diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index 974fee6..0eb76e4 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -726,6 +726,8 @@ function serendipity_searchEntries($term, $limit = '') { e.id, e.authorid, a.realname AS author, + e.allow_comments, + e.moderate_comments, a.email, e.timestamp, e.comments, diff --git a/plugins/serendipity_plugin_comments/serendipity_plugin_comments.php b/plugins/serendipity_plugin_comments/serendipity_plugin_comments.php index 3646c9d..3123a6e 100644 --- a/plugins/serendipity_plugin_comments/serendipity_plugin_comments.php +++ b/plugins/serendipity_plugin_comments/serendipity_plugin_comments.php @@ -173,7 +173,7 @@ class serendipity_plugin_comments extends serendipity_plugin $user = PLUGIN_COMMENTS_ANONYMOUS; } - if (function_exists( 'mb_strimwidth')) { + if (function_exists('mb_strimwidth')) { $pos = 0; $parts = array(); $enc = LANG_CHARSET; @@ -183,13 +183,19 @@ class serendipity_plugin_comments extends serendipity_plugin $pos += mb_strlen($part, $enc); $parts[] = $part; } - $comment = implode( "\n", $parts); + $comment = implode("\n", $parts); } else { $comment = wordwrap($comment, $wordwrap, "\n", 1); } $entry = array('comment' => $comment, 'email' => $row['comment_email']); + + // Let's help the BBCOde plugin a bit: + #$entry['comment'] = preg_replace('@((\[.*)[\n\r]+(.*\]))+@imsU', '\2\3', $entry['comment']); + #$entry['comment'] = preg_replace('@((\[.+\].*)[\r\n]+(.*\[/.+\]))+@imsU', '\2\3', $entry['comment']); + serendipity_plugin_api::hook_event('frontend_display', $entry); + printf( '
' . PLUGIN_COMMENTS_ABOUT . '
', @@ -198,7 +204,7 @@ class serendipity_plugin_comments extends serendipity_plugin . htmlspecialchars($row['subject']) . '
' . "\n" . '' . htmlspecialchars(serendipity_strftime($dateformat, $row['stamp'])) . '
' . "\n" - . '' . strip_tags($entry['comment'], '
') . '
' + . '' . strip_tags($entry['comment'], '
') . '
' . '


' . "\n\n" ); }