Search Engine File

rotpar

Active member
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.
 
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).
 
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.
 
Back
Top Bottom