아이피별 스펨 실시간 자동삭제 업데이트 버전 2018/02/22
[code]
<?
$sip = array('122.254.165.221','100.100.100.5');//스팸 아이피추가
foreach($sip as $nip) {
$sip = $nip;
$tip = $_SERVER['REMOTE_ADDR'];
?>
<? if ($is_admin == $member[mb_nick]||$tip == $sip) { ?>
<?
$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 cf_possible_ip ='$sip'");
sql_query("delete from `$g5[write_prefix]$row[bo_table]` where cf_possible_ip ='$sip'");
$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]
댓글 5개
extend폴더에 넣으시면 됩니다.
스팸 아이피 추가
$sip = array('122.254.165.221','100.100.100.5');//아이피추가 하시면됩니다.
https://sir.kr/g5_plugin/3808
복 많이 받으십시요.^^
복보단은..... MegaHacks덕에 저또한 새롭게 알게 되었습니다. 어떤 스탬이 오는지 저에게 정보를 주시면 감사 하겠습니다.
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4417 | ||
| 2364 | 1년 전 | 1635 | ||
| 2363 | 1년 전 | 2109 | ||
| 2362 |
디지털홍익인간
|
1년 전 | 1259 | |
| 2361 | 1년 전 | 2035 | ||
| 2360 |
parkee
|
1년 전 | 929 | |
| 2359 | 1년 전 | 1655 | ||
| 2358 | 2년 전 | 1380 | ||
| 2357 | 2년 전 | 2653 | ||
| 2356 | 2년 전 | 1651 | ||
| 2355 |
타버린나무
|
2년 전 | 1859 | |
| 2354 | 2년 전 | 2389 | ||
| 2353 |
swallow
|
2년 전 | 2365 | |
| 2352 | 2년 전 | 1513 | ||
| 2351 | 2년 전 | 1592 | ||
| 2350 |
|
2년 전 | 1480 | |
| 2349 | 2년 전 | 1292 | ||
| 2348 | 2년 전 | 2380 | ||
| 2347 | 2년 전 | 2496 | ||
| 2346 |
ceramoon
|
2년 전 | 1536 | |
| 2345 | 2년 전 | 1274 | ||
| 2344 | 2년 전 | 1679 | ||
| 2343 | 2년 전 | 2408 | ||
| 2342 | 2년 전 | 1645 | ||
| 2341 | 2년 전 | 1181 | ||
| 2340 | 2년 전 | 2531 | ||
| 2339 | 2년 전 | 1222 | ||
| 2338 | 2년 전 | 1401 | ||
| 2337 | 2년 전 | 1711 | ||
| 2336 | 2년 전 | 2004 | ||
| 2335 | 2년 전 | 2282 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기