/** * Parse out the limit and offset values from the limit clause. We'll use * this to figure out with page number we need to grab, and how many * results we should find. We'll then store them as class variables for * future use. * * @param string $limit_clause * @return string The same limit clause */ public function limitCallback($limit_clause) { if (!WPSearch_Search::instance()->isReady()) { return $limit_clause; } # Parse out the range of search items to retreive if (is_search() && !is_admin()) { WPSearch_Log::add('debug', "Query limit callback executed"); $limit = str_replace("LIMIT", "", $limit_clause); list($offset, $limit) = split(",", $limit); $offset = intval($offset); $limit = intval($limit); self::$_page = $offset / $limit; self::$_perPage = $limit; } return $limit_clause; }
<?php /* Plugin Name: WP Search Plugin URI: http://codefury.net/projects/wpSearch/ Description: This is the missing search functionality for Wordpress-powered sites. Version: 2.0.4.0 Author: Kenny Katzgrau Author URI: http://codefury.net */ require dirname(__FILE__) . '/WPSearch/Core.php'; # Start the beast $engine = new WPSearch_Core(); $engine->execute();