|
@@ 810-832 (lines=23) @@
|
| 807 |
|
* |
| 808 |
|
* @return void |
| 809 |
|
*/ |
| 810 |
|
function insertImageName($member_srl, $target_file) |
| 811 |
|
{ |
| 812 |
|
// Check uploaded file |
| 813 |
|
if(!checkUploadedFile($target_file)) return; |
| 814 |
|
|
| 815 |
|
$oModuleModel = getModel('module'); |
| 816 |
|
$config = $oModuleModel->getModuleConfig('member'); |
| 817 |
|
// Get an image size |
| 818 |
|
$max_width = $config->image_name_max_width; |
| 819 |
|
if(!$max_width) $max_width = "90"; |
| 820 |
|
$max_height = $config->image_name_max_height; |
| 821 |
|
if(!$max_height) $max_height = "20"; |
| 822 |
|
// Get a target path to save |
| 823 |
|
$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl)); |
| 824 |
|
FileHandler::makeDir($target_path); |
| 825 |
|
|
| 826 |
|
$target_filename = sprintf('%s%d.gif', $target_path, $member_srl); |
| 827 |
|
// Get file information |
| 828 |
|
list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 829 |
|
// Convert if the image size is larger than a given size or if the format is not a gif |
| 830 |
|
if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
| 831 |
|
else @copy($target_file, $target_filename); |
| 832 |
|
} |
| 833 |
|
|
| 834 |
|
/** |
| 835 |
|
* Delete profile image |
|
@@ 919-941 (lines=23) @@
|
| 916 |
|
* |
| 917 |
|
* @return void |
| 918 |
|
*/ |
| 919 |
|
function insertImageMark($member_srl, $target_file) |
| 920 |
|
{ |
| 921 |
|
// Check uploaded file |
| 922 |
|
if(!checkUploadedFile($target_file)) return; |
| 923 |
|
|
| 924 |
|
$oModuleModel = getModel('module'); |
| 925 |
|
$config = $oModuleModel->getModuleConfig('member'); |
| 926 |
|
// Get an image size |
| 927 |
|
$max_width = $config->image_mark_max_width; |
| 928 |
|
if(!$max_width) $max_width = "20"; |
| 929 |
|
$max_height = $config->image_mark_max_height; |
| 930 |
|
if(!$max_height) $max_height = "20"; |
| 931 |
|
|
| 932 |
|
$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); |
| 933 |
|
FileHandler::makeDir($target_path); |
| 934 |
|
|
| 935 |
|
$target_filename = sprintf('%s%d.gif', $target_path, $member_srl); |
| 936 |
|
// Get file information |
| 937 |
|
list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 938 |
|
|
| 939 |
|
if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
| 940 |
|
else @copy($target_file, $target_filename); |
| 941 |
|
} |
| 942 |
|
|
| 943 |
|
/** |
| 944 |
|
* Delete Image Mark |