전체글(new.php) 불러올때 첫번째 이미지만 나옵니다..;;
본문
전체글(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?>
가로 이미지수를 늘려서 불러오기위해
아래와 같이 반복문....을 적용하니
<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?>
답변을 작성하시기 전에 로그인 해주세요.