data; } else { return $score; } $banned_domains = array(); $banned_parts = array(); $banned_ips = array(); $banned_titles = array(); foreach($blacklist as $element) { if($element['Type'] == "0") { $banned_ips[] = $element['Value']; } elseif($element['Type'] == "1") { $banned_parts[] = $element['Value']; } elseif($element['Type'] == "2") { $banned_domains[] = $element['Value']; } elseif($element['Type'] == "3") { $banned_titles[] = $element['Value']; } } $ipList = explode(",", get_ip()); foreach($ipList as $ip) { if(in_array($ip, $banned_ips)) { $score += 5; } } if(count($domain_parts) >= 3) { $sub_domain = $domain_parts[count($domain_parts) - 3] . "." . $domain_parts[count($domain_parts) - 2] . "." . $domain_parts[count($domain_parts) - 1]; } else { $sub_domain = $top_domain; } foreach($banned_domains as $part) { if(strtolower($part) == strtolower($top_domain) || strtolower($part) == strtolower($sub_domain)) { $score += 10; } elseif(strpos($url, $part) !== false) { $score += 5; } } foreach($banned_parts as $part) { if(strpos(strtolower($url), strtolower($part)) !== false) { $score += 3; } } if(!empty($title)) { foreach($banned_titles as $part) { if(strpos(strtolower($title), strtolower($part)) !== false) { $score += 3; } } } return $score; } ?>