게시판 글 보기에서 파일에 관한 질문입니다 정보
게시판 글 보기에서 파일에 관한 질문입니다본문
게시판에서 글을 볼때...
파일 또는 에디터로 그림을 올린 것을 클릭하면
새창으로 원본이미지가 나타나는데요...
이 기능을 없애려면 어느 파일의 어느 부분을 수정해야하는지 알고 싶습니다
댓글 전체
방법은 lib/common.lib.php 의 view_file_link() 함수에서
onclick='image_window(this);' 를 지우면 됩니다.
저도 가로크기가 600 이 넘는 이미지는 강제로 줄여서 저장한 다음 원본은
삭제 처리하고 이기능이 불필요하여 없애 버렸습니다.ㅎㅎ
아래는 수정된 예제 입니다.
// 파일을 보이게 하는 링크 (이미지, 플래쉬, 동영상)
function view_file_link($file, $width, $height, $content="")
{
global $config, $configs, $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/$configs[cfmdata]/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title='$content'>";
return "<img src='$g4[path]/data/$configs[cfmdata]/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' 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/$configs[cfmdata]/$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/$configs[cfmdata]/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height'));</script>";
}
onclick='image_window(this);' 를 지우면 됩니다.
저도 가로크기가 600 이 넘는 이미지는 강제로 줄여서 저장한 다음 원본은
삭제 처리하고 이기능이 불필요하여 없애 버렸습니다.ㅎㅎ
아래는 수정된 예제 입니다.
// 파일을 보이게 하는 링크 (이미지, 플래쉬, 동영상)
function view_file_link($file, $width, $height, $content="")
{
global $config, $configs, $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/$configs[cfmdata]/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title='$content'>";
return "<img src='$g4[path]/data/$configs[cfmdata]/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' 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/$configs[cfmdata]/$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/$configs[cfmdata]/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height'));</script>";
}
제가 사용하는 파일폴더 암호화?가 적용된 코드가 들어가 버렸네요.
코드 내용중 $configs[cfmdata] 를 찾아서 file 로 수정하세요..
코드 내용중 $configs[cfmdata] 를 찾아서 file 로 수정하세요..
헐랭이님 답변 감사합니다 ^^
파일로 올리는 것은 수정이 되었습니다
그런데 cheditor 로 올리는 이미지는 그대로 새창이 뜹니다..ㅠㅠ;;;
어느 파일을 손봐야 하는지..... 부탁드립니다
파일로 올리는 것은 수정이 되었습니다
그런데 cheditor 로 올리는 이미지는 그대로 새창이 뜹니다..ㅠㅠ;;;
어느 파일을 손봐야 하는지..... 부탁드립니다
자체 해결 했습니다 ^^
bbs/view.php 에서
onclick='image_window(this)' 을 삭제 했더니 에디터에서 올린
그림 파일이 새창으로 안 뜨는군요..^^
bbs/view.php 에서
onclick='image_window(this)' 을 삭제 했더니 에디터에서 올린
그림 파일이 새창으로 안 뜨는군요..^^