[G5] 럭키코멘트 (원본: 익명닉네임님 소스) > 그누보드5 팁자료실

그누보드5 팁자료실

[G5] 럭키코멘트 (원본: 익명닉네임님 소스) 정보

[G5] 럭키코멘트 (원본: 익명닉네임님 소스)

본문

https://sir.kr/g4_tiptech/34021

[G4->G5]로 바꾸어 봤는데...

 

제 사이트는 잘 되는데 다른 분들은 어떨지... 모르겠네요...

 

 

<?php


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

 

$random1 = rand(1,10); 
$random2 =  rand(1,10);

$point_rand = rand(5, 100);

//댓글 달경우 확률로 답글 + 추가 포인트 주기 
if ($w == "c" && $random1 == $random2) // 코멘트 입력
{
    $sql = " insert into $write_table
                set ca_name = '$wr[ca_name]',
                    wr_option = '$wr_secret',
                    wr_num = '$wr[wr_num]',
                    wr_reply = '',
                    wr_parent = '$wr_id',
                    wr_is_comment = '1',
                    wr_comment = '$tmp_comment',
                    wr_comment_reply = 'A',
                    wr_subject = 'Point {$point_rand}점. ★경★ {$wr_name}님 럭키 코멘트에 당첨 되셨습니다. ★축★',
                    wr_content = 'Point {$point_rand}점. ★경★ {$wr_name}님 럭키 코멘트에 당첨 되셨습니다. ★축★',
                    mb_id = 'Luck★Comment',
                    wr_password = '$wr_password',
                    wr_name = 'Luck★Event',
                    wr_email = '$wr_email',
                    wr_homepage = '$wr_homepage',
                    wr_datetime = '".G5_TIME_YMDHIS."',
                    wr_last = '',
                    wr_ip = '$_SERVER[REMOTE_ADDR]',
                    wr_1 = '$wr_1',
                    wr_2 = '$wr_2',
                    wr_3 = '$wr_3',
                    wr_4 = '$wr_4',
                    wr_5 = '$wr_5',
                    wr_6 = '$wr_6',
                    wr_7 = '$wr_7',
                    wr_8 = '$wr_8',
                    wr_9 = '$wr_9',
                    wr_10 = '$wr_10' ";
    sql_query($sql);

    //$comment_id = mysql_insert_id();

    // 원글에 코멘트수 증가 & 마지막 시간 반영
    //sql_query(" update $write_table set wr_comment = wr_comment + 1, wr_last = '$g4[time_ymdhis]' where wr_id = '$wr_id' ");

    // 새글 INSERT
    //sql_query(" insert into $g4[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime ) values ( '$bo_table', '$comment_id', '$wr_id', '$g4[time_ymdhis]' ) ");
    //sql_query(" insert into $g4[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '$g4[time_ymdhis]', '$member[mb_id]' ) ");

    // 코멘트 1 증가
    //sql_query(" update $g4[board_table] set bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' ");

    // 포인트 부여
    //insert_point($member[mb_id], $point_rand, "$board[bo_subject] {$wr_id}-{$comment_id} 댓글 럭키 이벤트 당첨!!", $bo_table, $comment_id, '코멘트');

    
    
    
    
    $comment_id = sql_insert_id();

    // 원글에 댓글수 증가 & 마지막 시간 반영
    sql_query(" update $write_table set wr_comment = wr_comment + 1, wr_last = '".G5_TIME_YMDHIS."' where wr_id = '$wr_id' ");

    // 새글 INSERT
    sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '".G5_TIME_YMDHIS."', '{$member['mb_id']}' ) ");

    // 댓글 1 증가
    sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' ");

    // 포인트 부여
    insert_point($member['mb_id'], $point_rand, "{$board['bo_subject']} {$wr_id}-{$comment_id} 댓글 럭키코멘트 당첨!!", $bo_table, $comment_id, '코멘트');
 

    } 

 

 

?>

 

write_comment_update.skin.php 파일로 저장하시고 게시판 스킨에다가 넣으시면되요.

추천
2

댓글 2개

전체 2,431 |RSS
그누보드5 팁자료실 내용 검색

회원로그인

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