Beehive PHP Cross Reference Discussion Forums

Source: /admin_wordfilter.php - 558 lines - 25335 bytes - Summary - Text - Print

   1  <?php
   2  
   3  /*======================================================================
   4  Copyright Project Beehive Forum 2002
   5  
   6  This file is part of Beehive Forum.
   7  
   8  Beehive Forum is free software; you can redistribute it and/or modify
   9  it under the terms of the GNU General Public License as published by
  10  the Free Software Foundation; either version 3 of the License, or
  11  (at your option) any later version.
  12  
  13  Beehive Forum is distributed in the hope that it will be useful,
  14  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16  GNU General Public License for more details.
  17  
  18  You should have received a copy of the GNU General Public License
  19  along with Beehive; if not, write to the Free Software
  20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  21  USA
  22  ======================================================================*/
  23  
  24  // Bootstrap
  25  require_once  'boot.php';
  26  
  27  // Required includes
  28  require_once  BH_INCLUDE_PATH . 'admin.inc.php';
  29  require_once  BH_INCLUDE_PATH . 'constants.inc.php';
  30  require_once  BH_INCLUDE_PATH . 'form.inc.php';
  31  require_once  BH_INCLUDE_PATH . 'format.inc.php';
  32  require_once  BH_INCLUDE_PATH . 'forum.inc.php';
  33  require_once  BH_INCLUDE_PATH . 'header.inc.php';
  34  require_once  BH_INCLUDE_PATH . 'html.inc.php';
  35  require_once  BH_INCLUDE_PATH . 'session.inc.php';
  36  require_once  BH_INCLUDE_PATH . 'word_filter.inc.php';
  37  // End Required includes
  38  
  39  // Check we're logged in correctly
  40  if (!session::logged_in()) {
  41      html_guest_error();
  42  }
  43  
  44  // Check we have Admin / Moderator access
  45  if (!(session::check_perm(USER_PERM_ADMIN_TOOLS, 0))) {
  46      html_draw_error(gettext("You do not have permission to use this section."));
  47  }
  48  
  49  // Perform additional admin login.
  50  admin_check_credentials();
  51  
  52  // Array to hold error messages
  53  $error_msg_array = array();
  54  
  55  $add_new_match_text = null;
  56  $add_new_filter_option = null;
  57  $add_new_filter_name = null;
  58  $match_text = null;
  59  $filter_option = null;
  60  $filter_name = null;
  61  
  62  if (isset($_GET['page']) && is_numeric($_GET['page'])) {
  63      $page = ($_GET['page'] > 0) ? $_GET['page'] : 1;
  64  } else {
  65      $page = 1;
  66  }
  67  
  68  // Constants for word filter type
  69  $admin_word_filter_options = array(
  70      WORD_FILTER_TYPE_ALL => gettext("All"),
  71      WORD_FILTER_TYPE_WHOLE_WORD => gettext("Whole Word"),
  72      WORD_FILTER_TYPE_PREG => gettext("PREG")
  73  );
  74  
  75  $admin_word_filter_enabled = array(
  76      WORD_FILTER_DISABLED => gettext("No"),
  77      WORD_FILTER_ENABLED => gettext("Yes")
  78  );
  79  
  80  // Form validation
  81  $valid = true;
  82  
  83  // Submit code
  84  if (isset($_POST['cancel']) || isset($_POST['delete'])) {
  85  
  86      unset($_POST['addfilter'], $_POST['filter_id'], $_GET['addfilter'], $_GET['filter_id']);
  87  }
  88  
  89  if (isset($_POST['delete'])) {
  90  
  91      if (isset($_POST['delete_filters']) && is_array($_POST['delete_filters'])) {
  92  
  93          foreach ($_POST['delete_filters'] as $filter_id => $delete_filter) {
  94  
  95              if (($delete_filter == "Y")) {
  96  
  97                  if (!admin_delete_word_filter($filter_id)) {
  98  
  99                      $valid = false;
 100                      $error_msg_array[] = gettext("Failed to update word filter. Check that the filter still exists.");
 101                  }
 102              }
 103          }
 104  
 105          if ($valid) {
 106  
 107              admin_add_log_entry(EDIT_WORD_FILTER);
 108  
 109              $redirect = "admin_wordfilter.php?webtag=$webtag&updated=true";
 110              header_redirect($redirect, gettext("Word Filter updated"));
 111              exit;
 112          }
 113      }
 114  
 115  } else if (isset($_POST['save'])) {
 116  
 117      $new_forum_settings = forum_get_settings();
 118  
 119      if (isset($_POST['force_word_filter']) && $_POST['force_word_filter'] == "Y") {
 120          $new_forum_settings['force_word_filter'] = "Y";
 121      } else {
 122          $new_forum_settings['force_word_filter'] = "N";
 123      }
 124  
 125      if (forum_save_settings($new_forum_settings)) {
 126  
 127          admin_add_log_entry(EDIT_WORD_FILTER);
 128          header_redirect("admin_wordfilter.php?webtag=$webtag&updated=true", gettext("Word Filter updated"));
 129  
 130      } else {
 131  
 132          $valid = false;
 133          $error_msg_array[] = gettext("Failed to update forum settings. Please try again later.");
 134      }
 135  
 136  } else if (isset($_POST['addfilter_submit'])) {
 137  
 138      if (isset($_POST['add_new_filter_name']) && strlen(trim($_POST['add_new_filter_name'])) > 0) {
 139          $add_new_filter_name = trim($_POST['add_new_filter_name']);
 140      } else {
 141          $valid = false;
 142          $error_msg_array[] = gettext("You must specify a filter name");
 143      }
 144  
 145      if (isset($_POST['add_new_match_text']) && strlen(trim($_POST['add_new_match_text'])) > 0) {
 146          $add_new_match_text = trim($_POST['add_new_match_text']);
 147      } else {
 148          $valid = false;
 149          $error_msg_array[] = gettext("You must specify matched text");
 150      }
 151  
 152      if (isset($_POST['add_new_filter_option']) && is_numeric($_POST['add_new_filter_option'])) {
 153          $add_new_filter_option = $_POST['add_new_filter_option'];
 154      } else {
 155          $valid = false;
 156          $error_msg_array[] = gettext("You must specify a filter option");
 157      }
 158  
 159      if (isset($_POST['add_new_filter_enabled']) && is_numeric($_POST['add_new_filter_enabled'])) {
 160          $add_new_filter_enabled = $_POST['add_new_filter_enabled'];
 161      } else {
 162          $add_new_filter_enabled = WORD_FILTER_DISABLED;
 163      }
 164  
 165      if (isset($_POST['add_new_replace_text']) && strlen(trim($_POST['add_new_replace_text'])) > 0) {
 166          $add_new_replace_text = trim($_POST['add_new_replace_text']);
 167      } else {
 168          $add_new_replace_text = "";
 169      }
 170  
 171      if ($valid) {
 172  
 173          if ($add_new_filter_option == WORD_FILTER_TYPE_PREG && preg_match('/e[^\/]*$/Diu', $add_new_match_text)) {
 174              $add_new_match_text = preg_replace_callback('/\/[^\/]*$/Diu', 'word_filter_apply_limit_preg', $add_new_match_text);
 175          }
 176  
 177          if (admin_add_word_filter($add_new_filter_name, $add_new_match_text, $add_new_replace_text, $add_new_filter_option, $add_new_filter_enabled)) {
 178  
 179              $log_data = array(
 180                  $add_new_match_text,
 181                  $add_new_replace_text,
 182                  $add_new_filter_option
 183              );
 184  
 185              admin_add_log_entry(EDIT_WORD_FILTER, $log_data);
 186  
 187              $redirect = "admin_wordfilter.php?webtag=$webtag&updated=true";
 188              header_redirect($redirect, gettext("Word Filter updated"));
 189              exit;
 190          }
 191      }
 192  
 193  } else if (isset($_POST['editfilter_submit'])) {
 194  
 195      if (isset($_POST['filter_id']) && is_numeric($_POST['filter_id'])) {
 196          $filter_id = $_POST['filter_id'];
 197      } else {
 198          $valid = false;
 199          $error_msg_array[] = gettext("You must specify a filter ID");
 200      }
 201  
 202      if (isset($_POST['filter_name']) && strlen(trim($_POST['filter_name'])) > 0) {
 203          $filter_name = trim($_POST['filter_name']);
 204      } else {
 205          $valid = false;
 206          $error_msg_array[] = gettext("You must specify a filter name");
 207      }
 208  
 209      if (isset($_POST['match_text']) && strlen(trim($_POST['match_text'])) > 0) {
 210          $match_text = trim($_POST['match_text']);
 211      } else {
 212          $valid = false;
 213          $error_msg_array[] = gettext("You must specify matched text");
 214      }
 215  
 216      if (isset($_POST['filter_option']) && is_numeric($_POST['filter_option'])) {
 217          $filter_option = $_POST['filter_option'];
 218      } else {
 219          $valid = false;
 220          $error_msg_array[] = gettext("You must specify a filter option");
 221      }
 222  
 223      if (isset($_POST['filter_enabled']) && is_numeric($_POST['filter_enabled'])) {
 224          $filter_enabled = $_POST['filter_enabled'];
 225      } else {
 226          $filter_enabled = WORD_FILTER_DISABLED;
 227      }
 228  
 229      if (isset($_POST['replace_text']) && strlen(trim($_POST['replace_text'])) > 0) {
 230          $replace_text = trim($_POST['replace_text']);
 231      } else {
 232          $replace_text = "";
 233      }
 234  
 235      if ($valid) {
 236  
 237          if ($filter_option == WORD_FILTER_TYPE_PREG && preg_match('/e[^\/]*$/Diu', $match_text)) {
 238              $match_text = preg_replace_callback('/\/[^\/]*$/Diu', 'word_filter_apply_limit_preg', $match_text);
 239          }
 240  
 241          if (admin_update_word_filter($filter_id, $filter_name, $match_text, $replace_text, $filter_option, $filter_enabled)) {
 242  
 243              $log_data = array(
 244                  $filter_option,
 245                  $match_text,
 246                  $replace_text,
 247                  $filter_option
 248              );
 249  
 250              admin_add_log_entry(EDIT_WORD_FILTER, $log_data);
 251  
 252              $redirect = "admin_wordfilter.php?webtag=$webtag&updated=true";
 253              header_redirect($redirect, gettext("Word Filter updated"));
 254              exit;
 255  
 256          } else {
 257  
 258              $error_msg_array[] = gettext("Failed to update word filter. Check that the filter still exists.");
 259          }
 260      }
 261  
 262  } else if (isset($_POST['addfilter'])) {
 263  
 264      $redirect = "admin_wordfilter.php?webtag=$webtag&addfilter=true";
 265      header_redirect($redirect);
 266      exit;
 267  }
 268  
 269  if (isset($_GET['addfilter']) || isset($_POST['addfilter'])) {
 270  
 271      html_draw_top(sprintf('title=%s', gettext("Admin -  Word Filter - Add word filter")), 'class=window_title', 'main_css=admin.css');
 272  
 273      echo "<h1>", gettext("Admin"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Word Filter"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Add word filter"), "</h1>\n";
 274  
 275      if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
 276          html_display_error_array($error_msg_array, '700', 'center');
 277      }
 278  
 279      echo "<br />\n";
 280      echo "<div align=\"center\">\n";
 281      echo "<form accept-charset=\"utf-8\" name=\"startpage\" method=\"post\" action=\"admin_wordfilter.php\">\n";
 282      echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
 283      echo "  ", form_input_hidden('addfilter', 'true'), "\n";
 284      echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"700\">\n";
 285      echo "    <tr>\n";
 286      echo "      <td align=\"left\">\n";
 287      echo "        <table class=\"box\" width=\"100%\">\n";
 288      echo "          <tr>\n";
 289      echo "            <td align=\"left\" class=\"posthead\">\n";
 290      echo "              <table class=\"posthead\" width=\"100%\">\n";
 291      echo "                <tr>\n";
 292      echo "                  <td align=\"left\" class=\"subhead\">", gettext("Add New Word Filter"), "</td>\n";
 293      echo "                </tr>\n";
 294      echo "                <tr>\n";
 295      echo "                  <td align=\"center\">\n";
 296      echo "                    <table class=\"posthead\" width=\"95%\">\n";
 297      echo "                      <tr>\n";
 298      echo "                        <td align=\"left\">", gettext("Filter Name"), ":</td>\n";
 299      echo "                        <td align=\"left\" colspan=\"3\">", form_input_text("add_new_filter_name", (isset($_POST['add_new_filter_name']) ? htmlentities_array($_POST['add_new_filter_name']) : ""), 60, 255), "</td>\n";
 300      echo "                      </tr>\n";
 301      echo "                      <tr>\n";
 302      echo "                        <td align=\"left\">", gettext("Matched Text"), ":</td>\n";
 303      echo "                        <td align=\"left\" colspan=\"3\">", form_input_text("add_new_match_text", (isset($_POST['add_new_match_text']) ? htmlentities_array($_POST['add_new_match_text']) : ""), 60), "</td>\n";
 304      echo "                      </tr>\n";
 305      echo "                      <tr>\n";
 306      echo "                        <td align=\"left\">", gettext("Replacement Text"), ":</td>\n";
 307      echo "                        <td align=\"left\" colspan=\"3\">", form_input_text("add_new_replace_text", (isset($_POST['add_new_replace_text']) ? htmlentities_array($_POST['add_new_replace_text']) : ""), 60), "</td>\n";
 308      echo "                      </tr>\n";
 309      echo "                      <tr>\n";
 310      echo "                        <td align=\"left\" valign=\"top\">", gettext("Filter Type"), ":</td>\n";
 311      echo "                        <td align=\"left\">", form_dropdown_array("add_new_filter_option", array(gettext("All"), gettext("Whole Word"), gettext("PREG")), (isset($_POST['add_new_filter_option']) ? $_POST['add_new_filter_option'] : 0)), "</td>\n";
 312      echo "                      </tr>\n";
 313      echo "                      <tr>\n";
 314      echo "                        <td align=\"left\" valign=\"top\">", gettext("Filter Enabled"), ":</td>\n";
 315      echo "                        <td align=\"left\">", form_dropdown_array("add_new_filter_enabled", array(WORD_FILTER_ENABLED => gettext("Yes"), WORD_FILTER_DISABLED => gettext("No")), (isset($_POST['add_new_filter_enabled']) ? $_POST['add_new_filter_enabled'] : 1)), "</td>\n";
 316      echo "                      </tr>\n";
 317      echo "                      <tr>\n";
 318      echo "                        <td align=\"left\">&nbsp;</td>\n";
 319      echo "                      </tr>\n";
 320      echo "                    </table>\n";
 321      echo "                  </td>\n";
 322      echo "                </tr>\n";
 323      echo "              </table>\n";
 324      echo "            </td>\n";
 325      echo "          </tr>\n";
 326      echo "        </table>\n";
 327      echo "      </td>\n";
 328      echo "    </tr>\n";
 329      echo "    <tr>\n";
 330      echo "      <td align=\"left\">&nbsp;</td>\n";
 331      echo "    </tr>\n";
 332      echo "    <tr>\n";
 333      echo "      <td colspan=\"2\" align=\"center\">", form_submit("addfilter_submit", gettext("Add")), "&nbsp;", form_submit("cancel", gettext("Cancel")), "</td>\n";
 334      echo "    </tr>\n";
 335      echo "  </table>\n";
 336      echo "</form>\n";
 337  
 338      html_display_warning_msg(sprintf('%s<p>%s</p>%s', gettext("<b>All</b> matches against the whole text so filtering mom to mum will also change moment to mument."), gettext("<b>Whole Word</b> matches against whole words only so filtering mom to mum will NOT change moment to mument."), gettext("<b>PREG</b> allows you to use Perl Regular Expressions to match text.")), '700', 'center');
 339  
 340      echo "</div>\n";
 341  
 342      html_draw_bottom();
 343  
 344  } else if (isset($_POST['filter_id']) || isset($_GET['filter_id'])) {
 345  
 346      if (isset($_POST['filter_id']) && is_numeric($_POST['filter_id'])) {
 347  
 348          $filter_id = $_POST['filter_id'];
 349  
 350      } else if (isset($_GET['filter_id']) && is_numeric($_GET['filter_id'])) {
 351  
 352          $filter_id = $_GET['filter_id'];
 353  
 354      } else {
 355  
 356          html_draw_error(gettext("You must specify a filter ID"), 'admin_wordfilter.php', 'get', array('back' => gettext("Back")));
 357      }
 358  
 359      if (!$word_filter_array = admin_get_word_filter($filter_id)) {
 360          html_draw_error(gettext("Invalid Filter ID"), 'admin_wordfilter.php', 'get', array('back' => gettext("Back")));
 361      }
 362  
 363      html_draw_top(sprintf('title=%s', gettext("Admin - Word Filter - Edit Word Filter")), 'class=window_title', 'main_css=admin.css');
 364  
 365      echo "<h1>", gettext("Admin"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Word Filter"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Edit Word Filter"), "</h1>\n";
 366  
 367      if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
 368          html_display_error_array($error_msg_array, '700', 'center');
 369      }
 370  
 371      echo "<br />\n";
 372      echo "<div align=\"center\">\n";
 373      echo "<form accept-charset=\"utf-8\" name=\"startpage\" method=\"post\" action=\"admin_wordfilter.php\">\n";
 374      echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
 375      echo "  ", form_input_hidden('filter_id', htmlentities_array($filter_id)), "\n";
 376      echo "  ", form_input_hidden("delete_filters[$filter_id]", 'Y'), "\n";
 377      echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"700\">\n";
 378      echo "    <tr>\n";
 379      echo "      <td align=\"left\">\n";
 380      echo "        <table class=\"box\" width=\"100%\">\n";
 381      echo "          <tr>\n";
 382      echo "            <td align=\"left\" class=\"posthead\">\n";
 383      echo "              <table class=\"posthead\" width=\"100%\">\n";
 384      echo "                <tr>\n";
 385      echo "                  <td align=\"left\" class=\"subhead\">", gettext("Edit Word Filter"), "</td>\n";
 386      echo "                </tr>\n";
 387      echo "                <tr>\n";
 388      echo "                  <td align=\"center\">\n";
 389      echo "                    <table class=\"posthead\" width=\"95%\">\n";
 390      echo "                      <tr>\n";
 391      echo "                        <td align=\"left\">", gettext("Filter Name"), ":</td>\n";
 392      echo "                        <td align=\"left\">", form_input_text("filter_name", (isset($_POST['filter_name']) ? htmlentities_array($_POST['filter_name']) : htmlentities_array($word_filter_array['FILTER_NAME'])), 60, 255), "</td>\n";
 393      echo "                      </tr>\n";
 394      echo "                      <tr>\n";
 395      echo "                        <td align=\"left\">", gettext("Matched Text"), ":</td>\n";
 396      echo "                        <td align=\"left\">", form_input_text("match_text", (isset($_POST['match_text']) ? htmlentities_array($_POST['match_text']) : htmlentities_array($word_filter_array['MATCH_TEXT'])), 60), "</td>\n";
 397      echo "                      </tr>\n";
 398      echo "                      <tr>\n";
 399      echo "                        <td align=\"left\">", gettext("Replacement Text"), ":</td>\n";
 400      echo "                        <td align=\"left\">", form_input_text("replace_text", (isset($_POST['replace_text']) ? htmlentities_array($_POST['replace_text']) : htmlentities_array($word_filter_array['REPLACE_TEXT'])), 60), "</td>\n";
 401      echo "                      </tr>\n";
 402      echo "                      <tr>\n";
 403      echo "                        <td align=\"left\" valign=\"top\">", gettext("Filter Type"), ":</td>\n";
 404      echo "                        <td align=\"left\">", form_dropdown_array("filter_option", array(gettext("All"), gettext("Whole Word"), gettext("PREG")), (isset($_POST['filter_option']) ? htmlentities_array($_POST['filter_option']) : htmlentities_array($word_filter_array['FILTER_TYPE']))), "</td>\n";
 405      echo "                      </tr>\n";
 406      echo "                      <tr>\n";
 407      echo "                        <td align=\"left\" valign=\"top\">", gettext("Filter Enabled"), ":</td>\n";
 408      echo "                        <td align=\"left\">", form_dropdown_array("filter_enabled", array(WORD_FILTER_ENABLED => gettext("Yes"), WORD_FILTER_DISABLED => gettext("No")), (isset($_POST['filter_enabled']) ? htmlentities_array($_POST['filter_enabled']) : htmlentities_array($word_filter_array['FILTER_ENABLED']))), "</td>\n";
 409      echo "                      </tr>\n";
 410      echo "                      <tr>\n";
 411      echo "                        <td align=\"left\">&nbsp;</td>\n";
 412      echo "                      </tr>\n";
 413      echo "                    </table>\n";
 414      echo "                  </td>\n";
 415      echo "                </tr>\n";
 416      echo "              </table>\n";
 417      echo "            </td>\n";
 418      echo "          </tr>\n";
 419      echo "        </table>\n";
 420      echo "      </td>\n";
 421      echo "    </tr>\n";
 422      echo "    <tr>\n";
 423      echo "      <td align=\"left\">&nbsp;</td>\n";
 424      echo "    </tr>\n";
 425      echo "    <tr>\n";
 426      echo "      <td colspan=\"2\" align=\"center\">", form_submit("editfilter_submit", gettext("Save")), "&nbsp;", form_submit("delete", gettext("Delete")), "&nbsp;", form_submit("cancel", gettext("Cancel")), "</td>\n";
 427      echo "    </tr>\n";
 428      echo "  </table>\n";
 429      echo "</form>\n";
 430  
 431      html_display_warning_msg(sprintf('%s<p>%s</p>%s', gettext("<b>All</b> matches against the whole text so filtering mom to mum will also change moment to mument."), gettext("<b>Whole Word</b> matches against whole words only so filtering mom to mum will NOT change moment to mument."), gettext("<b>PREG</b> allows you to use Perl Regular Expressions to match text.")), '700', 'center');
 432  
 433      echo "</div>\n";
 434  
 435      html_draw_bottom();
 436  
 437  } else {
 438  
 439      html_draw_top(sprintf('title=%s', gettext("Admin - Word Filter")), 'class=window_title', 'main_css=admin.css');
 440  
 441      $word_filter_array = admin_get_word_filter_list($page);
 442  
 443      echo "<h1>", gettext("Admin"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Word Filter"), "</h1>\n";
 444  
 445      if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
 446  
 447          html_display_error_array($error_msg_array, '86%', 'center');
 448  
 449      } else if (isset($_GET['updated'])) {
 450  
 451          html_display_success_msg(gettext("Word Filter updated"), '86%', 'center');
 452  
 453      } else if (sizeof($word_filter_array['word_filter_array']) < 1) {
 454  
 455          html_display_warning_msg(gettext("No existing word filter entries found. To add a filter click the 'Add New' button below."), '86%', 'center');
 456      }
 457  
 458      echo "<br />\n";
 459      echo "<div align=\"center\">\n";
 460      echo "<form accept-charset=\"utf-8\" method=\"post\" action=\"admin_wordfilter.php\">\n";
 461      echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
 462      echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 463      echo "    <tr>\n";
 464      echo "      <td align=\"left\">\n";
 465      echo "        <table class=\"box\" width=\"100%\">\n";
 466      echo "          <tr>\n";
 467      echo "            <td align=\"left\" class=\"posthead\">\n";
 468      echo "              <table class=\"posthead\" width=\"100%\">\n";
 469      echo "                <tr>\n";
 470      echo "                  <td align=\"left\" class=\"subhead\" width=\"20\">&nbsp;</td>\n";
 471      echo "                  <td align=\"left\" class=\"subhead\" style=\"white-space: nowrap\">", gettext("Filter Name"), "&nbsp;</td>\n";
 472      echo "                  <td align=\"left\" class=\"subhead\" style=\"white-space: nowrap\">", gettext("Filter Type"), "&nbsp;</td>\n";
 473      echo "                  <td align=\"center\" class=\"subhead\" style=\"white-space: nowrap\" width=\"100\">", gettext("Filter Enabled"), "&nbsp;</td>\n";
 474      echo "                </tr>\n";
 475  
 476      if (sizeof($word_filter_array['word_filter_array']) > 0) {
 477  
 478          foreach ($word_filter_array['word_filter_array'] as $filter_id => $word_filter) {
 479  
 480              echo "                <tr>\n";
 481              echo "                  <td align=\"center\">", form_checkbox("delete_filters[$filter_id]", "Y"), "</td>\n";
 482              echo "                  <td align=\"left\"><a href=\"admin_wordfilter.php?webtag=$webtag&amp;filter_id=$filter_id\">", htmlentities_array($word_filter['FILTER_NAME']), "</a></td>\n";
 483              echo "                  <td align=\"left\">{$admin_word_filter_options[$word_filter['FILTER_TYPE']]}</td>\n";
 484              echo "                  <td align=\"center\">{$admin_word_filter_enabled[$word_filter['FILTER_ENABLED']]}&nbsp;</td>\n";
 485              echo "                </tr>\n";
 486          }
 487      }
 488  
 489      echo "                <tr>\n";
 490      echo "                  <td align=\"left\">&nbsp;</td>\n";
 491      echo "                </tr>\n";
 492      echo "              </table>\n";
 493      echo "            </td>\n";
 494      echo "          </tr>\n";
 495      echo "        </table>\n";
 496      echo "      </td>\n";
 497      echo "    </tr>\n";
 498      echo "    <tr>\n";
 499      echo "      <td align=\"left\">&nbsp;</td>\n";
 500      echo "    </tr>\n";
 501      echo "    <tr>\n";
 502      echo "      <td class=\"postbody\" align=\"center\">";
 503  
 504      html_page_links("admin_wordfilter.php?webtag=$webtag", $page, $word_filter_array['word_filter_count'], 10);
 505  
 506      echo "      </td>\n";
 507      echo "    </tr>\n";
 508      echo "    <tr>\n";
 509      echo "      <td align=\"left\">&nbsp;</td>\n";
 510      echo "    </tr>\n";
 511      echo "    <tr>\n";
 512      echo "      <td colspan=\"2\" align=\"center\">", form_submit("addfilter", gettext("Add New")), "&nbsp;", form_submit("delete", gettext("Delete Selected")), "</td>\n";
 513      echo "    </tr>\n";
 514      echo "  </table>\n";
 515      echo "  <br />\n";
 516      echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 517      echo "    <tr>\n";
 518      echo "      <td align=\"left\">\n";
 519      echo "        <table class=\"box\" width=\"100%\">\n";
 520      echo "          <tr>\n";
 521      echo "            <td align=\"left\" class=\"posthead\">\n";
 522      echo "              <table class=\"posthead\" width=\"100%\">\n";
 523      echo "                <tr>\n";
 524      echo "                  <td align=\"left\" class=\"subhead\">", gettext("Options"), "</td>\n";
 525      echo "                </tr>\n";
 526      echo "                <tr>\n";
 527      echo "                  <td align=\"center\">\n";
 528      echo "                    <table width=\"95%\">\n";
 529      echo "                      <tr>\n";
 530      echo "                        <td align=\"left\">", form_checkbox("force_word_filter", "Y", gettext("Force use of admin word filter on all users (inc. guests)"), forum_get_setting("force_word_filter", "Y")), "</td>\n";
 531      echo "                      </tr>\n";
 532      echo "                    </table>\n";
 533      echo "                  </td>\n";
 534      echo "                </tr>\n";
 535      echo "                <tr>\n";
 536      echo "                  <td align=\"left\">&nbsp;</td>\n";
 537      echo "                </tr>\n";
 538      echo "              </table>\n";
 539      echo "            </td>\n";
 540      echo "          </tr>\n";
 541      echo "        </table>\n";
 542      echo "      </td>\n";
 543      echo "    </tr>\n";
 544      echo "    <tr>\n";
 545      echo "      <td align=\"left\">&nbsp;</td>\n";
 546      echo "    </tr>\n";
 547      echo "    <tr>\n";
 548      echo "      <td align=\"center\">", form_submit("save", gettext("Save")), "</td>\n";
 549      echo "    </tr>\n";
 550      echo "    <tr>\n";
 551      echo "      <td align=\"left\">&nbsp;</td>\n";
 552      echo "    </tr>\n";
 553      echo "  </table>\n";
 554      echo "</form>\n";
 555      echo "</div>\n";
 556  
 557      html_draw_bottom();
 558  }

title

Description

title

Description

title

Description

title

title

Body