전체글(new.php) 불러올때 첫번째 이미지만 나옵니다..;;

0001.jpg
전체글(new.php)에서 1행일때는 정상적으로 출력이 되는데

가로 이미지수를 늘려서 불러오기위해
아래와 같이 반복문....을 적용하니

<ul>
<?php for ($i = 0; $i < count($list); $i++) { ?>
<li>
............................
</li>
<?php } ?>
</ul>

를 사용하면 첨부이미지와 같이
첫번째 이미지만 중복돼서 나오네요..

어깨너머로 소스만 조금씩 수정해서 쓰는정도의 실력인지라..
도저히 감을 잡을수가 없네요...
고수님들의 도움 부탁드립니다.

++++++++++++++++ 사용중인 new.skin.php ++++++++++++++++++

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G4_LIB_PATH.'/thumbnail.lib.php');
global $is_admin;

$latest_img_width = 220; //이미지 가로 크기
$latest_img_height = 300; //이미지 세로 길이
?>

<link rel="stylesheet" href="<?php echo $new_skin_url; ?>/style.css">

<!-- 검색 -->
<fieldset id="new_sch">
<!--legend>상세검색</legend-->
<form name="fnew" method="get">
<?=$group_select?>
<!--select name="view" id="view" title="검색종류" onchange="select_change()">
<option value="">전체게시물
<option value="w">원글만
<option value="c">코멘트만
</select-->
<input type="hidden" name="mb_id" value="<?=$mb_id?>" id="mb_id" title="검색어(필수)">
<input type="submit" value="이동">
</form>
<script>
function select_change()
{
document.fnew.submit();
}
document.getElementById("gr_id").value = "<?=$gr_id?>";
//document.getElementById("view").value = "<?=$view?>";
</script>
</fieldset>
<!-- 검색 끝 -->

<!-- 제목 시작 -->
<div class="bach72_img_thumb">
<div class="bach72_thumb">
<?
for ($i=0; $i<count($list); $i++)
{
$gr_subject = cut_str($list[$i]['gr_subject'], 20);
$bo_subject = cut_str($list[$i]['bo_subject'], 20);
$wr_subject = get_text(cut_str($list[$i]['wr_subject'], 80));
// 이미지추출
$lt_thumb = get_list_thumbnail($list[$i][bo_table], $list[$i]['wr_id'], $latest_img_width, $latest_img_height);
$It_noimg = "$new_skin_url/img/noimg.gif";
if($lt_thumb['src']) {
$img_content = '<img alt="'.$lt_thumb['alt'].'" src="'.$lt_thumb['src'].'" width="'.$latest_img_width.'" height="'.$latest_img_height.'">';
} else {
$img_content = '<img src="'.$It_noimg.'" width="'.$latest_img_width.'" height="'.$latest_img_height.'">'; // no img 대신에 그냥 출력안되게 변경


}
?>
<?
// new icon 표시
$new_skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $new_skin_path));
$icon_new = '';
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", G4_SERVER_TIME - (24 * 3600)))
$icon_new = '<img src="'.$new_skin_url.'/img/icon_new.gif" alt="새글">';
?>

<ul>
<?php for ($i = 0; $i < count($list); $i++) { ?>
<li class="bach72_img" style="height:470px;overflow:hidden;">
<a href="<?php echo $list[$i]['wr_link1']?>" target="_blank"><?=$img_content;?></a>
<span class="bach72_thumb_subject"><strong><a href="<?php echo $list[$i]['href'] ?>"><?php echo $list[$i]['wr_subject'] ?></a></strong> <?=$icon_new?></span>
<span class='bach72_thumb_mchon'>[ <?php echo $list[$i]['wr_3'] ?> ]</span>
<span class='bach72_thumb_body'><?=cut_str(strip_tags($list[$i][wr_content]),60,"...")?></span>
<span class='bach72_thumb_price'><strong><font color='#F5685F'><?php echo $list[$i]['wr_1'] ?>원</font></strong></span>
<span class='bach72_thumb_order'><a href="<?php echo $list[$i]['wr_link1']?>" target="_blank" title="<?php echo $list[$i]['wr_subject'] ?>"><img src="<?php echo $new_skin_url; ?>/img/icon_order.gif" border='0'></a></span><br><br>

<a href="<?=G4_BBS_URL?>/board.php?bo_table=<?=$list[$i]['bo_table']?>">[ <?php echo $list[$i]['bo_subject'] ?> ]</a>
</li>
<?php } ?>
</ul>


<? } ?>

<? if ($i == 0)
echo "게시물이 없습니다.";
?>
</div>
</div>
<?=$write_pages?>

+++++++++++++++++++++++++++++++++++++++++++++++++



오류 주소 : http://alos.co.kr/ilsaninfo/bbs/new.php



◆◆◆◆◆◆◆◆ 전체글 (이미지갤러리형) 필요하신분 응용하세요!! ◆◆◆◆◆◆◆◆

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G4_LIB_PATH.'/thumbnail.lib.php');
global $is_admin;

$set_value = explode("/","220/300/4");
$thumb_width = $set_value[0]; //썸네일 가로 크기
$thumb_height = $set_value[1]; //썸네일 세로 크기
//$latest_img_width = 220; //이미지 가로 크기
//$latest_img_height = 300; //이미지 세로 길이
?>

<link rel="stylesheet" href="<?php echo $new_skin_url; ?>/style.css">

<!-- 검색 -->
<fieldset id="new_sch">
<!--legend>상세검색</legend-->
<form name="fnew" method="get">
<?=$group_select?>
<!--select name="view" id="view" title="검색종류" onchange="select_change()">
<option value="">전체게시물
<option value="w">원글만
<option value="c">코멘트만
</select-->
<input type="hidden" name="mb_id" value="<?=$mb_id?>" id="mb_id" title="검색어(필수)">
<input type="submit" value="이동">
</form>
<script>
function select_change()
{
document.fnew.submit();
}
document.getElementById("gr_id").value = "<?=$gr_id?>";
//document.getElementById("view").value = "<?=$view?>";
</script>
</fieldset>
<!-- 검색 끝 -->

<!-- 제목 시작 -->
<div class="bach72_img_thumb">
<div class="bach72_thumb">
<?
for ($i=0; $i<count($list); $i++)
{
$gr_subject = cut_str($list[$i]['gr_subject'], 20);
$bo_subject = cut_str($list[$i]['bo_subject'], 20);
$wr_subject = get_text(cut_str($list[$i]['wr_subject'], 80));

}
?>

<ul>


<? if (!count($list) == 0) { ?>
<?
for ($i = 0; $i < count($list); $i++) {
$noimg = $new_skin_url.'/img/_noimg.gif';
$thumb = get_list_thumbnail($list[$i]['bo_table'], $list[$i]['wr_id'], $thumb_width, $thumb_height);
if($thumb['src']) {
$img_src = $thumb['src'];
} else {
$img_src = $noimg;
}
$img_alt = $thumb['alt'];

if($i>0 && ($i%$set_value[2]) == ($set_value[2] - 1)) {
$li_class = '';
} else {
$li_class = ' class="bach72_img"';
}

// new icon 표시
$new_skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $new_skin_path));
$icon_new = '';
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", G4_SERVER_TIME - (24 * 3600)))
$icon_new = '<img src="'.$new_skin_url.'/img/icon_new.gif" alt="새글">';
?>
<li class="bach72_img" style="height:470px;overflow:hidden;">
<a href="<?php echo $list[$i]['wr_link1']?>" target="_blank" title="<?php echo $list[$i]['wr_subject'] ?>">
<img src="<?=$img_src?>" class="bach72_thumb_front" width="<?=$thumb_width ?>" height="<?=$thumb_height ?>" onmouseover="this.src='<?=$new_skin_url ?>/img/thumb_over.png'" onmouseout="this.src='<?=$img_src ?>'">
<img src="<?= $img_src?>" width="<?= $thumb_width?>" height="<?= $thumb_height?>" class="bach72_thumb_back">
</a>
<span class="bach72_thumb_subject"><strong><a href="<?php echo $list[$i]['wr_link1']?>" target="_blank" title="<?php echo $list[$i]['wr_subject'] ?>"><?php echo $list[$i]['wr_subject'] ?></a></strong> <?=$icon_new?></span>
<span class='bach72_thumb_mchon'>[ <?php echo $list[$i]['wr_3'] ?> ]</span>
<span class='bach72_thumb_body'><?=cut_str(strip_tags($list[$i][wr_content]),60,"...")?></span>
<span class='bach72_thumb_price'><strong><font color='#F5685F'><?php echo $list[$i]['wr_1'] ?>원</font></strong></span>
<span class='bach72_thumb_order'><a href="<?php echo $list[$i]['wr_link1']?>" target="_blank" title="<?php echo $list[$i]['wr_subject'] ?>"><img src="<?php echo $new_skin_url; ?>/img/icon_order.gif" border='0'></a></span><br><br>

<a href="<?=G4_BBS_URL?>/board.php?bo_table=<?=$list[$i]['bo_table']?>">[ <?php echo $list[$i]['bo_subject'] ?> ]</a>
</li>
<? } ?>
</ul>

<? } else { ?>
<p class="bach72_no_list">게시물이 없습니다.</p>
<? } ?>
</div>
</div>
<?=$write_pages?>

첨부파일

0001.jpg (410.6 KB)
0회 2013-08-27 23:20
|

댓글 1개

해결했습니다...^^
최신글 (갤러리) 스킨 응용해서 적용했습니다.
필요하신분 있을지 몰라 게시글 본문하단에 소스오픈합니다.
(이곳에 댓글 달려니 글이 잘리네요..)
댓글을 작성하시려면 로그인이 필요합니다.

그누5 질답

그누보드5 버전에 대한 질문을 할 수 있습니다.쪽지나 메일로 해결해 주겠다는 답변은 정상적인 답변으로 보기 어려우므로 신고해 주시기 바랍니다.

+
제목 글쓴이 날짜 조회
12년 전 조회 322
12년 전 조회 450
12년 전 조회 759
12년 전 조회 1,060
12년 전 조회 443
12년 전 조회 330
12년 전 조회 327
12년 전 조회 366
12년 전 조회 433
12년 전 조회 447
12년 전 조회 351
12년 전 조회 276
12년 전 조회 314
12년 전 조회 560
12년 전 조회 237
12년 전 조회 281
12년 전 조회 373
12년 전 조회 396
12년 전 조회 1,921
12년 전 조회 544