Beehive PHP Cross Reference Discussion Forums

Source: /thread_options.php - 1005 lines - 51469 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 . 'folder.inc.php';
  31  require_once  BH_INCLUDE_PATH . 'form.inc.php';
  32  require_once  BH_INCLUDE_PATH . 'format.inc.php';
  33  require_once  BH_INCLUDE_PATH . 'forum.inc.php';
  34  require_once  BH_INCLUDE_PATH . 'header.inc.php';
  35  require_once  BH_INCLUDE_PATH . 'html.inc.php';
  36  require_once  BH_INCLUDE_PATH . 'messages.inc.php';
  37  require_once  BH_INCLUDE_PATH . 'poll.inc.php';
  38  require_once  BH_INCLUDE_PATH . 'post.inc.php';
  39  require_once  BH_INCLUDE_PATH . 'session.inc.php';
  40  require_once  BH_INCLUDE_PATH . 'thread.inc.php';
  41  require_once  BH_INCLUDE_PATH . 'user.inc.php';
  42  require_once  BH_INCLUDE_PATH . 'word_filter.inc.php';
  43  // End Required includes
  44  
  45  // Check we're logged in correctly
  46  if (!session::logged_in()) {
  47      html_guest_error();
  48  }
  49  
  50  // Check that required variables are set
  51  if (isset($_GET['msg']) && validate_msg($_GET['msg'])) {
  52  
  53      $msg = $_GET['msg'];
  54      list($tid, $pid) = explode(".", $_GET['msg']);
  55  
  56  } else if (isset($_POST['msg']) && validate_msg($_POST['msg'])) {
  57  
  58      $msg = $_POST['msg'];
  59      list($tid, $pid) = explode(".", $_POST['msg']);
  60  
  61  } else {
  62  
  63      html_draw_error(gettext("The requested thread could not be found or access was denied."));
  64  }
  65  
  66  if (isset($_POST['return_msg']) && validate_msg($_POST['return_msg'])) {
  67      $return_msg = $_POST['return_msg'];
  68  } else if (isset($_GET['return_msg']) && validate_msg($_GET['return_msg'])) {
  69      $return_msg = $_GET['return_msg'];
  70  } else {
  71      $return_msg = $msg;
  72  }
  73  
  74  if (!$folder_data = thread_get_folder($tid)) {
  75      html_draw_error(gettext("The requested folder could not be found or access was denied."));
  76  }
  77  
  78  $perm_folder_moderate = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID']);
  79  
  80  if (!$thread_data = thread_get($tid, $perm_folder_moderate, false, $perm_folder_moderate)) {
  81      html_draw_error(gettext("The requested thread could not be found or access was denied."));
  82  }
  83  
  84  // Array to hold error messages
  85  $error_msg_array = array();
  86  
  87  // Array of valid thread deletion types
  88  $thread_delete_valid_types = array(
  89      THREAD_DELETE_PERMENANT,
  90      THREAD_DELETE_NON_PERMENANT
  91  );
  92  
  93  // Back button clicked.
  94  if (isset($_POST['back'])) {
  95  
  96      header_redirect("messages.php?webtag=$webtag&msg=$return_msg");
  97      exit;
  98  }
  99  
 100  // Code for handling functionality from messages.php
 101  if (isset($_GET['markasread']) && is_numeric($_GET['markasread'])) {
 102  
 103      if (in_range($_GET['markasread'], 0, $thread_data['LENGTH'])) {
 104  
 105          $mark_as_read = $_GET['markasread'];
 106  
 107          if (messages_set_read($tid, $mark_as_read, $thread_data['MODIFIED'])) {
 108  
 109              header_redirect("messages.php?webtag=$webtag&msg=$return_msg&markasread=1");
 110              exit;
 111          }
 112      }
 113  
 114      header_redirect("messages.php?webtag=$webtag&msg=$return_msg&markasread=0");
 115      exit;
 116  
 117  } else if (isset($_POST['setinterest']) && is_numeric($_POST['setinterest'])) {
 118  
 119      $thread_interest = $_POST['setinterest'];
 120  
 121      if (thread_set_interest($tid, $thread_interest)) {
 122  
 123          header_redirect("messages.php?webtag=$webtag&msg=$return_msg&setinterest=1");
 124          exit;
 125      }
 126  
 127      header_redirect("messages.php?webtag=$webtag&msg=$return_msg&setinterest=0");
 128      exit;
 129  }
 130  
 131  // Submit Code
 132  if (isset($_POST['save'])) {
 133  
 134      $valid = true;
 135  
 136      if (isset($_POST['markasread']) && is_numeric($_POST['markasread'])) {
 137  
 138          if (in_range($_POST['markasread'], 0, $thread_data['LENGTH'])) {
 139  
 140              $thread_data['LAST_READ'] = $_POST['markasread'];
 141  
 142              if (!messages_set_read($tid, $thread_data['LAST_READ'], $thread_data['MODIFIED'])) {
 143  
 144                  $error_msg_array[] = gettext("Failed to update thread read status");
 145                  $valid = false;
 146              }
 147  
 148          } else {
 149  
 150              $error_msg_array[] = gettext("Failed to update thread read status");
 151              $valid = false;
 152          }
 153      }
 154  
 155      if (isset($_POST['interest']) && is_numeric($_POST['interest'])) {
 156  
 157          $thread_data['INTEREST'] = $_POST['interest'];
 158  
 159          if (!thread_set_interest($tid, $thread_data['INTEREST'])) {
 160  
 161              $error_msg_array[] = gettext("Failed to update thread interest");
 162              $valid = false;
 163          }
 164      }
 165  
 166      // Admin Options
 167      if (session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID']) || (($thread_data['BY_UID'] == $_SESSION['UID']) && ($thread_data['ADMIN_LOCK'] != THREAD_ADMIN_LOCK_ENABLED) && forum_get_setting('allow_post_editing', 'Y') && ((intval(forum_get_setting('post_edit_time', 'is_numeric', 0)) == 0) || ((time() - $thread_data['CREATED']) < (intval(forum_get_setting('post_edit_time', 'is_numeric', 0) * MINUTE_IN_SECONDS)))))) {
 168  
 169          if (isset($_POST['rename']) && strlen(trim($_POST['rename'])) > 0) {
 170  
 171              $t_rename = trim($_POST['rename']);
 172  
 173              if ($t_rename !== trim($thread_data['TITLE'])) {
 174  
 175                  if (thread_change_title($tid, $t_rename)) {
 176  
 177                      post_add_edit_text($tid, 1);
 178  
 179                      if (session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID'])) {
 180  
 181                          admin_add_log_entry(RENAME_THREAD, array($tid, $thread_data['TITLE'], $t_rename));
 182                      }
 183  
 184                  } else {
 185  
 186                      $error_msg_array[] = gettext("Failed to rename thread");
 187                      $valid = false;
 188                  }
 189              }
 190          }
 191  
 192          if (isset($_POST['move']) && is_numeric($_POST['move'])) {
 193  
 194              $t_move = $_POST['move'];
 195  
 196              if (folder_is_valid($t_move) && ($t_move !== $thread_data['FID'])) {
 197  
 198                  if ((session::check_perm(USER_PERM_FOLDER_MODERATE, $t_move) || (session::check_perm(USER_PERM_THREAD_MOVE, $t_move) && ($thread_data['BY_UID'] == $_SESSION['UID']) && ($thread_data['ADMIN_LOCK'] != THREAD_ADMIN_LOCK_ENABLED) && forum_get_setting('allow_post_editing', 'Y') && ((intval(forum_get_setting('post_edit_time', 'is_numeric', 0)) == 0) || ((time() - $thread_data['CREATED']) < (intval(forum_get_setting('post_edit_time', 'is_numeric', 0) * MINUTE_IN_SECONDS)))))) && thread_change_folder($tid, $t_move)) {
 199  
 200                      $new_folder_title = folder_get_title($t_move);
 201                      $old_folder_title = folder_get_title($thread_data['FID']);
 202  
 203                      post_add_edit_text($tid, 1);
 204  
 205                      if (session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID'])) {
 206  
 207                          admin_add_log_entry(MOVED_THREAD, array($tid, $thread_data['TITLE'], $old_folder_title, $new_folder_title));
 208                      }
 209  
 210                  } else {
 211  
 212                      $error_msg_array[] = gettext("Failed to move thread to specified folder");
 213                      $valid = false;
 214                  }
 215              }
 216          }
 217      }
 218  
 219      if (session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID'])) {
 220  
 221          if (isset($_POST['closed']) && is_numeric($_POST['closed'])) {
 222  
 223              $t_closed = in_array($_POST['closed'], range(0, 1)) ? $_POST['closed'] : $thread_data['CLOSED'];
 224  
 225              if ($t_closed != $thread_data['CLOSED']) {
 226  
 227                  if (thread_set_closed($tid, $t_closed > 0)) {
 228  
 229                      post_add_edit_text($tid, 1);
 230  
 231                      admin_add_log_entry(($t_closed > 0) ? CLOSED_THREAD : OPENED_THREAD, array($tid, $thread_data['TITLE']));
 232  
 233                  } else {
 234  
 235                      $error_msg_array[] = gettext("Failed to update thread closed status");
 236                      $valid = false;
 237                  }
 238              }
 239          }
 240  
 241          if (isset($_POST['admin_lock']) && is_numeric($_POST['admin_lock'])) {
 242  
 243              $t_admin_lock = in_array($_POST['admin_lock'], range(0, 1)) ? $_POST['admin_lock'] : $thread_data['ADMIN_LOCK'];
 244  
 245              if ($t_admin_lock != $thread_data['ADMIN_LOCK']) {
 246  
 247                  if (thread_admin_lock($tid, $t_admin_lock > 0)) {
 248  
 249                      post_add_edit_text($tid, 1);
 250  
 251                      admin_add_log_entry(($t_admin_lock > 0) ? LOCKED_THREAD : UNLOCKED_THREAD, array($tid, $thread_data['TITLE']));
 252  
 253                  } else {
 254  
 255                      $error_msg_array[] = gettext("Failed to update thread lock status");
 256                      $valid = false;
 257                  }
 258              }
 259          }
 260  
 261          if (isset($_POST['sticky']) && $_POST['sticky'] == "Y") {
 262  
 263              $t_sticky = $_POST['sticky'];
 264  
 265              if (isset($_POST['sticky_year']) && isset($_POST['sticky_month']) && isset($_POST['sticky_day'])) {
 266  
 267                  $sticky_day = trim($_POST['sticky_day']);
 268                  $sticky_month = trim($_POST['sticky_month']);
 269                  $sticky_year = trim($_POST['sticky_year']);
 270  
 271                  if (is_numeric($sticky_month) && $sticky_month > 0 && is_numeric($sticky_day) && $sticky_day > 0 && is_numeric($sticky_year) && $sticky_year > 0) {
 272  
 273                      if (@checkdate($sticky_month, $sticky_day, $sticky_year)) {
 274  
 275                          $t_sticky_until = mktime(0, 0, 0, $sticky_month, $sticky_day, $sticky_year);
 276  
 277                          if (($t_sticky != $thread_data['STICKY']) || ($t_sticky_until != $thread_data['STICKY_UNTIL'])) {
 278  
 279                              $thread_data['STICKY'] = $_POST['sticky'];
 280                              $thread_data['STICKY_UNTIL'] = $t_sticky_until;
 281  
 282                              if (thread_set_sticky($tid, true, $t_sticky_until)) {
 283  
 284                                  post_add_edit_text($tid, 1);
 285  
 286                                  admin_add_log_entry(CREATE_THREAD_STICKY, array($tid, $thread_data['TITLE']));
 287  
 288                              } else {
 289  
 290                                  $error_msg_array[] = gettext("Failed to update thread sticky status");
 291                                  $valid = false;
 292                              }
 293                          }
 294  
 295                      } else {
 296  
 297                          $error_msg_array[] = gettext("Failed to update thread sticky status");
 298                          $valid = false;
 299                      }
 300  
 301                  } else {
 302  
 303                      if (thread_set_sticky($tid, true)) {
 304  
 305                          post_add_edit_text($tid, 1);
 306  
 307                          admin_add_log_entry(CREATE_THREAD_STICKY, array($tid, $thread_data['TITLE']));
 308  
 309                      } else {
 310  
 311                          $error_msg_array[] = gettext("Failed to update thread sticky status");
 312                          $valid = false;
 313                      }
 314                  }
 315              }
 316  
 317          } else if (isset($_POST['sticky']) && $_POST['sticky'] == "N") {
 318  
 319              $t_sticky = $_POST['sticky'];
 320  
 321              if ($t_sticky != $thread_data['STICKY']) {
 322  
 323                  if (thread_set_sticky($tid, false)) {
 324  
 325                      post_add_edit_text($tid, 1);
 326  
 327                      admin_add_log_entry(REMOVE_THREAD_STICKY, array($tid, $thread_data['TITLE']));
 328  
 329                  } else {
 330  
 331                      $error_msg_array[] = gettext("Failed to update thread sticky status");
 332                      $valid = false;
 333                  }
 334              }
 335          }
 336  
 337          if (isset($_POST['thread_merge_split']) && is_numeric($_POST['thread_merge_split'])) {
 338  
 339              if ($_POST['thread_merge_split'] == THREAD_TYPE_MERGE) {
 340  
 341                  if (isset($_POST['merge_thread']) && is_numeric($_POST['merge_thread'])) {
 342  
 343                      if (isset($_POST['merge_type']) && is_numeric($_POST['merge_type']) && isset($_POST['merge_thread_con']) && $_POST['merge_thread_con'] == "Y") {
 344  
 345                          $error_str = '';
 346  
 347                          $merge_thread = $_POST['merge_thread'];
 348                          $merge_type = $_POST['merge_type'];
 349  
 350                          if (validate_msg($merge_thread)) {
 351                              list($merge_thread) = explode('.', $merge_thread);
 352                          }
 353  
 354                          if (($merge_result = thread_merge($tid, $merge_thread, $merge_type, $error_str)) !== false) {
 355  
 356                              post_add_edit_text($tid, 1);
 357  
 358                              admin_add_log_entry(THREAD_MERGE, $merge_result);
 359  
 360                          } else {
 361  
 362                              $error_msg_array[] = $error_str;
 363                              $valid = false;
 364                          }
 365                      }
 366                  }
 367  
 368              } else if ($_POST['thread_merge_split'] == THREAD_TYPE_SPLIT) {
 369  
 370                  if (isset($_POST['split_thread']) && is_numeric($_POST['split_thread']) && $_POST['split_thread'] > 1) {
 371  
 372                      if (isset($_POST['split_type']) && is_numeric($_POST['split_type']) && isset($_POST['split_thread_con']) && $_POST['split_thread_con'] == "Y") {
 373  
 374                          $error_str = '';
 375  
 376                          $split_start = $_POST['split_thread'];
 377                          $split_type = $_POST['split_type'];
 378  
 379                          if (($split_result = thread_split($tid, $split_start, $split_type, $error_str)) !== false) {
 380  
 381                              post_add_edit_text($tid, 1);
 382  
 383                              admin_add_log_entry(THREAD_SPLIT, $split_result);
 384  
 385                          } else {
 386  
 387                              $error_msg_array[] = $error_str;
 388                              $valid = false;
 389                          }
 390                      }
 391                  }
 392              }
 393          }
 394  
 395          if (isset($_POST['t_to_uid_in_thread']) && is_numeric($_POST['t_to_uid_in_thread']) && isset($_POST['deluser_con']) && $_POST['deluser_con'] == "Y") {
 396  
 397              $del_user_uid = $_POST['t_to_uid_in_thread'];
 398  
 399              if (($user_logon = user_get_logon($del_user_uid)) !== false) {
 400  
 401                  if (thread_delete_by_user($tid, $del_user_uid)) {
 402  
 403                      post_add_edit_text($tid, 1);
 404                      admin_add_log_entry(DELETE_USER_THREAD_POSTS, array($tid, $thread_data['TITLE'], $user_logon));
 405  
 406                  } else {
 407  
 408                      $error_msg_array[] = sprintf(gettext("Failed to delete posts by selected user"), $user_logon);
 409                      $valid = false;
 410                  }
 411              }
 412          }
 413  
 414          if (isset($_POST['delete_thread']) && in_array($_POST['delete_thread'], $thread_delete_valid_types)) {
 415  
 416              if (isset($_POST['delete_thread_confirm']) && $_POST['delete_thread_confirm'] == "Y") {
 417  
 418                  $delete_thread = $_POST['delete_thread'];
 419  
 420                  if (thread_delete($tid, $delete_thread)) {
 421  
 422                      post_add_edit_text($tid, 1);
 423  
 424                      admin_add_log_entry(DELETE_THREAD, array($tid, $thread_data['TITLE']));
 425  
 426                      html_draw_top(sprintf('title=%s', gettext("Delete Thread")), 'class=window_title');
 427                      html_display_msg(gettext("Delete Thread"), gettext("Thread was successfully deleted"), 'discussion.php', 'get', array('continue' => gettext("Continue")), array(), html_get_frame_name('main'), 'center');
 428                      html_draw_bottom();
 429                      exit;
 430  
 431                  } else {
 432  
 433                      $error_msg_array[] = gettext("Failed to delete thread.");
 434                      $valid = false;
 435                  }
 436              }
 437          }
 438  
 439          if (isset($_POST['undelete_thread']) && $_POST['undelete_thread'] == "Y") {
 440  
 441              if (isset($_POST['undelete_thread_confirm']) && $_POST['undelete_thread_confirm'] == "Y") {
 442  
 443                  if (thread_undelete($tid)) {
 444  
 445                      post_add_edit_text($tid, 1);
 446  
 447                      admin_add_log_entry(UNDELETE_THREAD, array($tid, $thread_data['TITLE']));
 448  
 449                      html_draw_top(sprintf('title=%s', gettext("Undelete Thread")), 'class=window_title');
 450                      html_display_msg(gettext("Undelete Thread"), gettext("Thread was successfully undeleted"), 'thread_options.php', 'get', array('back' => gettext("Back")), array('msg' => $msg), '_self', 'center');
 451                      html_draw_bottom();
 452                      exit;
 453  
 454                  } else {
 455  
 456                      $error_msg_array[] = gettext("Failed to un-delete thread");
 457                      $valid = false;
 458                  }
 459              }
 460          }
 461      }
 462  
 463      if ($valid) {
 464  
 465          header_redirect("thread_options.php?webtag=$webtag&msg=$msg&return_msg=$return_msg&updated=true");
 466          exit;
 467      }
 468  }
 469  
 470  if ($thread_data['DELETED'] == 'N') {
 471  
 472      html_draw_top(sprintf('title=%s', sprintf(gettext("Thread Options - %s"), $thread_data['TITLE'])), "basetarget=_blank", 'js/search_popup.js', 'class=window_title');
 473  
 474      echo "<h1>", gettext("Thread Options"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" /><a href=\"messages.php?webtag=$webtag&amp;msg=$return_msg\" target=\"_self\">", word_filter_add_ob_tags($thread_data['TITLE'], true), "</a></h1>\n";
 475  
 476      if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
 477  
 478          html_display_error_array($error_msg_array, '600', 'center');
 479  
 480      } else if (isset($_GET['updated'])) {
 481  
 482          html_display_success_msg(gettext("Updates saved successfully"), '600', 'center');
 483  
 484      } else if (thread_is_poll($tid)) {
 485  
 486          html_display_warning_msg(gettext("To rename this thread you must edit the poll."), '600', 'center');
 487      }
 488  
 489      echo "<br />\n";
 490      echo "<div align=\"center\">\n";
 491      echo "  <form accept-charset=\"utf-8\" name=\"thread_options\" action=\"thread_options.php\" method=\"post\" target=\"_self\">\n";
 492      echo "  ", form_input_hidden("webtag", htmlentities_array($webtag)), "\n";
 493      echo "  ", form_input_hidden("msg", htmlentities_array($msg)), "\n";
 494      echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"600\">\n";
 495      echo "    <tr>\n";
 496      echo "      <td align=\"left\">\n";
 497      echo "        <table class=\"box\" width=\"100%\">\n";
 498      echo "          <tr>\n";
 499      echo "            <td align=\"left\" class=\"posthead\">\n";
 500      echo "              <table class=\"posthead\" width=\"100%\">\n";
 501      echo "                <tr>\n";
 502      echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("User Options"), "</td>\n";
 503      echo "                </tr>\n";
 504      echo "                <tr>\n";
 505      echo "                  <td align=\"center\">\n";
 506      echo "                    <table class=\"posthead\" width=\"95%\">\n";
 507      echo "                      <tr>\n";
 508      echo "                        <td align=\"left\" width=\"260\" class=\"posthead\">", gettext("Marked as read"), ":</td>\n";
 509      echo "                        <td align=\"left\">", form_dropdown_array('markasread', range(0, $thread_data['LENGTH']), ($thread_data['LAST_READ'] > $thread_data['LENGTH'] ? $thread_data['LENGTH'] : $thread_data['LAST_READ'])), " ", gettext("posts out of"), " {$thread_data['LENGTH']}</td>\n";
 510      echo "                      </tr>\n";
 511      echo "                      <tr>\n";
 512      echo "                        <td align=\"left\" valign=\"top\" class=\"posthead\">", gettext("Interest"), ":</td>\n";
 513      echo "                        <td align=\"left\">", form_radio("interest", THREAD_IGNORED, gettext("Ignore"), $thread_data['INTEREST'] == THREAD_IGNORED), "</td>\n";
 514      echo "                      </tr>\n";
 515      echo "                      <tr>\n";
 516      echo "                        <td align=\"left\">&nbsp;</td>\n";
 517      echo "                        <td align=\"left\">", form_radio("interest", THREAD_NOINTEREST, gettext("Normal"), $thread_data['INTEREST'] == THREAD_NOINTEREST), "</td>\n";
 518      echo "                      </tr>\n";
 519      echo "                      <tr>\n";
 520      echo "                        <td align=\"left\">&nbsp;</td>\n";
 521      echo "                        <td align=\"left\">", form_radio("interest", THREAD_INTERESTED, gettext("Interested"), $thread_data['INTEREST'] == THREAD_INTERESTED), "</td>\n";
 522      echo "                      </tr>\n";
 523      echo "                      <tr>\n";
 524      echo "                        <td align=\"left\">&nbsp;</td>\n";
 525      echo "                        <td align=\"left\">", form_radio("interest", THREAD_SUBSCRIBED, gettext("Subscribe"), $thread_data['INTEREST'] == THREAD_SUBSCRIBED), "</td>\n";
 526      echo "                      </tr>\n";
 527      echo "                      <tr>\n";
 528      echo "                        <td align=\"left\">&nbsp;</td>\n";
 529      echo "                        <td align=\"left\">&nbsp;</td>\n";
 530      echo "                      </tr>\n";
 531      echo "                    </table>\n";
 532      echo "                  </td>\n";
 533      echo "                </tr>\n";
 534      echo "              </table>\n";
 535      echo "            </td>\n";
 536      echo "          </tr>\n";
 537      echo "        </table>\n";
 538  
 539      if (session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID']) || (($thread_data['BY_UID'] == $_SESSION['UID']) && ($thread_data['ADMIN_LOCK'] != THREAD_ADMIN_LOCK_ENABLED) && forum_get_setting('allow_post_editing', 'Y') && ((intval(forum_get_setting('post_edit_time', 'is_numeric', 0)) == 0) || ((time() - $thread_data['CREATED']) < (intval(forum_get_setting('post_edit_time', 'is_numeric', 0) * MINUTE_IN_SECONDS)))))) {
 540  
 541          if (!thread_is_poll($tid)) {
 542  
 543              echo "        <br />\n";
 544              echo "        <table class=\"box\" width=\"100%\">\n";
 545              echo "          <tr>\n";
 546              echo "            <td align=\"left\" class=\"posthead\">\n";
 547              echo "              <table class=\"posthead\" width=\"100%\">\n";
 548              echo "                <tr>\n";
 549              echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Rename"), " / ", gettext("Move"), "</td>\n";
 550              echo "                </tr>\n";
 551              echo "                <tr>\n";
 552              echo "                  <td align=\"center\">\n";
 553              echo "                    <table class=\"posthead\" width=\"95%\">\n";
 554              echo "                      <tr>\n";
 555              echo "                        <td align=\"left\" width=\"260\" class=\"posthead\">", gettext("Rename thread"), ":</td>\n";
 556              echo "                        <td align=\"left\">", form_input_text("rename", htmlentities_array($thread_data['TITLE']), 37, 64), "</td>\n";
 557              echo "                      </tr>\n";
 558              echo "                      <tr>\n";
 559              echo "                        <td align=\"left\" class=\"posthead\">", gettext("Move thread"), ":</td>\n";
 560              echo "                        <td align=\"left\">", folder_draw_dropdown($thread_data['FID'], "move", "", FOLDER_ALLOW_NORMAL_THREAD, USER_PERM_THREAD_MOVE, "", "post_folder_dropdown"), "</td>\n";
 561              echo "                      </tr>\n";
 562              echo "                      <tr>\n";
 563              echo "                        <td align=\"left\">&nbsp;</td>\n";
 564              echo "                        <td align=\"left\">&nbsp;</td>\n";
 565              echo "                      </tr>\n";
 566              echo "                    </table>\n";
 567              echo "                  </td>\n";
 568              echo "                </tr>\n";
 569              echo "              </table>\n";
 570              echo "            </td>\n";
 571              echo "          </tr>\n";
 572              echo "        </table>\n";
 573  
 574          } else {
 575  
 576              echo "        <br />\n";
 577              echo "        <table class=\"box\" width=\"100%\">\n";
 578              echo "          <tr>\n";
 579              echo "            <td align=\"left\" class=\"posthead\">\n";
 580              echo "              <table class=\"posthead\" width=\"100%\">\n";
 581              echo "                <tr>\n";
 582              echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Move"), "</td>\n";
 583              echo "                </tr>\n";
 584              echo "                <tr>\n";
 585              echo "                  <td align=\"center\">\n";
 586              echo "                    <table class=\"posthead\" width=\"95%\">\n";
 587              echo "                      <tr>\n";
 588              echo "                        <td align=\"left\" width=\"260\" class=\"posthead\">", gettext("Move thread"), ":</td>\n";
 589              echo "                        <td align=\"left\">", folder_draw_dropdown($thread_data['FID'], "move", "", FOLDER_ALLOW_POLL_THREAD, USER_PERM_THREAD_MOVE, "", "post_folder_dropdown"), "</td>\n";
 590              echo "                      </tr>\n";
 591              echo "                      <tr>\n";
 592              echo "                        <td align=\"left\">&nbsp;</td>\n";
 593              echo "                        <td align=\"left\">&nbsp;</td>\n";
 594              echo "                      </tr>\n";
 595              echo "                    </table>\n";
 596              echo "                  </td>\n";
 597              echo "                </tr>\n";
 598              echo "              </table>\n";
 599              echo "            </td>\n";
 600              echo "          </tr>\n";
 601              echo "        </table>\n";
 602          }
 603  
 604          if (session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID'])) {
 605  
 606              $thread_available_pids = thread_get_unmoved_posts($tid);
 607  
 608              if (thread_is_poll($tid) && $thread_available_pids) {
 609  
 610                  echo "        <br />\n";
 611                  echo "        <table class=\"box\" width=\"100%\">\n";
 612                  echo "          <tr>\n";
 613                  echo "            <td align=\"left\" class=\"posthead\">\n";
 614                  echo "              <table class=\"posthead\" width=\"100%\">\n";
 615                  echo "                <tr>\n";
 616                  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Merge / Split Thread"), "</td>\n";
 617                  echo "                </tr>\n";
 618                  echo "                <tr>\n";
 619                  echo "                  <td align=\"center\">\n";
 620                  echo "                    <table class=\"posthead\" width=\"95%\">\n";
 621                  echo "                      <tr>\n";
 622                  echo "                        <td align=\"left\" width=\"260\">", form_input_hidden("thread_merge_split", THREAD_TYPE_SPLIT), gettext("Split thread at post:"), "</td>\n";
 623                  echo "                        <td align=\"left\">", form_dropdown_array('split_thread', $thread_available_pids), "</td>\n";
 624                  echo "                      </tr>\n";
 625                  echo "                      <tr>\n";
 626                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 627                  echo "                        <td align=\"left\" class=\"posthead\">", form_radio("split_type", THREAD_SPLIT_REPLIES, gettext("Selected post and replies only")), "</td>\n";
 628                  echo "                      </tr>\n";
 629                  echo "                      <tr>\n";
 630                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 631                  echo "                        <td align=\"left\" class=\"posthead\">", form_radio("split_type", THREAD_SPLIT_FOLLOWING, gettext("Selected and all following posts")), "</td>\n";
 632                  echo "                      </tr>\n";
 633                  echo "                      <tr>\n";
 634                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 635                  echo "                        <td align=\"left\">", form_checkbox("split_thread_con", "Y", gettext("Confirm")), "</td>\n";
 636                  echo "                      </tr>\n";
 637                  echo "                      <tr>\n";
 638                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 639                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 640                  echo "                      </tr>\n";
 641                  echo "                    </table>\n";
 642                  echo "                  </td>\n";
 643                  echo "                </tr>\n";
 644                  echo "              </table>\n";
 645                  echo "            </td>\n";
 646                  echo "          </tr>\n";
 647                  echo "        </table>\n";
 648  
 649              } else if (!thread_is_poll($tid) && !$thread_available_pids) {
 650  
 651                  echo "        <br />\n";
 652                  echo "        <table class=\"box\" width=\"100%\">\n";
 653                  echo "          <tr>\n";
 654                  echo "            <td align=\"left\" class=\"posthead\">\n";
 655                  echo "              <table class=\"posthead\" width=\"100%\">\n";
 656                  echo "                <tr>\n";
 657                  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Merge / Split Thread"), "</td>\n";
 658                  echo "                </tr>\n";
 659                  echo "                <tr>\n";
 660                  echo "                  <td align=\"center\">\n";
 661                  echo "                    <table class=\"posthead\" width=\"95%\">\n";
 662                  echo "                      <tr>\n";
 663                  echo "                        <td align=\"left\" width=\"260\">", form_input_hidden("thread_merge_split", THREAD_TYPE_MERGE), gettext("Merge with thread ID:"), "</td>\n";
 664                  echo "                        <td align=\"left\" style=\"white-space: nowrap\">", form_input_text_search("merge_thread", null, 28, 15, SEARCH_THREAD, false, null, "merge_thread_id"), "</td>\n";
 665                  echo "                      </tr>\n";
 666                  echo "                      <tr>\n";
 667                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 668                  echo "                        <td align=\"left\" class=\"posthead\">", form_radio("merge_type", THREAD_MERGE_START, gettext("Posts in this thread at start")), "</td>\n";
 669                  echo "                      </tr>\n";
 670                  echo "                      <tr>\n";
 671                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 672                  echo "                        <td align=\"left\" class=\"posthead\">", form_radio("merge_type", THREAD_MERGE_END, gettext("Posts in this thread at end")), "</td>\n";
 673                  echo "                      </tr>\n";
 674                  echo "                      <tr>\n";
 675                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 676                  echo "                        <td align=\"left\" class=\"posthead\">", form_radio("merge_type", THREAD_MERGE_BY_CREATED, gettext("Re-order posts into date order")), "</td>\n";
 677                  echo "                      </tr>\n";
 678                  echo "                      <tr>\n";
 679                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 680                  echo "                        <td align=\"left\">", form_checkbox("merge_thread_con", "Y", gettext("Confirm")), "</td>\n";
 681                  echo "                      </tr>\n";
 682                  echo "                      <tr>\n";
 683                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 684                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 685                  echo "                      </tr>\n";
 686                  echo "                    </table>\n";
 687                  echo "                  </td>\n";
 688                  echo "                </tr>\n";
 689                  echo "              </table>\n";
 690                  echo "            </td>\n";
 691                  echo "          </tr>\n";
 692                  echo "        </table>\n";
 693  
 694              } else if (!thread_is_poll($tid) && $thread_available_pids) {
 695  
 696                  $thread_available_pids = array('&nbsp;') + $thread_available_pids;
 697  
 698                  echo "        <br />\n";
 699                  echo "        <table class=\"box\" width=\"100%\">\n";
 700                  echo "          <tr>\n";
 701                  echo "            <td align=\"left\" class=\"posthead\">\n";
 702                  echo "              <table class=\"posthead\" width=\"100%\">\n";
 703                  echo "                <tr>\n";
 704                  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Merge / Split Thread"), "</td>\n";
 705                  echo "                </tr>\n";
 706                  echo "                <tr>\n";
 707                  echo "                  <td align=\"center\">\n";
 708                  echo "                    <table class=\"posthead\" width=\"95%\">\n";
 709                  echo "                      <tr>\n";
 710                  echo "                        <td align=\"left\" width=\"260\">", form_radio("thread_merge_split", THREAD_TYPE_MERGE, gettext("Merge with thread ID:"), false, null, 'posthead'), "</td>\n";
 711                  echo "                        <td align=\"left\" style=\"white-space: nowrap\">", form_input_text_search('merge_thread', null, 37, false, SEARCH_THREAD, false, null, "merge_thread_id"), "</td>\n";
 712                  echo "                      </tr>\n";
 713                  echo "                      <tr>\n";
 714                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 715                  echo "                        <td align=\"left\" class=\"posthead\">", form_radio("merge_type", THREAD_MERGE_START, gettext("Posts in this thread at start")), "</td>\n";
 716                  echo "                      </tr>\n";
 717                  echo "                      <tr>\n";
 718                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 719                  echo "                        <td align=\"left\" class=\"posthead\">", form_radio("merge_type", THREAD_MERGE_START, gettext("Posts in this thread at end")), "</td>\n";
 720                  echo "                      </tr>\n";
 721                  echo "                      <tr>\n";
 722                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 723                  echo "                        <td align=\"left\" class=\"posthead\">", form_radio("merge_type", THREAD_MERGE_BY_CREATED, gettext("Re-order posts into date order")), "</td>\n";
 724                  echo "                      </tr>\n";
 725                  echo "                      <tr>\n";
 726                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 727                  echo "                        <td align=\"left\">", form_checkbox("merge_thread_con", "Y", gettext("Confirm")), "</td>\n";
 728                  echo "                      </tr>\n";
 729                  echo "                      <tr>\n";
 730                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 731                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 732                  echo "                      </tr>\n";
 733                  echo "                      <tr>\n";
 734                  echo "                        <td align=\"left\" colspan=\"2\"><hr /></td>\n";
 735                  echo "                      </tr>\n";
 736                  echo "                      <tr>\n";
 737                  echo "                        <td align=\"left\" width=\"260\">", form_radio("thread_merge_split", THREAD_TYPE_SPLIT, gettext("Split thread at post:"), false, null, 'posthead'), "</td>\n";
 738                  echo "                        <td align=\"left\">", form_dropdown_array('split_thread', $thread_available_pids), "</td>\n";
 739                  echo "                      </tr>\n";
 740                  echo "                      <tr>\n";
 741                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 742                  echo "                        <td align=\"left\" class=\"posthead\">", form_radio("split_type", THREAD_SPLIT_REPLIES, gettext("Selected post and replies only")), "</td>\n";
 743                  echo "                      </tr>\n";
 744                  echo "                      <tr>\n";
 745                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 746                  echo "                        <td align=\"left\" class=\"posthead\">", form_radio("split_type", THREAD_SPLIT_FOLLOWING, gettext("Selected and all following posts")), "</td>\n";
 747                  echo "                      </tr>\n";
 748                  echo "                      <tr>\n";
 749                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 750                  echo "                        <td align=\"left\">", form_checkbox("split_thread_con", "Y", gettext("Confirm")), "</td>\n";
 751                  echo "                      </tr>\n";
 752                  echo "                      <tr>\n";
 753                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 754                  echo "                        <td align=\"left\">&nbsp;</td>\n";
 755                  echo "                      </tr>\n";
 756                  echo "                    </table>\n";
 757                  echo "                  </td>\n";
 758                  echo "                </tr>\n";
 759                  echo "              </table>\n";
 760                  echo "            </td>\n";
 761                  echo "          </tr>\n";
 762                  echo "        </table>\n";
 763              }
 764  
 765              echo "        <br />\n";
 766              echo "        <table class=\"box\" width=\"100%\">\n";
 767              echo "          <tr>\n";
 768              echo "            <td align=\"left\" class=\"posthead\">\n";
 769              echo "              <table class=\"posthead\" width=\"100%\">\n";
 770              echo "                <tr>\n";
 771              echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Make Thread Sticky"), "</td>\n";
 772              echo "                </tr>\n";
 773              echo "                <tr>\n";
 774              echo "                  <td align=\"center\">\n";
 775              echo "                    <table class=\"posthead\" width=\"95%\">\n";
 776              echo "                      <tr>\n";
 777              echo "                        <td align=\"left\" width=\"150\" class=\"posthead\">", gettext("Sticky"), ":</td>\n";
 778  
 779              $sticky_year_min = strftime('%Y');
 780  
 781              if ($thread_data['STICKY_UNTIL'] && $thread_data['STICKY'] == "Y") {
 782  
 783                  $sticky_year = strftime('%Y', $thread_data['STICKY_UNTIL']);
 784                  $sticky_month = strftime('%b', $thread_data['STICKY_UNTIL']);
 785                  $sticky_day = strftime('%d', $thread_data['STICKY_UNTIL']);
 786  
 787                  if ($sticky_year < $sticky_year_min) {
 788                      $sticky_year_min = $sticky_year;
 789                  }
 790  
 791              } else {
 792  
 793                  $sticky_year = 0;
 794                  $sticky_month = 0;
 795                  $sticky_day = 0;
 796              }
 797  
 798              echo "                        <td align=\"left\" style=\"white-space: nowrap\">", form_radio("sticky", "Y", gettext("Until 00:00 UTC"), $thread_data['STICKY'] == "Y"), "&nbsp;", form_date_dropdowns($sticky_year, $sticky_month, $sticky_day, "sticky_", $sticky_year_min), "&nbsp;<span class=\"small_optional_text\">", gettext("(Optional)"), "</span></td>\n";
 799              echo "                      </tr>\n";
 800              echo "                      <tr>\n";
 801              echo "                        <td align=\"left\">&nbsp;</td>\n";
 802              echo "                        <td align=\"left\">", form_radio("sticky", "N", gettext("No"), $thread_data['STICKY'] == "N"), "</td>\n";
 803              echo "                      </tr>\n";
 804              echo "                      <tr>\n";
 805              echo "                        <td align=\"left\">&nbsp;</td>\n";
 806              echo "                        <td align=\"left\">&nbsp;</td>\n";
 807              echo "                      </tr>\n";
 808              echo "                    </table>\n";
 809              echo "                  </td>\n";
 810              echo "                </tr>\n";
 811              echo "              </table>\n";
 812              echo "            </td>\n";
 813              echo "          </tr>\n";
 814              echo "        </table>\n";
 815              echo "        <br />\n";
 816              echo "        <table class=\"box\" width=\"100%\">\n";
 817              echo "          <tr>\n";
 818              echo "            <td align=\"left\" class=\"posthead\">\n";
 819              echo "              <table class=\"posthead\" width=\"100%\">\n";
 820              echo "                <tr>\n";
 821              echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Locked"), " / ", gettext("Closed"), "</td>\n";
 822              echo "                </tr>\n";
 823              echo "                <tr>\n";
 824              echo "                  <td align=\"center\">\n";
 825              echo "                    <table class=\"posthead\" width=\"95%\">\n";
 826              echo "                      <tr>\n";
 827              echo "                        <td align=\"left\" class=\"posthead\">", gettext("Closed for posting"), ":</td>\n";
 828              echo "                        <td align=\"left\">\n";
 829              echo "                          ", form_radio("closed", THREAD_CLOSED, gettext("Yes"), $thread_data['CLOSED'] > 0), " \n";
 830              echo "                          ", form_radio("closed", THREAD_OPEN, gettext("No"), $thread_data['CLOSED'] < 1), "\n";
 831              echo "                        </td>\n";
 832              echo "                      </tr>\n";
 833              echo "                      <tr>\n";
 834              echo "                        <td align=\"left\" class=\"posthead\">", gettext("Lock title and folder"), ":</td>\n";
 835              echo "                        <td align=\"left\">\n";
 836              echo "                          ", form_radio("admin_lock", THREAD_ADMIN_LOCK_ENABLED, gettext("Yes"), $thread_data['ADMIN_LOCK'] > 0), " \n";
 837              echo "                          ", form_radio("admin_lock", THREAD_ADMIN_LOCK_DISABLED, gettext("No"), $thread_data['ADMIN_LOCK'] < 1), "\n";
 838              echo "                        </td>\n";
 839              echo "                      </tr>\n";
 840              echo "                      <tr>\n";
 841              echo "                        <td align=\"left\">&nbsp;</td>\n";
 842              echo "                        <td align=\"left\">&nbsp;</td>\n";
 843              echo "                      </tr>\n";
 844              echo "                    </table>\n";
 845              echo "                  </td>\n";
 846              echo "                </tr>\n";
 847              echo "              </table>\n";
 848              echo "            </td>\n";
 849              echo "          </tr>\n";
 850              echo "        </table>\n";
 851              echo "        <br />\n";
 852              echo "        <table class=\"box\" width=\"100%\">\n";
 853              echo "          <tr>\n";
 854              echo "            <td align=\"left\" class=\"posthead\">\n";
 855              echo "              <table class=\"posthead\" width=\"100%\">\n";
 856              echo "                <tr>\n";
 857              echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Delete posts"), "</td>\n";
 858              echo "                </tr>\n";
 859              echo "                <tr>\n";
 860              echo "                  <td align=\"center\">\n";
 861              echo "                    <table class=\"posthead\" width=\"95%\">\n";
 862              echo "                      <tr>\n";
 863              echo "                        <td align=\"left\" class=\"posthead\" width=\"260\">", gettext("Delete posts in thread by user"), ":</td>\n";
 864              echo "                        <td align=\"left\" class=\"posthead\">", post_draw_to_dropdown_in_thread($tid, 0, false, true, 'bhselect', 'style="width: 275px"'), "</td>\n";
 865              echo "                      </tr>\n";
 866              echo "                      <tr>\n";
 867              echo "                        <td align=\"left\">&nbsp;</td>\n";
 868              echo "                        <td align=\"left\" class=\"posthead\">", form_checkbox("deluser_con", "Y", gettext("Confirm")), "</td>\n";
 869              echo "                      </tr>\n";
 870              echo "                      <tr>\n";
 871              echo "                        <td align=\"left\">&nbsp;</td>\n";
 872              echo "                        <td align=\"left\">&nbsp;</td>\n";
 873              echo "                      </tr>\n";
 874              echo "                    </table>\n";
 875              echo "                  </td>\n";
 876              echo "                </tr>\n";
 877              echo "              </table>\n";
 878              echo "            </td>\n";
 879              echo "          </tr>\n";
 880              echo "        </table>\n";
 881              echo "        <br />\n";
 882              echo "        <table class=\"box\" width=\"100%\">\n";
 883              echo "          <tr>\n";
 884              echo "            <td align=\"left\" class=\"posthead\">\n";
 885              echo "              <table class=\"posthead\" width=\"100%\">\n";
 886              echo "                <tr>\n";
 887              echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Delete Thread"), "</td>\n";
 888              echo "                </tr>\n";
 889              echo "                <tr>\n";
 890              echo "                  <td align=\"center\">\n";
 891              echo "                    <table class=\"posthead\" width=\"95%\">\n";
 892              echo "                      <tr>\n";
 893              echo "                        <td align=\"left\" class=\"posthead\" width=\"260\">", gettext("Delete Thread"), ":</td>\n";
 894              echo "                        <td align=\"left\" class=\"posthead\">", form_radio("delete_thread", -1, gettext("No"), true), "</td>\n";
 895              echo "                      </tr>\n";
 896              echo "                      <tr>\n";
 897              echo "                        <td align=\"left\">&nbsp;</td>\n";
 898              echo "                        <td align=\"left\" class=\"posthead\">", form_radio("delete_thread", THREAD_DELETE_PERMENANT, gettext("Permanently Delete")), "</td>\n";
 899              echo "                      </tr>\n";
 900              echo "                      <tr>\n";
 901              echo "                        <td align=\"left\">&nbsp;</td>\n";
 902              echo "                        <td align=\"left\" class=\"posthead\">", form_radio("delete_thread", THREAD_DELETE_NON_PERMENANT, gettext("Move to Deleted Threads")), "</td>\n";
 903              echo "                      </tr>\n";
 904              echo "                      <tr>\n";
 905              echo "                        <td align=\"left\">&nbsp;</td>\n";
 906              echo "                        <td align=\"left\" class=\"posthead\">", form_checkbox("delete_thread_confirm", "Y", gettext("Confirm")), "</td>\n";
 907              echo "                      </tr>\n";
 908              echo "                      <tr>\n";
 909              echo "                        <td align=\"left\">&nbsp;</td>\n";
 910              echo "                        <td align=\"left\">&nbsp;</td>\n";
 911              echo "                      </tr>\n";
 912              echo "                    </table>\n";
 913              echo "                  </td>\n";
 914              echo "                </tr>\n";
 915              echo "              </table>\n";
 916              echo "            </td>\n";
 917              echo "          </tr>\n";
 918              echo "        </table>\n";
 919          }
 920      }
 921  
 922      echo "      </td>\n";
 923      echo "    </tr>\n";
 924      echo "    <tr>\n";
 925      echo "      <td align=\"left\">&nbsp;</td>\n";
 926      echo "    </tr>\n";
 927      echo "    <tr>\n";
 928      echo "      <td align=\"center\">", form_submit("save", gettext("Save")), "&nbsp;", form_submit("back", gettext("Back")), "</td>\n";
 929      echo "    </tr>\n";
 930      echo "  </table>\n";
 931      echo "  </form>\n";
 932      echo "</div>\n";
 933  
 934      html_draw_bottom();
 935  
 936  } else if (session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID'])) {
 937  
 938      html_draw_top(sprintf('title=%s', sprintf(gettext("Thread Options - %s"), $thread_data['TITLE'])), "basetarget=_blank", 'class=window_title');
 939  
 940      echo "<h1>", gettext("Thread Options"), ": <a href=\"messages.php?webtag=$webtag&amp;msg=$return_msg\" target=\"_self\">#{$tid} ", word_filter_add_ob_tags($thread_data['TITLE'], true), "</a></h1>\n";
 941  
 942      if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
 943  
 944          html_display_error_array($error_msg_array, '600', 'center');
 945  
 946      } else if (isset($_GET['updated'])) {
 947  
 948          html_display_success_msg(gettext("Updates saved successfully"), '600', 'center');
 949      }
 950  
 951      echo "<br />\n";
 952      echo "<div align=\"center\">\n";
 953      echo "  <form accept-charset=\"utf-8\" name=\"thread_options\" action=\"thread_options.php\" method=\"post\" target=\"_self\">\n";
 954      echo "  ", form_input_hidden("webtag", htmlentities_array($webtag)), "\n";
 955      echo "  ", form_input_hidden("msg", htmlentities_array($msg)), "\n";
 956      echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"600\">\n";
 957      echo "    <tr>\n";
 958      echo "      <td align=\"left\">\n";
 959      echo "        <table class=\"box\" width=\"100%\">\n";
 960      echo "          <tr>\n";
 961      echo "            <td align=\"left\" class=\"posthead\">\n";
 962      echo "              <table class=\"posthead\" width=\"100%\"> \n";
 963      echo "                <tr>\n";
 964      echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Undelete Thread"), "</td>\n";
 965      echo "                </tr>\n";
 966      echo "                <tr>\n";
 967      echo "                  <td align=\"center\">\n";
 968      echo "                    <table class=\"posthead\" width=\"95%\">\n";
 969      echo "                      <tr>\n";
 970      echo "                        <td align=\"left\">", gettext("Undelete Thread"), "</td>\n";
 971      echo "                        <td align=\"left\">", form_radio("undelete_thread", "Y", gettext("Yes")), "&nbsp;", form_radio("undelete_thread", "N", gettext("No"), true), "</td>\n";
 972      echo "                      </tr>\n";
 973      echo "                      <tr>\n";
 974      echo "                        <td align=\"left\">&nbsp;</td>\n";
 975      echo "                        <td align=\"left\" class=\"posthead\">", form_checkbox("undelete_thread_confirm", "Y", gettext("Confirm")), " \n";
 976      echo "                        </td>\n";
 977      echo "                      <tr>\n";
 978      echo "                        <td align=\"left\">&nbsp;</td>\n";
 979      echo "                        <td align=\"left\">&nbsp;</td>\n";
 980      echo "                      </tr>\n";
 981      echo "                    </table>\n";
 982      echo "                  </td>\n";
 983      echo "                </tr>\n";
 984      echo "              </table>\n";
 985      echo "            </td>\n";
 986      echo "          </tr>\n";
 987      echo "        </table>\n";
 988      echo "      </td>\n";
 989      echo "    </tr>\n";
 990      echo "    <tr>\n";
 991      echo "      <td align=\"left\">&nbsp;</td>\n";
 992      echo "    </tr>\n";
 993      echo "    <tr>\n";
 994      echo "      <td align=\"center\">", form_submit("save", gettext("Save")), "</td>\n";
 995      echo "    </tr>\n";
 996      echo "  </table>\n";
 997      echo "  </form>\n";
 998      echo "</div>\n";
 999  
1000      html_draw_bottom();
1001  
1002  } else {
1003  
1004      html_draw_error(gettext("You cannot edit posts in this folder"));
1005  }

title

Description

title

Description

title

Description

title

title

Body