diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index 9f3de4b0..69dbb165 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -42,13 +42,14 @@ class infofix extends CI_Controller // 链接 $sub_url = $info->ic_url == $key ? $info->ic_url : ''; + $limitStr = 30; // 信息内容 $pos_content = 0; $pos_content = mb_stripos($info->ic_content, $key); $sub_content = array(); while ($pos_content) { - array_push($sub_content, '[...' . mb_substr($info->ic_content, $pos_content - 20, mb_strlen($key) + 20 * 2) . '...]'); + array_push($sub_content, '[...' . mb_substr($info->ic_content, $pos_content - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'); $pos_content = mb_stripos($info->ic_content, $key, $pos_content + mb_strlen($key)); } @@ -59,7 +60,7 @@ class infofix extends CI_Controller $pos_content2 = 0; $pos_content2 = mb_stripos($info->amp_json, $key); while ($pos_content2) { - array_push($sub_content2, '[...' . mb_substr($info->amp_json, $pos_content2 - 20, mb_strlen($key) + 20 * 2) . '...]'); + array_push($sub_content2, '[...' . mb_substr($info->amp_json, $pos_content2 - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'); $pos_content2 = mb_stripos($info->amp_json, $key, $pos_content2 + mb_strlen($key)); } } @@ -70,7 +71,7 @@ class infofix extends CI_Controller $pos_content3 = 0; $pos_content3 = mb_stripos($info->amp_body, $key); while ($pos_content3) { - array_push($sub_content3, '[...' . mb_substr($info->amp_body, $pos_content3 - 20, mb_strlen($key) + 20 * 2) . '...]'); + array_push($sub_content3, '[...' . mb_substr($info->amp_body, $pos_content3 - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'); $pos_content3 = mb_stripos($info->amp_body, $key, $pos_content3 + mb_strlen($key)); } } @@ -103,7 +104,11 @@ class infofix extends CI_Controller // json参数 $site = $this->input->get_post('site'); $keys = $this->input->get_post('keys'); - $keyArr = explode(',', $keys); + $keyArr = explode('@', $keys); + + sleep(3); + echo json_encode($keyArr); + return true; // 容错 if (empty($site) || empty($keys) || strpos($keys, '/') === false) {