From: friendica Date: Tue, 13 Mar 2012 11:04:26 +0000 (-0700) Subject: initial tag display for categories and save-to-file - suitable for testing but needs... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5a4167646553e589cf9647c0e0d0446e3f5fd672;p=friendica.git initial tag display for categories and save-to-file - suitable for testing but needs cleanup, links to delete term, and theming. --- diff --git a/include/text.php b/include/text.php index 011006b764..2663bdebaa 100644 --- a/include/text.php +++ b/include/text.php @@ -913,6 +913,33 @@ function prepare_body($item,$attach = false) { } $s .= '
'; } + $matches = false; + $cnt = preg_match_all('/<(.*?)>/',$item['file'],$matches,PREG_SET_ORDER); + if($cnt) { + logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG); + foreach($matches as $mtch) { + if(strlen($x)) + $x .= ','; + $x .= file_tag_decode($mtch[1]); + } + if(strlen($x)) + $s .= '
' . t('Categories:') . ' ' . $x . '
'; + + + } + $matches = false; + $x = ''; + $cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER); + if($cnt) { + logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG); + foreach($matches as $mtch) { + if(strlen($x)) + $x .= ','; + $x .= file_tag_decode($mtch[1]); + } + if(strlen($x) && (local_user() == $item['uid'])) + $s .= '
' . t('Filed under:') . ' ' . $x . '
'; + } $prep_arr = array('item' => $item, 'html' => $s);