|
From: Florin C B. <ory...@us...> - 2010-07-23 11:15:25
|
Update of /cvsroot/mxbb/mx_smartor/album_mod/modules In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv17054/modules Modified Files: album_pic.php album_pic_nuffed.php album_showpage.php album_thumbnail.php Log Message: Index: album_pic_nuffed.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_pic_nuffed.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_pic_nuffed.php 13 Mar 2008 11:52:44 -0000 1.3 --- album_pic_nuffed.php 23 Jul 2010 11:15:17 -0000 1.4 *************** *** 41,44 **** --- 41,48 ---- else { + //header('Content-type: image/jpeg'); + //header('Content-Disposition: filename=' . $images['no_picure']); + //readfile($images['no_picure']); + //exit; mx_message_die(GENERAL_MESSAGE, 'No pics specified'); } *************** *** 86,89 **** --- 90,106 ---- if( empty($thispic) || !file_exists(ALBUM_UPLOAD_PATH . $pic_filename) ) { + if(empty($images['no_picure']) || file_exists($module_root_path. 'album_mod/nopicture.jpg')) + { + header('Content-type: image/jpeg'); + header('Content-Disposition: filename=\'PHPBB_URL. $module_root_path. \'album_mod/nopicture.jpg'); + readfile($module_root_path. 'album_mod/nopicture.jpg'); + } + else + { + header('Content-type: image/jpeg'); + header('Content-Disposition: filename=' . $images['no_picure']); + readfile($images['no_picure']); + } + exit; mx_message_die(GENERAL_MESSAGE, $lang['Pic_not_exist']); } Index: album_thumbnail.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_thumbnail.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_thumbnail.php 30 Aug 2008 22:23:00 -0000 1.5 --- album_thumbnail.php 23 Jul 2010 11:15:17 -0000 1.6 *************** *** 70,73 **** --- 70,77 ---- } + // Mighty Gorgon: this code is reserved for generating extra thumbnail size on the fly... + $req_thumb_size = $mx_request_vars->request('thumbnail_size', MX_TYPE_NO_TAGS, $album_config['thumbnail_size']); + $req_thumb_size = (($req_thumb_size > 600) || ($req_thumb_size < 30)) ? $album_config['thumbnail_size'] : $req_thumb_size; + $cat_id = $thispic['pic_cat_id']; $album_user_id = $thispic['cat_user_id']; *************** *** 76,87 **** $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); $pic_fullpath = ALBUM_UPLOAD_PATH . $pic_filename; $pic_thumbnail_new = md5($pic_filename) . $pic_filetype; ! $pic_thumbnail = ( $thispic['pic_thumbnail'] == '' ) ? $pic_thumbnail_new : $thispic['pic_thumbnail']; //$pic_thumbnail = ( $thispic['pic_thumbnail'] == '' ) ? $pic_filename : $thispic['pic_thumbnail']; $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; $pic_thumbnail_new_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail_new; $pic_title = $thispic['pic_title']; $pic_title_reg = ereg_replace("[^A-Za-z0-9]", "_", $pic_title); if( empty($thispic) || !file_exists($pic_fullpath) ) { --- 80,135 ---- $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); $pic_fullpath = ALBUM_UPLOAD_PATH . $pic_filename; + $pic_fullpath = str_replace(array(' '), array('%20'), $pic_id); + $pic_id = str_replace('http://', '', str_replace('https://', '', $pic_id)); $pic_thumbnail_new = md5($pic_filename) . $pic_filetype; ! $pic_thumbnail = ($thispic['pic_thumbnail'] == '') ? $pic_thumbnail_new : $thispic['pic_thumbnail']; //$pic_thumbnail = ( $thispic['pic_thumbnail'] == '' ) ? $pic_filename : $thispic['pic_thumbnail']; $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; $pic_thumbnail_new_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail_new; + // Mighty Gorgon: this prefix is needed to not overwrite standard thumbnails with the ones generated with the extra size... + $pic_thumbnail_prefix = 'mid_' . (($req_thumb_size != $album_config['thumbnail_size']) ? ($req_thumb_size . '_') : '') . md5($pic_id); + $thumb_ext_array = array('gif', 'jpg', 'png'); $pic_title = $thispic['pic_title']; $pic_title_reg = ereg_replace("[^A-Za-z0-9]", "_", $pic_title); + if (!in_array($pic_filetype, $thumb_ext_array)) + { + $image_processed = true; + $pic_size = get_full_image_info($pic_fullpath); + + if($pic_size == false) + { + if(empty($images['no_thumbnail']) || file_exists($module_root_path. 'album_mod/nothumbnail.jpg')) + { + header('Content-type: image/jpeg'); + header('Content-Disposition: filename=thumb_' . $pic_title_reg . '.' . $pic_filetype); + readfile($module_root_path. 'album_mod/nothumbnail.jpg'); + } + else + { + header('Content-type: image/jpeg'); + header('Content-Disposition: filename=thumb_' . $pic_title_reg . '.' . $pic_filetype); + readfile($images['no_thumbnail']); + } + exit; + } + + $pic_width = $pic_size['width']; + $pic_height = $pic_size['height']; + $pic_filetype = strtolower($pic_size['type']); + + $pic_title = substr($pic_filename, 0, strlen($pic_filename) - strlen($pic_filetype) - 1); + $pic_title_reg = ereg_replace("[^A-Za-z0-9]", '_', $pic_title); + $pic_thumbnail = $pic_thumbnail_prefix . '.' . $pic_filetype; + } + else + { + $pic_title = substr($pic_filename, 0, strlen($pic_filename) - strlen($pic_filetype) - 1); + $pic_title_reg = ereg_replace("[^A-Za-z0-9]", '_', $pic_title); + $pic_thumbnail = $pic_thumbnail_prefix . '_' . $pic_filename; + } + + $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; + if( empty($thispic) || !file_exists($pic_fullpath) ) { Index: album_showpage.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_showpage.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** album_showpage.php 12 Sep 2008 05:17:58 -0000 1.7 --- album_showpage.php 23 Jul 2010 11:15:17 -0000 1.8 *************** *** 1101,1104 **** --- 1101,1110 ---- } // Mighty Gorgon - Slideshow - END + + if( @filesize(ALBUM_UPLOAD_PATH . $thispic['pic_filename']) == false ) + { + print("filesize() stat failed for this picture, or file was deleted on server."); + $thispic['pic_filename'] = "fap_nothumbnail.jpg"; + } // Mighty Gorgon - Pic Size - BEGIN *************** *** 1106,1110 **** $pic_width = $pic_size[0]; $pic_height = $pic_size[1]; ! $pic_filesize = filesize(ALBUM_UPLOAD_PATH . $thispic['pic_filename']); // Mighty Gorgon - Pic Size - END --- 1112,1116 ---- $pic_width = $pic_size[0]; $pic_height = $pic_size[1]; ! $pic_filesize = @filesize(ALBUM_UPLOAD_PATH . $thispic['pic_filename']); // Mighty Gorgon - Pic Size - END Index: album_pic.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_pic.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_pic.php 13 Mar 2008 08:35:57 -0000 1.3 --- album_pic.php 23 Jul 2010 11:15:17 -0000 1.4 *************** *** 69,72 **** --- 69,76 ---- } + // Mighty Gorgon: this code is reserved for generating extra thumbnail size on the fly... + $req_thumb_size = $mx_request_vars->request('thumbnail_size', MX_TYPE_NO_TAGS, $album_config['thumbnail_size']); + $req_thumb_size = (($req_thumb_size > 600) || ($req_thumb_size < 30)) ? $album_config['thumbnail_size'] : $req_thumb_size; + $cat_id = $thispic['pic_cat_id']; $album_user_id = $thispic['cat_user_id']; *************** *** 76,79 **** --- 80,86 ---- $pic_fullpath = ALBUM_UPLOAD_PATH . $pic_filename; $pic_wm_fullpath = ALBUM_WM_CACHE_PATH . 'full_' . $pic_filename; + // Mighty Gorgon: this prefix is needed to not overwrite standard thumbnails with the ones generated with the extra size... + $pic_wm_prefix = 'mid_' . (($req_thumb_size != $album_config['thumbnail_size']) ? ($req_thumb_size . '_') : '') . md5($pic_id); + $pic_ext_array = array('gif', 'jpg', 'png'); $pic_title = $thispic['pic_title']; $pic_title_reg = ereg_replace("[^A-Za-z0-9]", "_", $pic_title); *************** *** 87,91 **** } ! if( empty($thispic) || !file_exists($pic_fullpath) ) { mx_message_die(GENERAL_MESSAGE, $lang['Pic_not_exist']); --- 94,131 ---- } ! if (!in_array($pic_filetype, $pic_ext_array)) ! { ! $image_processed = true; ! $pic_size = get_full_image_info($pic_fullpath); ! ! if($pic_size == false) ! { ! if(empty($images['no_thumbnail']) || file_exists($module_root_path. 'album_mod/nopicture.jpg')) ! { ! header('Content-type: image/jpeg'); ! header('Content-Disposition: filename=thumb_' . $pic_title_reg . '.' . $pic_filetype); ! readfile($module_root_path. 'album_mod/nopicture.jpg'); ! } ! else ! { ! header('Content-type: image/jpeg'); ! header('Content-Disposition: filename=thumb_' . $pic_title_reg . '.' . $pic_filetype); ! readfile($images['no_picture']); ! } ! exit; ! } ! ! $pic_width = $pic_size['width']; ! $pic_height = $pic_size['height']; ! $pic_filetype = strtolower($pic_size['type']); ! ! $pic_title = substr($pic_filename, 0, strlen($pic_filename) - strlen($pic_filetype) - 1); ! $pic_title_reg = ereg_replace("[^A-Za-z0-9]", '_', $pic_title); ! } ! ! $pic_wm_fullpath = ALBUM_WM_CACHE_PATH . 'full_' . $pic_filename; ! ! ! if(empty($thispic) || ($pic_info['exists'] == false) || !file_exists($pic_info['fullpath'])) { mx_message_die(GENERAL_MESSAGE, $lang['Pic_not_exist']); |