Version Description
- Added config file with installation and migration functions
- Refactored code, removed Yes options
- Replaced deprecated functions
github Issues
Download this release
Release Info
Developer | sparkica |
Plugin | Search Everything |
Version | 7.0.2 |
Comparing to | |
See all releases |
Code changes from version 7.0.1 to 7.0.2
- README.markdown +0 -5
- config.php +197 -0
- css/admin.css +14 -0
- lang/se.mo +0 -0
- lang/se.pot +15 -2
- options.php +294 -0
- readme.txt +21 -39
- search-everything.php +84 -70
- views/options.php +0 -427
README.markdown
CHANGED
@@ -56,11 +56,6 @@ Search Everything increases the ability of the default Wordpress Search, options
|
|
56 |
* Exclude Categories from search
|
57 |
|
58 |
|
59 |
-
Search Everything Plus
|
60 |
-
============
|
61 |
-
Premium version coming soon, get notified on updates [here](http://wpsearchplugin.com/get-notified/ "Get updates").
|
62 |
-
|
63 |
-
|
64 |
Installation
|
65 |
============
|
66 |
|
56 |
* Exclude Categories from search
|
57 |
|
58 |
|
|
|
|
|
|
|
|
|
|
|
59 |
Installation
|
60 |
============
|
61 |
|
config.php
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
global $se_options, $se_meta;
|
4 |
+
$se_options = false;
|
5 |
+
$se_meta = false;
|
6 |
+
|
7 |
+
|
8 |
+
function se_get_options() {
|
9 |
+
global $se_options, $se_meta;
|
10 |
+
if($se_options) {
|
11 |
+
return $se_options;
|
12 |
+
}
|
13 |
+
|
14 |
+
$se_options = get_option('se_options', false);
|
15 |
+
|
16 |
+
if(!$se_options || $se_meta['version'] !== SE_VERSION) {
|
17 |
+
se_upgrade();
|
18 |
+
$se_meta = get_option('se_meta');
|
19 |
+
$se_options = get_option('se_options');
|
20 |
+
}
|
21 |
+
|
22 |
+
$se_meta = new ArrayObject($se_meta);
|
23 |
+
$se_options = new ArrayObject($se_options);
|
24 |
+
|
25 |
+
return $se_options;
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
function se_get_meta() {
|
30 |
+
global $se_meta;
|
31 |
+
|
32 |
+
if (!$se_meta) {
|
33 |
+
se_get_options();
|
34 |
+
}
|
35 |
+
return $se_meta;
|
36 |
+
}
|
37 |
+
|
38 |
+
function se_update_meta($new_meta) {
|
39 |
+
global $se_meta;
|
40 |
+
|
41 |
+
$new_meta = (array) $new_meta;
|
42 |
+
|
43 |
+
$r = update_option('se_meta', $new_meta);
|
44 |
+
|
45 |
+
if($r && $se_meta !== false) {
|
46 |
+
$se_meta->exchangeArray($new_meta);
|
47 |
+
}
|
48 |
+
|
49 |
+
return $r;
|
50 |
+
}
|
51 |
+
|
52 |
+
function se_update_options($new_options) {
|
53 |
+
global $se_options;
|
54 |
+
|
55 |
+
$new_options = (array) $new_options;
|
56 |
+
$r = update_option('se_options', $new_options);
|
57 |
+
if($r && $se_options !== false) {
|
58 |
+
$se_options->exchangeArray($new_options);
|
59 |
+
}
|
60 |
+
|
61 |
+
return $r;
|
62 |
+
}
|
63 |
+
|
64 |
+
//we have to be careful, as previously version was not stored in the options!
|
65 |
+
function se_upgrade() {
|
66 |
+
$se_meta = get_option('se_meta', false);
|
67 |
+
$version = false;
|
68 |
+
|
69 |
+
if($se_meta) {
|
70 |
+
$version = $se_meta['version'];
|
71 |
+
}
|
72 |
+
|
73 |
+
if($version) {
|
74 |
+
if(version_compare($version, SE_VERSION, '<')) {
|
75 |
+
call_user_func('wp_se_migrate_' . str_replace('.', '_', $version));
|
76 |
+
se_upgrade();
|
77 |
+
}
|
78 |
+
} else {
|
79 |
+
//check if se_options exist
|
80 |
+
$se_options = get_option('se_options', false);
|
81 |
+
if($se_options) {
|
82 |
+
se_migrate_7_0_1(); //existing users don't have version stored in their db
|
83 |
+
} else {
|
84 |
+
se_install();
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
function se_migrate_7_0_1() {
|
91 |
+
$se_meta = array(
|
92 |
+
'blog_id' => false,
|
93 |
+
'auth_key' => false,
|
94 |
+
'version' => '7.0.2',
|
95 |
+
'first_version' => '7.0.1',
|
96 |
+
'new_user' => false,
|
97 |
+
'name' => '',
|
98 |
+
'email' => '',
|
99 |
+
'show_options_page_notice' => false
|
100 |
+
);
|
101 |
+
|
102 |
+
update_option('se_meta',$se_meta);
|
103 |
+
|
104 |
+
//get options and update values to boolean
|
105 |
+
$old_options = get_option('se_options', false);
|
106 |
+
|
107 |
+
if($old_options) {
|
108 |
+
$new_options = se_get_default_options();
|
109 |
+
|
110 |
+
$boolean_keys = array(
|
111 |
+
'se_use_page_search' => false,
|
112 |
+
'se_use_comment_search' => false,
|
113 |
+
'se_use_tag_search' => false,
|
114 |
+
'se_use_tax_search' => false,
|
115 |
+
'se_use_category_search' => false,
|
116 |
+
'se_approved_comments_only'=> false,
|
117 |
+
'se_approved_pages_only' => false,
|
118 |
+
'se_use_excerpt_search' => false,
|
119 |
+
'se_use_draft_search' => false,
|
120 |
+
'se_use_attachment_search' => false,
|
121 |
+
'se_use_authors' => false,
|
122 |
+
'se_use_cmt_authors' => false,
|
123 |
+
'se_use_metadata_search' => false,
|
124 |
+
'se_use_highlight' => false,
|
125 |
+
);
|
126 |
+
$text_keys = array(
|
127 |
+
'se_exclude_categories' => '',
|
128 |
+
'se_exclude_categories_list' => '',
|
129 |
+
'se_exclude_posts' => '',
|
130 |
+
'se_exclude_posts_list' => '',
|
131 |
+
'se_highlight_color' => '',
|
132 |
+
'se_highlight_style' => ''
|
133 |
+
);
|
134 |
+
|
135 |
+
foreach ($boolean_keys as $k) {
|
136 |
+
$new_options[$k] = ('Yes' === $old_options[$k]);
|
137 |
+
}
|
138 |
+
foreach ($text_keys as $t) {
|
139 |
+
$new_options[$t] = $old_options[$t];
|
140 |
+
}
|
141 |
+
update_option('se_options',$new_options);
|
142 |
+
}
|
143 |
+
|
144 |
+
//moved to meta
|
145 |
+
$notice = get_option('se_show_we_tried', false);
|
146 |
+
if($notice) {
|
147 |
+
delete_option('se_show_we_tried');
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
|
152 |
+
function se_install() {
|
153 |
+
$se_meta = array(
|
154 |
+
'blog_id' => false,
|
155 |
+
'auth_key' => false,
|
156 |
+
'version' => SE_VERSION,
|
157 |
+
'first_version' => SE_VERSION,
|
158 |
+
'new_user' => true,
|
159 |
+
'name' => '',
|
160 |
+
'email' => '',
|
161 |
+
'show_options_page_notice' => true
|
162 |
+
);
|
163 |
+
$se_options = se_get_default_options();
|
164 |
+
|
165 |
+
update_option('se_meta', $se_meta);
|
166 |
+
update_option('se_options', $se_options);
|
167 |
+
|
168 |
+
}
|
169 |
+
|
170 |
+
function se_get_default_options() {
|
171 |
+
$se_options = array(
|
172 |
+
'se_exclude_categories' => '',
|
173 |
+
'se_exclude_categories_list' => '',
|
174 |
+
'se_exclude_posts' => '',
|
175 |
+
'se_exclude_posts_list' => '',
|
176 |
+
'se_use_page_search' =>false,
|
177 |
+
'se_use_comment_search' =>false,
|
178 |
+
'se_use_tag_search' => false,
|
179 |
+
'se_use_tax_search' => false,
|
180 |
+
'se_use_category_search' => false,
|
181 |
+
'se_approved_comments_only'=> false,
|
182 |
+
'se_approved_pages_only' => false,
|
183 |
+
'se_use_excerpt_search' => false,
|
184 |
+
'se_use_draft_search' => false,
|
185 |
+
'se_use_attachment_search' => false,
|
186 |
+
'se_use_authors' => false,
|
187 |
+
'se_use_cmt_authors' => false,
|
188 |
+
'se_use_metadata_search' => false,
|
189 |
+
'se_use_highlight' => false,
|
190 |
+
'se_highlight_color' => '',
|
191 |
+
'se_highlight_style' => ''
|
192 |
+
);
|
193 |
+
|
194 |
+
return $se_options;
|
195 |
+
}
|
196 |
+
|
197 |
+
?>
|
css/admin.css
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.thanks {width:400px; }
|
2 |
+
.thanks p {padding-left:20px; padding-right:20px;}
|
3 |
+
.info { background: #FFFFCC; border: 1px dotted #D8D2A9; padding: 10px; color: #333; }
|
4 |
+
.info a { color: #333; text-decoration: none; border-bottom: 1px dotted #333 }
|
5 |
+
.info a:hover { color: #666; border-bottom: 1px dotted #666; }
|
6 |
+
|
7 |
+
#se-basic-settings,#se-advanced-settings, #se-test-search, #se-info {margin-top: 20px;}
|
8 |
+
#se-basic-settings .manage-column, #se-advanced-settings .manage-column {font-weight:bold;}
|
9 |
+
#se-basic-settings.widefat, #se-advanced-settings.widefat,#se-test-search.widefat, #se-info.widefat {width:80%;}
|
10 |
+
.se-col {width:350px;}
|
11 |
+
.se-suboption label { font-size: smaller;margin-left:10px; color:#666;}
|
12 |
+
|
13 |
+
#se-top-notice {width:80%; position:relative;}
|
14 |
+
#se-top-notice .updated {margin:0;}
|
lang/se.mo
CHANGED
Binary file
|
lang/se.pot
CHANGED
@@ -9,9 +9,12 @@ msgstr ""
|
|
9 |
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/search-everything\n"
|
11 |
"POT-Creation-Date: 2009-06-11 23:25+0000\n"
|
|
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
|
|
|
15 |
"MIME-Version: 1.0\n"
|
16 |
"Content-Type: text/plain; charset=CHARSET\n"
|
17 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -147,8 +150,8 @@ msgstr ""
|
|
147 |
|
148 |
#: views/options.php:270
|
149 |
msgid ""
|
150 |
-
"Example:<br/>background-color: #FFF984; font-weight: bold; color: #000; "
|
151 |
-
"
|
152 |
msgstr ""
|
153 |
|
154 |
#: views/options.php:283
|
@@ -256,3 +259,13 @@ msgstr ""
|
|
256 |
#. Author URI of an extension
|
257 |
msgid "http://sproutventure.com/"
|
258 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/search-everything\n"
|
11 |
"POT-Creation-Date: 2009-06-11 23:25+0000\n"
|
12 |
+
"POT-Revision-Date: Sun Jan 26 2014 16:52:44 GMT+0100 (CET)\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
15 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
16 |
+
"Language: \n"
|
17 |
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION\n"
|
18 |
"MIME-Version: 1.0\n"
|
19 |
"Content-Type: text/plain; charset=CHARSET\n"
|
20 |
"Content-Transfer-Encoding: 8bit\n"
|
150 |
|
151 |
#: views/options.php:270
|
152 |
msgid ""
|
153 |
+
"Example:<br/>background-color: #FFF984; font-weight: bold; color: #000; padding:"
|
154 |
+
" 0 1px;"
|
155 |
msgstr ""
|
156 |
|
157 |
#: views/options.php:283
|
259 |
#. Author URI of an extension
|
260 |
msgid "http://sproutventure.com/"
|
261 |
msgstr ""
|
262 |
+
|
263 |
+
#. Shown in options title after plugin name
|
264 |
+
msgctxt "options.php"
|
265 |
+
msgid "settings"
|
266 |
+
msgstr ""
|
267 |
+
|
268 |
+
#. Shown below title on options page.
|
269 |
+
msgctxt "options.php"
|
270 |
+
msgid "Customize your search by checking one or more options below."
|
271 |
+
msgstr ""
|
options.php
ADDED
@@ -0,0 +1,294 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
Class se_admin {
|
4 |
+
|
5 |
+
function se_admin() {
|
6 |
+
// Load language file
|
7 |
+
$locale = get_locale();
|
8 |
+
$meta = se_get_meta();
|
9 |
+
if ( !empty($locale) )
|
10 |
+
load_textdomain('SearchEverything', SE_PLUGIN_DIR .'lang/se-'.$locale.'.mo');
|
11 |
+
|
12 |
+
add_action( 'admin_enqueue_scripts', array(&$this,'se_register_plugin_styles'));
|
13 |
+
add_action('admin_menu', array(&$this, 'se_add_options_panel'));
|
14 |
+
|
15 |
+
|
16 |
+
if ( isset( $_GET['se_notice'] ) && 0 == $_GET['se_notice'] ) {
|
17 |
+
$meta['show_options_page_notice'] = false;
|
18 |
+
se_update_meta($meta);
|
19 |
+
}
|
20 |
+
if ( $meta['show_options_page_notice'] ) {
|
21 |
+
add_action( 'all_admin_notices', array( &$this, 'se_options_page_notice' ) );
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
// Register style sheet
|
26 |
+
function se_register_plugin_styles() {
|
27 |
+
wp_register_style( 'search-everything', SE_PLUGIN_URL . '/css/admin.css' );
|
28 |
+
wp_enqueue_style( 'search-everything' );
|
29 |
+
}
|
30 |
+
|
31 |
+
function se_add_options_panel() {
|
32 |
+
add_options_page('Search', 'Search Everything', 'manage_options', 'extend_search', array(&$this, 'se_option_page'));
|
33 |
+
}
|
34 |
+
|
35 |
+
//build admin interface
|
36 |
+
function se_option_page() {
|
37 |
+
global $wpdb, $table_prefix, $wp_version;
|
38 |
+
|
39 |
+
$new_options = array(
|
40 |
+
'se_exclude_categories' => (isset($_POST['exclude_categories']) && !empty($_POST['exclude_categories'])) ? $_POST['exclude_categories'] : '',
|
41 |
+
'se_exclude_categories_list' => (isset($_POST['exclude_categories_list']) && !empty($_POST['exclude_categories_list'])) ? $_POST['exclude_categories_list'] : '',
|
42 |
+
'se_exclude_posts' => (isset($_POST['exclude_posts'])) ? $_POST['exclude_posts'] : '',
|
43 |
+
'se_exclude_posts_list' => (isset($_POST['exclude_posts_list']) && !empty($_POST['exclude_posts_list'])) ? $_POST['exclude_posts_list'] : '',
|
44 |
+
'se_use_page_search' => (isset($_POST['search_pages']) && $_POST['search_pages']) ,
|
45 |
+
'se_use_comment_search' => (isset($_POST['search_comments']) && $_POST['search_comments']) ,
|
46 |
+
'se_use_tag_search' => (isset($_POST['search_tags']) && $_POST['search_tags'] ),
|
47 |
+
'se_use_tax_search' => (isset($_POST['search_taxonomies']) && $_POST['search_taxonomies']),
|
48 |
+
'se_use_category_search' => (isset($_POST['search_categories']) && $_POST['search_categories']),
|
49 |
+
'se_approved_comments_only' => (isset($_POST['appvd_comments']) && $_POST['appvd_comments'] ),
|
50 |
+
'se_approved_pages_only' => (isset($_POST['appvd_pages']) && $_POST['appvd_pages']),
|
51 |
+
'se_use_excerpt_search' => (isset($_POST['search_excerpt']) && $_POST['search_excerpt']),
|
52 |
+
'se_use_draft_search' => (isset($_POST['search_drafts']) && $_POST['search_drafts']),
|
53 |
+
'se_use_attachment_search' => (isset($_POST['search_attachments']) && $_POST['search_attachments']),
|
54 |
+
'se_use_authors' => (isset($_POST['search_authors']) && $_POST['search_authors']),
|
55 |
+
'se_use_cmt_authors' => (isset($_POST['search_cmt_authors']) && $_POST['search_cmt_authors']),
|
56 |
+
'se_use_metadata_search' => (isset($_POST['search_metadata']) && $_POST['search_metadata']),
|
57 |
+
'se_use_highlight' => (isset($_POST['search_highlight']) && $_POST['search_highlight']),
|
58 |
+
'se_highlight_color' => (isset($_POST['highlight_color'])) ? $_POST['highlight_color'] : '',
|
59 |
+
'se_highlight_style' => (isset($_POST['highlight_style'])) ? $_POST['highlight_style'] : ''
|
60 |
+
);
|
61 |
+
|
62 |
+
if(isset($_POST['action']) && $_POST['action'] == "save") {
|
63 |
+
echo "<div class=\"updated fade\" id=\"limitcatsupdatenotice\"><p>" . __('Your default search settings have been <strong>updated</strong> by Search Everything. </p><p> What are you waiting for? Go check out the new search results!', 'SearchEverything') . "</p></div>";
|
64 |
+
se_update_options($new_options);
|
65 |
+
}
|
66 |
+
|
67 |
+
if(isset($_POST['action']) && $_POST['action'] == "reset") {
|
68 |
+
echo "<div class=\"updated fade\" id=\"limitcatsupdatenotice\"><p>" . __('Your default search settings have been <strong>updated</strong> by Search Everything. </p><p> What are you waiting for? Go check out the new search results!', 'SearchEverything') . "</p></div>";
|
69 |
+
$default_options = se_get_default_options();
|
70 |
+
se_update_options($default_options);
|
71 |
+
}
|
72 |
+
|
73 |
+
$options = se_get_options();
|
74 |
+
$meta = se_get_meta();
|
75 |
+
|
76 |
+
?>
|
77 |
+
|
78 |
+
<div class="wrap">
|
79 |
+
<h2><?php _e('Search Everything', 'SearchEverything'); ?> <?php echo $meta['version']; ?> - <?php _e('settings','SearchEverything');?></h2>
|
80 |
+
<p><?php _e('Customize your search by checking one or more options below.','SearchEverything'); ?></p>
|
81 |
+
<form method="post">
|
82 |
+
<table id="se-basic-settings" class="widefat">
|
83 |
+
<thead>
|
84 |
+
<tr class="title">
|
85 |
+
<th scope="col" class="manage-column se-col"><?php _e('Basic Configuration', 'SearchEverything'); ?></th>
|
86 |
+
<th scope="col" class="manage-column"></th>
|
87 |
+
</tr>
|
88 |
+
</thead>
|
89 |
+
<tbody> <?php
|
90 |
+
// Show options for 2.5 and below
|
91 |
+
if ($wp_version <= '2.5') : ?>
|
92 |
+
<tr valign="middle">
|
93 |
+
<th class="titledesc"><?php _e('Search every page','SearchEverything'); ?>:<br/><small></small></td>
|
94 |
+
<td><input type="checkbox" id="search_pages" name="search_pages" value="yes" <?php checked($options['se_use_page_search']); ?>);</td>
|
95 |
+
</tr>
|
96 |
+
<tr valign="middle">
|
97 |
+
<th scope="row" class="se-suboption"><label for="appvd_pages"><?php _e('Search approved pages only','SearchEverything'); ?>:</label></th>
|
98 |
+
<td><input type="checkbox" id="appvd_pages" name="appvd_pages" value="yes" <?php checked($options['se_approved_pages_only']); ?></td>
|
99 |
+
</tr><?php endif; ?> <?php
|
100 |
+
// Show tags only for WP 2.3+
|
101 |
+
if ($wp_version >= '2.3') : ?>
|
102 |
+
<tr valign="middle">
|
103 |
+
<th scope="row"><label for="search_tags"><?php _e('Search every tag name','SearchEverything'); ?>:</label></th>
|
104 |
+
<td><input type="checkbox" id="search_tags" name="search_tags" value="yes" <?php checked($options['se_use_tag_search']); ?></td>
|
105 |
+
</tr><?php endif; ?> <?php
|
106 |
+
// Show taxonomies only for WP 2.3+
|
107 |
+
if ($wp_version >= '2.3') : ?>
|
108 |
+
<tr valign="middle">
|
109 |
+
<th scope="row"><label for="search_tags"><?php _e('Search custom taxonomies','SearchEverything'); ?>:</label></th>
|
110 |
+
<td><input type="checkbox" id="search_tags" name="search_taxonomies" value="yes" <?php checked($options['se_use_tax_search']); ?></td>
|
111 |
+
</tr><?php endif; ?>
|
112 |
+
<?php
|
113 |
+
if ($wp_version >= '2.5') : ?>
|
114 |
+
<tr valign="middle">
|
115 |
+
<th scope="row"><label for="search_categories"><?php _e('Search every category name and description','SearchEverything'); ?>:</label></th>
|
116 |
+
<td><input type="checkbox" id="search_categories" name="search_categories" value="yes" <?php checked($options['se_use_category_search']); ?></td>
|
117 |
+
</tr><?php endif; ?>
|
118 |
+
<tr valign="middle">
|
119 |
+
<th scope="row"><label for="search_comments"><?php _e('Search every comment','SearchEverything'); ?>:</label></th>
|
120 |
+
<td><input type="checkbox" name="search_comments" id="search_comments" value="yes" <?php checked($options['se_use_comment_search']); ?></td>
|
121 |
+
</tr>
|
122 |
+
<tr valign="middle">
|
123 |
+
<th scope="row" class="se-suboption"><label for="search_cmt_authors"><?php _e('Search comment authors','SearchEverything'); ?>:</label></th>
|
124 |
+
<td><input type="checkbox" id="search_cmt_authors" name="search_cmt_authors" value="yes" <?php checked($options['se_use_cmt_authors']); ?></td>
|
125 |
+
</tr>
|
126 |
+
<tr valign="middle">
|
127 |
+
<th scope="row" class="se-suboption"><label for="appvd_comments"><?php _e('Search approved comments only','SearchEverything'); ?>:</label></th>
|
128 |
+
<td><input type="checkbox" id="appvd_comments" name="appvd_comments" value="yes" <?php checked($options['se_approved_comments_only']); ?></td>
|
129 |
+
</tr>
|
130 |
+
<tr valign="middle">
|
131 |
+
<th scope="row"><label for="search_excerpt"><?php _e('Search every excerpt','SearchEverything'); ?>:</label></th>
|
132 |
+
<td><input type="checkbox" id="search_excerpt" name="search_excerpt" value="yes" <?php checked($options['se_use_excerpt_search']); ?></td>
|
133 |
+
</tr>
|
134 |
+
<?php
|
135 |
+
// Show categories only for WP 2.5+
|
136 |
+
if ($wp_version >= '2.5') : ?>
|
137 |
+
<tr valign="middle">
|
138 |
+
<th scope="row"><label for="search_drafts"><?php _e('Search every draft','SearchEverything'); ?></label></th>
|
139 |
+
<td><input type="checkbox" id="search_drafts" name="search_drafts" value="yes" <?php checked($options['se_use_draft_search']); ?></td>
|
140 |
+
</tr>
|
141 |
+
<?php endif; ?>
|
142 |
+
<tr valign="middle">
|
143 |
+
<th><label for="search_attachments"><?php _e('Search every attachment','SearchEverything'); ?></label>:
|
144 |
+
<br/><small><?php _e('(post type = attachment)','SearchEverything'); ?></small></td>
|
145 |
+
<td><input type="checkbox" id="search_attachments" name="search_attachments" value="yes" <?php checked($options['se_use_attachment_search']); ?></td>
|
146 |
+
</tr>
|
147 |
+
<tr valign="middle">
|
148 |
+
<th scope="row"><label for="search_metadata"><?php _e('Search every custom field','SearchEverything'); ?>:</label><br/>
|
149 |
+
<small><?php _e('(metadata)','SearchEverything'); ?></small></tth>
|
150 |
+
<td><input type="checkbox" id="search_metadata" name="search_metadata" value="yes" <?php checked($options['se_use_metadata_search']); ?></td>
|
151 |
+
</tr>
|
152 |
+
<tr valign="middle">
|
153 |
+
<th scope="row"><label for="search_authors"><?php _e('Search every author','SearchEverything'); ?>:</label></th>
|
154 |
+
<td><input type="checkbox" id="search_authors" name="search_authors" value="yes" <?php checked($options['se_use_authors']); ?></td>
|
155 |
+
</tr>
|
156 |
+
<tr valign="middle">
|
157 |
+
<th scope="row"><label for="search_highlight"><?php _e('Highlight Search Terms','SearchEverything'); ?>:</label></th>
|
158 |
+
<td><input type="checkbox" id="search_highlight" name="search_highlight" value="yes" <?php checked($options['se_use_highlight']); ?></td>
|
159 |
+
</tr>
|
160 |
+
<tr valign="top">
|
161 |
+
<th scope="row" class="se-suboption"><label for="highlight_color"><?php _e('Highlight Background Color','SearchEverything'); ?>:</label></th>
|
162 |
+
<td>
|
163 |
+
<input type="text" id="highlight_color" name="highlight_color" value="<?php echo $options['se_highlight_color'];?>" /><br/>
|
164 |
+
<small> <?php _e('Examples:\'#FFF984\' or \'red\'','SearchEverything'); ?></small>
|
165 |
+
</td>
|
166 |
+
</tr>
|
167 |
+
</tbody>
|
168 |
+
</table>
|
169 |
+
<table id="se-advanced-settings" class="widefat">
|
170 |
+
<thead>
|
171 |
+
<tr class="title">
|
172 |
+
<th scope="col" class="manage-column se-col"><?php _e('Advanced Configuration - Exclusion', 'SearchEverything'); ?></th>
|
173 |
+
<th scope="col" class="manage-column"></th>
|
174 |
+
</tr>
|
175 |
+
</thead>
|
176 |
+
<tbody>
|
177 |
+
<tr valign="middle">
|
178 |
+
<th scope="row"><label for="exclude_posts_list"><?php _e('Exclude some post or page IDs','SearchEverything'); ?>:</label></th>
|
179 |
+
<td class="forminp">
|
180 |
+
<input type="text" id="exclude_posts_list" name="exclude_posts_list" value="<?php echo $options['se_exclude_posts_list'];?>" />
|
181 |
+
<br/><small><?php _e('Comma separated Post IDs (example: 1, 5, 9)','SearchEverything'); ?></small>
|
182 |
+
</td>
|
183 |
+
</tr>
|
184 |
+
<tr valign="middle">
|
185 |
+
<th scope="row"><label for="exclude_categories_list"><?php _e('Exclude Categories','SearchEverything'); ?>:</label></th>
|
186 |
+
<td class="forminp">
|
187 |
+
<input type="text" id="exclude_categories_list" name="exclude_categories_list" value="<?php echo $options['se_exclude_categories_list'];?>" />
|
188 |
+
<br/><small><?php _e('Comma separated category IDs (example: 1, 4)','SearchEverything'); ?></small>
|
189 |
+
</td>
|
190 |
+
</tr>
|
191 |
+
<tr valign="middle">
|
192 |
+
<th scope="row"><label for="highlight_style"><?php _e('Full Highlight Style','SearchEverything'); ?>:</label></th>
|
193 |
+
<td class="forminp">
|
194 |
+
<input type="text" id="highlight_style" name="highlight_style" value="<?php echo $options['se_highlight_style'];?>" /> <br/>
|
195 |
+
<small><?php _e('Important: \'Highlight Background Color\' must be blank to use this advanced styling.', 'SearchEverything') ?></small><br/>
|
196 |
+
<small><?php _e('Example: background-color: #FFF984; font-weight: bold; color: #000; padding: 0 1px;','SearchEverything'); ?></small>
|
197 |
+
</td>
|
198 |
+
</tr>
|
199 |
+
</tbody>
|
200 |
+
</table>
|
201 |
+
<p class="submit">
|
202 |
+
<input type="hidden" name="action" value="save" />
|
203 |
+
<input type="submit" class="button button-primary" value="<?php _e('Save Changes', 'SearchEverything') ?>" />
|
204 |
+
</p>
|
205 |
+
</form>
|
206 |
+
<table id="se-test-search" class="widefat">
|
207 |
+
<thead>
|
208 |
+
<tr class="title">
|
209 |
+
<th scope="col" class="manage-column se-col"><?php _e('Test Search Form', 'SearchEverything'); ?></th>
|
210 |
+
<th scope="col" class="manage-column"></th>
|
211 |
+
</tr>
|
212 |
+
</thead>
|
213 |
+
<tbody>
|
214 |
+
<tr valign="middle">
|
215 |
+
<th >
|
216 |
+
<?php _e('Use this search form to run a live search test.', 'SearchEverything'); ?>
|
217 |
+
</th>
|
218 |
+
<td>
|
219 |
+
<form method="get" id="searchform" action="<?php bloginfo($cap = version_compare('2.2', $wp_version, '<') ? 'url' : 'home'); ?>">
|
220 |
+
<p class="srch submit">
|
221 |
+
<input type="text" class="srch-txt" value="<?php echo (isset($S)) ? wp_specialchars($s, 1) : ''; ?>" name="s" id="s" size="30" />
|
222 |
+
<input type="submit" class="button"class="SE5_btn" id="searchsubmit" value="<?php _e('Run Test Search', 'SearchEverything'); ?>" />
|
223 |
+
</p>
|
224 |
+
</form>
|
225 |
+
</td>
|
226 |
+
</tr>
|
227 |
+
</tbody>
|
228 |
+
</table>
|
229 |
+
<table id="se-info" class="widefat">
|
230 |
+
<thead>
|
231 |
+
<tr class="title">
|
232 |
+
<th scope="col" class="manage-column se-col"><?php _e('News', 'SearchEverything'); ?></th>
|
233 |
+
<th scope="col" class="manage-column"><?php _e('Development Support', 'SearchEverything'); ?></th>
|
234 |
+
<th scope="col" class="manage-column"><?php _e('Localization Support', 'SearchEverything'); ?></th>
|
235 |
+
</tr>
|
236 |
+
</thead>
|
237 |
+
<tr valign="middle">
|
238 |
+
<td class="thanks">
|
239 |
+
<p><strong><?php _e('LOCALIZATION SUPPORT:', 'SearchEverything'); ?></strong><br/><?php _e('Version 6 was a major update and a few areas need new localization support. If you can help send us your translations by posting them as a new issue, ', 'SearchEverything') ?><a href="https://github.com/Zemanta/search-everything-wordpress-plugin/issues?sort=created&direction=desc&state=open&page=1" target="blank"><strong><?php _e('here','SearchEverything')?></strong></a>.</p>
|
240 |
+
<p><strong><?php _e('Thank You!', 'SearchEverything'); ?></strong><br/><?php _e('The development of Search Everything since Version one has primarily come from the WordPress community, We’m grateful for their dedicated and continued support.', 'SearchEverything'); ?></p>
|
241 |
+
</td>
|
242 |
+
<td>
|
243 |
+
<ul class="SE_lists">
|
244 |
+
<li><a href="https://github.com/ninnypants"><strong>Tyrel Kelsey</strong></a></li>
|
245 |
+
</ul>
|
246 |
+
</td>
|
247 |
+
<td>
|
248 |
+
<ul class="SE_lists">
|
249 |
+
<li><a href="#" target="blank">minjae kim (KR) - v.6</a></li>
|
250 |
+
<li><a href="http://www.r-sn.com/wp" target="blank">Anonymous (AR) - v.6</a></li>
|
251 |
+
<li><a href="http://www.doctorley.pl" target="blank">Karol Manikowski (PL) - v.6</a></li>
|
252 |
+
<li><a href="http://www.paulwicking.com" target="blank">Paul Wicking (NO)- v.6</a></li>
|
253 |
+
<li><a href="#">Bilei Radu (RO)- v.6</a></li>
|
254 |
+
<li><a href="http://www.fatcow.com" target="blank">Fat Cow (BY) - v.6</a></li>
|
255 |
+
<li><a href="http://gidibao.net/" target="blank">Gianni Diurno (IT) - v.6</a></li>
|
256 |
+
<li><a href="#">Maris Svirksts (LV) - v.6</a></li>
|
257 |
+
<li><a href="#">Simon Hansen (NN) - v.6</a></li>
|
258 |
+
<li><a href="http://beyn.org/" target="blank">jean Pierre Gavoille (FR) - v.6</a></li>
|
259 |
+
<li><a href="#">hit1205 (CN and TW)</a></li>
|
260 |
+
<li><a href="http://www.alohastone.com" target="blank">alohastone (DE)</a></li>
|
261 |
+
<li><a href="http://gidibao.net/" target="blank">Gianni Diurno (ES)</a></li>
|
262 |
+
<li><a href="#">János Csárdi-Braunstein (HU)</a></li>
|
263 |
+
<li><a href="http://idimensie.nl" target="blank">Joeke-Remkus de Vries (NL)</a></li>
|
264 |
+
<li><a href="#">Silver Ghost (RU)</a></li>
|
265 |
+
<li><a href="http://mishkin.se" target="blank">Mikael Jorhult (RU)</a></li>
|
266 |
+
<li><a href="#">Baris Unver (TR)</a></li>
|
267 |
+
</ul>
|
268 |
+
</td>
|
269 |
+
</tr>
|
270 |
+
</table>
|
271 |
+
</div>
|
272 |
+
|
273 |
+
<?php
|
274 |
+
} //end se_option_page
|
275 |
+
|
276 |
+
function se_options_page_notice() {
|
277 |
+
$screen = get_current_screen();
|
278 |
+
if ( 'settings_page_extend_search' == $screen->id ):
|
279 |
+
$close_url = admin_url( $screen->parent_file );
|
280 |
+
$close_url = add_query_arg( array(
|
281 |
+
'page' => 'extend_search',
|
282 |
+
'se_notice' => 0,
|
283 |
+
), $close_url );
|
284 |
+
?>
|
285 |
+
<div class="updated" id="se-top-notice" >
|
286 |
+
<a href="<?php echo $close_url; ?>" style="position: absolute; right: 30px; top: 20px;">Dismiss</a>
|
287 |
+
<h3>Good news everyone!</h3>
|
288 |
+
<p class="about-description">This plugin is <strong>alive</strong> again and we have great plans for it. Stay tuned.</p>
|
289 |
+
</div>
|
290 |
+
<?php
|
291 |
+
endif;
|
292 |
+
} //end page notice
|
293 |
+
} //end class
|
294 |
+
?>
|
readme.txt
CHANGED
@@ -1,49 +1,31 @@
|
|
1 |
=== Plugin Name ===
|
2 |
Contributors: zemanta
|
3 |
-
Donate link: http://bit.ly/plugin-donations
|
4 |
Tags: search, search highlight, tag search, category search, category exclusion, comment search, page search, admin, seo, post filter
|
5 |
Requires at least: 3
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 7.0.
|
8 |
|
9 |
-
|
10 |
|
11 |
|
12 |
== Update ==
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
It took a few years of kick-starting the Search Everything Plus project and it being subverted by new full-time projects at Sprout Venture before realizing it had to stop. Our goal of fixing WordPress search with SE+ needed too much focus, something we couldn't sacrifice because of growing client projects. After a year of trying and nothing awesome to show we decided to cease all planning and development on the Search Everything Plus plugin/service. </p>
|
17 |
-
|
18 |
-
But our goal of fixing WordPress search isn't lost and we have <strong>two</strong> recomendations for you:</p>
|
19 |
-
|
20 |
-
[SearchWP](http://s-v.me/RgIu)
|
21 |
-
They claim it's the best search plugin around and we can't agree more. It's seriously close to what we had planned for SE+, in many ways it's much better than what we counted on accomplishing.</p>
|
22 |
-
|
23 |
-
[Swiftype Search plugin](http://s-v.me/Q8wb)
|
24 |
-
It replaces the standard WordPress search with a better, more relevant search engine, and in doing so offloads the performance burden of search queries from your database to theirs.</p>
|
25 |
-
|
26 |
-
|
27 |
-
The advantages of both should be clear but if you're undecided we recomend [SearchWP](http://s-v.me/RgIu) becuase of how it doesn't require a subscription.
|
28 |
-
|
29 |
-
Sincerely,
|
30 |
-
Dan Cameron
|
31 |
-
Principal and Janitor, Sprout Venture Inc.
|
32 |
-
|
33 |
|
34 |
== Description ==
|
35 |
|
|
|
|
|
36 |
= Better WordPress search in three steps =
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
-
Options include search highlight, searching pages, excerpts, attachments, drafts, comments and custom fields (metadata).
|
43 |
|
44 |
= What it does: =
|
45 |
|
46 |
-
Search Everything increases the ability of the default Wordpress Search, options
|
47 |
|
48 |
* Search Highlighting
|
49 |
* Search Every Page
|
@@ -64,26 +46,22 @@ Search Everything increases the ability of the default Wordpress Search, options
|
|
64 |
|
65 |
Installation Instructions:
|
66 |
|
67 |
-
1. Download the plugin and unzip it
|
68 |
2. Put the 'search-everything' directory into your wp-content/plugins/ directory.
|
69 |
3. Go to the Plugins page in your WordPress Administration area and click 'Activate' next to Search Everything.
|
70 |
4. Go to the Options > Search Everything and configure your settings.
|
71 |
-
5. That's it.
|
72 |
|
73 |
|
74 |
== Frequently Asked Questions ==
|
75 |
|
76 |
= It doesn't work =
|
77 |
|
78 |
-
Read the installation guide.
|
79 |
-
|
80 |
-
= Where is feature x? =
|
81 |
-
|
82 |
-
[github Issues](https://github.com/sproutventure/search-everything-wordpress-plugin/issues "Github Issues"). Label it as a "feature-request"
|
83 |
|
84 |
= It *still* doesn't work (and you're certain there's a bug) =
|
85 |
|
86 |
-
[github Issues](https://github.com/
|
87 |
|
88 |
= What Translations are included? =
|
89 |
|
@@ -111,10 +89,14 @@ Read the installation guide.
|
|
111 |
|
112 |
1. Screenshot of the options panel
|
113 |
|
114 |
-
== Help ==
|
115 |
|
116 |
-
Send me your pull requests on [github](https://github.com/sproutventure/search-everything-wordpress-plugin "github")
|
117 |
|
118 |
-
==
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
[github Issues](https://github.com/sproutventure/search-everything-wordpress-plugin/issues "Github Issues")
|
1 |
=== Plugin Name ===
|
2 |
Contributors: zemanta
|
|
|
3 |
Tags: search, search highlight, tag search, category search, category exclusion, comment search, page search, admin, seo, post filter
|
4 |
Requires at least: 3
|
5 |
+
Tested up to: 3.8
|
6 |
+
Stable tag: 7.0.2
|
7 |
|
8 |
+
Search Everything increases WordPress' default search functionality in three easy steps.
|
9 |
|
10 |
|
11 |
== Update ==
|
12 |
|
13 |
+
From Jan 24, 2014 Search Everything originaly developed by dancameron, sproutventure will be maintained and developed further by Zemanta.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
== Description ==
|
16 |
|
17 |
+
Search Everything improves WordPress default search functionality without modifying any of the template pages. You can configure it to search pages, excerpts, attachments, drafts, comments, tags and custom fields (metadata) and you can specify your own search highlight style. It also offers the ability to exclude specific pages and posts. It does not search password-protected content. Simply install, configure... and search.
|
18 |
+
|
19 |
= Better WordPress search in three steps =
|
20 |
|
21 |
+
* Activate
|
22 |
+
* Configure options
|
23 |
+
* Search!
|
24 |
|
|
|
25 |
|
26 |
= What it does: =
|
27 |
|
28 |
+
Search Everything increases the ability of the default Wordpress Search, options include:
|
29 |
|
30 |
* Search Highlighting
|
31 |
* Search Every Page
|
46 |
|
47 |
Installation Instructions:
|
48 |
|
49 |
+
1. Download the plugin and unzip it.
|
50 |
2. Put the 'search-everything' directory into your wp-content/plugins/ directory.
|
51 |
3. Go to the Plugins page in your WordPress Administration area and click 'Activate' next to Search Everything.
|
52 |
4. Go to the Options > Search Everything and configure your settings.
|
53 |
+
5. That's it. You can search now.
|
54 |
|
55 |
|
56 |
== Frequently Asked Questions ==
|
57 |
|
58 |
= It doesn't work =
|
59 |
|
60 |
+
Read the installation guide.
|
|
|
|
|
|
|
|
|
61 |
|
62 |
= It *still* doesn't work (and you're certain there's a bug) =
|
63 |
|
64 |
+
Please open a new issue at [github Issues](https://github.com/zemanta/search-everything-wordpress-plugin/issues "Github Issues")
|
65 |
|
66 |
= What Translations are included? =
|
67 |
|
89 |
|
90 |
1. Screenshot of the options panel
|
91 |
|
|
|
92 |
|
|
|
93 |
|
94 |
+
== Changelog ==
|
95 |
+
|
96 |
+
= 7.0.2 =
|
97 |
+
* Added config file with installation and migration functions
|
98 |
+
* Refactored code, removed Yes options
|
99 |
+
* Replaced deprecated functions
|
100 |
+
|
101 |
|
102 |
[github Issues](https://github.com/sproutventure/search-everything-wordpress-plugin/issues "Github Issues")
|
search-everything.php
CHANGED
@@ -1,32 +1,36 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Search Everything
|
4 |
-
Plugin URI: https://github.com/
|
5 |
Description: Adds search functionality without modifying any template pages: Activate, Configure and Search. Options Include: search highlight, 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: 7.0.
|
7 |
-
Author:
|
8 |
-
Author URI: http://
|
9 |
*/
|
10 |
|
11 |
-
|
12 |
-
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
13 |
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
if (
|
18 |
-
define(
|
19 |
|
20 |
-
if (
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
27 |
|
|
|
28 |
$SE = new SearchEverything();
|
29 |
//add filters based upon option settings
|
|
|
30 |
|
31 |
class SearchEverything {
|
32 |
|
@@ -42,59 +46,59 @@ class SearchEverything {
|
|
42 |
$this->wp_ver23 = ( $wp_version >= '2.3' );
|
43 |
$this->wp_ver25 = ( $wp_version >= '2.5' );
|
44 |
$this->wp_ver28 = ( $wp_version >= '2.8' );
|
45 |
-
$this->options =
|
46 |
|
47 |
-
if (
|
48 |
-
include SE_ABSPATH . 'views/options.php';
|
49 |
$SEAdmin = new se_admin();
|
50 |
// Disable Search-Everything, because posts_join is not working properly in Wordpress-backend's Ajax functions
|
51 |
if ( basename( $_SERVER["SCRIPT_NAME"] ) == "admin-ajax.php" ) {
|
52 |
return true;
|
53 |
}
|
54 |
}
|
|
|
55 |
//add filters based upon option settings
|
56 |
-
if (
|
57 |
add_filter( 'posts_join', array( &$this, 'se_terms_join' ) );
|
58 |
-
if (
|
59 |
$this->se_log( "searching tags" );
|
60 |
}
|
61 |
-
if (
|
62 |
$this->se_log( "searching categories" );
|
63 |
}
|
64 |
-
if (
|
65 |
$this->se_log( "searching custom taxonomies" );
|
66 |
}
|
67 |
}
|
68 |
|
69 |
-
if (
|
70 |
add_filter( 'posts_where', array( &$this, 'se_search_pages' ) );
|
71 |
$this->se_log( "searching pages" );
|
72 |
}
|
73 |
|
74 |
-
if (
|
75 |
$this->se_log( "searching excerpts" );
|
76 |
}
|
77 |
|
78 |
-
if (
|
79 |
add_filter( 'posts_join', array( &$this, 'se_comments_join' ) );
|
80 |
$this->se_log( "searching comments" );
|
81 |
// Highlight content
|
82 |
-
if (
|
83 |
add_filter( 'comment_text', array( &$this, 'se_postfilter' ) );
|
84 |
}
|
85 |
}
|
86 |
|
87 |
-
if (
|
88 |
add_filter( 'posts_where', array( &$this, 'se_search_draft_posts' ) );
|
89 |
$this->se_log( "searching drafts" );
|
90 |
}
|
91 |
|
92 |
-
if (
|
93 |
add_filter( 'posts_where', array( &$this, 'se_search_attachments' ) );
|
94 |
$this->se_log( "searching attachments" );
|
95 |
}
|
96 |
|
97 |
-
if (
|
98 |
add_filter( 'posts_join', array( &$this, 'se_search_metadata_join' ) );
|
99 |
$this->se_log( "searching metadata" );
|
100 |
}
|
@@ -110,7 +114,7 @@ class SearchEverything {
|
|
110 |
$this->se_log( "searching excluding categories" );
|
111 |
}
|
112 |
|
113 |
-
if (
|
114 |
|
115 |
add_filter( 'posts_join', array( &$this, 'se_search_authors_join' ) );
|
116 |
$this->se_log( "searching authors" );
|
@@ -127,7 +131,7 @@ class SearchEverything {
|
|
127 |
add_filter( 'posts_request', array( &$this, 'se_log_query' ), 10, 2 );
|
128 |
|
129 |
// Highlight content
|
130 |
-
if (
|
131 |
add_filter( 'the_content', array( &$this, 'se_postfilter' ), 11 );
|
132 |
add_filter( 'the_title', array( &$this, 'se_postfilter' ), 11 );
|
133 |
add_filter( 'the_excerpt', array( &$this, 'se_postfilter' ), 11 );
|
@@ -167,22 +171,22 @@ class SearchEverything {
|
|
167 |
$searchQuery = $this->se_search_default();
|
168 |
|
169 |
//add filters based upon option settings
|
170 |
-
if (
|
171 |
$searchQuery .= $this->se_build_search_tag();
|
172 |
}
|
173 |
-
if (
|
174 |
$searchQuery .= $this->se_build_search_categories();
|
175 |
}
|
176 |
-
if (
|
177 |
$searchQuery .= $this->se_build_search_metadata();
|
178 |
}
|
179 |
-
if (
|
180 |
$searchQuery .= $this->se_build_search_excerpt();
|
181 |
}
|
182 |
-
if (
|
183 |
$searchQuery .= $this->se_build_search_comments();
|
184 |
}
|
185 |
-
if (
|
186 |
$searchQuery .= $this->se_search_authors();
|
187 |
}
|
188 |
if ( $searchQuery != '' ) {
|
@@ -255,7 +259,7 @@ class SearchEverything {
|
|
255 |
function se_log( $msg ) {
|
256 |
|
257 |
if ( $this->logging ) {
|
258 |
-
$fp = fopen(
|
259 |
if ( !$fp ) {
|
260 |
echo 'unable to write to log file!';
|
261 |
}
|
@@ -285,7 +289,7 @@ class SearchEverything {
|
|
285 |
if ( !empty( $this->query_instance->query_vars['s'] ) ) {
|
286 |
|
287 |
$where = str_replace( '"', '\'', $where );
|
288 |
-
if (
|
289 |
$where = str_replace( "post_type = 'post'", " AND 'post_password = '' AND ", $where );
|
290 |
} else { // < v 2.1
|
291 |
$where = str_replace( 'post_type = \'post\' AND ', '', $where );
|
@@ -298,9 +302,11 @@ class SearchEverything {
|
|
298 |
// create the search excerpts query
|
299 |
function se_build_search_excerpt() {
|
300 |
global $wpdb;
|
301 |
-
$
|
|
|
|
|
302 |
$search_terms = $this->se_get_search_terms();
|
303 |
-
$exact = $
|
304 |
$search = '';
|
305 |
|
306 |
if ( !empty( $search_terms ) ) {
|
@@ -312,14 +318,14 @@ class SearchEverything {
|
|
312 |
$search .= "{$searchand}($wpdb->posts.post_excerpt LIKE '{$n}{$term}{$n}')";
|
313 |
$searchand = ' AND ';
|
314 |
}
|
315 |
-
$sentence_term =
|
316 |
-
if (
|
317 |
$search = "($search) OR ($wpdb->posts.post_excerpt LIKE '{$n}{$sentence_term}{$n}')";
|
318 |
}
|
319 |
if ( !empty( $search ) )
|
320 |
$search = " OR ({$search}) ";
|
321 |
}
|
322 |
-
|
323 |
return $search;
|
324 |
}
|
325 |
|
@@ -362,9 +368,11 @@ class SearchEverything {
|
|
362 |
// create the comments data query
|
363 |
function se_build_search_comments() {
|
364 |
global $wpdb;
|
365 |
-
$
|
|
|
|
|
366 |
$search_terms = $this->se_get_search_terms();
|
367 |
-
$exact = $
|
368 |
|
369 |
if ( !empty( $search_terms ) ) {
|
370 |
// Building search query on comments content
|
@@ -378,15 +386,15 @@ class SearchEverything {
|
|
378 |
}
|
379 |
$searchand = ' AND ';
|
380 |
}
|
381 |
-
$sentense_term =
|
382 |
-
if (
|
383 |
if ( $this->wp_ver23 ) {
|
384 |
$searchContent = "($searchContent) OR (cmt.comment_content LIKE '{$n}{$sentense_term}{$n}')";
|
385 |
}
|
386 |
}
|
387 |
$search = $searchContent;
|
388 |
// Building search query on comments author
|
389 |
-
if ( $this->options['se_use_cmt_authors']
|
390 |
$searchand = '';
|
391 |
$comment_author = '';
|
392 |
foreach ( $search_terms as $term ) {
|
@@ -396,22 +404,22 @@ class SearchEverything {
|
|
396 |
}
|
397 |
$searchand = ' AND ';
|
398 |
}
|
399 |
-
$sentence_term =
|
400 |
-
if (
|
401 |
if ( $this->wp_ver23 ) {
|
402 |
$comment_author = "($comment_author) OR (cmt.comment_author LIKE '{$n}{$sentence_term}{$n}')";
|
403 |
}
|
404 |
}
|
405 |
$search = "($search) OR ($comment_author)";
|
406 |
}
|
407 |
-
if (
|
408 |
$comment_approved = "AND cmt.comment_approved = '1'";
|
409 |
$search = "($search) $comment_approved";
|
410 |
}
|
411 |
if ( !empty( $search ) )
|
412 |
$search = " OR ({$search}) ";
|
413 |
}
|
414 |
-
|
415 |
$this->se_log( "comments sql: ".$search );
|
416 |
return $search;
|
417 |
}
|
@@ -436,7 +444,7 @@ class SearchEverything {
|
|
436 |
}
|
437 |
$searchand = ' OR ';
|
438 |
}
|
439 |
-
$sentence_term =
|
440 |
if ( count( $search_terms ) > 1 && $search_terms[0] != $sentence_term ) {
|
441 |
if ( $this->wp_ver23 ) {
|
442 |
$search .= " OR (u.display_name LIKE '{$n}{$sentence_term}{$n}')";
|
@@ -476,7 +484,7 @@ class SearchEverything {
|
|
476 |
}
|
477 |
$searchand = ' AND ';
|
478 |
}
|
479 |
-
$sentence_term =
|
480 |
if ( count( $search_terms ) > 1 && $search_terms[0] != $sentence_term ) {
|
481 |
if ( $this->wp_ver23 ) {
|
482 |
$search = "($search) OR (m.meta_value LIKE '{$n}{$sentence_term}{$n}')";
|
@@ -496,9 +504,11 @@ class SearchEverything {
|
|
496 |
// create the search tag query
|
497 |
function se_build_search_tag() {
|
498 |
global $wpdb;
|
499 |
-
$
|
|
|
|
|
500 |
$search_terms = $this->se_get_search_terms();
|
501 |
-
$exact = $
|
502 |
$search = '';
|
503 |
|
504 |
if ( !empty( $search_terms ) ) {
|
@@ -512,8 +522,8 @@ class SearchEverything {
|
|
512 |
}
|
513 |
$searchand = ' AND ';
|
514 |
}
|
515 |
-
$sentence_term =
|
516 |
-
if (
|
517 |
if ( $this->wp_ver23 ) {
|
518 |
$search = "($search) OR (tter.name LIKE '{$n}{$sentence_term}{$n}')";
|
519 |
}
|
@@ -528,9 +538,11 @@ class SearchEverything {
|
|
528 |
// create the search categories query
|
529 |
function se_build_search_categories() {
|
530 |
global $wpdb;
|
531 |
-
$
|
|
|
|
|
532 |
$search_terms = $this->se_get_search_terms();
|
533 |
-
$exact = $
|
534 |
$search = '';
|
535 |
|
536 |
if ( !empty( $search_terms ) ) {
|
@@ -543,7 +555,7 @@ class SearchEverything {
|
|
543 |
$searchSlug .= "{$searchand}(tter.slug LIKE '{$n}".sanitize_title_with_dashes( $term )."{$n}')";
|
544 |
$searchand = ' AND ';
|
545 |
}
|
546 |
-
if (
|
547 |
$searchSlug = "($searchSlug) OR (tter.slug LIKE '{$n}".sanitize_title_with_dashes( $s )."{$n}')";
|
548 |
}
|
549 |
if ( !empty( $searchSlug ) )
|
@@ -557,8 +569,8 @@ class SearchEverything {
|
|
557 |
$searchDesc .= "{$searchand}(ttax.description LIKE '{$n}{$term}{$n}')";
|
558 |
$searchand = ' AND ';
|
559 |
}
|
560 |
-
$sentence_term =
|
561 |
-
if (
|
562 |
$searchDesc = "($searchDesc) OR (ttax.description LIKE '{$n}{$sentence_term}{$n}')";
|
563 |
}
|
564 |
if ( !empty( $searchDesc ) )
|
@@ -629,7 +641,7 @@ class SearchEverything {
|
|
629 |
|
630 |
} else {
|
631 |
|
632 |
-
if (
|
633 |
$comment_approved = " AND comment_approved = '1'";
|
634 |
} else {
|
635 |
$comment_approved = '';
|
@@ -686,9 +698,11 @@ class SearchEverything {
|
|
686 |
}
|
687 |
// if we're searching custom taxonomies
|
688 |
if ( $this->options['se_use_tax_search'] ) {
|
689 |
-
$all_taxonomies =
|
|
|
|
|
690 |
foreach ( $all_taxonomies as $taxonomy ) {
|
691 |
-
if ( $taxonomy
|
692 |
continue;
|
693 |
$on[] = "ttax.taxonomy = '".addslashes( $taxonomy )."'";
|
694 |
}
|
@@ -706,7 +720,7 @@ class SearchEverything {
|
|
706 |
// in the search result page.
|
707 |
function se_postfilter( $postcontent ) {
|
708 |
global $wpdb;
|
709 |
-
$s = $this->query_instance->query_vars['s'];
|
710 |
// highlighting
|
711 |
if ( is_search() && $s != '' ) {
|
712 |
$highlight_color = $this->options['se_highlight_color'];
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Search Everything
|
4 |
+
Plugin URI: https://github.com/Zemanta/search-everything-wordpress-plugin/
|
5 |
Description: Adds search functionality without modifying any template pages: Activate, Configure and Search. Options Include: search highlight, 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: 7.0.2
|
7 |
+
Author: Zemanta
|
8 |
+
Author URI: http://www.zemanta.com
|
9 |
*/
|
10 |
|
11 |
+
define('SE_VERSION', '7.0.2');
|
|
|
12 |
|
13 |
+
if (!defined('SE_PLUGIN_FILE'))
|
14 |
+
define('SE_PLUGIN_FILE', plugin_basename(__FILE__));
|
15 |
|
16 |
+
if (!defined('SE_PLUGIN_NAME'))
|
17 |
+
define('SE_PLUGIN_NAME', trim(dirname(plugin_basename(__FILE__)), '/'));
|
18 |
|
19 |
+
if (!defined('SE_PLUGIN_DIR'))
|
20 |
+
define('SE_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . SE_PLUGIN_NAME);
|
21 |
+
|
22 |
+
if (!defined('SE_PLUGIN_URL'))
|
23 |
+
define('SE_PLUGIN_URL', WP_PLUGIN_URL . '/' . SE_PLUGIN_NAME);
|
24 |
+
|
25 |
+
include_once(SE_PLUGIN_DIR . '/config.php');
|
26 |
+
include_once(SE_PLUGIN_DIR . '/options.php');
|
27 |
+
|
28 |
+
add_action('wp_loaded','se_initialize_plugin');
|
29 |
|
30 |
+
function se_initialize_plugin() {
|
31 |
$SE = new SearchEverything();
|
32 |
//add filters based upon option settings
|
33 |
+
}
|
34 |
|
35 |
class SearchEverything {
|
36 |
|
46 |
$this->wp_ver23 = ( $wp_version >= '2.3' );
|
47 |
$this->wp_ver25 = ( $wp_version >= '2.5' );
|
48 |
$this->wp_ver28 = ( $wp_version >= '2.8' );
|
49 |
+
$this->options = se_get_options();
|
50 |
|
51 |
+
if ( current_user_can('manage_options') ) {
|
|
|
52 |
$SEAdmin = new se_admin();
|
53 |
// Disable Search-Everything, because posts_join is not working properly in Wordpress-backend's Ajax functions
|
54 |
if ( basename( $_SERVER["SCRIPT_NAME"] ) == "admin-ajax.php" ) {
|
55 |
return true;
|
56 |
}
|
57 |
}
|
58 |
+
|
59 |
//add filters based upon option settings
|
60 |
+
if ( $this->options['se_use_tag_search'] || $this->options['se_use_category_search'] || $this->options['se_use_tax_search'] ) {
|
61 |
add_filter( 'posts_join', array( &$this, 'se_terms_join' ) );
|
62 |
+
if ( $this->options['se_use_tag_search'] ) {
|
63 |
$this->se_log( "searching tags" );
|
64 |
}
|
65 |
+
if ( $this->options['se_use_category_search'] ) {
|
66 |
$this->se_log( "searching categories" );
|
67 |
}
|
68 |
+
if ( $this->options['se_use_tax_search'] ) {
|
69 |
$this->se_log( "searching custom taxonomies" );
|
70 |
}
|
71 |
}
|
72 |
|
73 |
+
if ( $this->options['se_use_page_search'] ) {
|
74 |
add_filter( 'posts_where', array( &$this, 'se_search_pages' ) );
|
75 |
$this->se_log( "searching pages" );
|
76 |
}
|
77 |
|
78 |
+
if ( $this->options['se_use_excerpt_search'] ) {
|
79 |
$this->se_log( "searching excerpts" );
|
80 |
}
|
81 |
|
82 |
+
if ( $this->options['se_use_comment_search'] ) {
|
83 |
add_filter( 'posts_join', array( &$this, 'se_comments_join' ) );
|
84 |
$this->se_log( "searching comments" );
|
85 |
// Highlight content
|
86 |
+
if ( $this->options['se_use_highlight'] ) {
|
87 |
add_filter( 'comment_text', array( &$this, 'se_postfilter' ) );
|
88 |
}
|
89 |
}
|
90 |
|
91 |
+
if ( $this->options['se_use_draft_search'] ) {
|
92 |
add_filter( 'posts_where', array( &$this, 'se_search_draft_posts' ) );
|
93 |
$this->se_log( "searching drafts" );
|
94 |
}
|
95 |
|
96 |
+
if ( $this->options['se_use_attachment_search'] ) {
|
97 |
add_filter( 'posts_where', array( &$this, 'se_search_attachments' ) );
|
98 |
$this->se_log( "searching attachments" );
|
99 |
}
|
100 |
|
101 |
+
if ( $this->options['se_use_metadata_search'] ) {
|
102 |
add_filter( 'posts_join', array( &$this, 'se_search_metadata_join' ) );
|
103 |
$this->se_log( "searching metadata" );
|
104 |
}
|
114 |
$this->se_log( "searching excluding categories" );
|
115 |
}
|
116 |
|
117 |
+
if ( $this->options['se_use_authors'] ) {
|
118 |
|
119 |
add_filter( 'posts_join', array( &$this, 'se_search_authors_join' ) );
|
120 |
$this->se_log( "searching authors" );
|
131 |
add_filter( 'posts_request', array( &$this, 'se_log_query' ), 10, 2 );
|
132 |
|
133 |
// Highlight content
|
134 |
+
if ( $this->options['se_use_highlight'] ) {
|
135 |
add_filter( 'the_content', array( &$this, 'se_postfilter' ), 11 );
|
136 |
add_filter( 'the_title', array( &$this, 'se_postfilter' ), 11 );
|
137 |
add_filter( 'the_excerpt', array( &$this, 'se_postfilter' ), 11 );
|
171 |
$searchQuery = $this->se_search_default();
|
172 |
|
173 |
//add filters based upon option settings
|
174 |
+
if ( $this->options['se_use_tag_search'] ) {
|
175 |
$searchQuery .= $this->se_build_search_tag();
|
176 |
}
|
177 |
+
if ( $this->options['se_use_category_search'] || $this->options['se_use_tax_search'] ) {
|
178 |
$searchQuery .= $this->se_build_search_categories();
|
179 |
}
|
180 |
+
if ( $this->options['se_use_metadata_search'] ) {
|
181 |
$searchQuery .= $this->se_build_search_metadata();
|
182 |
}
|
183 |
+
if ( $this->options['se_use_excerpt_search'] ) {
|
184 |
$searchQuery .= $this->se_build_search_excerpt();
|
185 |
}
|
186 |
+
if ( $this->options['se_use_comment_search'] ) {
|
187 |
$searchQuery .= $this->se_build_search_comments();
|
188 |
}
|
189 |
+
if ( $this->options['se_use_authors'] ) {
|
190 |
$searchQuery .= $this->se_search_authors();
|
191 |
}
|
192 |
if ( $searchQuery != '' ) {
|
259 |
function se_log( $msg ) {
|
260 |
|
261 |
if ( $this->logging ) {
|
262 |
+
$fp = fopen( SE_PLUGIN_DIR. "logfile.log", "a+" );
|
263 |
if ( !$fp ) {
|
264 |
echo 'unable to write to log file!';
|
265 |
}
|
289 |
if ( !empty( $this->query_instance->query_vars['s'] ) ) {
|
290 |
|
291 |
$where = str_replace( '"', '\'', $where );
|
292 |
+
if ( $this->options['se_approved_pages_only'] ) {
|
293 |
$where = str_replace( "post_type = 'post'", " AND 'post_password = '' AND ", $where );
|
294 |
} else { // < v 2.1
|
295 |
$where = str_replace( 'post_type = \'post\' AND ', '', $where );
|
302 |
// create the search excerpts query
|
303 |
function se_build_search_excerpt() {
|
304 |
global $wpdb;
|
305 |
+
$vars = $this->query_instance->query_vars;
|
306 |
+
|
307 |
+
$s = $vars['s'];
|
308 |
$search_terms = $this->se_get_search_terms();
|
309 |
+
$exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
|
310 |
$search = '';
|
311 |
|
312 |
if ( !empty( $search_terms ) ) {
|
318 |
$search .= "{$searchand}($wpdb->posts.post_excerpt LIKE '{$n}{$term}{$n}')";
|
319 |
$searchand = ' AND ';
|
320 |
}
|
321 |
+
$sentence_term = esc_sql( $s );
|
322 |
+
if ( count( $search_terms ) > 1 && $search_terms[0] != $sentence_term ) {
|
323 |
$search = "($search) OR ($wpdb->posts.post_excerpt LIKE '{$n}{$sentence_term}{$n}')";
|
324 |
}
|
325 |
if ( !empty( $search ) )
|
326 |
$search = " OR ({$search}) ";
|
327 |
}
|
328 |
+
|
329 |
return $search;
|
330 |
}
|
331 |
|
368 |
// create the comments data query
|
369 |
function se_build_search_comments() {
|
370 |
global $wpdb;
|
371 |
+
$vars = $this->query_instance->query_vars;
|
372 |
+
|
373 |
+
$s = $vars['s'];
|
374 |
$search_terms = $this->se_get_search_terms();
|
375 |
+
$exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
|
376 |
|
377 |
if ( !empty( $search_terms ) ) {
|
378 |
// Building search query on comments content
|
386 |
}
|
387 |
$searchand = ' AND ';
|
388 |
}
|
389 |
+
$sentense_term = esc_sql( $s );
|
390 |
+
if ( count( $search_terms ) > 1 && $search_terms[0] != $sentense_term ) {
|
391 |
if ( $this->wp_ver23 ) {
|
392 |
$searchContent = "($searchContent) OR (cmt.comment_content LIKE '{$n}{$sentense_term}{$n}')";
|
393 |
}
|
394 |
}
|
395 |
$search = $searchContent;
|
396 |
// Building search query on comments author
|
397 |
+
if ( $this->options['se_use_cmt_authors'] ) {
|
398 |
$searchand = '';
|
399 |
$comment_author = '';
|
400 |
foreach ( $search_terms as $term ) {
|
404 |
}
|
405 |
$searchand = ' AND ';
|
406 |
}
|
407 |
+
$sentence_term = esc_sql( $s );
|
408 |
+
if ( count( $search_terms ) > 1 && $search_terms[0] != $sentence_term ) {
|
409 |
if ( $this->wp_ver23 ) {
|
410 |
$comment_author = "($comment_author) OR (cmt.comment_author LIKE '{$n}{$sentence_term}{$n}')";
|
411 |
}
|
412 |
}
|
413 |
$search = "($search) OR ($comment_author)";
|
414 |
}
|
415 |
+
if ( $this->options['se_approved_comments_only'] ) {
|
416 |
$comment_approved = "AND cmt.comment_approved = '1'";
|
417 |
$search = "($search) $comment_approved";
|
418 |
}
|
419 |
if ( !empty( $search ) )
|
420 |
$search = " OR ({$search}) ";
|
421 |
}
|
422 |
+
//$this->se_log( "comments where: ".$where );
|
423 |
$this->se_log( "comments sql: ".$search );
|
424 |
return $search;
|
425 |
}
|
444 |
}
|
445 |
$searchand = ' OR ';
|
446 |
}
|
447 |
+
$sentence_term = esc_sql( $s );
|
448 |
if ( count( $search_terms ) > 1 && $search_terms[0] != $sentence_term ) {
|
449 |
if ( $this->wp_ver23 ) {
|
450 |
$search .= " OR (u.display_name LIKE '{$n}{$sentence_term}{$n}')";
|
484 |
}
|
485 |
$searchand = ' AND ';
|
486 |
}
|
487 |
+
$sentence_term = esc_sql( $s );
|
488 |
if ( count( $search_terms ) > 1 && $search_terms[0] != $sentence_term ) {
|
489 |
if ( $this->wp_ver23 ) {
|
490 |
$search = "($search) OR (m.meta_value LIKE '{$n}{$sentence_term}{$n}')";
|
504 |
// create the search tag query
|
505 |
function se_build_search_tag() {
|
506 |
global $wpdb;
|
507 |
+
$vars = $this->query_instance->query_vars;
|
508 |
+
|
509 |
+
$s = $vars['s'];
|
510 |
$search_terms = $this->se_get_search_terms();
|
511 |
+
$exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
|
512 |
$search = '';
|
513 |
|
514 |
if ( !empty( $search_terms ) ) {
|
522 |
}
|
523 |
$searchand = ' AND ';
|
524 |
}
|
525 |
+
$sentence_term = esc_sql( $s );
|
526 |
+
if ( count( $search_terms ) > 1 && $search_terms[0] != $sentence_term ) {
|
527 |
if ( $this->wp_ver23 ) {
|
528 |
$search = "($search) OR (tter.name LIKE '{$n}{$sentence_term}{$n}')";
|
529 |
}
|
538 |
// create the search categories query
|
539 |
function se_build_search_categories() {
|
540 |
global $wpdb;
|
541 |
+
$vars = $this->query_instance->query_vars;
|
542 |
+
|
543 |
+
$s = $vars['s'];
|
544 |
$search_terms = $this->se_get_search_terms();
|
545 |
+
$exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
|
546 |
$search = '';
|
547 |
|
548 |
if ( !empty( $search_terms ) ) {
|
555 |
$searchSlug .= "{$searchand}(tter.slug LIKE '{$n}".sanitize_title_with_dashes( $term )."{$n}')";
|
556 |
$searchand = ' AND ';
|
557 |
}
|
558 |
+
if ( count( $search_terms ) > 1 && $search_terms[0] != $s ) {
|
559 |
$searchSlug = "($searchSlug) OR (tter.slug LIKE '{$n}".sanitize_title_with_dashes( $s )."{$n}')";
|
560 |
}
|
561 |
if ( !empty( $searchSlug ) )
|
569 |
$searchDesc .= "{$searchand}(ttax.description LIKE '{$n}{$term}{$n}')";
|
570 |
$searchand = ' AND ';
|
571 |
}
|
572 |
+
$sentence_term = esc_sql( $s );
|
573 |
+
if ( count( $search_terms ) > 1 && $search_terms[0] != $sentence_term ) {
|
574 |
$searchDesc = "($searchDesc) OR (ttax.description LIKE '{$n}{$sentence_term}{$n}')";
|
575 |
}
|
576 |
if ( !empty( $searchDesc ) )
|
641 |
|
642 |
} else {
|
643 |
|
644 |
+
if ( $this->options['se_approved_comments_only'] ) {
|
645 |
$comment_approved = " AND comment_approved = '1'";
|
646 |
} else {
|
647 |
$comment_approved = '';
|
698 |
}
|
699 |
// if we're searching custom taxonomies
|
700 |
if ( $this->options['se_use_tax_search'] ) {
|
701 |
+
$all_taxonomies = get_taxonomies();
|
702 |
+
$filter_taxonomies = array( 'post_tag', 'category', 'nav_menu', 'link_category' );
|
703 |
+
|
704 |
foreach ( $all_taxonomies as $taxonomy ) {
|
705 |
+
if ( in_array( $taxonomy, $filter_taxonomies ) )
|
706 |
continue;
|
707 |
$on[] = "ttax.taxonomy = '".addslashes( $taxonomy )."'";
|
708 |
}
|
720 |
// in the search result page.
|
721 |
function se_postfilter( $postcontent ) {
|
722 |
global $wpdb;
|
723 |
+
$s = isset( $this->query_instance->query_vars['s'] ) ? $this->query_instance->query_vars['s'] : '';
|
724 |
// highlighting
|
725 |
if ( is_search() && $s != '' ) {
|
726 |
$highlight_color = $this->options['se_highlight_color'];
|
views/options.php
DELETED
@@ -1,427 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
Class se_admin {
|
4 |
-
|
5 |
-
var $version = '6.9';
|
6 |
-
|
7 |
-
function se_admin() {
|
8 |
-
|
9 |
-
// Load language file
|
10 |
-
$locale = get_locale();
|
11 |
-
if ( !empty($locale) )
|
12 |
-
load_textdomain('SearchEverything', SE_ABSPATH .'lang/se-'.$locale.'.mo');
|
13 |
-
|
14 |
-
|
15 |
-
add_action('admin_head', array(&$this, 'se_options_style'));
|
16 |
-
add_action('admin_menu', array(&$this, 'se_add_options_panel'));
|
17 |
-
|
18 |
-
}
|
19 |
-
|
20 |
-
function se_add_options_panel() {
|
21 |
-
global $wp_version;
|
22 |
-
$cap = version_compare('2.0', $wp_version, '<') ? 'publish_posts' : 7;
|
23 |
-
add_options_page('Search', 'Search Everything', $cap, 'extend_search', array(&$this, 'se_option_page'));
|
24 |
-
}
|
25 |
-
|
26 |
-
//build admin interface
|
27 |
-
function se_option_page() {
|
28 |
-
global $wpdb, $table_prefix, $wp_version;
|
29 |
-
|
30 |
-
$new_options = array(
|
31 |
-
'se_exclude_categories' => (isset($_POST['exclude_categories']) && !empty($_POST['exclude_categories'])) ? $_POST['exclude_categories'] : '',
|
32 |
-
'se_exclude_categories_list' => (isset($_POST['exclude_categories_list']) && !empty($_POST['exclude_categories_list'])) ? $_POST['exclude_categories_list'] : '',
|
33 |
-
'se_exclude_posts' => (isset($_POST['exclude_posts'])) ? $_POST['exclude_posts'] : '',
|
34 |
-
'se_exclude_posts_list' => (isset($_POST['exclude_posts_list']) && !empty($_POST['exclude_posts_list'])) ? $_POST['exclude_posts_list'] : '',
|
35 |
-
'se_use_page_search' => (isset($_POST['search_pages']) && $_POST['search_pages'] == 'Yes') ? 'Yes' : 'No',
|
36 |
-
'se_use_comment_search' => (isset($_POST['search_comments']) && $_POST['search_comments'] == 'Yes') ? 'Yes' : 'No',
|
37 |
-
'se_use_tag_search' => (isset($_POST['search_tags']) && $_POST['search_tags'] == 'Yes') ? 'Yes' : 'No',
|
38 |
-
'se_use_tax_search' => (isset($_POST['search_taxonomies']) && $_POST['search_taxonomies'] == 'Yes') ? 'Yes' : 'No',
|
39 |
-
'se_use_category_search' => (isset($_POST['search_categories']) && $_POST['search_categories'] == 'Yes') ? 'Yes' : 'No',
|
40 |
-
'se_approved_comments_only' => (isset($_POST['appvd_comments']) && $_POST['appvd_comments'] == 'Yes') ? 'Yes' : 'No',
|
41 |
-
'se_approved_pages_only' => (isset($_POST['appvd_pages']) && $_POST['appvd_pages'] == 'Yes') ? 'Yes' : 'No',
|
42 |
-
'se_use_excerpt_search' => (isset($_POST['search_excerpt']) && $_POST['search_excerpt'] == 'Yes') ? 'Yes' : 'No',
|
43 |
-
'se_use_draft_search' => (isset($_POST['search_drafts']) && $_POST['search_drafts'] == 'Yes') ? 'Yes' : 'No',
|
44 |
-
'se_use_attachment_search' => (isset($_POST['search_attachments']) && $_POST['search_attachments'] == 'Yes') ? 'Yes' : 'No',
|
45 |
-
'se_use_authors' => (isset($_POST['search_authors']) && $_POST['search_authors'] == 'Yes') ? 'Yes' : 'No',
|
46 |
-
'se_use_cmt_authors' => (isset($_POST['search_cmt_authors']) && $_POST['search_cmt_authors'] == 'Yes') ? 'Yes' : 'No',
|
47 |
-
'se_use_metadata_search' => (isset($_POST['search_metadata']) && $_POST['search_metadata'] == 'Yes') ? 'Yes' : 'No',
|
48 |
-
'se_use_highlight' => (isset($_POST['search_highlight']) && $_POST['search_highlight'] == 'Yes') ? 'Yes' : 'No',
|
49 |
-
'se_highlight_color' => (isset($_POST['highlight_color'])) ? $_POST['highlight_color'] : '',
|
50 |
-
'se_highlight_style' => (isset($_POST['highlight_style'])) ? $_POST['highlight_style'] : ''
|
51 |
-
|
52 |
-
);
|
53 |
-
|
54 |
-
if(isset($_POST['action']) && $_POST['action'] == "save") {
|
55 |
-
echo "<div class=\"updated fade\" id=\"limitcatsupdatenotice\"><p>" . __('Your default search settings have been <strong>updated</strong> by Search Everything. </p><p> What are you waiting for? Go check out the new search results!', 'SearchEverything') . "</p></div>";
|
56 |
-
update_option("se_options", $new_options);
|
57 |
-
|
58 |
-
}
|
59 |
-
|
60 |
-
if(isset($_POST['action']) && $_POST['action'] == "reset") {
|
61 |
-
echo "<div class=\"updated fade\" id=\"limitcatsupdatenotice\"><p>" . __('Your default search settings have been <strong>updated</strong> by Search Everything. </p><p> What are you waiting for? Go check out the new search results!', 'SearchEverything') . "</p></div>";
|
62 |
-
delete_option("se_options", $new_options);
|
63 |
-
}
|
64 |
-
|
65 |
-
$options = get_option('se_options');
|
66 |
-
|
67 |
-
?>
|
68 |
-
|
69 |
-
<div class="welcome-panel" id="seplus">
|
70 |
-
|
71 |
-
<div class="welcome-panel-content">
|
72 |
-
|
73 |
-
<h3>Well, we tried...</h3>
|
74 |
-
|
75 |
-
<p class="about-description" style="margin-bottom:1em;">It took a few years of kick-starting the Search Everything Plus project and it being subverted by new full-time projects at Sprout Venture before realizing it had to stop. Our goal of fixing WordPress search with SE+ needed too much focus, something we couldn't sacrifice because of growing client projects. After a year of trying and nothing awesome to show we decided to cease all planning and development on the Search Everything Plus plugin/service. </p>
|
76 |
-
|
77 |
-
<p class="about-description" style="font-size:1.1em;margin-bottom:1em;">But our goal of fixing WordPress search isn't lost and we have <strong>two</strong> recomendations for you:</p>
|
78 |
-
|
79 |
-
<p class="about-description" style="font-size:1.1em;margin-bottom:1em;"><strong><a href="http://s-v.me/RgIu">SearchWP</a></strong> —
|
80 |
-
They claim it's the best search plugin around and we can't agree more. It's seriously close to what we had planned for SE+, in many ways it's much better than what we counted on accomplishing.</p>
|
81 |
-
|
82 |
-
<p class="about-description" style="font-size:1.1em;margin-bottom:1em;"><strong><a href="http://s-v.me/Q8wb">Swiftype Search plugin</a></strong> —
|
83 |
-
It replaces the standard WordPress search with a better, more relevant search engine, and in doing so offloads the performance burden of search queries from your database to theirs.</p>
|
84 |
-
|
85 |
-
|
86 |
-
<p class="about-description" style="font-size:1.1em;margin-bottom:1em;">The advantages of both should be clear but if you're undecided we recomend <a href="http://s-v.me/RgIu">SearchWP</a> becuase of how it doesn't require a subscription.
|
87 |
-
|
88 |
-
<p class="about-description" style="font-size:1.1em;">Sincerely,
|
89 |
-
Dan Cameron<br/>
|
90 |
-
Principal and Janitor, Sprout Venture Inc.</p>
|
91 |
-
</div>
|
92 |
-
</div>
|
93 |
-
|
94 |
-
<div class="wrap">
|
95 |
-
<h2><?php _e('Search Everything Version:', 'SearchEverything'); ?> <?php echo $this->version; ?></h2>
|
96 |
-
<form method="post">
|
97 |
-
|
98 |
-
<div style="float: right; margin-bottom:10px; padding:0; " id="top-update" class="submit">
|
99 |
-
<input type="hidden" name="action" value="save" />
|
100 |
-
<input type="submit" class="button"value="<?php _e('Update Options', 'SearchEverything') ?>" />
|
101 |
-
</div>
|
102 |
-
|
103 |
-
|
104 |
-
<table style="margin-bottom: 20px;"></table>
|
105 |
-
<table class="widefat fixed">
|
106 |
-
<thead>
|
107 |
-
<tr class="title">
|
108 |
-
<th scope="col" class="manage-column"><?php _e('Basic Configuration', 'SearchEverything'); ?></th>
|
109 |
-
<th scope="col" class="manage-column"></th>
|
110 |
-
</tr>
|
111 |
-
</thead>
|
112 |
-
<?php
|
113 |
-
// Show options for 2.5 and below
|
114 |
-
if ($wp_version <= '2.5') : ?>
|
115 |
-
<tr class="mainrow">
|
116 |
-
<td class="titledesc"><?php _e('Search every page','SearchEverything'); ?>:<br/><small></small></td>
|
117 |
-
<td class="forminp">
|
118 |
-
<select id="search_pages" name="search_pages">
|
119 |
-
<option<?php selected($options['se_use_page_search'], 'No'); ?> value="No"> </option>
|
120 |
-
<option<?php selected($options['se_use_page_search'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
121 |
-
</select>
|
122 |
-
|
123 |
-
</td>
|
124 |
-
</tr>
|
125 |
-
|
126 |
-
<tr class="mainrow">
|
127 |
-
<td class="titledesc"> <?php _e('Search approved pages only','SearchEverything'); ?>:</td>
|
128 |
-
<td class="forminp">
|
129 |
-
<select id="appvd_pages" name="appvd_pages">
|
130 |
-
<option<?php selected($options['se_approved_pages_only'], 'No'); ?> value="No"> </option>
|
131 |
-
<option<?php selected($options['se_approved_pages_only'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
132 |
-
</select>
|
133 |
-
<br/><small></small>
|
134 |
-
</td>
|
135 |
-
</tr>
|
136 |
-
<?php endif; ?>
|
137 |
-
<?php
|
138 |
-
// Show tags only for WP 2.3+
|
139 |
-
if ($wp_version >= '2.3') : ?>
|
140 |
-
<tr class="mainrow">
|
141 |
-
<td class="titledesc"><?php _e('Search every tag name','SearchEverything'); ?>:</td>
|
142 |
-
<td class="forminp">
|
143 |
-
<select id="search_tags" name="search_tags" >
|
144 |
-
<option<?php selected($options['se_use_tag_search'], 'No'); ?> value="No"> </option>
|
145 |
-
<option<?php selected($options['se_use_tag_search'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
146 |
-
</select>
|
147 |
-
<br/><small></small>
|
148 |
-
</td>
|
149 |
-
</tr>
|
150 |
-
<?php endif; ?>
|
151 |
-
<?php
|
152 |
-
// Show taxonomies only for WP 2.3+
|
153 |
-
if ($wp_version >= '2.3') : ?>
|
154 |
-
<tr class="mainrow">
|
155 |
-
<td class="titledesc"><?php _e('Search custom taxonomies','SearchEverything'); ?>:</td>
|
156 |
-
<td class="forminp">
|
157 |
-
<select id="search_tags" name="search_taxonomies" >
|
158 |
-
<option<?php selected($options['se_use_tax_search'], 'No'); ?> value="No"> </option>
|
159 |
-
<option<?php selected($options['se_use_tax_search'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
160 |
-
</select>
|
161 |
-
<br/><small></small>
|
162 |
-
</td>
|
163 |
-
</tr>
|
164 |
-
<?php endif; ?>
|
165 |
-
<?php
|
166 |
-
// Show categories only for WP 2.5+
|
167 |
-
if ($wp_version >= '2.5') : ?>
|
168 |
-
<tr class="mainrow">
|
169 |
-
<td class="titledesc"><?php _e('Search every category name and description','SearchEverything'); ?>:</td>
|
170 |
-
<td class="forminp">
|
171 |
-
<select id="search_categories" name="search_categories">
|
172 |
-
<option<?php selected($options['se_use_category_search'], 'No'); ?> value="No"> </option>
|
173 |
-
<option<?php selected($options['se_use_category_search'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
174 |
-
</select>
|
175 |
-
<br/><small></small>
|
176 |
-
</td>
|
177 |
-
</tr>
|
178 |
-
<?php endif; ?>
|
179 |
-
<tr class="mainrow">
|
180 |
-
<td class="titledesc"><?php _e('Search every comment','SearchEverything'); ?>:</td>
|
181 |
-
<td class="forminp">
|
182 |
-
<select name="search_comments" id="search_comments">
|
183 |
-
<option<?php selected($options['se_use_comment_search'], 'No'); ?> value="No"> </option>
|
184 |
-
<option<?php selected($options['se_use_comment_search'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
185 |
-
</select>
|
186 |
-
<br/><small></small>
|
187 |
-
</td>
|
188 |
-
</tr>
|
189 |
-
<tr class="mainrow">
|
190 |
-
<td class="titledesc"> <?php _e('Search comment authors','SearchEverything'); ?>:</td>
|
191 |
-
<td class="forminp">
|
192 |
-
<select id="search_cmt_authors" name="search_cmt_authors">
|
193 |
-
<option<?php selected($options['se_use_cmt_authors'], 'No'); ?> value="No"> </option>
|
194 |
-
<option<?php selected($options['se_use_cmt_authors'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
195 |
-
</select>
|
196 |
-
<br/><small></small>
|
197 |
-
</td>
|
198 |
-
</tr>
|
199 |
-
<tr class="mainrow">
|
200 |
-
<td class="titledesc"> <?php _e('Search approved comments only','SearchEverything'); ?>:</td>
|
201 |
-
<td class="forminp">
|
202 |
-
<select id="appvd_comments" name="appvd_comments">
|
203 |
-
<option<?php selected($options['se_approved_comments_only'], 'No'); ?> value="No"> </option>
|
204 |
-
<option<?php selected($options['se_approved_comments_only'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
205 |
-
</select>
|
206 |
-
<br/><small></small>
|
207 |
-
</td>
|
208 |
-
</tr>
|
209 |
-
<tr class="mainrow">
|
210 |
-
<td class="titledesc"><?php _e('Search every excerpt','SearchEverything'); ?>:</td>
|
211 |
-
<td class="forminp">
|
212 |
-
<select id="search_excerpt" name="search_excerpt">
|
213 |
-
<option<?php selected($options['se_use_excerpt_search'], 'No'); ?> value="No"> </option>
|
214 |
-
<option<?php selected($options['se_use_excerpt_search'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
215 |
-
</select>
|
216 |
-
<br/><small></small>
|
217 |
-
</td>
|
218 |
-
</tr>
|
219 |
-
<?php
|
220 |
-
// Show categories only for WP 2.5+
|
221 |
-
if ($wp_version >= '2.5') : ?>
|
222 |
-
<tr class="mainrow">
|
223 |
-
<td class="titledesc"><?php _e('Search every draft','SearchEverything'); ?>:</td>
|
224 |
-
<td class="forminp">
|
225 |
-
<select id="search_drafts" name="search_drafts">
|
226 |
-
<option<?php selected($options['se_use_draft_search'], 'No'); ?> value="No"> </option>
|
227 |
-
<option<?php selected($options['se_use_draft_search'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
228 |
-
</select>
|
229 |
-
<br/><small></small>
|
230 |
-
</td>
|
231 |
-
</tr>
|
232 |
-
<?php endif; ?>
|
233 |
-
<tr class="mainrow">
|
234 |
-
<td class="titledesc"><?php _e('Search every attachment','SearchEverything'); ?>:<br/><small><?php _e('(post type = attachment)','SearchEverything'); ?></small></td>
|
235 |
-
<td class="forminp">
|
236 |
-
<select id="search_attachments" name="search_attachments">
|
237 |
-
<option<?php selected($options['se_use_attachment_search'], 'No'); ?> value="No"> </option>
|
238 |
-
<option<?php selected($options['se_use_attachment_search'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
239 |
-
</select>
|
240 |
-
<br/><small></small>
|
241 |
-
</td>
|
242 |
-
</tr>
|
243 |
-
<tr class="mainrow">
|
244 |
-
<td class="titledesc"><?php _e('Search every custom field','SearchEverything'); ?>:<br/><small><?php _e('(metadata)','SearchEverything'); ?></small></td>
|
245 |
-
<td class="forminp">
|
246 |
-
<select id="search_metadata" name="search_metadata">
|
247 |
-
<option<?php selected($options['se_use_metadata_search'], 'No'); ?> value="No"> </option>
|
248 |
-
<option<?php selected($options['se_use_metadata_search'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
249 |
-
</select>
|
250 |
-
|
251 |
-
</td>
|
252 |
-
</tr>
|
253 |
-
<tr class="mainrow">
|
254 |
-
<td class="titledesc"><?php _e('Search every author','SearchEverything'); ?>:</td>
|
255 |
-
<td class="forminp">
|
256 |
-
<select id="search_authors" name="search_authors">
|
257 |
-
<option<?php selected($options['se_use_authors'],'No'); ?> value="No"> </option>
|
258 |
-
<option<?php selected($options['se_use_authors'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
259 |
-
</select>
|
260 |
-
</td>
|
261 |
-
</tr>
|
262 |
-
<tr class="mainrow">
|
263 |
-
<td class="titledesc"><?php _e('Highlight Search Terms','SearchEverything'); ?>:</td>
|
264 |
-
<td class="forminp">
|
265 |
-
<select id="search_highlight" name="search_highlight">
|
266 |
-
<option<?php selected($options['se_use_highlight'], 'No'); ?> value="No"> </option>
|
267 |
-
<option<?php selected($options['se_use_highlight'], 'Yes'); ?> value="Yes"><?php _e('Yes', 'SearchEverything'); ?></option>
|
268 |
-
</select>
|
269 |
-
<br/><small></small>
|
270 |
-
</td>
|
271 |
-
</tr>
|
272 |
-
<tr class="mainrow">
|
273 |
-
<td class="titledesc"> <?php _e('Highlight Background Color','SearchEverything'); ?>:</td>
|
274 |
-
<td class="forminp">
|
275 |
-
<input type="text" id="highlight_color" name="highlight_color" value="<?php echo $options['se_highlight_color'];?>" />
|
276 |
-
<br/><small><?php _e('Examples:<br/>\'#FFF984\' or \'red\'','SearchEverything'); ?></small>
|
277 |
-
</td>
|
278 |
-
</tr>
|
279 |
-
|
280 |
-
</table>
|
281 |
-
<table style="margin-bottom: 20px;"></table>
|
282 |
-
|
283 |
-
<table class="widefat">
|
284 |
-
<thead>
|
285 |
-
<tr class="title">
|
286 |
-
<th scope="col" class="manage-column"><?php _e('Advanced Configuration - Exclusion', 'SearchEverything'); ?></th>
|
287 |
-
<th scope="col" class="manage-column"></th>
|
288 |
-
</tr>
|
289 |
-
</thead>
|
290 |
-
|
291 |
-
<tr class="mainrow">
|
292 |
-
<td class="titledesc"><?php _e('Exclude some post or page IDs','SearchEverything'); ?>:</td>
|
293 |
-
<td class="forminp">
|
294 |
-
<input type="text" id="exclude_posts_list" name="exclude_posts_list" value="<?php echo $options['se_exclude_posts_list'];?>" />
|
295 |
-
<br/><small><?php _e('Comma separated Post IDs (example: 1, 5, 9)','SearchEverything'); ?></small>
|
296 |
-
</td>
|
297 |
-
</tr>
|
298 |
-
<tr class="mainrow">
|
299 |
-
<td class="titledesc"><?php _e('Exclude Categories','SearchEverything'); ?>:</td>
|
300 |
-
<td class="forminp">
|
301 |
-
<input type="text" id="exclude_categories_list" name="exclude_categories_list" value="<?php echo $options['se_exclude_categories_list'];?>" />
|
302 |
-
<br/><small><?php _e('Comma separated category IDs (example: 1, 4)','SearchEverything'); ?></small>
|
303 |
-
</td>
|
304 |
-
</tr>
|
305 |
-
<tr class="mainrow">
|
306 |
-
<td class="titledesc"><?php _e('Full Highlight Style','SearchEverything'); ?>:</td>
|
307 |
-
<td class="forminp">
|
308 |
-
<small><?php _e('Important: \'Highlight Background Color\' must be blank to use this advanced styling.', 'SearchEverything') ?></small><br/>
|
309 |
-
<input type="text" id="highlight_style" name="highlight_style" value="<?php echo $options['se_highlight_style'];?>" />
|
310 |
-
<br/><small><?php _e('Example:<br/>background-color: #FFF984; font-weight: bold; color: #000; padding: 0 1px;','SearchEverything'); ?></small>
|
311 |
-
</td>
|
312 |
-
</tr>
|
313 |
-
</table>
|
314 |
-
|
315 |
-
|
316 |
-
<p class="submit">
|
317 |
-
<input type="hidden" name="action" value="save" />
|
318 |
-
<input type="submit" class="button"value="<?php _e('Update Options', 'SearchEverything') ?>" />
|
319 |
-
</p>
|
320 |
-
</form>
|
321 |
-
|
322 |
-
<div class="info">
|
323 |
-
<div style="float: left; padding-top:4px;"><?php _e('Developed by Dan Cameron of', 'SearchEverything'); ?> <a href="http://sproutventure.com?search-everything" title="Custom WordPress Development"><?php _e('Sprout Venture', 'SearchEverything'); ?></a>. <?php _e('We Provide custom WordPress Plugins and Themes and a whole lot more.', 'SearchEverything') ?>
|
324 |
-
</div>
|
325 |
-
<div style="float: right; margin:0; padding:0; " class="submit">
|
326 |
-
<form method="post">
|
327 |
-
<input name="reset" type="submit" class="button"value="<?php _e('Reset Button', 'SearchEverything') ?>" />
|
328 |
-
<input type="hidden" name="action" value="reset" />
|
329 |
-
</form>
|
330 |
-
<div style="clear:both;"></div>
|
331 |
-
</div>
|
332 |
-
|
333 |
-
<div style="clear: both;"></div>
|
334 |
-
|
335 |
-
<small><?php _e('Find a bug?', 'SearchEverything') ?> <a href="https://core.sproutventure.com/projects/search-everything/issues" target="blank"><?php _e('Post it as a new issue','SearchEverything')?></a>.</small>
|
336 |
-
</div>
|
337 |
-
|
338 |
-
<table style="margin-bottom: 20px;"></table>
|
339 |
-
<table class="widefat">
|
340 |
-
<thead>
|
341 |
-
<tr class="title">
|
342 |
-
<th scope="col" class="manage-column"><?php _e('Test Search Form', 'SearchEverything'); ?></th>
|
343 |
-
<th scope="col" class="manage-column"></th>
|
344 |
-
</tr>
|
345 |
-
</thead>
|
346 |
-
|
347 |
-
<tr class="mainrow">
|
348 |
-
<td class="thanks">
|
349 |
-
<p><?php _e('Use this search form to run a live search test.', 'SearchEverything'); ?></p>
|
350 |
-
</td>
|
351 |
-
<td>
|
352 |
-
<form method="get" id="searchform" action="<?php bloginfo($cap = version_compare('2.2', $wp_version, '<') ? 'url' : 'home'); ?>">
|
353 |
-
<p class="srch submit">
|
354 |
-
<input type="text" class="srch-txt" value="<?php echo (isset($S)) ? wp_specialchars($s, 1) : ''; ?>" name="s" id="s" size="30" />
|
355 |
-
<input type="submit" class="button"class="SE5_btn" id="searchsubmit" value="<?php _e('Run Test Search', 'SearchEverything'); ?>" />
|
356 |
-
</p>
|
357 |
-
</form>
|
358 |
-
</td>
|
359 |
-
</tr>
|
360 |
-
</table>
|
361 |
-
|
362 |
-
<table style="margin-bottom: 20px;"></table>
|
363 |
-
<table class="widefat">
|
364 |
-
<thead>
|
365 |
-
<tr class="title">
|
366 |
-
<th scope="col" class="manage-column"><?php _e('News', 'SearchEverything'); ?></th>
|
367 |
-
<th scope="col" class="manage-column"><?php _e('Development Support', 'SearchEverything'); ?></th>
|
368 |
-
<th scope="col" class="manage-column"><?php _e('Localization Support', 'SearchEverything'); ?></th>
|
369 |
-
</tr>
|
370 |
-
</thead>
|
371 |
-
|
372 |
-
<tr class="mainrow">
|
373 |
-
<td class="thanks">
|
374 |
-
<p><strong><?php _e('LOCALIZATION SUPPORT:', 'SearchEverything'); ?></strong><br/><?php _e('Version 6 was a major update and a few areas need new localization support. If you can help send me your translations by posting them as a new issue, ', 'SearchEverything') ?><a href="https://github.com/sproutventure/search-everything-wordpress-plugin/issues?sort=created&direction=desc&state=open&page=1" target="blank"><strong><?php _e('here','SearchEverything')?></strong></a>.</p>
|
375 |
-
<p><strong><?php _e('Thank You!', 'SearchEverything'); ?></strong><br/><?php _e('The development of Search Everything since Version one has primarily come from the WordPress community, I’m grateful for their dedicated and continued support.', 'SearchEverything'); ?></p>
|
376 |
-
</td>
|
377 |
-
<td>
|
378 |
-
<ul class="SE_lists">
|
379 |
-
<li><a href="https://github.com/ninnypants"><strong>Tyrel Kelsey</strong></a></li>
|
380 |
-
</ul>
|
381 |
-
</td>
|
382 |
-
<td>
|
383 |
-
<ul class="SE_lists">
|
384 |
-
<li><a href="#" target="blank">minjae kim (KR) - v.6</a></li>
|
385 |
-
<li><a href="http://www.r-sn.com/wp" target="blank">Anonymous (AR) - v.6</a></li>
|
386 |
-
<li><a href="http://www.doctorley.pl" target="blank">Karol Manikowski (PL) - v.6</a></li>
|
387 |
-
<li><a href="http://www.paulwicking.com" target="blank">Paul Wicking (NO)- v.6</a></li>
|
388 |
-
<li><a href="#">Bilei Radu (RO)- v.6</a></li>
|
389 |
-
<li><a href="http://www.fatcow.com" target="blank">Fat Cow (BY) - v.6</a></li>
|
390 |
-
<li><a href="http://gidibao.net/" target="blank">Gianni Diurno (IT) - v.6</a></li>
|
391 |
-
<li><a href="#">Maris Svirksts (LV) - v.6</a></li>
|
392 |
-
<li><a href="#">Simon Hansen (NN) - v.6</a></li>
|
393 |
-
<li><a href="http://beyn.org/" target="blank">jean Pierre Gavoille (FR) - v.6</a></li>
|
394 |
-
<li><a href="#">hit1205 (CN and TW)</a></li>
|
395 |
-
<li><a href="http://www.alohastone.com" target="blank">alohastone (DE)</a></li>
|
396 |
-
<li><a href="http://gidibao.net/" target="blank">Gianni Diurno (ES)</a></li>
|
397 |
-
<li><a href="#">János Csárdi-Braunstein (HU)</a></li>
|
398 |
-
<li><a href="http://idimensie.nl" target="blank">Joeke-Remkus de Vries (NL)</a></li>
|
399 |
-
<li><a href="#">Silver Ghost (RU)</a></li>
|
400 |
-
<li><a href="http://mishkin.se" target="blank">Mikael Jorhult (RU)</a></li>
|
401 |
-
<li><a href="#">Baris Unver (TR)</a></li>
|
402 |
-
</ul>
|
403 |
-
</td>
|
404 |
-
|
405 |
-
</tr>
|
406 |
-
</table>
|
407 |
-
</div>
|
408 |
-
|
409 |
-
|
410 |
-
<?php
|
411 |
-
} //end se_option_page
|
412 |
-
|
413 |
-
//styling options page
|
414 |
-
function se_options_style() {
|
415 |
-
?>
|
416 |
-
<style type="text/css" media="screen">
|
417 |
-
.titledesc {width:300px;}
|
418 |
-
.thanks {width:400px; }
|
419 |
-
.thanks p {padding-left:20px; padding-right:20px;}
|
420 |
-
.info { background: #FFFFCC; border: 1px dotted #D8D2A9; padding: 10px; color: #333; }
|
421 |
-
.info a { color: #333; text-decoration: none; border-bottom: 1px dotted #333 }
|
422 |
-
.info a:hover { color: #666; border-bottom: 1px dotted #666; }
|
423 |
-
</style>
|
424 |
-
<?php
|
425 |
-
}
|
426 |
-
|
427 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|