Code: Show/Hide $host_ip = $row['session_ip'];
$host_ip = hexdec(substr($row['session_ip'], 0, 2)); $host_ip .= '.'; $host_ip .= hexdec(substr($row['session_ip'], 2, 2)); $host_ip .= '.'; $host_ip .= hexdec(substr($row['session_ip'], 4, 2)); $host_ip .= '.'; $host_ip .= hexdec(substr($row['session_ip'], 6, 2)); $hostname = gethostbyaddr($host_ip); if (preg_match('/\.googlebot\.com$/', $hostname)) { $username = "<font color=blue>G</font><font color=red>o</font><font color=red>o</font><font color=blue>g</font><font color=green>l</font><font color=red>e</font>Bot"; } |
Code: Show/Hide User-agent: Googlebot
Disallow: / |
Code: Show/Hide User-agent: *
Disallow: / |
Code: Show/Hide $host_ip = $row['session_ip'];
$host_ip = hexdec(substr($row['session_ip'], 0, 2)); $host_ip .= '.'; $host_ip .= hexdec(substr($row['session_ip'], 2, 2)); $host_ip .= '.'; $host_ip .= hexdec(substr($row['session_ip'], 4, 2)); $host_ip .= '.'; $host_ip .= hexdec(substr($row['session_ip'], 6, 2)); |
Code: Show/Hide // script snippet from phpBB2/includes/functions.php
// line 343 - 353 function encode_ip($dotquad_ip) { $ip_sep = explode('.', $dotquad_ip); return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]); } function decode_ip($int_ip) { $hexipbang = explode('.', chunk_split($int_ip, 2, '.')); return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]); } |