테스트 사이트 - 개발 중인 베타 버전입니다

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

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



가로 이미지수를 늘려서 불러오기위해

아래와 같이 반복문....을 적용하니



<ul>

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

&nbsp;<li>

............................

&nbsp; &nbsp; </li>

<?php } ?>

&nbsp; </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">

&nbsp; &nbsp; <!--legend>상세검색</legend-->

&nbsp; &nbsp; <form name="fnew" method="get">

&nbsp; &nbsp; <?=$group_select?>

&nbsp; &nbsp; <!--select name="view" id="view" title="검색종류" onchange="select_change()">

&nbsp; &nbsp; &nbsp; &nbsp; <option value="">전체게시물

&nbsp; &nbsp; &nbsp; &nbsp; <option value="w">원글만

&nbsp; &nbsp; &nbsp; &nbsp; <option value="c">코멘트만

&nbsp; &nbsp; </select-->

&nbsp; &nbsp; <input type="hidden" name="mb_id" value="<?=$mb_id?>" id="mb_id" title="검색어(필수)">

&nbsp; &nbsp; <input type="submit" value="이동">

&nbsp; &nbsp; </form>

&nbsp; &nbsp; <script>

&nbsp; &nbsp; function select_change()

&nbsp; &nbsp; {

&nbsp; &nbsp; &nbsp; &nbsp; document.fnew.submit();

&nbsp; &nbsp; }

&nbsp; &nbsp; document.getElementById("gr_id").value = "<?=$gr_id?>";

&nbsp; &nbsp; //document.getElementById("view").value = "<?=$view?>";

&nbsp; &nbsp; </script>

</fieldset>

<!-- 검색 끝 -->



<!-- 제목 시작 -->

<div class="bach72_img_thumb">

&nbsp; <div class="bach72_thumb">

<?

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

{

$gr_subject = cut_str($list[$i]['gr_subject'], 20);

&nbsp; &nbsp; $bo_subject = cut_str($list[$i]['bo_subject'], 20);

&nbsp; &nbsp; $wr_subject = get_text(cut_str($list[$i]['wr_subject'], 80));

&nbsp; &nbsp; // 이미지추출

&nbsp; &nbsp; $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";

&nbsp; &nbsp; if($lt_thumb['src']) {

&nbsp; &nbsp; $img_content = '<img alt="'.$lt_thumb['alt'].'" src="'.$lt_thumb['src'].'" width="'.$latest_img_width.'" height="'.$latest_img_height.'">';

&nbsp; &nbsp; } else {

&nbsp; &nbsp; $img_content = '<img src="'.$It_noimg.'" width="'.$latest_img_width.'" height="'.$latest_img_height.'">'; // no img 대신에 그냥 출력안되게 변경





}

?>

<?

// new icon 표시

&nbsp; &nbsp; $new_skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $new_skin_path));

&nbsp; &nbsp; $icon_new = '';

&nbsp; &nbsp; if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", G4_SERVER_TIME - (24 * 3600)))

&nbsp; &nbsp; $icon_new = '<img src="'.$new_skin_url.'/img/icon_new.gif" alt="새글">';

?>



&nbsp; <ul>

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

&nbsp; &nbsp; <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>&nbsp;<?=$icon_new?></span>

<span class='bach72_thumb_mchon'>[ <?php echo $list[$i]['wr_3'] ?> ]</span>

&nbsp; &nbsp; <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>





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

&nbsp; &nbsp; </li>

<?php } ?>

&nbsp; </ul>





<? } ?>



<? if ($i == 0)

&nbsp; &nbsp; echo "게시물이 없습니다.";

?>

&nbsp; &nbsp; </div>

</div>

<?=$write_pages?>



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







오류 주소 : <a href="http://alos.co.kr/ilsaninfo/bbs/new.php" target="_blank" rel="noopener noreferrer">http://alos.co.kr/ilsaninfo/bbs/new.php</a>







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



<?

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">

&nbsp; &nbsp; <!--legend>상세검색</legend-->

&nbsp; &nbsp; <form name="fnew" method="get">

&nbsp; &nbsp; <?=$group_select?>

&nbsp; &nbsp; <!--select name="view" id="view" title="검색종류" onchange="select_change()">

&nbsp; &nbsp; &nbsp; &nbsp; <option value="">전체게시물

&nbsp; &nbsp; &nbsp; &nbsp; <option value="w">원글만

&nbsp; &nbsp; &nbsp; &nbsp; <option value="c">코멘트만

&nbsp; &nbsp; </select-->

&nbsp; &nbsp; <input type="hidden" name="mb_id" value="<?=$mb_id?>" id="mb_id" title="검색어(필수)">

&nbsp; &nbsp; <input type="submit" value="이동">

&nbsp; &nbsp; </form>

&nbsp; &nbsp; <script>

&nbsp; &nbsp; function select_change()

&nbsp; &nbsp; {

&nbsp; &nbsp; &nbsp; &nbsp; document.fnew.submit();

&nbsp; &nbsp; }

&nbsp; &nbsp; document.getElementById("gr_id").value = "<?=$gr_id?>";

&nbsp; &nbsp; //document.getElementById("view").value = "<?=$view?>";

&nbsp; &nbsp; </script>

</fieldset>

<!-- 검색 끝 -->



<!-- 제목 시작 -->

<div class="bach72_img_thumb">

&nbsp; <div class="bach72_thumb">

<?

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

{

$gr_subject = cut_str($list[$i]['gr_subject'], 20);

&nbsp; &nbsp; $bo_subject = cut_str($list[$i]['bo_subject'], 20);

&nbsp; &nbsp; $wr_subject = get_text(cut_str($list[$i]['wr_subject'], 80));



}

?>



&nbsp; <ul>





&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <? if (!count($list) == 0) { ?>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <?

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i = 0; $i < count($list); $i++) {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $noimg = $new_skin_url.'/img/_noimg.gif';

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $thumb = get_list_thumbnail($list[$i]['bo_table'], $list[$i]['wr_id'], $thumb_width, $thumb_height);

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($thumb['src']) {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $img_src = $thumb['src'];

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $img_src = $noimg;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $img_alt = $thumb['alt'];



&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($i>0 && ($i%$set_value[2]) == ($set_value[2] - 1)) {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $li_class = '';

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $li_class = ' class="bach72_img"';

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }



// new icon 표시

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $new_skin_path));

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon_new = '';

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", G4_SERVER_TIME - (24 * 3600)))

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon_new = '<img src="'.$new_skin_url.'/img/icon_new.gif" alt="새글">';

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ?>

<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 ?>'">

&nbsp; &nbsp; <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>&nbsp;<?=$icon_new?></span>

<span class='bach72_thumb_mchon'>[ <?php echo $list[$i]['wr_3'] ?> ]</span>

&nbsp; &nbsp; <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>





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

&nbsp; &nbsp; </li>

<? } ?>

&nbsp; </ul>



<? } else { ?>

&nbsp;<p class="bach72_no_list">게시물이 없습니다.</p>

<? } ?>

&nbsp; &nbsp; </div>

</div>

<?=$write_pages?>
댓글을 작성하려면 로그인이 필요합니다.

답변 1개

해결했습니다...^^

최신글 (갤러리) 스킨 응용해서 적용했습니다.

필요하신분 있을지 몰라 게시글 본문하단에 소스오픈합니다.

(이곳에 댓글 달려니 글이 잘리네요..)
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인

전체 질문 목록

🐛 버그신고