갤러리 최근게시물 두줄로 출력하고 싶은데요.. > 그누4 질문답변

그누4 질문답변

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

갤러리 최근게시물 두줄로 출력하고 싶은데요.. 정보

갤러리 최근게시물 두줄로 출력하고 싶은데요..

본문

http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=11270&sca=%C3%D6%B1%D9%B0%D4%BD%C3%B9%B0
보짱님이 공개해주신 최근겔러리 주소인데요..
지금은 한줄로 나와있는데 이것을 두줄로 만들고 싶거든요..

---------------------------------------------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td width="35" height="25" background="<?=$latest_skin_path?>/img/bg_01.gif"></td>
<td background="<?=$latest_skin_path?>/img/bg_02.gif">
<font style="font-size:9pt;"><b><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></b>
</td>
<td width="12" height="25" background="<?=$latest_skin_path?>/img/bg_03.gif"></td>
</tr>
</table>

<table width=100% cellpadding=0 cellspacing=0 style="table-layout: fixed;">
<tr>
    <td align=center>
<table width=98% border=0>
        <tr>
<?
for ($i=0; $i<count($list); $i++)
{
    if ($i > 0)
        echo '<td width=20> </td>';

    $title = get_text($list[$i][wr_subject]);
    $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_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";

    echo <<<HEREDOC
    <td width='110' valign='top' align='center'>
        <table width='110' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
            <td width='110' height='5' align='center'></td>
</tr>

        <tr>
            <td width='110' height='100' align='center'>
<div style='width:110px;height:100px;border:1px solid #CCCCCC;padding:3px' align='center'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='110' height='100' border='0' align='absmiddle' title='$title'></a>
</div>
    </td>
        </tr>

<tr>
            <td width='110' height='5' align='center'></td>
</tr>

<tr>
            <td width='110' height='20' align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>{$list[$i][subject]}</a></td>
</tr>
</table>
    </td>
HEREDOC;
}
?>
</tr></table>


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

----------------------------------------------------------------------------------------------------------------------------
이게 소스인데요..
어느부분을 어떻게 수정을 해야 두줄로 출력이 되나요?ㅜㅜ
이래저래 수정해보고 해도 에러만 나오고 도저히 못찾겠어요..ㅠㅠ
 
다른분들이 갤러리 올려주신것으로 사용할려고 했는데, 이미지 크기에 따라 사이즈가 달라져 버리고, 리스트 항목에도 이미지가 전체적으로 안보여지더라구요..ㅠㅠ
  • 복사

댓글 전체

수정 전
    if ($i > 0)
        echo '<td width=20>&nbsp;</td>';



수정 후
    if ($i && $i%$mod==0)
        echo "</tr><tr>";

    else if ($i > 0)
        echo "<td width=20>&nbsp;</td>";



그리고 상단에~ 추가

$mod = $board[bo_5]; //이미지 가로 갯수


예)

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!$board[bo_5]) alert("해당 게시판 설정 : 여분 필드 5 에 목록에서 보여질 한 줄당 가로 이미지 수를 설정하십시오.");
$mod = $board[bo_5]; //이미지 가로 갯수
?>


예제 스킨~

http://www.morssola.co.kr/data/bbs/board.php?bo_table=1021_g4&sca=%C3%D6%BD%C5%B1%DB&sfl=wr_subject%7C%7Cwr_content&stx=2%B4%DC%2C+3%B4%DC&sop=and&x=32&y=10
© SIRSOFT
현재 페이지 제일 처음으로