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와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
나누면 즐거움이 커집니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 3289 | 9년 전 | 4819 | ||
| 3288 | 9년 전 | 5803 | ||
| 3287 |
|
9년 전 | 3508 | |
| 3286 |
또치하우스
|
9년 전 | 12303 | |
| 3285 | 9년 전 | 11505 | ||
| 3284 |
다람쥐7마리
|
10년 전 | 4684 | |
| 3283 |
블랙초콜렛더블샷
|
10년 전 | 5974 | |
| 3282 |
또치하우스
|
10년 전 | 10272 | |
| 3281 | 10년 전 | 9789 | ||
| 3280 | 10년 전 | 4994 | ||
| 3279 | 10년 전 | 4274 | ||
| 3278 | 10년 전 | 5359 | ||
| 3277 |
|
10년 전 | 5268 | |
| 3276 | 10년 전 | 5781 | ||
| 3275 | 10년 전 | 4352 | ||
| 3274 | 10년 전 | 5594 | ||
| 3273 | 10년 전 | 6910 | ||
| 3272 | 10년 전 | 7223 | ||
| 3271 | 10년 전 | 4937 | ||
| 3270 |
|
10년 전 | 5406 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기