Search Everything - Version 3.9.9.5

Version Description

Download this release

Release Info

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

Code changes from version 3.7 to 3.9.9.5

Files changed (7) hide show
  1. SE3fr_FR.mo +0 -0
  2. SE3fr_FR.po +68 -0
  3. SE3fr_FR.pot +56 -0
  4. options.jpg +0 -0
  5. readme.txt +5 -6
  6. screenshot-1.jpg +0 -0
  7. search_everything.php +205 -166
SE3fr_FR.mo ADDED
Binary file
SE3fr_FR.po ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Search Everything\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: 2007-08-19 18:20+0100\n"
6
+ "Last-Translator: alakhnor <alakhnor@wanadoo.fr>\n"
7
+ "Language-Team: Alakhnor\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-Language: French\n"
12
+ "X-Poedit-Country: FRANCE\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: c:\\wamp\\www\\wordpress212\\wp-content\\plugins\\\n"
15
+ "X-Poedit-SearchPath-0: search-everything\n"
16
+
17
+ #: search-everything/search_everything.php:404
18
+ msgid "The options selected below will be used in every search query on this site; in addition to the built-in post search."
19
+ msgstr "Les options sélectionnées ci-dessous seront utilisées dans les recherches effectuées sur ce site en s'ajoutant à la fonction de recherche existante."
20
+
21
+ #: search-everything/search_everything.php:420
22
+ msgid "Exclude some post IDs"
23
+ msgstr "Exclure des articles"
24
+
25
+ #: search-everything/search_everything.php:424
26
+ msgid "List of ID to exclude"
27
+ msgstr "Liste des ID à exclure"
28
+
29
+ #: search-everything/search_everything.php:428
30
+ msgid "Exclude some category IDs"
31
+ msgstr "Exclure des catégories"
32
+
33
+ #: search-everything/search_everything.php:432
34
+ msgid "List of category ID to exclude"
35
+ msgstr "Liste des ID de catégorie à exclure"
36
+
37
+ #: search-everything/search_everything.php:436
38
+ msgid "Search Every Page (non-password protected)"
39
+ msgstr "Chercher dans les pages (non-protégées par mot de passe)"
40
+
41
+ #: search-everything/search_everything.php:440
42
+ msgid "Search Every Comment"
43
+ msgstr "Chercher dans les commentaires"
44
+
45
+ #: search-everything/search_everything.php:448
46
+ msgid "Search only Approved comments only?"
47
+ msgstr "Chercher dans les commentaires approuvés seulement"
48
+
49
+ #: search-everything/search_everything.php:455
50
+ msgid "Search Every Excerpt"
51
+ msgstr "Chercher dans les excerpt"
52
+
53
+ #: search-everything/search_everything.php:459
54
+ msgid "Search Every Draft"
55
+ msgstr "Chercher dans les brouillons"
56
+
57
+ #: search-everything/search_everything.php:463
58
+ msgid "Search Every Attachment"
59
+ msgstr "Chercher dans les documents joints"
60
+
61
+ #: search-everything/search_everything.php:467
62
+ msgid "Search Custom Fields (Metadata)"
63
+ msgstr "Chercher dans les champs personnalisés (Meta-data)"
64
+
65
+ #: search-everything/search_everything.php:473
66
+ msgid "You may have to update your options twice before it sticks."
67
+ msgstr "Vous devrez peut-être valider vos options deux fois afin qu'elles prennent effet."
68
+
SE3fr_FR.pot ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+ # This file is distributed under the same license as the PACKAGE package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: PACKAGE VERSION\n"
10
+ "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2007-01-14 00:02+0200\n"
12
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "MIME-Version: 1.0\n"
16
+ "Content-Type: text/plain; charset=CHARSET\n"
17
+ "Content-Transfer-Encoding: 8bit\n"
18
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
19
+
20
+
21
+ msgid "PunBB tools"
22
+ msgstr "Outils punbb"
23
+
24
+ msgid "Unavailable punbb/ directory in %s. You may create it manually and/or give it writing rights."
25
+ msgstr "Dossier punbb/ dans %s indisponible. Vous pouvez le cr�er manuellement et/ou lui donner les droits d'�criture."
26
+
27
+ msgid "Unable to create punbb.ini file"
28
+ msgstr "Impossible de cr�er le fichier punbb.ini"
29
+
30
+ msgid "Config file %s, is not writable."
31
+ msgstr "Le fichier de configuration %s n'est pas accessible en �criture."
32
+
33
+ msgid "An error occured while writing the file."
34
+ msgstr "Une erreur s'est produite � l'�criture du fichier."
35
+
36
+ msgid "Configuration file successfully updated."
37
+ msgstr "Fichier de configuration mis � jour avec succ�s."
38
+
39
+ msgid "You must give a PunBB path"
40
+ msgstr "Vous devez indiquer le chemin de PunBB"
41
+
42
+ msgid "You must give a PunBB location"
43
+ msgstr "Vous devez indiquer l'emplacement de PunBB"
44
+
45
+ msgid "The PunBB path does not seems to be correct or punbb is not installed"
46
+ msgstr "Le chemin de PunBB ne semble pas correct ou PunBB n'est pas install�"
47
+
48
+ msgid "Params"
49
+ msgstr "Param�tres"
50
+
51
+ msgid "Relative path"
52
+ msgstr "Chemin relatif"
53
+
54
+ msgid "Absolute path"
55
+ msgstr "Chemin absolu"
56
+
options.jpg ADDED
Binary file
readme.txt CHANGED
@@ -1,16 +1,16 @@
1
  === Plugin Name ===
2
  Contributors: dancameron, few others
3
  Donate link: http://www.amazon.com/gp/registry/wishlist/3EM84J7FVHE6S/ref=wl_web/
4
- Tags: search, comment search, page search, admin, seo, tags, meta
5
  Requires at least: 1.5
6
  Tested up to: 2.2
7
- Stable tag: 3.2.1
8
 
9
- Description: Adds search functionality with little setup. Including options to search pages, tags (Jerome's Keywords Plugin, UTW support coming soon), excerpts, attachments, drafts, comments and custom fields (metadata). Additional Features: Localization. Thank you wordpress
10
 
11
  == Description ==
12
 
13
- Description: Adds search functionality with little setup. Including options to search pages, tags (Jerome's Keywords Plugin, UTW support coming soon), excerpts, attachments, drafts, comments and custom fields (metadata). Additional Features: Localization. Thank you wordpress
14
 
15
 
16
 
@@ -39,8 +39,7 @@ Open up a thread in the support forums tagged 'searcheverything' and 'dancameron
39
 
40
  == Screenshots ==
41
 
42
- 1. Screenshot of the options panel.
43
-
44
 
45
  == Help ==
46
 
1
  === Plugin Name ===
2
  Contributors: dancameron, few others
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: 1.5
6
  Tested up to: 2.2
7
+ Stable tag: 3.9.9
8
 
9
+ Adds search functionality with little setup. Including options to search pages, excerpts, attachments, drafts, comments and custom fields (metadata).
10
 
11
  == Description ==
12
 
13
+ Adds search functionality for almost everything on your site. Including options for searching pages, excerpts, attachments, drafts, comments and custom fields (metadata).
14
 
15
 
16
 
39
 
40
  == Screenshots ==
41
 
42
+ Screenshot of the options panel ![options panel](/options.jpg "Options")
 
43
 
44
  == Help ==
45
 
screenshot-1.jpg ADDED
Binary file
search_everything.php CHANGED
@@ -2,10 +2,10 @@
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, tags (Jerome's Keywords Plugin, UTW support coming soon), excerpts, attachments, drafts, comments and custom fields (metadata). Additional Features: Localization. Thank you wordpress community!
6
- Version: 3.8
7
  Author: Dan Cameron
8
- Author URI: http://dancameron.org
9
  */
10
 
11
  /*
@@ -23,8 +23,7 @@ $logging = 0;
23
  $locale = get_locale();
24
  if ( !empty($locale) )
25
  load_textdomain('SearchEverything', ABSPATH . 'wp-content/plugins/' . dirname(plugin_basename(__FILE__)) .'/' . 'SE3'.$locale.'.mo');
26
-
27
-
28
  function SE3_log($msg) {
29
  global $logging;
30
  if ($logging) {
@@ -37,19 +36,7 @@ function SE3_log($msg) {
37
  return true;
38
  }
39
 
40
-
41
-
42
  //add filters based upon option settings
43
- if ("true" == get_option('SE3_exclude_posts')) {
44
- add_filter('posts_where', 'SE3_exclude_posts');
45
- SE3_log("searching excluding");
46
- }
47
-
48
- if ("true" == get_option('SE3_use_page_search')) {
49
- add_filter('posts_where', 'SE3_search_pages');
50
- SE3_log("searching pages");
51
- }
52
-
53
  if ("true" == get_option('SE3_use_page_search')) {
54
  add_filter('posts_where', 'SE3_search_pages');
55
  SE3_log("searching pages");
@@ -82,11 +69,24 @@ if ("true" == get_option('SE3_use_metadata_search')) {
82
  SE3_log("searching metadata");
83
  }
84
 
85
- //Tag Search provided by Thu Tu
86
- if ("true" == get_option('SE3_use_tag_search')) {
87
- add_filter('posts_where', 'SE3_search_tag');
88
- add_filter('posts_join', 'SE3_search_tag_join');
89
- SE3_log("searching tag");
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
 
92
  //Duplicate fix provided by Tiago.Pocinho
@@ -101,19 +101,50 @@ function SE3_distinct($query){
101
  }
102
  return $query;
103
  }
104
-
105
- //exlude some posts from search
106
- function SE3_exclude_posts($where) {
107
- global $wp_query;
108
- if (!empty($wp_query->query_vars['s'])) {
109
- $where = str_replace('"', '\'', $where);
110
- $where .= ' AND ID NOT IN ( '.get_option('SE3_exclude_posts_list').' )';
111
- }
112
 
113
- SE3_log("pages where: ".$where);
114
- return $where;
 
 
 
 
 
 
115
  }
116
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  //search pages (except password protected pages provided by loops)
118
  function SE3_search_pages($where) {
119
  global $wp_query;
@@ -252,20 +283,6 @@ function SE3_search_tag_join($join) {
252
  return $join;
253
  }
254
 
255
- //join for searching tag UTW
256
- // function SE3_search_tag_join($join) {
257
- // global $table_prefix, $wpdb;
258
- //
259
- // if (!empty($wp_query->query_vars['s'])) {
260
- //
261
- // $join .= " LEFT JOIN $tablepost2tag p2t on $wpdb->posts.ID = p2t.post_id INNER JOIN $tabletags on p2t.tag_id = $tabletags.tag_id ";
262
- // }
263
-
264
- // SE3_log("tag join: ".$join);
265
- // return $join;
266
- //}
267
-
268
-
269
  //build admin interface
270
  function SE3_option_page() {
271
 
@@ -274,19 +291,31 @@ global $wpdb, $table_prefix;
274
  if ( isset($_POST['SE3_update_options']) ) {
275
 
276
  $errs = array();
277
-
 
 
 
 
 
 
 
 
 
 
 
 
278
  if ( !empty($_POST['exclude_posts']) ) {
279
  update_option('SE3_exclude_posts', "true");
280
  } else {
281
  update_option('SE3_exclude_posts', "false");
282
  }
283
-
284
  if ( !empty($_POST['exclude_posts_list']) ) {
285
  update_option('SE3_exclude_posts_list', $_POST['exclude_posts_list']);
286
  } else {
287
  update_option('SE3_exclude_posts_list', "");
288
  }
289
-
290
  if ( !empty($_POST['search_pages']) ) {
291
  update_option('SE3_use_page_search', "true");
292
  } else {
@@ -334,9 +363,9 @@ global $wpdb, $table_prefix;
334
  } else {
335
  update_option('SE3_use_tag_search', "false");
336
  }
337
-
338
  if ( empty($errs) ) {
339
- echo '<div id="message" class="updated fade"><p>Options updated!</p></div>';
340
  } else {
341
  echo '<div id="message" class="error fade"><ul>';
342
  foreach ( $errs as $name => $msg ) {
@@ -347,12 +376,28 @@ global $wpdb, $table_prefix;
347
  } // End if update
348
 
349
  //set up option checkbox values
 
 
 
 
 
 
350
  if ('true' == get_option('SE3_exclude_posts')) {
351
  $exclude_posts = 'checked="true"';
352
  } else {
353
  $exclude_posts = '';
354
  }
355
-
 
 
 
 
 
 
 
 
 
 
356
  if ('true' == get_option('SE3_use_page_search')) {
357
  $page_search = 'checked="true"';
358
  } else {
@@ -377,7 +422,6 @@ global $wpdb, $table_prefix;
377
  $excerpt_search = '';
378
  }
379
 
380
-
381
  if ('true' == get_option('SE3_use_draft_search')) {
382
  $draft_search = 'checked="true"';
383
  } else {
@@ -401,133 +445,128 @@ global $wpdb, $table_prefix;
401
  } else {
402
  $tag_search = '';
403
  }
404
-
405
- ?>
406
 
407
- <div class="wrap" id="SE3_options_panel">
408
- <h2>Search Everything 3</h2>
409
- <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>
410
- <div id="searchform">
411
- <form method="get" id="searchform" action="<?php bloginfo('home'); ?>">
412
- <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
413
- <input type="submit" id="searchsubmit" value="Test Search" />
414
- </div>
415
- </form>
416
- </div>
417
-
418
-
419
-
420
- <form method="post">
421
-
422
- <table id="search_options" cell-spacing="2" cell-padding="2">
423
- <tr>
424
- <td class="col1"><input type="checkbox" name="search_pages" value="<?php echo get_option('SE3_use_page_search'); ?>" <?php echo $page_search; ?> /></td>
425
- <td class="col2" colspan=2 ><?php _e('Search Every Page (non-password protected)','SearchEverything'); ?></td>
426
- </tr>
427
- <tr>
428
- <td class="col1"><input type="checkbox" name="search_comments" value="<?php echo get_option('SE3_use_comment_search'); ?>" <?php echo $comment_search; ?> /></td>
429
- <td class="col2" colspan=2 ><?php _e('Search Every Comment','SearchEverything'); ?></td>
430
- </tr>
431
- <tr class="child_option">
432
- <td>&nbsp;</td>
433
- <td>
434
- <table>
435
- <tr>
436
- <td class="col1"><input type="checkbox" name="appvd_comments" value="<?php echo get_option('SE3_approved_comments_only'); ?>" <?php echo $appvd_comment; ?> /></td>
437
- <td class="col2"><?php _e('Search only Approved comments only?','SearchEverything'); ?></td>
438
- </tr>
439
- </table>
440
- </td>
441
- </tr>
442
- <tr>
443
- <td class="col1"><input type="checkbox" name="search_tag" value="<?php echo get_option('SE3_use_tag_search'); ?>" <?php echo $tag_search; ?> /></td>
444
- <td class="col2"><?php _e('Search Tags (Jeromes Keywords Plugin, UTW support coming soon)','SearchEverything'); ?></td>
445
- </tr>
446
- <tr>
447
- <td class="col1"><input type="checkbox" name="search_excerpt" value="<?php echo get_option('SE3_use_excerpt_search'); ?>" <?php echo $excerpt_search; ?> /></td>
448
- <td class="col2"><?php _e('Search Every Excerpt','SearchEverything'); ?></td>
449
- </tr>
450
- <tr>
451
- <td class="col1"><input type="checkbox" name="search_drafts" value="<?php echo get_option('SE3_use_draft_search'); ?>" <?php echo $draft_search; ?> /></td>
452
- <td class="col2"><?php _e('Search Every Draft','SearchEverything'); ?></td>
453
- </tr>
454
- <tr>
455
- <td class="col1"><input type="checkbox" name="search_attachments" value="<?php echo get_option('SE3_use_attachment_search'); ?>" <?php echo $attachment_search; ?> /></td>
456
- <td class="col2"><?php _e('Search Every Attachment','SearchEverything'); ?></td>
457
- </tr>
458
- <tr>
459
- <td class="col1"><input type="checkbox" name="search_metadata" value="<?php echo get_option('SE3_use_metadata_search'); ?>" <?php echo $metadata_search; ?> /></td>
460
- <td class="col2"><?php _e('Search Custom Fields (Metadata)','SearchEverything'); ?></td>
461
- </tr>
462
- <tr>
463
- <!--<td class="col1"><input type="checkbox" name="exclude_posts" value="<?php echo get_option('SE3_exclude_posts'); ?>" <?php echo $exclude_posts; ?> /></td>
464
- <td class="col2" colspan=2 ><?php _e('Exclude some post IDs','SearchEverything'); ?></td>
465
- </tr>
466
- <tr>-->
467
-
468
- <!--<td class="col2" colspan=2 >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php _e('List of Post IDs to exclude','SearchEverything'); ?><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" size="30" name="exclude_posts_list" value="<?php echo get_option('SE3_exclude_posts_list');?>" /></td>
469
- </tr>-->
470
- </table>
471
-
472
- <p style="margin-left:70%" class="submit">
473
- <input type="submit" name="SE3_update_options" value="Save"/>
474
- </p>
475
- </form>
476
-
477
- </div>
478
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
 
480
  <?php
481
  } //end SE3_option_page
482
 
483
  function SE3_add_options_panel() {
484
- add_options_page('Search Everything', 'Search Everything', 'edit_plugins', 'SE3_options_page', 'SE3_option_page');
485
  }
486
  add_action('admin_menu', 'SE3_add_options_panel');
487
 
488
  //styling options page
489
  function SE3_options_style() {
490
  ?>
491
- <style type="text/css">
492
-
493
- table#search_options {
494
- table-layout: auto;
495
- }
496
-
497
-
498
- #search_options td.col1, #search_options th.col1 {
499
- width: 30px;
500
- text-align: left;
501
- }
502
-
503
- #search_options td.col2, #search_options th.col2 {
504
- width: 450px;
505
- margin-left: -15px;
506
- text-align: left;
507
- }
508
-
509
- #search_options tr.child_option {
510
- margin-left: 15px;
511
- margin-top: -3px;
512
- }
513
-
514
- #SE3_options_panel p.submit {
515
- text-align: left;
516
- }
517
-
518
- div#searchform div {
519
- margin-left: auto;
520
- margin-right: auto;
521
- margin-top: 5px;
522
- margin-bottom: 5px;
523
- }
524
-
525
- </style>
526
-
527
  <?php
528
  }
529
 
530
-
531
  add_action('admin_head', 'SE3_options_style');
532
 
533
- ?>
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: 3.9.9.5
7
  Author: Dan Cameron
8
+ Author URI: http://dancameron.org/
9
  */
10
 
11
  /*
23
  $locale = get_locale();
24
  if ( !empty($locale) )
25
  load_textdomain('SearchEverything', ABSPATH . 'wp-content/plugins/' . dirname(plugin_basename(__FILE__)) .'/' . 'SE3'.$locale.'.mo');
26
+
 
27
  function SE3_log($msg) {
28
  global $logging;
29
  if ($logging) {
36
  return true;
37
  }
38
 
 
 
39
  //add filters based upon option settings
 
 
 
 
 
 
 
 
 
 
40
  if ("true" == get_option('SE3_use_page_search')) {
41
  add_filter('posts_where', 'SE3_search_pages');
42
  SE3_log("searching pages");
69
  SE3_log("searching metadata");
70
  }
71
 
72
+ if ("true" == get_option('SE3_exclude_posts')) {
73
+ add_filter('posts_where', 'SE3_exclude_posts');
74
+ SE3_log("searching excluding posts");
75
+ }
76
+
77
+
78
+
79
+ if ("true" == get_option('SE3_exclude_categories')) {
80
+ add_filter('posts_where', 'SE3_exclude_categories');
81
+ add_filter('posts_join', 'SE3_exclude_categories_join');
82
+ SE3_log("searching excluding categories");
83
+ }
84
+
85
+ //Tag Search provided by Thu Tu
86
+ if ("true" == get_option('SE3_use_tag_search')) {
87
+ add_filter('posts_where', 'SE3_search_tag');
88
+ add_filter('posts_join', 'SE3_search_tag_join');
89
+ SE3_log("searching tag");
90
  }
91
 
92
  //Duplicate fix provided by Tiago.Pocinho
101
  }
102
  return $query;
103
  }
 
 
 
 
 
 
 
 
104
 
105
+ //exlude some posts from search
106
+ function SE3_exclude_posts($where) {
107
+ global $wp_query;
108
+ if (!empty($wp_query->query_vars['s'])) {
109
+ $excl_list = implode(',', explode(',', trim(get_option('SE3_exclude_posts_list'))));
110
+ $where = str_replace('"', '\'', $where);
111
+ $where = 'AND ('.substr($where, strpos($where, 'AND')+3).' )';
112
+ $where .= ' AND (ID NOT IN ( '.$excl_list.' ))';
113
  }
114
+
115
+ SE3_log("ex posts where: ".$where);
116
+ return $where;
117
+ }
118
+
119
+
120
+
121
+ //exlude some categories from search
122
+ function SE3_exclude_categories($where) {
123
+ global $wp_query;
124
+ if (!empty($wp_query->query_vars['s'])) {
125
+ $excl_list = implode(',', explode(',', trim(get_option('SE3_exclude_categories_list'))));
126
+ $where = str_replace('"', '\'', $where);
127
+ $where = 'AND ('.substr($where, strpos($where, 'AND')+3).' )';
128
+ $where .= ' AND (c.category_id NOT IN ( '.$excl_list.' ))';
129
+ }
130
+
131
+ SE3_log("ex cats where: ".$where);
132
+ return $where;
133
+ }
134
+
135
+ //join for excluding categories
136
+ function SE3_exclude_categories_join($join) {
137
+ global $wp_query, $wpdb;
138
+
139
+ if (!empty($wp_query->query_vars['s'])) {
140
+
141
+ $join .= "LEFT JOIN $wpdb->post2cat AS c ON $wpdb->posts.ID = c.post_id";
142
+ }
143
+ SE3_log("category join: ".$join);
144
+ return $join;
145
+ }
146
+
147
+
148
  //search pages (except password protected pages provided by loops)
149
  function SE3_search_pages($where) {
150
  global $wp_query;
283
  return $join;
284
  }
285
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  //build admin interface
287
  function SE3_option_page() {
288
 
291
  if ( isset($_POST['SE3_update_options']) ) {
292
 
293
  $errs = array();
294
+
295
+ if ( !empty($_POST['exclude_categories']) ) {
296
+ update_option('SE3_exclude_categories', "true");
297
+ } else {
298
+ update_option('SE3_exclude_categories', "false");
299
+ }
300
+
301
+ if ( !empty($_POST['exclude_categories_list']) ) {
302
+ update_option('SE3_exclude_categories_list', $_POST['exclude_categories_list']);
303
+ } else {
304
+ update_option('SE3_exclude_categories_list', "");
305
+ }
306
+
307
  if ( !empty($_POST['exclude_posts']) ) {
308
  update_option('SE3_exclude_posts', "true");
309
  } else {
310
  update_option('SE3_exclude_posts', "false");
311
  }
312
+
313
  if ( !empty($_POST['exclude_posts_list']) ) {
314
  update_option('SE3_exclude_posts_list', $_POST['exclude_posts_list']);
315
  } else {
316
  update_option('SE3_exclude_posts_list', "");
317
  }
318
+
319
  if ( !empty($_POST['search_pages']) ) {
320
  update_option('SE3_use_page_search', "true");
321
  } else {
363
  } else {
364
  update_option('SE3_use_tag_search', "false");
365
  }
366
+
367
  if ( empty($errs) ) {
368
+ echo '<div id="message" class="updated fade"><p>Search Options Saved!</p></div>';
369
  } else {
370
  echo '<div id="message" class="error fade"><ul>';
371
  foreach ( $errs as $name => $msg ) {
376
  } // End if update
377
 
378
  //set up option checkbox values
379
+ if ('true' == get_option('SE3_exclude_categories')) {
380
+ $exclude_categories = 'checked="true"';
381
+ } else {
382
+ $exclude_categories = '';
383
+ }
384
+
385
  if ('true' == get_option('SE3_exclude_posts')) {
386
  $exclude_posts = 'checked="true"';
387
  } else {
388
  $exclude_posts = '';
389
  }
390
+
391
+
392
+ ### NEW with v.3.9.1 ##################################
393
+ if ('true' == get_option('SE3_exclude_pages')) {
394
+ $exclude_pages = 'checked="true"';
395
+ } else {
396
+ $exclude_pages = '';
397
+ }
398
+ ### NEW with v.3.9.1 ##################################
399
+
400
+
401
  if ('true' == get_option('SE3_use_page_search')) {
402
  $page_search = 'checked="true"';
403
  } else {
422
  $excerpt_search = '';
423
  }
424
 
 
425
  if ('true' == get_option('SE3_use_draft_search')) {
426
  $draft_search = 'checked="true"';
427
  } else {
445
  } else {
446
  $tag_search = '';
447
  }
 
 
448
 
449
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
 
451
+ <div class="wrap" id="SE3_options_panel">
452
+ <h2>Search Everything (SE) Version: 3.9.9</h2>
453
+ <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>
454
+
455
+ </div>
456
+
457
+ <div class="wrap SE3">
458
+ <h2>SE Search Options</h2>
459
+ <p>Use this form to configure your search options.</p>
460
+ <form id="SE_form" method="post" action="">
461
+ <fieldset>
462
+ <legend>Search Options Form</legend>
463
+ <p><input type="checkbox" id="exclude_posts" name="exclude_posts" value="<?php echo get_option('SE3_exclude_posts'); ?>" <?php echo $exclude_posts; ?> />
464
+ <label for="exclude_posts"><?php _e('Exclude some post or page IDs','SearchEverything'); ?></label><br />
465
+ <label for="exclude_posts_list" class="SE_text_label"><?php _e('List of IDs to exclude (example: 1, 5, 9)','SearchEverything'); ?></label><br />
466
+ <input type="text" size="40" class="SE_text_input" id="exclude_posts_list" name="exclude_posts_list" value="<?php echo get_option('SE3_exclude_posts_list');?>" /></p>
467
+
468
+ <p><input type="checkbox" id="exclude_categories" name="exclude_categories" value="<?php echo get_option('SE3_exclude_categories'); ?>" <?php echo $exclude_categories; ?> />
469
+ <label for="exclude_categories"><?php _e('Exclude some category IDs','SearchEverything'); ?></label><br />
470
+ <label for="exclude_categories_list" class="SE_text_label"><?php _e('List of category IDs to exclude (example: 1, 4)','SearchEverything'); ?></label><br />
471
+ <input type="text" size="40" class="SE_text_input" id="exclude_categories_list" name="exclude_categories_list" value="<?php echo get_option('SE3_exclude_categories_list');?>" /></p>
472
+
473
+ <p><input type="checkbox" id="search_pages" name="search_pages" value="<?php echo get_option('SE3_use_page_search'); ?>" <?php echo $page_search; ?> />
474
+ <label for="search_pages"><?php _e('Search every page (non-password protected)','SearchEverything'); ?></label></p>
475
+
476
+ <p><input type="checkbox" id="search_comments" name="search_comments" value="<?php echo get_option('SE3_use_comment_search'); ?>" <?php echo $comment_search; ?> />
477
+ <label for="search_comments"><?php _e('Search every comment','SearchEverything'); ?></label><br />
478
+ <input type="checkbox" class="SE_text_input" id="appvd_comments" name="appvd_comments" value="<?php echo get_option('SE3_approved_comments_only'); ?>" <?php echo $appvd_comment; ?> />
479
+ <label for="appvd_comments"><?php _e('Search approved comments only?','SearchEverything'); ?></label></p>
480
+
481
+ <p><input type="checkbox" id="search_excerpt" name="search_excerpt" value="<?php echo get_option('SE3_use_excerpt_search'); ?>" <?php echo $excerpt_search; ?> />
482
+ <label for="search_excerpt"><?php _e('Search every excerpt','SearchEverything'); ?></label></p>
483
+
484
+ <p><input type="checkbox" id="search_drafts" name="search_drafts" value="<?php echo get_option('SE3_use_draft_search'); ?>" <?php echo $draft_search; ?> />
485
+ <label for="search_drafts"><?php _e('Search every draft','SearchEverything'); ?></label></p>
486
+
487
+ <p><input type="checkbox" id="search_attachments" name="search_attachments" value="<?php echo get_option('SE3_use_attachment_search'); ?>" <?php echo $attachment_search; ?> />
488
+ <label for="search_attachments"><?php _e('Search every attachment','SearchEverything'); ?></label></p>
489
+
490
+ <p><input type="checkbox" id="search_metadata" name="search_metadata" value="<?php echo get_option('SE3_use_metadata_search'); ?>" <?php echo $metadata_search; ?> />
491
+ <label for="search_metadata"><?php _e('Search custom fields (metadata)','SearchEverything'); ?></label></p>
492
+
493
+ <p><input type="checkbox" id="search_tag" name="search_tag" value="<?php echo get_option('SE3_use_tag_search'); ?>" <?php echo $tag_search; ?> />
494
+ <label for="search_tag"><?php _e('Search keywords/tags - <small>Jerome\'s Keywords only</small>','SearchEverything'); ?></label></p>
495
+
496
+ <p class="submit"><input type="submit" name="SE3_update_options" class="SE3_btn" value="Save Search Options"/><br />
497
+ <span class="SE_notice">Important:</span> <?php _e('You may have to click Save Search Options twice before it sticks.','SearchEverything'); ?></p>
498
+
499
+ </fieldset>
500
+ </form>
501
+ </div>
502
+ <div class="wrap SE3">
503
+ <h2>SE Search Form</h2>
504
+ <p>Use this search form to run a live search test.</p>
505
+
506
+ <fieldset>
507
+ <legend>Site Search</legend>
508
+ <form method="get" id="searchform" action="<?php bloginfo('home'); ?>"><p class="srch submit">
509
+ <label for="s">Enter search terms<br /></label>
510
+ <input type="text" class="srch-txt" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
511
+ <input type="submit" class="SE3_btn" id="searchsubmit" value="Run Test Search" /></p>
512
+ </form>
513
+ </fieldset>
514
+ </div>
515
+ <div class="wrap">
516
+ <h2>SE Project Information</h2>
517
+ <p>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>
518
+ <ul class="SE_lists">
519
+ <li><a href="http://kinrowan.net/">Cori Schlegel</a></li>
520
+ <li><a href="http://green-beast.com/">Mike Cherim</a></li>
521
+ <li><a href="http://alexking.org/">Alex King</a></li>
522
+ <li><a href="http://blog.saddey.net/">Saddy</a></li>
523
+ <li><a href="http://www.reaper-x.com/">Reaper</a></li>
524
+
525
+ <li>Alakhnor</li>
526
+ <li>Uli Iserloh</li>
527
+ </ul>
528
+ <p>If you&#8217;d like to contribute there&#8217;s a lot to do:</p>
529
+ <ul class="SE_lists">
530
+ <li><strong>2.3 Compatibility</strong></li>
531
+ <li>More meta data fuctions.</li>
532
+ <li>Search WP 2.3 tags.</li>
533
+ <li>Search Bookmarks.</li>
534
+ <li>&#8230;anything else you want to add.</li>
535
+ </ul>
536
+ <br/><p>The current project home is at <a href="http://scatter3d.com/">scatter3d.com</a>. If you want to contribute <a href="mailto:dancameron@gmail.com">e-mail me</a> your modifications.<br/> Donations are accepted.</p>
537
+ <p class="sig">Respectfully,<br />
538
+ <a href="http://dancameron.org/">Dan Cameron</a></p>
539
+ </div>
540
 
541
  <?php
542
  } //end SE3_option_page
543
 
544
  function SE3_add_options_panel() {
545
+ add_options_page('Search', 'Search Everything', 'edit_plugins', 'SE3_options_page', 'SE3_option_page');
546
  }
547
  add_action('admin_menu', 'SE3_add_options_panel');
548
 
549
  //styling options page
550
  function SE3_options_style() {
551
  ?>
552
+ <style type="text/css" media="screen">
553
+ div.SE3 p.submit, div.SE3 form p.submit, div.SE3 p.submit input { text-align:left; }
554
+ #SE3_options_panel p.submit { text-align:left; }
555
+ form#searchform label, form#searchform input, form#SE_form label, form#SE_form input { margin-left:10px; }
556
+ input.SE3_btn { cursor:pointer; margin-left:5px; }
557
+ form legend { font-weight:bold; color:navy; }
558
+ p.srch { margin:0; margin-bottom:20px; }
559
+ p.submit input.srch-txt { background-color:#f4f4f4; background-image:none; border:1px solid #999; padding:6px; }
560
+ p.submit input.srch-txt:focus, p.submit input.srch-txt:active { background-color:#fff; background-image:none; border:1px solid #111; padding:6px; }
561
+ p.sig { margin-left:25px; }
562
+ span.SE_notice { color:#cd0000; font-weight:bold; padding-left:10px; }
563
+ label.SE_text_label { cursor:text; }
564
+ form#SE_form label.SE_text_label, form#SE_form input.SE_text_input { margin-left:38px; }
565
+ ul.SE_lists li { list-style-type:square; }
566
+ </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
567
  <?php
568
  }
569
 
 
570
  add_action('admin_head', 'SE3_options_style');
571
 
572
+ ?>