master
LMR 1 year ago
parent 19c0f5258b
commit 29218c5c9d

@ -31,9 +31,13 @@ class infofix extends CI_Controller
foreach ($rs as $info) { foreach ($rs as $info) {
$keycount = array(); $keycount = array();
foreach ($keys as $key) { foreach ($keys as $key) {
$pos1 = stripos($info->ic_url, $key); $pos_url = stripos($info->ic_url, $key);
$pos2 = stripos($info->ic_content, $key); $sub_url = $info->ic_url == $key ? $info->ic_url : '';
array_push($keycount, array('key' => $key, 'pos1' => $pos1, 'pos2' => $pos2)); $pos_content = stripos($info->ic_content, $key);
$sub_content = '[...' . substr($info->ic_content, $pos_content - 20, strlen($key) + 20 * 2) . '...]';
if ($pos_url !== false || $pos_content !== false) {
array_push($keycount, array('key' => $key, 'sub_url' => $sub_url, 'sub_content' => $sub_content));
}
} }
$info->ic_content = $keycount; $info->ic_content = $keycount;
} }

Loading…
Cancel
Save