|
From: FlorinCB <ory...@us...> - 2008-09-04 20:36:23
|
Update of /cvsroot/mxbb/mx_smartor/album_mod/modules In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3135 Modified Files: album_picm.php Log Message: fix Index: album_picm.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_picm.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_picm.php 13 Mar 2008 08:35:57 -0000 1.3 --- album_picm.php 4 Sep 2008 20:36:18 -0000 1.4 *************** *** 73,76 **** --- 73,85 ---- $pic_thumbnail = $thispic['pic_thumbnail']; + $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); + $pic_fullpath = ALBUM_UPLOAD_PATH . $pic_filename; + $pic_wm_fullpath = ALBUM_WM_CACHE_PATH . 'full_' . $pic_filename; + $pic_med_fullpath = ALBUM_MED_CACHE_PATH . $pic_thumbnail; + $pic_title = $thispic['pic_title']; + $pic_title_reg = ereg_replace("[^A-Za-z0-9]", "_", $pic_title); + $apply_wm = false; + $wm_file = ALBUM_WM_FILE; + if( empty($thispic) or !file_exists(ALBUM_UPLOAD_PATH . $pic_filename) ) { *************** *** 102,106 **** if (empty($thiscat)) { ! die($lang['Category_not_exist']); } --- 111,115 ---- if (empty($thiscat)) { ! //die($lang['Category_not_exist']); } *************** *** 110,118 **** // ------------------------------------ ! $album_user_access = album_user_access($cat_id, $thiscat, 1, 0, 0, 0, 0, 0); // VIEW ! if ($album_user_access['view'] == 0) { ! die($lang['Not_Authorised']); } --- 119,127 ---- // ------------------------------------ ! $album_user_access = album_user_access($cat_id, $thiscat, 1, 0, 1, 1, 1, 1); ! if (($auth_data['view'] == 0) && ($album_user_access['view'] == false)) { ! mx_message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); } *************** *** 133,137 **** } - // ------------------------------------ // Check hotlink --- 142,145 ---- *************** *** 182,186 **** // ------------------------------------ ! if( ($pic_filetype != '.jpg') and ($pic_filetype != '.png') ) { // -------------------------------- --- 190,194 ---- // ------------------------------------ ! if( ($pic_filetype != '.jpg') && ($pic_filetype != '.JPG') && ($pic_filetype != '.png') && ($pic_filetype != '.PNG') ) { // -------------------------------- *************** *** 202,214 **** switch ($pic_filetype) { case '.jpg': ! header('Content-type: image/jpeg'); break; case '.png': ! header('Content-type: image/png'); break; } ! readfile(ALBUM_MED_CACHE_PATH . $pic_thumbnail); exit; } --- 210,247 ---- switch ($pic_filetype) { + case '.gif': + $file_header = 'Content-type: image/gif'; + break; case '.jpg': ! $file_header = 'Content-type: image/jpeg'; break; case '.png': ! $file_header = 'Content-type: image/png'; ! break; ! default: ! header('Content-type: image/jpeg'); ! header('Content-Disposition: filename=' . $pic_title_reg . $pic_filetype); ! readfile($images['no_thumbnail']); ! exit; break; } + + if ( (($pic_filetype == '.jpg') || ($pic_filetype == '.png')) && ($apply_wm == false) ) + { + header($file_header); + header('Content-Disposition: filename=' .$pic_title_reg . $pic_filetype); + readfile($pic_med_fullpath); + exit; + } ! if ( $pic_filetype == '.gif' ) ! { ! header($file_header); ! header('Content-Disposition: filename=' . $pic_title_reg . $pic_filetype); ! readfile($pic_med_fullpath); ! exit; ! } ! ! readfile($pic_med_fullpath); exit; } |