Search Everything - Version 5.0

Version Description

Download this release

Release Info

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

Code changes from version 4.7.8 to 5.0

Files changed (5) hide show
  1. SE-Admin.php +47 -45
  2. lang/SE4-hu_HU.po +39 -35
  3. readme-JAPANESE.txt +1 -1
  4. readme.txt +7 -6
  5. search_everything.php +101 -101
SE-Admin.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  Class SearchEverythingAdmin {
4
 
5
- var $version = '4.7.8';
6
 
7
  function SearchEverythingAdmin() {
8
 
@@ -12,45 +12,47 @@ Class SearchEverythingAdmin {
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
  }
23
 
24
  //build admin interface
25
- function SE4_option_page() {
26
  global $wpdb, $table_prefix, $wp_version;
27
 
28
  if($_POST['action'] == "save") {
29
  echo "<div class=\"updated fade\" id=\"limitcatsupdatenotice\"><p>" . __("Search Everything Options <strong>Updated</strong>.") . "</p></div>";
30
 
31
  $new_options = array(
32
- 'SE4_exclude_categories' => $_POST["exclude_categories"],
33
- 'SE4_exclude_categories_list' => $_POST["exclude_categories_list"],
34
- 'SE4_exclude_posts' => $_POST["exclude_posts"],
35
- 'SE4_exclude_posts_list' => $_POST["exclude_posts_list"],
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"],
43
- 'SE4_use_draft_search' => $_POST["search_drafts"],
44
- 'SE4_use_attachment_search' => $_POST["search_attachments"],
45
- 'SE4_use_metadata_search' => $_POST["search_metadata"]
 
 
46
  );
47
 
48
- update_option("search_tag", $_POST["SE4_use_tag_search"]);
49
- update_option("SE4_options", $new_options);
50
 
51
  }
52
 
53
- $options = get_option('SE4_options');
54
  $search_tag = get_option('search_tag');
55
 
56
  ?>
@@ -67,54 +69,54 @@ Class SearchEverythingAdmin {
67
  <td>
68
  <form method="post">
69
  <legend><?php _e('Search Options Form', 'SearchEverything'); ?></legend>
70
- <p><input type="checkbox" id="exclude_posts" name="exclude_posts" value="true" <?php if($options['SE4_exclude_posts'] == 'true') { echo 'checked="true"'; } ?> />
71
  <label for="exclude_posts"><?php _e('Exclude some post or page IDs','SearchEverything'); ?></label><br />
72
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="exclude_posts_list" class="SE_text_label"><?php _e('Comma separated Post IDs (example: 1, 5, 9)','SearchEverything'); ?></label><br />
73
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" size="50" class="SE_text_input" id="exclude_posts_list" name="exclude_posts_list" value="<?php echo $options['SE4_exclude_posts_list'];?>" /></p>
74
 
75
- <p><input type="checkbox" id="exclude_categories" name="exclude_categories" value="true" <?php if($options['SE4_exclude_categories'] == 'true') { echo 'checked="true"'; } ?> />
76
  <label for="exclude_categories"><?php _e('Exclude Categories','SearchEverything'); ?></label><br />
77
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="exclude_categories_list" class="SE_text_label"><?php _e('Comma separated category IDs (example: 1, 4)','SearchEverything'); ?></label><br />
78
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" size="50" class="SE_text_input" id="exclude_categories_list" name="exclude_categories_list" value="<?php echo $options['SE4_exclude_categories_list'];?>" /></p>
79
 
80
- <p><input type="checkbox" id="search_pages" name="search_pages" value="true" <?php if($options['SE4_use_page_search'] == 'true') { echo 'checked="true"'; } ?> />
81
  <label for="search_pages"><?php _e('Search every page (non-password protected)','SearchEverything'); ?></label></p>
82
- <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" class="SE_text_input" id="appvd_pages" name="appvd_pages" value="true" <?php if($options['SE4_approved_pages_only'] == 'true') { echo 'checked="true"'; } ?>
83
  <label for="appvd_pages"><?php _e('Search approved pages only?','SearchEverything'); ?></label></p>
84
 
85
  <?php
86
  // Show tags only for WP 2.3+
87
  If ($wp_version >= '2.3') { ?>
88
- <p><input type="checkbox" id="search_tags" name="search_tags" value="true" <?php if($options['SE4_use_tag_search'] == 'true') { echo 'checked="true"'; } ?> />
89
  <label for="search_tags"><?php _e('Search every tag name','SearchEverything'); ?></label></p>
90
  <?php } ?>
91
 
92
  <?php
93
  // Show categories only for WP 2.5+
94
  If ($wp_version >= '2.5') { ?>
95
- <p><input type="checkbox" id="search_categories" name="search_categories" value="true" <?php if($options['SE4_use_category_search'] == 'true') { echo 'checked="true"'; } ?> />
96
  <label for="search_categories"><?php _e('Search every category name','SearchEverything'); ?></label></p>
97
  <?php } ?>
98
 
99
- <p><input type="checkbox" id="search_comments" name="search_comments" value="true" <?php if($options['SE4_use_comment_search'] == 'true') { echo 'checked="true"'; } ?> />
100
  <label for="search_comments"><?php _e('Search every comment','SearchEverything'); ?></label></p>
101
 
102
- <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" class="SE_text_input" id="appvd_comments" name="appvd_comments" value="true" <?php if($options['SE4_approved_comments_only'] == 'true') { echo 'checked="true"'; } ?> />
103
  <label for="appvd_comments"><?php _e('Search approved comments only?','SearchEverything'); ?></label></p>
104
 
105
- <p><input type="checkbox" id="search_excerpt" name="search_excerpt" value="true" <?php if($options['SE4_use_excerpt_search'] == 'true') { echo 'checked="true"'; } ?> />
106
  <label for="search_excerpt"><?php _e('Search every excerpt','SearchEverything'); ?></label></p>
107
  <?php
108
  // Show drafts only for WP 2.3+
109
  If ($wp_version < '2.5') { ?>
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
  <?php } ?>
113
- <p><input type="checkbox" id="search_attachments" name="search_attachments" value="true" <?php if($options['SE4_use_attachment_search'] == 'true') { echo 'checked="true"'; } ?> />
114
  <label for="search_attachments"><?php _e('Search every attachment','SearchEverything'); ?></label></p>
115
- <p><input type="checkbox" id="search_authors" name="search_authors" value="true" <?php if($options['SE4_use_authors'] == 'true') { echo 'checked="true"'; } ?> />
116
  <label for="search_authors"><?php _e('Search every author','SearchEverything'); ?></label></p>
117
- <p><input type="checkbox" id="search_metadata" name="search_metadata" value="true" <?php if($options['SE4_use_metadata_search'] == 'true') { echo 'checked="true"'; } ?> />
118
  <label for="search_metadata"><?php _e('Search every custom field (metadata)','SearchEverything'); ?></label></p>
119
 
120
  </td>
@@ -139,7 +141,7 @@ Class SearchEverythingAdmin {
139
  <form method="get" id="searchform" action="<?php bloginfo('home'); ?>"><p class="srch submit">
140
  <label for="s"><?php _e('Enter search terms', 'SearchEverything'); ?><br /></label>
141
  <input type="text" class="srch-txt" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" size="30" />
142
- <input type="submit" class="SE4_btn" id="searchsubmit" value="<?php _e('Run Test Search', 'SearchEverything'); ?>" /></p>
143
  </form>
144
  </td>
145
  </tr>
@@ -164,7 +166,7 @@ Class SearchEverythingAdmin {
164
  <li><a href="http://www.reaper-x.com/">Reaper</a></li>
165
  <li><a href="http://beyn.org/">Barış Ünver</a> (localization support)</li>
166
  <li><a href="http://www.alohastone.com">alohastone</a> (localization support)</li>
167
- <li><a href="http://www.fratelliditalia.eu">Domiziano Galia</a></li>
168
  <li><a href="http://meandmymac.net">Arnan de Gans</a> (Options panel)</li>
169
  <li>Uli Iserloh</li>
170
  </ul>
@@ -192,16 +194,16 @@ Class SearchEverythingAdmin {
192
  </div>
193
 
194
  <?php
195
- } //end SE4_option_page
196
 
197
  //styling options page
198
- function SE4_options_style() {
199
  ?>
200
  <style type="text/css" media="screen">
201
- div.SE4 p.submit, div.SE4 form p.submit, div.SE4 p.submit input { text-align:left; }
202
- #SE4_options_panel p.submit { text-align:left; }
203
  form#searchform label, form#searchform input, form#SE_form label, form#SE_form input { margin-left:10px; }
204
- input.SE4_btn { cursor:pointer; margin-left:5px; }
205
  p.srch { margin:0; margin-bottom:20px; }
206
  p.submit input.srch-txt { background-color:#f4f4f4; background-image:none; border:1px solid #999; padding:6px; }
207
  p.submit input.srch-txt:focus, p.submit input.srch-txt:active { background-color:#fff; background-image:none; border:1px solid #111; padding:6px; }
2
 
3
  Class SearchEverythingAdmin {
4
 
5
+ var $version = '5';
6
 
7
  function SearchEverythingAdmin() {
8
 
12
  load_textdomain('SearchEverything', SE_ABSPATH .'lang/SE4-'.$locale.'.mo');
13
 
14
 
15
+ add_action('admin_head', array(&$this, 'SE5_options_style'));
16
+ add_action('admin_menu', array(&$this, 'SE5_add_options_panel'));
17
 
18
  }
19
 
20
+ function SE5_add_options_panel() {
21
+ add_options_page('Search', 'Search Everything', 7, 'manage_search', array(&$this, 'SE5_option_page'));
22
  }
23
 
24
  //build admin interface
25
+ function SE5_option_page() {
26
  global $wpdb, $table_prefix, $wp_version;
27
 
28
  if($_POST['action'] == "save") {
29
  echo "<div class=\"updated fade\" id=\"limitcatsupdatenotice\"><p>" . __("Search Everything Options <strong>Updated</strong>.") . "</p></div>";
30
 
31
  $new_options = array(
32
+ 'SE5_exclude_categories' => $_POST["exclude_categories"],
33
+ 'SE5_exclude_categories_list' => $_POST["exclude_categories_list"],
34
+ 'SE5_exclude_posts' => $_POST["exclude_posts"],
35
+ 'SE5_exclude_posts_list' => $_POST["exclude_posts_list"],
36
+ 'SE5_use_page_search' => $_POST["search_pages"],
37
+ 'SE5_use_comment_search' => $_POST["search_comments"],
38
+ 'SE5_use_tag_search' => $_POST["search_tags"],
39
+ 'SE5_use_category_search' => $_POST["search_categories"],
40
+ 'SE5_approved_comments_only' => $_POST["appvd_comments"],
41
+ 'SE5_approved_pages_only' => $_POST["appvd_pages"],
42
+ 'SE5_use_excerpt_search' => $_POST["search_excerpt"],
43
+ 'SE5_use_draft_search' => $_POST["search_drafts"],
44
+ 'SE5_use_attachment_search' => $_POST["search_attachments"],
45
+ 'SE5_use_authors' => $_POST['search_authors'],
46
+ 'SE5_use_metadata_search' => $_POST["search_metadata"]
47
+
48
  );
49
 
50
+ update_option("search_tag", $_POST["SE5_use_tag_search"]);
51
+ update_option("SE5_options", $new_options);
52
 
53
  }
54
 
55
+ $options = get_option('SE5_options');
56
  $search_tag = get_option('search_tag');
57
 
58
  ?>
69
  <td>
70
  <form method="post">
71
  <legend><?php _e('Search Options Form', 'SearchEverything'); ?></legend>
72
+ <p><input type="checkbox" id="exclude_posts" name="exclude_posts" value="true" <?php if($options['SE5_exclude_posts'] == 'true') { echo 'checked="true"'; } ?> />
73
  <label for="exclude_posts"><?php _e('Exclude some post or page IDs','SearchEverything'); ?></label><br />
74
  &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 />
75
+ &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['SE5_exclude_posts_list'];?>" /></p>
76
 
77
+ <p><input type="checkbox" id="exclude_categories" name="exclude_categories" value="true" <?php if($options['SE5_exclude_categories'] == 'true') { echo 'checked="true"'; } ?> />
78
  <label for="exclude_categories"><?php _e('Exclude Categories','SearchEverything'); ?></label><br />
79
  &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 />
80
+ &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['SE5_exclude_categories_list'];?>" /></p>
81
 
82
+ <p><input type="checkbox" id="search_pages" name="search_pages" value="true" <?php if($options['SE5_use_page_search'] == 'true') { echo 'checked="true"'; } ?> />
83
  <label for="search_pages"><?php _e('Search every page (non-password protected)','SearchEverything'); ?></label></p>
84
+ <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" class="SE_text_input" id="appvd_pages" name="appvd_pages" value="true" <?php if($options['SE5_approved_pages_only'] == 'true') { echo 'checked="true"'; } ?>
85
  <label for="appvd_pages"><?php _e('Search approved pages only?','SearchEverything'); ?></label></p>
86
 
87
  <?php
88
  // Show tags only for WP 2.3+
89
  If ($wp_version >= '2.3') { ?>
90
+ <p><input type="checkbox" id="search_tags" name="search_tags" value="true" <?php if($options['SE5_use_tag_search'] == 'true') { echo 'checked="true"'; } ?> />
91
  <label for="search_tags"><?php _e('Search every tag name','SearchEverything'); ?></label></p>
92
  <?php } ?>
93
 
94
  <?php
95
  // Show categories only for WP 2.5+
96
  If ($wp_version >= '2.5') { ?>
97
+ <p><input type="checkbox" id="search_categories" name="search_categories" value="true" <?php if($options['SE5_use_category_search'] == 'true') { echo 'checked="true"'; } ?> />
98
  <label for="search_categories"><?php _e('Search every category name','SearchEverything'); ?></label></p>
99
  <?php } ?>
100
 
101
+ <p><input type="checkbox" id="search_comments" name="search_comments" value="true" <?php if($options['SE5_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['SE5_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['SE5_use_excerpt_search'] == 'true') { echo 'checked="true"'; } ?> />
108
  <label for="search_excerpt"><?php _e('Search every excerpt','SearchEverything'); ?></label></p>
109
  <?php
110
  // Show drafts only for WP 2.3+
111
  If ($wp_version < '2.5') { ?>
112
+ <p><input type="checkbox" id="search_drafts" name="search_drafts" value="true" <?php if($options['SE5_use_draft_search'] == 'true') { echo 'checked="true"'; } ?> />
113
  <label for="search_drafts"><?php _e('Search every draft','SearchEverything'); ?></label></p>
114
  <?php } ?>
115
+ <p><input type="checkbox" id="search_attachments" name="search_attachments" value="true" <?php if($options['SE5_use_attachment_search'] == 'true') { echo 'checked="true"'; } ?> />
116
  <label for="search_attachments"><?php _e('Search every attachment','SearchEverything'); ?></label></p>
117
+ <p><input type="checkbox" id="search_authors" name="search_authors" value="true" <?php if($options['SE5_use_authors'] == 'true') { echo 'checked="true"'; } ?> />
118
  <label for="search_authors"><?php _e('Search every author','SearchEverything'); ?></label></p>
119
+ <p><input type="checkbox" id="search_metadata" name="search_metadata" value="true" <?php if($options['SE5_use_metadata_search'] == 'true') { echo 'checked="true"'; } ?> />
120
  <label for="search_metadata"><?php _e('Search every custom field (metadata)','SearchEverything'); ?></label></p>
121
 
122
  </td>
141
  <form method="get" id="searchform" action="<?php bloginfo('home'); ?>"><p class="srch submit">
142
  <label for="s"><?php _e('Enter search terms', 'SearchEverything'); ?><br /></label>
143
  <input type="text" class="srch-txt" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" size="30" />
144
+ <input type="submit" class="SE5_btn" id="searchsubmit" value="<?php _e('Run Test Search', 'SearchEverything'); ?>" /></p>
145
  </form>
146
  </td>
147
  </tr>
166
  <li><a href="http://www.reaper-x.com/">Reaper</a></li>
167
  <li><a href="http://beyn.org/">Barış Ünver</a> (localization support)</li>
168
  <li><a href="http://www.alohastone.com">alohastone</a> (localization support)</li>
169
+ <li><a href="http://cinelover.wordpress.com/">Emanuel Righetto</a></li>
170
  <li><a href="http://meandmymac.net">Arnan de Gans</a> (Options panel)</li>
171
  <li>Uli Iserloh</li>
172
  </ul>
194
  </div>
195
 
196
  <?php
197
+ } //end SE5_option_page
198
 
199
  //styling options page
200
+ function SE5_options_style() {
201
  ?>
202
  <style type="text/css" media="screen">
203
+ div.SE5 p.submit, div.SE5 form p.submit, div.SE5 p.submit input { text-align:left; }
204
+ #SE5_options_panel p.submit { text-align:left; }
205
  form#searchform label, form#searchform input, form#SE_form label, form#SE_form input { margin-left:10px; }
206
+ input.SE5_btn { cursor:pointer; margin-left:5px; }
207
  p.srch { margin:0; margin-bottom:20px; }
208
  p.submit input.srch-txt { background-color:#f4f4f4; background-image:none; border:1px solid #999; padding:6px; }
209
  p.submit input.srch-txt:focus, p.submit input.srch-txt:active { background-color:#fff; background-image:none; border:1px solid #111; padding:6px; }
lang/SE4-hu_HU.po CHANGED
@@ -2,112 +2,116 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Search Everything magyar fordítás\n"
4
  "POT-Creation-Date: \n"
5
- "PO-Revision-Date: 2008-08-07 15:25+0100\n"
6
  "Last-Translator: János Csárdi-Braunstein <csardijanos@gmail.com>\n"
7
  "Language-Team: János Csárdi-Braunstein <csardijanos@gmail.com>\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "X-Poedit-KeywordsList: __;_e\n"
12
- "X-Poedit-Basepath: C:\\Dokumente und Einstellungen\\AlohaStone\\Eigene Dateien\\Eigene Websites\\ver 2.3\\wordpress\\wp-content\\plugins\\\n"
13
  "X-Poedit-Language: Hungarian\n"
14
  "X-Poedit-Country: HUNGARY\n"
15
  "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-SearchPath-0: search-everything\n"
17
 
18
- #: search-everything/SE-Admin.php:29
19
  msgid "Search Everything Options <strong>Updated</strong>."
20
  msgstr "Search Everything beállításai <strong>mentve</strong>."
21
 
22
- #: search-everything/SE-Admin.php:59
23
- msgid "The options selected below will be used in every search query on this site; in addition to the built-in post search."
24
- msgstr "Amiket itt beállítasz, minden az oldaladon történő keresésre hatással van (persze csak akkor, ha a Wordpress keresőjével keresel, külső keresőkre nincs hatása, pl. Google). Használd a lenti kereső mezőt a beállítások kipróbálásához."
25
-
26
- #: search-everything/SE-Admin.php:63
27
- msgid "SE Search Options"
28
- msgstr "SE keresési opciók"
29
-
30
- #: search-everything/SE-Admin.php:64
31
  msgid "Use this form to configure your search options."
32
  msgstr "Használd ezt az oldalt a keresés beállításához"
33
 
34
- #: search-everything/SE-Admin.php:67
 
 
 
 
35
  msgid "Search Options Form"
36
  msgstr "Keresési beállítások"
37
 
38
- #: search-everything/SE-Admin.php:69
39
  msgid "Exclude some post or page IDs"
40
  msgstr "Néhány oldal vagy bejegyzés kihagyása a keresésből"
41
 
42
- #: search-everything/SE-Admin.php:70
43
  msgid "Comma separated Post IDs (example: 1, 5, 9)"
44
  msgstr "Írd be vesszővel azoknak az oldalaknak, vagy bejegyzéseknek az azonosítóját, amiken nem szeretnél keresni (pl. 1, 4, 5)"
45
 
46
- #: search-everything/SE-Admin.php:75
47
  msgid "Exclude Categories"
48
  msgstr "Kihagyni kívánt kategóriák"
49
 
50
- #: search-everything/SE-Admin.php:76
51
  msgid "Comma separated category IDs (example: 1, 4)"
52
  msgstr "Írd be vesszővel azoknak a kategóriáknak az azonosítóját, amiken nem szeretnél keresni (pl. 1, 5)"
53
 
54
- #: search-everything/SE-Admin.php:81
55
  msgid "Search every page (non-password protected)"
56
  msgstr "Keresés minden oldalon (nem jelszó védetteken)"
57
 
58
- #: search-everything/SE-Admin.php:83
59
  msgid "Search approved pages only?"
60
  msgstr "Csak a közzétett oldalak között?"
61
 
62
- #: search-everything/SE-Admin.php:89
63
- msgid "Search every tag"
64
- msgstr "Keresés minden cimke között"
65
 
66
- #: search-everything/SE-Admin.php:94
 
 
 
 
67
  msgid "Search every comment"
68
  msgstr "Keresés minden hozzászólás között"
69
 
70
- #: search-everything/SE-Admin.php:97
71
  msgid "Search approved comments only?"
72
  msgstr "Csak az elfogadott hozzászólások között?"
73
 
74
- #: search-everything/SE-Admin.php:100
75
  msgid "Search every excerpt"
76
  msgstr "Keresés minden kivonat között"
77
 
78
- #: search-everything/SE-Admin.php:103
79
  msgid "Search every draft"
80
  msgstr "Keresés minden piszkozat között"
81
 
82
- #: search-everything/SE-Admin.php:106
83
  msgid "Search every attachment"
84
  msgstr "Keresés minden feltöltött fájl között"
85
 
86
- #: search-everything/SE-Admin.php:109
 
 
 
 
87
  msgid "Search every custom field (metadata)"
88
  msgstr "Keresés minden saját mező között (metadata)"
89
 
90
- #: search-everything/SE-Admin.php:115
91
  msgid "Update Options"
92
  msgstr "Beállítások mentése"
93
 
94
- #: search-everything/SE-Admin.php:121
95
  msgid "SE Search Form"
96
  msgstr "SE keresés"
97
 
98
- #: search-everything/SE-Admin.php:122
99
  msgid "Use this search form to run a live search test."
100
  msgstr "Használd ezt a keresőt az keresős kipróbálásához"
101
 
102
- #: search-everything/SE-Admin.php:125
103
  msgid "Site Search"
104
  msgstr "Keresés az oldalon"
105
 
106
- #: search-everything/SE-Admin.php:127
107
  msgid "Enter search terms"
108
  msgstr "Írd be amire keresni szeretnél"
109
 
110
- #: search-everything/SE-Admin.php:129
111
  msgid "Run Test Search"
112
  msgstr "Keresés"
113
 
2
  msgstr ""
3
  "Project-Id-Version: Search Everything magyar fordítás\n"
4
  "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: 2008-12-20 10:38+0100\n"
6
  "Last-Translator: János Csárdi-Braunstein <csardijanos@gmail.com>\n"
7
  "Language-Team: János Csárdi-Braunstein <csardijanos@gmail.com>\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "X-Poedit-KeywordsList: __;_e\n"
12
+ "X-Poedit-Basepath: .\n"
13
  "X-Poedit-Language: Hungarian\n"
14
  "X-Poedit-Country: HUNGARY\n"
15
  "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
 
18
+ #: ../SE-Admin.php:29
19
  msgid "Search Everything Options <strong>Updated</strong>."
20
  msgstr "Search Everything beállításai <strong>mentve</strong>."
21
 
22
+ #: ../SE-Admin.php:63
 
 
 
 
 
 
 
 
23
  msgid "Use this form to configure your search options."
24
  msgstr "Használd ezt az oldalt a keresés beállításához"
25
 
26
+ #: ../SE-Admin.php:64
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 "Amiket itt beállítasz, minden az oldaladon történő keresésre hatással van (persze csak akkor, ha a Wordpress keresőjével keresel, külső keresőkre nincs hatása, pl. Google). Használd a lenti kereső mezőt a beállítások kipróbálásához."
29
+
30
+ #: ../SE-Admin.php:69
31
  msgid "Search Options Form"
32
  msgstr "Keresési beállítások"
33
 
34
+ #: ../SE-Admin.php:71
35
  msgid "Exclude some post or page IDs"
36
  msgstr "Néhány oldal vagy bejegyzés kihagyása a keresésből"
37
 
38
+ #: ../SE-Admin.php:72
39
  msgid "Comma separated Post IDs (example: 1, 5, 9)"
40
  msgstr "Írd be vesszővel azoknak az oldalaknak, vagy bejegyzéseknek az azonosítóját, amiken nem szeretnél keresni (pl. 1, 4, 5)"
41
 
42
+ #: ../SE-Admin.php:76
43
  msgid "Exclude Categories"
44
  msgstr "Kihagyni kívánt kategóriák"
45
 
46
+ #: ../SE-Admin.php:77
47
  msgid "Comma separated category IDs (example: 1, 4)"
48
  msgstr "Írd be vesszővel azoknak a kategóriáknak az azonosítóját, amiken nem szeretnél keresni (pl. 1, 5)"
49
 
50
+ #: ../SE-Admin.php:81
51
  msgid "Search every page (non-password protected)"
52
  msgstr "Keresés minden oldalon (nem jelszó védetteken)"
53
 
54
+ #: ../SE-Admin.php:83
55
  msgid "Search approved pages only?"
56
  msgstr "Csak a közzétett oldalak között?"
57
 
58
+ #: ../SE-Admin.php:89
59
+ msgid "Search every tag name"
60
+ msgstr "Keresés minden címke között"
61
 
62
+ #: ../SE-Admin.php:96
63
+ msgid "Search every category name"
64
+ msgstr "Keresés minden kategória között"
65
+
66
+ #: ../SE-Admin.php:100
67
  msgid "Search every comment"
68
  msgstr "Keresés minden hozzászólás között"
69
 
70
+ #: ../SE-Admin.php:103
71
  msgid "Search approved comments only?"
72
  msgstr "Csak az elfogadott hozzászólások között?"
73
 
74
+ #: ../SE-Admin.php:106
75
  msgid "Search every excerpt"
76
  msgstr "Keresés minden kivonat között"
77
 
78
+ #: ../SE-Admin.php:111
79
  msgid "Search every draft"
80
  msgstr "Keresés minden piszkozat között"
81
 
82
+ #: ../SE-Admin.php:114
83
  msgid "Search every attachment"
84
  msgstr "Keresés minden feltöltött fájl között"
85
 
86
+ #: ../SE-Admin.php:116
87
+ msgid "Search every author"
88
+ msgstr "Keresés minden szerző között"
89
+
90
+ #: ../SE-Admin.php:118
91
  msgid "Search every custom field (metadata)"
92
  msgstr "Keresés minden saját mező között (metadata)"
93
 
94
+ #: ../SE-Admin.php:125
95
  msgid "Update Options"
96
  msgstr "Beállítások mentése"
97
 
98
+ #: ../SE-Admin.php:131
99
  msgid "SE Search Form"
100
  msgstr "SE keresés"
101
 
102
+ #: ../SE-Admin.php:134
103
  msgid "Use this search form to run a live search test."
104
  msgstr "Használd ezt a keresőt az keresős kipróbálásához"
105
 
106
+ #: ../SE-Admin.php:138
107
  msgid "Site Search"
108
  msgstr "Keresés az oldalon"
109
 
110
+ #: ../SE-Admin.php:140
111
  msgid "Enter search terms"
112
  msgstr "Írd be amire keresni szeretnél"
113
 
114
+ #: ../SE-Admin.php:142
115
  msgid "Run Test Search"
116
  msgstr "Keresés"
117
 
readme-JAPANESE.txt CHANGED
@@ -36,7 +36,7 @@ Translation by Naoko McCracken http://detlog.org/
36
  | search_everything.php
37
  | SE-Admin.php
38
  - lang
39
- | SE4-ja.mo
40
 
41
  2. プラグイン管理画面にログインし、「Search Everything」を有効化します。
42
 
36
  | search_everything.php
37
  | SE-Admin.php
38
  - lang
39
+ | SE5-ja.mo
40
 
41
  2. プラグイン管理画面にログインし、「Search Everything」を有効化します。
42
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Plugin Name ===
2
  Contributors: dancameron
3
- Donate link: http://sproutventure.com
4
  Tags: search, tag search, category search, category exclusion, comment search, page search, admin, seo
5
  Requires at least: 2.1
6
- Tested up to: 2.6.3
7
- Stable tag: 4.7.8
8
 
9
  Increases Wordpress' default search functionality through an options panel. Options include searching pages, excerpts, attachments, drafts, comments and custom fields (metadata).
10
 
@@ -30,6 +30,7 @@ Search Everything increases the ability of the default Wordpress Search, options
30
 
31
  == Update Log ==
32
 
 
33
  *4.7.7 - New conditions to fix plugin from breaking with certain option selections. props Matias Gertel
34
  *4.7.6.2 - Bug fix, some people returning no results. Matching release number with WP version.
35
  *4.7.5 - Post Revision Update for Wordpress 2.6 (necessary update for 2.6 users), removed future posts from results
@@ -46,7 +47,7 @@ Search Everything increases the ability of the default Wordpress Search, options
46
  * 4.0.1 - Bug fix~Extraneous 's' in options panel
47
  * 4.0.0 - Wordpress 2.3 Support, Password protected pages option, Overhaul of Admin area
48
 
49
- [SVN Browser](http://searcheverything.scatter3d.com:3000/browser "Project Home and SVN Browser")
50
 
51
  == Installation ==
52
 
@@ -68,7 +69,7 @@ Read the installation guide.
68
 
69
  = It *still* doesn't work =
70
 
71
- Open up a thread in the support forums tagged 'searcheverything' and 'dancameron'.
72
 
73
 
74
  == Screenshots ==
@@ -82,5 +83,5 @@ I do need help with this plugin. If you can possibly do my day job and take my g
82
 
83
  == Support ==
84
 
85
- Create a new topic in the forums with 'searcheverything' and 'dancameron' as the tag for your support related questions.
86
 
1
  === Plugin Name ===
2
  Contributors: dancameron
3
+ Donate link: http://www.amazon.com/
4
  Tags: search, tag search, category search, category exclusion, comment search, page search, admin, seo
5
  Requires at least: 2.1
6
+ Tested up to: 2.7
7
+ Stable tag: 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
 
30
 
31
  == Update Log ==
32
 
33
+ *5 - Bug Release, Extend Author Search to comments (props to Joshua Bettigole), Tag Fix, Meta Fix
34
  *4.7.7 - New conditions to fix plugin from breaking with certain option selections. props Matias Gertel
35
  *4.7.6.2 - Bug fix, some people returning no results. Matching release number with WP version.
36
  *4.7.5 - Post Revision Update for Wordpress 2.6 (necessary update for 2.6 users), removed future posts from results
47
  * 4.0.1 - Bug fix~Extraneous 's' in options panel
48
  * 4.0.0 - Wordpress 2.3 Support, Password protected pages option, Overhaul of Admin area
49
 
50
+ [SVN Browser](https://redmine.sproutventure.com/projects/show/search-everything "Project Home and SVN Browser")
51
 
52
  == Installation ==
53
 
69
 
70
  = It *still* doesn't work =
71
 
72
+ [Support Forums and Project Center](https://redmine.sproutventure.com/projects/show/search-everything "Support Forums and Project Center")
73
 
74
 
75
  == Screenshots ==
83
 
84
  == Support ==
85
 
86
+ [Support Forums and Project Center](https://redmine.sproutventure.com/projects/show/search-everything "Support Forums and Project Center")
87
 
search_everything.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Search Everything
4
  Plugin URI: http://dancameron.org/wordpress/
5
  Description: Adds search functionality with little setup. Including options to search pages, excerpts, attachments, drafts, comments, tags and custom fields (metadata). Also offers the ability to exclude specific pages and posts. Does not search password-protected content.
6
- Version: 4.7.8
7
  Author: Dan Cameron
8
  Author URI: http://dancameron.org/
9
  */
@@ -32,86 +32,85 @@ Class SearchEverything {
32
  global $wp_version;
33
  $this->wp_ver23 = ($wp_version >= '2.3');
34
  $this->wp_ver25 = ($wp_version >= '2.5');
35
- $this->options = get_option('SE4_options');
36
 
37
  if (is_admin()) {
38
  include ( SE_ABSPATH . 'SE-Admin.php' );
39
  $SEAdmin = new SearchEverythingAdmin();
40
  }
41
-
42
  //add filters based upon option settings
43
- if ("true" == $this->options['SE4_use_tag_search']) {
44
- add_filter('posts_where', array(&$this, 'SE4_search_tags'));
45
- add_filter('posts_join', array(&$this, 'SE4_terms_join'));
46
- $this->SE4_log("searching tags");
47
  }
48
 
49
- if ("true" == $this->options['SE4_use_category_search']) {
50
- add_filter('posts_where', array(&$this, 'SE4_search_categories'));
51
- add_filter('posts_join', array(&$this, 'SE4_terms_join'));
52
- $this->SE4_log("searching categories");
53
  }
54
 
55
- if ("true" == $this->options['SE4_use_page_search']) {
56
- add_filter('posts_where', array(&$this, 'SE4_search_pages'));
57
- $this->SE4_log("searching pages");
58
  }
59
 
60
- if ("true" == $this->options['SE4_use_excerpt_search']) {
61
- add_filter('posts_where', array(&$this, 'SE4_search_excerpt'));
62
- $this->SE4_log("searching excerpts");
63
  }
64
 
65
- if ("true" == $this->options['SE4_use_comment_search']) {
66
- add_filter('posts_where', array(&$this, 'SE4_search_comments'));
67
- add_filter('posts_join', array(&$this, 'SE4_comments_join'));
68
- $this->SE4_log("searching comments");
69
  }
70
 
71
- if ("true" == $this->options['SE4_use_draft_search']) {
72
- add_filter('posts_where', array(&$this, 'SE4_search_draft_posts'));
73
- $this->SE4_log("searching drafts");
74
  }
75
 
76
- if ("true" == $this->options['SE4_use_attachment_search']) {
77
- add_filter('posts_where', array(&$this, 'SE4_search_attachments'));
78
- $this->SE4_log("searching attachments");
79
  }
80
 
81
- if ("true" == $this->options['SE4_use_metadata_search']) {
82
- add_filter('posts_where', array(&$this, 'SE4_search_metadata'));
83
- add_filter('posts_join', array(&$this, 'SE4_search_metadata_join'));
84
- $this->SE4_log("searching metadata");
85
  }
86
 
87
- if ("true" == $this->options['SE4_exclude_posts']) {
88
- add_filter('posts_where', array(&$this, 'SE4_exclude_posts'));
89
- $this->SE4_log("searching excluding posts");
90
  }
91
 
92
- if ("true" == $this->options['SE4_exclude_categories']) {
93
- add_filter('posts_where', array(&$this, 'SE4_exclude_categories'));
94
- add_filter('posts_join', array(&$this, 'SE4_exclude_categories_join'));
95
- $this->SE4_log("searching excluding categories");
96
  }
97
 
98
- if ("true" == $this->options['SE4_exclude_authors']) {
99
- add_filter('posts_where', array(&$this, 'SE4_search_authors'));
100
- add_filter('posts_join', array(&$this, 'SE4_search_authors_join'));
101
- $this->SE4_log("searching authors");
102
  }
103
 
104
  // Add registration of bo_revisions hook handler
105
  // right before the following line already existant
106
- add_filter('posts_where', array(&$this, 'SE4_no_revisions'));
107
 
108
 
109
  //Duplicate fix provided by Tiago.Pocinho
110
- add_filter('posts_request', array(&$this, 'SE4_distinct'));
111
  }
112
 
113
  // Exclude post revisions
114
- function SE4_no_revisions($where) {
115
  global $wp_query;
116
  if (!empty($wp_query->query_vars['s'])) {
117
  $where = 'AND (' . substr($where, strpos($where, 'AND')+3) . ') AND post_type != \'revision\'';
@@ -120,7 +119,7 @@ Class SearchEverything {
120
  }
121
 
122
  // Logs search into a file
123
- function SE4_log($msg) {
124
 
125
  if ($this->logging) {
126
  $fp = fopen("logfile.log","a+");
@@ -134,7 +133,7 @@ Class SearchEverything {
134
  }
135
 
136
  //Duplicate fix provided by Tiago.Pocinho
137
- function SE4_distinct($query){
138
  global $wp_query;
139
  if (!empty($wp_query->query_vars['s'])) {
140
  if (strstr($where, 'DISTINCT')) {
@@ -145,26 +144,26 @@ Class SearchEverything {
145
  return $query;
146
  }
147
 
148
- function SE4_exclude_posts($where) {
149
  global $wp_query;
150
  if (!empty($wp_query->query_vars['s'])) {
151
- $excl_list = implode(',', explode(',', trim($this->options['SE4_exclude_posts_list'])));
152
  $where = str_replace('"', '\'', $where);
153
  $where = 'AND ('.substr($where, strpos($where, 'AND')+3).' )';
154
  $where .= ' AND (ID NOT IN ( '.$excl_list.' ))';
155
  }
156
 
157
- $this->SE4_log("ex posts where: ".$where);
158
  return $where;
159
  }
160
 
161
  //search pages (except password protected pages provided by loops)
162
- function SE4_search_pages($where) {
163
  global $wp_query;
164
  if (!empty($wp_query->query_vars['s'])) {
165
 
166
  $where = str_replace('"', '\'', $where);
167
- if ('true' == $this->options['SE4_approved_pages_only']) {
168
  $where = str_replace('post_type = \'post\' AND ', 'post_password = \'\' AND ', $where);
169
  }
170
  else { // < v 2.1
@@ -172,12 +171,12 @@ Class SearchEverything {
172
  }
173
  }
174
 
175
- $this->SE4_log("pages where: ".$where);
176
  return $where;
177
  }
178
 
179
  //search excerpts provided by Dennis Turner, fixed by GvA
180
- function SE4_search_excerpt($where) {
181
  global $wp_query;
182
  if (!empty($wp_query->query_vars['s'])) {
183
  $where = str_replace('"', '\'', $where);
@@ -187,25 +186,25 @@ Class SearchEverything {
187
  $wp_query->query_vars['s'] . '%\'', $where);
188
  }
189
 
190
- $this->SE4_log("excerpts where: ".$where);
191
  return $where;
192
  }
193
 
194
 
195
  //search drafts
196
- function SE4_search_draft_posts($where) {
197
  global $wp_query;
198
  if (!empty($wp_query->query_vars['s'])) {
199
  $where = str_replace('"', '\'', $where);
200
  $where = str_replace(' AND (post_status = \'publish\'', ' AND (post_status = \'publish\' or post_status = \'draft\'', $where);
201
  }
202
 
203
- $this->SE4_log("drafts where: ".$where);
204
  return $where;
205
  }
206
 
207
  //search attachments
208
- function SE4_search_attachments($where) {
209
  global $wp_query;
210
  if (!empty($wp_query->query_vars['s'])) {
211
  $where = str_replace('"', '\'', $where);
@@ -213,62 +212,64 @@ Class SearchEverything {
213
  $where = str_replace('AND post_status != \'attachment\'','',$where);
214
  }
215
 
216
- $this->SE4_log("attachments where: ".$where);
217
  return $where;
218
  }
219
 
220
  //search comments
221
- function SE4_search_comments($where) {
222
  global $wp_query, $wpdb;
223
  if (!empty($wp_query->query_vars['s'])) {
224
- if ('true' == $this->options['SE4_approved_comments_only']) {
225
  $comment_approved = " AND c.comment_approved = '1'";
226
  } else {
227
  $comment_approved = '';
228
  }
229
 
 
 
 
 
 
230
  if ($this->wp_ver23) {
231
- $or = " OR ( c.comment_post_ID = ".$wpdb->posts . ".ID " . $comment_approved . " AND c.comment_content LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
232
- $where = preg_replace("/\bor\b/i",$or." OR",$where,1);
233
- }
234
- }
235
 
236
- $this->SE4_log("comments where: ".$where);
 
 
 
237
 
238
  return $where;
239
  }
240
 
241
  //search metadata
242
- function SE4_search_metadata($where) {
243
  global $wp_query, $wpdb;
244
  if (!empty($wp_query->query_vars['s'])) {
245
  if ($this->wp_ver23)
246
- $or = " OR (m.meta_value LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
247
  else
248
- $or = " OR meta_value LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%' ";
249
  }
250
- $where = preg_replace("/\bor\b/i",$or." OR",$where,1);
251
- $this->SE4_log("metadata where: ".$where);
252
 
253
  return $where;
254
  }
255
 
256
  //search tags
257
- function SE4_search_tags($where) {
258
  global $wp_query, $wpdb;
259
  if (!empty($wp_query->query_vars['s'])) {
260
- //$where .= " OR ( tter.slug LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
261
- $or = " OR ( tter.name LIKE '%" . str_replace(' ', '-',$wpdb->escape($wp_query->query_vars['s'])) . "%') ";
262
- $where = preg_replace("/\bor\b/i",$or." OR",$where,1);
263
  }
264
 
265
- $this->SE4_log("tags where: ".$where);
266
 
267
  return $where;
268
  }
269
 
270
  //search categories
271
- function SE4_search_categories ( $where ) {
272
 
273
  global $wp_query, $wpdb;
274
 
@@ -277,18 +278,18 @@ Class SearchEverything {
277
  $where = preg_replace("/\bor\b/i",$or." OR",$where,1);
278
  }
279
 
280
- $this->SE4_log("categories where: ".$where);
281
 
282
  return $where;
283
 
284
  }
285
 
286
  //exlude some categories from search
287
- function SE4_exclude_categories($where) {
288
  global $wp_query, $wpdb;
289
  if (!empty($wp_query->query_vars['s'])) {
290
- if (trim($this->options['SE4_exclude_categories_list']) != '') {
291
- $excl_list = implode("','", explode(',', "'".trim($this->options['SE4_exclude_categories_list'])."'" ));
292
  $where = str_replace('"', '\'', $where);
293
  $where = 'AND ('.substr($where, strpos($where, 'AND')+3).' )';
294
  if ($this->wp_ver23)
@@ -298,12 +299,12 @@ Class SearchEverything {
298
  }
299
  }
300
 
301
- $this->SE4_log("ex cats where: ".$where);
302
  return $where;
303
  }
304
 
305
  //join for excluding categories - Deprecated in 2.3
306
- function SE4_exclude_categories_join($join) {
307
  global $wp_query, $wpdb;
308
 
309
  if (!empty($wp_query->query_vars['s'])) {
@@ -314,12 +315,12 @@ Class SearchEverything {
314
  $join .= "LEFT JOIN $wpdb->post2cat AS c ON $wpdb->posts.ID = c.post_id";
315
  }
316
  }
317
- $this->SE4_log("category join: ".$join);
318
  return $join;
319
  }
320
 
321
  //join for searching comments
322
- function SE4_comments_join($join) {
323
  global $wp_query, $wpdb;
324
 
325
  if (!empty($wp_query->query_vars['s'])) {
@@ -328,7 +329,7 @@ Class SearchEverything {
328
  $join .= " LEFT JOIN $wpdb->comments AS c ON ( comment_post_ID = ID " . $comment_approved . ") ";
329
  } else {
330
 
331
- if ('true' == $this->options['SE4_approved_comments_only']) {
332
  $comment_approved = " AND comment_approved = '1'";
333
  } else {
334
  $comment_approved = '';
@@ -339,38 +340,37 @@ Class SearchEverything {
339
  }
340
  }
341
 
342
- $this->SE4_log("comments join: ".$join);
343
  return $join;
344
  }
345
 
346
  //join for searching authors
347
- function SE4_search_authors($where) {
348
  global $wp_query, $wpdb;
 
349
  if (!empty($wp_query->query_vars['s'])) {
350
- $or = " OR (u.user_nicename LIKE '%" .
351
- $wpdb->escape($wp_query->query_vars['s']) . "%') ";
352
 
353
  }
354
  $where = preg_replace("/\bor\b/i",$or." OR",$where,1);
355
- $this->SE4_log("user where: ".$where);
356
 
357
  return $where;
358
  }
359
 
360
 
361
- function SE4_search_authors_join($join) {
362
  global $wp_query, $wpdb;
363
 
364
  if (!empty($wp_query->query_vars['s'])) {
365
- $join .= " LEFT JOIN $wpdb->users AS u ON
366
- ($wpdb->posts.post_author = u.ID) ";
367
 
368
  }
369
- $this->SE4_log("authors join: ".$join);
370
  return $join;
371
  }
372
  //join for searching metadata
373
- function SE4_search_metadata_join($join) {
374
  global $wp_query, $wpdb;
375
 
376
  if (!empty($wp_query->query_vars['s'])) {
@@ -380,23 +380,23 @@ $wpdb->escape($wp_query->query_vars['s']) . "%') ";
380
  else
381
  $join .= " LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id ";
382
  }
383
- $this->SE4_log("metadata join: ".$join);
384
  return $join;
385
  }
386
 
387
  //join for searching tags
388
- function SE4_terms_join($join) {
389
  global $wp_query, $wpdb;
390
 
391
  if (!empty($wp_query->query_vars['s'])) {
392
 
393
  // if we're searching for categories
394
- if ( $this->options['SE4_use_category_search'] ) {
395
  $on[] = "ttax.taxonomy = 'category'";
396
  }
397
 
398
  // if we're searching for tags
399
- if ( $this->options['SE4_use_tag_search'] ) {
400
  $on[] = "ttax.taxonomy = 'post_tag'";
401
  }
402
 
@@ -406,7 +406,7 @@ $wpdb->escape($wp_query->query_vars['s']) . "%') ";
406
  $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) ";
407
  }
408
 
409
- $this->SE4_log("tags join: ".$join);
410
  return $join;
411
  }
412
  }
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: 5
7
  Author: Dan Cameron
8
  Author URI: http://dancameron.org/
9
  */
32
  global $wp_version;
33
  $this->wp_ver23 = ($wp_version >= '2.3');
34
  $this->wp_ver25 = ($wp_version >= '2.5');
35
+ $this->options = get_option('SE5_options');
36
 
37
  if (is_admin()) {
38
  include ( SE_ABSPATH . 'SE-Admin.php' );
39
  $SEAdmin = new SearchEverythingAdmin();
40
  }
 
41
  //add filters based upon option settings
42
+ if ("true" == $this->options['SE5_use_tag_search']) {
43
+ add_filter('posts_where', array(&$this, 'SE5_search_tags'));
44
+ add_filter('posts_join', array(&$this, 'SE5_terms_join'));
45
+ $this->SE5_log("searching tags");
46
  }
47
 
48
+ if ("true" == $this->options['SE5_use_category_search']) {
49
+ add_filter('posts_where', array(&$this, 'SE5_search_categories'));
50
+ add_filter('posts_join', array(&$this, 'SE5_terms_join'));
51
+ $this->SE5_log("searching categories");
52
  }
53
 
54
+ if ("true" == $this->options['SE5_use_page_search']) {
55
+ add_filter('posts_where', array(&$this, 'SE5_search_pages'));
56
+ $this->SE5_log("searching pages");
57
  }
58
 
59
+ if ("true" == $this->options['SE5_use_excerpt_search']) {
60
+ add_filter('posts_where', array(&$this, 'SE5_search_excerpt'));
61
+ $this->SE5_log("searching excerpts");
62
  }
63
 
64
+ if ("true" == $this->options['SE5_use_comment_search']) {
65
+ add_filter('posts_where', array(&$this, 'SE5_search_comments'));
66
+ add_filter('posts_join', array(&$this, 'SE5_comments_join'));
67
+ $this->SE5_log("searching comments");
68
  }
69
 
70
+ if ("true" == $this->options['SE5_use_draft_search']) {
71
+ add_filter('posts_where', array(&$this, 'SE5_search_draft_posts'));
72
+ $this->SE5_log("searching drafts");
73
  }
74
 
75
+ if ("true" == $this->options['SE5_use_attachment_search']) {
76
+ add_filter('posts_where', array(&$this, 'SE5_search_attachments'));
77
+ $this->SE5_log("searching attachments");
78
  }
79
 
80
+ if ("true" == $this->options['SE5_use_metadata_search']) {
81
+ add_filter('posts_where', array(&$this, 'SE5_search_metadata'));
82
+ add_filter('posts_join', array(&$this, 'SE5_search_metadata_join'));
83
+ $this->SE5_log("searching metadata");
84
  }
85
 
86
+ if ("true" == $this->options['SE5_exclude_posts']) {
87
+ add_filter('posts_where', array(&$this, 'SE5_exclude_posts'));
88
+ $this->SE5_log("searching excluding posts");
89
  }
90
 
91
+ if ("true" == $this->options['SE5_exclude_categories']) {
92
+ add_filter('posts_where', array(&$this, 'SE5_exclude_categories'));
93
+ add_filter('posts_join', array(&$this, 'SE5_exclude_categories_join'));
94
+ $this->SE5_log("searching excluding categories");
95
  }
96
 
97
+ if ("true" == $this->options['SE5_use_authors']) {
98
+ add_filter('posts_where', array(&$this, 'SE5_search_authors'));
99
+ add_filter('posts_join', array(&$this, 'SE5_search_authors_join'));
100
+ $this->SE5_log("searching authors");
101
  }
102
 
103
  // Add registration of bo_revisions hook handler
104
  // right before the following line already existant
105
+ add_filter('posts_where', array(&$this, 'SE5_no_revisions'));
106
 
107
 
108
  //Duplicate fix provided by Tiago.Pocinho
109
+ add_filter('posts_request', array(&$this, 'SE5_distinct'));
110
  }
111
 
112
  // Exclude post revisions
113
+ function SE5_no_revisions($where) {
114
  global $wp_query;
115
  if (!empty($wp_query->query_vars['s'])) {
116
  $where = 'AND (' . substr($where, strpos($where, 'AND')+3) . ') AND post_type != \'revision\'';
119
  }
120
 
121
  // Logs search into a file
122
+ function SE5_log($msg) {
123
 
124
  if ($this->logging) {
125
  $fp = fopen("logfile.log","a+");
133
  }
134
 
135
  //Duplicate fix provided by Tiago.Pocinho
136
+ function SE5_distinct($query){
137
  global $wp_query;
138
  if (!empty($wp_query->query_vars['s'])) {
139
  if (strstr($where, 'DISTINCT')) {
144
  return $query;
145
  }
146
 
147
+ function SE5_exclude_posts($where) {
148
  global $wp_query;
149
  if (!empty($wp_query->query_vars['s'])) {
150
+ $excl_list = implode(',', explode(',', trim($this->options['SE5_exclude_posts_list'])));
151
  $where = str_replace('"', '\'', $where);
152
  $where = 'AND ('.substr($where, strpos($where, 'AND')+3).' )';
153
  $where .= ' AND (ID NOT IN ( '.$excl_list.' ))';
154
  }
155
 
156
+ $this->SE5_log("ex posts where: ".$where);
157
  return $where;
158
  }
159
 
160
  //search pages (except password protected pages provided by loops)
161
+ function SE5_search_pages($where) {
162
  global $wp_query;
163
  if (!empty($wp_query->query_vars['s'])) {
164
 
165
  $where = str_replace('"', '\'', $where);
166
+ if ('true' == $this->options['SE5_approved_pages_only']) {
167
  $where = str_replace('post_type = \'post\' AND ', 'post_password = \'\' AND ', $where);
168
  }
169
  else { // < v 2.1
171
  }
172
  }
173
 
174
+ $this->SE5_log("pages where: ".$where);
175
  return $where;
176
  }
177
 
178
  //search excerpts provided by Dennis Turner, fixed by GvA
179
+ function SE5_search_excerpt($where) {
180
  global $wp_query;
181
  if (!empty($wp_query->query_vars['s'])) {
182
  $where = str_replace('"', '\'', $where);
186
  $wp_query->query_vars['s'] . '%\'', $where);
187
  }
188
 
189
+ $this->SE5_log("excerpts where: ".$where);
190
  return $where;
191
  }
192
 
193
 
194
  //search drafts
195
+ function SE5_search_draft_posts($where) {
196
  global $wp_query;
197
  if (!empty($wp_query->query_vars['s'])) {
198
  $where = str_replace('"', '\'', $where);
199
  $where = str_replace(' AND (post_status = \'publish\'', ' AND (post_status = \'publish\' or post_status = \'draft\'', $where);
200
  }
201
 
202
+ $this->SE5_log("drafts where: ".$where);
203
  return $where;
204
  }
205
 
206
  //search attachments
207
+ function SE5_search_attachments($where) {
208
  global $wp_query;
209
  if (!empty($wp_query->query_vars['s'])) {
210
  $where = str_replace('"', '\'', $where);
212
  $where = str_replace('AND post_status != \'attachment\'','',$where);
213
  }
214
 
215
+ $this->SE5_log("attachments where: ".$where);
216
  return $where;
217
  }
218
 
219
  //search comments
220
+ function SE5_search_comments($where) {
221
  global $wp_query, $wpdb;
222
  if (!empty($wp_query->query_vars['s'])) {
223
+ if ('true' == $this->options['SE5_approved_comments_only']) {
224
  $comment_approved = " AND c.comment_approved = '1'";
225
  } else {
226
  $comment_approved = '';
227
  }
228
 
229
+ if($this->options['SE5_use_authors'] == 'true')
230
+ {
231
+ $comment_author = " OR c.comment_author LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%' ";
232
+ }
233
+
234
  if ($this->wp_ver23) {
235
+ $where .= " OR ( c.comment_post_ID = ".$wpdb->posts . ".ID " . $comment_approved . " AND c.comment_content LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
 
 
 
236
 
237
+
238
+ }
239
+ }
240
+ $this->SE5_log("comments where: ".$where);
241
 
242
  return $where;
243
  }
244
 
245
  //search metadata
246
+ function SE5_search_metadata($where) {
247
  global $wp_query, $wpdb;
248
  if (!empty($wp_query->query_vars['s'])) {
249
  if ($this->wp_ver23)
250
+ $where .= " OR (m.meta_value LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
251
  else
252
+ $where .= " OR meta_value LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%' ";
253
  }
254
+ $this->SE5_log("metadata where: ".$where);
 
255
 
256
  return $where;
257
  }
258
 
259
  //search tags
260
+ function SE5_search_tags($where) {
261
  global $wp_query, $wpdb;
262
  if (!empty($wp_query->query_vars['s'])) {
263
+ $where .= " OR ( tter.name LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
 
 
264
  }
265
 
266
+ $this->SE5_log("tags where: ".$where);
267
 
268
  return $where;
269
  }
270
 
271
  //search categories
272
+ function SE5_search_categories ( $where ) {
273
 
274
  global $wp_query, $wpdb;
275
 
278
  $where = preg_replace("/\bor\b/i",$or." OR",$where,1);
279
  }
280
 
281
+ $this->SE5_log("categories where: ".$where);
282
 
283
  return $where;
284
 
285
  }
286
 
287
  //exlude some categories from search
288
+ function SE5_exclude_categories($where) {
289
  global $wp_query, $wpdb;
290
  if (!empty($wp_query->query_vars['s'])) {
291
+ if (trim($this->options['SE5_exclude_categories_list']) != '') {
292
+ $excl_list = implode("','", explode(',', "'".trim($this->options['SE5_exclude_categories_list'])."'" ));
293
  $where = str_replace('"', '\'', $where);
294
  $where = 'AND ('.substr($where, strpos($where, 'AND')+3).' )';
295
  if ($this->wp_ver23)
299
  }
300
  }
301
 
302
+ $this->SE5_log("ex cats where: ".$where);
303
  return $where;
304
  }
305
 
306
  //join for excluding categories - Deprecated in 2.3
307
+ function SE5_exclude_categories_join($join) {
308
  global $wp_query, $wpdb;
309
 
310
  if (!empty($wp_query->query_vars['s'])) {
315
  $join .= "LEFT JOIN $wpdb->post2cat AS c ON $wpdb->posts.ID = c.post_id";
316
  }
317
  }
318
+ $this->SE5_log("category join: ".$join);
319
  return $join;
320
  }
321
 
322
  //join for searching comments
323
+ function SE5_comments_join($join) {
324
  global $wp_query, $wpdb;
325
 
326
  if (!empty($wp_query->query_vars['s'])) {
329
  $join .= " LEFT JOIN $wpdb->comments AS c ON ( comment_post_ID = ID " . $comment_approved . ") ";
330
  } else {
331
 
332
+ if ('true' == $this->options['SE5_approved_comments_only']) {
333
  $comment_approved = " AND comment_approved = '1'";
334
  } else {
335
  $comment_approved = '';
340
  }
341
  }
342
 
343
+ $this->SE5_log("comments join: ".$join);
344
  return $join;
345
  }
346
 
347
  //join for searching authors
348
+ function SE5_search_authors($where) {
349
  global $wp_query, $wpdb;
350
+
351
  if (!empty($wp_query->query_vars['s'])) {
352
+ $or = " OR (u.user_nicename LIKE '%" . $wpdb->escape($wp_query->query_vars['s']) . "%') ";
 
353
 
354
  }
355
  $where = preg_replace("/\bor\b/i",$or." OR",$where,1);
356
+ $this->SE5_log("user where: ".$where);
357
 
358
  return $where;
359
  }
360
 
361
 
362
+ function SE5_search_authors_join($join) {
363
  global $wp_query, $wpdb;
364
 
365
  if (!empty($wp_query->query_vars['s'])) {
366
+ $join .= " LEFT JOIN $wpdb->users AS u ON ($wpdb->posts.post_author = u.ID) ";
 
367
 
368
  }
369
+ $this->SE5_log("authors join: ".$join);
370
  return $join;
371
  }
372
  //join for searching metadata
373
+ function SE5_search_metadata_join($join) {
374
  global $wp_query, $wpdb;
375
 
376
  if (!empty($wp_query->query_vars['s'])) {
380
  else
381
  $join .= " LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id ";
382
  }
383
+ $this->SE5_log("metadata join: ".$join);
384
  return $join;
385
  }
386
 
387
  //join for searching tags
388
+ function SE5_terms_join($join) {
389
  global $wp_query, $wpdb;
390
 
391
  if (!empty($wp_query->query_vars['s'])) {
392
 
393
  // if we're searching for categories
394
+ if ( $this->options['SE5_use_category_search'] ) {
395
  $on[] = "ttax.taxonomy = 'category'";
396
  }
397
 
398
  // if we're searching for tags
399
+ if ( $this->options['SE5_use_tag_search'] ) {
400
  $on[] = "ttax.taxonomy = 'post_tag'";
401
  }
402
 
406
  $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) ";
407
  }
408
 
409
+ $this->SE5_log("tags join: ".$join);
410
  return $join;
411
  }
412
  }