]> git.mxchange.org Git - friendica.git/commitdiff
initial tag display for categories and save-to-file - suitable for testing but needs...
authorfriendica <info@friendica.com>
Tue, 13 Mar 2012 11:04:26 +0000 (04:04 -0700)
committerfriendica <info@friendica.com>
Tue, 13 Mar 2012 11:04:26 +0000 (04:04 -0700)
include/text.php

index 011006b764cfd2058f2e41b2b08f9d9a494fda58..2663bdebaa7bd41947f83987e6bd9a1427ee4fd4 100644 (file)
@@ -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);