테스트 사이트 - 개발 중인 베타 버전입니다

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

· 3년 전 · 2867 · 2

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개

좋은자료 감사합니다
3년 전
@산적이
감사합니다. 좋은 하루되세요~~~!!!

게시글 목록

번호 제목
24149
24140
24133
24125
24119
24109
24105
24101
24093
24089
24077
24074
24071
24070
24067
24056
24050
24046
24043
24040
24037
24036
24035
24034
24021
24017
24005
24002
23990
23980