aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-13 04:04:26 -0700
committerfriendica <info@friendica.com>2012-03-13 04:04:26 -0700
commit5a4167646553e589cf9647c0e0d0446e3f5fd672 (patch)
treeed6ecc655add4d0fa2bd2bf233fa648d4d875090 /include
parentbf7425c591de360a97c37544f777d7d69791420c (diff)
downloadvolse-hubzilla-5a4167646553e589cf9647c0e0d0446e3f5fd672.tar.gz
volse-hubzilla-5a4167646553e589cf9647c0e0d0446e3f5fd672.tar.bz2
volse-hubzilla-5a4167646553e589cf9647c0e0d0446e3f5fd672.zip
initial tag display for categories and save-to-file - suitable for testing but needs cleanup, links to delete term, and theming.
Diffstat (limited to 'include')
-rw-r--r--include/text.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php
index 011006b76..2663bdeba 100644
--- a/include/text.php
+++ b/include/text.php
@@ -913,6 +913,33 @@ function prepare_body($item,$attach = false) {
}
$s .= '<div class="clear"></div></div>';
}
+ $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 .= '<div class="categorytags"><span>' . t('Categories:') . ' </span>' . $x . '</div>';
+
+
+ }
+ $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 .= '<div class="filesavetags"><span>' . t('Filed under:') . ' </span>' . $x . '</div>';
+ }
$prep_arr = array('item' => $item, 'html' => $s);