]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/noticesearchrss.php
save notice to inbox on saveNew
[quix0rs-gnu-social.git] / actions / noticesearchrss.php
index 4e206c9a2549ab7b6caab7b29cb5ac747f1ddb89..f598d833eb8fd35981616d5d69679ff201629092 100644 (file)
@@ -39,8 +39,12 @@ class NoticesearchrssAction extends Rss10Action {
                # lcase it for comparison
                $q = strtolower($q);
 
-               $notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')');
-               $notice->orderBy('created DESC');
+               if(common_config('db','type')=='mysql') {
+                       $notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')');
+               } else {
+                       $notice->whereAdd('to_tsvector(\'english\',content) @@ plainto_tsquery(\''.addslashes($q).'\')');
+               }
+               $notice->orderBy('created DESC, notice.id DESC');
 
                # Ask for an extra to see if there's more.
 
@@ -70,4 +74,4 @@ class NoticesearchrssAction extends Rss10Action {
        function get_image() {
                return NULL;
        }
-}
\ No newline at end of file
+}