php파일에서 댓글쓰기
필요해서 급하게 만들어서 소스가 개판일수도있습니다.
extend 폴더에 test.php 만드시고 업로드 하세요 아래소스~
한가지 말씀드리면 extend 는 인크루드 안하셔도 작동합니다.
<?php
function comment($bo_table_f,$wr_id_f,$mb_id_f,$mb_pw_f,$mb_nick_f,$content){
global $g4;
$bo_tbe = 'g4_write_'.$bo_table_f;
$row = "select wr_id ,wr_num,wr_parent,wr_comment from $bo_tbe where wr_id = $wr_id_f and wr_is_comment = 0";
$fetch = sql_fetch($row);
$sql = "insert into $bo_tbe
set wr_num = '".$fetch['wr_num']."',
wr_is_comment = 1,
wr_content = '$content',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = '$mb_id_f',
wr_password = '".sql_password($mb_pw_f)."',
wr_name = '$mb_nick_f',
wr_email = '$wr_email',
wr_datetime = '$g4[time_ymdhis]',
wr_last = '$g4[time_ymdhis]',
wr_ip = '$_SERVER[REMOTE_ADDR]' ";
sql_query($sql);
$wr_id = mysql_insert_id();
sql_query(" update $bo_tbe set wr_parent = '$fetch[wr_parent]' where wr_id = '$wr_id' ");
sql_query(" update $bo_tbe set wr_comment = $fetch[wr_comment] + 1 where wr_id = '$fetch[wr_id]' ");
}
?>
사용법
echo comment('게시판',wr_id번호,'아이디','패스워드','닉네임','코멘트내용');
응용하시면
다른사이트 댓글 파싱해와서 자동으로 올리거나 할수도있습니다.
extend 폴더에 test.php 만드시고 업로드 하세요 아래소스~
한가지 말씀드리면 extend 는 인크루드 안하셔도 작동합니다.
<?php
function comment($bo_table_f,$wr_id_f,$mb_id_f,$mb_pw_f,$mb_nick_f,$content){
global $g4;
$bo_tbe = 'g4_write_'.$bo_table_f;
$row = "select wr_id ,wr_num,wr_parent,wr_comment from $bo_tbe where wr_id = $wr_id_f and wr_is_comment = 0";
$fetch = sql_fetch($row);
$sql = "insert into $bo_tbe
set wr_num = '".$fetch['wr_num']."',
wr_is_comment = 1,
wr_content = '$content',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = '$mb_id_f',
wr_password = '".sql_password($mb_pw_f)."',
wr_name = '$mb_nick_f',
wr_email = '$wr_email',
wr_datetime = '$g4[time_ymdhis]',
wr_last = '$g4[time_ymdhis]',
wr_ip = '$_SERVER[REMOTE_ADDR]' ";
sql_query($sql);
$wr_id = mysql_insert_id();
sql_query(" update $bo_tbe set wr_parent = '$fetch[wr_parent]' where wr_id = '$wr_id' ");
sql_query(" update $bo_tbe set wr_comment = $fetch[wr_comment] + 1 where wr_id = '$fetch[wr_id]' ");
}
?>
사용법
echo comment('게시판',wr_id번호,'아이디','패스워드','닉네임','코멘트내용');
응용하시면
다른사이트 댓글 파싱해와서 자동으로 올리거나 할수도있습니다.
댓글 1개
kalcapt
12년 전
오 때에따라 좋은 팁이네요~^^
게시판 목록
그누4 팁자료실
그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
나누면 즐거움이 커집니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 3269 |
|
10년 전 | 6658 | |
| 3268 | 10년 전 | 7181 | ||
| 3267 |
또치하우스
|
11년 전 | 5000 | |
| 3266 |
네이비칼라
|
11년 전 | 5033 | |
| 3265 | 11년 전 | 5152 | ||
| 3264 | 11년 전 | 7041 | ||
| 3263 |
|
11년 전 | 7209 | |
| 3262 |
|
11년 전 | 6645 | |
| 3261 | 11년 전 | 5555 | ||
| 3260 | 11년 전 | 7408 | ||
| 3259 | 11년 전 | 6707 | ||
| 3258 | 11년 전 | 5513 | ||
| 3257 | 11년 전 | 10483 | ||
| 3256 | 11년 전 | 3824 | ||
| 3255 |
언제나해피
|
11년 전 | 7406 | |
| 3254 | 11년 전 | 4988 | ||
| 3253 | 11년 전 | 13094 | ||
| 3252 | 11년 전 | 4750 | ||
| 3251 |
노피노키오
|
11년 전 | 6829 | |
| 3250 |
|
11년 전 | 5811 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기