for문 질문이요 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

for문 질문이요 정보

for문 질문이요

본문

for ($i=0; $i<count($list); $i++)
{
$homepageurl="";
//추가
if($list[$i][wr_1] >= 100)
{
$ing="[작업완료]";
//$homepageurl=$list[wr_link1];
if($list[$i][wr_link1]) $homepageurl="<a href='".$list[$i][wr_link1]."' target=_blank>";
}
else $ing="";
   
$_datetime=$list[$i][datetime2];
    $_hit=$list[$i][wr_hit];


    $title = "클릭하시면 해당 사이트로 이동합니다.";
    $content = cut_str(get_text($list[$i][wr_content]), 80);
    $img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
    if (!file_exists($img) || !$list[$i][file][0][file])
        $img = "$board_skin_path/img/progress/no_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&no=1";
    //$view_href = "";
    //if ($is_admin)
        $view_href = "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>";

    $checkbox = "";
 

$link = cut_str($list[$i][wr_link1], 70);
$homepageurl="<a href='{$list[$i][wr_link1]}' target=_blank>{$link}</a>";
$homepageurl2="<a href='{$list[$i][wr_link1]}' target=_blank>";

$wr_guide = nl2br(cut_str($list[$i][wr_2],250));

if($i = "count($list)-1")
$s = "<img src='$board_skin_path/images/list_line.gif' width='1' height='135'>";
    $tr = "";
    if ($i && $i%$board[bo_gallery_cols]==0)
        $tr = "</tr><tr>";
    echo "$tr";
//<td width=1 valign="top"><img src="{$board_skin_path}/images/list_line.gif" width="1" height="135"></td>
echo <<<HEREDOC

<td width="650" valign="top" align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
<td width=1 valign="top"><img src="{$board_skin_path}/images/list_line.gif" width="1" height="135"></td>//이미지삽입
                    <td align=center>
                        <table border="0" cellpadding="0" cellspacing="0">                         
                            <tr>
                            <td align="center">{$view_href}<img src="{$img}" height="135" width="135"  border="0" ></a></td>
                            </tr>                         
<tr>
<td align="center" height=30 colspan=3><img src="{$board_skin_path}/img/homepagemake_icon.gif" width="9" height="9">
{$checkbox}{$view_href}{$list[$i][subject]}</a></td>
</tr>
                        </table>
                    </td>
<td>{$s}</td>
                </tr>
            </table>
        </td>
    </tr>

</table>
<br>
    </td>
HEREDOC;
}

|            |
|  이미지  |
|            |

이런식으로 이미지 사이사이에 칸막이 이미지를 삽입하고 싶습니다

단순하게 저런식으로 하니까 한쪽만 출력이 마지막에는 안 나오고

잘 안되네요

양쪽 다 삽입하니 겹치고

어떻게하면 좋을까요?
  • 복사

댓글 전체

if($i==count($list)-1)
echo "<td width=1 valign="top"><img src="{$board_skin_path}/images/list_line.gif" width="1" height="135"></td>";

이렇게 if문 사용하셔서 이미지가 마지막에 끝날때 td가 하나 더 생기도록 하셔도 될것 같네용...
저랑 같은 생각을 하셨네요

하지만 저렇게 할 경우 이미지가 많아 세로로 2줄 이상이 나오게 되면 칸막이 이미지가

마지막 이미지에만 출력이 되요
© SIRSOFT
현재 페이지 제일 처음으로