Thanks a lot man. I'm having trouble now with the Friendly Urls...it seems to not be working right.
Also, in the user agent checking, where do you put this code:
## function for user ip address checking
## matches full/part of an ip address
## might be useful for people who dont have a .htaccess file
## or those who want to identify bots who dont supply a valid or a cloaked
## useragent. probably should be called on return of 0 from useragentcheck
## in online.php
##
## i think its unnecessary. also the ip address matching isnt great since php
## cant handle CIDR addresses so either you break the ip address up and match
## values or you use ranges (as below) which will also identify ip outside
## the allocated range
## ie crawler918.com
##
http://ws.arin.net/cgi-bin/whois.pl?queryinput=!%20NET-12-148-209-192-1
## 12.148.209.192/26
## /26 is 62 ip addresses identifying 12.148.209. means that you're blocking 254 ip
## address which will exclude non rogue ips.
## ip address have a tendancy to change and would result in a fairly bit list.
function useripaddresscheck( $match_addr, $addr_code )
{
$addr = array(
'12.148.209.' => 'www.nameprotect.com|||crawler918.com',
'12.148.196.' => 'www.nameprotect.com|||crawler918.com',
'12.175.0.' => 'www.nameprotect.com|||crawler918.com',
'63.148.99.' => 'www.cyveillance.com|||cyveillance',
'65.118.41.' => 'www.cyveillance.com|||cyveillance'
);
foreach( $addr as $useraddr => $addrurl )
{
if ( preg_match ("/^\d+$/", $useraddr) )
{
$useraddr = $addrurl;
$addrurl = "Web Robot";
}
if ( preg_match ("/^". preg_quote ($useraddr) ."\d+/i", $match_addr) )
{
$addrinfo = preg_split ("/\|\|\|/", $addrurl);
if (!($addrinfo[1])) {
$addrinfo[0] = "http://www.robotstxt.org/wc/active.html";
$addrinfo[1] = "Web Robot ".$useraddr."*";
}
switch ($addr_code) {
case 0:
return 1;
break;
case 1:
return $addrinfo[1];
break;
case 2:
return '</a><a href="http://'. $addrinfo[0] .'" alt="'. $addrinfo[1] .'"><i>'. $addrinfo[1] .'</i>';
break;
}
}
}
}
## ----------------------------------------------------------------------------- ##