mirror of
https://github.com/friendica/friendica
synced 2024-11-18 07:03:40 +00:00
add support for more file attachment types
This commit is contained in:
parent
9dbe7efce5
commit
6152cbd5ac
33 changed files with 1044 additions and 7 deletions
File diff suppressed because it is too large
Load diff
|
@ -1050,7 +1050,18 @@ function prepare_body($item,$attach = false) {
|
|||
$cnt = preg_match_all('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"|',$r,$matches, PREG_SET_ORDER);
|
||||
if($cnt) {
|
||||
foreach($matches as $mtch) {
|
||||
$icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/')));
|
||||
$filetype = strtolower(substr( $mtch[3], 0, strpos($mtch[3],'/') ));
|
||||
if($filetype) {
|
||||
$filesubtype = strtolower(substr( $mtch[3], strpos($mtch[3],'/') + 1 ));
|
||||
$filesubtype = str_replace('.', '-', $filesubtype);
|
||||
}
|
||||
else {
|
||||
$filetype = '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':
|
||||
|
@ -1061,7 +1072,8 @@ function prepare_body($item,$attach = false) {
|
|||
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 .= ' ' . $mtch[2] . ' ' . t('bytes');
|
||||
if((local_user() == $item['uid']) && ($item['contact-id'] != $a->contact['id']) && ($item['network'] == NETWORK_DFRN))
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -219,6 +219,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -219,6 +219,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -218,6 +218,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -218,6 +218,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -219,6 +219,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -219,6 +219,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -186,6 +186,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
@ -2568,4 +2569,4 @@ list-style-type: disc;
|
|||
#photos-upload-newalbum-div {
|
||||
float: left;
|
||||
width: 175px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -221,6 +221,7 @@
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -512,7 +512,8 @@ div[id$="wrapper"]{height:100%;}div[id$="wrapper"] br{clear:left;}
|
|||
.icon.dim{opacity:0.3;}
|
||||
#pause{position:fixed;bottom:40px;right:30px;z-index:10;}
|
||||
.border{border:1px solid #babdb6;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;}.border:hover{border:1px solid #babdb6;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;}
|
||||
.attachtype{display:block;width:20px;height:23px;background-image:url(../../../images/content-types.png);}
|
||||
.attachtype{display:block;width:20px;height:23px;background-image:url(../../../images/content-types.png);background-position: -80px 0px;
|
||||
}
|
||||
.type-video{background-position:0px 0px;}
|
||||
.type-image{background-position:-20px 0;}
|
||||
.type-audio{background-position:-40px 0;}
|
||||
|
|
|
@ -2998,6 +2998,7 @@ div {
|
|||
display: block;
|
||||
.box(20px, 23px);
|
||||
background-image: url(../../../images/content-types.png);
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
.type-video {
|
||||
background-position: 0px 0px;
|
||||
|
|
|
@ -512,7 +512,8 @@ div[id$="wrapper"]{height:100%;}div[id$="wrapper"] br{clear:left;}
|
|||
.icon.dim{opacity:0.3;}
|
||||
#pause{position:fixed;bottom:40px;right:30px;z-index:10;}
|
||||
.border{border:1px solid #babdb6;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;}.border:hover{border:1px solid #babdb6;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;}
|
||||
.attachtype{display:block;width:20px;height:23px;background-image:url(../../../images/content-types.png);}
|
||||
.attachtype{display:block;width:20px;height:23px;background-image:url(../../../images/content-types.png);background-position: -80px 0px;
|
||||
}
|
||||
.type-video{background-position:0px 0px;}
|
||||
.type-image{background-position:-20px 0;}
|
||||
.type-audio{background-position:-40px 0;}
|
||||
|
|
|
@ -2999,6 +2999,7 @@ div {
|
|||
display: block;
|
||||
.box(20px, 23px);
|
||||
background-image: url(../../../images/content-types.png);
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
.type-video {
|
||||
background-position: 0px 0px;
|
||||
|
|
|
@ -3137,6 +3137,7 @@ aside input[type='text'] {
|
|||
display: block; width: 20px; height: 23px;
|
||||
float: left;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.body-attach {
|
||||
|
|
|
@ -2935,6 +2935,7 @@ aside input[type='text'] {
|
|||
display: block; width: 20px; height: 23px;
|
||||
float: left;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.body-attach {
|
||||
|
|
|
@ -3850,6 +3850,7 @@ aside input[type='text'] {
|
|||
display: block; width: 20px; height: 23px;
|
||||
float: left;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.body-attach {
|
||||
|
|
|
@ -3761,6 +3761,7 @@ aside input[type='text'] {
|
|||
display: block; width: 20px; height: 23px;
|
||||
float: left;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.body-attach {
|
||||
|
|
|
@ -3792,6 +3792,7 @@ margin-left: 0px;
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url("../../../images/content-types.png");
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
|
|
@ -2962,6 +2962,7 @@ tr {
|
|||
.attachtype {
|
||||
display: block; width: 20px; height: 23px;
|
||||
background-image: url('../../../images/content-types.png');
|
||||
background-position: -80px 0px;
|
||||
}
|
||||
|
||||
.type-video { background-position: 0px 0px; }
|
||||
|
@ -3289,4 +3290,4 @@ ul.menu-popup {
|
|||
/* Pages profile widget */
|
||||
#page-profile div#profile-page-list{
|
||||
margin-left: 45px;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue