|
From: Florin C B. <ory...@us...> - 2013-03-18 21:38:47
|
Update of /cvsroot/mxbb/mx_smartor/album_mod/modules In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18812/modules Modified Files: album_pic_nuffed.php album_picm.php Log Message: database schema upgrade for mx_smartor 3.0 and FAP 1.5.0 plus some files Index: album_pic_nuffed.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_pic_nuffed.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** album_pic_nuffed.php 23 Jul 2010 11:15:17 -0000 1.4 --- album_pic_nuffed.php 18 Mar 2013 21:38:44 -0000 1.5 *************** *** 1,22 **** <?php ! /*************************************************************************** ! * album_pic_nuffed.php ! * ------------------- ! * begin : 2005/11/10 ! * copyright : Mighty Gorgon ! * email : mig...@mi... ! * ! * $Id: album_pic_nuffed.php, v 1.0.0 2005/11/10 ! * ! ***************************************************************************/ ! ! /*************************************************************************** * ! * 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. * ! ***************************************************************************/ // MX --- 1,11 ---- <?php ! /** * ! * @package Mx-Publisher Module - mx_smartor ! * @version $Id$ ! * @copyright (c) 2003 [sma...@ho..., Smartor] Mx-Publisher Development Team ! * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * ! */ // MX *************** *** 47,50 **** --- 36,47 ---- mx_message_die(GENERAL_MESSAGE, 'No pics specified'); } + //$pic_id = phpBB3::request_var('pic_id', 0); + if ($pic_id <= 0) + { + image_no_thumbnail('no_thumb.jpg'); + exit; + //die($lang['NO_PICS_SPECIFIED']); + //message_die(GENERAL_MESSAGE, $lang['NO_PICS_SPECIFIED']); + } // ------------------------------------ *************** *** 54,61 **** { $sql = "SELECT p.*, c.* ! FROM ". ALBUM_TABLE ." AS p, ". ALBUM_CAT_TABLE ." AS c ! WHERE p.pic_id = '$pic_id' ! AND c.cat_id = p.pic_cat_id"; ! if( !($result = $db->sql_query($sql)) ) { --- 51,58 ---- { $sql = "SELECT p.*, c.* ! FROM " . ALBUM_TABLE . " AS p, " . ALBUM_CAT_TABLE . " AS c ! WHERE pic_id = '" . $pic_id . "' ! AND c.cat_id = p.pic_cat_id ! LIMIT 1"; if( !($result = $db->sql_query($sql)) ) { *************** *** 68,72 **** $sql = "SELECT * FROM ". ALBUM_TABLE ." ! WHERE pic_id = '$pic_id'"; if( !($result = $db->sql_query($sql)) ) { --- 65,69 ---- $sql = "SELECT * FROM ". ALBUM_TABLE ." ! WHERE pic_id = '$pic_id'"; if( !($result = $db->sql_query($sql)) ) { *************** *** 75,79 **** $thispic = $db->sql_fetchrow($result); } - $db->sql_freeresult($result); --- 72,75 ---- *************** *** 81,106 **** $album_user_id = $thispic['cat_user_id']; ! $pic_filename = $thispic['pic_filename']; ! $file_part = explode('.', strtolower($pic_filename)); ! $pic_filetype = $file_part[sizeof($file_part) - 1]; ! $pic_title = substr($pic_filename, 0, strlen($pic_filename) - strlen($pic_filetype) - 1); ! $pic_title = $thispic['pic_title']; ! $pic_thumbnail = $thispic['pic_thumbnail']; ! 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']); } --- 77,85 ---- $album_user_id = $thispic['cat_user_id']; ! $pic_info = array(); ! $pic_info = pic_info($thispic['pic_filename'], $thispic['pic_thumbnail'], $thispic['pic_title']); ! if(empty($thispic) || ($pic_info['exists'] == false) || !file_exists($pic_info['fullpath'])) { mx_message_die(GENERAL_MESSAGE, $lang['Pic_not_exist']); } *************** *** 110,116 **** // ------------------------------------ $album_user_access = album_permissions($album_user_id, $cat_id, ALBUM_AUTH_VIEW, $thispic); ! if( $album_user_access['view'] == false ) { ! mx_message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); } --- 89,95 ---- // ------------------------------------ $album_user_access = album_permissions($album_user_id, $cat_id, ALBUM_AUTH_VIEW, $thispic); ! if($album_user_access['view'] == false) { ! mx_message_die(GENERAL_MESSAGE, $lang['Not_Authorized']); } *************** *** 118,129 **** // Check Pic Approval // ------------------------------------ ! ! if( $userdata['user_level'] != ADMIN ) { ! if( ($thispic['cat_approval'] == ADMIN) || (($thispic['cat_approval'] == MOD) && !$album_user_access['moderator']) ) { ! if( $thispic['pic_approval'] != 1 ) { ! mx_message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); } } --- 97,107 ---- // Check Pic Approval // ------------------------------------ ! if($user->data['user_level'] != ADMIN) { ! if(($thispic['cat_approval'] == ADMIN) || (($thispic['cat_approval'] == MOD) && !$album_user_access['moderator'])) { ! if($thispic['pic_approval'] != 1) { ! mx_message_die(GENERAL_MESSAGE, $lang['Not_Authorized']); } } *************** *** 133,139 **** // Check hotlink // ------------------------------------ ! if( ($album_config['hotlink_prevent'] == true) && (isset($HTTP_SERVER_VARS['HTTP_REFERER'])) ) { ! $check_referer = explode('?', $HTTP_SERVER_VARS['HTTP_REFERER']); $check_referer = trim($check_referer[0]); --- 111,117 ---- // Check hotlink // ------------------------------------ ! if(($album_config['hotlink_prevent'] == true) && (isset($_SERVER['HTTP_REFERER']))) { ! $check_referer = explode('?', $_SERVER['HTTP_REFERER']); $check_referer = trim($check_referer[0]); *************** *** 145,157 **** } ! $good_referers[] = $board_config['server_name'] . $board_config['script_path']; $errored = true; ! for ($i = 0; $i < count($good_referers); $i++) { $good_referers[$i] = trim($good_referers[$i]); ! if( (strstr($check_referer, $good_referers[$i])) && ($good_referers[$i] != '') ) { $errored = false; --- 123,135 ---- } ! $good_referers[] = $config['server_name'] . $config['script_path']; $errored = true; ! for ($i = 0; $i < sizeof($good_referers); $i++) { $good_referers[$i] = trim($good_referers[$i]); ! if((strstr($check_referer, $good_referers[$i])) && ($good_referers[$i] != '')) { $errored = false; *************** *** 159,169 **** } ! if( $errored ) { ! mx_message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); /* ! header('Content-type: image/jpeg'); ! header('Content-Disposition: filename=' . $pic_title_reg . '.' . $pic_filetype); ! readfile($images['no_thumbnail']); exit; */ --- 137,145 ---- } ! if($errored) { ! mx_message_die(GENERAL_MESSAGE, $lang['Not_Authorized']); /* ! image_no_thumbnail($pic_info['title_reg'] . '.' . $pic_info['filetype']); exit; */ *************** *** 174,184 **** $Image = new ImgObj(); ! $Image->ReadSourceFile(ALBUM_UPLOAD_PATH . $pic_filename); ! //include(ALBUM_UPLOAD_PATH . $pic_filename); ! if( (($nuff_http['nuff_sepia'] == true) || ($nuff_http['nuff_bw'] == true) || ($nuff_http['nuff_blur'] == true) || ($nuff_http['nuff_scatter'] == true)) && ($album_config['enable_sepia_bw'] == true) ) { ! ( ($nuff_http['nuff_resize_w'] == 0) || ($nuff_http['nuff_resize_w'] > 200) ) ? ($nuff_http['nuff_resize_w'] = 200) : false; ! ( ($nuff_http['nuff_resize_h'] == 0) || ($nuff_http['nuff_resize_h'] > 150) ) ? ($nuff_http['nuff_resize_h'] = 150) : false; $Image->Resize($nuff_http['nuff_resize_w'], $nuff_http['nuff_resize_h']); --- 150,160 ---- $Image = new ImgObj(); ! $Image->ReadSourceFile($pic_info['fullpath']); ! ! if((($nuff_http['nuff_sepia'] == true) || ($nuff_http['nuff_bw'] == true) || ($nuff_http['nuff_blur'] == true) || ($nuff_http['nuff_scatter'] == true)) && ($album_config['enable_sepia_bw'] == true)) { ! (($nuff_http['nuff_resize_w'] == 0) || ($nuff_http['nuff_resize_w'] > 200)) ? ($nuff_http['nuff_resize_w'] = 200) : false; ! (($nuff_http['nuff_resize_h'] == 0) || ($nuff_http['nuff_resize_h'] > 150)) ? ($nuff_http['nuff_resize_h'] = 150) : false; $Image->Resize($nuff_http['nuff_resize_w'], $nuff_http['nuff_resize_h']); *************** *** 230,234 **** //Rotate anti-clockwise degrees (transparency lost) ! if( $nuff_http['nuff_rotation_d'] > 0 ) { ($nuff_http['nuff_rotation'] == true) ? $Image->Rotate($nuff_http['nuff_rotation_d']) : false; --- 206,210 ---- //Rotate anti-clockwise degrees (transparency lost) ! if($nuff_http['nuff_rotation_d'] > 0) { ($nuff_http['nuff_rotation'] == true) ? $Image->Rotate($nuff_http['nuff_rotation_d']) : false; *************** *** 236,245 **** //WatermarkPos(File, Pos, Size, Transition) ! if( ($pic_filetype != 'gif') && ($album_config['use_watermark'] == true) && ($userdata['user_level'] != ADMIN) && ! ( (!$userdata['session_logged_in']) || ($album_config['wut_users'] == 1)) ) { //$wm_file = ALBUM_WM_FILE; $wm_file = (file_exists($thispic['cat_wm']) ? $thispic['cat_wm'] : ALBUM_WM_FILE); ! $wm_position = ( ($album_config['disp_watermark_at'] > 0) && ($album_config['disp_watermark_at'] < 10) ) ? $album_config['disp_watermark_at'] : 5; $wm_maxsize = 50; $wm_transition = 100; --- 212,221 ---- //WatermarkPos(File, Pos, Size, Transition) ! if(($pic_info['filetype'] != 'gif') && ($album_config['use_watermark'] == true) && ($user->data['user_level'] != ADMIN) && ! ((!$user->data['session_logged_in']) || ($album_config['wut_users'] == 1))) { //$wm_file = ALBUM_WM_FILE; $wm_file = (file_exists($thispic['cat_wm']) ? $thispic['cat_wm'] : ALBUM_WM_FILE); ! $wm_position = (($album_config['disp_watermark_at'] > 0) && ($album_config['disp_watermark_at'] < 10)) ? $album_config['disp_watermark_at'] : 5; $wm_maxsize = 50; $wm_transition = 100; *************** *** 247,256 **** } ! $Image->SendToFile(ALBUM_UPLOAD_PATH . "cache/" . $pic_filename); //Write image to file //JPG Compression ! $nuff_http['nuff_recompress_r'] = (($nuff_http['nuff_recompress'] == false) || ($nuff_http['nuff_recompress_r'] == 0)) ? 75 : false; ! $Image->SendToBrowser($pic_title, $pic_filetype, '', '_nuffed', $nuff_http['nuff_recompress_r']); $Image->Destroy(); //Destroy whole class including GD image in memory. --- 223,232 ---- } ! //$Image->SendToFile("cache/test2"); //Write image to file //JPG Compression ! (($nuff_http['nuff_recompress'] == false) || ($nuff_http['nuff_recompress_r'] == 0)) ? ($nuff_http['nuff_recompress_r'] = 75) : false; ! $Image->SendToBrowser($pic_info['title_reg'], $pic_info['filetype'], '', '_nuffed', $nuff_http['nuff_recompress_r']); $Image->Destroy(); //Destroy whole class including GD image in memory. Index: album_picm.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_picm.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** album_picm.php 18 Mar 2013 20:58:58 -0000 1.10 --- album_picm.php 18 Mar 2013 21:38:44 -0000 1.11 *************** *** 54,62 **** { //$sql = "SELECT * FROM " . ALBUM_TABLE . " WHERE pic_id = '$pic_id'"; ! $sql = "SELECT p.*, c.* ! FROM " . ALBUM_TABLE . " AS p, " . ALBUM_CAT_TABLE . " AS c ! WHERE p.pic_id = '" . $pic_id . "' ! AND c.cat_id = p.pic_cat_id ! LIMIT 1"; if (!($result = $db->sql_query($sql))) { --- 54,71 ---- { //$sql = "SELECT * FROM " . ALBUM_TABLE . " WHERE pic_id = '$pic_id'"; ! if ($cat_id != PERSONAL_GALLERY) ! { ! $sql = "SELECT p.*, c.* ! FROM ". ALBUM_TABLE ." AS p, ". ALBUM_CAT_TABLE ." AS c ! WHERE p.pic_id = '$pic_id' ! AND c.cat_id = p.pic_cat_id"; ! } ! else ! { ! $sql = "SELECT * ! FROM ". ALBUM_TABLE ." ! WHERE pic_id = '$pic_id'"; ! ! } if (!($result = $db->sql_query($sql))) { *************** *** 70,74 **** } } - $thispic = $db->sql_fetchrow($result); $db->sql_freeresult($result); --- 79,82 ---- |