• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Search Engine File

#1
Hi,

I just saw in another post that there is a file in xenforo what regocnizes search engine bots

Code:
public static $knownRobots = array
(
'avsearch',
'baiduspider',
'bingbot',
'crawler',
'facebookexternalhit',
'feedfetcher-google',
'feedzirra',
'googlebot',
'kscrawler',
'magpie-crawler',
'nutch',
'php/',
'scooter',
'scoutjet',
'sogou web spider',
'twitterbot',
'xenforo signature generator',
'yahoo! slurp',
'yandexbot',
'zend_http_client',
);
where is the location of this file and can I add more bots? I need it for the "first click" plugin.
 

Chris D

XenForo developer
Staff member
#2
That file is library/XenForo/Session.php

Be weary of making code edits but if you're comfortable with doing so at least keep a note of your changes for reference after upgrading (where the files will be replaced).
 

Jeremy

Well-known member
#4
That file is library/XenForo/Session.php

Be weary of making code edits but if you're comfortable with doing so at least keep a note of your changes for reference after upgrading (where the files will be replaced).
Since its static, he should be able to do:
PHP:
XenForo_Session::$knownRobots = array_merge(array('my', 'robots'), XenForo_Session::$knownRobots);
 
// or... I've seen this used but never used this operator:
XenForo_Session::$knownRobots += array('my, 'robots');
It a code event early on.
 
#5
Thank you guys, just one question... I have this bot identification file attached, do you know how I could filter the bots name to put in in the xf file?
 

Attachments