Index: branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php =================================================================== diff -u -r7755 -r7762 --- branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php (.../application.php) (revision 7755) +++ branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php (.../application.php) (revision 7762) @@ -2414,7 +2414,25 @@ } return $user_groups; } + + /** + * Allows to detect if page is browsed by spider (293 agents supported) + * + * @return bool + */ + function IsSpider() + { + static $is_spider = null; + if (!isset($is_spider)) { + $sql = 'SELECT AgentId + FROM '.TABLE_PREFIX.'SpiderUserAgents + WHERE UserAgent = '.$this->DB->qstr(trim($_SERVER['HTTP_USER_AGENT'])); + $is_spider = $this->DB->GetOne($sql) > 0; + } + + return $is_spider; + } } ?> \ No newline at end of file