Search Everything - Version 6.1.3

Version Description

Download this release

Release Info

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

Code changes from version 6.1.1 to 6.1.3

Files changed (6) hide show
  1. lang/se-nn_NO.mo +0 -0
  2. lang/se-nn_NO.po +223 -0
  3. lang/se.pot +24 -1
  4. readme.txt +6 -2
  5. search-everything.php +164 -132
  6. views/options.php +23 -22
lang/se-nn_NO.mo ADDED
Binary file
lang/se-nn_NO.po ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Search Everything 6.1\n"
4
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/search-everything\n"
5
+ "POT-Creation-Date: 2009-05-28 00:37+0000\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Simon Hansen <simonboba@gmail.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1\n"
13
+ "X-Poedit-Language: Norwegian Nynorsk\n"
14
+ "X-Poedit-Country: NORWAY\n"
15
+
16
+ #: views/options.php:51
17
+ msgid "Your default search settings have been <strong>updated</strong> by Search Everything. </p><p> What are you waiting for? Go check out the new search results!"
18
+ msgstr "Search Everything <strong>oppdaterte</strong> søkjeinnstillingane dine. </p><p> Kva ventar du på? Sjekk dei nye søkjetreffa!"
19
+
20
+ #: views/options.php:58
21
+ msgid "Your settings have been reset"
22
+ msgstr "Nullstilte innstillingane dine"
23
+
24
+ #: views/options.php:68
25
+ msgid "Search Everything Version:"
26
+ msgstr "Search Everything versjon:"
27
+
28
+ #: views/options.php:73
29
+ #: views/options.php:251
30
+ msgid "Update Options"
31
+ msgstr "Oppdater val"
32
+
33
+ #: views/options.php:81
34
+ msgid "Basic Configuration"
35
+ msgstr "Generelle innstillingar"
36
+
37
+ #: views/options.php:87
38
+ msgid "Search every page"
39
+ msgstr "Søk i sider"
40
+
41
+ #: views/options.php:87
42
+ msgid "(non-password protected)"
43
+ msgstr "(ikkje passordverna)"
44
+
45
+ #: views/options.php:91
46
+ #: views/options.php:102
47
+ #: views/options.php:115
48
+ #: views/options.php:129
49
+ #: views/options.php:140
50
+ #: views/options.php:150
51
+ #: views/options.php:160
52
+ #: views/options.php:170
53
+ #: views/options.php:183
54
+ #: views/options.php:194
55
+ #: views/options.php:204
56
+ #: views/options.php:214
57
+ msgid "Yes"
58
+ msgstr "Ja"
59
+
60
+ #: views/options.php:98
61
+ msgid "Search approved pages only"
62
+ msgstr "Søk berre på godkjende sider"
63
+
64
+ #: views/options.php:111
65
+ msgid "Search every tag name"
66
+ msgstr "Søk i merkelappar"
67
+
68
+ #: views/options.php:125
69
+ msgid "Search every category name and description"
70
+ msgstr "Søk på kategorinamn og -forklaring."
71
+
72
+ #: views/options.php:136
73
+ msgid "Search every comment"
74
+ msgstr "Søk i innspel"
75
+
76
+ #: views/options.php:146
77
+ msgid "Search comment authors"
78
+ msgstr "Søk på innspelforfattar"
79
+
80
+ #: views/options.php:156
81
+ msgid "Search approved comments only"
82
+ msgstr "Søk berre på godkjende innspel"
83
+
84
+ #: views/options.php:166
85
+ msgid "Search every excerpt"
86
+ msgstr "Søk i utdrag"
87
+
88
+ #: views/options.php:179
89
+ msgid "Search every draft"
90
+ msgstr "Søk i kladdar"
91
+
92
+ #: views/options.php:190
93
+ msgid "Search every attachment"
94
+ msgstr "Søk i vedlegg"
95
+
96
+ #: views/options.php:200
97
+ msgid "Search every custom field"
98
+ msgstr "Søk i eigendefinerte felt (metadata)"
99
+
100
+ #: views/options.php:200
101
+ msgid "(metadata)"
102
+ msgstr "(metadata)"
103
+
104
+ #: views/options.php:210
105
+ msgid "Search every author"
106
+ msgstr "Søk frå alle forfattarar"
107
+
108
+ #: views/options.php:226
109
+ msgid "Advanced Configuration - Exclusion"
110
+ msgstr "Avanserte innstillingar - Utestenging"
111
+
112
+ #: views/options.php:232
113
+ msgid "Exclude some post or page IDs"
114
+ msgstr "Steng ute sider eller innlegg på ID"
115
+
116
+ #: views/options.php:235
117
+ msgid "Comma separated Post IDs (example: 1, 5, 9)"
118
+ msgstr "Skil innlegg-ID med komma (døme: 1, 5, 9)"
119
+
120
+ #: views/options.php:239
121
+ msgid "Exclude Categories"
122
+ msgstr "Steng ute kategoriar"
123
+
124
+ #: views/options.php:242
125
+ msgid "Comma separated category IDs (example: 1, 4)"
126
+ msgstr "Skil kategori-ID med komma (døme: 1, 4)"
127
+
128
+ #: views/options.php:256
129
+ msgid "Developed by Dan Cameron of"
130
+ msgstr "Utvikla av Dan Cameron frå"
131
+
132
+ #: views/options.php:256
133
+ msgid "Sprout Venture"
134
+ msgstr "Sprout Venture"
135
+
136
+ #: views/options.php:256
137
+ msgid "We Provide custom WordPress Plugins and Themes and a whole lot more."
138
+ msgstr "Me tilbyd innstikk og bunader til WordPress, og mykje meir."
139
+
140
+ #: views/options.php:260
141
+ msgid "Reset Button"
142
+ msgstr "Nullstill"
143
+
144
+ #: views/options.php:268
145
+ msgid "Find a bug?"
146
+ msgstr "Funne ein feil?"
147
+
148
+ #: views/options.php:268
149
+ msgid "Post it as a new issue"
150
+ msgstr "Post det som eit nytt problem"
151
+
152
+ #: views/options.php:275
153
+ msgid "Test Search Form"
154
+ msgstr "Prøv søket"
155
+
156
+ #: views/options.php:282
157
+ msgid "Use this search form to run a live search test."
158
+ msgstr "Nytt dette søkjeskjemaet for å prøva søket"
159
+
160
+ #: views/options.php:288
161
+ msgid "Run Test Search"
162
+ msgstr "Søk"
163
+
164
+ #: views/options.php:299
165
+ msgid "News"
166
+ msgstr "Nyhende"
167
+
168
+ #: views/options.php:300
169
+ msgid "Development Support"
170
+ msgstr "Utviklingsstøtte"
171
+
172
+ #: views/options.php:301
173
+ msgid "Localization Support"
174
+ msgstr "Språkstøtte"
175
+
176
+ #: views/options.php:307
177
+ msgid "LOCALIZATION SUPPORT:"
178
+ msgstr "SPRÅKSTØTTE:"
179
+
180
+ #: views/options.php:307
181
+ msgid "Version 6 was a major update and a few areas need new localization support. If you can help send me your translations by posting them as a new issue, "
182
+ msgstr "Versjon 6 var ei større oppdatering, og mykje nytt lyt omsetjast. Viss du kan hjelpa til, send omsetjingane dine ved å posta dei som eit nytt problem,"
183
+
184
+ #: views/options.php:307
185
+ msgid "here"
186
+ msgstr "her"
187
+
188
+ #: views/options.php:308
189
+ msgid "Thank You!"
190
+ msgstr "Takk skal du ha!"
191
+
192
+ #: views/options.php:308
193
+ msgid "The development of Search Everything since Version one has primarily come from the WordPress community, I&#8217;m grateful for their dedicated and continued support."
194
+ msgstr "Utviklinga av Search Everything har sidan versjon ein fyrst og fremst kome frå WordPress-fellesskapet. Eg er takksam for deira oppofrande og vedvarande støtte."
195
+
196
+ #: views/options.php:318
197
+ msgid "and many more..."
198
+ msgstr "og mange andre..."
199
+
200
+ #: views/options.php:318
201
+ msgid "how about you?"
202
+ msgstr "kva med deg?"
203
+
204
+ #. Plugin Name of an extension
205
+ msgid "Search Everything"
206
+ msgstr "Search Everything"
207
+
208
+ #. Plugin URI of an extension
209
+ msgid "https://redmine.sproutventure.com/projects/show/search-everything"
210
+ msgstr "https://redmine.sproutventure.com/projects/show/search-everything"
211
+
212
+ #. Description of an extension
213
+ msgid "Adds search functionality without modifying template pages: Activate, Configure and Search. Options Include: 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."
214
+ msgstr "Legg til søkjefunksjonar utan å endra sidemalane: Aktiver, still inn og søk. Du kan stilla inn: søk på sider, utdrag, vedlegg, kladdar, innspel, merkelappar og eigendefinerte felt (metadata). Det er òg høve til å stengja ute gjevne sider og innlegg. Søkjer ikkje i passordverna innhald."
215
+
216
+ #. Author of an extension
217
+ msgid "Dan Cameron of Sprout Venture"
218
+ msgstr "Dan Cameron frå Sprout Venture"
219
+
220
+ #. Author URI of an extension
221
+ msgid "http://sproutventure.com/"
222
+ msgstr "http://sproutventure.com/"
223
+
lang/se.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/search-everything\n"
11
- "POT-Creation-Date: 2009-05-27 15:18+0000\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -23,6 +23,10 @@ msgid ""
23
  "results!"
24
  msgstr ""
25
 
 
 
 
 
26
  #: views/options.php:68
27
  msgid "Search Everything Version:"
28
  msgstr ""
@@ -43,6 +47,13 @@ msgstr ""
43
  msgid "(non-password protected)"
44
  msgstr ""
45
 
 
 
 
 
 
 
 
46
  #: views/options.php:98
47
  msgid "Search approved pages only"
48
  msgstr ""
@@ -123,6 +134,10 @@ msgstr ""
123
  msgid "We Provide custom WordPress Plugins and Themes and a whole lot more."
124
  msgstr ""
125
 
 
 
 
 
126
  #: views/options.php:268
127
  msgid "Find a bug?"
128
  msgstr ""
@@ -180,6 +195,14 @@ msgid ""
180
  "continued support."
181
  msgstr ""
182
 
 
 
 
 
 
 
 
 
183
  #. Plugin Name of an extension
184
  msgid "Search Everything"
185
  msgstr ""
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/search-everything\n"
11
+ "POT-Creation-Date: 2009-05-28 00:37+0000\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
23
  "results!"
24
  msgstr ""
25
 
26
+ #: views/options.php:58
27
+ msgid "Your settings have been reset"
28
+ msgstr ""
29
+
30
  #: views/options.php:68
31
  msgid "Search Everything Version:"
32
  msgstr ""
47
  msgid "(non-password protected)"
48
  msgstr ""
49
 
50
+ #: views/options.php:91 views/options.php:102 views/options.php:115
51
+ #: views/options.php:129 views/options.php:140 views/options.php:150
52
+ #: views/options.php:160 views/options.php:170 views/options.php:183
53
+ #: views/options.php:194 views/options.php:204 views/options.php:214
54
+ msgid "Yes"
55
+ msgstr ""
56
+
57
  #: views/options.php:98
58
  msgid "Search approved pages only"
59
  msgstr ""
134
  msgid "We Provide custom WordPress Plugins and Themes and a whole lot more."
135
  msgstr ""
136
 
137
+ #: views/options.php:260
138
+ msgid "Reset Button"
139
+ msgstr ""
140
+
141
  #: views/options.php:268
142
  msgid "Find a bug?"
143
  msgstr ""
195
  "continued support."
196
  msgstr ""
197
 
198
+ #: views/options.php:318
199
+ msgid "and many more..."
200
+ msgstr ""
201
+
202
+ #: views/options.php:318
203
+ msgid "how about you?"
204
+ msgstr ""
205
+
206
  #. Plugin Name of an extension
207
  msgid "Search Everything"
208
  msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.amazon.com/wishlist/3EM84J7FVHE6S
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.8
7
- Stable tag: 6.1.1
8
 
9
  Increases Wordpress' default search functionality through an options panel. Options include searching pages, excerpts, attachments, drafts, comments and custom fields (metadata).
10
 
@@ -20,17 +20,21 @@ Search Everything increases the ability of the default Wordpress Search, options
20
  * Search only approved comments
21
  * Search Every Draft
22
  * Search Every Excerpt
23
- * Search Every Attachment
24
  * Search Every Custom Field (metadata)
25
  * Exclude Posts from search
26
  * Exclude Categories from search
27
 
 
 
28
  * 6.1.1 - Fixed bug when search comments is selected and localization update.
29
  * 6.1 - New search comment author selection, Misc. bug fixes from v.6 release and updated Localization support.
30
  * 6 - New Options Panel!!, Multi-Word fix! #44, Exclude Bug Fix, Admin search fix.
31
 
32
  == Update Log ==
33
 
 
 
34
  * 6.1.1 - Fixed bug when search comments is selected and localization update.
35
  * 6.1 - New search comment author selection, Misc. bug fixes from v.6 release and updated Localization support.
36
  * 6 - New Options Panel!!, Multi-Word fix! #44, Exclude Bug Fix, Admin search fix.
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.8
7
+ Stable tag: 6.1.3
8
 
9
  Increases Wordpress' default search functionality through an options panel. Options include searching pages, excerpts, attachments, drafts, comments and custom fields (metadata).
10
 
20
  * Search only approved comments
21
  * Search Every Draft
22
  * Search Every Excerpt
23
+ * Search Every Attachment (post type)
24
  * Search Every Custom Field (metadata)
25
  * Exclude Posts from search
26
  * Exclude Categories from search
27
 
28
+ * 6.1.3 - Exclusion Bug Fix.
29
+ * 6.1.2 - Localization bug fixes.
30
  * 6.1.1 - Fixed bug when search comments is selected and localization update.
31
  * 6.1 - New search comment author selection, Misc. bug fixes from v.6 release and updated Localization support.
32
  * 6 - New Options Panel!!, Multi-Word fix! #44, Exclude Bug Fix, Admin search fix.
33
 
34
  == Update Log ==
35
 
36
+ * 6.1.3 - Exclusion Bug Fix.
37
+ * 6.1.2 - Localization bug fixes.
38
  * 6.1.1 - Fixed bug when search comments is selected and localization update.
39
  * 6.1 - New search comment author selection, Misc. bug fixes from v.6 release and updated Localization support.
40
  * 6 - New Options Panel!!, Multi-Word fix! #44, Exclude Bug Fix, Admin search fix.
search-everything.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Search Everything
4
  Plugin URI: https://redmine.sproutventure.com/projects/show/search-everything
5
  Description: Adds search functionality without modifying template pages: Activate, Configure and Search. Options Include: 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: 6.1.1
7
  Author: Dan Cameron of Sprout Venture
8
  Author URI: http://sproutventure.com/
9
  */
@@ -39,68 +39,65 @@ Class SearchEverything {
39
  $SEAdmin = new se_admin();
40
  }
41
  //add filters based upon option settings
42
- if ("Yes" == $this->options['se_use_tag_search'])
43
  {
44
  add_filter('posts_join', array(&$this, 'se_terms_join'));
45
  $this->se_log("searching tags");
46
  }
47
 
48
- if ("Yes" == $this->options['se_use_category_search'])
49
  {
50
  add_filter('posts_join', array(&$this, 'se_terms_join'));
51
  $this->se_log("searching categories");
52
  }
53
 
54
- if ("Yes" == $this->options['se_use_page_search'])
55
  {
56
  add_filter('posts_where', array(&$this, 'se_search_pages'));
57
  $this->se_log("searching pages");
58
  }
59
 
60
- if ("Yes" == $this->options['se_use_excerpt_search'])
61
  {
62
  $this->se_log("searching excerpts");
63
  }
64
 
65
- if ("Yes" == $this->options['se_use_comment_search'])
66
  {
67
- add_filter('posts_where', array(&$this, 'se_search_comments'));
68
  add_filter('posts_join', array(&$this, 'se_comments_join'));
69
  $this->se_log("searching comments");
70
  }
71
 
72
- if ("Yes" == $this->options['se_use_draft_search'])
73
  {
74
  add_filter('posts_where', array(&$this, 'se_search_draft_posts'));
75
  $this->se_log("searching drafts");
76
  }
77
 
78
- if ("Yes" == $this->options['se_use_attachment_search'])
79
  {
80
  add_filter('posts_where', array(&$this, 'se_search_attachments'));
81
  $this->se_log("searching attachments");
82
  }
83
 
84
- if ("Yes" == $this->options['se_use_metadata_search'])
85
  {
86
  add_filter('posts_join', array(&$this, 'se_search_metadata_join'));
87
  $this->se_log("searching metadata");
88
  }
89
 
90
- if ($this->options['se_exclude_posts_list'] != '')
91
  {
92
- add_filter('posts_where', array(&$this, 'se_exclude_posts'));
93
  $this->se_log("searching excluding posts");
94
  }
95
 
96
- if ($this->options['se_exclude_categories_list'] != '')
97
  {
98
- add_filter('posts_where', array(&$this, 'se_exclude_categories'));
99
  add_filter('posts_join', array(&$this, 'se_exclude_categories_join'));
100
  $this->se_log("searching excluding categories");
101
  }
102
 
103
- if ("Yes" == $this->options['se_use_authors'])
104
  {
105
  add_filter('posts_where', array(&$this, 'se_search_authors'));
106
  add_filter('posts_join', array(&$this, 'se_search_authors_join'));
@@ -123,21 +120,18 @@ Class SearchEverything {
123
  $sentence = $wp_query->query_vars['sentence'];
124
  $search_terms = array();
125
 
126
- if ( !empty($s) )
 
 
 
 
127
  {
128
- // added slashes screw with quote grouping when done early, so done later
129
- $s = stripslashes($s);
130
- if ($sentence)
131
- {
132
- $search_terms = array($s);
133
- }
134
- else
135
- {
136
- preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches);
137
- $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
138
- }
139
  }
140
-
141
  return $search_terms;
142
  }
143
 
@@ -146,25 +140,29 @@ Class SearchEverything {
146
  {
147
  global $wp_query, $wpdb;
148
  $searchQuery = '';
149
-
150
  //add filters based upon option settings
151
- if ("Yes" == $this->options['se_use_tag_search'])
152
  {
153
  $searchQuery .= $this->se_build_search_tag();
154
  }
155
- if ("Yes" == $this->options['se_use_category_search'])
156
  {
157
  $searchQuery .= $this->se_build_search_categories();
158
  }
159
- if ("Yes" == $this->options['se_use_metadata_search'])
160
  {
161
  $searchQuery .= $this->se_build_search_metadata();
162
  }
163
- if ("Yes" == $this->options['se_use_excerpt_search'])
164
  {
165
  $searchQuery .= $this->se_build_search_excerpt();
166
  }
167
- if ($searchQuery != '')
 
 
 
 
168
  {
169
  $index1 = strpos($where, '((');
170
  $index2 = strrpos($where, ')) ');
@@ -174,15 +172,24 @@ Class SearchEverything {
174
  $where = $firstPart."(".$secondPart.$searchQuery.")".$lastPart;
175
 
176
  }
177
- $this->se_log("metadata where: ".$where);
 
 
 
 
 
 
 
 
 
178
  return $where;
179
  }
180
 
181
  // Exclude post revisions
182
- function se_no_revisions($where)
183
  {
184
  global $wp_query;
185
- if (!empty($wp_query->query_vars['s']))
186
  {
187
  $where = 'AND (' . substr($where, strpos($where, 'AND')+3) . ') AND post_type != \'revision\'';
188
  }
@@ -190,15 +197,15 @@ Class SearchEverything {
190
  }
191
 
192
  // Logs search into a file
193
- function se_log($msg)
194
  {
195
 
196
- if ($this->logging)
197
  {
198
  $fp = fopen("logfile.log","a+");
199
- if ( !$fp )
200
- {
201
- echo 'unable to write to log file!';
202
  }
203
  $date = date("Y-m-d H:i:s ");
204
  $source = "search_everything plugin: ";
@@ -214,45 +221,25 @@ Class SearchEverything {
214
  global $wp_query;
215
  if (!empty($wp_query->query_vars['s']))
216
  {
217
- if (strstr($where, 'DISTINCT'))
218
- {}
219
- else
220
  {
221
  $query = str_replace('SELECT', 'SELECT DISTINCT', $query);
222
  }
223
  }
224
  return $query;
225
  }
226
-
227
-
228
- function se_exclude_posts($where)
229
- {
230
- global $wp_query;
231
- if (!empty($wp_query->query_vars['s']))
232
- {
233
- if (trim($this->options['se_exclude_posts_list']) != '')
234
- {
235
- $excl_list = implode(',', explode(',',
236
- trim($this->options['se_exclude_posts_list'])));
237
- $where = str_replace('"', '\'', $where);
238
- $where = 'AND ('.substr($where, strpos($where, 'AND')+3).' )';
239
- $where .= ' AND (wp_posts.ID NOT IN ( '.$excl_list.' ))';
240
- }
241
- }
242
- $this->se_log("ex posts where: ".$where);
243
- return $where;
244
- }
245
-
246
 
247
  //search pages (except password protected pages provided by loops)
248
- function se_search_pages($where)
249
  {
250
  global $wp_query;
251
- if (!empty($wp_query->query_vars['s']))
252
  {
253
 
254
  $where = str_replace('"', '\'', $where);
255
- if ('Yes' == $this->options['se_approved_pages_only'])
256
  {
257
  $where = str_replace('post_type = \'post\' AND ', 'post_password = \'\' AND ', $where);
258
  } else { // < v 2.1
@@ -295,10 +282,10 @@ trim($this->options['se_exclude_posts_list'])));
295
 
296
 
297
  //search drafts
298
- function se_search_draft_posts($where)
299
  {
300
  global $wp_query;
301
- if (!empty($wp_query->query_vars['s']))
302
  {
303
  $where = str_replace('"', '\'', $where);
304
  $where = str_replace(' AND (post_status = \'publish\'', ' AND (post_status = \'publish\' or post_status = \'draft\'', $where);
@@ -308,10 +295,10 @@ trim($this->options['se_exclude_posts_list'])));
308
  }
309
 
310
  //search attachments
311
- function se_search_attachments($where)
312
  {
313
  global $wp_query;
314
- if (!empty($wp_query->query_vars['s']))
315
  {
316
  $where = str_replace('"', '\'', $where);
317
  $where = str_replace(' AND (post_status = \'publish\'', ' AND (post_status = \'publish\' or post_status = \'attachment\'', $where);
@@ -321,38 +308,69 @@ trim($this->options['se_exclude_posts_list'])));
321
  return $where;
322
  }
323
 
324
- //search comments
325
- function se_search_comments($where)
326
  {
327
- global $wp_query, $wpdb;
328
- if (!empty($wp_query->query_vars['s']))
329
- {
330
- if ('Yes' == $this->options['se_approved_comments_only'])
331
- {
332
- $comment_approved = " AND cmt.comment_approved = '1'";
333
- } else {
334
- $comment_approved = '';
335
- }
336
 
337
- if($this->options['se_use_authors'] == 'Yes')
 
 
 
 
 
 
 
338
  {
339
- $comment_author = " OR cmt.comment_author LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%' ";
340
  }
341
-
342
- else
 
 
 
 
343
  {
344
- $comment_author = '';
345
  }
346
-
347
- if ($this->wp_ver23) {
348
- $where .= " OR (( cmt.comment_content LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%'".$comment_author.")".$comment_approved.")";
349
-
350
-
351
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  }
353
  $this->se_log("comments where: ".$where);
354
- return $where;
355
-
356
  }
357
 
358
  // create the search meta data query
@@ -374,7 +392,7 @@ trim($this->options['se_exclude_posts_list'])));
374
  {
375
  $search .= "{$searchand}(m.meta_value LIKE '{$n}{$term}{$n}')";
376
  } else {
377
- $search .= "{$searchand}(meta_value LIKE '{$n}{$term}{$n}')";
378
  }
379
  $searchand = ' AND ';
380
  }
@@ -392,10 +410,10 @@ trim($this->options['se_exclude_posts_list'])));
392
  if ( !empty($search) )
393
  $search = " OR ({$search}) ";
394
 
395
- }
396
  $this->se_log("meta where: ".$where);
397
- return $search;
398
- }
399
 
400
  // create the search tag query
401
  function se_build_search_tag()
@@ -406,12 +424,12 @@ trim($this->options['se_exclude_posts_list'])));
406
  $exact = $wp_query->query_vars['exact'];
407
  $search = '';
408
 
409
- if ( !empty($search_terms) )
410
  {
411
  // Building search query
412
  $n = ($exact) ? '' : '%';
413
  $searchand = '';
414
- foreach($search_terms as $term)
415
  {
416
  $term = addslashes_gpc($term);
417
  if ($this->wp_ver23)
@@ -485,36 +503,50 @@ trim($this->options['se_exclude_posts_list'])));
485
  return $search;
486
  }
487
 
488
- //exlude some categories from search
489
- function se_exclude_categories($where)
490
  {
491
- global $wp_query, $wpdb;
492
- if (!empty($wp_query->query_vars['s']))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  {
494
- if (trim($this->options['se_exclude_categories_list']) != '')
 
495
  {
496
- $excl_list = implode("','", explode(',', "'".trim($this->options['se_exclude_categories_list'])."'" ));
497
- $where = str_replace('"', '\'', $where);
498
- $where = 'AND ('.substr($where, strpos($where, 'AND')+3).' )';
499
- if ($this->wp_ver23)
500
- $where .= " AND ( ctax.term_id NOT IN ( ".$excl_list." ))";
501
- else
502
- $where .= ' AND (c.category_id NOT IN ( '.$excl_list.' ))';
503
  }
504
  }
505
- $this->se_log("ex cats where: ".$where);
506
- return $where;
507
  }
508
 
509
  //join for excluding categories - Deprecated in 2.3
510
- function se_exclude_categories_join($join)
511
  {
512
  global $wp_query, $wpdb;
513
 
514
- if (!empty($wp_query->query_vars['s']))
515
  {
516
 
517
- if ($this->wp_ver23)
518
  {
519
  $join .= " LEFT JOIN $wpdb->term_relationships AS crel ON ($wpdb->posts.ID = crel.object_id) LEFT JOIN $wpdb->term_taxonomy AS ctax ON (ctax.taxonomy = 'category' AND crel.term_taxonomy_id = ctax.term_taxonomy_id) LEFT JOIN $wpdb->terms AS cter ON (ctax.term_id = cter.term_id) ";
520
  } else {
@@ -526,19 +558,19 @@ trim($this->options['se_exclude_posts_list'])));
526
  }
527
 
528
  //join for searching comments
529
- function se_comments_join($join)
530
  {
531
  global $wp_query, $wpdb;
532
 
533
- if (!empty($wp_query->query_vars['s']))
534
  {
535
- if ($this->wp_ver23)
536
  {
537
  $join .= " LEFT JOIN $wpdb->comments AS cmt ON ( cmt.comment_post_ID = ID ) ";
538
 
539
  } else {
540
 
541
- if ('Yes' == $this->options['se_approved_comments_only'])
542
  {
543
  $comment_approved = " AND comment_approved = '1'";
544
  } else {
@@ -553,11 +585,11 @@ trim($this->options['se_exclude_posts_list'])));
553
  }
554
 
555
  //join for searching authors
556
- function se_search_authors($where)
557
  {
558
  global $wp_query, $wpdb;
559
 
560
- if (!empty($wp_query->query_vars['s']))
561
  {
562
  $or = " OR (u.user_nicename LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
563
  }
@@ -567,11 +599,11 @@ trim($this->options['se_exclude_posts_list'])));
567
  }
568
 
569
 
570
- function se_search_authors_join($join)
571
  {
572
  global $wp_query, $wpdb;
573
 
574
- if (!empty($wp_query->query_vars['s']))
575
  {
576
  $join .= " LEFT JOIN $wpdb->users AS u ON ($wpdb->posts.post_author = u.ID) ";
577
  }
@@ -580,11 +612,11 @@ trim($this->options['se_exclude_posts_list'])));
580
  }
581
 
582
  //join for searching metadata
583
- function se_search_metadata_join($join)
584
  {
585
  global $wp_query, $wpdb;
586
 
587
- if (!empty($wp_query->query_vars['s']))
588
  {
589
 
590
  if ($this->wp_ver23)
@@ -597,21 +629,21 @@ trim($this->options['se_exclude_posts_list'])));
597
  }
598
 
599
  //join for searching tags
600
- function se_terms_join($join)
601
  {
602
  global $wp_query, $wpdb;
603
 
604
- if (!empty($wp_query->query_vars['s']))
605
  {
606
 
607
  // if we're searching for categories
608
- if ( $this->options['se_use_category_search'] )
609
  {
610
  $on[] = "ttax.taxonomy = 'category'";
611
  }
612
 
613
  // if we're searching for tags
614
- if ( $this->options['se_use_tag_search'] )
615
  {
616
  $on[] = "ttax.taxonomy = 'post_tag'";
617
  }
3
  Plugin Name: Search Everything
4
  Plugin URI: https://redmine.sproutventure.com/projects/show/search-everything
5
  Description: Adds search functionality without modifying template pages: Activate, Configure and Search. Options Include: 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: 6.1.3
7
  Author: Dan Cameron of Sprout Venture
8
  Author URI: http://sproutventure.com/
9
  */
39
  $SEAdmin = new se_admin();
40
  }
41
  //add filters based upon option settings
42
+ if ("Yes" == $this->options['se_use_tag_search'])
43
  {
44
  add_filter('posts_join', array(&$this, 'se_terms_join'));
45
  $this->se_log("searching tags");
46
  }
47
 
48
+ if ("Yes" == $this->options['se_use_category_search'])
49
  {
50
  add_filter('posts_join', array(&$this, 'se_terms_join'));
51
  $this->se_log("searching categories");
52
  }
53
 
54
+ if ("Yes" == $this->options['se_use_page_search'])
55
  {
56
  add_filter('posts_where', array(&$this, 'se_search_pages'));
57
  $this->se_log("searching pages");
58
  }
59
 
60
+ if ("Yes" == $this->options['se_use_excerpt_search'])
61
  {
62
  $this->se_log("searching excerpts");
63
  }
64
 
65
+ if ("Yes" == $this->options['se_use_comment_search'])
66
  {
 
67
  add_filter('posts_join', array(&$this, 'se_comments_join'));
68
  $this->se_log("searching comments");
69
  }
70
 
71
+ if ("Yes" == $this->options['se_use_draft_search'])
72
  {
73
  add_filter('posts_where', array(&$this, 'se_search_draft_posts'));
74
  $this->se_log("searching drafts");
75
  }
76
 
77
+ if ("Yes" == $this->options['se_use_attachment_search'])
78
  {
79
  add_filter('posts_where', array(&$this, 'se_search_attachments'));
80
  $this->se_log("searching attachments");
81
  }
82
 
83
+ if ("Yes" == $this->options['se_use_metadata_search'])
84
  {
85
  add_filter('posts_join', array(&$this, 'se_search_metadata_join'));
86
  $this->se_log("searching metadata");
87
  }
88
 
89
+ if ($this->options['se_exclude_posts_list'] != '')
90
  {
 
91
  $this->se_log("searching excluding posts");
92
  }
93
 
94
+ if ($this->options['se_exclude_categories_list'] != '')
95
  {
 
96
  add_filter('posts_join', array(&$this, 'se_exclude_categories_join'));
97
  $this->se_log("searching excluding categories");
98
  }
99
 
100
+ if ("Yes" == $this->options['se_use_authors'])
101
  {
102
  add_filter('posts_where', array(&$this, 'se_search_authors'));
103
  add_filter('posts_join', array(&$this, 'se_search_authors_join'));
120
  $sentence = $wp_query->query_vars['sentence'];
121
  $search_terms = array();
122
 
123
+ if ( !empty($s) )
124
+ {
125
+ // added slashes screw with quote grouping when done early, so done later
126
+ $s = stripslashes($s);
127
+ if ($sentence)
128
  {
129
+ $search_terms = array($s);
130
+ } else {
131
+ preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches);
132
+ $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
 
 
 
 
 
 
 
133
  }
134
+ }
135
  return $search_terms;
136
  }
137
 
140
  {
141
  global $wp_query, $wpdb;
142
  $searchQuery = '';
143
+
144
  //add filters based upon option settings
145
+ if ("Yes" == $this->options['se_use_tag_search'])
146
  {
147
  $searchQuery .= $this->se_build_search_tag();
148
  }
149
+ if ("Yes" == $this->options['se_use_category_search'])
150
  {
151
  $searchQuery .= $this->se_build_search_categories();
152
  }
153
+ if ("Yes" == $this->options['se_use_metadata_search'])
154
  {
155
  $searchQuery .= $this->se_build_search_metadata();
156
  }
157
+ if ("Yes" == $this->options['se_use_excerpt_search'])
158
  {
159
  $searchQuery .= $this->se_build_search_excerpt();
160
  }
161
+ if ("Yes" == $this->options['se_use_comment_search'])
162
+ {
163
+ $searchQuery .= $this->se_build_search_comments();
164
+ }
165
+ if ($searchQuery != '')
166
  {
167
  $index1 = strpos($where, '((');
168
  $index2 = strrpos($where, ')) ');
172
  $where = $firstPart."(".$secondPart.$searchQuery.")".$lastPart;
173
 
174
  }
175
+ if ($this->options['se_exclude_posts_list'] != '')
176
+ {
177
+ $where .= $this->se_build_exclude_posts();
178
+ }
179
+ if ($this->options['se_exclude_categories_list'] != '')
180
+ {
181
+ $where .= $this->se_build_exclude_categories();
182
+
183
+ }
184
+ $this->se_log("global where: ".$where);
185
  return $where;
186
  }
187
 
188
  // Exclude post revisions
189
+ function se_no_revisions($where)
190
  {
191
  global $wp_query;
192
+ if (!empty($wp_query->query_vars['s']))
193
  {
194
  $where = 'AND (' . substr($where, strpos($where, 'AND')+3) . ') AND post_type != \'revision\'';
195
  }
197
  }
198
 
199
  // Logs search into a file
200
+ function se_log($msg)
201
  {
202
 
203
+ if ($this->logging)
204
  {
205
  $fp = fopen("logfile.log","a+");
206
+ if ( !$fp )
207
+ {
208
+ echo 'unable to write to log file!';
209
  }
210
  $date = date("Y-m-d H:i:s ");
211
  $source = "search_everything plugin: ";
221
  global $wp_query;
222
  if (!empty($wp_query->query_vars['s']))
223
  {
224
+ if (strstr($where, 'DISTINCT'))
225
+ {}
226
+ else
227
  {
228
  $query = str_replace('SELECT', 'SELECT DISTINCT', $query);
229
  }
230
  }
231
  return $query;
232
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
  //search pages (except password protected pages provided by loops)
235
+ function se_search_pages($where)
236
  {
237
  global $wp_query;
238
+ if (!empty($wp_query->query_vars['s']))
239
  {
240
 
241
  $where = str_replace('"', '\'', $where);
242
+ if ('Yes' == $this->options['se_approved_pages_only'])
243
  {
244
  $where = str_replace('post_type = \'post\' AND ', 'post_password = \'\' AND ', $where);
245
  } else { // < v 2.1
282
 
283
 
284
  //search drafts
285
+ function se_search_draft_posts($where)
286
  {
287
  global $wp_query;
288
+ if (!empty($wp_query->query_vars['s']))
289
  {
290
  $where = str_replace('"', '\'', $where);
291
  $where = str_replace(' AND (post_status = \'publish\'', ' AND (post_status = \'publish\' or post_status = \'draft\'', $where);
295
  }
296
 
297
  //search attachments
298
+ function se_search_attachments($where)
299
  {
300
  global $wp_query;
301
+ if (!empty($wp_query->query_vars['s']))
302
  {
303
  $where = str_replace('"', '\'', $where);
304
  $where = str_replace(' AND (post_status = \'publish\'', ' AND (post_status = \'publish\' or post_status = \'attachment\'', $where);
308
  return $where;
309
  }
310
 
311
+ // create the comments data query
312
+ function se_build_search_comments()
313
  {
314
+ global $wp_query, $wpdb;
315
+ $s = $wp_query->query_vars['s'];
316
+ $search_terms = $this->se_get_search_terms();
317
+ $exact = $wp_query->query_vars['exact'];
 
 
 
 
 
318
 
319
+ if ( !empty($search_terms) ) {
320
+ // Building search query on comments content
321
+ $n = ($exact) ? '' : '%';
322
+ $searchand = '';
323
+ $searchContent = '';
324
+ foreach($search_terms as $term) {
325
+ $term = addslashes_gpc($term);
326
+ if ($this->wp_ver23)
327
  {
328
+ $searchContent .= "{$searchand}(cmt.comment_content LIKE '{$n}{$term}{$n}')";
329
  }
330
+ $searchand = ' AND ';
331
+ }
332
+ $term = $wpdb->escape($s);
333
+ if (!$sentence && count($search_terms) > 1 && $search_terms[0] != $s )
334
+ {
335
+ if ($this->wp_ver23)
336
  {
337
+ $searchContent = "($searchContent) OR (cmt.comment_content LIKE '{$n}{$s}{$n}')";
338
  }
 
 
 
 
 
339
  }
340
+ $search = $searchContent;
341
+ // Building search query on comments autor
342
+ if($this->options['se_use_cmt_authors'] == 'Yes')
343
+ {
344
+ $searchand = '';
345
+ $comment_author = '';
346
+ foreach($search_terms as $term) {
347
+ $term = addslashes_gpc($term);
348
+ if ($this->wp_ver23)
349
+ {
350
+ $comment_author .= "{$searchand}(cmt.comment_author LIKE '{$n}{$term}{$n}')";
351
+ }
352
+ $searchand = ' AND ';
353
+ }
354
+ $term = $wpdb->escape($s);
355
+ if (!$sentence && count($search_terms) > 1 && $search_terms[0] != $s )
356
+ {
357
+ if ($this->wp_ver23)
358
+ {
359
+ $comment_author = "($comment_author) OR (cmt.comment_author LIKE '{$n}{$s}{$n}')";
360
+ }
361
+ }
362
+ $search = "($search) OR ($comment_author)";
363
+ }
364
+ if ('Yes' == $this->options['se_approved_comments_only'])
365
+ {
366
+ $comment_approved = "AND cmt.comment_approved = '1'";
367
+ $search = "($search) $comment_approved";
368
+ }
369
+ if ( !empty($search) )
370
+ $search = " OR ({$search}) ";
371
  }
372
  $this->se_log("comments where: ".$where);
373
+ return $search;
 
374
  }
375
 
376
  // create the search meta data query
392
  {
393
  $search .= "{$searchand}(m.meta_value LIKE '{$n}{$term}{$n}')";
394
  } else {
395
+ $search .= "{$searchand}(meta_value LIKE '{$n}{$term}{$n}')";
396
  }
397
  $searchand = ' AND ';
398
  }
410
  if ( !empty($search) )
411
  $search = " OR ({$search}) ";
412
 
413
+ }
414
  $this->se_log("meta where: ".$where);
415
+ return $search;
416
+ }
417
 
418
  // create the search tag query
419
  function se_build_search_tag()
424
  $exact = $wp_query->query_vars['exact'];
425
  $search = '';
426
 
427
+ if ( !empty($search_terms) )
428
  {
429
  // Building search query
430
  $n = ($exact) ? '' : '%';
431
  $searchand = '';
432
+ foreach($search_terms as $term)
433
  {
434
  $term = addslashes_gpc($term);
435
  if ($this->wp_ver23)
503
  return $search;
504
  }
505
 
506
+ // create the Posts exclusion query
507
+ function se_build_exclude_posts()
508
  {
509
+ $excludeQuery = '';
510
+ $excludedPostList = trim($this->options['se_exclude_posts_list']);
511
+ if ($excludedPostList != '')
512
+ {
513
+ $excl_list = implode(',', explode(',',$excludedPostList));
514
+ $excludeQuery = ' AND (wp_posts.ID NOT IN ( '.$excl_list.' ))';
515
+ }
516
+ $this->se_log("ex posts where: ".$excludeQuery);
517
+ return $excludeQuery;
518
+ }
519
+
520
+ // create the Categories exclusion query
521
+ function se_build_exclude_categories()
522
+ {
523
+ $excludeQuery = '';
524
+ $excludedCatList = trim($this->options['se_exclude_categories_list']);
525
+ if ($excludedCatList != '')
526
  {
527
+ $excl_list = implode(',', explode(',',$excludedCatList));
528
+ if ($this->wp_ver23)
529
  {
530
+ $excludeQuery = " AND ( ctax.term_id NOT IN ( ".$excl_list." ))";
531
+ }
532
+ else
533
+ {
534
+ $excludeQuery = ' AND (c.category_id NOT IN ( '.$excl_list.' ))';
 
 
535
  }
536
  }
537
+ $this->se_log("ex category where: ".$excludeQuery);
538
+ return $excludeQuery;
539
  }
540
 
541
  //join for excluding categories - Deprecated in 2.3
542
+ function se_exclude_categories_join($join)
543
  {
544
  global $wp_query, $wpdb;
545
 
546
+ if (!empty($wp_query->query_vars['s']))
547
  {
548
 
549
+ if ($this->wp_ver23)
550
  {
551
  $join .= " LEFT JOIN $wpdb->term_relationships AS crel ON ($wpdb->posts.ID = crel.object_id) LEFT JOIN $wpdb->term_taxonomy AS ctax ON (ctax.taxonomy = 'category' AND crel.term_taxonomy_id = ctax.term_taxonomy_id) LEFT JOIN $wpdb->terms AS cter ON (ctax.term_id = cter.term_id) ";
552
  } else {
558
  }
559
 
560
  //join for searching comments
561
+ function se_comments_join($join)
562
  {
563
  global $wp_query, $wpdb;
564
 
565
+ if (!empty($wp_query->query_vars['s']))
566
  {
567
+ if ($this->wp_ver23)
568
  {
569
  $join .= " LEFT JOIN $wpdb->comments AS cmt ON ( cmt.comment_post_ID = ID ) ";
570
 
571
  } else {
572
 
573
+ if ('Yes' == $this->options['se_approved_comments_only'])
574
  {
575
  $comment_approved = " AND comment_approved = '1'";
576
  } else {
585
  }
586
 
587
  //join for searching authors
588
+ function se_search_authors($where)
589
  {
590
  global $wp_query, $wpdb;
591
 
592
+ if (!empty($wp_query->query_vars['s']))
593
  {
594
  $or = " OR (u.user_nicename LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
595
  }
599
  }
600
 
601
 
602
+ function se_search_authors_join($join)
603
  {
604
  global $wp_query, $wpdb;
605
 
606
+ if (!empty($wp_query->query_vars['s']))
607
  {
608
  $join .= " LEFT JOIN $wpdb->users AS u ON ($wpdb->posts.post_author = u.ID) ";
609
  }
612
  }
613
 
614
  //join for searching metadata
615
+ function se_search_metadata_join($join)
616
  {
617
  global $wp_query, $wpdb;
618
 
619
+ if (!empty($wp_query->query_vars['s']))
620
  {
621
 
622
  if ($this->wp_ver23)
629
  }
630
 
631
  //join for searching tags
632
+ function se_terms_join($join)
633
  {
634
  global $wp_query, $wpdb;
635
 
636
+ if (!empty($wp_query->query_vars['s']))
637
  {
638
 
639
  // if we're searching for categories
640
+ if ( $this->options['se_use_category_search'] )
641
  {
642
  $on[] = "ttax.taxonomy = 'category'";
643
  }
644
 
645
  // if we're searching for tags
646
+ if ( $this->options['se_use_tag_search'] )
647
  {
648
  $on[] = "ttax.taxonomy = 'post_tag'";
649
  }
views/options.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  Class se_admin {
4
 
5
- var $version = '6.1.1';
6
 
7
  function se_admin() {
8
 
@@ -48,14 +48,14 @@ Class se_admin {
48
 
49
  if($_POST['action'] == "save")
50
  {
51
- echo "<div class=\"updated fade\" id=\"limitcatsupdatenotice\"><p>" . __("Your default search settings have been <strong>updated</strong> by Search Everything. </p><p> What are you waiting for? Go check out the new search results!") . "</p></div>";
52
  update_option("se_options", $new_options);
53
 
54
  }
55
 
56
  if($_POST['action'] == "reset")
57
  {
58
- echo '<div id="message" class="updated fade"><p><strong>Your settings have been reset.</strong></p></div>';
59
  delete_option("se_options", $new_options);
60
  }
61
 
@@ -88,7 +88,7 @@ Class se_admin {
88
  <td class="forminp">
89
  <select id="search_pages" name="search_pages">
90
  <option<?php if ($options['se_use_page_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
91
- <option<?php if ($options['se_use_page_search'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
92
  </select>
93
 
94
  </td>
@@ -99,7 +99,7 @@ Class se_admin {
99
  <td class="forminp">
100
  <select id="appvd_pages" name="appvd_pages">
101
  <option<?php if ($options['se_approved_pages_only'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
102
- <option<?php if ($options['se_approved_pages_only'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
103
  </select>
104
  <br/><small></small>
105
  </td>
@@ -112,7 +112,7 @@ Class se_admin {
112
  <td class="forminp">
113
  <select id="search_tags" name="search_tags" >
114
  <option<?php if ($options['se_use_tag_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
115
- <option<?php if ($options['se_use_tag_search'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
116
  </select>
117
  <br/><small></small>
118
  </td>
@@ -126,7 +126,7 @@ Class se_admin {
126
  <td class="forminp">
127
  <select id="search_categories" name="search_categories">
128
  <option<?php if ($options['se_use_category_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
129
- <option<?php if ($options['se_use_category_search'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
130
  </select>
131
  <br/><small></small>
132
  </td>
@@ -137,7 +137,7 @@ Class se_admin {
137
  <td class="forminp">
138
  <select name="search_comments" id="search_comments">
139
  <option<?php if ($options['se_use_comment_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
140
- <option<?php if ($options['se_use_comment_search'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
141
  </select>
142
  <br/><small></small>
143
  </td>
@@ -147,7 +147,7 @@ Class se_admin {
147
  <td class="forminp">
148
  <select id="search_cmt_authors" name="search_cmt_authors">
149
  <option<?php if ($options['se_use_cmt_authors'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
150
- <option<?php if ($options['se_use_cmt_authors'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
151
  </select>
152
  <br/><small></small>
153
  </td>
@@ -157,7 +157,7 @@ Class se_admin {
157
  <td class="forminp">
158
  <select id="appvd_comments" name="appvd_comments">
159
  <option<?php if ($options['se_approved_comments_only'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
160
- <option<?php if ($options['se_approved_comments_only'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
161
  </select>
162
  <br/><small></small>
163
  </td>
@@ -167,7 +167,7 @@ Class se_admin {
167
  <td class="forminp">
168
  <select id="search_excerpt" name="search_excerpt">
169
  <option<?php if ($options['se_use_excerpt_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
170
- <option<?php if ($options['se_use_excerpt_search'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
171
  </select>
172
  <br/><small></small>
173
  </td>
@@ -180,18 +180,18 @@ Class se_admin {
180
  <td class="forminp">
181
  <select id="search_drafts" name="search_drafts">
182
  <option<?php if ($options['se_use_draft_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
183
- <option<?php if ($options['se_use_draft_search'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
184
  </select>
185
  <br/><small></small>
186
  </td>
187
  </tr>
188
  <?php endif; ?>
189
  <tr class="mainrow">
190
- <td class="titledesc"><?php _e('Search every attachment','SearchEverything'); ?>:</td>
191
  <td class="forminp">
192
  <select id="search_attachments" name="search_attachments">
193
  <option<?php if ($options['se_use_attachment_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
194
- <option<?php if ($options['se_use_attachment_search'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
195
  </select>
196
  <br/><small></small>
197
  </td>
@@ -201,7 +201,7 @@ Class se_admin {
201
  <td class="forminp">
202
  <select id="search_metadata" name="search_metadata">
203
  <option<?php if ($options['se_use_metadata_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
204
- <option<?php if ($options['se_use_metadata_search'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
205
  </select>
206
 
207
  </td>
@@ -211,7 +211,7 @@ Class se_admin {
211
  <td class="forminp">
212
  <select id="search_authors" name="search_authors">
213
  <option<?php if ($options['se_use_authors'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
214
- <option<?php if ($options['se_use_authors'] == 'Yes') { echo ' selected="selected"'; } ?>>Yes</option>
215
  </select>
216
  <br/><small></small>
217
  </td>
@@ -257,7 +257,7 @@ Class se_admin {
257
  </div>
258
  <div style="float: right; margin:0; padding:0; " class="submit">
259
  <form method="post">
260
- <input name="reset" type="submit" value="Reset Button" />
261
  <input type="hidden" name="action" value="reset" />
262
  </form>
263
  <div style="clear:both;"></div>
@@ -265,7 +265,7 @@ Class se_admin {
265
 
266
  <div style="clear: both;"></div>
267
 
268
- <small><?php _e('Find a bug?') ?> <a href="https://redmine.sproutventure.com/projects/search-everything/issues" target="blank"><?php _e('Post it as a new issue','SearchEverything')?></a>.</small>
269
  </div>
270
 
271
  <table style="margin-bottom: 20px;"></table>
@@ -297,14 +297,14 @@ Class se_admin {
297
  <thead>
298
  <tr class="title">
299
  <th scope="col" class="manage-column"><?php _e('News', 'SearchEverything'); ?></th>
300
- <th scope="col" class="manage-column"><?php _e('Development Support', 'SearchEverything'); ?>></th>
301
- <th scope="col" class="manage-column"><?php _e('Localization Support', 'SearchEverything'); ?>></th>
302
  </tr>
303
  </thead>
304
 
305
  <tr class="mainrow">
306
  <td class="thanks">
307
- <p><strong><?php _e('LOCALIZATION SUPPORT:', 'SearchEverything'); ?>></strong><br/><?php _e('Version 6 was a major update and a few areas need new localization support. If you can help send me your translations by posting them as a new issue, ') ?><a href="https://redmine.sproutventure.com/projects/search-everything/issues" target="blank"><strong><?php _e('here','SearchEverything')?></strong></a>.</p>
308
  <p><strong><?php _e('Thank You!', 'SearchEverything'); ?></strong><br/><?php _e('The development of Search Everything since Version one has primarily come from the WordPress community, I&#8217;m grateful for their dedicated and continued support.', 'SearchEverything'); ?></p>
309
  </td>
310
  <td>
@@ -315,11 +315,12 @@ Class se_admin {
315
  <li><a href="http://striderweb.com/" target="blank">Stephen Rider</a></li>
316
  <li><a href="http://chrismeller.com/" target="blank">Chris Meller</a></li>
317
  <li><a href="http://kinrowan.net/" target="blank">Cori Schlegel</a></li>
318
- <li>and many more...<a href="https://redmine.sproutventure.com/projects/search-everything/issues" target="blank">how about you?</a></li>
319
  </ul>
320
  </td>
321
  <td>
322
  <ul class="SE_lists">
 
323
  <li><a href="#">hit1205 (CN and TW)</a></li>
324
  <li><a href="http://beyn.org/" target="blank">Barış Ünver (FR)</a></li>
325
  <li><a href="http://www.alohastone.com" target="blank">alohastone (DE)</a></li>
2
 
3
  Class se_admin {
4
 
5
+ var $version = '6.1.3';
6
 
7
  function se_admin() {
8
 
48
 
49
  if($_POST['action'] == "save")
50
  {
51
+ echo "<div class=\"updated fade\" id=\"limitcatsupdatenotice\"><p>" . __('Your default search settings have been <strong>updated</strong> by Search Everything. </p><p> What are you waiting for? Go check out the new search results!', 'SearchEverything') . "</p></div>";
52
  update_option("se_options", $new_options);
53
 
54
  }
55
 
56
  if($_POST['action'] == "reset")
57
  {
58
+ echo "<div class=\"updated fade\" id=\"limitcatsupdatenotice\"><p>" . __('Your default search settings have been <strong>updated</strong> by Search Everything. </p><p> What are you waiting for? Go check out the new search results!', 'SearchEverything') . "</p></div>";
59
  delete_option("se_options", $new_options);
60
  }
61
 
88
  <td class="forminp">
89
  <select id="search_pages" name="search_pages">
90
  <option<?php if ($options['se_use_page_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
91
+ <option<?php if ($options['se_use_page_search'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
92
  </select>
93
 
94
  </td>
99
  <td class="forminp">
100
  <select id="appvd_pages" name="appvd_pages">
101
  <option<?php if ($options['se_approved_pages_only'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
102
+ <option<?php if ($options['se_approved_pages_only'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
103
  </select>
104
  <br/><small></small>
105
  </td>
112
  <td class="forminp">
113
  <select id="search_tags" name="search_tags" >
114
  <option<?php if ($options['se_use_tag_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
115
+ <option<?php if ($options['se_use_tag_search'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
116
  </select>
117
  <br/><small></small>
118
  </td>
126
  <td class="forminp">
127
  <select id="search_categories" name="search_categories">
128
  <option<?php if ($options['se_use_category_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
129
+ <option<?php if ($options['se_use_category_search'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
130
  </select>
131
  <br/><small></small>
132
  </td>
137
  <td class="forminp">
138
  <select name="search_comments" id="search_comments">
139
  <option<?php if ($options['se_use_comment_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
140
+ <option<?php if ($options['se_use_comment_search'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
141
  </select>
142
  <br/><small></small>
143
  </td>
147
  <td class="forminp">
148
  <select id="search_cmt_authors" name="search_cmt_authors">
149
  <option<?php if ($options['se_use_cmt_authors'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
150
+ <option<?php if ($options['se_use_cmt_authors'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
151
  </select>
152
  <br/><small></small>
153
  </td>
157
  <td class="forminp">
158
  <select id="appvd_comments" name="appvd_comments">
159
  <option<?php if ($options['se_approved_comments_only'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
160
+ <option<?php if ($options['se_approved_comments_only'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
161
  </select>
162
  <br/><small></small>
163
  </td>
167
  <td class="forminp">
168
  <select id="search_excerpt" name="search_excerpt">
169
  <option<?php if ($options['se_use_excerpt_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
170
+ <option<?php if ($options['se_use_excerpt_search'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
171
  </select>
172
  <br/><small></small>
173
  </td>
180
  <td class="forminp">
181
  <select id="search_drafts" name="search_drafts">
182
  <option<?php if ($options['se_use_draft_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
183
+ <option<?php if ($options['se_use_draft_search'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
184
  </select>
185
  <br/><small></small>
186
  </td>
187
  </tr>
188
  <?php endif; ?>
189
  <tr class="mainrow">
190
+ <td class="titledesc"><?php _e('Search every attachment','SearchEverything'); ?>:<br/><small><?php _e('(post type = attachment)','SearchEverything'); ?></small></td>
191
  <td class="forminp">
192
  <select id="search_attachments" name="search_attachments">
193
  <option<?php if ($options['se_use_attachment_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
194
+ <option<?php if ($options['se_use_attachment_search'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
195
  </select>
196
  <br/><small></small>
197
  </td>
201
  <td class="forminp">
202
  <select id="search_metadata" name="search_metadata">
203
  <option<?php if ($options['se_use_metadata_search'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
204
+ <option<?php if ($options['se_use_metadata_search'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
205
  </select>
206
 
207
  </td>
211
  <td class="forminp">
212
  <select id="search_authors" name="search_authors">
213
  <option<?php if ($options['se_use_authors'] == 'No') { echo ' selected="selected"'; } ?>>&nbsp;&nbsp;</option>
214
+ <option<?php if ($options['se_use_authors'] == 'Yes') { echo ' selected="selected"'; } ?>><?php _e('Yes', 'SearchEverything'); ?></option>
215
  </select>
216
  <br/><small></small>
217
  </td>
257
  </div>
258
  <div style="float: right; margin:0; padding:0; " class="submit">
259
  <form method="post">
260
+ <input name="reset" type="submit" value="<?php _e('Reset Button', 'SearchEverything') ?>" />
261
  <input type="hidden" name="action" value="reset" />
262
  </form>
263
  <div style="clear:both;"></div>
265
 
266
  <div style="clear: both;"></div>
267
 
268
+ <small><?php _e('Find a bug?', 'SearchEverything') ?> <a href="https://redmine.sproutventure.com/projects/search-everything/issues" target="blank"><?php _e('Post it as a new issue','SearchEverything')?></a>.</small>
269
  </div>
270
 
271
  <table style="margin-bottom: 20px;"></table>
297
  <thead>
298
  <tr class="title">
299
  <th scope="col" class="manage-column"><?php _e('News', 'SearchEverything'); ?></th>
300
+ <th scope="col" class="manage-column"><?php _e('Development Support', 'SearchEverything'); ?></th>
301
+ <th scope="col" class="manage-column"><?php _e('Localization Support', 'SearchEverything'); ?></th>
302
  </tr>
303
  </thead>
304
 
305
  <tr class="mainrow">
306
  <td class="thanks">
307
+ <p><strong><?php _e('LOCALIZATION SUPPORT:', 'SearchEverything'); ?></strong><br/><?php _e('Version 6 was a major update and a few areas need new localization support. If you can help send me your translations by posting them as a new issue, ', 'SearchEverything') ?><a href="https://redmine.sproutventure.com/projects/search-everything/issues" target="blank"><strong><?php _e('here','SearchEverything')?></strong></a>.</p>
308
  <p><strong><?php _e('Thank You!', 'SearchEverything'); ?></strong><br/><?php _e('The development of Search Everything since Version one has primarily come from the WordPress community, I&#8217;m grateful for their dedicated and continued support.', 'SearchEverything'); ?></p>
309
  </td>
310
  <td>
315
  <li><a href="http://striderweb.com/" target="blank">Stephen Rider</a></li>
316
  <li><a href="http://chrismeller.com/" target="blank">Chris Meller</a></li>
317
  <li><a href="http://kinrowan.net/" target="blank">Cori Schlegel</a></li>
318
+ <li><?php _e('and many more...', 'SearchEverything'); ?><a href="https://redmine.sproutventure.com/projects/search-everything/issues" target="blank"><?php _e('how about you?', 'SearchEverything'); ?></a></li>
319
  </ul>
320
  </td>
321
  <td>
322
  <ul class="SE_lists">
323
+ <li><a href="#">Simon Hansen (NN)</a></li>
324
  <li><a href="#">hit1205 (CN and TW)</a></li>
325
  <li><a href="http://beyn.org/" target="blank">Barış Ünver (FR)</a></li>
326
  <li><a href="http://www.alohastone.com" target="blank">alohastone (DE)</a></li>