From 9cbff6835b3ecfafe2b529c93635960cba2011c9 Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 13 Oct 2014 13:12:43 +0900 Subject: [PATCH] =?UTF-8?q?sfl=EC=97=90=20mb=5Fid=EA=B0=80=20=EC=9E=88?= =?UTF-8?q?=EC=9C=BC=EB=A9=B4=20=EC=9D=B8=EA=B8=B0=20=EA=B2=80=EC=83=89?= =?UTF-8?q?=EC=96=B4=20=EA=B8=B0=EB=A1=9D=ED=95=98=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/search.php | 8 ++++---- lib/common.lib.php | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bbs/search.php b/bbs/search.php index 2a83c1edc..ed0058d54 100644 --- a/bbs/search.php +++ b/bbs/search.php @@ -72,6 +72,10 @@ if ($stx) { if (trim($s[$i]) == '') continue; $search_str = $s[$i]; + + // 인기검색어 + insert_popular($field, $search_str); + $str .= $op1; $str .= "("; @@ -100,10 +104,6 @@ if ($stx) { $str .= ")"; $op1 = " {$sop} "; - - // 인기검색어 - $sql = " insert into {$g5['popular_table']} set pp_word = '{$search_str}', pp_date = '".G5_TIME_YMD."', pp_ip = '{$_SERVER['REMOTE_ADDR']}' "; - sql_query($sql, FALSE); } $str .= ")"; diff --git a/lib/common.lib.php b/lib/common.lib.php index a53b23898..4bd59b75e 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -616,8 +616,7 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op if ($search_str == "") continue; // 인기검색어 - $sql = " insert into {$g5['popular_table']} set pp_word = '$search_str', pp_date = '".G5_TIME_YMD."', pp_ip = '{$_SERVER['REMOTE_ADDR']}' "; - sql_query($sql, FALSE); + insert_popular($field, $search_str); $str .= $op1; $str .= "("; @@ -2813,4 +2812,15 @@ function get_icode_userinfo($id, $pass) return $userinfo; } + +// 인기검색어 입력 +function insert_popular($field, $str) +{ + global $g5; + + if(!in_array('mb_id', $field)) { + $sql = " insert into {$g5['popular_table']} set pp_word = '{$str}', pp_date = '".G5_TIME_YMD."', pp_ip = '{$_SERVER['REMOTE_ADDR']}' "; + sql_query($sql, FALSE); + } +} ?> \ No newline at end of file