1
1
Fork 0

Remove the old hashtag functions, change it to the new functionality.

This commit is contained in:
Michael Vogel 2015-03-01 20:40:38 +01:00
commit 3f1d186106
3 changed files with 23 additions and 113 deletions

View file

@ -1610,7 +1610,16 @@ function item_body_set_hashtags(&$item) {
continue;
$basetag = str_replace('_',' ',substr($tag,1));
$item["body"] = str_replace($tag,'#[url='.$a->get_baseurl().'/search?tag='.rawurlencode($basetag).']'.$basetag.'[/url]', $item["body"]);
$newtag = '#[url='.$a->get_baseurl().'/search?tag='.rawurlencode($basetag).']'.$basetag.'[/url]';
$item["body"] = str_replace($tag, $newtag, $item["body"]);
if(!stristr($item["tag"],"/search?tag=".$basetag."]".$basetag."[/url]")) {
if(strlen($item["tag"]))
$item["tag"] = ','.$item["tag"];
$item["tag"] = $newtag.$item["tag"];
}
}
// Convert back the masked hashtags