2012-09-01, 02:35 PM
2012-09-01, 02:46 PM
The easiest, but not necessarily the best, way to accomplish this would be to:
1. Add the spider IP address to the User Agent String field in the Spiders/Bots list.
2. Edit ./inc/class_session.php and find:
and replace with:
With this method it allows both useragent and IP address validation.
1. Add the spider IP address to the User Agent String field in the Spiders/Bots list.
2. Edit ./inc/class_session.php and find:
if(my_strpos(my_strtolower($this->useragent), my_strtolower($spider['useragent'])) !== false)
and replace with:
if(my_strpos(my_strtolower($this->useragent), my_strtolower($spider['useragent'])) !== false || get_ip() == $spider['useragent'])
With this method it allows both useragent and IP address validation.
2012-09-01, 02:58 PM
(2012-09-01, 02:46 PM)Nathan Malcolm Wrote: [ -> ]The easiest, but not necessarily the best, way to accomplish this would be to:
1. Add the spider IP address to the User Agent String field in the Spiders/Bots list.
2. Edit ./inc/class_session.php and find:
if(my_strpos(my_strtolower($this->useragent), my_strtolower($spider['useragent'])) !== false)
and replace with:
if(my_strpos(my_strtolower($this->useragent), my_strtolower($spider['useragent'])) !== false || get_ip() == $spider['useragent'])
With this method it allows both useragent and IP address validation.
Ok, knowing the file i can properly drive this,
So if i want to use the ptr i must just do
if(my_strpos(my_strtolower($this->useragent), my_strtolower($spider['useragent'])) !== false || preg_match("/" . $spider['useragent'] . "/i",gethostbyaddr(get_ip())
assuming $spider is an array with the spider data
Thanks