유아원님의 인기검색어 삭제하는거 문의드립니다. 정보
유아원님의 인기검색어 삭제하는거 문의드립니다.본문
아래의 소스를 사용중입니다.
키워드를 클릭하면 그 키워드만 삭제되는것 같은데요..
전부다 지워지네요...
왜 그럴까요???
adm 폴더에서 사용중입니다.
<?
$g4_path = ".";
include_once("$g4_path/_common.php");
$date = "1"; // 날짜 지정
// 수동 삭제
if ($type == 'del') {
// 9보다 작다면 차단
if ($member[mb_level] < '9') {
alert("운영자만 가능합니다.");
} else {
// 삭제
$sql = " delete from $g4[popular_table] where pp_ip = '$ip' ";
sql_query($sql);
goto_url("./keyword_del.php");
}
} else {
// 한글이 아닐 때 삭제
$to_date = date("Y-m-d H:i:s"); //오늘 날짜
$fr_date = date("Y-m-d H:i:s", strtotime($to_date) - ($date * 86400));
$sql = " select *, count(*) as cnt from $g4[popular_table]
where pp_date between '$fr_date' and '$to_date'
group by pp_word
order by cnt desc, pp_word
limit 300 ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 넘버
$num = $i + 1;
if (!check_string($row[pp_word], _G4_HANGUL_ + _G4_ALPHABETIC_ + _G4_NUMERIC_)) {
//if (!check_string($row[pp_word], _G4_HANGUL_ )) {
//echo $num." <font color='red'>[D] ".$row[pp_word]." ($row[cnt])</font><p>";
$sql2 = " delete from $g4[popular_table] where pp_id = '{$row[pp_id]}' ";
sql_query($sql2);
}
else if (!cut_hangul_last($row[pp_word])) {
//echo $num." <font color='red'>[D] ".$row[pp_word]." ($row[cnt])</font><p>";
$sql3 = " delete from $g4[popular_table] where pp_id = '{$row[pp_id]}' ";
sql_query($sql3);
} else {
echo $num." <a href='?type=del&ip={$row[pp_ip]}'>".$row[pp_word]."</a> ($row[cnt])<p>";
}
}
// 키워드 삭제
$sql0 = " delete from $g4[popular_table] where pp_word LIKE '%가슴%'
or pp_word LIKE '%노출%'
or pp_word LIKE '%음란%'
or pp_word LIKE '%야사%' ";
sql_query($sql0);
}
?>
키워드를 클릭하면 그 키워드만 삭제되는것 같은데요..
전부다 지워지네요...
왜 그럴까요???
adm 폴더에서 사용중입니다.
<?
$g4_path = ".";
include_once("$g4_path/_common.php");
$date = "1"; // 날짜 지정
// 수동 삭제
if ($type == 'del') {
// 9보다 작다면 차단
if ($member[mb_level] < '9') {
alert("운영자만 가능합니다.");
} else {
// 삭제
$sql = " delete from $g4[popular_table] where pp_ip = '$ip' ";
sql_query($sql);
goto_url("./keyword_del.php");
}
} else {
// 한글이 아닐 때 삭제
$to_date = date("Y-m-d H:i:s"); //오늘 날짜
$fr_date = date("Y-m-d H:i:s", strtotime($to_date) - ($date * 86400));
$sql = " select *, count(*) as cnt from $g4[popular_table]
where pp_date between '$fr_date' and '$to_date'
group by pp_word
order by cnt desc, pp_word
limit 300 ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 넘버
$num = $i + 1;
if (!check_string($row[pp_word], _G4_HANGUL_ + _G4_ALPHABETIC_ + _G4_NUMERIC_)) {
//if (!check_string($row[pp_word], _G4_HANGUL_ )) {
//echo $num." <font color='red'>[D] ".$row[pp_word]." ($row[cnt])</font><p>";
$sql2 = " delete from $g4[popular_table] where pp_id = '{$row[pp_id]}' ";
sql_query($sql2);
}
else if (!cut_hangul_last($row[pp_word])) {
//echo $num." <font color='red'>[D] ".$row[pp_word]." ($row[cnt])</font><p>";
$sql3 = " delete from $g4[popular_table] where pp_id = '{$row[pp_id]}' ";
sql_query($sql3);
} else {
echo $num." <a href='?type=del&ip={$row[pp_ip]}'>".$row[pp_word]."</a> ($row[cnt])<p>";
}
}
// 키워드 삭제
$sql0 = " delete from $g4[popular_table] where pp_word LIKE '%가슴%'
or pp_word LIKE '%노출%'
or pp_word LIKE '%음란%'
or pp_word LIKE '%야사%' ";
sql_query($sql0);
}
?>
댓글 전체
해당 키워드의 아이피주소값(키워드 검색한 사람)이 동일한것만 삭제됩니다.^^
한사람이 여러개를 검색했을수도 있으므로, 여러개가 삭제될수도 있겠지요..
한사람이 여러개를 검색했을수도 있으므로, 여러개가 삭제될수도 있겠지요..
아..그렇군요.아이피로 삭제되는군요..