new.php 수정하고 싶습니다. > 그누4 질문답변

그누4 질문답변

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

new.php 수정하고 싶습니다. 정보

new.php 수정하고 싶습니다.

본문

new.php 수정하고 싶습니다.
지금 new.php는
원글은 제목형태로 표기되며 문제가 없는데요.
댓글의 경우 원글의 제목에 [코]만 붙어서 표기되기 때문에 ㅋㅋㅋ 와같은 글이 도배가 되어도 적발할 방법이 없습니다.

그간 질문을 통해 답변도 많이 얻었고
직접 게시판을 뒤져서 팁들도 많이 참고했지만 잘 안되네요.

코멘트를 [코]가 아닌 내용이 표시되게 하려면 어떻게 해야 하나요..
쌀쌀한 날이 점점 많아지네요.
감기조심하시길 바랍니다.
읽어주셔서 감사합니다.

*가능하시다면 파일을 수정하여 팁자료실에 아예 올려주시면 더더욱 감사할것 같습니다.

댓글 전체

new.php

 $row3 = sql_fetch(" select wr_content, mb_id, wr_name, wr_email, wr_homepage, wr_datetime from $tmp_write_table where wr_id = '$row[wr_id]' "); // ★ wr_content 추가
$list[$i] = $row2;
$comment .= $row3['wr_content']; // ★ 추가
$list[$i][mb_id] = $row3[mb_id];

skin/new/사용스킨/new.skin.php 
제목 출력 부분에서 코멘트 아닌 경우 조건 추가
<?php if(!$list[$i]['comment'])  echo $wr_subject ?></a>
<?php if(!$list[$i]['comment'])  echo $wr_subject ?></a>

위 부분(g5, g4 다름) 원래(변경전)으로 수정하고
echo <<<HEREDOC 위쪽에 아래와 같이 제목 출력에 대한 조건 처리

if(!$list[$i][comment]) $wr_subject = get_text(cut_str($list[$i][wr_subject], 40)); // 코멘트 아닌 경우에 제목 출력
오..뭔가 보입니다.!!
근데 따라해보니 약간 오류가 있는듯합니다.
일반글은 :제목 (정상출력)
코멘트는 : 코멘트 원글제목 (원글제목이 따라붙네요;;)
http://www.choogo.net/bbs/new.php?gr_id=&view=&mb_id=
위처럼 됩니다.

*아마 사노라가노라님께서 정확히 알려주셨는데 제가 잘못적용했거나 제가 그동안 테스트하며 원본이 꼬여있는 경우도 있을 수 있긴합니다..ㅠㅠ;;
if(!$list[$i][comment]) $wr_subject = get_text(cut_str($list[$i][wr_subject], 40)); // 코멘트 아닌 경우에 제목 출력
위 내용이 코멘트이면 제목 출력 하지 않음 처리인데 적용 하셨는지 적용되었다면 적용한 위치 등 체크
답변감사합니다!

new.skin.php에

<?
for ($i=0; $i<count($list); $i++)
{
    $gr_subject = cut_str($list[$i][gr_subject], 10);
    $bo_subject = cut_str($list[$i][bo_subject], 10);
    $wr_subject = get_text(cut_str($list[$i][wr_subject], 40));
    if(!$list[$i][comment]) $wr_subject = get_text(cut_str($list[$i][wr_subject], 40)); // 코멘트 아닌 경우에 제목 출력
    echo <<<HEREDOC
<tr>
    <td align="center" height="30" colspan=3><a href='./new.php?gr_id={$list[$i][gr_id]}'>{$gr_subject}</a></td>
    <td align="center" colspan=2><a href='./board.php?bo_table={$list[$i][bo_table]}'>{$bo_subject}</a></td>
    <td width="">&nbsp;<a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a></td>
    <td align="center">{$list[$i][name]}</td>
    <td align="center" colspan=2>{$list[$i][datetime2]}</td>
    <!-- <a href="javascript:;" onclick="document.getElementById('mb_id').value='{$list[$i][mb_id]}';">&middot;</a> -->
</tr>
<tr>
    <td colspan="9" height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
}
?>

와 같이 되어있습니다.

그리고 new.php에는

    else // 코멘트
    {
        $comment = "[코] ";
        $comment_link = "#c_{$row[wr_id]}";
        $row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_parent]' ");
        $row3 = sql_fetch(" select mb_id, wr_name, wr_email, wr_homepage, wr_datetime, wr_content from $tmp_write_table where wr_id = '$row[wr_id]' ");
        $list[$i] = $row2;
$comment .= $row3['wr_content']; // ★ 추가
        $list[$i][mb_id] = $row3[mb_id];
        $list[$i][wr_name] = $row3[wr_name];
        $list[$i][wr_email] = $row3[wr_email];
        $list[$i][wr_homepage] = $row3[wr_homepage];
        $list[$i][wr_content] = $row3[wr_content];

        $name = get_sideview($row3[mb_id], cut_str($row3[wr_name], $config[cf_cut_name]), $row3[wr_email], $row3[wr_homepage]);
        // 당일인 경우 시간으로 표시함
        $datetime = substr($row3[wr_datetime],0,10);
        $datetime2 = $row3[wr_datetime];
        if ($datetime == $g4[time_ymd])
            $datetime2 = substr($datetime2,11,5);
        else
            $datetime2 = substr($datetime2,5,5);
    }

와같이 되어있습니다.

혹시 잘못된 부분이있나용??^^;;
// $wr_subject = get_text(cut_str($list[$i][wr_subject], 40));
if(!$list[$i][comment]) $wr_subject = get_text(cut_str($list[$i][wr_subject], 40)); // 코멘트 아닌 경우에 제목..

기존 제목 처리 부분 주석 처리 후 확인 해 보세요.
전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

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