Search Everything - Version 4.5

Version Description

Download this release

Release Info

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

Code changes from version 4.2.3 to 4.5

Files changed (6) hide show
  1. SE-Admin.php +36 -26
  2. lang/SE4-ja.mo +0 -0
  3. lang/SE4-ja.po +124 -0
  4. readme-JAPANESE.txt +43 -0
  5. readme.txt +8 -7
  6. search_everything.php +79 -41
SE-Admin.php CHANGED
@@ -2,21 +2,21 @@
2
 
3
  Class SearchEverythingAdmin {
4
 
5
- var $version = '4.2.3';
6
 
7
  function SearchEverythingAdmin() {
8
-
9
  // Load language file
10
  $locale = get_locale();
11
  if ( !empty($locale) )
12
  load_textdomain('SearchEverything', SE_ABSPATH .'lang/SE4-'.$locale.'.mo');
13
-
14
 
15
  add_action('admin_head', array(&$this, 'SE4_options_style'));
16
  add_action('admin_menu', array(&$this, 'SE4_add_options_panel'));
17
 
18
  }
19
-
20
  function SE4_add_options_panel() {
21
  add_options_page('Search', 'Search Everything', 7, 'manage_search', array(&$this, 'SE4_option_page'));
22
  }
@@ -36,6 +36,7 @@ Class SearchEverythingAdmin {
36
  'SE4_use_page_search' => $_POST["search_pages"],
37
  'SE4_use_comment_search' => $_POST["search_comments"],
38
  'SE4_use_tag_search' => $_POST["search_tags"],
 
39
  'SE4_approved_comments_only' => $_POST["appvd_comments"],
40
  'SE4_approved_pages_only' => $_POST["appvd_pages"],
41
  'SE4_use_excerpt_search' => $_POST["search_excerpt"],
@@ -53,12 +54,12 @@ Class SearchEverythingAdmin {
53
  $search_tag = get_option('search_tag');
54
 
55
  ?>
56
-
57
  <div class="wrap" id="SE4_options_panel">
58
  <h2>Search Everything (SE) Version: <?php echo $this->version; ?></h2>
59
  <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>
60
  </div>
61
-
62
  <div class="wrap SE4">
63
  <h2><?php _e('SE Search Options', 'SearchEverything'); ?></h2>
64
  <p><?php _e('Use this form to configure your search options.', 'SearchEverything'); ?></p>
@@ -69,45 +70,52 @@ Class SearchEverythingAdmin {
69
  <label for="exclude_posts"><?php _e('Exclude some post or page IDs','SearchEverything'); ?></label><br />
70
  &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 />
71
  &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>
72
-
73
- <p><input type="checkbox" id="exclude_categories" name="exclude_categories"
74
- value="true" <?php if($options['SE4_exclude_categories'] == 'true') { echo 'checked="true"'; } ?> />
75
  <label for="exclude_categories"><?php _e('Exclude Categories','SearchEverything'); ?></label><br />
76
  &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 />
77
  &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>
78
-
79
  <p><input type="checkbox" id="search_pages" name="search_pages"
80
  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
- <p><input type="checkbox" id="search_comments" name="search_comments"
 
 
 
 
 
 
 
93
  value="true" <?php if($options['SE4_use_comment_search'] == 'true') { echo 'checked="true"'; } ?> />
94
  <label for="search_comments"><?php _e('Search every comment','SearchEverything'); ?></label></p>
95
-
96
  <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"'; } ?>
97
  <label for="appvd_comments"><?php _e('Search approved comments only?','SearchEverything'); ?></label></p>
98
-
99
  <p><input type="checkbox" id="search_excerpt" name="search_excerpt" value="true" <?php if($options['SE4_use_excerpt_search'] == 'true') { echo 'checked="true"'; } ?> />
100
  <label for="search_excerpt"><?php _e('Search every excerpt','SearchEverything'); ?></label></p>
101
-
102
- <p><input type="checkbox" id="search_drafts" name="search_drafts" value="true" <?php if($options['SE4_use_draft_search'] == 'true') { echo 'checked="true"'; } ?>
103
  <label for="search_drafts"><?php _e('Search every draft','SearchEverything'); ?></label></p>
104
-
105
  <p><input type="checkbox" id="search_attachments" name="search_attachments" value="true" <?php if($options['SE4_use_attachment_search'] == 'true') { echo 'checked="true"'; } ?> />
106
  <label for="search_attachments"><?php _e('Search every attachment','SearchEverything'); ?></label></p>
107
-
108
  <p><input type="checkbox" id="search_metadata" name="search_metadata" value="true" <?php if($options['SE4_use_metadata_search'] == 'true') { echo 'checked="true"'; } ?> />
109
  <label for="search_metadata"><?php _e('Search every custom field (metadata)','SearchEverything'); ?></label></p>
110
-
111
  </fieldset>
112
  <fieldset class="options">
113
  <div class="submit">
@@ -120,7 +128,7 @@ If ($wp_version >= '2.3') { ?>
120
  <div class="wrap SE4">
121
  <h2><?php _e('SE Search Form', 'SearchEverything'); ?></h2>
122
  <p><?php _e('Use this search form to run a live search test.', 'SearchEverything'); ?></p>
123
-
124
  <fieldset>
125
  <legend><?php _e('Site Search', 'SearchEverything'); ?></legend>
126
  <form method="get" id="searchform" action="<?php bloginfo('home'); ?>"><p class="srch submit">
@@ -132,8 +140,10 @@ If ($wp_version >= '2.3') { ?>
132
  </div>
133
  <div class="wrap">
134
  <h2>SE Project Information</h2>
135
- <p>As of 2.3 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>
136
  <ul class="SE_lists">
 
 
137
  <li>Alakhnor</li>
138
  <li><a href="http://kinrowan.net/">Cori Schlegel</a></li>
139
  <li><a href="http://green-beast.com/">Mike Cherim</a></li>
@@ -143,7 +153,7 @@ If ($wp_version >= '2.3') { ?>
143
  <li><a href="http://www.alohastone.com">alohastone</a> (localization support)</li>
144
  <li><a href="http://www.fratelliditalia.eu">Domiziano Galia</a></li>
145
  <li>Uli Iserloh</li>
146
-
147
  </ul>
148
  <p>If you&#8217;d like to contribute there&#8217;s a lot to do:</p>
149
  <ul class="SE_lists">
@@ -155,7 +165,7 @@ If ($wp_version >= '2.3') { ?>
155
  <p class="sig">Respectfully,<br />
156
  <a href="http://dancameron.org/">Dan Cameron</a></p>
157
  </div>
158
-
159
  <?php
160
  } //end SE4_option_page
161
 
@@ -163,16 +173,16 @@ If ($wp_version >= '2.3') { ?>
163
  function SE4_options_style() {
164
  ?>
165
  <style type="text/css" media="screen">
166
- div.SE4 p.submit, div.SE4 form p.submit, div.SE4 p.submit input { text-align:left; }
167
  #SE4_options_panel p.submit { text-align:left; }
168
  form#searchform label, form#searchform input, form#SE_form label, form#SE_form input { margin-left:10px; }
169
  input.SE4_btn { cursor:pointer; margin-left:5px; }
170
- p.srch { margin:0; margin-bottom:20px; }
171
  p.submit input.srch-txt { background-color:#f4f4f4; background-image:none; border:1px solid #999; padding:6px; }
172
  p.submit input.srch-txt:focus, p.submit input.srch-txt:active { background-color:#fff; background-image:none; border:1px solid #111; padding:6px; }
173
  p.sig { margin-left:25px; }
174
  span.SE_notice { color:#cd0000; font-weight:bold; padding-left:10px; }
175
- label.SE_text_label { cursor:text; }
176
  form#SE_form label.SE_text_label, form#SE_form input.SE_text_input { margin-left:38px; }
177
  ul.SE_lists li { list-style-type:square; }
178
  </style>
2
 
3
  Class SearchEverythingAdmin {
4
 
5
+ var $version = '4.5';
6
 
7
  function SearchEverythingAdmin() {
8
+
9
  // Load language file
10
  $locale = get_locale();
11
  if ( !empty($locale) )
12
  load_textdomain('SearchEverything', SE_ABSPATH .'lang/SE4-'.$locale.'.mo');
13
+
14
 
15
  add_action('admin_head', array(&$this, 'SE4_options_style'));
16
  add_action('admin_menu', array(&$this, 'SE4_add_options_panel'));
17
 
18
  }
19
+
20
  function SE4_add_options_panel() {
21
  add_options_page('Search', 'Search Everything', 7, 'manage_search', array(&$this, 'SE4_option_page'));
22
  }
36
  'SE4_use_page_search' => $_POST["search_pages"],
37
  'SE4_use_comment_search' => $_POST["search_comments"],
38
  'SE4_use_tag_search' => $_POST["search_tags"],
39
+ 'SE4_use_category_search' => $_POST["search_categories"],
40
  'SE4_approved_comments_only' => $_POST["appvd_comments"],
41
  'SE4_approved_pages_only' => $_POST["appvd_pages"],
42
  'SE4_use_excerpt_search' => $_POST["search_excerpt"],
54
  $search_tag = get_option('search_tag');
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>
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">
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">
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>
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">
165
  <p class="sig">Respectfully,<br />
166
  <a href="http://dancameron.org/">Dan Cameron</a></p>
167
  </div>
168
+
169
  <?php
170
  } //end SE4_option_page
171
 
173
  function SE4_options_style() {
174
  ?>
175
  <style type="text/css" media="screen">
176
+ div.SE4 p.submit, div.SE4 form p.submit, div.SE4 p.submit input { text-align:left; }
177
  #SE4_options_panel p.submit { text-align:left; }
178
  form#searchform label, form#searchform input, form#SE_form label, form#SE_form input { margin-left:10px; }
179
  input.SE4_btn { cursor:pointer; margin-left:5px; }
180
+ p.srch { margin:0; margin-bottom:20px; }
181
  p.submit input.srch-txt { background-color:#f4f4f4; background-image:none; border:1px solid #999; padding:6px; }
182
  p.submit input.srch-txt:focus, p.submit input.srch-txt:active { background-color:#fff; background-image:none; border:1px solid #111; padding:6px; }
183
  p.sig { margin-left:25px; }
184
  span.SE_notice { color:#cd0000; font-weight:bold; padding-left:10px; }
185
+ label.SE_text_label { cursor:text; }
186
  form#SE_form label.SE_text_label, form#SE_form input.SE_text_input { margin-left:38px; }
187
  ul.SE_lists li { list-style-type:square; }
188
  </style>
lang/SE4-ja.mo ADDED
Binary file
lang/SE4-ja.po ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Japanese Language File for Search Everything 3.01
2
+ # (search_everything-ja_UTF.po)
3
+ # This file is distributed under the same license as the WordPress package.
4
+ #
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: Search Everything 3.01\n"
8
+ "POT-Creation-Date: \n"
9
+ "PO-Revision-Date: 2008-02-29 11:50-0500\n"
10
+ "Last-Translator: Naoko McCracken <info@nao-net.com>\n"
11
+ "Language-Team: WordPress J-Series Project <http://wppluginsj.sourceforge.jp/i18n-ja_jp/>\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Poedit-Language: Japanese\n"
16
+ "X-Poedit-Country: JAPAN\n"
17
+ "X-Poedit-SourceCharset: utf-8\n"
18
+ "X-Poedit-KeywordsList: _e;__\n"
19
+ "X-Poedit-Basepath: .\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+
22
+ #: search-everything/SE-Admin.php:29
23
+ msgid "Search Everything Options <strong>Updated</strong>."
24
+ msgstr "Search Everything の設定を<strong>更新しました</strong>。"
25
+
26
+ #: search-everything/SE-Admin.php:59
27
+ msgid "The options selected below will be used in every search query on this site; in addition to the built-in post search."
28
+ msgstr "以下で選択した設定は、デフォルトの記事検索機能に加え、サイト内の検索クエリすべてに適用されます。"
29
+
30
+ #: search-everything/SE-Admin.php:63
31
+ msgid "SE Search Options"
32
+ msgstr "SE 検索設定"
33
+
34
+ #: search-everything/SE-Admin.php:64
35
+ msgid "Use this form to configure your search options."
36
+ msgstr "以下のフォームで検索設定を行ってください。"
37
+
38
+ #: search-everything/SE-Admin.php:67
39
+ msgid "Search Options Form"
40
+ msgstr "検索設定フォーム"
41
+
42
+ #: search-everything/SE-Admin.php:69
43
+ msgid "Exclude some post or page IDs"
44
+ msgstr "指定した ID の投稿やページを検索対象に含めない"
45
+
46
+ #: search-everything/SE-Admin.php:70
47
+ msgid "Comma separated Post IDs (example: 1, 5, 9)"
48
+ msgstr "投稿 ID を半角コンマ区切りで記入してください(例: 1, 5, 9)。"
49
+
50
+ #: search-everything/SE-Admin.php:75
51
+ msgid "Exclude Categories"
52
+ msgstr "指定したカテゴリーを検索対象に含めない"
53
+
54
+ #: search-everything/SE-Admin.php:76
55
+ msgid "Comma separated category IDs (example: 1, 4)"
56
+ msgstr "カテゴリー ID を半角コンマ区切りで記入してください(例: 1, 4)。"
57
+
58
+ #: search-everything/SE-Admin.php:81
59
+ msgid "Search every page (non-password protected)"
60
+ msgstr "パスワード保護されていないページをすべて検索"
61
+
62
+ #: search-everything/SE-Admin.php:83
63
+ msgid "Search approved pages only?"
64
+ msgstr "承認したページのみを検索しますか?"
65
+
66
+ #: search-everything/SE-Admin.php:89
67
+ msgid "Search every tag"
68
+ msgstr "タグをすべて検索"
69
+
70
+ #: search-everything/SE-Admin.php:94
71
+ msgid "Search every comment"
72
+ msgstr "コメントをすべて検索"
73
+
74
+ #: search-everything/SE-Admin.php:97
75
+ msgid "Search approved comments only?"
76
+ msgstr "承認したコメントのみを検索しますか?"
77
+
78
+ #: search-everything/SE-Admin.php:100
79
+ msgid "Search every excerpt"
80
+ msgstr "記事の要約をすべて検索"
81
+
82
+ #: search-everything/SE-Admin.php:103
83
+ msgid "Search every draft"
84
+ msgstr "未公開の記事をすべて検索"
85
+
86
+ #: search-everything/SE-Admin.php:106
87
+ msgid "Search every attachment"
88
+ msgstr "メディアをすべて検索"
89
+
90
+ #: search-everything/SE-Admin.php:109
91
+ msgid "Search every custom field (metadata)"
92
+ msgstr "カスタムフィールド(メタデータ)をすべて検索"
93
+
94
+ #: search-everything/SE-Admin.php:115
95
+ msgid "Update Options"
96
+ msgstr "設定を更新"
97
+
98
+ #: search-everything/SE-Admin.php:121
99
+ msgid "SE Search Form"
100
+ msgstr "SE 検索フォーム"
101
+
102
+ #: search-everything/SE-Admin.php:122
103
+ msgid "Use this search form to run a live search test."
104
+ msgstr "この検索フォームで現在適用された設定を元にした検索テストを行うことができます。"
105
+
106
+ #: search-everything/SE-Admin.php:125
107
+ msgid "Site Search"
108
+ msgstr "サイトの検索"
109
+
110
+ #: search-everything/SE-Admin.php:127
111
+ msgid "Enter search terms"
112
+ msgstr "検索キーワードを入力"
113
+
114
+ #: search-everything/SE-Admin.php:129
115
+ msgid "Run Test Search"
116
+ msgstr "検索のテスト"
117
+
118
+ #~ msgid "Search Everything"
119
+ #~ msgstr "検索対象設定"
120
+ #~ msgid "Save"
121
+ #~ msgstr "保存"
122
+ #~ msgid "You may have to update your options twice before it sticks."
123
+ #~ msgstr "変更が適用されるまで、設定を2回更新する必要がある場合があります。"
124
+
readme-JAPANESE.txt ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Search Everything (SE) v4.2.2 - 検索対象にするコンテンツを追加するプラグイン
2
+ GNU General Public License
3
+ Developed by Daniel Cameron dancameron@gmail.com / http://dancameron.org/
4
+ Translation by Naoko McCracken http://detlog.org/
5
+ 対応テスト済みのWordPressバージョン: 2.1〜2.3(日本語タグ未対応)
6
+
7
+ このプラグインの翻訳版配布ページ: http://wppluginsj.sourceforge.jp/i18n-ja_jp/search-everything/
8
+ このプラグインに関する追加情報(英語): http://wordpress.org/extend/plugins/search-everything/
9
+
10
+ ◆はじめに
11
+ ------------------------
12
+ デフォルトの状態のWordPressでは、公開したと投稿の本文のみが検索されます。このプラグインを使って、検索対象にするコンテンツを追加することができます。
13
+
14
+ - ページ作成機能で追加した全ページ
15
+ - パスワード保護されていない全ページ
16
+ - タグ(ただし現時点では日本語はうまく行かないようです)
17
+ - すべてのコメント
18
+ - 承認済みのコメントのみ
19
+ - 未公開の草稿記事
20
+ - 投稿の要約
21
+ - アタッチメント(記事内で使用中のアップロードファイル)
22
+ - カスタムフィールドで追加した記事のメタデータ
23
+ - カテゴリー
24
+ - ID指定した以外の全ページ
25
+ - ID指定した以外の全カテゴリー
26
+
27
+ ◆インストール
28
+ ------------------------
29
+ 1. ZIPファイルを解凍します。
30
+
31
+ 2. search-everythingフォルダをそのままプラグインディレクトリ(/wp-content/plugins/)に移動します。
32
+
33
+ - wp-content
34
+ - plugins
35
+ - search-everything
36
+ | search_everything.php
37
+ | SE-Admin.php
38
+ - lang
39
+ | SE4-ja.mo
40
+
41
+ 2. プラグイン管理画面にログインし、「Search Everything」を有効化します。
42
+
43
+ 3. 「設定」メニューのサブメニューとして現れる、「Search Everything」管理パネルへ移動し、設定を変更します。検索したいコンテンツにチェックを入れ、「設定を更新」ボタンをクリックします。
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, comment search, page search, admin, seo
5
  Requires at least: 2.1
6
- Tested up to: 2.3
7
- Stable tag: 4.2.2
8
 
9
  Increases Wordpress' default search functionality through an options panel. Options include searching pages, excerpts, attachments, drafts, comments and custom fields (metadata).
10
 
@@ -14,6 +14,7 @@ Search Everything increases the ability of the default Wordpress Search, options
14
 
15
  * Search Every Page
16
  * Search Every Tag
 
17
  * Search non-password protected pages only
18
  * Search Every Comment
19
  * Search only approved comments
@@ -21,15 +22,15 @@ Search Everything increases the ability of the default Wordpress Search, options
21
  * Search Every Excerpt
22
  * Search Every Attachment
23
  * Search Every Custom Field (metadata)
24
- * Search Every Category Name
25
  * Exclude Posts from search
26
  * Exclude Categories from search
27
 
28
- ... tagging support and category exclusion for WordPress 2.3 is now supported.
29
 
30
 
31
  == Update Log ==
32
 
 
33
  * 4.2.2 - Localization PO and MO updates, German Translation
34
  * 4.2 - Full 2.3 Support with Tag Searching and Category Exclusion. Major Performance tweaks for searching tags and comments (4.2.1).
35
  * 4.1 - Major Plugin Architecture change, better localization support
@@ -45,7 +46,7 @@ Search Everything increases the ability of the default Wordpress Search, options
45
  Installation Instructions:
46
 
47
  1. Download the plugin and unzip it (didn't you already do this?).
48
- 2. Put the 'searchev-erything' directory into your wp-content/plugins/ directory.
49
  3. Go to the Plugins page in your WordPress Administration area and click 'Activate' next to Search Everything.
50
  4. Go to the Options > Search Everything and configure your site.
51
  5. That's it. Have fun and if you can contribute (see notes), at the very least post your likes and dislikes about the plugin linking to http://dancameron.org/wordpress/ so your readers to find the plugin and I can see your feedback.
@@ -69,7 +70,7 @@ Open up a thread in the support forums tagged 'searcheverything' and 'dancameron
69
 
70
  == Help ==
71
 
72
- I do need help with this plugin. If you can possibly do my day job and take my girls to the park I would appreciate it so I can work on this plugin. Otherwise contribute your fixes and suggestions to me in the forums or through the contact form on my site.
73
 
74
 
75
  == Support ==
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.5
7
+ Stable tag: 4.5
8
 
9
  Increases Wordpress' default search functionality through an options panel. Options include searching pages, excerpts, attachments, drafts, comments and custom fields (metadata).
10
 
14
 
15
  * Search Every Page
16
  * Search Every Tag
17
+ * Search Every Category
18
  * Search non-password protected pages only
19
  * Search Every Comment
20
  * Search only approved comments
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
+ ... I'm still looking for some help so please contact me if you'd like to contribute.
29
 
30
 
31
  == Update Log ==
32
 
33
+ *4.5 - Japanese Language Support, Category Fix for Wordpress 2.5, Tag search fix (name) other minors
34
  * 4.2.2 - Localization PO and MO updates, German Translation
35
  * 4.2 - Full 2.3 Support with Tag Searching and Category Exclusion. Major Performance tweaks for searching tags and comments (4.2.1).
36
  * 4.1 - Major Plugin Architecture change, better localization support
46
  Installation Instructions:
47
 
48
  1. Download the plugin and unzip it (didn't you already do this?).
49
+ 2. Put the 'search-everything' directory into your wp-content/plugins/ directory.
50
  3. Go to the Plugins page in your WordPress Administration area and click 'Activate' next to Search Everything.
51
  4. Go to the Options > Search Everything and configure your site.
52
  5. That's it. Have fun and if you can contribute (see notes), at the very least post your likes and dislikes about the plugin linking to http://dancameron.org/wordpress/ so your readers to find the plugin and I can see your feedback.
70
 
71
  == Help ==
72
 
73
+ I do need help with this plugin. If you can possibly do my day job and take my girls to the park I would appreciate it; otherwise contribute your fixes and suggestions to me in the forums or through the contact form on my site.
74
 
75
 
76
  == Support ==
search_everything.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
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.2.3
7
  Author: Dan Cameron
8
  Author URI: http://dancameron.org/
9
  */
@@ -23,29 +23,37 @@ Class SearchEverything {
23
  var $login = false;
24
  var $options;
25
  var $wp_ver23;
26
-
 
27
  function SearchEverything(){
28
  global $wp_version;
29
  $this->wp_ver23 = ($wp_version >= '2.3');
 
30
  $this->options = get_option('SE4_options');
31
 
32
  if (is_admin()) {
33
  include ( SE_ABSPATH . '/SE-Admin.php' );
34
  $SEAdmin = new SearchEverythingAdmin();
35
  }
36
-
37
  //add filters based upon option settings
38
  if ("true" == $this->options['SE4_use_tag_search']) {
39
  add_filter('posts_where', array(&$this, 'SE4_search_tags'));
40
  add_filter('posts_join', array(&$this, 'SE4_terms_join'));
41
  $this->SE4_log("searching tags");
42
  }
43
-
 
 
 
 
 
 
44
  if ("true" == $this->options['SE4_use_page_search']) {
45
  add_filter('posts_where', array(&$this, 'SE4_search_pages'));
46
  $this->SE4_log("searching pages");
47
  }
48
-
49
  if ("true" == $this->options['SE4_use_excerpt_search']) {
50
  add_filter('posts_where', array(&$this, 'SE4_search_excerpt'));
51
  $this->SE4_log("searching excerpts");
@@ -56,12 +64,12 @@ Class SearchEverything {
56
  add_filter('posts_join', array(&$this, 'SE4_comments_join'));
57
  $this->SE4_log("searching comments");
58
  }
59
-
60
  if ("true" == $this->options['SE4_use_draft_search']) {
61
  add_filter('posts_where', array(&$this, 'SE4_search_draft_posts'));
62
  $this->SE4_log("searching drafts");
63
  }
64
-
65
  if ("true" == $this->options['SE4_use_attachment_search']) {
66
  add_filter('posts_where', array(&$this, 'SE4_search_attachments'));
67
  $this->SE4_log("searching attachments");
@@ -83,7 +91,7 @@ Class SearchEverything {
83
  add_filter('posts_join', array(&$this, 'SE4_exclude_categories_join'));
84
  $this->SE4_log("searching excluding categories");
85
  }
86
-
87
  //Duplicate fix provided by Tiago.Pocinho
88
  add_filter('posts_request', array(&$this, 'SE4_distinct'));
89
  }
@@ -93,6 +101,7 @@ Class SearchEverything {
93
 
94
  if ($this->logging) {
95
  $fp = fopen("logfile.log","a+");
 
96
  $date = date("Y-m-d H:i:s ");
97
  $source = "search_everything plugin: ";
98
  fwrite($fp, "\n\n".$date."\n".$source."\n".$msg);
@@ -121,29 +130,29 @@ Class SearchEverything {
121
  $where = 'AND ('.substr($where, strpos($where, 'AND')+3).' )';
122
  $where .= ' AND (ID NOT IN ( '.$excl_list.' ))';
123
  }
124
-
125
  $this->SE4_log("ex posts where: ".$where);
126
  return $where;
127
  }
128
-
129
  //search pages (except password protected pages provided by loops)
130
  function SE4_search_pages($where) {
131
  global $wp_query;
132
  if (!empty($wp_query->query_vars['s'])) {
133
-
134
  $where = str_replace('"', '\'', $where);
135
- if ('true' == $this->options['SE4_approved_pages_only']) {
136
  $where = str_replace('post_type = \'post\' AND ', 'post_password = \'\' AND ', $where);
137
  }
138
  else { // < v 2.1
139
  $where = str_replace('post_type = \'post\' AND ', '', $where);
140
  }
141
  }
142
-
143
  $this->SE4_log("pages where: ".$where);
144
  return $where;
145
  }
146
-
147
  //search excerpts provided by Dennis Turner
148
  function SE4_search_excerpt($where) {
149
  global $wp_query;
@@ -154,11 +163,11 @@ Class SearchEverything {
154
  $wp_query->query_vars['s'] . '%\') OR (post_excerpt LIKE \'%' .
155
  $wp_query->query_vars['s'] . '%\'', $where);
156
  }
157
-
158
  $this->SE4_log("excerpts where: ".$where);
159
  return $where;
160
  }
161
-
162
  //search drafts
163
  function SE4_search_draft_posts($where) {
164
  global $wp_query;
@@ -166,11 +175,11 @@ Class SearchEverything {
166
  $where = str_replace('"', '\'', $where);
167
  $where = str_replace(' AND (post_status = \'publish\'', ' AND (post_status = \'publish\' or post_status = \'draft\'', $where);
168
  }
169
-
170
  $this->SE4_log("drafts where: ".$where);
171
  return $where;
172
  }
173
-
174
  //search attachments
175
  function SE4_search_attachments($where) {
176
  global $wp_query;
@@ -179,11 +188,11 @@ Class SearchEverything {
179
  $where = str_replace(' AND (post_status = \'publish\'', ' AND (post_status = \'publish\' or post_status = \'attachment\'', $where);
180
  $where = str_replace('AND post_status != \'attachment\'','',$where);
181
  }
182
-
183
  $this->SE4_log("attachments where: ".$where);
184
  return $where;
185
  }
186
-
187
  //search comments
188
  function SE4_search_comments($where) {
189
  global $wp_query, $wpdb;
@@ -198,12 +207,12 @@ Class SearchEverything {
198
  $where .= " OR ( c.comment_post_ID = ".$wpdb->posts . ".ID " . $comment_approved . " AND c.comment_content LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
199
  }
200
  }
201
-
202
  $this->SE4_log("comments where: ".$where);
203
-
204
  return $where;
205
  }
206
-
207
  //search metadata
208
  function SE4_search_metadata($where) {
209
  global $wp_query, $wpdb;
@@ -213,9 +222,9 @@ Class SearchEverything {
213
  else
214
  $where .= " OR meta_value LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%' ";
215
  }
216
-
217
  $this->SE4_log("metadata where: ".$where);
218
-
219
  return $where;
220
  }
221
 
@@ -224,14 +233,29 @@ Class SearchEverything {
224
  global $wp_query, $wpdb;
225
  if (!empty($wp_query->query_vars['s'])) {
226
  //$where .= " OR ( tter.slug LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
227
- $where .= " OR ( tter.slug LIKE '%" . str_replace(' ', '-',$wpdb->escape($wp_query->query_vars['s'])) . "%') ";
228
  }
229
-
230
  $this->SE4_log("tags where: ".$where);
231
-
232
  return $where;
233
  }
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  //exlude some categories from search
236
  function SE4_exclude_categories($where) {
237
  global $wp_query, $wpdb;
@@ -250,13 +274,13 @@ Class SearchEverything {
250
  $this->SE4_log("ex cats where: ".$where);
251
  return $where;
252
  }
253
-
254
  //join for excluding categories - Deprecated in 2.3
255
  function SE4_exclude_categories_join($join) {
256
  global $wp_query, $wpdb;
257
-
258
  if (!empty($wp_query->query_vars['s'])) {
259
-
260
  if ($this->wp_ver23) {
261
  $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) ";
262
  } else {
@@ -266,13 +290,13 @@ Class SearchEverything {
266
  $this->SE4_log("category join: ".$join);
267
  return $join;
268
  }
269
-
270
  //join for searching comments
271
  function SE4_comments_join($join) {
272
  global $wp_query, $wpdb;
273
-
274
  if (!empty($wp_query->query_vars['s'])) {
275
-
276
  if ($this->wp_ver23) {
277
  $join .= " LEFT JOIN $wpdb->comments AS c ON ( comment_post_ID = ID " . $comment_approved . ") ";
278
  } else {
@@ -291,16 +315,16 @@ Class SearchEverything {
291
  $this->SE4_log("comments join: ".$join);
292
  return $join;
293
  }
294
-
295
  //join for searching metadata
296
  function SE4_search_metadata_join($join) {
297
  global $wp_query, $wpdb;
298
-
299
  if (!empty($wp_query->query_vars['s'])) {
300
 
301
  if ($this->wp_ver23)
302
  $join .= " LEFT JOIN $wpdb->postmeta AS m ON ($wpdb->posts.ID = m.post_id) ";
303
- else
304
  $join .= "LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id ";
305
  }
306
  $this->SE4_log("metadata join: ".$join);
@@ -310,11 +334,25 @@ Class SearchEverything {
310
  //join for searching tags
311
  function SE4_terms_join($join) {
312
  global $wp_query, $wpdb;
313
-
314
  if (!empty($wp_query->query_vars['s'])) {
315
- $join .= " LEFT JOIN $wpdb->term_relationships AS trel ON ($wpdb->posts.ID = trel.object_id) LEFT JOIN $wpdb->term_taxonomy AS ttax ON (ttax.taxonomy = 'post_tag' AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN $wpdb->terms AS tter ON (ttax.term_id = tter.term_id) ";
 
 
 
316
  }
317
-
 
 
 
 
 
 
 
 
 
 
 
318
  $this->SE4_log("tags join: ".$join);
319
  return $join;
320
  }
2
  /*
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
  */
23
  var $login = false;
24
  var $options;
25
  var $wp_ver23;
26
+ var $wp_ver25;
27
+
28
  function SearchEverything(){
29
  global $wp_version;
30
  $this->wp_ver23 = ($wp_version >= '2.3');
31
+ $this->wp_ver25 = ($wp_version >= '2.5');
32
  $this->options = get_option('SE4_options');
33
 
34
  if (is_admin()) {
35
  include ( SE_ABSPATH . '/SE-Admin.php' );
36
  $SEAdmin = new SearchEverythingAdmin();
37
  }
38
+
39
  //add filters based upon option settings
40
  if ("true" == $this->options['SE4_use_tag_search']) {
41
  add_filter('posts_where', array(&$this, 'SE4_search_tags'));
42
  add_filter('posts_join', array(&$this, 'SE4_terms_join'));
43
  $this->SE4_log("searching tags");
44
  }
45
+
46
+ if ("true" == $this->options['SE4_use_category_search']) {
47
+ add_filter('posts_where', array(&$this, 'SE4_search_categories'));
48
+ add_filter('posts_join', array(&$this, 'SE4_terms_join'));
49
+ $this->SE4_log("searching categories");
50
+ }
51
+
52
  if ("true" == $this->options['SE4_use_page_search']) {
53
  add_filter('posts_where', array(&$this, 'SE4_search_pages'));
54
  $this->SE4_log("searching pages");
55
  }
56
+
57
  if ("true" == $this->options['SE4_use_excerpt_search']) {
58
  add_filter('posts_where', array(&$this, 'SE4_search_excerpt'));
59
  $this->SE4_log("searching excerpts");
64
  add_filter('posts_join', array(&$this, 'SE4_comments_join'));
65
  $this->SE4_log("searching comments");
66
  }
67
+
68
  if ("true" == $this->options['SE4_use_draft_search']) {
69
  add_filter('posts_where', array(&$this, 'SE4_search_draft_posts'));
70
  $this->SE4_log("searching drafts");
71
  }
72
+
73
  if ("true" == $this->options['SE4_use_attachment_search']) {
74
  add_filter('posts_where', array(&$this, 'SE4_search_attachments'));
75
  $this->SE4_log("searching attachments");
91
  add_filter('posts_join', array(&$this, 'SE4_exclude_categories_join'));
92
  $this->SE4_log("searching excluding categories");
93
  }
94
+
95
  //Duplicate fix provided by Tiago.Pocinho
96
  add_filter('posts_request', array(&$this, 'SE4_distinct'));
97
  }
101
 
102
  if ($this->logging) {
103
  $fp = fopen("logfile.log","a+");
104
+ if ( !$fp ) { echo 'unable to write to log file!'; }
105
  $date = date("Y-m-d H:i:s ");
106
  $source = "search_everything plugin: ";
107
  fwrite($fp, "\n\n".$date."\n".$source."\n".$msg);
130
  $where = 'AND ('.substr($where, strpos($where, 'AND')+3).' )';
131
  $where .= ' AND (ID NOT IN ( '.$excl_list.' ))';
132
  }
133
+
134
  $this->SE4_log("ex posts where: ".$where);
135
  return $where;
136
  }
137
+
138
  //search pages (except password protected pages provided by loops)
139
  function SE4_search_pages($where) {
140
  global $wp_query;
141
  if (!empty($wp_query->query_vars['s'])) {
142
+
143
  $where = str_replace('"', '\'', $where);
144
+ if ('true' == $this->options['SE4_approved_pages_only']) {
145
  $where = str_replace('post_type = \'post\' AND ', 'post_password = \'\' AND ', $where);
146
  }
147
  else { // < v 2.1
148
  $where = str_replace('post_type = \'post\' AND ', '', $where);
149
  }
150
  }
151
+
152
  $this->SE4_log("pages where: ".$where);
153
  return $where;
154
  }
155
+
156
  //search excerpts provided by Dennis Turner
157
  function SE4_search_excerpt($where) {
158
  global $wp_query;
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;
175
  $where = str_replace('"', '\'', $where);
176
  $where = str_replace(' AND (post_status = \'publish\'', ' AND (post_status = \'publish\' or post_status = \'draft\'', $where);
177
  }
178
+
179
  $this->SE4_log("drafts where: ".$where);
180
  return $where;
181
  }
182
+
183
  //search attachments
184
  function SE4_search_attachments($where) {
185
  global $wp_query;
188
  $where = str_replace(' AND (post_status = \'publish\'', ' AND (post_status = \'publish\' or post_status = \'attachment\'', $where);
189
  $where = str_replace('AND post_status != \'attachment\'','',$where);
190
  }
191
+
192
  $this->SE4_log("attachments where: ".$where);
193
  return $where;
194
  }
195
+
196
  //search comments
197
  function SE4_search_comments($where) {
198
  global $wp_query, $wpdb;
207
  $where .= " OR ( c.comment_post_ID = ".$wpdb->posts . ".ID " . $comment_approved . " AND c.comment_content LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
208
  }
209
  }
210
+
211
  $this->SE4_log("comments where: ".$where);
212
+
213
  return $where;
214
  }
215
+
216
  //search metadata
217
  function SE4_search_metadata($where) {
218
  global $wp_query, $wpdb;
222
  else
223
  $where .= " OR meta_value LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%' ";
224
  }
225
+
226
  $this->SE4_log("metadata where: ".$where);
227
+
228
  return $where;
229
  }
230
 
233
  global $wp_query, $wpdb;
234
  if (!empty($wp_query->query_vars['s'])) {
235
  //$where .= " OR ( tter.slug LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
236
+ $where .= " OR ( tter.name LIKE '%" . str_replace(' ', '-',$wpdb->escape($wp_query->query_vars['s'])) . "%') ";
237
  }
238
+
239
  $this->SE4_log("tags where: ".$where);
240
+
241
  return $where;
242
  }
243
 
244
+ //search categories
245
+ function SE4_search_categories ( $where ) {
246
+
247
+ global $wp_query, $wpdb;
248
+
249
+ if ( ! empty($wp_query->query_vars['s']) ) {
250
+ $where .= " OR ( tter.slug LIKE '%" . sanitize_title_with_dashes( $wp_query->query_vars['s'] ) . "%') ";
251
+ }
252
+
253
+ $this->SE4_log("categories where: ".$where);
254
+
255
+ return $where;
256
+
257
+ }
258
+
259
  //exlude some categories from search
260
  function SE4_exclude_categories($where) {
261
  global $wp_query, $wpdb;
274
  $this->SE4_log("ex cats where: ".$where);
275
  return $where;
276
  }
277
+
278
  //join for excluding categories - Deprecated in 2.3
279
  function SE4_exclude_categories_join($join) {
280
  global $wp_query, $wpdb;
281
+
282
  if (!empty($wp_query->query_vars['s'])) {
283
+
284
  if ($this->wp_ver23) {
285
  $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) ";
286
  } else {
290
  $this->SE4_log("category join: ".$join);
291
  return $join;
292
  }
293
+
294
  //join for searching comments
295
  function SE4_comments_join($join) {
296
  global $wp_query, $wpdb;
297
+
298
  if (!empty($wp_query->query_vars['s'])) {
299
+
300
  if ($this->wp_ver23) {
301
  $join .= " LEFT JOIN $wpdb->comments AS c ON ( comment_post_ID = ID " . $comment_approved . ") ";
302
  } else {
315
  $this->SE4_log("comments join: ".$join);
316
  return $join;
317
  }
318
+
319
  //join for searching metadata
320
  function SE4_search_metadata_join($join) {
321
  global $wp_query, $wpdb;
322
+
323
  if (!empty($wp_query->query_vars['s'])) {
324
 
325
  if ($this->wp_ver23)
326
  $join .= " LEFT JOIN $wpdb->postmeta AS m ON ($wpdb->posts.ID = m.post_id) ";
327
+ else
328
  $join .= "LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id ";
329
  }
330
  $this->SE4_log("metadata join: ".$join);
334
  //join for searching tags
335
  function SE4_terms_join($join) {
336
  global $wp_query, $wpdb;
337
+
338
  if (!empty($wp_query->query_vars['s'])) {
339
+
340
+ // if we're searching for categories
341
+ if ( $this->options['SE4_use_category_search'] ) {
342
+ $on[] = "ttax.taxonomy = 'category'";
343
  }
344
+
345
+ // if we're searching for tags
346
+ if ( $this->options['SE4_use_tag_search'] ) {
347
+ $on[] = "ttax.taxonomy = 'post_tag'";
348
+ }
349
+
350
+ // build our final string
351
+ $on = ' ( ' . implode( ' OR ', $on ) . ' ) ';
352
+
353
+ $join .= " LEFT JOIN $wpdb->term_relationships AS trel ON ($wpdb->posts.ID = trel.object_id) LEFT JOIN $wpdb->term_taxonomy AS ttax ON ( " . $on . " AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN $wpdb->terms AS tter ON (ttax.term_id = tter.term_id) ";
354
+ }
355
+
356
  $this->SE4_log("tags join: ".$join);
357
  return $join;
358
  }