From: Michael Date: Tue, 6 Jun 2017 17:55:14 +0000 (+0000) Subject: Attached pictures in OStatus posts are now displayed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=910cca06291365d5b8f425dcf0217a452327dea5;p=friendica.git Attached pictures in OStatus posts are now displayed --- diff --git a/include/text.php b/include/text.php index c9babba940..2a8b84c65f 100644 --- a/include/text.php +++ b/include/text.php @@ -1397,9 +1397,9 @@ function prepare_body(&$item,$attach = false, $preview = false) { )); } - $filetype = strtolower(substr( $mime, 0, strpos($mime,'/') )); + $filetype = strtolower(substr($mime, 0, strpos($mime,'/'))); if($filetype) { - $filesubtype = strtolower(substr( $mime, strpos($mime,'/') + 1 )); + $filesubtype = strtolower(substr($mime, strpos($mime,'/') + 1)); $filesubtype = str_replace('.', '-', $filesubtype); } else { @@ -1407,23 +1407,15 @@ function prepare_body(&$item,$attach = false, $preview = false) { $filesubtype = 'unkn'; } - $icon = '
'; - /*$icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/'))); - switch($icontype) { - case 'video': - case 'audio': - case 'image': - case 'text': - $icon = '
'; - break; - default: - $icon = '
'; - break; - }*/ - $title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1])); $title .= ' ' . $mtch[2] . ' ' . t('bytes'); + if (($filetype == 'image') AND ($item['network'] == NETWORK_OSTATUS)) { + $icon = ''; + } else { + $icon = '
'; + } + $as .= '' . $icon . ''; } }