이미지 엑박이 뜹니다. ㅠㅠ > 그누4 질문답변

그누4 질문답변

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

이미지 엑박이 뜹니다. ㅠㅠ 정보

이미지 엑박이 뜹니다. ㅠㅠ

본문

이미지를 불러올땐 썸네일에 반응하는데
불러오지 않을땐 썸네일에 noimage 이미지가 나와야 하는데
엑박으로 뜨네요..
어디를 수정해야하는지.. ㅠ.ㅠ
답변 부탁드릴께요..

-------------------view.skin.php-------------------------

if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$view_line = 680; //테이블에서 270 뺀 값
$view_line2 = 670; //$view_line에서 12 뺀 값
$view_line3 = 650; //$view_line2에서 110 뺀 값

$view_td = 770; //테이블 30 뺀 값

$mb = get_member($view[mb_id]);
$mb_info = $mb[mb_hp];
if ($mb[mb_hp]) {
$mb_info = $mb[mb_hp];
}
else if ($mb[mb_tel]) {
$mb_info = $mb[mb_tel];
} else {
$mb_info = "연락처가 없습니다.";
}
?>

<link rel='stylesheet' type='text/css' href='<?=$board_skin_path?>/board_style.css'>

<!-- 게시글 보기 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspcing="0"><tr><td>

<!-- 링크 버튼 -->
<?
ob_start();
?>
<table width='100%' cellpadding=0 cellspacing=0 >
<tr height=80>
    <td width=100% align=right>
        <? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/search_list.gif' border='0' align='absmiddle'></a> "; } ?>
   
        <? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/write.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/reply.gif' border='0' align='absmiddle'></a> "; } ?>

        <? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/modify.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/delete.gif' border='0' align='absmiddle'></a> "; } ?>

        <? if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/good.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/nogood.gif' border='0' align='absmiddle'></a> "; } ?>

        <? if ($scrap_href) { echo "<a href=\"javascript:;\" onclick=\"win_scrap('./scrap_popin.php?bo_table=$bo_table&wr_id=$wr_id');\"><img src='$board_skin_path/img/scrap.gif' border='0' align='absmiddle'></a> "; } ?>

        <? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/copy.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/move.gif' border='0' align='absmiddle'></a> "; } ?>
  <? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/list.gif' border='0' align='absmiddle'></a> "; ?>
    </td>
 
</tr>
</table>
<?
$link_buttons = ob_get_contents();
ob_end_clean();
?>

<p align=right><? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle'></a>&nbsp;"; } ?><? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/next.gif' border='0' align='absmiddle'></a>&nbsp;"; } ?></p>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
 <tr>
  <td width="700" align="center">

<SCRIPT LANGUAGE='JavaScript'>
// 이미지뷰어
<!--
    var win= null;
    function View_Open(img, w, h)
    {
        var winl = (screen.width-w)/2;
        var wint = (screen.height-h)/3;
        var settings  ='height='+h+',';
            settings +='width='+w+',';
            settings +='top='+wint+',';
            settings +='left='+winl+',';
            settings +='scrollbars=yes,';
            settings +='resizable=yes,';
            settings +='status=no';

        win=window.open("","newWindow",settings);
        win.document.open();
        win.document.write ("<html><head><title>원본 이미지 보기</title></head>");
        win.document.write ("<script>function init(){window.resizeBy(document.all.pop_img.width-document.body.clientWidth, document.all.pop_img.height-document.body.clientHeight+10);}</script>");
        win.document.write ("<body bgcolor=white topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 oncontextmenu='return false' ondragstart='return false' onkeydown='return false' onselectstart='return false' onload='init();'>");
        win.document.write ("<img src='"+img+"' border=0 onclick='window.close();' style='cursor:hand' title='닫기' id='pop_img'>");
        win.document.write ("</body></html>");
        win.document.close();
    }
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
<!--
image_directory = "";  //배경이미지 경로
clear = new Image();  clear.src = image_directory + "./img/blank.gif";
<?
//파일 뽑기
$sql2 = " select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 10 ";
$result2 = sql_query($sql2);
for ($j=0; $row2 = sql_fetch_array($result2); $j++) {
$view_one = "{$g4['path']}/data/file/{$bo_table}/{$row2['bf_file']}";
?>
view_img<?=$j?> = new Image();
view_img<?=$j?>.src = "<?=$g4['path']?>/data/file/<?=$bo_table?>/<?=$row2['bf_file']?>";
<? } ?>
function bgChange(imgName) {
 document.all.view_img.src = eval(imgName + ".src");
}
//  -->
</SCRIPT>

<table width=100% cellspacing="0" cellpadding="0" border="0" align="center">
 

 <tr>
  <td width="5"></td>
 
    <td style="padding:4 0 4 0px;" width="440" height="330" align="center" valign="top">
      <div style='width:440px; position:relative; overflow:hidden;' align=center><a href="javascript:void(0);" onClick="View_Open('<?=$view_one?>')"><img src="<?=$view_one?>" name="view_img" border="5" width=420 height=300 style="border-color:#161616;"></a></div>
    </td>
  <td width="10"></td>
 
    <td style="padding:4 0 4 0px;" width="250" height="330" align="center" valign="top">

<table id="Table_01" width="250" height="138" border="0" cellpadding="0" cellspacing="0">
 <tr>
  <td colspan="2">
  <img src="<?=$board_skin_path?>/img/product_01.gif" width="250" height="12" alt=""></td>
 </tr>
 <tr>
  <td>
  <img src="<?=$board_skin_path?>/img/product_02.gif" width="91" height="28" alt=""></td>
        <td width="159" height="28">

            <p align="center"><b><font color="#669900"><span style="font-size:9pt;"><?php echo($view[subject]); ?></span></font></b><span style="font-size:8pt;"><font color="#666666"></font></span></p>
</td>
 </tr>
 <tr>
  <td colspan="2">
  <img src="<?=$board_skin_path?>/img/product_04.gif" width="250" height="4" alt=""></td>
 </tr>
 <tr>
  <td>
  <img src="<?=$board_skin_path?>/img/product_05.gif" width="91" height="28" alt=""></td>
        <td width="159" height="28">
     
            <p align="center"><font color="#999999"><?php echo($view[wr_3]); ?></font></p>
</td>
 </tr>
 <tr>
  <td colspan="2">
  <img src="<?=$board_skin_path?>/img/product_07.gif" width="250" height="4" alt=""></td>
 </tr>
 <tr>
  <td>
  <img src="<?=$board_skin_path?>/img/product_08.gif" width="91" height="28" alt=""></td>
        <td width="159" height="28">

            <p align="center"><font color="#999999"><?php echo($view[wr_2]); ?></font></p>
</td>
 </tr>
 <tr>
  <td colspan="2">
  <img src="<?=$board_skin_path?>/img/product_10.gif" width="250" height="34" alt=""></td>
 </tr>
</table>

<?
//파일 뽑기
$sql = " select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 10 ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {

//썸네일 코드 시작
$data_path = $g4['path'] . "/data/file/{$bo_table}";//라이브러리 파일 참조
$thumb_path = $data_path . '/thumbOpen';

$view_w = 90; //썸네일 가로사이즈
$view_h = 70; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티

if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
    $filename = $row[bf_file]; //파일명
    $thumb = $thumb_path.'/'.$filename; //썸네일
    if (!file_exists($thumb))
    {
 $file = $data_path.'/'.$filename; //원본
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;

            $rate = $view_w / $size[0];
            $height = (int)($size[1] * $rate);

            if ($height < $view_h)
                $dst = imagecreatetruecolor($view_w, $height);
            else
                $dst = imagecreatetruecolor($view_w, $view_h);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$filename, $sch_q);
            chmod($thumb_path.'/'.$filename, 0707);
        }
    }

 if (file_exists($thumb) && $filename) {
?>
<a href="javascript:void(0);" onClick="View_Open('<?=$data_path?>/<?=$filename?>')" onMouseOver="bgChange('view_img<?=$i?>');" onMouseOut="bgChange('view_img<?=$i?>');"><img src='<?=$thumb?>' border=1 width=90 height=70 style="border-color:#d5d5d5;"></a>&nbsp;&nbsp;<?
//onMouseOut="bgChange('clear');"
}
}
?>
    </td>
  <td width="5"></td>
 </tr>

</table>
  </td>
</td> </tr> </table>





<table width="100%" cellspacing="0" cellpadding="0" border="0">
  <tr>
    <td height="5"></td>
  </tr>
  <tr>
    <td height="5"></td>
  </tr>
  <tr>
    <td width="100%" valign="top" style="word-break:break-all;"> <span class="V_content">
      </span>
      <!-- 테러 태그 방지용 --></xml></xmp>
<img src="<?=$board_skin_path?>/img/inf.gif"  alt="">


</td>
  </tr>
  <tr>
    <td height="5"></td>
  </tr>
</table>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
  <tr>
    <td width="<?=$view_td?>">
      <table width="100%" cellspacing="0" cellpadding="0" border="0" valign="top">
        <tr>
          <td bgcolor="#cacaca" width="<?=$view_td?>" height="5"></td>
        </tr>

 <tr>
          <td width="<?=$view_td?>" height="10"></td>
        </tr>

              <tr>
                <td>


 <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                                <tr>
                                  <td height="7"></td>
                                </tr>
                                <tr>
                                  <td><span class="V_content">
                                    <p style="margin:5px;"><?=$view[content];?>
                                    </span>
                                    <?//echo $view[rich_content]; // 과 같은 코드를 사용할 경우?>
                                    <span class="V_content"> </span></td>
                                </tr>
                              </table>


                </td>
              </tr>

 <tr>
          <td width="<?=$view_td?>" height="10"></td>
        </tr>

 <tr>
          <td bgcolor="#cacaca" width="<?=$view_td?>" height="5"></td>
        </tr>

                  </table>

                </td>
              </tr>
            </table>


<?=$link_buttons?>

</td></tr></table>


<!-- 게시글 보기 끝 -->
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로