최신게시물뽑아오기 질문드립니다... > 그누4 질문답변

그누4 질문답변

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

최신게시물뽑아오기 질문드립니다... 정보

최신게시물뽑아오기 질문드립니다...

본문

아래소스는 최신글을 불러오는 소스입니다.
아래 방식으로 불러오면
1열로만 나타나게 되는데...
2열로 나타나게 하려면 어떻게 해야 하나요?




이런식을
ㅁㅁ
ㅁㅁ
이런식으로 말이죠....


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

// 썸네일 생성
$thumb_width = "90"; //썸네일 가로길이 / 이미지 크기를 조정하실려면 조정하십시오.
$thumb_height = "70"; //썸네일 세로길이
$thumb_quality = "100"; //퀼리티 100이하로 설정
$wr_content_cut = "200";  //본문글자 자를숫자

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

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

<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr><td bgcolor=#EBEBEB height=1 colspan=5></td></tr>
<colgroup width=14>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
    <td colspan=5 align=center>
        <table width=100% height=80 border=0 cellpadding=0 cellspacing="0">
<!-- <tr><td bgcolor=#EBEBEB height=1 colspan=5></td></tr> -->
<tr><td height=5 colspan=5></td></tr>
        <tr>
<td width=5></td>
<td>
              <?
$img = "<img src='$board_skin_path/img/no_img.gif' border=0 title='이미지 없음'>";
//$thumb = $thumb_path.'/'.$list[$i][wr_id];
$thumb = $thumb_path.'/'.$list[$i][file][0][file];
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
continue;
  $rate = $thumb_width / $size[0];
  $height = (int)($size[1] * $rate);

  if ($height < $thumb_height)
$dst = imagecreatetruecolor($thumb_width, $height);
  else
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
  imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
  imagejpeg($dst, $thumb_path.'/'.$list[$i][file][0][file], $thumb_quality);
  chmod($thumb_path.'/'.$list[$i][file][0][file], 0606);
  imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
  chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}

if (file_exists($thumb) && $list[$i][file][0][file]) {
echo "<a href='{$list[$i][href]}'><img src='{$thumb}' width='{$thumb_width}' height='{$thumb_height}' align='absmiddle' border='0'></a>";
} else {
//preg_match("`<\s*img\s+src\s*=\s*['|\"]?([^'|\"\s]+://[^'|\"\s]+\.(gif|jpe?g|png))['|\"]?\s*[^>]+`i", $list[$i]['wr_content'], $images);

if (!empty($images[1])) {
$img_size = GetImageSize("$images[1]");
if($img_size[0] >= $img_size[1]) {
$imgper = $thumb_width/$img_size[0];
$thumb_height = $img_size[1]*$imgper;
}else{
$imgper = $thumb_height/$img_size[1];
$thumb_width = $img_size[0]*$imgper;
}

echo "<a href='{$list[$i][href]}'><img src='{$images[1]}' width='{$thumb_width}' height='{$thumb_height}' align='absmiddle' border='0'></a>";
} else {
echo "";
}
}
?>
</td>
<td width=5></td>
            <td>            <?
            echo "<a href='{$list[$i]['href']}'>";
            echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
echo "<br><font style='font-family:돋움; font-size:9pt; color:#2C88B9;'>{$list[$i]['wr_1']}</font>";
echo "<br><font style='font-family:돋움; font-size:9pt; color:#2C88B9;'>{$list[$i]['wr_2']}</font>";
            echo "</a>";

            if ($list[$i]['comment_cnt'])
                echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";


            echo " " . $list[$i]['icon_new'];
            ?></td>
<td width=5></td>
  </tr>
<tr><td height=5 colspan=5></td></tr>
        <tr><td bgcolor=#EBEBEB height=1 colspan=5></td></tr>
        </table></td>
</tr>
<? } ?>

<? if (count($list) == 0) { ?><tr><td colspan=5 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>

</table>
  • 복사

댓글 전체

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