최신글 이미지 2개이상 출력 다시 질문 드립니다!! 정보
최신글 이미지 2개이상 출력 다시 질문 드립니다!!본문
휴먼님이 올리신 스킨을 사용중입니다.
아래는 소스입니다
----------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<script>
/*
rolling page by hong..
*/
var leftCt = 0;
$(function(){
$("#album").attr("top", "0");
$("#imgList").attr("timer", setInterval("imgRight()", 3000)); // 멈춰있는 시간
$("#_sub0").css("color", "ff7200");
$("#_sub4").css("color", "6A6A6A");
});
function imgStart(tp){
clearInterval($("#imgList").attr("timer"));
if(tp == "R"){ // 오른쪽 이동
$("#imgList").attr("timer", setInterval("imgRight()", 3000)); // 멈춰있는 시간
imgRight();
}else{ // 왼쪽이동
if(leftCt == 0){
var leng = $("#imgList div").size();
$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
$("#imgList>div").eq(leng).remove();
leftCt = 1;
}
$("#imgList").attr("timer", setInterval("imgLeft()", 3000));
imgLeft();
}
}
function imgRight(){
$("#imgList").animate({
left : parseInt($("#imgList div").eq(0).width() * -1)
},300,function(){
$("#imgList").css("left", "0px");
$("#imgList>div").eq(0).clone().appendTo($("#imgList"));
$("#imgList>div").eq(0).remove();
});
var cnt = parseInt($("#hidd_cnt").val());
var precnt = cnt - 1;
if (cnt==0)
{
$("#_sub0").css("color", "ff7200");
$("#_sub4").css("color", "6A6A6A");
}else{
$("#_sub"+cnt).css("color", "ff7200");
$("#_sub"+precnt).css("color", "6A6A6A");
}
cnt = cnt + 1;
// precnt = cnt - 1;
if (cnt > 4)
{
cnt = 0;
}
$("#hidd_cnt").val(cnt);
}
function imgLeft(){
var leng = $("#imgList div").size();
$("#imgList").animate({
left : 0
},300,function(){
$("#imgList").css("left", "0px");
$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
$("#imgList>div").eq(leng).remove();
});
}
</script>
<style>
/*
이미지 사이즈 맞춰서 수정해주세요... (#viewArea)
*/
#back {position:relative; width:170px; height:110px; background-color:#fafafa; border:#e2e6e9 0px solid;}
#viewArea {position:relative; width:150px; height:110px; overflow:hidden; left:0px; top:0px;}
#imgList {position:absolute; width:800px; left:0px; top:0px;}
#imgList div {float:left; padding:0px; }
#btnLeft {position:absolute; left:10px; float:left; z-index:10; top:43px; cursor:hand;}
#btnRight {position:absolute; right:10px; float:right; z-index:10; top:43px; cursor:hand;}
</style>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width=14><img src='<?=$latest_skin_path?>/img/latest_t01.gif'></td>
<td width='100%' background='<?=$latest_skin_path?>/img/bg_latest.gif'> <strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
<td width=37 background='<?=$latest_skin_path?>/img/bg_latest.gif'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
<td width=14><img src='<?=$latest_skin_path?>/img/latest_t02.gif'></td>
</tr>
</table>
<input type="hidden" id="hidd_cnt" value="1">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="160" align="center" valign="top">
<div id="back">
<div id="viewArea">
<div id="imgList">
<? for ($i=0; $i<count($list); $i++) {
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
?>
<div><a href="<?=$list[$i]['href']?>"><img src='<?=$img?>' width="150" height="110" border="0"></a></div>
<? } ?>
</div>
</div>
<!--<div id="btnLeft">
<span onClick="imgStart('L')"><img src='<?=$latest_skin_path?>/img/btn_left.gif' border="0" align=absmiddle></span>
</div>
<div id="btnRight">
<span onClick="imgStart('R')"><img src='<?=$latest_skin_path?>/img/btn_right.gif' border="0" align=absmiddle></span>
</div>-->
</div>
</td>
<td>
<table width=470 cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=100%>
<tr>
<td height=17><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:나눔고딕; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:나눔고딕; font-size:9pt; color:#6A6A6A; font:bold;' id='_sub".$i."'>{$list[$i]['subject']}</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>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?></td>
<td align=right>
<font style='font-family:tahoma; font-size:12px; color:#2266c7;'><?echo $list[$i]['datetime'];?></font>
</td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
</td></tr></table>
---------------------소스 끝--------------------------------------------
<div id="imgList">
<? for ($i=0; $i<count($list); $i++) {
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
?>
<div><a href="<?=$list[$i]['href']?>"><img src='<?=$img?>' width="150" height="110" border="0"></a></div>
<? } ?>
</div>
이 부분을 한번 더 넣어서 $image = $list[$i][file][0][file]; 0을 1로 수정하면 될듯해서
해봤는데 안돼네요..
따로 뭔가 추가해줘야 하는부분이 있는지요...
좀 가르쳐 주세요.. T.T
아래는 소스입니다
----------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<script>
/*
rolling page by hong..
*/
var leftCt = 0;
$(function(){
$("#album").attr("top", "0");
$("#imgList").attr("timer", setInterval("imgRight()", 3000)); // 멈춰있는 시간
$("#_sub0").css("color", "ff7200");
$("#_sub4").css("color", "6A6A6A");
});
function imgStart(tp){
clearInterval($("#imgList").attr("timer"));
if(tp == "R"){ // 오른쪽 이동
$("#imgList").attr("timer", setInterval("imgRight()", 3000)); // 멈춰있는 시간
imgRight();
}else{ // 왼쪽이동
if(leftCt == 0){
var leng = $("#imgList div").size();
$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
$("#imgList>div").eq(leng).remove();
leftCt = 1;
}
$("#imgList").attr("timer", setInterval("imgLeft()", 3000));
imgLeft();
}
}
function imgRight(){
$("#imgList").animate({
left : parseInt($("#imgList div").eq(0).width() * -1)
},300,function(){
$("#imgList").css("left", "0px");
$("#imgList>div").eq(0).clone().appendTo($("#imgList"));
$("#imgList>div").eq(0).remove();
});
var cnt = parseInt($("#hidd_cnt").val());
var precnt = cnt - 1;
if (cnt==0)
{
$("#_sub0").css("color", "ff7200");
$("#_sub4").css("color", "6A6A6A");
}else{
$("#_sub"+cnt).css("color", "ff7200");
$("#_sub"+precnt).css("color", "6A6A6A");
}
cnt = cnt + 1;
// precnt = cnt - 1;
if (cnt > 4)
{
cnt = 0;
}
$("#hidd_cnt").val(cnt);
}
function imgLeft(){
var leng = $("#imgList div").size();
$("#imgList").animate({
left : 0
},300,function(){
$("#imgList").css("left", "0px");
$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
$("#imgList>div").eq(leng).remove();
});
}
</script>
<style>
/*
이미지 사이즈 맞춰서 수정해주세요... (#viewArea)
*/
#back {position:relative; width:170px; height:110px; background-color:#fafafa; border:#e2e6e9 0px solid;}
#viewArea {position:relative; width:150px; height:110px; overflow:hidden; left:0px; top:0px;}
#imgList {position:absolute; width:800px; left:0px; top:0px;}
#imgList div {float:left; padding:0px; }
#btnLeft {position:absolute; left:10px; float:left; z-index:10; top:43px; cursor:hand;}
#btnRight {position:absolute; right:10px; float:right; z-index:10; top:43px; cursor:hand;}
</style>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width=14><img src='<?=$latest_skin_path?>/img/latest_t01.gif'></td>
<td width='100%' background='<?=$latest_skin_path?>/img/bg_latest.gif'> <strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
<td width=37 background='<?=$latest_skin_path?>/img/bg_latest.gif'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
<td width=14><img src='<?=$latest_skin_path?>/img/latest_t02.gif'></td>
</tr>
</table>
<input type="hidden" id="hidd_cnt" value="1">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="160" align="center" valign="top">
<div id="back">
<div id="viewArea">
<div id="imgList">
<? for ($i=0; $i<count($list); $i++) {
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
?>
<div><a href="<?=$list[$i]['href']?>"><img src='<?=$img?>' width="150" height="110" border="0"></a></div>
<? } ?>
</div>
</div>
<!--<div id="btnLeft">
<span onClick="imgStart('L')"><img src='<?=$latest_skin_path?>/img/btn_left.gif' border="0" align=absmiddle></span>
</div>
<div id="btnRight">
<span onClick="imgStart('R')"><img src='<?=$latest_skin_path?>/img/btn_right.gif' border="0" align=absmiddle></span>
</div>-->
</div>
</td>
<td>
<table width=470 cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=100%>
<tr>
<td height=17><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:나눔고딕; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:나눔고딕; font-size:9pt; color:#6A6A6A; font:bold;' id='_sub".$i."'>{$list[$i]['subject']}</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>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?></td>
<td align=right>
<font style='font-family:tahoma; font-size:12px; color:#2266c7;'><?echo $list[$i]['datetime'];?></font>
</td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
</td></tr></table>
---------------------소스 끝--------------------------------------------
<div id="imgList">
<? for ($i=0; $i<count($list); $i++) {
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
?>
<div><a href="<?=$list[$i]['href']?>"><img src='<?=$img?>' width="150" height="110" border="0"></a></div>
<? } ?>
</div>
이 부분을 한번 더 넣어서 $image = $list[$i][file][0][file]; 0을 1로 수정하면 될듯해서
해봤는데 안돼네요..
따로 뭔가 추가해줘야 하는부분이 있는지요...
좀 가르쳐 주세요.. T.T
댓글 전체
질문이 뭔지 애매하네요; 최신글 이미지 2개이상 출력이라는게
게시물2개인지 한게시물의 첨부이미지2개이상인건지요 ㅠ_ㅠ;;
게시물2개인지 한게시물의 첨부이미지2개이상인건지요 ㅠ_ㅠ;;
관심 가져주셔서 감사합니다!!
한 게시물에 첨부이미지 2개 이상입니다!!
한 게시물에 첨부이미지 2개 이상입니다!!