view_image.php

view_image.php

QA

view_image.php

답변 1

본문

보기페이지에서 이미지클릭하면 새창으로 뜨는 건데요,,,

 

<?php
include_once('./_common.php');

$g5['title'] = '이미지 크게보기';
include_once(G5_PATH.'/head.sub.php');

$filename = preg_replace('/[^A-Za-z0-9 _ .\-\/]/', '', $_GET['fn']);

$extension = pathinfo($filename, PATHINFO_EXTENSION);

if ( ! preg_match('/(jpg|jpeg|png|gif|bmp)$/i', $extension) ){
    alert_close('이미지 확장자가 아닙니다.');
}

if(strpos($filename, 'data/editor')) {
    $editor_file = strstr($filename, 'editor');
    $filepath = G5_DATA_PATH.'/'.$editor_file;
} else if(strpos($filename, 'data/qa')) {
    $editor_file = strstr($filename, 'qa');
    $filepath = G5_DATA_PATH.'/'.$editor_file;
} else {
    $editor_file = '';
    $filepath = G5_DATA_PATH.'/file/'.$bo_table.'/'.$filename;
}

if(is_file($filepath)) {
    $size = @getimagesize($filepath);
    if(empty($size))
        alert_close('이미지 파일이 아닙니다.');

    $width = $size[0];
    $height = $size[1];

    if($editor_file)
        $fileurl = G5_DATA_URL.'/'.$editor_file;
    else
        $fileurl = G5_DATA_URL.'/file/'.$bo_table.'/'.$filename;

    $img = '<img src="'.$fileurl.'" alt="" width="'.$width.'" height="'.$height.'" id="map" class="draggable" style="position:relative;top:0;left:0;cursor:move;">';
} else {
    alert_close('파일이 존재하지 않습니다.');
}
?>

 

<div>

<?php echo $img ?>

</div>

 

이 창의 상단에 div 50px를 주고 싶습니다.

그밑에 

<div></div>

<div><?php echo $img ?></div>

 

이렇게 나오게요,,

위에 div에 다운로드 버튼을 넣으려구요,,,

 

 

이 질문에 댓글 쓰기 :

답변 1

<br><br> <--- 이렇게 넣으면 안되나요?

아니면 아래처럼

<div style="margin-top:50px;">다운로드버튼 </div>

<div><?php echo $img ?></div>

 

그런데 설마 이런 답변을 원하는 것이 맞나요?

 

 

늘 오셔서 도와주시네요,,감사합니다.
방금 짜집기로 해결하였습니다.ㅎ

view_image.php에 캔버스 속성 넣고 그린후에 drawing이미지 다운로드 버튼을 넣으려고 한건데...

style="width:<?php echo  $width = $size[0]-20; ?>px; 이렇게 하니 되네요..

그리고 원래 스크립트를 window.resizeTo(win_w+200, win_h+200); 이렇게 했더니 div넣은 만큼 창크기도 늘어나구요,,
편한 밤되세요,,

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 224
© SIRSOFT
현재 페이지 제일 처음으로