]> git.mxchange.org Git - friendica.git/commitdiff
attachment display
authorFriendika <info@friendika.com>
Wed, 25 May 2011 03:41:29 +0000 (20:41 -0700)
committerFriendika <info@friendika.com>
Wed, 25 May 2011 03:41:29 +0000 (20:41 -0700)
boot.php
include/conversation.php
view/theme/dispy/style.css
view/theme/duepuntozero/style.css
view/theme/loozah/style.css

index faf3c4db4affdb7ffe270c9380402008f948985a..b328eec0e6b15fbdfd6f0c0a6c7f66d6db69f621 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2540,8 +2540,40 @@ function link_compare($a,$b) {
 
 
 if(! function_exists('prepare_body')) {
-function prepare_body($item) {
-       return prepare_text($item['body']);
+function prepare_body($item,$attach = false) {
+
+       $s = prepare_text($item['body']);
+       if(! $attach)
+               return $s;
+
+       $arr = explode(',',$item['attach']);
+       if(count($arr)) {
+               foreach($arr as $r) {
+                       $matches = false;
+                       $icon = '';
+                       $cnt = preg_match('|\[attach\]href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" title=\"(.+?)\"\[\/attach\]|',$r,$matches);
+                       if($cnt) {
+                               $icontype = strtolower(substr($matches[3],0,strpos($matches[3],'/')));
+                               switch($icontype) {
+                                       case 'video':
+                                       case 'audio':
+                                       case 'image':
+                                       case 'text':
+                                               $icon = '<div class="attachtype type-' . $attachtype . '"></div>';
+                                               break;
+                                       default:
+                                               $icon = '<div class="attachtype type-unkn"></div>';
+                                               break;
+                               }
+                               $title = ((strlen(trim($matches[4]))) ? escape_tags(trim($matches[4])) : escape_tags($matches[1]));
+                               $title .= ' ' . $matches[2] . ' ' . t('bytes');
+
+                               $s .= '<a href="' . strip_tags($matches[1]) . '" title="' . $title . '" >' . $icon . '</a>';
+                       }
+               }
+       }
+       $s .= '<div class="clear"></div>';
+       return $s;
 }}
 
 if(! function_exists('prepare_text')) {
index 4fa4b92ada48b11db0eb2769956ac81e6931bc9f..742df20cbd90e473974f7ff00df3d352f4ac38e4 100644 (file)
@@ -183,6 +183,8 @@ function conversation(&$a, $items, $mode, $update) {
 
                                $drop = replace_macros($droptpl,array('$id' => $item['id']));
                                $lock = '<div class="wall-item-lock"></div>';
+
+                               $body = prepare_body($item);
                                
                                $o .= replace_macros($tpl,array(
                                        '$id' => $item['item_id'],
@@ -194,7 +196,7 @@ function conversation(&$a, $items, $mode, $update) {
                                        '$lock' => $lock,
                                        '$thumb' => $profile_avatar,
                                        '$title' => $item['title'],
-                                       '$body' => smilies(bbcode($item['body'])),
+                                       '$body' => $body,
                                        '$ago' => relative_date($item['created']),
                                        '$location' => $location,
                                        '$indent' => '',
@@ -441,6 +443,9 @@ function conversation(&$a, $items, $mode, $update) {
 
                        // Build the HTML
 
+                       $body = prepare_body($item);
+
+
                        $tmp_item = replace_macros($template,array(
                                '$id' => $item['item_id'],
                                '$linktitle' => sprintf( t('View %s\'s profile'), $profile_name),
@@ -455,7 +460,7 @@ function conversation(&$a, $items, $mode, $update) {
                                '$osparkle' => $osparkle,
                                '$sparkle' => $sparkle,
                                '$title' => $item['title'],
-                               '$body' => smilies(bbcode($item['body'])),
+                               '$body' => $body,
                                '$ago' => relative_date($item['created']),
                                '$lock' => $lock,
                                '$location' => $location,
index 9ef5df0ce9040464e9093b7a9dd5a56828fdae1c..a72f8c60cb5d5723c8032a0636f2f70b4f7d37f1 100644 (file)
@@ -807,6 +807,7 @@ section { margin: 10px 11% 0px 11%; font-size: 0.8em; padding-right: 230px;}
 
 .attachtype {
        display: block; width: 20px; height: 23px;
+       padding: 3px;
        background-image: url('../../../images/content-types.gif');
 }
 
index c639f15714736e6a9338ab2b8b7753416bcd4d51..485efec59174b0fbf83081adee3620b38215dcf6 100644 (file)
@@ -2426,6 +2426,8 @@ a.mail-list-link {
 
 .attachtype {
        display: block; width: 20px; height: 23px;
+       padding: 3px;
+       float: left;
        background-image: url('../../../images/content-types.gif');
 }
 
index f5bc4b3c81d8760b395b53ada335621a8f55b8c8..c5358aad9f110a309df3751df6c85e30f152e648 100644 (file)
@@ -2443,6 +2443,8 @@ a.mail-list-link {
 
 .attachtype {
        display: block; width: 20px; height: 23px;
+       padding: 3px;
+       float: left;
        background-image: url('../../../images/content-types.gif');
 }