Beehive PHP Cross Reference Discussion Forums

Source: /pm.php - 129 lines - 4750 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 . 'cache.inc.php';
  29  require_once  BH_INCLUDE_PATH . 'constants.inc.php';
  30  require_once  BH_INCLUDE_PATH . 'html.inc.php';
  31  require_once  BH_INCLUDE_PATH . 'pm.inc.php';
  32  require_once  BH_INCLUDE_PATH . 'session.inc.php';
  33  // End Required includes
  34  
  35  // Don't cache this page - fixes problems with Opera.
  36  cache_disable();
  37  
  38  // Check we're logged in correctly
  39  if (!session::logged_in()) {
  40      html_guest_error();
  41  }
  42  
  43  // Array to hold error messages
  44  $error_msg_array = array();
  45  
  46  // Available PM Folders
  47  $available_folders = array(
  48      PM_FOLDER_INBOX,
  49      PM_FOLDER_SENT,
  50      PM_FOLDER_OUTBOX,
  51      PM_FOLDER_SAVED,
  52      PM_FOLDER_DRAFTS,
  53      PM_SEARCH_RESULTS
  54  );
  55  
  56  // Default to Inbox
  57  $current_folder = PM_FOLDER_INBOX;
  58  
  59  // Get the user's saved left frame width.
  60  if (isset($_SESSION['LEFT_FRAME_WIDTH']) && is_numeric($_SESSION['LEFT_FRAME_WIDTH'])) {
  61      $left_frame_width = max(100, $_SESSION['LEFT_FRAME_WIDTH']);
  62  } else {
  63      $left_frame_width = 280;
  64  }
  65  
  66  // Output starts here
  67  html_draw_top('frame_set_html', 'pm_popup_disabled');
  68  
  69  $frameset = new html_frameset_cols('pm', "$left_frame_width,*");
  70  
  71  // If we're viewing a message we need to know the folder it is in.
  72  if (isset($_GET['mid']) && is_numeric($_GET['mid'])) {
  73  
  74      $mid = $_GET['mid'];
  75  
  76      if (($message_data = pm_message_get($mid))) {
  77  
  78          if (($message_folder = pm_get_type_folder($message_data['TYPE']))) {
  79  
  80              $current_folder = $message_folder;
  81          }
  82      }
  83  
  84      if (isset($_GET['message_sent'])) {
  85  
  86          $frameset->html_frame("pm_folders.php?webtag=$webtag&amp;mid=$mid&amp;folder=$current_folder", html_get_frame_name('pm_folders'), 0);
  87          $frameset->html_frame("pm_messages.php?webtag=$webtag&amp;mid=$mid&amp;folder=$current_folder&amp;message_sent=true#message", html_get_frame_name('pm_messages'), 0);
  88  
  89      } else if (isset($_GET['message_saved'])) {
  90  
  91          $frameset->html_frame("pm_folders.php?webtag=$webtag&amp;mid=$mid&amp;folder=$current_folder", html_get_frame_name('pm_folders'), 0);
  92          $frameset->html_frame("pm_messages.php?webtag=$webtag&amp;mid=$mid&amp;folder=$current_folder&amp;message_saved=true#message", html_get_frame_name('pm_messages'), 0);
  93  
  94      } else {
  95  
  96          $frameset->html_frame("pm_folders.php?webtag=$webtag&amp;mid=$mid&amp;folder=$current_folder", html_get_frame_name('pm_folders'), 0);
  97          $frameset->html_frame("pm_messages.php?webtag=$webtag&amp;mid=$mid&amp;folder=$current_folder#message", html_get_frame_name('pm_messages'), 0);
  98      }
  99  
 100  } else if (isset($_GET['folder']) && is_numeric($_GET['folder'])) {
 101  
 102      $current_folder = (in_array($_GET['folder'], $available_folders)) ? $_GET['folder'] : PM_FOLDER_INBOX;
 103  
 104      if (isset($_GET['message_sent'])) {
 105  
 106          $frameset->html_frame("pm_folders.php?webtag=$webtag&amp;folder=$current_folder", html_get_frame_name('pm_folders'), 0);
 107          $frameset->html_frame("pm_messages.php?webtag=$webtag&amp;folder=$current_folder&message_sent=true", html_get_frame_name('pm_messages'), 0);
 108  
 109      } else {
 110  
 111          $frameset->html_frame("pm_folders.php?webtag=$webtag&amp;folder=$current_folder", html_get_frame_name('pm_folders'), 0);
 112          $frameset->html_frame("pm_messages.php?webtag=$webtag&amp;folder=$current_folder", html_get_frame_name('pm_messages'), 0);
 113      }
 114  }
 115  
 116  if (isset($_GET['message_sent'])) {
 117  
 118      $frameset->html_frame("pm_folders.php?webtag=$webtag", html_get_frame_name('pm_folders'), 0);
 119      $frameset->html_frame("pm_messages.php?webtag=$webtag&message_sent=true", html_get_frame_name('pm_messages'), 0);
 120  
 121  } else {
 122  
 123      $frameset->html_frame("pm_folders.php?webtag=$webtag", html_get_frame_name('pm_folders'), 0);
 124      $frameset->html_frame("pm_messages.php?webtag=$webtag", html_get_frame_name('pm_messages'), 0);
 125  }
 126  
 127  $frameset->output_html();
 128  
 129  html_draw_bottom(true);

title

Description

title

Description

title

Description

title

title

Body