Beehive PHP Cross Reference Discussion Forums

Source: /folder_options.php - 159 lines - 6093 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 . 'constants.inc.php';
  29  require_once  BH_INCLUDE_PATH . 'folder.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 . 'header.inc.php';
  33  require_once  BH_INCLUDE_PATH . 'html.inc.php';
  34  require_once  BH_INCLUDE_PATH . 'session.inc.php';
  35  require_once  BH_INCLUDE_PATH . 'word_filter.inc.php';
  36  // End Required includes
  37  
  38  // Check we're logged in correctly
  39  if (!session::logged_in()) {
  40      html_guest_error();
  41  }
  42  
  43  // Check that required variables are set
  44  if (isset($_GET['fid']) && is_numeric($_GET['fid'])) {
  45  
  46      $fid = $_GET['fid'];
  47  
  48  } else if (isset($_POST['fid']) && is_numeric($_POST['fid'])) {
  49  
  50      $fid = $_POST['fid'];
  51  
  52  } else {
  53  
  54      html_draw_error(gettext("The requested folder could not be found or access was denied."));
  55  }
  56  
  57  // Get the folder ID for the current message
  58  if (!$folder_data = folder_get($fid)) {
  59      html_draw_error(gettext("The requested folder could not be found or access was denied."));
  60  }
  61  
  62  // Get the existing thread data.
  63  if (!folder_is_accessible($fid)) {
  64      html_draw_error(gettext("The requested folder could not be found or access was denied."));
  65  }
  66  
  67  // Array to hold error messages
  68  $error_msg_array = array();
  69  
  70  // Submit Code
  71  if (isset($_POST['save'])) {
  72  
  73      $valid = true;
  74  
  75      if (isset($_POST['interest']) && is_numeric($_POST['interest'])) {
  76  
  77          $folder_data['INTEREST'] = $_POST['interest'];
  78  
  79          if (!user_set_folder_interest($fid, $folder_data['INTEREST'])) {
  80  
  81              $error_msg_array[] = gettext("Failed to update folder interest");
  82              $valid = false;
  83          }
  84      }
  85  
  86      if ($valid) {
  87  
  88          header_redirect("folder_options.php?webtag=$webtag&fid=$fid&updated=true");
  89          exit;
  90      }
  91  }
  92  
  93  html_draw_top(sprintf('title=%s', sprintf(gettext("Folder Options - %s"), $folder_data['TITLE'])), "basetarget=_blank", 'class=window_title');
  94  
  95  echo "<h1>", gettext("Folder Options"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", word_filter_add_ob_tags($folder_data['TITLE'], true), "</h1>\n";
  96  
  97  if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
  98  
  99      html_display_error_array($error_msg_array, '500', 'center');
 100  
 101  } else if (isset($_GET['updated'])) {
 102  
 103      html_display_success_msg(gettext("Updates saved successfully"), '500', 'center');
 104  }
 105  
 106  echo "<br />\n";
 107  echo "<div align=\"center\">\n";
 108  echo "  <form accept-charset=\"utf-8\" name=\"folder_options\" action=\"folder_options.php\" method=\"post\" target=\"_self\">\n";
 109  echo "  ", form_input_hidden("webtag", htmlentities_array($webtag)), "\n";
 110  echo "  ", form_input_hidden("fid", htmlentities_array($fid)), "\n";
 111  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"500\">\n";
 112  echo "    <tr>\n";
 113  echo "      <td align=\"left\">\n";
 114  echo "        <table class=\"box\" width=\"100%\">\n";
 115  echo "          <tr>\n";
 116  echo "            <td align=\"left\" class=\"posthead\">\n";
 117  echo "              <table class=\"posthead\" width=\"100%\">\n";
 118  echo "                <tr>\n";
 119  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Interest"), "</td>\n";
 120  echo "                </tr>\n";
 121  echo "                <tr>\n";
 122  echo "                  <td align=\"center\">\n";
 123  echo "                    <table class=\"posthead\" width=\"95%\">\n";
 124  echo "                      <tr>\n";
 125  echo "                        <td align=\"left\" valign=\"top\" class=\"posthead\">", gettext("Interest"), ":</td>\n";
 126  echo "                        <td align=\"left\">", form_radio("interest", FOLDER_IGNORED, gettext("Ignore"), $folder_data['INTEREST'] == FOLDER_IGNORED), "</td>\n";
 127  echo "                      </tr>\n";
 128  echo "                      <tr>\n";
 129  echo "                        <td align=\"left\">&nbsp;</td>\n";
 130  echo "                        <td align=\"left\">", form_radio("interest", FOLDER_NOINTEREST, gettext("Normal"), $folder_data['INTEREST'] == FOLDER_NOINTEREST), "</td>\n";
 131  echo "                      </tr>\n";
 132  echo "                      <tr>\n";
 133  echo "                        <td align=\"left\">&nbsp;</td>\n";
 134  echo "                        <td align=\"left\">", form_radio("interest", FOLDER_SUBSCRIBED, gettext("Subscribe"), $folder_data['INTEREST'] == FOLDER_SUBSCRIBED), "</td>\n";
 135  echo "                      </tr>\n";
 136  echo "                      <tr>\n";
 137  echo "                        <td align=\"left\">&nbsp;</td>\n";
 138  echo "                        <td align=\"left\">&nbsp;</td>\n";
 139  echo "                      </tr>\n";
 140  echo "                    </table>\n";
 141  echo "                  </td>\n";
 142  echo "                </tr>\n";
 143  echo "              </table>\n";
 144  echo "            </td>\n";
 145  echo "          </tr>\n";
 146  echo "        </table>\n";
 147  echo "      </td>\n";
 148  echo "    </tr>\n";
 149  echo "    <tr>\n";
 150  echo "      <td align=\"left\">&nbsp;</td>\n";
 151  echo "    </tr>\n";
 152  echo "    <tr>\n";
 153  echo "      <td align=\"center\">", form_submit("save", gettext("Save")), "&nbsp;", form_button("close_popup", gettext("Close")) . "</td>\n";
 154  echo "    </tr>\n";
 155  echo "  </table>\n";
 156  echo "  </form>\n";
 157  echo "</div>\n";
 158  
 159  html_draw_bottom();

title

Description

title

Description

title

Description

title

title

Body