X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=36ac57f17d5d938213723e03ba576d4ccf08d27b;hb=dbf51229d9014089eba0da41a55f23c507f7e2ea;hp=5296011bb37e080a220f4eb024455b79115ac13c;hpb=c0af9b2938bca3accccf2f6e6ae97c562e96b3ce;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index 5296011bb3..36ac57f17d 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -369,7 +369,6 @@ function visible_activity($item) { if(!function_exists('conversation')) { function conversation(&$a, $items, $mode, $update, $preview = false) { - require_once('include/bbcode.php'); $ssl_state = ((local_user()) ? true : false); @@ -524,7 +523,26 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $tags=array(); $hashtags = array(); $mentions = array(); - foreach(explode(',',$item['tag']) as $tag){ + + $taglist = q("SELECT `type`, `term`, `url` FROM `term` WHERE `otype` = %d AND `oid` = %d AND `type` IN (%d, %d) ORDER BY `tid`", + intval(TERM_OBJ_POST), intval($item['id']), intval(TERM_HASHTAG), intval(TERM_MENTION)); + + foreach($taglist as $tag) { + + if ($tag["url"] == "") + $tag["url"] = $searchpath.strtolower($tag["term"]); + + if ($tag["type"] == TERM_HASHTAG) { + $hashtags[] = "#".$tag["term"].""; + $prefix = "#"; + } elseif ($tag["type"] == TERM_MENTION) { + $mentions[] = "@".$tag["term"].""; + $prefix = "@"; + } + $tags[] = $prefix."".$tag["term"].""; + } + + /*foreach(explode(',',$item['tag']) as $tag){ $tag = trim($tag); if ($tag!="") { $t = bbcode($tag); @@ -534,7 +552,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { elseif($t[0] == '@') $mentions[] = $t; } - } + }*/ $sp = false; $profile_link = best_link_url($item,$sp);