Search Everything - Version 4.6

Version Description

Download this release

Release Info

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

Code changes from version 4.5 to 4.6

Files changed (3) hide show
  1. SE-Admin.php +122 -103
  2. screenshot-1.jpg +0 -0
  3. search_everything.php +10 -9
SE-Admin.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  Class SearchEverythingAdmin {
4
 
5
- var $version = '4.5';
6
 
7
  function SearchEverythingAdmin() {
8
 
@@ -55,115 +55,134 @@ Class SearchEverythingAdmin {
55
 
56
  ?>
57
 
58
- <div class="wrap" id="SE4_options_panel">
59
  <h2>Search Everything (SE) Version: <?php echo $this->version; ?></h2>
60
- <p><?php _e('The options selected below will be used in every search query on this site; in addition to the built-in post search.','SearchEverything'); ?></p>
61
- </div>
62
 
63
- <div class="wrap SE4">
64
- <h2><?php _e('SE Search Options', 'SearchEverything'); ?></h2>
65
- <p><?php _e('Use this form to configure your search options.', 'SearchEverything'); ?></p>
66
- <form method="post">
67
- <fieldset class="options">
68
- <legend><?php _e('Search Options Form', 'SearchEverything'); ?></legend>
69
- <p><input type="checkbox" id="exclude_posts" name="exclude_posts" value="true" <?php if($options['SE4_exclude_posts'] == 'true') { echo 'checked="true"'; } ?> />
70
- <label for="exclude_posts"><?php _e('Exclude some post or page IDs','SearchEverything'); ?></label><br />
71
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="exclude_posts_list" class="SE_text_label"><?php _e('Comma separated Post IDs (example: 1, 5, 9)','SearchEverything'); ?></label><br />
72
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" size="50" class="SE_text_input" id="exclude_posts_list" name="exclude_posts_list" value="<?php echo $options['SE4_exclude_posts_list'];?>" /></p>
73
-
74
- <p><input type="checkbox" id="exclude_categories" name="exclude_categories"
75
- value="true" <?php if($options['SE4_exclude_categories'] == 'true') { echo 'checked="true"'; } ?> />
76
- <label for="exclude_categories"><?php _e('Exclude Categories','SearchEverything'); ?></label><br />
77
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="exclude_categories_list" class="SE_text_label"><?php _e('Comma separated category IDs (example: 1, 4)','SearchEverything'); ?></label><br />
78
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" size="50" class="SE_text_input" id="exclude_categories_list" name="exclude_categories_list" value="<?php echo $options['SE4_exclude_categories_list'];?>" /></p>
79
-
80
- <p><input type="checkbox" id="search_pages" name="search_pages"
81
- value="true" <?php if($options['SE4_use_page_search'] == 'true') { echo 'checked="true"'; } ?> />
82
- <label for="search_pages"><?php _e('Search every page (non-password protected)','SearchEverything'); ?></label></p>
83
- <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" class="SE_text_input" id="appvd_pages" name="appvd_pages" value="true" <?php if($options['SE4_approved_pages_only'] == 'true') { echo 'checked="true"'; } ?>
84
- <label for="appvd_pages"><?php _e('Search approved pages only?','SearchEverything'); ?></label></p>
85
-
86
- <?php
87
- // Show tags only for WP 2.3+
88
- If ($wp_version >= '2.3') { ?>
89
- <p><input type="checkbox" id="search_tags" name="search_tags" value="true" <?php if($options['SE4_use_tag_search'] == 'true') { echo 'checked="true"'; } ?> />
90
- <label for="search_tags"><?php _e('Search every tag','SearchEverything'); ?></label></p>
91
- <?php } ?>
92
-
93
- <?php
94
- // Show categories only for WP 2.5+
95
- If ($wp_version >= '2.5') { ?>
96
- <p><input type="checkbox" id="search_categories" name="search_categories" value="true" <?php if($options['SE4_use_category_search'] == 'true') { echo 'checked="true"'; } ?> />
97
- <label for="search_categories"><?php _e('Search every category','SearchEverything'); ?></label></p>
98
- <?php } ?>
99
-
100
- <p><input type="checkbox" id="search_comments" name="search_comments"
101
- value="true" <?php if($options['SE4_use_comment_search'] == 'true') { echo 'checked="true"'; } ?> />
102
- <label for="search_comments"><?php _e('Search every comment','SearchEverything'); ?></label></p>
103
-
104
- <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" class="SE_text_input" id="appvd_comments" name="appvd_comments" value="true" <?php if($options['SE4_approved_comments_only'] == 'true') { echo 'checked="true"'; } ?>
105
- <label for="appvd_comments"><?php _e('Search approved comments only?','SearchEverything'); ?></label></p>
106
-
107
- <p><input type="checkbox" id="search_excerpt" name="search_excerpt" value="true" <?php if($options['SE4_use_excerpt_search'] == 'true') { echo 'checked="true"'; } ?> />
108
- <label for="search_excerpt"><?php _e('Search every excerpt','SearchEverything'); ?></label></p>
109
-
110
- <p><input type="checkbox" id="search_drafts" name="search_drafts" value="true" <?php if($options['SE4_use_draft_search'] == 'true') { echo 'checked="true"'; } ?>
111
- <label for="search_drafts"><?php _e('Search every draft','SearchEverything'); ?></label></p>
112
-
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
-
119
- </fieldset>
120
- <fieldset class="options">
121
- <div class="submit">
122
- <input type="hidden" name="action" value="save" />
123
- <input type="submit" value="<?php _e('Update Options', 'SearchEverything') ?>" />
124
- </div>
125
- </fieldset>
126
- </form>
127
  </div>
128
- <div class="wrap SE4">
 
129
  <h2><?php _e('SE Search Form', 'SearchEverything'); ?></h2>
130
- <p><?php _e('Use this search form to run a live search test.', 'SearchEverything'); ?></p>
131
-
132
- <fieldset>
133
- <legend><?php _e('Site Search', 'SearchEverything'); ?></legend>
134
- <form method="get" id="searchform" action="<?php bloginfo('home'); ?>"><p class="srch submit">
135
- <label for="s"><?php _e('Enter search terms', 'SearchEverything'); ?><br /></label>
136
- <input type="text" class="srch-txt" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
137
- <input type="submit" class="SE4_btn" id="searchsubmit" value="<?php _e('Run Test Search', 'SearchEverything'); ?>" /></p>
138
- </form>
139
- </fieldset>
 
 
 
 
 
140
  </div>
 
141
  <div class="wrap">
142
  <h2>SE Project Information</h2>
143
- <p>As of 2.5 I'm taking a hiatus from SE development; however I'm still accepting and committing feature updates and fixes from the community. <br/> You should not fret, the development since Version One has primarily come from the WordPress community and as a Search Everything user myself, I&#8217;m grateful for their dedicated and continued support:</p>
144
- <ul class="SE_lists">
145
- <li><a href="http://chrismeller.com/">Chris Meller</a></li>
146
- <li>jdleung</li>
147
- <li>Alakhnor</li>
148
- <li><a href="http://kinrowan.net/">Cori Schlegel</a></li>
149
- <li><a href="http://green-beast.com/">Mike Cherim</a></li>
150
- <li><a href="http://blog.saddey.net/">Saddy</a></li>
151
- <li><a href="http://www.reaper-x.com/">Reaper</a></li>
152
- <li><a href="http://beyn.org/">Barış Ünver</a> (localization support)</li>
153
- <li><a href="http://www.alohastone.com">alohastone</a> (localization support)</li>
154
- <li><a href="http://www.fratelliditalia.eu">Domiziano Galia</a></li>
155
- <li>Uli Iserloh</li>
156
-
157
- </ul>
158
- <p>If you&#8217;d like to contribute there&#8217;s a lot to do:</p>
159
- <ul class="SE_lists">
160
- <li>More meta data functions.</li>
161
- <li>Search Bookmarks.</li>
162
- <li>&#8230;anything else you want to add.</li>
163
- </ul>
164
- <br/><p>The current project home is at <a href="http://scatter3d.com/">scatter3d.com</a>. If you want to contribute <a href="mailto:dancameron+se@gmail.com">e-mail me</a> your modifications.</p>
165
- <p class="sig">Respectfully,<br />
166
- <a href="http://dancameron.org/">Dan Cameron</a></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  </div>
168
 
169
  <?php
2
 
3
  Class SearchEverythingAdmin {
4
 
5
+ var $version = '4.6';
6
 
7
  function SearchEverythingAdmin() {
8
 
55
 
56
  ?>
57
 
58
+ <div class="wrap">
59
  <h2>Search Everything (SE) Version: <?php echo $this->version; ?></h2>
 
 
60
 
61
+ <table class="form-table">
62
+ <tr valign="top">
63
+ <td colspan="4" bgcolor="#DDD"><?php _e('Use this form to configure your search options.', 'SearchEverything'); ?><br />
64
+ <?php _e('The options selected below will be used in every search query on this site; in addition to the built-in post search.','SearchEverything'); ?></td>
65
+ </tr>
66
+ <tr>
67
+ <td>
68
+ <form method="post">
69
+ <legend><?php _e('Search Options Form', 'SearchEverything'); ?></legend>
70
+ <p><input type="checkbox" id="exclude_posts" name="exclude_posts" value="true" <?php if($options['SE4_exclude_posts'] == 'true') { echo 'checked="true"'; } ?> />
71
+ <label for="exclude_posts"><?php _e('Exclude some post or page IDs','SearchEverything'); ?></label><br />
72
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="exclude_posts_list" class="SE_text_label"><?php _e('Comma separated Post IDs (example: 1, 5, 9)','SearchEverything'); ?></label><br />
73
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" size="50" class="SE_text_input" id="exclude_posts_list" name="exclude_posts_list" value="<?php echo $options['SE4_exclude_posts_list'];?>" /></p>
74
+
75
+ <p><input type="checkbox" id="exclude_categories" name="exclude_categories" value="true" <?php if($options['SE4_exclude_categories'] == 'true') { echo 'checked="true"'; } ?> />
76
+ <label for="exclude_categories"><?php _e('Exclude Categories','SearchEverything'); ?></label><br />
77
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="exclude_categories_list" class="SE_text_label"><?php _e('Comma separated category IDs (example: 1, 4)','SearchEverything'); ?></label><br />
78
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" size="50" class="SE_text_input" id="exclude_categories_list" name="exclude_categories_list" value="<?php echo $options['SE4_exclude_categories_list'];?>" /></p>
79
+
80
+ <p><input type="checkbox" id="search_pages" name="search_pages" value="true" <?php if($options['SE4_use_page_search'] == 'true') { echo 'checked="true"'; } ?> />
81
+ <label for="search_pages"><?php _e('Search every page (non-password protected)','SearchEverything'); ?></label></p>
82
+ <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" class="SE_text_input" id="appvd_pages" name="appvd_pages" value="true" <?php if($options['SE4_approved_pages_only'] == 'true') { echo 'checked="true"'; } ?>
83
+ <label for="appvd_pages"><?php _e('Search approved pages only?','SearchEverything'); ?></label></p>
84
+
85
+ <?php
86
+ // Show tags only for WP 2.3+
87
+ If ($wp_version >= '2.3') { ?>
88
+ <p><input type="checkbox" id="search_tags" name="search_tags" value="true" <?php if($options['SE4_use_tag_search'] == 'true') { echo 'checked="true"'; } ?> />
89
+ <label for="search_tags"><?php _e('Search every tag','SearchEverything'); ?></label></p>
90
+ <?php } ?>
91
+
92
+ <?php
93
+ // Show categories only for WP 2.5+
94
+ If ($wp_version >= '2.5') { ?>
95
+ <p><input type="checkbox" id="search_categories" name="search_categories" value="true" <?php if($options['SE4_use_category_search'] == 'true') { echo 'checked="true"'; } ?> />
96
+ <label for="search_categories"><?php _e('Search every category','SearchEverything'); ?></label></p>
97
+ <?php } ?>
98
+
99
+ <p><input type="checkbox" id="search_comments" name="search_comments" value="true" <?php if($options['SE4_use_comment_search'] == 'true') { echo 'checked="true"'; } ?> />
100
+ <label for="search_comments"><?php _e('Search every comment','SearchEverything'); ?></label></p>
101
+
102
+ <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" class="SE_text_input" id="appvd_comments" name="appvd_comments" value="true" <?php if($options['SE4_approved_comments_only'] == 'true') { echo 'checked="true"'; } ?>
103
+ <label for="appvd_comments"><?php _e('Search approved comments only?','SearchEverything'); ?></label></p>
104
+
105
+ <p><input type="checkbox" id="search_excerpt" name="search_excerpt" value="true" <?php if($options['SE4_use_excerpt_search'] == 'true') { echo 'checked="true"'; } ?> />
106
+ <label for="search_excerpt"><?php _e('Search every excerpt','SearchEverything'); ?></label></p>
107
+
108
+ <p><input type="checkbox" id="search_drafts" name="search_drafts" value="true" <?php if($options['SE4_use_draft_search'] == 'true') { echo 'checked="true"'; } ?>
109
+ <label for="search_drafts"><?php _e('Search every draft','SearchEverything'); ?></label></p>
110
+
111
+ <p><input type="checkbox" id="search_attachments" name="search_attachments" value="true" <?php if($options['SE4_use_attachment_search'] == 'true') { echo 'checked="true"'; } ?> />
112
+ <label for="search_attachments"><?php _e('Search every attachment','SearchEverything'); ?></label></p>
113
+
114
+ <p><input type="checkbox" id="search_metadata" name="search_metadata" value="true" <?php if($options['SE4_use_metadata_search'] == 'true') { echo 'checked="true"'; } ?> />
115
+ <label for="search_metadata"><?php _e('Search every custom field (metadata)','SearchEverything'); ?></label></p>
116
+ </form>
117
+ </td>
118
+ </tr>
119
+ </table>
120
+ <div class="submit">
121
+ <input type="hidden" name="action" value="save" />
122
+ <input type="submit" value="<?php _e('Update Options', 'SearchEverything') ?>" />
123
+ </div>
 
124
  </div>
125
+
126
+ <div class="wrap">
127
  <h2><?php _e('SE Search Form', 'SearchEverything'); ?></h2>
128
+ <table class="form-table">
129
+ <tr valign="top">
130
+ <td colspan="4" bgcolor="#DDD"><?php _e('Use this search form to run a live search test.', 'SearchEverything'); ?></td>
131
+ </tr>
132
+ <tr>
133
+ <td>
134
+ <legend><?php _e('Site Search', 'SearchEverything'); ?></legend>
135
+ <form method="get" id="searchform" action="<?php bloginfo('home'); ?>"><p class="srch submit">
136
+ <label for="s"><?php _e('Enter search terms', 'SearchEverything'); ?><br /></label>
137
+ <input type="text" class="srch-txt" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" size="30" />
138
+ <input type="submit" class="SE4_btn" id="searchsubmit" value="<?php _e('Run Test Search', 'SearchEverything'); ?>" /></p>
139
+ </form>
140
+ </td>
141
+ </tr>
142
+ </table>
143
  </div>
144
+
145
  <div class="wrap">
146
  <h2>SE Project Information</h2>
147
+ <table class="form-table">
148
+ <tr valign="top">
149
+ <td colspan="4" bgcolor="#DDD">
150
+ As of 2.5 I'm taking a hiatus from SE development; however I'm still accepting and committing feature updates and fixes from the community.<br/>
151
+ You should not fret, the development since Version One has primarily come from the WordPress community and as a Search Everything user myself, I&#8217;m grateful for their dedicated and continued support:
152
+ <ul class="SE_lists">
153
+ <li><a href="http://chrismeller.com/">Chris Meller</a></li>
154
+ <li>jdleung</li>
155
+ <li>Alakhnor</li>
156
+ <li><a href="http://kinrowan.net/">Cori Schlegel</a></li>
157
+ <li><a href="http://green-beast.com/">Mike Cherim</a></li>
158
+ <li><a href="http://blog.saddey.net/">Saddy</a></li>
159
+ <li><a href="http://www.reaper-x.com/">Reaper</a></li>
160
+ <li><a href="http://beyn.org/">Barış Ünver</a> (localization support)</li>
161
+ <li><a href="http://www.alohastone.com">alohastone</a> (localization support)</li>
162
+ <li><a href="http://www.fratelliditalia.eu">Domiziano Galia</a></li>
163
+ <li><a href="http://meandmymac.net">Arnan de Gans</a> (Options panel)</li>
164
+ <li>Uli Iserloh</li>
165
+ </ul>
166
+ </td>
167
+ </tr>
168
+ <tr>
169
+ <td bgcolor="#DDD">
170
+ If you&#8217;d like to contribute there&#8217;s a lot to do:
171
+ <ul class="SE_lists">
172
+ <li>More meta data functions.</li>
173
+ <li>Search Bookmarks.</li>
174
+ <li>&#8230;anything else you want to add.</li>
175
+ </ul>
176
+ </td>
177
+ </tr>
178
+ <tr>
179
+ <td bgcolor="#DDD">
180
+ The current project home is at <a href="http://scatter3d.com/">scatter3d.com</a>. If you want to contribute <a href="mailto:dancameron+se@gmail.com">e-mail me</a> your modifications.<br />
181
+ Respectfully,<br />
182
+ <a href="http://dancameron.org/">Dan Cameron</a>
183
+ </td>
184
+ </tr>
185
+ </table>
186
  </div>
187
 
188
  <?php
screenshot-1.jpg CHANGED
Binary file
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.5
7
  Author: Dan Cameron
8
  Author URI: http://dancameron.org/
9
  */
@@ -153,21 +153,22 @@ Class SearchEverything {
153
  return $where;
154
  }
155
 
156
- //search excerpts provided by Dennis Turner
157
  function SE4_search_excerpt($where) {
158
  global $wp_query;
159
  if (!empty($wp_query->query_vars['s'])) {
160
- $where = str_replace('"', '\'', $where);
161
- $where = str_replace(' OR (post_content LIKE \'%' .
162
- $wp_query->query_vars['s'] . '%\'', ' OR (post_content LIKE \'%' .
163
- $wp_query->query_vars['s'] . '%\') OR (post_excerpt LIKE \'%' .
164
- $wp_query->query_vars['s'] . '%\'', $where);
165
- }
166
 
167
  $this->SE4_log("excerpts where: ".$where);
168
  return $where;
169
  }
170
-
 
171
  //search drafts
172
  function SE4_search_draft_posts($where) {
173
  global $wp_query;
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.6
7
  Author: Dan Cameron
8
  Author URI: http://dancameron.org/
9
  */
153
  return $where;
154
  }
155
 
156
+ //search excerpts provided by Dennis Turner, fixed by GvA
157
  function SE4_search_excerpt($where) {
158
  global $wp_query;
159
  if (!empty($wp_query->query_vars['s'])) {
160
+ $where = str_replace('"', '\'', $where);
161
+ $where = str_replace(' OR (wp_posts.post_content LIKE \'%' .
162
+ $wp_query->query_vars['s'] . '%\'', ' OR (wp_posts.post_content LIKE \'%' .
163
+ $wp_query->query_vars['s'] . '%\') OR (wp_posts.post_excerpt LIKE \'%' .
164
+ $wp_query->query_vars['s'] . '%\'', $where);
165
+ }
166
 
167
  $this->SE4_log("excerpts where: ".$where);
168
  return $where;
169
  }
170
+
171
+
172
  //search drafts
173
  function SE4_search_draft_posts($where) {
174
  global $wp_query;