Simply Exclude - Version 1.7

Version Description

Download this release

Release Info

Developer pmenard
Plugin Icon wp plugin Simply Exclude
Version 1.7
Comparing to
See all releases

Code changes from version 1.6.1 to 1.7

Files changed (3) hide show
  1. readme.txt +8 -3
  2. simplyexclude.php +291 -38
  3. simplyexclude_style_admin.css +10 -1
readme.txt CHANGED
@@ -4,17 +4,19 @@ Donate link: http://www.codehooligans.com
4
  Tags: admin, posts, pages, categories, tags, exclude, include, is_front, is_archive, is_search, is_feed
5
  Requires at least: 2.3
6
  Tested up to: 2.5.1
7
- Stable tag: 1.6.1
8
 
9
  == Description ==
10
 
11
- Provides an interface to selectively exclude/include categories, tags and page from the 4 actions used by WordPress
12
 
13
  is_front - When the user views the Front page.
14
  is_archive - When the user views an category or tags Archive.
15
  is_search - When the user views a search result page.
16
  is_feed - When a Feed is viewed/requested.
17
 
 
 
18
  [Plugin Homepage](http://www.codehooligans.com/2008/04/27/simply-exclude-plugin/ "SimplyExclude Plugin for WordPress")
19
 
20
  == Installation ==
@@ -50,4 +52,7 @@ At the time (version 1.6.1) the plugin only effects Pages included in the tradit
50
  1.0 - 2007-11-20: Initial release<br />
51
  1.1 - 2008-12-15: Added logic to work with WP version greater than 2.2<br />
52
  1.5 - 20008-04-27 Fixed display issues. Changes 'List' to 'Archive'. Added tags inclusion/exclusion login. Works only with WP 2.3 and greater.<br />
53
- 1.6 - 2008-05-22 Fixed various items. Added format display for Categories and Pages to reveal hierarchy, Disable plugin functions when searching in admin. This also corrected a display exclusion bug when showing categories and pages. </p>
 
 
 
4
  Tags: admin, posts, pages, categories, tags, exclude, include, is_front, is_archive, is_search, is_feed
5
  Requires at least: 2.3
6
  Tested up to: 2.5.1
7
+ Stable tag: 1.7
8
 
9
  == Description ==
10
 
11
+ Provides an interface to selectively exclude/include categories, tags, authors and pages from the 4 actions used by WordPress
12
 
13
  is_front - When the user views the Front page.
14
  is_archive - When the user views an category or tags Archive.
15
  is_search - When the user views a search result page.
16
  is_feed - When a Feed is viewed/requested.
17
 
18
+ Note: Page exclusions only work for search.
19
+
20
  [Plugin Homepage](http://www.codehooligans.com/2008/04/27/simply-exclude-plugin/ "SimplyExclude Plugin for WordPress")
21
 
22
  == Installation ==
52
  1.0 - 2007-11-20: Initial release<br />
53
  1.1 - 2008-12-15: Added logic to work with WP version greater than 2.2<br />
54
  1.5 - 20008-04-27 Fixed display issues. Changes 'List' to 'Archive'. Added tags inclusion/exclusion login. Works only with WP 2.3 and greater.<br />
55
+ 1.6 - 2008-05-22 Fixed various items. Added format display for Categories and Pages to reveal hierarchy, Disable plugin functions when searching in admin. This also corrected a display exclusion bug when showing categories and pages. <br />
56
+ 1.7 - 2008-05-29 Added Author to the Include/Exclude logic. Now you can exclude Author's Posts from Search, Home, RSS, Archive.
57
+
58
+ </p>
simplyexclude.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Simply Exclude
4
  Plugin URI: http://www.codehooligans.com/2008/04/27/simply-exclude-plugin/
5
  Description: Provides an interface to selectively exclude/include categories, tags and page from the 4 actions used by WordPress. is_front, is_archive, is_search, is_feed.
6
  Author: Paul Menard
7
- Version: 1.6.1
8
  Author URI: http://www.codehooligans.com
9
 
10
  Revision history
@@ -12,7 +12,7 @@ Revision history
12
  1.1 - 2008-12-15: Added logic to work with WP version greater than 2.2
13
  1.5 - 20008-04-27 Fixed display issues. Changes 'List' to 'Archive'. Added tags inclusion/exclusion login. Works only with WP 2.3 and greater.
14
  1.6 - 2008-05-22 Fixed various items. Added format display for Categories and Pages to reveal heirarchy, Disable plugin functions when searching in admin. This also corrected a display exclusion bug when showing categories and pages.
15
-
16
  */
17
 
18
  class SimplyExclude
@@ -55,7 +55,7 @@ class SimplyExclude
55
 
56
  add_action('save_post', array(&$this,'save_page_exclude_answer'));
57
 
58
- add_filter('posts_request', array(&$this,'posts_request_proc'));
59
  }
60
 
61
 
@@ -71,7 +71,8 @@ class SimplyExclude
71
  $this->in_admin = true;
72
 
73
  if (function_exists('add_meta_box')) {
74
- add_meta_box($this->_options_key, $this->_admin_menu_label, array(&$this,'add_page_exclude_sidebar_dbx'), 'page');
 
75
  }
76
  else {
77
  add_filter('dbx_page_sidebar', array(&$this,'add_page_exclude_sidebar_dbx'));
@@ -157,7 +158,42 @@ class SimplyExclude
157
  = "Visibility in archive links (i.e., calendar links).";
158
  $this->default_IsActions['tags']['is_archive']['action'] = "e";
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  // Pages Definitions
162
  $this->default_IsActions['pages'] = array();
163
  $this->default_IsActions['pages']['is_search']['name'] = "Search";
@@ -182,6 +218,7 @@ class SimplyExclude
182
  $this->se_cfg['cats']['actions'][$cat_key] = $cat_action['action'];
183
  }
184
  }
 
185
  if (!isset($this->se_cfg['tags']['actions']))
186
  {
187
  foreach($this->default_IsActions['tags'] as $tag_key => $tag_action)
@@ -189,6 +226,15 @@ class SimplyExclude
189
  $this->se_cfg['tags']['actions'][$tag_key] = $tag_action['action'];
190
  }
191
  }
 
 
 
 
 
 
 
 
 
192
  if (!isset($this->se_cfg['pages']['actions']))
193
  {
194
  foreach($this->default_IsActions['pages'] as $page_key => $page_action)
@@ -251,6 +297,10 @@ class SimplyExclude
251
  $this->se_display_tags_panel($se_admin);
252
  break;
253
 
 
 
 
 
254
 
255
  default:
256
  case 'edit_categories':
@@ -291,6 +341,15 @@ class SimplyExclude
291
  title="Manage Tag Exclusions">Manage Tags</a></li><?php
292
  }
293
  ?>
 
 
 
 
 
 
 
 
 
294
  <li><a href="?page=<?php
295
  echo $this->options_key ?>&amp;se_admin[action]=edit_pages"
296
  <?php
@@ -439,7 +498,6 @@ class SimplyExclude
439
  function se_show_cat_item_row($cat_info, $class)
440
  {
441
  $cat_parents = $this->get_cat_parent_tree_array($cat_info->cat_ID, 0);
442
- //echo "cat_parents<pre>"; print_r($cat_parents); echo "</pre>";
443
  $level_spacer = "";
444
  foreach($cat_parents as $cat_parent)
445
  {
@@ -630,6 +688,161 @@ class SimplyExclude
630
  /////////////////////////////////////////////////////////////////
631
 
632
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
633
  // PAGE FUNCTIONS
634
  /////////////////////////////////////////////////////////////////
635
  function se_display_pages_panel($se_admin)
@@ -867,7 +1080,6 @@ class SimplyExclude
867
  if ($this->in_admin == true)
868
  return;
869
 
870
- //echo "query before<pre>"; print_r($query); echo "</pre>";
871
  if (count($this->default_IsActions['cats']) > 0)
872
  {
873
  foreach ($this->default_IsActions['cats'] as $action_key => $action_val)
@@ -891,57 +1103,85 @@ class SimplyExclude
891
 
892
  if ($this->wp_version >= 2.3)
893
  {
894
- foreach ($this->default_IsActions['tags'] as $action_key => $action_val)
895
  {
896
- if ($query->{$action_key})
897
  {
898
- if (isset($this->se_cfg['tags'][$action_key]))
899
  {
900
- if (isset($tag_array_list))
901
- unset($tag_array_list);
902
-
903
- $tag_array_list = array();
904
- if (count($this->se_cfg['tags'][$action_key]) > 0)
905
  {
906
- foreach($this->se_cfg['tags'][$action_key] as $key => $val)
 
 
 
 
907
  {
908
- $tag_array_list[] = $key;
 
 
 
 
 
 
 
 
 
 
 
 
909
  }
 
 
 
 
910
 
911
- if ($this->se_cfg['tags']['actions'][$action_key] == "e")
912
- {
913
- $query->set('tag__not_in', $tag_array_list);
914
- }
915
- else
 
 
 
 
 
916
  {
917
- $query->set('tag__in', $tag_array_list);
 
 
918
  }
919
  }
 
 
920
  }
921
  }
922
  }
923
  }
924
-
925
- foreach ($this->default_IsActions['pages'] as $action_key => $action_val)
926
  {
927
- if ($query->{$action_key})
928
  {
929
- add_filter('posts_where', array(&$this, 'SE4_search_pages'));
930
- add_filter('posts_where', array(&$this, 'SE4_exclude_posts'));
 
 
931
 
932
  /*
933
- $pages_list;
934
- if (isset($this->se_cfg['pages'][$action_key]))
935
- {
936
- //echo "this->se_cfg['pages'][$action_key]=[". $this->se_cfg['pages'][$action_key]. "]<br />";
937
 
938
- $pages_list = $this->se_listify_ids($this->se_cfg['pages']['actions'][$action_key],
939
- $this->se_cfg['pages'][$action_key]);
940
- //echo "pages_list=[". $pages_list."]<br />";
941
- }
942
- if (strlen($pages_list))
943
- $query->set('page', $pages_list);
944
  */
 
945
  }
946
  }
947
  //echo "query after<pre>"; print_r($query); echo "</pre>";
@@ -992,6 +1232,19 @@ class SimplyExclude
992
  WP action. </p>
993
  <?php
994
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
995
  else if ($type == "pages")
996
  {
997
 
@@ -1029,7 +1282,7 @@ class SimplyExclude
1029
  if ($this->wp_version < 2.5)
1030
  {
1031
  ?>
1032
- <fieldset id="use_ssl" class="dbx-box">
1033
  <h3 class="dbx-handle"><?php _e('Exclude from Search?') ?></h3>
1034
  <div class="dbx-content">
1035
  <?php
4
  Plugin URI: http://www.codehooligans.com/2008/04/27/simply-exclude-plugin/
5
  Description: Provides an interface to selectively exclude/include categories, tags and page from the 4 actions used by WordPress. is_front, is_archive, is_search, is_feed.
6
  Author: Paul Menard
7
+ Version: 1.7
8
  Author URI: http://www.codehooligans.com
9
 
10
  Revision history
12
  1.1 - 2008-12-15: Added logic to work with WP version greater than 2.2
13
  1.5 - 20008-04-27 Fixed display issues. Changes 'List' to 'Archive'. Added tags inclusion/exclusion login. Works only with WP 2.3 and greater.
14
  1.6 - 2008-05-22 Fixed various items. Added format display for Categories and Pages to reveal heirarchy, Disable plugin functions when searching in admin. This also corrected a display exclusion bug when showing categories and pages.
15
+ 1.7 - 2008-05-29 Added Author to the Include/Exclude logic. Now you can exclude Author's Posts from Search, Home, RSS, Archive.
16
  */
17
 
18
  class SimplyExclude
55
 
56
  add_action('save_post', array(&$this,'save_page_exclude_answer'));
57
 
58
+ //add_filter('posts_request', array(&$this,'posts_request_proc'));
59
  }
60
 
61
 
71
  $this->in_admin = true;
72
 
73
  if (function_exists('add_meta_box')) {
74
+ add_meta_box($this->_options_key, $this->_admin_menu_label,
75
+ array(&$this,'add_page_exclude_sidebar_dbx'), 'page');
76
  }
77
  else {
78
  add_filter('dbx_page_sidebar', array(&$this,'add_page_exclude_sidebar_dbx'));
158
  = "Visibility in archive links (i.e., calendar links).";
159
  $this->default_IsActions['tags']['is_archive']['action'] = "e";
160
 
161
+ // Authors
162
+ $this->default_IsActions['authors'] = array();
163
+ $this->default_IsActions['authors']['is_home']['name']
164
+ = "Front";
165
+ $this->default_IsActions['authors']['is_home']['description']
166
+ = "Visibility on the front/main page.";
167
+ $this->default_IsActions['authors']['is_home']['action']
168
+ = "i";
169
+
170
+ $this->default_IsActions['authors']['is_archive']['name']
171
+ = "Archive";
172
+ $this->default_IsActions['authors']['is_archive']['description']
173
+ = "Visibility on the archive of categories on the sidebar";
174
+ $this->default_IsActions['authors']['is_archive']['action']
175
+ = "e";
176
+
177
+ $this->default_IsActions['authors']['is_search']['name']
178
+ = "Search";
179
+ $this->default_IsActions['authors']['is_search']['description']
180
+ = "Visibility in search results.";
181
+ $this->default_IsActions['authors']['is_search']['action']
182
+ = "e";
183
 
184
+ $this->default_IsActions['authors']['is_feed']['name']
185
+ = "Feed";
186
+ $this->default_IsActions['authors']['is_feed']['description']
187
+ = "Visibility in RSS/RSS2/Atom feeds.";
188
+ $this->default_IsActions['authors']['is_feed']['action']
189
+ = "e";
190
+
191
+ $this->default_IsActions['authors']['is_archive']['name']
192
+ = "Archive";
193
+ $this->default_IsActions['authors']['is_archive']['description']
194
+ = "Visibility in archive links (i.e., calendar links).";
195
+ $this->default_IsActions['authors']['is_archive']['action'] = "e";
196
+
197
  // Pages Definitions
198
  $this->default_IsActions['pages'] = array();
199
  $this->default_IsActions['pages']['is_search']['name'] = "Search";
218
  $this->se_cfg['cats']['actions'][$cat_key] = $cat_action['action'];
219
  }
220
  }
221
+
222
  if (!isset($this->se_cfg['tags']['actions']))
223
  {
224
  foreach($this->default_IsActions['tags'] as $tag_key => $tag_action)
226
  $this->se_cfg['tags']['actions'][$tag_key] = $tag_action['action'];
227
  }
228
  }
229
+
230
+ if (!isset($this->se_cfg['authors']['actions']))
231
+ {
232
+ foreach($this->default_IsActions['authors'] as $author_key => $author_action)
233
+ {
234
+ $this->se_cfg['authors']['actions'][$author_key] = $author_action['action'];
235
+ }
236
+ }
237
+
238
  if (!isset($this->se_cfg['pages']['actions']))
239
  {
240
  foreach($this->default_IsActions['pages'] as $page_key => $page_action)
297
  $this->se_display_tags_panel($se_admin);
298
  break;
299
 
300
+ case 'edit_authors':
301
+ case 'save_authors':
302
+ $this->se_display_authors_panel($se_admin);
303
+ break;
304
 
305
  default:
306
  case 'edit_categories':
341
  title="Manage Tag Exclusions">Manage Tags</a></li><?php
342
  }
343
  ?>
344
+ <li><a href="?page=<?php
345
+ echo $this->options_key ?>&amp;se_admin[action]=edit_authors"
346
+ <?php
347
+ if (($se_admin['action'] == 'edit_authors')
348
+ || ($se_admin['action'] == 'save_authors'))
349
+ echo 'class="current"';
350
+ ?>
351
+ title="Manage Author Exclusions">Manage Authors</a></li>
352
+
353
  <li><a href="?page=<?php
354
  echo $this->options_key ?>&amp;se_admin[action]=edit_pages"
355
  <?php
498
  function se_show_cat_item_row($cat_info, $class)
499
  {
500
  $cat_parents = $this->get_cat_parent_tree_array($cat_info->cat_ID, 0);
 
501
  $level_spacer = "";
502
  foreach($cat_parents as $cat_parent)
503
  {
688
  /////////////////////////////////////////////////////////////////
689
 
690
 
691
+ // AUTHOR FUNCTIONS
692
+ /////////////////////////////////////////////////////////////////
693
+ function se_display_authors_panel($se_admin)
694
+ {
695
+ ?>
696
+ <h2>Manage Author Exclusions</h2>
697
+ <?php
698
+ if ($se_admin['action'] == "save_authors")
699
+ {
700
+ if (isset($se_admin['authors']))
701
+ $this->se_cfg['authors'] = $se_admin['authors'];
702
+ else
703
+ unset($this->se_cfg['authors']);
704
+
705
+ $this->se_save_config();
706
+ ?>
707
+ <div class="updated">
708
+ <p>Author Exclusions successfully updated.</p>
709
+ </div>
710
+ <?php
711
+ }
712
+ $this->se_show_authors_form();
713
+ }
714
+
715
+ function se_load_authors()
716
+ {
717
+ global $wpdb;
718
+ if (!$this->authors)
719
+ {
720
+ $this->authors = get_users_of_blog();
721
+ }
722
+ }
723
+
724
+ function se_show_authors_form()
725
+ {
726
+ $this->se_load_authors();
727
+ if ($this->authors)
728
+ {
729
+ $this->display_instructions('authors');
730
+ ?>
731
+ <form name="author_exclusion" id="author_exclusion"
732
+ action="?page=<?php
733
+ echo $this->options_key ?>&amp;se_admin[action]=save_authors" method="post">
734
+
735
+ <table class="widefat" width="80%" cellpadding="0" cellspacing="2" border="0">
736
+ <thead>
737
+ <tr>
738
+ <th class="action"><?php _e('Action Name') ?></th>
739
+ <th class="description"><?php _e('Description ') ?></th>
740
+ <th class="inc-excl"><?php _e('Inclusion/Exclusion') ?></th>
741
+ </tr>
742
+ </thead>
743
+ <tbody>
744
+ <?php
745
+ foreach ($this->default_IsActions['authors'] as $action_key => $action_val)
746
+ {
747
+ $class = ('alternate' == $class) ? '' : 'alternate';
748
+ ?>
749
+ <tr <?php if (strlen($class)) echo "class='".$class."'" ?>>
750
+ <td class="action"><?php echo $action_val['name'] ?></td>
751
+ <td class="description"><?php echo $action_val['description'] ?></td>
752
+ <td class="inc-excl">
753
+ <input type="radio"
754
+ name="se_admin[authors][actions][<?php echo $action_key ?>]" value="i"
755
+ <?php if ($this->se_cfg['authors']['actions'][$action_key] == 'i')
756
+ echo "checked='checked'"; ?> /> Include only<br />
757
+ <input type="radio"
758
+ name="se_admin[authors][actions][<?php echo $action_key ?>]" value="e"
759
+ <?php if ($this->se_cfg['authors']['actions'][$action_key] == 'e')
760
+ echo "checked='checked'"; ?> /> Exclude
761
+ </td>
762
+ <tr>
763
+ <?php
764
+ }
765
+ ?>
766
+ </tbody>
767
+ </table>
768
+ <br />
769
+ <table class="widefat" width="80%" cellpadding="0" cellspacing="2" border="0">
770
+ <thead>
771
+ <tr>
772
+ <th class="author-id" scope="col"><?php _e('ID') ?></th>
773
+ <th class="author-name" scope="col"><?php _e('Author Name') ?></th>
774
+ <th class="cat-action" scope="col"><?php _e('Exclude from...') ?></th>
775
+ </tr>
776
+ </thead>
777
+ <tbody>
778
+ <?php
779
+ foreach($this->authors as $author_info)
780
+ {
781
+ $class = ('alternate' == $class) ? '' : 'alternate';
782
+ $this->se_show_author_item_row($author_info, $class);
783
+ }
784
+ ?>
785
+ <tr>
786
+ <td colspan="3">
787
+ <p class="submit">
788
+ <input type="hidden" name="action" value="editcatvis" />
789
+ <input type="submit" name="submit" value="<?php _e('Save Changes &raquo;') ?>" />
790
+ </p>
791
+ </td>
792
+ </tr>
793
+ </tbody>
794
+ </table>
795
+ </p></div>
796
+ </form>
797
+ <?php
798
+ }
799
+ else
800
+ {
801
+ ?><p>You don't have any Authorss defined.</p><?php
802
+ }
803
+ }
804
+
805
+ function se_show_author_item_row($author_info, $class)
806
+ {
807
+ ?>
808
+ <tr <?php if (strlen($class)) echo "class='".$class."'" ?>>
809
+ <td class="author-id"><?php echo $author_info->user_id ?></td>
810
+ <td class="author-name"><?php echo $author_info->display_name ?></td>
811
+ <td class="author-action"><?php $this->se_display_author_action_row($author_info->user_id) ?></td>
812
+ </tr>
813
+ <?php
814
+ }
815
+
816
+ function se_display_author_action_row($author_id)
817
+ {
818
+ foreach ($this->default_IsActions['authors'] as $action_key => $action_val)
819
+ {
820
+ ?>
821
+ <label for="authors-<?php echo $action_key ?>-<?php echo $author_id ?>">
822
+ <?php echo $action_val['name'] ?></label>&nbsp;
823
+ <input type="checkbox"
824
+ name="se_admin[authors][<?php echo $action_key ?>][<?php echo $author_id ?>]"
825
+ id="authors-<?php echo $action_key ?>-<?php echo $author_id ?>"
826
+ <?php
827
+ if ($this->se_cfg['authors'][$action_key][$author_id] == "on")
828
+ echo "checked='checked' ";
829
+ ?> />
830
+ <?php
831
+ }
832
+ }
833
+
834
+ // END CONFIG FUNCTIONS
835
+ /////////////////////////////////////////////////////////////////
836
+
837
+
838
+
839
+
840
+
841
+
842
+
843
+
844
+
845
+
846
  // PAGE FUNCTIONS
847
  /////////////////////////////////////////////////////////////////
848
  function se_display_pages_panel($se_admin)
1080
  if ($this->in_admin == true)
1081
  return;
1082
 
 
1083
  if (count($this->default_IsActions['cats']) > 0)
1084
  {
1085
  foreach ($this->default_IsActions['cats'] as $action_key => $action_val)
1103
 
1104
  if ($this->wp_version >= 2.3)
1105
  {
1106
+ if (count($this->default_IsActions['tags']) > 0)
1107
  {
1108
+ foreach ($this->default_IsActions['tags'] as $action_key => $action_val)
1109
  {
1110
+ if ($query->{$action_key})
1111
  {
1112
+ if (isset($this->se_cfg['tags'][$action_key]))
 
 
 
 
1113
  {
1114
+ if (isset($tag_array_list))
1115
+ unset($tag_array_list);
1116
+
1117
+ $tag_array_list = array();
1118
+ if (count($this->se_cfg['tags'][$action_key]) > 0)
1119
  {
1120
+ foreach($this->se_cfg['tags'][$action_key] as $key => $val)
1121
+ {
1122
+ $tag_array_list[] = $key;
1123
+ }
1124
+
1125
+ if ($this->se_cfg['tags']['actions'][$action_key] == "e")
1126
+ {
1127
+ $query->set('tag__not_in', $tag_array_list);
1128
+ }
1129
+ else
1130
+ {
1131
+ $query->set('tag__in', $tag_array_list);
1132
+ }
1133
  }
1134
+ }
1135
+ }
1136
+ }
1137
+ }
1138
 
1139
+ if (count($this->default_IsActions['authors']) > 0)
1140
+ {
1141
+ foreach ($this->default_IsActions['authors'] as $action_key => $action_val)
1142
+ {
1143
+ $authors_list = "";
1144
+ if ($query->{$action_key})
1145
+ {
1146
+ if (isset($this->se_cfg['authors'][$action_key]))
1147
+ {
1148
+ if (count($this->se_cfg['authors'][$action_key]))
1149
  {
1150
+ $authors_list = $this->se_listify_ids(
1151
+ $this->se_cfg['authors']['actions'][$action_key],
1152
+ $this->se_cfg['authors'][$action_key]);
1153
  }
1154
  }
1155
+ if (strlen($authors_list))
1156
+ $query->set('author', $authors_list);
1157
  }
1158
  }
1159
  }
1160
  }
1161
+
1162
+ if (count($this->default_IsActions['pages']) > 0)
1163
  {
1164
+ foreach ($this->default_IsActions['pages'] as $action_key => $action_val)
1165
  {
1166
+ if ($query->{$action_key})
1167
+ {
1168
+ add_filter('posts_where', array(&$this, 'SE4_search_pages'));
1169
+ add_filter('posts_where', array(&$this, 'SE4_exclude_posts'));
1170
 
1171
  /*
1172
+ $pages_list;
1173
+ if (isset($this->se_cfg['pages'][$action_key]))
1174
+ {
1175
+ //echo "this->se_cfg['pages'][$action_key]=[". $this->se_cfg['pages'][$action_key]. "]<br />";
1176
 
1177
+ $pages_list = $this->se_listify_ids($this->se_cfg['pages']['actions'][$action_key],
1178
+ $this->se_cfg['pages'][$action_key]);
1179
+ //echo "pages_list=[". $pages_list."]<br />";
1180
+ }
1181
+ if (strlen($pages_list))
1182
+ $query->set('page', $pages_list);
1183
  */
1184
+ }
1185
  }
1186
  }
1187
  //echo "query after<pre>"; print_r($query); echo "</pre>";
1232
  WP action. </p>
1233
  <?php
1234
  }
1235
+ else if ($type == "authors")
1236
+ {
1237
+ ?>
1238
+ <p>Set the checkbox to exclude the respective author from the action</p>
1239
+ <p>So what is the difference between Exclusion and Inclusion?<br />
1240
+ <strong>Exclude</strong>: Select this action to exclude Authors from WP
1241
+ action. For example you may wish to exclude the Author 'jim' from Searches.<br />
1242
+ <strong>Include</strong>: Select the Author you wish to be included for certain
1243
+ WP actions. For example you want only a certain author(s) displayed on the home
1244
+ page. Note that with Include only those checked items will be included in the
1245
+ WP action. </p>
1246
+ <?php
1247
+ }
1248
  else if ($type == "pages")
1249
  {
1250
 
1282
  if ($this->wp_version < 2.5)
1283
  {
1284
  ?>
1285
+ <fieldset id="exclude_search_page" class="dbx-box">
1286
  <h3 class="dbx-handle"><?php _e('Exclude from Search?') ?></h3>
1287
  <div class="dbx-content">
1288
  <?php
simplyexclude_style_admin.css CHANGED
@@ -40,6 +40,8 @@ form#cat_exclusion table tr .action,
40
  form#cat_exclusion table tr .cat-id,
41
  form#tag_exclusion table tr .action,
42
  form#tag_exclusion table tr .tag-id,
 
 
43
  form#page_exclusion table tr .action,
44
  form#page_exclusion table tr .page-id {
45
  text-align: left;
@@ -50,6 +52,8 @@ form#cat_exclusion table tr .description,
50
  form#cat_exclusion table tr .cat-name,
51
  form#tag_exclusion table tr .description,
52
  form#tag_exclusion table tr .tag-name,
 
 
53
  form#page_exclusion table tr .description,
54
  form#page_exclusion table tr .page-name {
55
  text-align: left;
@@ -60,6 +64,8 @@ form#cat_exclusion table tr .inc-excl,
60
  form#cat_exclusion table tr .cat-action,
61
  form#tag_exclusion table tr .inc-excl,
62
  form#tag_exclusion table tr .tag-action,
 
 
63
  form#page_exclusion table tr .inc-excl,
64
  form#page_exclusion table tr .page-action {
65
  text-align: left;
@@ -68,13 +74,15 @@ form#page_exclusion table tr .page-action {
68
 
69
  form#cat_exclusion table tbody tr td.cat-action label,
70
  form#tag_exclusion table tbody tr td.tag-action label,
 
71
  form#page_exclusion table tbody tr td.page-action label {
72
  padding: 0;
73
  margin: 0;
74
  }
75
 
76
  form#cat_exclusion table tbody tr td.cat-action input,
77
- form#tag_exclusion table tbody tr td.tag-action input {
 
78
  margin-right: 15px;
79
  margin-left: 0px;
80
  }
@@ -87,6 +95,7 @@ form#page_exclusion table tbody tr td.page-action input {
87
 
88
  form#cat_exclusion .submit,
89
  form#tag_exclusion .submit,
 
90
  form#page_exclusion .submit {
91
  border-top: 0px solid #CCCCCC;
92
  margin: 2px 0pt 0pt;
40
  form#cat_exclusion table tr .cat-id,
41
  form#tag_exclusion table tr .action,
42
  form#tag_exclusion table tr .tag-id,
43
+ form#author_exclusion table tr .action,
44
+ form#author_exclusion table tr .author-id,
45
  form#page_exclusion table tr .action,
46
  form#page_exclusion table tr .page-id {
47
  text-align: left;
52
  form#cat_exclusion table tr .cat-name,
53
  form#tag_exclusion table tr .description,
54
  form#tag_exclusion table tr .tag-name,
55
+ form#author_exclusion table tr .description,
56
+ form#author_exclusion table tr .author-name,
57
  form#page_exclusion table tr .description,
58
  form#page_exclusion table tr .page-name {
59
  text-align: left;
64
  form#cat_exclusion table tr .cat-action,
65
  form#tag_exclusion table tr .inc-excl,
66
  form#tag_exclusion table tr .tag-action,
67
+ form#author_exclusion table tr .inc-excl,
68
+ form#author_exclusion table tr .author-action,
69
  form#page_exclusion table tr .inc-excl,
70
  form#page_exclusion table tr .page-action {
71
  text-align: left;
74
 
75
  form#cat_exclusion table tbody tr td.cat-action label,
76
  form#tag_exclusion table tbody tr td.tag-action label,
77
+ form#author_exclusion table tbody tr td.author-action label,
78
  form#page_exclusion table tbody tr td.page-action label {
79
  padding: 0;
80
  margin: 0;
81
  }
82
 
83
  form#cat_exclusion table tbody tr td.cat-action input,
84
+ form#tag_exclusion table tbody tr td.tag-action input,
85
+ form#author_exclusion table tbody tr td.author-action input {
86
  margin-right: 15px;
87
  margin-left: 0px;
88
  }
95
 
96
  form#cat_exclusion .submit,
97
  form#tag_exclusion .submit,
98
+ form#author_exclusion .submit,
99
  form#page_exclusion .submit {
100
  border-top: 0px solid #CCCCCC;
101
  margin: 2px 0pt 0pt;