시와별

최근 갤러리 가로로 2개로 만들기

죄송합니다.
누구 도움을 좀 주셨음 합니다.
최근글 입니다.
여기서 무엇을 수정해야 최근글 사진이 2장 가로로 나오는지요?

질문과 답변을 뒤져보니 잘 이해가 안되고 여기에 남겨둔 소스와 다른 소스들이 있어서
그렇답니다.
감사합니다.

/////////////////////////////////

<?
if (!defined("_GNUBOARD_")) exit; //

$cols = 5; //
$image_h = 10; // ̹
$col_width = (int)(99 / $cols);

$img_width = 200; //
$img_height = 160; //
$img_quality = 90; //

if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 ̻ ġǾ ־ ִ Խ Դϴ.");

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

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

?>
<ul>
<? for ($i=0; $i<count($list); $i++) {
$img = "";
$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\" width=\"90\" height=\"60\" alt=\"$g4[subject]\" class=\"img_box\"/>";
?>
<?
$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 = strip_tags($rw_content);
?>
<li><?=$a_img?><br /><a href='<?=$list[$i][href]?>'><font color=#666666><?=$list[$i]['subject']?></font></a></li>
<? } $cnt = ($i%$cols); for ($k=$cnt; $k<$cols && $cnt; $k++) ?>
</ul>

<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=10,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>
|

댓글 2개

여기서 말고 최신글 불러올때

<?=latest("basic4", "screen2", 3, 15)?> 에서

3이 갯수 15가 제목의 글자수 로 알고있습니다.

3을 2로 바꾸면 갤러리 2개가 되지 않을까요 .
<li style='float:left;'> 이렇게 해주면 되긴하겠지만 오와열 중에서 열에 문제가 잇을 것입니다
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
13년 전 조회 1,482
13년 전 조회 952
13년 전 조회 990
13년 전 조회 796
13년 전 조회 974
13년 전 조회 1,504
13년 전 조회 1,652
13년 전 조회 1,251
13년 전 조회 1,598
13년 전 조회 1,550
13년 전 조회 1,301
13년 전 조회 1,410
13년 전 조회 1,612
13년 전 조회 1,635
13년 전 조회 1,592
13년 전 조회 2,629
13년 전 조회 1,536
13년 전 조회 1,284
13년 전 조회 1,209
13년 전 조회 1,482