+ $mime = $mtch[3];
+
+ if((local_user() == $item['uid']) && ($item['contact-id'] != $a->contact['id']) && ($item['network'] == NETWORK_DFRN))
+ $the_url = $a->get_baseurl() . '/redir/' . $item['contact-id'] . '?f=1&url=' . $mtch[1];
+ else
+ $the_url = $mtch[1];
+
+ if(strpos($mime, 'video') !== false) {
+ if(!$vhead) {
+ $vhead = true;
+ $a->page['htmlhead'] .= replace_macros(get_markup_template('videos_head.tpl'), array(
+ '$baseurl' => $a->get_baseurl(),
+ ));
+ $a->page['end'] .= replace_macros(get_markup_template('videos_end.tpl'), array(
+ '$baseurl' => $a->get_baseurl(),
+ ));
+ }
+
+ $id = end(explode('/', $the_url));
+ $as .= replace_macros(get_markup_template('video_top.tpl'), array(
+ '$video' => array(
+ 'id' => $id,
+ 'title' => t('View Video'),
+ 'src' => $the_url,
+ 'mime' => $mime,
+ ),
+ ));
+ }
+
+ $filetype = strtolower(substr( $mime, 0, strpos($mime,'/') ));
+ if($filetype) {
+ $filesubtype = strtolower(substr( $mime, strpos($mime,'/') + 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],'/')));