]> git.mjollnir.org Git - s9y.git/commitdiff
fix missing to fetch *_comments
authorgarvinhicking <garvinhicking>
Mon, 24 Jul 2006 14:18:21 +0000 (14:18 +0000)
committergarvinhicking <garvinhicking>
Mon, 24 Jul 2006 14:18:21 +0000 (14:18 +0000)
docs/NEWS
include/functions_entries.inc.php
plugins/serendipity_plugin_comments/serendipity_plugin_comments.php

index 95dc6c052490ef9546bea6d8a6708cfb4ac5ce24..0f36b0458dfc48b5be9916e9e70825d7ca6cdd53 100644 (file)
--- 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)
 
index 974fee657c8b4ea24216d6dbe2ba50a089c1c979..0eb76e4c0d4c67852fc0a1e5ce7e5aedb204c517 100644 (file)
@@ -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,
index 3646c9d0250059e8b3987b8253f628f8cbc6e83c..3123a6e1aff2641ee54671b8d5d27aa6a04c9255 100644 (file)
@@ -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(
                   '<div class="plugin_comment_wrap">' . PLUGIN_COMMENTS_ABOUT . '</div>',
 
@@ -198,7 +204,7 @@ class serendipity_plugin_comments extends serendipity_plugin
                       . htmlspecialchars($row['subject'])
                       . '</a><br />' . "\n"
                       . '<span class="plugin_comment_date">' . htmlspecialchars(serendipity_strftime($dateformat, $row['stamp'])) . '</span><br />' . "\n"
-                      . '<span class="plugin_comment_body">' . strip_tags($entry['comment'], '<br /><img>') . '</span>'
+                      . '<span class="plugin_comment_body">' . strip_tags($entry['comment'], '<br /><img><a>') . '</span>'
                       . '<br /><br /><br />' . "\n\n"
                 );
             }