From 54ffc32d7c4d9c9d1231bdfa2147b7dc6ef12743 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 16 Jul 2012 21:52:26 -0700 Subject: working towards getting rid of item['tag'] and item['file'] - still some dependencies --- include/text.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index 1825ec572..d7fc5808f 100644 --- a/include/text.php +++ b/include/text.php @@ -554,17 +554,16 @@ return str_replace ("%","=",rawurlencode($s)); if(! function_exists('get_mentions')) { -function get_mentions($item) { +function get_mentions($item,$tags) { $o = ''; - if(! strlen($item['tag'])) + + if(! count($tags)) return $o; - $arr = explode(',',$item['tag']); - foreach($arr as $x) { - $matches = null; - if(preg_match('/@\[url=([^\]]*)\]/',$x,$matches)) { - $o .= "\t\t" . '' . "\r\n"; - $o .= "\t\t" . '' . "\r\n"; + foreach($tags as $x) { + if($x['type'] == TERM_MENTION) { + $o .= "\t\t" . '' . "\r\n"; + $o .= "\t\t" . '' . "\r\n"; } } return $o; -- cgit v1.2.3