가로로 된 최근게시물을 세로로 바꾸고 싶어요.ㅠㅜ > 그누4 질문답변

그누4 질문답변

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

가로로 된 최근게시물을 세로로 바꾸고 싶어요.ㅠㅜ 정보

가로로 된 최근게시물을 세로로 바꾸고 싶어요.ㅠㅜ

본문

링크1번을 보시면 좌측 하단에

인기 검색어 밑에 새로등록한 음식점이라고 있습니다.
아래는 해상 최근 게시물 소스이구요..
---------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$gr = get_group($gr_id);
?>
<table width=200 cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<?
$ex10_filed = explode("|",$list[$i][wr_10]);
$list[$i][ext10_00]  = $ex10_filed[0];
?>
<?
$ex7_filed = explode("|",$list[$i][wr_7]);
$list[$i][ext7_00]  = $ex7_filed[0];
$list[$i][ext7_01]  = $ex7_filed[1];
?>
 
<tr>
    <td align=left>
        <table width=100%><tr><td align=left width=90>
            <?
       $style = "";
    if ($list[$i][icon_new])
    $style = "style='font-family:굴림; color:#006F00;' ";
 $subject = "<span $style>".cut_str($list[$i][subject],50)."</span>"; //제목 글자수
        echo "<a href='{$list[$i][href]}'>";
             $image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
             if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
        echo "<img src='$g4[path]/data/file/{$list[$i][bo_table]}/$image' width='90' height='65' border=0>"; // 이미지크기
             } else
        echo "<img src='$latest_skin_path/img/noimage.gif' width='90' height='65' border=0></td>";
           
   echo $list[$i]['icon_reply'] . " ";
            echo "<td width=110 valign=top style='padding:10 0 0 0' align=center><font color=#E33300><b>{$list[$i]['bo_subject']}</font>{$list[$i][ext10_00]}</b><br><a href='{$list[$i]['href']}'>";
            if ($list[$i]['is_notice'])
                echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><font color=#E33300>[{$list[$i]['bo_subject']}]</font> {$list[$i]['subject']}</font>";
            else
//                echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'><b>{$list[$i]['ca_name']}</b><br><font color=red>[{$list[$i]['bo_subject']}]</font><br> {$list[$i]['subject']}</font>";
    echo "<font style='font-family:돋움; font-size:9pt; color:#000000;'>{$list[$i]['subject']}</font>";
            echo "</a>";
   echo "<br><font color=#1A8426><img src=http://image.daum-img.net/hanmail/s_img/local/icon/tel_icon.gif> {$list[$i][wr_3]}</font>";

            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></td>";

            // 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'];
            ?></tr></table></td></tr>
        <tr><td bgcolor=#EBEBEB height=1></td>
</tr>
<? } ?>

<? if (count($list) == 0) { ?><tr><td align=center><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>

</table>
----------------------------------------------
소스가 이렇게 되어있어서.. 최근게시물에 출력을 할 때
<?=latest_group("최근게시물이름", "그룹이름", 10, 14); ?>
이렇게 하면.. 그룹 안에있는 게시물들이.. 최근게시물에 쭈루룩.. 출력이 되는데..
문제는 세로로 출력이 됩니다.ㅠㅜ

제 기억으로는.. 링크2번 소스를 수정해서 사용을 했는데..ㅠㅜ

세로로 말고 가로로 되게 할 수 있는 방법이 있을까요?ㅜㅡ
가로로.. 갯수 정하고.. 줄 수도 정해서 출력되게 하고 싶은데..ㅠㅜ

방법을 모르겠네요..ㅠㅜ
이것저것 보면서 수정해봤는데..계속 오류만 나오고.. 제대로 출력도 안되고.ㅠㅜ

  • 복사

댓글 전체

다른부분 오류는 체크하지 못했구요

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$gr = get_group($gr_id);
?>
<table width=200 cellpadding=0 cellspacing=0>
<tr> ===============================================> 여기에 TR 추가

<? for ($i=0; $i<count($list); $i++) { ?>
<?
$ex10_filed = explode("|",$list[$i][wr_10]);
$list[$i][ext10_00]  = $ex10_filed[0];
?>
<?
$ex7_filed = explode("|",$list[$i][wr_7]);
$list[$i][ext7_00]  = $ex7_filed[0];
$list[$i][ext7_01]  = $ex7_filed[1];
?>
 
<tr> ===============================================> 이 TR 삭제
    <td align=left>
        <table width=100%><tr><td align=left width=90>
            <?
      $style = "";
    if ($list[$i][icon_new])
    $style = "style='font-family:굴림; color:#006F00;' ";
 $subject = "<span $style>".cut_str($list[$i][subject],50)."</span>"; //제목 글자수
        echo "<a href='{$list[$i][href]}'>";
            $image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
            if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
        echo "<img src='$g4[path]/data/file/{$list[$i][bo_table]}/$image' width='90' height='65' border=0>"; // 이미지크기
            } else
        echo "<img src='$latest_skin_path/img/noimage.gif' width='90' height='65' border=0></td>";
           
  echo $list[$i]['icon_reply'] . " ";
            echo "<td width=110 valign=top style='padding:10 0 0 0' align=center><font color=#E33300><b>{$list[$i]['bo_subject']}</font>{$list[$i][ext10_00]}</b><br><a href='{$list[$i]['href']}'>";
            if ($list[$i]['is_notice'])
                echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><font color=#E33300>[{$list[$i]['bo_subject']}]</font> {$list[$i]['subject']}</font>";
            else
//                echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'><b>{$list[$i]['ca_name']}</b><br><font color=red>[{$list[$i]['bo_subject']}]</font><br> {$list[$i]['subject']}</font>";
    echo "<font style='font-family:돋움; font-size:9pt; color:#000000;'>{$list[$i]['subject']}</font>";
            echo "</a>";
  echo "<br><font color=#1A8426><img src=http://image.daum-img.net/hanmail/s_img/local/icon/tel_icon.gif>&nbsp;{$list[$i][wr_3]}</font>";

            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></td>";

            // 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'];
            ?></tr></table></td></tr>  =================> 여기 끝에 TR도 삭제.. 
        <tr><td bgcolor=#EBEBEB height=1></td> ========> 이 라인삭제

</tr> ===============================================> 이 TR 삭제

<? } ?>

<? if (count($list) == 0) { ?><tr><td align=center><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</tr> ===============================================> 여기에 /TR 추가
</table>
미련한곰탱이 님 감사합니다.
제대로 출력이 되네요..
그런데..지금은 가로로 한줄로만 출력이 되는데..
혹시 세로 줄도 임의로 정할 수 있는 방법이 혹시 없을까요?ㅠㅜ
2~3줄정도를 하고 싶은데.. 지금은 한줄로만 출력이 되네요^^;
?></tr></table></td></tr>  =================> 여기 끝에 TR도 삭제.. 
        <tr><td bgcolor=#EBEBEB height=1></td> ========> 이 라인삭제

</tr> ===============================================> 이 TR 삭제

<? } ?>


위 부분에서 

<? if($i!=0&&$i%7==0){ echo "</tr><tr>";}?>  // i가 0이 아니고 7의 배수일때 한줄씩 내리게 됩니다.
<? } ?>

을 넣어주게되면 i 가 0 이아니고 7의 배수일때 한줄씩 내리게 됩니다.
감사합니다..
글을 이제 확인했습니다.
적용을 해 봤는데요..
<? if($i!=0&&$i%4==0){ echo "</tr><tr>";}?>
이렇게 4줄씩 나오게 입력을 하니..
첫줄에는 5개가 나오고 두번째줄부터는 정상적으로 4개가 나오네요..

이것저것 바꿔보다가
<? if($i!=0&&$i%4==3){ echo "</tr><tr>";}?>
이런식으로 4==3으로 바꿔주니까 정상적으로 출력되네요^^;
뭐 이렇게 해도 상관은 없겠죠?^^;
암튼..감사합니다.
© SIRSOFT
현재 페이지 제일 처음으로