Search Everything - Version 4.7.8

Version Description

Download this release

Release Info

Developer dancameron
Plugin Icon wp plugin Search Everything
Version 4.7.8
Comparing to
See all releases

Code changes from version 4.7.7 to 4.7.8

Files changed (3) hide show
  1. SE-Admin.php +3 -2
  2. readme.txt +2 -2
  3. search_everything.php +34 -3
SE-Admin.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  Class SearchEverythingAdmin {
4
 
5
- var $version = '4.7.6';
6
 
7
  function SearchEverythingAdmin() {
8
 
@@ -112,7 +112,8 @@ Class SearchEverythingAdmin {
112
  <?php } ?>
113
  <p><input type="checkbox" id="search_attachments" name="search_attachments" value="true" <?php if($options['SE4_use_attachment_search'] == 'true') { echo 'checked="true"'; } ?> />
114
  <label for="search_attachments"><?php _e('Search every attachment','SearchEverything'); ?></label></p>
115
-
 
116
  <p><input type="checkbox" id="search_metadata" name="search_metadata" value="true" <?php if($options['SE4_use_metadata_search'] == 'true') { echo 'checked="true"'; } ?> />
117
  <label for="search_metadata"><?php _e('Search every custom field (metadata)','SearchEverything'); ?></label></p>
118
 
2
 
3
  Class SearchEverythingAdmin {
4
 
5
+ var $version = '4.7.8';
6
 
7
  function SearchEverythingAdmin() {
8
 
112
  <?php } ?>
113
  <p><input type="checkbox" id="search_attachments" name="search_attachments" value="true" <?php if($options['SE4_use_attachment_search'] == 'true') { echo 'checked="true"'; } ?> />
114
  <label for="search_attachments"><?php _e('Search every attachment','SearchEverything'); ?></label></p>
115
+ <p><input type="checkbox" id="search_authors" name="search_authors" value="true" <?php if($options['SE4_use_authors'] == 'true') { echo 'checked="true"'; } ?> />
116
+ <label for="search_authors"><?php _e('Search every author','SearchEverything'); ?></label></p>
117
  <p><input type="checkbox" id="search_metadata" name="search_metadata" value="true" <?php if($options['SE4_use_metadata_search'] == 'true') { echo 'checked="true"'; } ?> />
118
  <label for="search_metadata"><?php _e('Search every custom field (metadata)','SearchEverything'); ?></label></p>
119
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Plugin Name ===
2
  Contributors: dancameron
3
- Donate link: http://www.amazon.com/gp/registry/wishlist/3EM84J7FVHE6S/ref=wl_web/
4
  Tags: search, tag search, category search, category exclusion, comment search, page search, admin, seo
5
  Requires at least: 2.1
6
  Tested up to: 2.6.3
7
- Stable tag: 4.7.7
8
 
9
  Increases Wordpress' default search functionality through an options panel. Options include searching pages, excerpts, attachments, drafts, comments and custom fields (metadata).
10
 
1
  === Plugin Name ===
2
  Contributors: dancameron
3
+ Donate link: http://sproutventure.com
4
  Tags: search, tag search, category search, category exclusion, comment search, page search, admin, seo
5
  Requires at least: 2.1
6
  Tested up to: 2.6.3
7
+ Stable tag: 4.7.8
8
 
9
  Increases Wordpress' default search functionality through an options panel. Options include searching pages, excerpts, attachments, drafts, comments and custom fields (metadata).
10
 
search_everything.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Search Everything
4
  Plugin URI: http://dancameron.org/wordpress/
5
  Description: Adds search functionality with little setup. Including options to search pages, excerpts, attachments, drafts, comments, tags and custom fields (metadata). Also offers the ability to exclude specific pages and posts. Does not search password-protected content.
6
- Version: 4.7.7
7
  Author: Dan Cameron
8
  Author URI: http://dancameron.org/
9
  */
@@ -95,7 +95,12 @@ Class SearchEverything {
95
  $this->SE4_log("searching excluding categories");
96
  }
97
 
98
-
 
 
 
 
 
99
  // Add registration of bo_revisions hook handler
100
  // right before the following line already existant
101
  add_filter('posts_where', array(&$this, 'SE4_no_revisions'));
@@ -337,7 +342,33 @@ Class SearchEverything {
337
  $this->SE4_log("comments join: ".$join);
338
  return $join;
339
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
 
 
 
 
 
341
  //join for searching metadata
342
  function SE4_search_metadata_join($join) {
343
  global $wp_query, $wpdb;
@@ -347,7 +378,7 @@ Class SearchEverything {
347
  if ($this->wp_ver23)
348
  $join .= " LEFT JOIN $wpdb->postmeta AS m ON ($wpdb->posts.ID = m.post_id) ";
349
  else
350
- $join .= "LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id ";
351
  }
352
  $this->SE4_log("metadata join: ".$join);
353
  return $join;
3
  Plugin Name: Search Everything
4
  Plugin URI: http://dancameron.org/wordpress/
5
  Description: Adds search functionality with little setup. Including options to search pages, excerpts, attachments, drafts, comments, tags and custom fields (metadata). Also offers the ability to exclude specific pages and posts. Does not search password-protected content.
6
+ Version: 4.7.8
7
  Author: Dan Cameron
8
  Author URI: http://dancameron.org/
9
  */
95
  $this->SE4_log("searching excluding categories");
96
  }
97
 
98
+ if ("true" == $this->options['SE4_exclude_authors']) {
99
+ add_filter('posts_where', array(&$this, 'SE4_search_authors'));
100
+ add_filter('posts_join', array(&$this, 'SE4_search_authors_join'));
101
+ $this->SE4_log("searching authors");
102
+ }
103
+
104
  // Add registration of bo_revisions hook handler
105
  // right before the following line already existant
106
  add_filter('posts_where', array(&$this, 'SE4_no_revisions'));
342
  $this->SE4_log("comments join: ".$join);
343
  return $join;
344
  }
345
+
346
+ //join for searching authors
347
+ function SE4_search_authors($where) {
348
+ global $wp_query, $wpdb;
349
+ if (!empty($wp_query->query_vars['s'])) {
350
+ $or = " OR (u.user_nicename LIKE '%" .
351
+ $wpdb->escape($wp_query->query_vars['s']) . "%') ";
352
+
353
+ }
354
+ $where = preg_replace("/\bor\b/i",$or." OR",$where,1);
355
+ $this->SE4_log("user where: ".$where);
356
+
357
+ return $where;
358
+ }
359
+
360
+
361
+ function SE4_search_authors_join($join) {
362
+ global $wp_query, $wpdb;
363
+
364
+ if (!empty($wp_query->query_vars['s'])) {
365
+ $join .= " LEFT JOIN $wpdb->users AS u ON
366
+ ($wpdb->posts.post_author = u.ID) ";
367
 
368
+ }
369
+ $this->SE4_log("authors join: ".$join);
370
+ return $join;
371
+ }
372
  //join for searching metadata
373
  function SE4_search_metadata_join($join) {
374
  global $wp_query, $wpdb;
378
  if ($this->wp_ver23)
379
  $join .= " LEFT JOIN $wpdb->postmeta AS m ON ($wpdb->posts.ID = m.post_id) ";
380
  else
381
+ $join .= " LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id ";
382
  }
383
  $this->SE4_log("metadata join: ".$join);
384
  return $join;