function list_prev($file_data) { $type = attach::get_type($file_data['file_name']); if ($type == 'IMAGE') { return '<img src="' . attach::file_link($file_data) . '?size=100x100"/>'; } if ($type == 'FVIDEO') { return '<img src="' . attach::file_link($file_data) . '?size=100x80"/>'; } return '<img src="' . URL . '/tpl/images/attach/' . $GLOBALS['att_type'][$type]['icon'] . '.png"/>'; }
} $cache = false; if (@$_SERVER['HTTP_IF_MODIFIED_SINCE'] || @$_SERVER['HTTP_IF_NONE_MATCH']) { @header('HTTP/1.1 304 Not Modified'); $cache = true; } $mime = $data['file_mime']; # thumb requested? if (@$_GET['size'] && attach::get_type($data['file_name']) == 'IMAGE') { $res = get_prev($id, $_GET['size']); if ($res) { #$mime = 'image/png'; $data_l = $res; } } if (@$_GET['size'] && attach::get_type($data['file_name']) == 'FVIDEO') { $res = get_video_prev($id, $_GET['size']); #exit (); if ($res) { $mime = 'image/jpeg'; $data_l = $res; } } if ($mime) { @header('Content-Type: ' . $mime); } else { @header('Content-Type: application/x-force-download'); } #@header ('Last-Modified: Fri, 02 May 2008 00:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', 880000) . ' GMT'); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 880000) . ' GMT');