[Linpha-cvs] SF.net SVN: linpha: [4666] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-12-22 15:38:51
|
Revision: 4666 http://svn.sourceforge.net/linpha/?rev=4666&view=rev Author: fangehrn Date: 2006-12-22 07:38:48 -0800 (Fri, 22 Dec 2006) Log Message: ----------- 2006-12-22 flo * added download feature (without watermark and statistics) Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/index.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.identify.class.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/templates/default/view_img.html.php Added Paths: ----------- trunk/linpha2/lib/modules/module.download.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-12-17 21:49:03 UTC (rev 4665) +++ trunk/linpha2/ChangeLog 2006-12-22 15:38:48 UTC (rev 4666) @@ -1,4 +1,7 @@ +2006-12-22 flo + * added download feature (without watermark and statistics) + 2006-12-17 flo * added newest getid3 library * added watermark scripts from linpha1 (used for video thumbnails) Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-12-17 21:49:03 UTC (rev 4665) +++ trunk/linpha2/index.php 2006-12-22 15:38:48 UTC (rev 4666) @@ -58,6 +58,9 @@ case 'exif': require_once(LINPHA_DIR.'/lib/include/File_Info_Show.php'); break; +case 'download': + require_once(LINPHA_DIR.'/lib/modules/module.download.php'); + break; case 'empty': require_once(LINPHA_DIR.'/lib/modules/module.empty.php'); break; Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-12-17 21:49:03 UTC (rev 4665) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-12-22 15:38:48 UTC (rev 4666) @@ -529,6 +529,7 @@ * fm_others, fm_upload, fm_delete, fm_move, fm_copy, fm_rename, fm_create_folder, fm_perm * thumbnail, image * meta_iptc + * download_noperm * * * @param string $type log types @@ -545,17 +546,19 @@ define('LOG_TYPE_META', 4); define('LOG_TYPE_FILEMANAGER', 5); define('LOG_TYPE_GUESTBOOK', 6); +define('LOG_TYPE_BASKET', 7); function linLog($type,$severity,$event,$text) { switch($type) { case LOG_TYPE_IMPORT: $type_msg = 'IMPORT '; break; case LOG_TYPE_UPDATE: $type_msg = 'UPDATE '; break; - case LOG_TYPE_USER: $type_msg = 'USER '; break; + case LOG_TYPE_USER: $type_msg = 'USER '; break; case LOG_TYPE_DB: $type_msg = 'DATABASE'; break; case LOG_TYPE_META: $type_msg = 'COMMENTS'; break; case LOG_TYPE_FILEMANAGER: $type_msg = 'FILEMANAGER'; break; case LOG_TYPE_GUESTBOOK: $type_msg = 'GUESTBOOK'; break; + case LOG_TYPE_BASKET: $type_msg = 'BASKET'; break; } /** Modified: trunk/linpha2/lib/classes/linpha.identify.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.identify.class.php 2006-12-17 21:49:03 UTC (rev 4665) +++ trunk/linpha2/lib/classes/linpha.identify.class.php 2006-12-22 15:38:48 UTC (rev 4666) @@ -513,6 +513,6 @@ ); return $array; } // end function getImagetypeTranslationArray() - + } // end class linIdentify ?> Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-12-17 21:49:03 UTC (rev 4665) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-12-22 15:38:48 UTC (rev 4666) @@ -515,7 +515,7 @@ */ if( $GLOBALS['linpha']->sql->checkPermission('download')) { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.LINPHA_CLIENT.'/download_file.php?id='.$GLOBALS['linpha']->template->idCurrent.'">'. + $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.LINPHA_LINK.'&linCat=download&linId='.$GLOBALS['linpha']->template->idCurrent.'">'. '<img src="'.$GLOBALS['linpha']->template->themeFile('images/download.png').'" border="0" title="'.i18n("Download Image").'" />' .'</a>'."\n"; } Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-12-17 21:49:03 UTC (rev 4665) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-12-22 15:38:48 UTC (rev 4666) @@ -420,7 +420,7 @@ if(isset($_SESSION['user_id'])) { $query = $GLOBALS['linpha']->db->Execute("SELECT option_name, option_value " . - "FROM ".LIN_PREFIX."config WHERE user_id = '".$_SESSION['user_id']."'"); + "FROM ".LIN_PREFIX."config WHERE user_id = '".LinSql::linAddslashes($_SESSION['user_id'])."'"); while($data = $query->FetchRow(ADODB_FETCH_NUM)) { Added: trunk/linpha2/lib/modules/module.download.php =================================================================== --- trunk/linpha2/lib/modules/module.download.php (rev 0) +++ trunk/linpha2/lib/modules/module.download.php 2006-12-22 15:38:48 UTC (rev 4666) @@ -0,0 +1,510 @@ +<?php +/* + * Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> + * Florian Angehrn + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/** + * Download + * @package Modules + * @todo use unified error messages + */ +if(!defined('LINPHA_DIR')) { exit(1); } + +if( !isset($_GET['linId']) ) +{ + echo i18n("No valid id supplied!"); + exit(1); +} + +$fullfilename = LinSql::getFullImagePath($_GET['linId']); + +/** + * check for valid filename + */ +if( $fullfilename === FALSE OR !file_exists($fullfilename) ) +{ + echo i18n("No valid id supplied!"); + exit(1); +} + +/** + * get file informations + */ +$data = $GLOBALS['linpha']->db->GetRow("SELECT md5sum, img_type FROM ".LIN_PREFIX."photos " . + "WHERE id = '".LinSql::linAddslashes($_GET['linId'])."'"); + +$md5sum = $data['md5sum']; +$img_type = $data['img_type']; +$filename = basename($fullfilename); + + +/** + * check download permissions and photos permissions + */ +if( !LinSql::photoIsAllowed( $_GET['linId'], 'read' ) ) +{ + echo i18n("No permission!"); + linLog(LOG_TYPE_BASKET, LOG_ERR, 'download_noperm', 'No permission to access the file '.$_GET['linId']); + exit(1); +} + +/** + * check permission + * allow video allways because we cannot watch a video without downloading it + */ +if( !LinSql::checkPermission('download') AND !LinIdentify::isVideo($img_type) ) +{ + echo i18n("No permission!"); + linLog(LOG_TYPE_BASKET, LOG_ERR, 'download_noperm', 'No permission to access the file '.$_GET['linId']); + exit(1); +} + +/** + * statistics + * do not count video views as downloads + */ +if( isset($_GET['isDownload']) OR !LinIdentify::isVideo($img_type) ) +{ + $GLOBALS['linpha']->db->Execute("UPDATE ".LIN_PREFIX."photos " . + "SET stats_downloads = stats_downloads + 1 WHERE md5sum='".$md5sum."'"); + + /** + * @todo + include_once(TOP_DIR.'/plugins/stats/stats.class.php'); + linStats('download',$md5sum); + */ +} + + +/** +* Watermark stuff +* +* if watermark is enabled (and it is a valid image), don't download the original image, +* but download a watermarked image +* +* @todo +*/ + //if(need_watermark($_GET['imgid']) && is_supported_image($org_type)) + +/** + * disable zlib compression to avoid broken archives + */ +@ini_set ('zlib.output_compression', 'Off'); + +header("Pragma: public"); +header("Expires: 0"); +header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); +header("Content-Type: ".get_mime_by_ext( LinFilesys::getFileExtFromPath($filename) )); + +/** + * removed this browser switch as it makes problem with ie6 and tiff files + * see http://sourceforge.net/tracker/index.php?func=detail&aid=999178&group_id=64772&atid=508614 + * +$user_agent = @strtolower($_SERVER["HTTP_USER_AGENT"]); +if ((is_integer (strpos($user_agent, "msie"))) && (is_integer (strpos($user_agent, "win")))) { + header( "Content-Disposition: filename=".$filename.";" ); +} else { + header( "Content-Disposition: attachment; filename=".$filename.";" ); +}*/ + +header( "Content-Disposition: attachment; filename=".$filename.";" ); + +header("Content-Transfer-Encoding: binary"); +header("Content-Length: ".filesize($fullfilename)); +readfile($fullfilename); + + +/** + * get the mime-type by file extension + * @uses module download + */ +function get_mime_by_ext($ext) +{ + $ext = strtolower($ext); + + /*switch($ext) { + case "avi": return "video/avi"; + case "mpg": return "video/mpeg"; + case "mpeg": return "video/mpeg"; + case "mp4": return "video/quicktime"; + case "mov": return "video/quicktime"; + + case "bmp": return "image/bmp"; + case "gif": return "image/gif"; + case "png": return "image/png"; + case "jpg": return "image/jpg"; + case "jpeg": return "image/jpg"; + case "psd": return "image/psd"; + case "tif": return "image/tiff"; + case "tiff": return "image/tiff"; + + case "tar": return "application/x-tar"; + case "gz": return "application/x-gzip"; + case "bz2": return "application/zip"; + case "zip": return "application/zip"; + case "rar": return "application/rar"; + + default: return "application/force-download"; + }*/ + + $arrayMimeTypes = array( + '323' => 'text/h323', + '3gp' => 'audio/3gpp', + '3gp' => 'video/3gpp', + 'IVF' => 'video/x-ivf', + 'Mtx' => 'Application/metastream', + 'aaf' => 'application/octet-stream', + 'aca' => 'application/octet-stream', + 'ace' => 'application/x-compressed', + 'acx' => 'application/internet-property-stream', + 'aer' => 'Application/atmosphere', + 'afm' => 'application/octet-stream', + 'ai' => 'application/postscript', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/aiff', + 'aiff' => 'audio/aiff', + 'application' => 'application/x-ms-application', + 'art' => 'image/x-jg', + 'as' => 'text/plain', + 'asd' => 'application/octet-stream', + 'asf' => 'video/x-ms-asf', + 'asi' => 'application/octet-stream', + 'asm' => 'text/plain', + 'asr' => 'video/x-ms-asf', + 'asx' => 'video/x-ms-asf', + 'au' => 'audio/basic', + 'avi' => 'video/x-msvideo', + 'axs' => 'application/olescript', + 'bas' => 'text/plain', + 'bcpio' => 'application/x-bcpio', + 'bin' => 'application/octet-stream', + 'bmp' => 'image/bmp', + 'c' => 'text/plain', + 'cab' => 'application/octet-stream', + 'cat' => 'application/vnd.ms-pki.seccat', + 'cdf' => 'application/x-cdf', + //'cfg' => '3DVista CFG', + 'chm' => 'application/octet-stream', + 'class' => 'application/x-java-applet', + 'clp' => 'application/x-msclip', + 'cmx' => 'image/x-cmx', + 'cnf' => 'text/plain', + 'co' => 'application/x-cult3d-object', + 'cod' => 'image/cis-cod', + 'cpio' => 'application/x-cpio', + 'cpp' => 'text/plain', + 'crd' => 'application/x-mscardfile', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'csh' => 'application/x-csh', + 'css' => 'text/css', + 'csv' => 'application/octet-stream', + 'cur' => 'application/octet-stream', + 'dcr' => 'application/x-director', + 'deploy' => 'application/octet-stream', + 'der' => 'application/x-x509-ca-cert', + 'dib' => 'image/bmp', + 'dir' => 'application/x-director', + 'disco' => 'text/xml', + 'djv' => 'Image/x.djvu', + 'djvu' => 'Image/x.djvu', + 'dll' => 'application/x-msdownload', + 'dlm' => 'text/dlm', + 'dnl' => 'application/x-msdownload', + 'doc' => 'application/msword', + 'dot' => 'application/msword', + 'dsp' => 'application/octet-stream', + 'dtd' => 'text/xml', + 'dvi' => 'application/x-dvi', + 'dwf' => 'drawing/x-dwf', + 'dwg' => 'image/x-dwg', + 'dwp' => 'application/octet-stream', + 'dxr' => 'application/x-director', + 'eml' => 'message/rfc822', + 'emz' => 'application/octet-stream', + 'eot' => 'application/octet-stream', + 'eps' => 'application/postscript', + 'etx' => 'text/x-setext', + 'evy' => 'application/envoy', + 'exe' => 'application/octet-stream', + 'fdf' => 'application/vnd.fdf', + 'fif' => 'application/fractals', + 'fla' => 'application/octet-stream', + 'flr' => 'x-world/x-vrml', + 'flv' => 'application/x-shockwave-flash', + 'gif' => 'image/gif', + 'gtar' => 'application/x-gtar', + 'gz' => 'application/x-gzip', + 'h' => 'text/plain', + 'hdf' => 'application/x-hdf', + 'hdml' => 'text/x-hdml', + 'hhc' => 'application/x-oleobject', + 'hhk' => 'application/octet-stream', + 'hhp' => 'application/octet-stream', + 'hlp' => 'application/winhlp', + 'hqx' => 'application/mac-binhex40', + 'hta' => 'application/hta', + 'htc' => 'text/x-component', + 'htm' => 'text/html', + 'html' => 'text/html', + 'htt' => 'text/webviewhtml', + 'hxt' => 'text/html', + 'ico' => 'image/x-icon', + 'ics' => 'application/octet-stream', + 'ief' => 'image/ief', + 'iii' => 'application/x-iphone', + 'inf' => 'application/octet-stream', + 'ins' => 'application/x-internet-signup', + 'ips' => 'application/x-ipscript', + 'ipx' => 'application/x-ipix', + 'isp' => 'application/x-internet-signup', + 'ivr' => 'i-world/i-vrml', + 'jad' => 'text/vnd.sun.j2me.app-descriptor', + 'jar' => 'application/java-archive', + 'java' => 'application/octet-stream', + 'jck' => 'application/liquidmotion', + 'jcz' => 'application/liquidmotion', + 'jfif' => 'image/pjpeg', + 'jpb' => 'application/octet-stream', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'js' => 'application/x-javascript', + 'kml' => 'Application/vnd.google-earth.kml+xml', + 'kmz' => 'Application/vnd.google-earth.kmz', + 'latex' => 'application/x-latex', + 'lit' => 'application/x-ms-reader', + 'lpk' => 'application/octet-stream', + 'lsf' => 'video/x-la-asf', + 'lsx' => 'video/x-la-asf', + 'lzh' => 'application/octet-stream', + 'm13' => 'application/x-msmediaview', + 'm14' => 'application/x-msmediaview', + 'm1v' => 'video/mpeg', + 'm3u' => 'audio/x-mpegurl', + 'man' => 'application/x-troff-man', + 'manifest' => 'application/x-ms-manifest', + 'map' => 'text/plain', + 'mdb' => 'application/x-msaccess', + 'mdp' => 'application/octet-stream', + 'me' => 'application/x-troff-me', + 'mht' => 'message/rfc822', + 'mhtml' => 'message/rfc822', + 'mid' => 'audio/mid', + 'midi' => 'audio/mid', + 'mix' => 'application/octet-stream', + 'mmf' => 'application/x-smaf', + 'mno' => 'text/xml', + 'mny' => 'application/x-msmoney', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'video/mpeg', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mpa' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpp' => 'application/vnd.ms-project', + 'mpv2' => 'video/mpeg', + 'ms' => 'application/x-troff-ms', + 'msi' => 'application/octet-stream', + 'mts' => 'Application/metastream', + 'mvb' => 'application/x-msmediaview', + 'mw2' => 'Image/x.mw2', + 'mwx' => 'Image/x.mwx', + 'nc' => 'application/x-netcdf', + 'nsc' => 'video/x-ms-asf', + 'nws' => 'message/rfc822', + 'ocx' => 'application/octet-stream', + 'oda' => 'application/oda', + 'ods' => 'application/oleobject', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'p10' => 'application/pkcs10', + 'p12' => 'application/x-pkcs12', + 'p7b' => 'application/x-pkcs7-certificates', + 'p7c' => 'application/pkcs7-mime', + 'p7m' => 'application/pkcs7-mime', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'pbm' => 'image/x-portable-bitmap', + 'pcx' => 'application/octet-stream', + 'pcz' => 'application/octet-stream', + 'pdf' => 'application/pdf', + 'pfb' => 'application/octet-stream', + 'pfm' => 'application/octet-stream', + 'pfx' => 'application/x-pkcs12', + 'pgm' => 'image/x-portable-graymap', + 'pko' => 'application/vnd.ms-pki.pko', + 'pma' => 'application/x-perfmon', + 'pmc' => 'application/x-perfmon', + 'pml' => 'application/x-perfmon', + 'pmr' => 'application/x-perfmon', + 'pmw' => 'application/x-perfmon', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'pnz' => 'image/png', + 'pot' => 'application/vnd.ms-powerpoint', + 'ppm' => 'image/x-portable-pixmap', + 'pps' => 'application/vnd.ms-powerpoint', + 'ppt' => 'application/vnd.ms-powerpoint', + 'prf' => 'application/pics-rules', + 'prm' => 'application/octet-stream', + 'prx' => 'application/octet-stream', + 'ps' => 'application/postscript', + 'psd' => 'application/octet-stream', + 'psm' => 'application/octet-stream', + 'psp' => 'application/octet-stream', + 'pub' => 'application/x-mspublisher', + 'qt' => 'video/quicktime', + 'qtl' => 'application/x-quicktimeplayer', + 'qxd' => 'application/octet-stream', + 'ra' => 'audio/x-pn-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'rar' => 'application/octet-stream', + 'ras' => 'image/x-cmu-raster', + //'rba' => '3DVista Audio', + 'rdf' => 'application/xml', + 'rf' => 'image/vnd.rn-realflash', + 'rgb' => 'image/x-rgb', + 'rm' => 'application/vnd.rn-realmedia', + 'rmi' => 'audio/mid', + 'rmvb' => 'application/vnd.rn-realmedia-vbr', + 'roff' => 'application/x-troff', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'rtf' => 'application/rtf', + 'rtx' => 'text/richtext', + 'scd' => 'application/x-msschedule', + 'sct' => 'text/scriptlet', + 'sea' => 'application/octet-stream', + 'setpay' => 'application/set-payment-initiation', + 'setreg' => 'application/set-registration-initiation', + 'sgml' => 'text/sgml', + 'sh' => 'application/x-sh', + 'shar' => 'application/x-shar', + 'sit' => 'application/x-stuffit', + //'ski' => '3DVista SKI', + //'skz' => '3DVista SKZ', + 'smd' => 'audio/x-smd', + 'smi' => 'application/octet-stream', + 'smx' => 'audio/x-smd', + 'smz' => 'audio/x-smd', + 'snd' => 'audio/basic', + 'snp' => 'application/octet-stream', + 'spc' => 'application/x-pkcs7-certificates', + 'spl' => 'application/futuresplash', + 'src' => 'application/x-wais-source', + 'ssm' => 'application/streamingmedia', + 'sst' => 'application/vnd.ms-pki.certstore', + 'stl' => 'application/vnd.ms-pki.stl', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'svg' => 'image/svg+xml', + 'svg2' => 'image/svg+xml', + 'svgz' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 't' => 'application/x-troff', + 'tar' => 'application/x-tar', + 'tcl' => 'application/x-tcl', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', + 'texinfo' => 'application/x-texinfo', + 'tgz' => 'application/x-compressed', + 'thn' => 'application/octet-stream', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'toc' => 'application/octet-stream', + 'tr' => 'application/x-troff', + 'trm' => 'application/x-msterminal', + 'tsv' => 'text/tab-separated-values', + 'ttf' => 'application/octet-stream', + 'txt' => 'text/plain', + 'u32' => 'application/octet-stream', + 'uls' => 'text/iuls', + 'ustar' => 'application/x-ustar', + 'utx' => 'Text/xml', + 'vbs' => 'text/vbscript', + 'vcf' => 'text/x-vcard', + 'vcs' => 'text/plain', + 'vdx' => 'application/vnd.visio', + 'vml' => 'text/xml', + 'vsd' => 'application/vnd.visio', + 'vss' => 'application/vnd.visio', + 'vst' => 'application/vnd.visio', + 'vsw' => 'application/vnd.visio', + 'vsx' => 'application/vnd.visio', + 'vtx' => 'application/vnd.visio', + 'wav' => 'audio/wav', + 'wax' => 'audio/x-ms-wax', + 'wbmp' => 'image/vnd.wap.wbmp', + 'wcm' => 'application/vnd.ms-works', + 'wdb' => 'application/vnd.ms-works', + 'wks' => 'application/vnd.ms-works', + 'wm' => 'video/x-ms-wm', + 'wma' => 'audio/x-ms-wma', + 'wmd' => 'application/x-ms-wmd', + 'wmf' => 'application/x-msmetafile', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'wmp' => 'video/x-ms-wmp', + 'wmv' => 'video/x-ms-wmv', + 'wmx' => 'video/x-ms-wmx', + 'wmz' => 'application/x-ms-wmz', + 'wps' => 'application/vnd.ms-works', + 'wri' => 'application/x-mswrite', + 'wrl' => 'x-world/x-vrml', + 'wrz' => 'x-world/x-vrml', + 'wsdl' => 'text/xml', + 'wvx' => 'video/x-ms-wvx', + 'x' => 'application/directx', + 'xaf' => 'x-world/x-vrml', + 'xbm' => 'image/x-xbitmap', + 'xdr' => 'text/plain', + 'xla' => 'application/vnd.ms-excel', + 'xlc' => 'application/vnd.ms-excel', + 'xlm' => 'application/vnd.ms-excel', + 'xls' => 'application/vnd.ms-excel', + 'xlt' => 'application/vnd.ms-excel', + 'xlw' => 'application/vnd.ms-excel', + 'xml' => 'text/xml', + 'xof' => 'x-world/x-vrml', + 'xpm' => 'image/x-xpixmap', + 'xsd' => 'text/xml', + 'xsf' => 'text/xml', + 'xsl' => 'text/xml', + 'xslt' => 'text/xml', + 'xsn' => 'application/octet-stream', + 'xwd' => 'image/x-xwindowdump', + 'z' => 'application/x-compress', + 'zip' => 'application/x-zip-compressed' + ); + + if( isset($arrayMimeTypes[$ext])) + { + return $arrayMimeTypes[$ext]; + } + else + { + return "application/force-download"; + } + +} + +?> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2006-12-17 21:49:03 UTC (rev 4665) +++ trunk/linpha2/templates/default/view_img.html.php 2006-12-22 15:38:48 UTC (rev 4666) @@ -46,7 +46,7 @@ <div id="linDivVideoLink" class="linDivMetaLinks"> <a href="<?php echo LINPHA_LINK.'linCat=video&linId='.$linTpl->idCurrent; ?>" onclick="javascript:myLinImage.updateLinId(this)" target="_blank"><?php echo i18n("Play Video"); ?></a> <br /><br /> - <a href="<?php echo LINPHA_LINK.'linCat=download&linId='.$linTpl->idCurrent; ?>" onclick="javascript:myLinImage.updateLinId(this)"><?php echo i18n("Download Video"); ?></a> + <a href="<?php echo LINPHA_LINK.'linCat=download&linId='.$linTpl->idCurrent; ?>&isDownload=true" onclick="javascript:myLinImage.updateLinId(this)"><?php echo i18n("Download Video"); ?></a> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |