|
@@ 842-864 (lines=23) @@
|
| 839 |
|
* |
| 840 |
|
* @return void |
| 841 |
|
*/ |
| 842 |
|
function insertImageName($member_srl, $target_file) |
| 843 |
|
{ |
| 844 |
|
// Check uploaded file |
| 845 |
|
if(!checkUploadedFile($target_file)) return; |
| 846 |
|
|
| 847 |
|
$oModuleModel = getModel('module'); |
| 848 |
|
$config = $oModuleModel->getModuleConfig('member'); |
| 849 |
|
// Get an image size |
| 850 |
|
$max_width = $config->image_name_max_width; |
| 851 |
|
if(!$max_width) $max_width = "90"; |
| 852 |
|
$max_height = $config->image_name_max_height; |
| 853 |
|
if(!$max_height) $max_height = "20"; |
| 854 |
|
// Get a target path to save |
| 855 |
|
$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl)); |
| 856 |
|
FileHandler::makeDir($target_path); |
| 857 |
|
|
| 858 |
|
$target_filename = sprintf('%s%d.gif', $target_path, $member_srl); |
| 859 |
|
// Get file information |
| 860 |
|
list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 861 |
|
// Convert if the image size is larger than a given size or if the format is not a gif |
| 862 |
|
if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
| 863 |
|
else @copy($target_file, $target_filename); |
| 864 |
|
} |
| 865 |
|
|
| 866 |
|
/** |
| 867 |
|
* Delete profile image |
|
@@ 951-973 (lines=23) @@
|
| 948 |
|
* |
| 949 |
|
* @return void |
| 950 |
|
*/ |
| 951 |
|
function insertImageMark($member_srl, $target_file) |
| 952 |
|
{ |
| 953 |
|
// Check uploaded file |
| 954 |
|
if(!checkUploadedFile($target_file)) return; |
| 955 |
|
|
| 956 |
|
$oModuleModel = getModel('module'); |
| 957 |
|
$config = $oModuleModel->getModuleConfig('member'); |
| 958 |
|
// Get an image size |
| 959 |
|
$max_width = $config->image_mark_max_width; |
| 960 |
|
if(!$max_width) $max_width = "20"; |
| 961 |
|
$max_height = $config->image_mark_max_height; |
| 962 |
|
if(!$max_height) $max_height = "20"; |
| 963 |
|
|
| 964 |
|
$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); |
| 965 |
|
FileHandler::makeDir($target_path); |
| 966 |
|
|
| 967 |
|
$target_filename = sprintf('%s%d.gif', $target_path, $member_srl); |
| 968 |
|
// Get file information |
| 969 |
|
list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 970 |
|
|
| 971 |
|
if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
| 972 |
|
else @copy($target_file, $target_filename); |
| 973 |
|
} |
| 974 |
|
|
| 975 |
|
/** |
| 976 |
|
* Delete Image Mark |