썸네일 최신게시판스킨에 관한 질문 드려봅니다. > 그누4 질문답변

그누4 질문답변

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

썸네일 최신게시판스킨에 관한 질문 드려봅니다. 정보

썸네일 최신게시판스킨에 관한 질문 드려봅니다.

본문

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 : http://leisuredesign.org/page/main_a.php

상단 주소를 참고해서 봐주셨으면 합니다.

계속 찾아봤는데 관련 질답글 내지 활용팁이 없어서 질문 드려요. 프로그래밍 지식이 거의 없어서 여러 고수님들이 공개해주신 소스들을 활용해서 사이트를 만들곤 하는데요 이번에 사이트를 꾸미면서 최신갤러리 스킨을 적용했습니다.

소스는 아래와 같습니다.

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$cols  = 2; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h  = 76; // 이미지 상하 간격
$col_width = (int)(99 / $cols);

$img_width = 96; //썸네일 가로길이
$img_height = 70; //썸네일 세로길이
$img_quality = 70; //퀼리티 100이하로 설정

if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb105'; //썸네일 이미지 생성 디렉토리

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);

?>
<table width=252 border="0" cellpadding=0 cellspacing=0>
  <? for ($i=0; $i<count($list); $i++) { ?>
  <tr>
    <td width="252" align=center>
      <table width="205" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <?  for ($i=0; $i<count($list); $i++) {
    if ($i>0 && $i%$cols==0) { echo "<td colspan='$cols' height='$image_h'></td><tr>"; }
    $img = "<img src='$latest_skin_path/img/noimg.gif' width='$img_width' height='$img_height' title='이미지 없음'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    // 썸네일 이미지가 존재하지 않는다면
    if (!file_exists($thumb)) {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        // 업로드된 파일이 이미지라면
        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
                break;

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

            // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
            if ($height < $img_height)
                // 계산된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $height);
            else
                // 설정된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $img_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
            imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        }
    }

    if (file_exists($thumb))
        $img = "<img src='$thumb'>";
?>
          <?
        $datetime = substr($list[$i][wr_datetime],0,10);
        $datetime2 = $list[$i][wr_datetime];
       
        if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", $g4['server_time'] - ($row['bo_new'] * 3600))) $comment_new = "new";

        if ($datetime == $g4[time_ymd])
            $datetime2 = substr($datetime2,11,5);
        else
            $datetime2 = substr($datetime2,5,5);

    $list[$i][datetime] = $datetime;
    $list[$i][datetime2] = $datetime2;
   
    $a[$i] = array(
      "wr_date"=>$datetime2,
);
?>
          <?
 $rw_subject = cut_str(stripslashes($list[$i][subject]),$subject_size,'..');
 $a_link="<a href='{$list[$i][href]}'>$rw_subject</a>";
 $a_img="<a href='{$list[$i][href]}'>$img</a>";
 $a_comment="<a href=\"{$list[$i][comment_href]}\"><span class='commentFont'>{$list[$i]['comment_cnt']}</span></a>";
 $rw_content = cut_str(stripslashes($list[$i][wr_content]),$content_size,' ..more');
 $rw_content = strip_tags($rw_content);
?>
          <td width="205" align=center valign="top">
            <?=$a_img?>
          </td>
          <? } $cnt = ($i%$cols); for ($k=$cnt; $k<$cols && $cnt; $k++) ?>
        </tr>
      </table></td>
  </tr>
  <? } ?>
  <? if (count($list) == 0) { ?>
  <tr>
    <td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</font></td>
  </tr>
  <? } ?>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
  imageHandle.document.write("<title>  </title>");
  imageHandle.document.write("<style>");
  imageHandle.document.write("*{margin:0;padding:0;border:0;}");
  imageHandle.document.write("</style>");
  imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>

현재 문제가 되는것은 갤러리 게시물(상단 링크페이지에서 우측하단 여디포갤러리입니다)에 댓글(comment)를 달았을때입니다. 게시물에 댓글을 입력하면 최신갤러리 스킨에서 noimg.gif파일을 출력하면서 새로운 글처럼 뜹니다. 기존 글이 유지가 되어야 하는데 지식이 짧아서 도통 원인을 찾을 수 없네요.

고수님들의 따뜻한 조언 부탁드립니다.

ps. 혹시 몰라서 글읽기권한은 공개로 해두었습니다.
  • 복사

댓글 전체

$a_comment="<a href=\"{$list[$i][comment_href]}\"><span class='commentFont'>{$list[$i]['comment_cnt']}</span></a>";

-----------------------

//$a_comment="<a href=\"{$list[$i][comment_href]}\"><span class='commentFont'>{$list[$i]['comment_cnt']}</span></a>";

주석 먹인 후 실험해보세요

그리고 commentFont  클래스에 뭐가 들었습니까? 이것도 확인
latest.lib.php에서

$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";

부분을

$sql = " select * from $tmp_write_table where wr_is_comment = 0 and wr_reply='' order by wr_num limit 0, $rows ";

일케해보세요~
© SIRSOFT
현재 페이지 제일 처음으로