글답변시

글답변시

QA

글답변시

답변 1

본문

원본글에 글 답변이 리스트에서  비노출을 시키고 싶습니다. 어느부분을 건드려야 하나요 ?


if ($sca || $stx) {

    $sql = " select distinct wr_parent from {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows ";

} else {

    $sql = " select * from {$write_table} where wr_is_comment = 0 ";

    if(!empty($notice_array))

        $sql .= " and wr_id not in (".implode(', ', $notice_array).") ";

    $sql .= " {$sql_order} limit {$from_record}, $page_rows ";

}


이 부분에서 


if ($sca || $stx) {

    $sql = " select distinct wr_parent from {$write_table} where {$sql_search} and wr_option='html1' {$sql_order} limit {$from_record}, $page_rows ";

} else {

    $sql = " select * from {$write_table} where wr_is_comment = 0  and wr_option='html1'";

    if(!empty($notice_array))

        $sql .= " and wr_id not in (".implode(', ', $notice_array).") ";

    $sql .= " {$sql_order} limit {$from_record}, $page_rows ";

}

이렇게 추가수정을 해도 괜찮을까요 ?

이 질문에 댓글 쓰기 :

답변 1


//여기서 부터 추가
$add_sql0 = " wr_id = wr_parent ";    // 글과 부모가 같은것(원글)
if ($sql_search) $add_sql1 = " and ".$add_sql;   // 추가될내용이 존재하면 뒤에 붙이고
$sql_search .= $add_sql1;   // 검색어영역에 추가될내용 붙입니다.
 
if ($sca || $stx) {
    $sql = " select distinct wr_parent from {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows ";
} else {
    $sql = " select * from {$write_table} where wr_is_comment = 0 ";
    $sql .= " and ".$sql_add0; //여기에도 추가합니다.  
    if(!empty($notice_array))
        $sql .= " and wr_id not in (".implode(', ', $notice_array).") ";
    $sql .= " {$sql_order} limit {$from_record}, $page_rows ";
}
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 11
© SIRSOFT
현재 페이지 제일 처음으로