X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=71a2564405714659f472904c2f1cf1850edd13c4;hb=2148a2bdb0cb38d3a085109eeeb6acc5d65484e6;hp=ea5deb4c1442a7c43ebb8929dbac66f64209290a;hpb=2b161108fe6552ef2effb7b300553f0242b2e49e;p=friendica.git diff --git a/include/text.php b/include/text.php index ea5deb4c14..71a2564405 100644 --- a/include/text.php +++ b/include/text.php @@ -1374,7 +1374,6 @@ function prepare_body(&$item, $attach = false, $preview = false) { $vhead = false; $arr = explode('[/attach],', $item['attach']); if (count($arr)) { - $as .= '
'; foreach ($arr as $r) { $matches = false; $icon = ''; @@ -1411,39 +1410,33 @@ 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 { $filetype = 'unkn'; $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'); - $as .= '' . $icon . ''; + if (($filetype == 'image') AND ($item['network'] == NETWORK_OSTATUS)) { + $icon = ''; + $s .= '
' . $icon . ''; + } else { + $icon = '
'; + $as .= '' . $icon . ''; + } + } } } - $as .= '
'; } - $s = $s . $as; + if ($as != '') { + $s .= '
'.$as.'
'; + } // map if (strpos($s, '
') !== false && x($item, 'coord')) {