public_html/wp-content/plugins/wp-statistics/includes/functions/functions.php
// This function will return a regular expression clause for matching one or more search engines.
This function will return a regular expression clause for matching one or more search engines.
This function will return a regular expression clause for matching one or more search engines .
function wp_statistics_searchengine_regex( $search_engine = 'all' ) {
		$searchengine_list = wp_statistics_searchengine_list();
		$search_query = '';
				if( strtolower( $search_engine ) == 'all' ) {
			foreach( $searchengine_list as $se ) {
				if( is_array( $se['regexpattern'] ) ) {
					foreach( $se['regexpattern'] as $subse ) {
						$search_query .= "{$subse}|";
					}
				} else {
					$search_query .= "{$se['regexpattern']}|";
				}
			}
			$search_query = substr( $search_query, 0, strlen( $search_query ) - 1 );
		} else {
			if( is_array( $searchengine_list[$search_engine]['regexpattern'] ) ) {
				foreach( $searchengine_list[$search_engine]['regexpattern'] as $se ) {
					$search_query .= "{$se}|";
				}
				$search_query = substr( $search_query, 0, strlen( $search_query ) - 1 );
			} else {
				$search_query .= $searchengine_list[$search_engine]['regexpattern'];
			}
		}
		return "({$search_query})";
	}
function wp_statistics_searchengine_regex ( $ search_engine = 'all' ) { $ searchengine_list = wp_statistics_searchengine_list ( ) ; $ search_query = '' ; if ( strtolower ( $ search_engine ) == 'all' ) { foreach ( $ searchengine_list as $ se ) { if ( is_array ( $ se [ 'regexpattern' ] ) ) { foreach ( $ se [ 'regexpattern' ] as $ subse ) { $ search_query .= " { $ subse } | " ; } } else { $ search_query .= " { $ se [ 'regexpattern' ] } | " ; } } $ search_query = substr ( $ search_query , 0 , strlen ( $ search_query ) - 1 ) ; } else { if ( is_array ( $ searchengine_list [ $ search_engine ] [ 'regexpattern' ] ) ) { foreach ( $ searchengine_list [ $ search_engine ] [ 'regexpattern' ] as $ se ) { $ search_query .= " { $ se } | " ; } $ search_query = substr ( $ search_query , 0 , strlen ( $ search_query ) - 1 ) ; } else { $ search_query .= $ searchengine_list [ $ search_engine ] [ 'regexpattern' ] ; } } return " ( { $ search_query } ) " ; }
This function will return a regular expression clause for matching one or more search engines.
This function will return a regular expression clause for matching one or more search engines .
// Get a complete list of search engines // Are we getting results for all search engines or a specific one?
 // The SQL pattern for a search engine may be an array if it has to handle multiple domains (like google.com and google.ca) or other factors. // Trim off the last '|' for the loop above. // For just one?  Ok, the SQL pattern for a search engine may be an array if it has to handle multiple domains (like google.com and google.ca) or other factors. // Trim off the last '|' for the loop above. // Add the brackets and return