구문 오류 좀 봐주세요 > 그누4 질문답변

그누4 질문답변

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

구문 오류 좀 봐주세요 정보

구문 오류 좀 봐주세요

본문

http://www.sir.co.kr/bbs/tb.php/g4_skin/9274
위의 모르솔라님의 latest 스킨을 수정하고 있는데요

index.php 에서

      <?=latest("스킨명", 데이블명, 5<-보여질 목록갯수, 25<-제목 글자수);?>

이렇게하면


 이미지  제목
            내용

정해진 목록수가 보이도록 만들려고 하는데 목록이 2개만 보이고 나머지는 가로로 배치되어 끈겨 버립니다.

어딘가 닫아야 할곳을 안닫았거나 워 그런게 있는거 같은데 그게 뭔지를 모르겠네요
안튼 끝부분의 문제 같은데 모르겠어서 올립니다.

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

if (!$board[bo_5]) alert("해당 게시판 설정 : 여분 필드 5 에 목록에서 보여질 이미지의 폭을 설정하십시오. (100)");
if (!$board[bo_9]) alert("해당 게시판 설정 : 여분 필드 9 에 목록에서 보여질 이미지의 질(quality)을 비율로 설정하십시오. (100 이하)");
if (!$board[bo_7]) alert("게시판 설정 : 여분 필드 7 에 목록에서 내용길이를 입력하십시오.");
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb100';

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);

?>

<table width=50% cellpadding=0 cellspacing=0>
<colgroup width=14>
<colgroup>
<colgroup width=37>
<colgroup width=14>
<tr>
    <td><img src='<?=$latest_skin_path?>/img/latest_t01.gif'></td>
    <td background='<?=$latest_skin_path?>/img/bg_latest.gif'>&nbsp;&nbsp;<strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
    <td background='<?=$latest_skin_path?>/img/bg_latest.gif'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
    <td><img src='<?=$latest_skin_path?>/img/latest_t02.gif'></td>
</tr>

<? for ($i=0; $i<count($list); $i++) { ?>
<table width="50%" border="0" cellspacing="0" cellpadding="0" align="left">
<tr><td bgcolor="#EEEEEE" width="100%" height="1"></td></tr>
<tr><td height="5"></td></tr>
<tr>
<?
{
    if ($i > 0)
        echo "<tr><td width=20>&nbsp;</td></tr>";

    $img = "<img src='$latest_skin_path/img/no_image.gif' border=0 title='이미지 없음'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    if (!file_exists($thumb))
    {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                break;

            $rate = $board[bo_5] / $size[0];
            $height = (int)($size[1] * $rate);

            $dst = imagecreatetruecolor($board[bo_5], $height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_5], $height, $size[0], $size[1]);
            imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_9]);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0707);
        }
    }

    if (file_exists($thumb))
        $img = "<img src='$thumb' border=0>";

    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
    $subject = "<span $style>".cut_str($list[$i][subject],100)."</span>";
    $wr_content = "<span $style>".cut_str(get_text($list[$i][wr_content]),$board[bo_7])."</span>";

    echo <<<HEREDOC
    <td style='word-break:break-all;' valign="top" align="left">
<table width='{$td_width}%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td width='100' height='75' align=center><div style='width:100px; height:75px; position: relative; overflow:hidden;' align=center><a href='{$list[$i][href]}'>{$img}</a></div></td>
<td></td>

<td valign='top'>
<table width='{$td_width}%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td height='20' style='padding:0 10' valign='top'><a href='{$list[$i][href]}'><strong>{$subject}</strong></a>{$comment_cnt} {$list[$i][icon_new]}</td>
</tr>
<tr>
<td style='padding:0 10' valign='top'><a href='{$list[$i][href]}'>{$wr_content}</td>
</tr>
</table>
</td>
</tr>
</table>
    </td>
HEREDOC;
}
?>
</tr>
</table>
</table>
<? } ?>

댓글 전체

<table width=100% cellpadding=0 cellspacing=0>
<tr>
    <td width=14><img src='<?=$latest_skin_path?>/img/latest_t01.gif'></td>
    <td background='<?=$latest_skin_path?>/img/bg_latest.gif'>&nbsp;&nbsp;<strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
    <td width=37 background='<?=$latest_skin_path?>/img/bg_latest.gif'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
    <td width=14><img src='<?=$latest_skin_path?>/img/latest_t02.gif'></td>
</tr>
</table>

<? for ($i=0; $i<count($list); $i++) { ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="left">
<tr><td bgcolor="#EEEEEE" width="100%" height="1"></td></tr>
<tr><td height="5"></td></tr>
<tr>
<?
{
    if ($i > 0)
        echo "<tr><td width=20>&nbsp;</td></tr>";

    $img = "<img src='$latest_skin_path/img/no_image.gif' border=0 title='이미지 없음'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    if (!file_exists($thumb))
    {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                break;

            $rate = $board[bo_5] / $size[0];
            $height = (int)($size[1] * $rate);

            $dst = imagecreatetruecolor($board[bo_5], $height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_5], $height, $size[0], $size[1]);
            imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_9]);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0707);
        }
    }

    if (file_exists($thumb))
        $img = "<img src='$thumb' border=0>";

    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
    $subject = "<span $style>".cut_str($list[$i][subject],100)."</span>";
    $wr_content = "<span $style>".cut_str(get_text($list[$i][wr_content]),$board[bo_7])."</span>";

    echo <<<HEREDOC
    <td style='word-break:break-all;' valign="top" align="left">
<table width='{$td_width}%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td width='100' height='75' align=center><div style='width:100px; height:75px; position: relative; overflow:hidden;' align=center><a href='{$list[$i][href]}'>{$img}</a></div></td>
<td></td>

<td valign='top'>
<table width='{$td_width}%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td height='20' style='padding:0 10' valign='top'><a href='{$list[$i][href]}'><strong>{$subject}</strong></a>{$comment_cnt} {$list[$i][icon_new]}</td>
</tr>
<tr>
<td style='padding:0 10' valign='top'><a href='{$list[$i][href]}'>{$wr_content}</td>
</tr>
</table>
</td>
</tr>
</table>
    </td>
HEREDOC;
}
?>
</tr>
</table>
<? } ?>
추가적인 설명.
테이블 태그중 코딩이 잘못되었습니다.



<table width=50% cellpadding=0 cellspacing=0>
<colgroup width=14>
<colgroup>
<colgroup width=37>
<colgroup width=14>
<tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
</tr>
//잘못된 곳
<table width="50%" border="0" cellspacing="0" cellpadding="0" align="left">
전체 24 |RSS
그누4 질문답변 내용 검색

회원로그인

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