Viewing 1 replies (of 1 total)
  • Thread Starter theresa95

    (@theresa95)

    Patch for a possible solution for bots with multiple UA signatures:

    Index: E:/core.php
    ===================================================================
    --- E:/core.php	(revision 1)
    +++ E:/core.php	(working copy)
    @@ -80,47 +80,48 @@
    
     		// Check For Bot
     		$bots = array(
    -			'Google Bot' => 'google',
    -			'MSN' => 'msnbot',
    -			'BingBot' => 'bingbot',
    -			'Alex' => 'ia_archiver',
    -			'Lycos' => 'lycos',
    -			'Ask Jeeves' => 'jeeves',
    -			'Altavista' => 'scooter',
    -			'AllTheWeb' => 'fast-webcrawler',
    -			'Inktomi' => 'slurp@inktomi',
    -			'Turnitin.com' => 'turnitinbot',
    -			'Technorati' => 'technorati',
    -			'Yahoo' => 'yahoo',
    -			'Findexa' => 'findexa',
    -			'NextLinks' => 'findlinks',
    -			'Gais' => 'gaisbo',
    -			'WiseNut' => 'zyborg',
    -			'WhoisSource' => 'surveybot',
    -			'Bloglines' => 'bloglines',
    -			'BlogSearch' => 'blogsearch',
    -			'PubSub' => 'pubsub',
    -			'Syndic8' => 'syndic8',
    -			'RadioUserland' => 'userland',
    -			'Gigabot' => 'gigabot',
    -			'Become.com' => 'become.com',
    -			'Baidu' => 'baidu',
    -			'Yandex' => 'yandex',
    -			'Amazon' => 'amazonaws.com'
    +			'Google Bot' => array('google'),
    +			'BingBot' => array('bingbot', 'msnbot', 'bingpreview'),
    +			'Alex' => array('ia_archiver'),
    +			'Lycos' => array('lycos'),
    +			'Ask Jeeves' => array('jeeves'),
    +			'Altavista' => array('scooter'),
    +			'AllTheWeb' => array('fast-webcrawler'),
    +			'Inktomi' => array('slurp@inktomi'),
    +			'Turnitin.com' => array('turnitinbot'),
    +			'Technorati' => array('technorati'),
    +			'Yahoo' => array('yahoo'),
    +			'Findexa' => array('findexa'),
    +			'NextLinks' => array('findlinks'),
    +			'Gais' => array('gaisbo'),
    +			'WiseNut' => array('zyborg'),
    +			'WhoisSource' => array('surveybot'),
    +			'Bloglines' => array('bloglines'),
    +			'BlogSearch' => array('blogsearch'),
    +			'PubSub' => array('pubsub'),
    +			'Syndic8' => array('syndic8'),
    +			'RadioUserland' => array('userland'),
    +			'Gigabot' => array('gigabot'),
    +			'Become.com' => array('become.com'),
    +			'Baidu' => array('baidu'),
    +			'Yandex' => array('yandex'),
    +			'Amazon' => array('amazonaws.com')
     		);
    
     		$bots = apply_filters( 'useronline_bots', $bots );
    
     		$bot_found = false;
    -		foreach ( $bots as $name => $lookfor ) {
    -			if ( stristr( $user_agent, $lookfor ) !== false ) {
    -				$user_id = 0;
    -				$user_name = $name;
    -				$username = $lookfor;
    -				$user_type = 'bot';
    -				$bot_found = true;
    +		foreach ( $bots as $bot => $names ) {
    +			foreach ( $names as $lookfor ) {
    +				if ( stristr( $user_agent, $lookfor ) !== false ) {
    +					$user_id = 0;
    +					$user_name = $bot;
    +					$username = $lookfor;
    +					$user_type = 'bot';
    +					$bot_found = true;
    
    -				break;
    +					break 2;
    +				}
     			}
     		}
Viewing 1 replies (of 1 total)
  • The topic ‘Bing bots are included in guest count’ is closed to new replies.