Division by zero in > 그누4 질문답변

그누4 질문답변

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

Division by zero in 정보

Division by zero in

본문

전에는 없던 에러였는데
갑자기 Division by zero in...에러가 뜹니다..
에러가 나는 php파일을 몇달간 건드린적도 없거든요.
 
 
board/ 밑에 똑같은 게시판스킨을 여러개 나누어 쓰는데..
나누어쓰는 모든게시판에서 에러가 나네요..
 
환경설정에서 복구최적화 해도 계속 에러나구요..
도움을 요청합니다.
 
 
 
Warning: Division by zero in /web/home/html/main/skin/board/pds/view.skin.php on line 181
 
 
 
해당파일 소스는...
 
 
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<link rel='stylesheet' type='text/css' href='<?=$board_skin_path?>/bstyle.css'>

<!-- [참고] 옵션필드 --//-->
<?
$ex9_filed = explode("|",$view[wr_9]);
$ext9_00  = $ex9_filed[0];
$ext9_01  = $ex9_filed[1];
$ext9_02  = $ex9_filed[2];
?>
<!-- [참고] 옵션필드 --//--> 

<!----------- { 레이아웃 테이블 시작 } -------------------------------------//-->
<table width="<?=$width?>" align="center" cellpadding="0" cellspcing="0"><tr><td>
 

<table width="100%" align="center" cellpadding=5 cellspacing=0 border=0 style='border-bottom:1px solid #cccccc'>
<tr>
 <td width=120 style='padding-left:7px;'>
  <!--빈공백--//-->
 </td>
 <td width='' align='right'style='padding-right:5px;'>
   <span class='v1'>Name :</span>
   <?=$view[name]?><? if ($is_ip_view) { echo " <span class='v2'>($ip)</span>"; } ?>
   <span class='v1'>Date :</span>
   <span class='v2'><?=substr($view[wr_datetime],2,14)?></span>
<!------   <span class='v1'>View</span><span class='v2'> (<?=$view[wr_hit]?>)</span>---//-->
  <? if ($is_good) echo " <span class='v1'>Good</span><span class='v2'> ($view[wr_good])";?><span class='v1'></span>
     <? if ($is_nogood) echo " <span class='v1'>Bad</span><span class='v2'> ($view[wr_nogood])";?><span class='v1'></span>
 </td>
 </tr>
</table>
<table><tr><td height=1></td></tr></table>
<!---- {상단 레이아웃 테이블} --//-->
<table width='100%' align='center' cellpadding=0 cellspacing=0 border=0>
<tr><td>
<!---- {상단 레이아웃 테이블} --//-->
<table width='100%' align='center' cellpadding=2 cellspacing=1 border=0 style='border:1px solid #4B9455'>
<colgroup width='20%' nowrap>
<colgroup width='30%'>
<colgroup width='20%' nowrap>
<colgroup width='30%'>
  <tr height="24">
    <td class='b_tit2 b_bg2'> + 제목글</td>
    <td colspan=3 bgcolor='#f0f0f0' style='padding-left:5px; padding-right:5px;'> 
 <b><?=$view[subject]?></b>
 </td>
  </tr>
  <tr height="24">
    <td class='b_tit2 b_bg2'> + 시험과목</td>
    <td bgcolor='#f0f0f0' style='padding-left:5px; padding-right:5px;'>
 <? if ($is_category) { echo ($category_name ? "$view[ca_name] " : ""); } ?> 
 </td>
    <td class='b_tit2 b_bg2'> + 문제유형</td>
    <td bgcolor='#f0f0f0' style='padding-left:5px; padding-right:5px;'>
 <? if($ext9_00 == '0000년') {
   echo '';
  }else{
   echo "[". $ext9_00 ."] ";
  }
 ?>
 <?=$ext9_01?>
 </td>
  </tr>
  <tr height="24">
    <td class='b_tit2 b_bg2'> + 출판사명</td>
    <td colspan=3 bgcolor='#f0f0f0' style='padding-left:5px; padding-right:5px;'>
 <?=$ext9_02?>
 </td>
  </tr>
 
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++) {
    if ($view[file][$i][source] && !$view[file][$i][view]) {
        $cnt++;
 if ($i==0) {
 echo "
        <tr height='24'><td class='b_tit2 b_bg2'> + 다운로드</td>
        <td colspan='3' bgcolor='#eef9fc' style='padding-left:5px; padding-right:5px;'>
        <img src='{$board_skin_path}/img/icon_hwp.gif' height='18' width='18' align=absmiddle> <a class='v1' href=\"javascript:file_download('{$view[file][$i][href]}&dn=1', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'>{$view[file][$i][source]} </a> <span class='v2'> ({$view[file][$i][size]})</span></td></tr>
        ";
  // <img src='{$board_skin_path}/img/icon_hwp.gif' height='18' width='18' align=absmiddle> <a class='v1' href='{$view[file][$i][href]}&dn=1' title='{$view[file][$i][content]}'>
 } else if($i==1) {
        echo "
        <tr height='24'><td class='b_tit2 b_bg2'> + 다운로드</td>
        <td colspan='3' bgcolor='#eef9fc' style='padding-left:5px; padding-right:5px;'>
        <img src='{$board_skin_path}/img/icon_hwp.gif' height='18' width='18' align=absmiddle> <a class='v1' href='{$view[file][$i][href]}&dn=1' title='{$view[file][$i][content]}'>{$view[file][$i][source]} </a> <span class='v2'> ({$view[file][$i][size]})</span></td></tr>
        ";
 } else {
        echo "
        <tr height='24'><td class='b_tit2 b_bg2'> + 다운로드 </td>
        <td colspan='3' bgcolor='yellow' style='padding-left:5px; padding-right:5px;'>
        <img src='{$board_skin_path}/img/icon_file2.gif' height='18' width='18' align=absmiddle> <a class='v1' href='{$view[file][$i][href]}&dn=1' title='{$view[file][$i][content]}'>{$view[file][$i][source]} </a> <span class='v2'> ({$view[file][$i][size]})</span></td></tr>
        ";
 }
    }
}
?>

  <tr height="15">
    <td class='b_tit2 b_bg2'> + 부가설명</td>
    <td colspan='3' bgcolor='#f0f0f0' style='padding-left:5px; padding-right:5px;'>
 <span class="ct lh"><?=$view[content];?></span>
        <?//echo $view[rich_content]; // 과 같은 코드를 사용할 경우?>
        <!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
 </td>
  </tr>
</table>
<!---- {하단 레이아웃 테이블} --//-->
</td></tr>
</table>
<!---- {하단 레이아웃 테이블} --//-->

<table width='100%'><tr><td height='5'></td></tr></table>

<!------- {gblist.skin.php 에서 지정한 이미지갯수만큼 뷰화면에서 한줄로 출력 } ----//---------->
  <?
  $n = $view[wr_2];     // 한줄당 출력 이미지수
  
  if ($n > (count($view[file])-1)) {
   $i_count = (count($view[file])-1);  //원본이미지수가 적으면 적은갯수를..
  }
  else {
   $i_count = $n;      //원본이미지수가 많으면 설정갯수를..
  } 
  if ($i_count > 0) {
  $wid = (int)($board[bo_image_width]/$i_count); //게시판환경설정->'이미지폭크기'를 갖고 나눈다
  $board[bo_image_width] = $wid;     //자동이미지폭 조정을 위해 다시 넘겨준다..
  $wid = (int)(1/$n*100);
  }
  echo "<table width='100%' cellpadding=3 cellspacing=0 border=0>";
  echo "<tr>";
        for ($i=0; $i<=count($view[file]); $i++) {
   if (($view[file][$i][view]) && $i>0 && ($i%$n == 0)) {
    echo "</tr><tr>";
   }
            if ($view[file][$i][view]) { 
    echo "<td align='center' valign='top' style='word-break:break-all'>";
    echo "<td align='center' valign='top' style='word-break:break-all'>";
    echo "<table cellpadding=10 cellspacing=0 border=0 style='border:1px solid #cccccc;'><tr><td>";
    echo "<table cellpadding=0 cellspacing=0 border=0 style='border:1px solid #888888;'><tr><td>";
    echo $view[file][$i][view];
    echo "</td></tr></table>";
    echo "</td></tr></table>";
    echo "<br><br>". $view[file][$i][content]; // 이미지 설명글 {게시판 환경설정에서 체크}
   }    
        }
  // 부족한 <td> 갯수 맞추는 작업
  if ((count($view[file])-1) % $n != 0) {
   $td_cnt = $n - ((count($view[file])-1)%$n);
   for ($t=0; $t<$td_cnt; $t++) {
    echo "<td> </td>";
   }
  }
  echo "</tr></table>";
        ?>
<!--------------- 여기까지 -------------------------------------//------->
 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<? if ($trackback_url) { ?>
<tr height=24>
    <td>
       <span class='v1'>Trackback add :</span> <a class='v1' href="javascript:clipboard_trackback('<?=$trackback_url?>');" style="letter-spacing:0;" title='이 글을 소개할 때는 이 주소를 사용하세요'><?=$trackback_url?></a> 
        <script language="JavaScript">
            function clipboard_trackback(str) {
                if (g4_is_gecko)
                    prompt("이 글의 고유주소입니다. Ctrl+C를 눌러 복사하세요.", str);
                else if (g4_is_ie) {
                    window.clipboardData.setData("Text", str);
                    alert("트랙백 주소가 복사되었습니다.\n\n<?=$trackback_url?>");
                }
            }
        </script>
    </td>
</tr>
<tr><td height="1" bgcolor='#ebebeb'></td></tr>
<? } ?>
</table>
<br>

<?
include_once("./view_comment.php");
?>
<!-- 링크 버튼 -->
<?
ob_start();
?>
<table width='100%' cellpadding=0 cellspacing=0>
<tr height=35>
    <td width=75%>
        <? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_search_list.gif' border='0' align='absmiddle'></a> "; } ?>
        <? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
        <? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_update.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_good.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_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/btn_scrap.gif' border='0' align='absmiddle'></a> "; } ?>--------//-->
        <? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' align='absmiddle'></a> "; } ?>
    </td>
    <td width=25% align=right>
        <? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?>
        <? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?>
    </td>
</tr>
</table>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
<!----------- { 레이아웃 테이블 시작 } --------------------------------------//-->
</td></tr></table>
<script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
    var target = document.getElementsByName('target_resize_image[]');
    var image_width = parseInt('<?=$board[bo_image_width]?>');
    var image_height = 0;
    for(i=0; i<target.length; i++) {
        // 원래 사이즈를 저장해 놓는다
        target[i].tmp_width  = target[i].width;
        target[i].tmp_height = target[i].height;
        // 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
        if(target[i].width > image_width) {
            image_height = parseFloat(target[i].width / target[i].height)
            target[i].width = image_width;
            target[i].height = parseInt(image_width / image_height);
        }
    }
}

function file_download(link, file)
{
<? if ($board[bo_download_point] < 0) { ?>if (confirm("포인트: 정회원준회원[<?=number_format($board[bo_download_point])?>점]\n\n확인을 누르면 포인트가 차감됩니다.\n원치않으시면 취소를 누르세요"))<?}?>
document.location.href = link;
}
</script>
 
  • 복사

댓글 전체

에러문으로 보면 존재하지 않는 값을 나눌려고 할때에 나오는 에러 입니다.

의심가는 코드는

<!------- {gblist.skin.php 에서 지정한 이미지갯수만큼 뷰화면에서 한줄로 출력 } ----//---------->
  <?
  $n = $view[wr_2];    // 한줄당 출력 이미지수
 
  if ($n > (count($view[file])-1)) {
  $i_count = (count($view[file])-1);  //원본이미지수가 적으면 적은갯수를..
  }
  else {
  $i_count = $n;      //원본이미지수가 많으면 설정갯수를..
  } 
  if ($i_count > 0) {
  $wid = (int)($board[bo_image_width]/$i_count); //게시판환경설정->'이미지폭크기'를 갖고 나눈다
  $board[bo_image_width] = $wid;    //자동이미지폭 조정을 위해 다시 넘겨준다..
  $wid = (int)(1/$n*100);
  }
  echo "<table width='100%' cellpadding=3 cellspacing=0 border=0>";
  echo "<tr>";
        for ($i=0; $i<=count($view[file]); $i++) {
  if (($view[file][$i][view]) && $i>0 && ($i%$n == 0)) {
    echo "</tr><tr>";
  }
            if ($view[file][$i][view]) {
    echo "<td align='center' valign='top' style='word-break:break-all'>";
    echo "<td align='center' valign='top' style='word-break:break-all'>";
    echo "<table cellpadding=10 cellspacing=0 border=0 style='border:1px solid #cccccc;'><tr><td>";
    echo "<table cellpadding=0 cellspacing=0 border=0 style='border:1px solid #888888;'><tr><td>";
    echo $view[file][$i][view];
    echo "</td></tr></table>";
    echo "</td></tr></table>";
    echo "<br><br>". $view[file][$i][content]; // 이미지 설명글 {게시판 환경설정에서 체크}
  }   
        }
  // 부족한 <td> 갯수 맞추는 작업
  if ((count($view[file])-1) % $n != 0) {
  $td_cnt = $n - ((count($view[file])-1)%$n);
  for ($t=0; $t<$td_cnt; $t++) {
    echo "<td>&nbsp;</td>";
  }
  }
  echo "</tr></table>";
        ?>
<!--------------- 여기까지 -------------------------------------//------->
© SIRSOFT
현재 페이지 제일 처음으로