mirror of
https://github.com/friendica/friendica
synced 2025-04-23 23:50:12 +00:00
Attached pictures in OStatus posts are now displayed
This commit is contained in:
parent
7fb4b1be12
commit
910cca0629
1 changed files with 8 additions and 16 deletions
|
@ -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) {
|
if($filetype) {
|
||||||
$filesubtype = strtolower(substr( $mime, strpos($mime,'/') + 1 ));
|
$filesubtype = strtolower(substr($mime, strpos($mime,'/') + 1));
|
||||||
$filesubtype = str_replace('.', '-', $filesubtype);
|
$filesubtype = str_replace('.', '-', $filesubtype);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1407,23 +1407,15 @@ function prepare_body(&$item,$attach = false, $preview = false) {
|
||||||
$filesubtype = 'unkn';
|
$filesubtype = 'unkn';
|
||||||
}
|
}
|
||||||
|
|
||||||
$icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>';
|
|
||||||
/*$icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/')));
|
|
||||||
switch($icontype) {
|
|
||||||
case 'video':
|
|
||||||
case 'audio':
|
|
||||||
case 'image':
|
|
||||||
case 'text':
|
|
||||||
$icon = '<div class="attachtype icon s22 type-' . $icontype . '"></div>';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$icon = '<div class="attachtype icon s22 type-unkn"></div>';
|
|
||||||
break;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1]));
|
$title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1]));
|
||||||
$title .= ' ' . $mtch[2] . ' ' . t('bytes');
|
$title .= ' ' . $mtch[2] . ' ' . t('bytes');
|
||||||
|
|
||||||
|
if (($filetype == 'image') AND ($item['network'] == NETWORK_OSTATUS)) {
|
||||||
|
$icon = '<img src="'.$the_url.'" alt="" title="'.$title.'">';
|
||||||
|
} else {
|
||||||
|
$icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>';
|
||||||
|
}
|
||||||
|
|
||||||
$as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>';
|
$as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue