]> git.mxchange.org Git - friendica.git/commitdiff
Tags are now added to the body again
authorMichael <heluecht@pirati.ca>
Sat, 2 May 2020 05:43:00 +0000 (05:43 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 2 May 2020 05:43:00 +0000 (05:43 +0000)
src/Protocol/Feed.php

index fd6dc10df5604ce173218ec2c22e89df86a7bc64..baf439dc026dcac5bae6ecc950d9fc25e29c7263 100644 (file)
@@ -481,7 +481,7 @@ class Feed {
                                        if (empty($taglist)) {
                                                $taglist = get_page_keywords($item["plink"], $preview, true, $contact["ffi_keyword_blacklist"]);
                                        }
-                                       /// @todo $item["body"] .= "\n" . $tags;
+                                       $item["body"] .= "\n" . self::tagToString($taglist);
                                } else {
                                        $taglist = [];
                                }
@@ -527,6 +527,27 @@ class Feed {
                return ["header" => $author, "items" => $items];
        }
 
+       /**
+        * Convert a tag array to a tag string
+        *
+        * @param array $tags
+        * @return string tag string
+        */
+       private static function tagToString(array $tags)
+       {
+               $tagstr = '';
+
+               foreach ($tags as $tag) {
+                       if ($tagstr != "") {
+                               $tagstr .= ", ";
+                       }
+       
+                       $tagstr .= "#[url=" . DI::baseUrl() . "/search?tag=" . urlencode($tag) . "]" . $tag . "[/url]";
+               }
+
+               return $tagstr;
+       }
+
        private static function titleIsBody($title, $body)
        {
                $title = strip_tags($title);