add linked hashtags to item tag

This commit is contained in:
Friendika 2010-11-17 14:56:41 -08:00
parent 5e6e92a10b
commit 56ccf0920a

View File

@ -124,6 +124,9 @@ function item_post(&$a) {
if(strpos($tag,'#') === 0) { if(strpos($tag,'#') === 0) {
$basetag = substr($tag,1); $basetag = substr($tag,1);
$body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . urlencode($basetag) . ']' . $basetag . '[/url]',$body); $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; continue;
} }
if(strpos($tag,'@') === 0) { if(strpos($tag,'@') === 0) {
@ -168,9 +171,9 @@ function item_post(&$a) {
} }
if($profile) { if($profile) {
$body = str_replace($name,'[url=' . $profile . ']' . $newname . '[/url]', $body); $body = str_replace($name,'[url=' . $profile . ']' . $newname . '[/url]', $body);
$profile = str_replace(',','%2c',$profile);
if(strlen($str_tags)) if(strlen($str_tags))
$str_tags .= ','; $str_tags .= ',';
$profile = str_replace(',','%2c',$profile);
$str_tags .= '@[url=' . $profile . ']' . $newname . '[/url]'; $str_tags .= '@[url=' . $profile . ']' . $newname . '[/url]';
} }
} }