]> git.mxchange.org Git - friendica.git/commitdiff
add linked hashtags to item tag
authorFriendika <info@friendika.com>
Wed, 17 Nov 2010 22:56:41 +0000 (14:56 -0800)
committerFriendika <info@friendika.com>
Wed, 17 Nov 2010 22:56:41 +0000 (14:56 -0800)
mod/item.php

index 430500f99876906ef5d4fe1d48d05f31c3748e44..4b95f2d9b39edefb84557bfb540e8fcac698db69 100644 (file)
@@ -124,6 +124,9 @@ function item_post(&$a) {
                        if(strpos($tag,'#') === 0) {
                                $basetag = substr($tag,1);
                                $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . urlencode($basetag) . ']' . $basetag . '[/url]',$body);
+                               if(strlen($str_tags))
+                                       $str_tags .= ',';
+                               $str_tags .= '#[url=' . $a->get_baseurl() . '/search?search=' . urlencode($basetag) . ']' . $basetag . '[/url]';
                                continue;
                        }
                        if(strpos($tag,'@') === 0) {
@@ -168,9 +171,9 @@ function item_post(&$a) {
                                }
                                if($profile) {
                                        $body = str_replace($name,'[url=' . $profile . ']' . $newname   . '[/url]', $body);
+                                       $profile = str_replace(',','%2c',$profile);
                                        if(strlen($str_tags))
                                                $str_tags .= ',';
-                                       $profile = str_replace(',','%2c',$profile);
                                        $str_tags .= '@[url=' . $profile . ']' . $newname       . '[/url]';
                                }
                        }