갤러리용 최신글에서 한 게시글의 첨부이미지 수를 3개이상 보여줄 수 있나요??

갤러리용 최신글에서 한 게시글의 첨부이미지 수를 3개이상 보여줄 수 있나요??

QA

갤러리용 최신글에서 한 게시글의 첨부이미지 수를 3개이상 보여줄 수 있나요??

본문

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" valign="top"> 
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
   <? for ($i=0; $i<count($list); $i++) {
     if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
   ?>    
   <td width="<?=$col_width?>%" align="center" valign="top">
   <?
   $image = $list[$i][file][0][file]; //원본
   $img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력
   
    echo $list[$i][icon_reply] . " ";
    echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
    echo "<tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:0px solid #CECECE; padding:0px'></a></td></tr>";
   echo "</table>";
   ?>   
   </td>
   <? } ?>    
   <?
   $cnt = ($i%$cols);
   for ($k=$cnt; $k<$cols && $cnt; $k++) {
    echo "<td width=$col_width%></td>";
   }
   ?>
   <? if (count($list) == 0) { echo "<td align=center>게시물이 없습니다.</td>"; } ?>   
    </tr>
  </table>
 </td>
  </tr>
</table>
 
---첨부된 이미지 3개를 보여줘야 하는데 최신글은 항상 첨부1 이미지를 보이더군요... 방법좀...

이 질문에 댓글 쓰기 :

답변 1

$image = $list[$i][file][0][file]; //원본

$image2 = $list[$i][file][1][file]; //원본

$image3 = $list[$i][file][2][file]; //원본

$img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력

$img2=$data_path. "/".$image2;  //썸네일이 없을경우 원본출력

$img3=$data_path. "/".$image3;  //썸네일이 없을경우 원본출력



만들고


<img src='$img' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:0px solid #CECECE; padding:0px'>

<img src='$img2' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:0px solid #CECECE; padding:0px'>

<img src='$img3' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:0px solid #CECECE; padding:0px'>

답변을 작성하시기 전에 로그인 해주세요.
전체 10,637
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT