Skip to content

Commit

Permalink
원본강제 리사이징 댓글첨부파일도 지원 (한인페이지님 제안)
Browse files Browse the repository at this point in the history
  • Loading branch information
curlychoi committed May 25, 2016
1 parent a2d21be commit d98b25f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions write_comment_update.tail.skin.php
Expand Up @@ -105,6 +105,23 @@
if ($file_upload_msg)
alert($file_upload_msg, $g4['bbs_path']."/board.php?bo_table=$bo_table&wr_id=$wr[wr_parent]&page=$page" . $qstr . "&cwin=$cwin#c_{$comment_id}");

// 원본 강제 리사이징 (첨부파일)
if ($mw_basic[cf_resize_original]) {
$sql = " select * from $mw[comment_file_table] ";
$sql.= " where bo_table = '$bo_table' and wr_id = '$comment_id' and bf_width > 0 order by bf_no";
$qry = sql_query($sql);
while ($row = sql_fetch_array($qry)) {
$file = "$file_path/$row[bf_file]";
$size = getImageSize($file);
//if ($size[0] > $mw_basic[cf_resize_original] || $mw_basic[cf_resize_original] < $size[1]) {
mw_make_thumbnail($mw_basic[cf_resize_original], $mw_basic[cf_resize_original], $file, $file, true);
$size = getImageSize($file);
//}
sql_query("update $mw[comment_file_table] set bf_width = '$size[0]', bf_height = '$size[1]',
bf_filesize = '".filesize($file)."'
where bo_table = '$bo_table' and wr_id = '$comment_id' and bf_no = '$row[bf_no]'");
}
}

if ($mw_basic['cf_image_outline']) {
mw_image_outline($dest_file, null, $mw_basic['cf_image_outline_color']);
Expand Down

0 comments on commit d98b25f

Please sign in to comment.