/** * Perform an expert search and return all results according * to the settings configured in the backend * * @param string $search The search phrase */ public function get_experts($search) { $result_types = $this->options['result_types']; $results = array(); foreach ($result_types as $result_type => $options) { $finder = Expert_Finder_Result_Type_Factory::getFinder($result_type, $options); if ($finder->isAvailable()) { $results = array_merge($results, $finder->getResults($search)); } } $this->sort_results($results); $authors = $this->get_authors($results); $this->sort_authors($authors); return $authors; }
public function expertfinder_result_types_callback() { $finder = Expert_Finder_Result_Type_Factory::getFinder('activity_stream'); if ($finder->isAvailable()) { echo "<h3>Activity Stream updates</h3>"; $this->checkbox_callback("result_types.activity_stream.enabled", 'Check to enable searching for activity stream updates.'); echo "<p>"; $this->text_callback('result_types.activity_stream.A', 'Enter base points <strong><i>A</i></strong> when the search term occures in an activty stream update.', 'number', '30%'); echo "</p>"; } $finder = Expert_Finder_Result_Type_Factory::getFinder('profile_field'); if ($finder->isAvailable()) { echo "<h3>Profile fields</h3>"; $this->checkbox_callback("result_types.profile_field.enabled", 'Check to enable searching for profile fields.'); echo "<p>"; $this->text_callback('result_types.profile_field.A', 'Enter base points <strong><i>A</i></strong> when the search term occures in a profile field.', 'number', '30%'); echo "</p>"; } $post_types = get_post_types(array('public' => true)); foreach ($post_types as $post_type) { $object = get_post_type_object($post_type); echo "<h3>{$object->labels->name}</h3>"; $this->checkbox_callback("result_types.post.post_types.{$post_type}.enabled", sprintf('Check to enable searching for %s', $object->labels->name)); echo "<p>"; $this->text_callback("result_types.post.post_types.{$post_type}.A_title", sprintf('Enter base points <strong><i>A<sub>t</sub></i></strong> when the search term occures in the title of a %s.', $object->labels->singular_name), 'number', '30%'); echo "<br>"; $this->text_callback("result_types.post.post_types.{$post_type}.A_content", sprintf('Enter base points <strong><i>A<sub>c</sub></i></strong> when the search term occures in the content of a %s.', $object->labels->singular_name), 'number', '30%'); echo "</p>"; } }