Location: PHPKode > projects > Esvon Personals > esvon-personals/inc/robots.inc.php
<?php

/*
if(!empty($_COOKIE)) { // somebody with cookies is not a robot
  define('SE_CRAWLER', '');
  return 0;
}
*/

function hwUserAgentMatches($a_v, $is_robots = false){
  $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
  if(!$ua) return 0;
//  return preg_match('/'.implode('|',$a_v).'/',$ua);
  foreach($a_v as $v){
    if(strpos($ua,$v)!==false){
      if($is_robots) define('SE_CRAWLER', $v);
      return 1;
    }
  }
  return 0;
}

$a_browsers = array(
'msie',
'gecko',
'firefox',
'netscape',
'firebird',
'go!zilla',
'icab',
'konqueror',
'links',
'lynx',
'omniweb',
'opera',
);

$a_robots_ex = array( // SE User Agents which can contain browser signature (msie, etc)
'becomebot',
);

$a_robots = array(
'robot',
'crawl',
'spider',
'antibot',
'appie',
'architext',
'bjaaland',
'digout4u',
'echo',
'fast-webcrawler',
'ferret',
'google',
'gulliver',
'harvest',
'htdig',
'ia_archiver',
'jeeves',
'jennybot',
'linkwalker',
'lycos_',
'mercator',
'moget',
'muscatferret',
'myweb',
'netcraft',
'nomad',
'petersnews',
'scooter',
'slurp',
'unlost_web_crawler',
'voila',
'webbase',
'weblayers',
'wisenutbot',
'acme.spider',
'ahoythehomepagefinder',
'alkaline',
'arachnophilia',
'aretha',
'ariadne',
'arks',
'aspider',
'atn.txt',
'atomz',
'auresys',
'backrub',
'bigbrother',
'blackwidow',
'blindekuh',
'bloodhound',
'brightnet',
'bspider',
'cactvschemistryspider',
'calif[^r]',
'cassandra',
'cgireader',
'checkbot',
'churl',
'cmc',
'collective',
'combine',
'conceptbot',
'coolbot',
'core',
'cosmos',
'cruiser',
'cusco',
'cyberspyder',
'deweb',
'dienstspider',
'digger',
'diibot',
'directhit',
'dnabot',
'download_express',
'dragonbot',
'dwcp',
'e-collector',
'ebiness',
'eit',
'elfinbot',
'emacs',
'emcspider',
'esther',
'evliyacelebi',
'nzexplorer',
'fdse',
'felix',
'fetchrover',
'fido',
'finnish',
'fireball',
'[^a]fish',
'fouineur',
'francoroute',
'freecrawl',
'funnelweb',
'gama',
'gazz',
'gcreep',
'getbot',
'geturl',
'golem',
'grapnel',
'griffon',
'gromit',
'hambot',
'havindex',
'hometown',
'htmlgobble',
'hyperdecontextualizer',
'iajabot',
'ibm',
'iconoclast',
'ilse',
'imagelock',
'incywincy',
'informant',
'infoseek',
'infoseeksidewinder',
'infospider',
'inspectorwww',
'intelliagent',
'irobot',
'iron33',
'israelisearch',
'javabee',
'jbot',
'jcrawler',
'jobo',
'jobot',
'joebot',
'jubii',
'jumpstation',
'katipo',
'kdd',
'kilroy',
'ko_yappo_robot',
'labelgrabber.txt',
'larbin',
'legs',
'linkidator',
'linkscan',
'lockon',
'logo_gif',
'macworm',
'magpie',
'marvin',
'mattie',
'mediafox',
'merzscope',
'meshexplorer',
'mindcrawler',
'momspider',
'monster',
'motor',
'mwdsearch',
'netcarta',
'netmechanic',
'netscoop',
'newscan-online',
'nhse',
'northstar',
'occam',
'octopus',
'openfind',
'orb_search',
'packrat',
'pageboy',
'parasite',
'patric',
'pegasus',
'perignator',
'perlcrawler',
'phantom',
'piltdownman',
'pimptrain',
'pioneer',
'pitkow',
'pjspider',
'pka',
'plumtreewebaccessor',
'poppi',
'portalb',
'puu',
'python',
'raven',
'rbse',
'resumerobot',
'rhcs',
'road_runner',
'robbie',
'robi',
'robofox',
'robozilla',
'roverbot',
'rules',
'safetynetrobot',
'search_au',
'searchprocess',
'senrigan',
'sgscout',
'shaggy',
'shaihulud',
'sift',
'simbot',
'site-valet',
'sitegrabber',
'sitetech',
'slcrawler',
'smartspider',
'snooper',
'solbot',
'spanner',
'speedy',
'spider_monkey',
'spiderbot',
'spiderline',
'spiderman',
'spiderview',
'spry',
'ssearcher',
'suke',
'suntek',
'sven',
'tach_bw',
'tarantula',
'tarspider',
'techbot',
'templeton',
'teoma_agent1',
'titin',
'titan',
'tkwww',
'tlspider',
'ucsd',
'udmsearch',
'urlck',
'valkyrie',
'verticrawl',
'victoria',
'visionsearch',
'vwbot',
'w3index',
'w3m2',
'wallpaper',
'wanderer',
'wapspider',
'webbandit',
'webcatcher',
'webcopy',
'webfetcher',
'webfoot',
'weblinker',
'webmirror',
'webmoose',
'webquest',
'webreader',
'webreaper',
'websnarf',
'webspider',
'webvac',
'webwalk',
'webwalker',
'webwatch',
'whatuseek',
'whowhere',
'wired-digital',
'wmir',
'wolp',
'wombat',
'worm',
'wwwc',
'wz101',
'xget',
# Other robots reported by users
'aport',
'awbot',
'baiduspider',
'bobby',
'boris',
'bumblebee',
'cscrawler',
'daviesbot',
'exactseek',
'ezresult',
'gigabot',
'gnodspider',
'henrythemiragorobot',
'internetseer',
'justview',
'linkbot',
'linkchecker',
'microsoft_url_control',
'msiecrawler',
'msnbot',
'nagios',
'nederland.zoek',
'perman',
'pompos',
'psbot',
'rambler',
'redalert',
'shoutcast',
'slysearch',
'surveybot',
'turnitinbot',
'turtle',
'ultraseek',
'webclipping.com',
'webcompass',
'yandex',
'zealbot',
'zyborg',
);

if(hwUserAgentMatches($a_robots_ex, true)) return 1;
if(hwUserAgentMatches($a_browsers) || !hwUserAgentMatches($a_robots, true)){ 
  define('SE_CRAWLER', '');
  return 0;
}
else return 1;

Return current item: Esvon Personals