에디터로 올린 이미지 리사이즈 되는 방법좀 알려주세요ㅠㅠ

파일첨부로 넣으면 게시판 설정에 맞게 리사이즈 되는데 에디터로 올리면
그림이 리사이즈되지 않고 원본 크기로 나옵니다.
그래서 테이블보다 그림이 더 커서 보기가 영 안좋아 지네요
에디터로 첨부한 이미지도 리사이즈 되는 방법좀 알려주세요ㅠㅠ
|

댓글 4개

js/board.js를 보면
function resizeBoardImage(imageWidth, borderColor) 가 있습니다.
그누 버번에 따라서
var content = document.getElementById("writeContents");
이거나 혹은
var target = document.getElementsByName('target_resize_image[]');
를 쓰는데
content 쪽이면 게시판 글 내용을 <div id="writeContents">로 둘러 싸 주시면 되고
target 쪽이면
wr_content에서 <img를 <img name="target_resize_image[]"로 문자열 치환을해 주시면 됩니다.
엑스엠엘님 답변 감사합니다.
그런데 제가 그누보드를 접한지 얼마 되지 않아서요ㅠㅠ

function resizeBoardImage(imageWidth, borderColor)
도 찾았고
var content = document.getElementById("writeContents");
를 쓴다는것도 알았는데 글 내용을 <div id="writeContents">로 둘러 싼다는게
무슨 말인지 잘 모르겠습니다ㅠㅠ

조금만 더 자세히 설명해주시면 안될까요ㅠㅠ
skin/board/basic/view.skin.php:113
<!-- 내용 출력 -->
<span id="writeContents"><?=$view[content];?></span>

이렇게 되어 있는지 확인해 보세요.
에디터에 첨부한 파일이 이미지 resize가 안되던걸요. common.lib.php 파일에서
view_file_link함수에서 사이즈를 조정하니까 됩니다.

function view_file_link($file, $width, $height, $content="")
{
global $config, $board;
global $g4;
static $ids;

if (!$file) return;

$ids++;

// 파일의 폭이 게시판설정의 이미지폭 보다 크다면 게시판설정 폭으로 맞추고 비율에 따라 높이를 계산
if ($width > $board[bo_image_width] && $board[bo_image_width])
{
$rate = $board[bo_image_width] / $width;
$width = $board[bo_image_width];
$height = (int)($height * $rate);
}

// 폭이 있는 경우 폭과 높이의 속성을 주고, 없으면 자동 계산되도록 코드를 만들지 않는다.
if ($width)
$attr = " width='$width' height='$height' ";
else
$attr = "";

if (preg_match("/\.($config[cf_image_extension])$/i", $file))
// 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임
// 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다
return "<img src='$g4[path]/data/file/$board[bo_table]/".urlencode($file)."' width=640 height=480 name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title='$content'>";
else if (preg_match("/\.($config[cf_flash_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(flash_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height', 'transparent'));</script>";
//=============================================================================================
// 동영상 파일에 악성코드를 심는 경우를 방지하기 위해 경로를 노출하지 않음
//---------------------------------------------------------------------------------------------
/*
else if (preg_match("/\.($config[cf_movie_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(obj_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height'));</script>";
*/
//=============================================================================================
}
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
16년 전 조회 1,183
16년 전 조회 927
16년 전 조회 1,684
16년 전 조회 776
16년 전 조회 902
16년 전 조회 784
16년 전 조회 818
16년 전 조회 1,852
16년 전 조회 924
16년 전 조회 2,553
16년 전 조회 1,063
16년 전 조회 1,528
16년 전 조회 825
16년 전 조회 747
16년 전 조회 789
16년 전 조회 783
16년 전 조회 1,217
16년 전 조회 2,842
16년 전 조회 3,825
16년 전 조회 2,541