|
@@ 788-810 (lines=23) @@
|
| 785 |
|
* |
| 786 |
|
* @return void |
| 787 |
|
*/ |
| 788 |
|
function insertImageName($member_srl, $target_file) |
| 789 |
|
{ |
| 790 |
|
// Check uploaded file |
| 791 |
|
if(!checkUploadedFile($target_file)) return; |
| 792 |
|
|
| 793 |
|
$oModuleModel = getModel('module'); |
| 794 |
|
$config = $oModuleModel->getModuleConfig('member'); |
| 795 |
|
// Get an image size |
| 796 |
|
$max_width = $config->image_name_max_width; |
| 797 |
|
if(!$max_width) $max_width = "90"; |
| 798 |
|
$max_height = $config->image_name_max_height; |
| 799 |
|
if(!$max_height) $max_height = "20"; |
| 800 |
|
// Get a target path to save |
| 801 |
|
$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl)); |
| 802 |
|
FileHandler::makeDir($target_path); |
| 803 |
|
|
| 804 |
|
$target_filename = sprintf('%s%d.gif', $target_path, $member_srl); |
| 805 |
|
// Get file information |
| 806 |
|
list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 807 |
|
// Convert if the image size is larger than a given size or if the format is not a gif |
| 808 |
|
if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
| 809 |
|
else @copy($target_file, $target_filename); |
| 810 |
|
} |
| 811 |
|
|
| 812 |
|
/** |
| 813 |
|
* Delete profile image |
|
@@ 897-919 (lines=23) @@
|
| 894 |
|
* |
| 895 |
|
* @return void |
| 896 |
|
*/ |
| 897 |
|
function insertImageMark($member_srl, $target_file) |
| 898 |
|
{ |
| 899 |
|
// Check uploaded file |
| 900 |
|
if(!checkUploadedFile($target_file)) return; |
| 901 |
|
|
| 902 |
|
$oModuleModel = getModel('module'); |
| 903 |
|
$config = $oModuleModel->getModuleConfig('member'); |
| 904 |
|
// Get an image size |
| 905 |
|
$max_width = $config->image_mark_max_width; |
| 906 |
|
if(!$max_width) $max_width = "20"; |
| 907 |
|
$max_height = $config->image_mark_max_height; |
| 908 |
|
if(!$max_height) $max_height = "20"; |
| 909 |
|
|
| 910 |
|
$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); |
| 911 |
|
FileHandler::makeDir($target_path); |
| 912 |
|
|
| 913 |
|
$target_filename = sprintf('%s%d.gif', $target_path, $member_srl); |
| 914 |
|
// Get file information |
| 915 |
|
list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 916 |
|
|
| 917 |
|
if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
| 918 |
|
else @copy($target_file, $target_filename); |
| 919 |
|
} |
| 920 |
|
|
| 921 |
|
/** |
| 922 |
|
* Delete Image Mark |