s

시그너스님의 구인 최신글에서 질문입니다.

몇시간을 헤매다가 질문을 올립니다.
시그너스님의 구인구직 최신글에서 10개의 글이 나오도록 설정 했는데 가로에서 5개씩
나누어 출력되도록 하려면 어느부분을 고쳐야 하는지요. 그누회원 여러분의 도움의 손길을
기다립니다. 감사합니다.
 
소스는....
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<link rel='stylesheet' type='text/css' href='<?=$latest_skin_path?>/img/bstyle.css'>

<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 시작 -->
<table width="942" cellpadding="0" cellspacing="0" border="0" align='center'>
<tr><td align='center'>
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
   <td width='2'></td>
   <td>
<table width=942 border=0 cellspacing=0 cellpadding=0 >
    <tr><td width="5"></td><td>
<table width=942 border=0 cellspacing=0 cellpadding=0 >
    <tr><td height=1 colspan=5  bgcolor=D9DAD9></td></tr>
    <tr><td width="10"></td>
        <td align="center" width=100><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/title.gif' width=96 height=21 border="0" align='absmiddle'></a></td>
        <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;<b><span class="v3">전체구인정보 <?=number_format($board[bo_count_write])?>건</span></b>&nbsp;</td>
        <td align=center  width="45"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' width="45" height="17" border="0" align='absmiddle'></a></td>
        <td width="10"></td>
    </tr>
    <tr><td colspan=5 bgcolor=E6E6E6 height=3></td></tr>
    <tr> <td colspan=5 bgcolor=B7B7B7 height=1></td></tr>
</table></td><td width="5"></td></tr>
</table>
<table border="0" cellpadding="0" cellspacing="0"><tr><td height='5'></td></tr></table>
    <table width="942" border="0" cellspacing="0" cellpadding="0">
    <tr>
<? 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 = "$latest_skin_path/img/no_logo.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]}'>";
// 주소입력값을 다시 쪼개어, '지역구'까지만 출력토록 함.
$ex3_filed = explode("|", $list[$i][wr_3]);
$ext3_02   = explode(" ", $ex3_filed[2]);
//echo $ext3_02[0] . "-" . $ext3_02[1]; {아래 주소표시부분에 위치)
//--보증금/월세/권리금
$ex7_filed = explode("|",$list[$i][wr_7]);
$ext7_00  = $ex7_filed[0];
$ext7_01  = $ex7_filed[1];
$ext7_02  = $ex7_filed[2];
//-- 학원분류
$ex5_filed = explode("|",$list[$i][wr_5]);
$ext5_00  = $ex5_filed[0];
$ext5_01  = $ex5_filed[1];
$ext5_02  = $ex5_filed[2];
$ext5_03  = $ex5_filed[3];
$ext5_04  = $ex5_filed[4];
$ext5_05  = $ex5_filed[5];
$ext5_06  = $ex5_filed[6];
$ext5_07  = $ex5_filed[7];
//-- 학원분류
$ex6_filed = explode("|",$list[$i][wr_6]);
$ext6_00  = $ex6_filed[0];
$ext6_01  = $ex6_filed[1];
$ex8_filed = explode("|",$list[$i][wr_8]);
$ext8_00  = $ex8_filed[0];
$ext8_01  = $ex8_filed[1];
$ext8_02  = $ex8_filed[2];
$ext8_06  = $ex8_filed[6];
$ext8_08  = $ex8_filed[9];
$ext8_09   = explode(" ", $ex8_filed[9]);
$ex9_filed = explode("|",$list[$i][wr_9]);
$ext9_00   = $ex9_filed[0];
$ext9_01   = $ex9_filed[1];
$ext9_02   = $ex9_filed[2];
$ext9_03   = $ex9_filed[3];
$ext9_04   = $ex9_filed[4];
$ext9_05   = $ex9_filed[5];
$ext9_06   = $ex9_filed[6];
$ext9_07   = $ex9_filed[7];
$ext9_08   = $ex9_filed[8];
$ext9_09   = $ex9_filed[9];
$ext5_06_c = cut_str(get_text($ext5_06), 20);
$ext8_06_c = cut_str(get_text($ext8_06), 16);
$subject = cut_str(get_text($list[$i][subject]), 24);
//================= 반복 start ====================== ?>
 
<!------------------ 넓이는 최소 440 입니다.--------------------------->
<!------------삽입-------------------->
<td  valign="top" ><table border="0" cellpadding="0" cellspacing="0"><tr><td width="5"></td><td>
        <!--이미지 시작-->
    <table width=174 cellpadding=0 cellspacing=0 border=0 >
    <tr><td><img src="<?=$latest_skin_path?>/img/box_grand_1.gif"></td></tr>
    <tr>
     <td background='<?=$latest_skin_path?>/img/box_grand_bg_1.gif' height=41>
      <table width=100% cellpadding=0 cellspacing=0 border=0 align="center">
       <tr>
       <td width=100% align="center"><?=$view_href?><img src="<?=$img?>" onmouseover="this.style.filter='gray alpha(opacity=60)'" width=160 height="41"  onmouseout="this.style.filter=''" border="0" title="<?=$title?>"></td>
                                                        </tr>
      </table>
     </td>
    </tr>
    <tr><td background=<?=$latest_skin_path?>/img/box_grand_bg_1.gif height=2></td></tr>
    <tr><td height=10 background=<?=$latest_skin_path?>/img/box_grand_bg_2.gif></td></tr>
    <tr>
     <td background=<?=$latest_skin_path?>/img/box_grand_bg_2.gif style='padding-left:6px; padding-right:6px;' height=20 align="center"><a href="<?=$list[$i][href]?>" ><B><FONT color=#0066cc><?=$ext5_06_c?></font></B></A>
        <? // 아이콘출력
        if ($list[$i][is_notice]) { echo "<img src=\"$latest_skin_path/img/icon_level01.gif\" width=15 height=15 align='absmiddle'>"; }
        else if ($list[$i][wr_1] == "1") { echo "<img src=\"$latest_skin_path/img/icon_level02.gif\" width=15 height=15 align='absmiddle'>"; }
        else { echo ""; } ?>
<!-- // 거래관련 아이콘 출력 --//-->
  <? if($list[$i][wr_4] == "on")  {echo "<img src='{$latest_skin_path}/img/icon_on.gif' border='0' width='35' height='14' align='absmiddle'>"; } ?>
  <? if($list[$i][wr_4] == "off") {echo "<img src='{$latest_skin_path}/img/icon_off.gif' border='0' width='45' height='14' align='absmiddle'>";} ?>

</td>
    </tr>
    <tr>
        <td background=<?=$latest_skin_path?>/img/box_grand_bg_2.gif style='padding-left:6px; padding-right:6px;' height=20 align="center">
                   <span style="word-break:break-all;"><?
        echo $list[$i][icon_reply] . " ";
        if ($list[$i][is_notice])
            echo "<a class='notice' href='{$list[$i][href]}'><font style='font-family:돋움; font-size:9pt; '>{$subject}</font></a>";
        else if ($list[$i][wr_1] == "1")
            echo "<a class='notice2' href='{$list[$i][href]}'><font style='font-family:돋움; font-size:9pt; '>{$subject}</font></a>";
        else if ($list[$i][wr_1] == "2")
            echo "<a href='{$list[$i][href]}'><font style='font-family:돋움; font-size:9pt; '><strong>{$subject}</strong></font></a>";
        else
            echo "<a href='{$list[$i][href]}'><font style='font-family:돋움; font-size:9pt; '>{$subject}</a>";
 
        if ($list[$i][comment_cnt])
            echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:8pt;'>{$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];
        ?>
                   </span></td>
    </tr>
                                <tr>
                                   <td align=center background=<?=$latest_skin_path?>/img/box_grand_bg_2.gif style='padding-left:6px; padding-right:6px;' height=20 align="center"><?=$ext8_06_c?>-<?=$ext6_00?></td>
                                </tr>
    <tr>
     <td background=<?=$latest_skin_path?>/img/box_grand_bg_2.gif style='padding-left:6px; padding-right:6px;' height=20 align="center">[<?=$ext8_09[0]?>-<?=$ext8_09[1]?>] <? if($ext8_02) {?><?=$ext8_02?><? } ?></td>
    </tr>
    <tr><td><img src=<?=$latest_skin_path?>/img/box_grand_2.gif></td></tr>
   </table></td><td width="5"></td></tr></table></td> 
     <!--이미지 끝-->

<? } ?>
    <? if (count($list) == 0) { echo "<td width=100% height=105 align=center>게시물이 없습니다.</td>"; } ?>
    </tr>
   </table></td>
   <td width='2' nowrap ></td>
   </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0"><tr><td height='5'></td></tr></table>
</td></tr>
</table>
|

댓글 2개

현재 가로로 10개가 나온다는 가정하에

<table width="942" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
===============================================>
<table width="942" border="0" cellspacing="0" cellpadding="0">

<? for ($i=0; $i<count($list); $i++) {
if( $i %5 == 0) echo '<tr>';
정말로 감사합니다. 언제나 rolo님은 회원들의 어려움을 도와주시는 참 좋은 분 같습니다.
다시한번 감사드립니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
19년 전 조회 1,513
19년 전 조회 1,715
19년 전 조회 1,509
19년 전 조회 2,243
19년 전 조회 1,195
19년 전 조회 1,788
19년 전 조회 1,578
19년 전 조회 1,540
19년 전 조회 1,513
19년 전 조회 1,712
19년 전 조회 1,578
19년 전 조회 1,545
19년 전 조회 1,524
19년 전 조회 1,427
19년 전 조회 1,524
19년 전 조회 1,198
19년 전 조회 1,515
19년 전 조회 1,589
19년 전 조회 2,476
19년 전 조회 1,584
🐛 버그신고