최근게시물에 복사글도 노출되게 하고싶습니다.

최근게시물에 복사글도 노출되게 하고싶습니다.

QA

최근게시물에 복사글도 노출되게 하고싶습니다.

본문

제목그대로 최근게시물에 복사된 글도 노출되고 하고싶습니다.

move_update.php파일에 이동된 글은 노출되는것같은데 복사글은 확인이 안되서요.

복사해서 수정해서 작성한 글들도 노출하고싶은데 방법 좀 알려주세요..!

이 질문에 댓글 쓰기 :

답변 3

move_update.php



                if ($sw == 'move' && $i == 0)
                {
                    // 스크랩 이동
                    sql_query(" update {$g5['scrap_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
                    // 최신글 이동
                    /*
                    sql_query(" update {$g5['board_new_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent', wr_parent = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
                    */
                    // 추천데이터 이동
                    sql_query(" update {$g5['board_good_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
                }
                sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$move_bo_table}', '{$insert_id}', '{$save_parent}', '".G5_TIME_YMDHIS."', '{$row2['mb_id']}' ) ");
             

 

 

아래 구문을 주석 처리하시고 


sql_query(" update {$g5['board_new_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent', wr_parent = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");

 

 

if문 밖에 아래 구문 넣으시면 됩니다.


sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$move_bo_table}', '{$insert_id}', '{$save_parent}', '".G5_TIME_YMDHIS."', '{$row2['mb_id']}' ) ");

 


                if ($sw == 'move' && $i == 0)
                {
                    // 스크랩 이동
                    sql_query(" update {$g5['scrap_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");

                    // 최신글 이동
                    /*sql_query(" update {$g5['board_new_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent', wr_parent = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");*/

                    // 추천데이터 이동
                    sql_query(" update {$g5['board_good_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
                }
            }
            else
            {
                $count_comment++;

                if ($sw == 'move')
                {
                    // 최신글 이동
                    sql_query(" update {$g5['board_new_table']} set bo_table = '$move_bo_table', wr_id = '$insert_id', wr_parent = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
                }
            }

            sql_query(" update $move_write_table set wr_parent = '$save_parent' where wr_id = '$insert_id' ");
			sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$move_bo_table}', '{$insert_id}', '{$save_parent}', '".G5_TIME_YMDHIS."', '{$row2['mb_id']}' ) ");



위처럼 넣었거든요..
잘못된걸까요ㅠㅠ

최신글은 등록시 날짜 부분이 오늘날짜로 반영되면 최신글로 될텐데 지금 복사한 날짜 기준으로 날짜가 등록되어 그런듯 합니다.

move_update.php 에서 wr_datetime 필드 부분을 오늘날짜로 적용해 주시면 최신글로 등록반영됩니다.


    if ($sw == 'move' && $i == 0)
    {
        // 스크랩 이동
        sql_query(" update {$g5['scrap_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
        
        // 최신글 이동
        /*sql_query(" update {$g5['board_new_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent', wr_parent = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");*/
        
        // 추천데이터 이동
        sql_query(" update {$g5['board_good_table']} set bo_table = '$move_bo_table', wr_id = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
    }
    sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$move_bo_table}', '{$insert_id}', '{$save_parent}', '".G5_TIME_YMDHIS."', '{$row2['mb_id']}' ) ");
}
else
{
    $count_comment++;
    
    if ($sw == 'move')
    {
        // 최신글 이동
        sql_query(" update {$g5['board_new_table']} set bo_table = '$move_bo_table', wr_id = '$insert_id', wr_parent = '$save_parent' where bo_table = '$bo_table' and wr_id = '{$row2['wr_id']}' ");
    }
}
sql_query(" update $move_write_table set wr_parent = '$save_parent' where wr_id = '$insert_id' ");

 

 

이렇게 넣으셔야죠

답변을 작성하시기 전에 로그인 해주세요.
전체 222
QA 내용 검색

회원로그인

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