스펨 실시간 자동삭제 업데이트 버전 2018/02/22
[code]
<?
$mdname = array('0oktu1', 'kf1229love','mmr1234','qmffor85g','9g7g3p','magickh7','bedael','ejrtjsl88','test9940','skdo15778');//스팸아이디 추가
foreach($mdname as $name) {
$mdname = $name;
?>
<? if ($mdname == $member[mb_nick]||$is_admin == $member[mb_nick]) { //관리자 또는 해당 스팸아이디 접근시 실행?>
<?
$query = sql_query("select bo_table from `$g5[board_table]`");
while($row = sql_fetch_array($query)) {
sql_query("delete from `$g5[write_prefix]$row[bo_table]` where mb_id='$mdname'");
sql_query("delete from `$g5[new_win_table]$row[bo_table]` where mb_id='$mdname'");
$sql = " select count(*) as cnt from ".$g5['write_prefix'].$row[bo_table]." where wr_is_comment = 0 ";
$row = sql_fetch($sql);
$bo_count_write = $row['cnt'];
$sql = " select count(*) as cnt from ".$g5['write_prefix'].$row[bo_table]." where wr_is_comment = 1 ";
$row = sql_fetch($sql);
$bo_count_comment = $row['cnt'];
if (isset($_POST['proc_count'])) {
// 원글을 얻습니다.
//$sql = " select wr_id from {$g5['write_prefix']}{$row[bo_table]} where wr_is_comment = 0 ";
$sql = " select a.wr_id, (count(b.wr_parent) - 1) as cnt from ".$g5['write_prefix'].$row[bo_table]." a, ".$g5['write_prefix'].$row[bo_table]." b where a.wr_id=b.wr_parent and a.wr_is_comment=0 group by a.wr_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
/*
// 코멘트수를 얻습니다.
$sql2 = " select count(*) as cnt from {$g5['write_prefix']}$row[bo_table] where wr_parent = '{$row['wr_id']}' and wr_is_comment = 1 ";
$row2 = sql_fetch($sql2);
*/
sql_query(" update ".$g5['write_prefix'].$row[bo_table]." set wr_comment = '".$row['cnt']."' where wr_id = '".$row['wr_id']."' ");
}
}
// 공지사항에는 등록되어 있지만 실제 존재하지 않는 글 아이디는 삭제합니다.
$bo_notice = "";
$lf = "";
if ($board['bo_notice']) {
$tmp_array = explode(",", $board['bo_notice']);
for ($i=0; $i<count($tmp_array); $i++) {
$tmp_wr_id = trim($tmp_array[$i]);
$row = sql_fetch(" select count(*) as cnt from ".$g5['write_prefix'].$row[bo_table]." where wr_id = '".$tmp_wr_id."' ");
if ($row['cnt']) {
$bo_notice .= $lf . $tmp_wr_id;
$lf = ",";
}
}
}
$sql = " update ".$g5['board_table']."
set bo_notice = '".$bo_notice."',
bo_count_write = '".$bo_count_write."',
bo_count_comment = '".$bo_count_comment."'
where bo_table = '".$row[bo_table]."' ";
sql_query($sql);
}
}
?>
<? }?>
[/code]
해피정님 정보로 응용 해보았습니다.
sdel.php파일 만드셔서
extend폴더에 넣으시면 됩니다.
$mdname = array('0oktu1', 'kf1229love','mmr1234','qmffor85g','9g7g3p','magickh7','bedael','ejrtjsl88','test9940','skdo15778');//스팸아이디 추가 하시면 됩니다.
댓글 19개
희안하게 스팸이 닉네임이, 아이디가 없이 스팸글이 올라와 버리더라구요
http://www.evnmusic.com/bbs/board.php?bo_table=co_1
id가 아니라, ip로 삭제하려면 어딜 수정해야할까요?
필요한 자료인데,
현재, 비회원, 일정 ip로 스팸 게시물이 자주 올라오네요.
감사합니다.
https://sir.kr/g5_tip/7510
https://sir.kr/g5_plugin/3808
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4410 | ||
| 1014 | 7년 전 | 6938 | ||
| 1013 | 7년 전 | 3936 | ||
| 1012 | 7년 전 | 5030 | ||
| 1011 | 7년 전 | 5424 | ||
| 1010 | 7년 전 | 4479 | ||
| 1009 | 7년 전 | 3788 | ||
| 1008 |
|
7년 전 | 5008 | |
| 1007 |
|
7년 전 | 5737 | |
| 1006 | 7년 전 | 18328 | ||
| 1005 | 7년 전 | 6315 | ||
| 1004 |
|
7년 전 | 4770 | |
| 1003 | 7년 전 | 9425 | ||
| 1002 | 7년 전 | 10500 | ||
| 1001 | 7년 전 | 3990 | ||
| 1000 | 7년 전 | 5690 | ||
| 999 | 7년 전 | 8997 | ||
| 998 | 7년 전 | 4239 | ||
| 997 | 7년 전 | 8351 | ||
| 996 | 7년 전 | 6622 | ||
| 995 | 7년 전 | 5154 | ||
| 994 | 7년 전 | 4518 | ||
| 993 |
|
7년 전 | 7691 | |
| 992 |
onlymilk47
|
7년 전 | 7891 | |
| 991 | 7년 전 | 4928 | ||
| 990 | 7년 전 | 5770 | ||
| 989 | 7년 전 | 4449 | ||
| 988 | 7년 전 | 4794 | ||
| 987 | 7년 전 | 8552 | ||
| 986 | 7년 전 | 5387 | ||
| 985 | 7년 전 | 7481 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기