최신글 게시판 엑박

최신글 게시판 엑박

QA

최신글 게시판 엑박

답변 1

본문

<?

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

 

 

$cols  = 1; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)

$image_h  = 1; // 이미지 상하 간격

$col_width = (int)(99 / $cols);

 

$img_width = 120; //썸네일 가로길이 

$img_height = 100; //썸네일 세로길이 

$img_quality = 100; //퀼리티 100이하로 설정 일부 php버전에서는 10이하의 수로 처리 될 수 있삼

 

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

 

$data_path = $g4['path'] . "/data/file/" . $bo_table;

//$thumb_path = $data_path.'/thumb_img_list'; //썸네일 이미지 생성 디렉토리

$path_save_dir = $data_path . '/thumb'; 

 

@mkdir($thumb_path, 0707);

@chmod($thumb_path, 0707);

 

?>

 

<script language="JavaScript" src="<?="$g4[path]/js/b4.common.js"?>"></script> 

<? include_once("$g4[path]/lib/thumb.lib.php")?> 

<? for ($i=0; $i<count($list); $i++) { ?>

 

 

<?

$wr_content = "<a href='{$list[$i]['href']}'>".cut_str(strip_tags($list[$i]['wr_content']), 230, '...')."</a>";

 //   if ($i>0 && $i%$cols==0) { echo "<td colspan='$cols' height='$image_h'></td><tr>"; }

    $img = "<img src='$g4_path/img/noimage.gif' border=1 width='$img_width' height='$img_height' title='이미지 없음' align=left style='margin-right:5px; border:1 #222222 solid;'>";

    $thumb = $thumb_path.'/'.$list[$i][wr_id];

// 섬네일과 새로 올린파일 날짜를 비교하여 셈네일을 갱신하기위해서 지운다.

if ( file_exists($thumb) && (filemtime($thumb) < filemtime($list[$i][file][0][path] .'/'. $list[$i][file][0][file])) ) {

@unlink($thumb);

}

    // 썸네일 이미지가 존재하지 않는다면

    if (!file_exists($thumb)) {

        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];

        // 업로드된 파일이 이미지라면

//echo $i;

        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);

$width = (int)($size[0] * $rate);

 

            // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면

            $dst = imagecreatetruecolor($img_width, $img_height);

 

            if ($height < $img_height) {                // 계산된 이미지 높이로 복사본 이미지 생성

imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $img_height, $size[0], $size[1]);

imagepng($dst, $path_save_dir.'/'.$list[$i][wr_id], 9);

            } else {   // 설정된 이미지 높이로 복사본 이미지 생성

imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);

imagepng($dst, $path_save_dir.'/'.$list[$i][wr_id], $img_quality);

}

//echo $i;

            chmod($path_save_dir.'/'.$list[$i][wr_id], 0606);

        }

    }

 

    if (file_exists($thumb))

        $img = "<img src='$thumb' border=0>";

?>

<?

        $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);

?>                                                         

 

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

<tr>

<td align="center">

<table width="95%" border="0" cellspacing="0" cellpadding="0">

  <tr>

<td width="124" valign="top">

<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">

          <tr>

              <td bgcolor="#FFFFFF"><?=$a_img?></td>

          </tr>

          </table>

        </td>

        <td width="15"></td>

        <td valign="top">

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

          <tr>

            <td>

              <?

            echo "<a href='{$list[$i]['href']}'  class=\"b\">";

            echo "<b>{$list[$i]['subject']}</b>";

            echo "</a>";

?>

            </td>

          </tr>

  <tr><td height="7"></td></tr>

          <tr><td><?=$wr_content?></td></tr>

        </table>

</td>

      </tr>

    </table>

</td>

</tr>

<tr><td height="15"></td></tr>

</table>

 

<?

}

?>

 

 

 

이게 소스인데

나오긴하는데

사진이 엑박이 나서 나와요... ㅠㅠㅠ 좀도와주세요 ㅠㅠㅠ

이 질문에 댓글 쓰기 :

답변 1

어느부분 소스인가요?

저 소스가  latest소스이구요 index에 <?=latest("new2","sub04_05",1,0);?> 이렇게 입력했습니다. 그러면 메인화면에 sub04_05의 게시판 내용이 나와야하는 거구요.. 근데 이미지가 엑박이 떠서 나오고 text는 정상적으로 나옵니다... 불당썸도 설치 되었구여

어떤 스킨 말씀하시는지는 모르겠으나.... 게시판 적용한 스킨은 http://jysoft.co.kr/program/main.php?pg_id=jybasic  여기서 다운받아서 넣었구요
latest skin소스는 저거 하나 밖에는 없어요.... ㅠㅠㅠ 다른 최신글 스킨 적용했는데 이미지 잘 나왔구요 저 최신글 소스로 사용했을때만 이미지 엑박현상나와서요...

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