XMB PHP Cross Reference Discussion Forums

Source: /u2u.php - 230 lines - 7484 bytes - Summary - Text - Print

Description: eXtreme Message Board XMB 1.9.11

   1  <?php
   2  /**
   3   * eXtreme Message Board
   4   * XMB 1.9.11
   5   *
   6   * Developed And Maintained By The XMB Group
   7   * Copyright (c) 2001-2012, The XMB Group
   8   * http://www.xmbforum2.com/
   9   *
  10   * This program is free software; you can redistribute it and/or
  11   * modify it under the terms of the GNU General Public License
  12   * as published by the Free Software Foundation; either version 2
  13   * of the License, or (at your option) any later version.
  14   *
  15   * This program is distributed in the hope that it will be useful,
  16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18   * GNU General Public License for more details.
  19   *
  20   * You should have received a copy of the GNU General Public License
  21   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  22   *
  23   **/
  24  
  25  define('X_SCRIPT', 'u2u.php');
  26  
  27  require  'header.php';
  28  require  ROOT.'include/u2u.inc.php';
  29  
  30  header('X-Robots-Tag: noindex');
  31  
  32  loadtemplates(
  33  'u2u_header',
  34  'u2u_footer',
  35  'u2u_msg',
  36  'u2u',
  37  'u2u_folderlink',
  38  'u2u_inbox',
  39  'u2u_outbox',
  40  'u2u_drafts',
  41  'u2u_row',
  42  'u2u_row_none',
  43  'u2u_view',
  44  'u2u_ignore',
  45  'u2u_send',
  46  'u2u_send_preview',
  47  'u2u_folders',
  48  'u2u_main',
  49  'u2u_quotabar',
  50  'u2u_old',
  51  'u2u_printable',
  52  'email_html_header',
  53  'email_html_footer'
  54  );
  55  
  56  smcwcache();
  57  
  58  eval('$css = "'.template('css').'";');
  59  
  60  $action = postedVar('action', '', FALSE, FALSE, FALSE, 'g');
  61  $sendmode = ($action == 'send') ? "true" : "false";
  62  
  63  eval('$u2uheader = "'.template('u2u_header').'";');
  64  eval('$u2ufooter = "'.template('u2u_footer').'";');
  65  
  66  if (X_GUEST) {
  67      redirect("{$full_url}misc.php?action=login", 0);
  68      exit;
  69  }
  70  
  71  $folder = postedVar('folder', '', TRUE, FALSE, TRUE);
  72  if ($folder == '') {
  73      $folder = postedVar('folder', '', TRUE, FALSE, TRUE, 'g');
  74  }
  75  
  76  $tofolder = postedVar('tofolder', '', TRUE, FALSE, TRUE);
  77  
  78  $folderlist = '';
  79  $folders = '';
  80  $farray = array();
  81  if ($folder != '' && ($action == '' || $action == 'mod' || $action == 'view')) {
  82      //$folder = checkInput($folder, true);
  83  } else {
  84      $folder = 'Inbox';
  85  }
  86  
  87  $u2ucount = u2u_folderList(); //Sets several global vars
  88  $u2uid = getInt('u2uid');
  89  if (!$u2uid) {
  90      $u2uid = postedVar('u2uid');
  91  }
  92  
  93  $thewidth = ($self['useoldu2u'] == 'yes') ? $tablewidth : '100%';
  94  
  95  $u2upreview = '';
  96  $leftpane = '';
  97  
  98  switch($action) {
  99      case 'modif':
 100          $mod = postedVar('mod', '', FALSE, FALSE);
 101          switch($mod) {
 102              case 'send':
 103                  if ($u2uid > 0) {
 104                      redirect($full_url."u2u.php?action=send&u2uid=$u2uid", 0);
 105                  } else {
 106                      redirect($full_url.'u2u.php?action=send', 0);
 107                  }
 108                  break;
 109              case 'reply':
 110                  if ($u2uid > 0) {
 111                      redirect($full_url."u2u.php?action=send&u2uid=$u2uid&reply=yes", 0);
 112                  } else {
 113                      redirect($full_url."u2u.php?action=send&reply=yes", 0);
 114                  }
 115                  break;
 116              case 'replydel':
 117                  if ($u2uid > 0) {
 118                      redirect($full_url."u2u.php?action=send&u2uid=$u2uid&reply=yes&del=yes", 0);
 119                  } else {
 120                      redirect($full_url."u2u.php?action=send&reply=yes&del=yes", 0);
 121                  }
 122                  break;
 123              case 'forward':
 124                  if ($u2uid > 0) {
 125                      redirect($full_url."u2u.php?action=send&u2uid=$u2uid&forward=yes", 0);
 126                  } else {
 127                      redirect($full_url."u2u.php?action=send&forward=yes", 0);
 128                  }
 129                  break;
 130              case 'sendtoemail':
 131                  u2u_print($u2uid, true);
 132                  break;
 133              case 'delete':
 134                  u2u_delete($u2uid, $folder);
 135                  break;
 136              case 'move':
 137                  u2u_move($u2uid, $tofolder);
 138                  break;
 139              case 'markunread':
 140                  u2u_markUnread($u2uid, $folder, $type);
 141                  break;
 142              default:
 143                  $leftpane = u2u_display($folder, $folders);
 144                  break;
 145          }
 146          break;
 147      case 'mod':
 148          $modaction = postedVar('modaction', '', FALSE, FALSE);
 149          $u2u_select = getFormArrayInt('u2u_select');
 150          $tofolder = postedVar('tofolder', '', TRUE, FALSE);
 151          $folder_url = recodeOut($folder);
 152          switch($modaction) {
 153              case 'delete':
 154                  if (!isset($u2u_select) || empty($u2u_select)) {
 155                      error($lang['textnonechosen'], false, $u2uheader, $u2ufooter, $full_url."u2u.php?folder=$folder_url", true, false, false);
 156                  }
 157                  u2u_mod_delete($folder, $u2u_select);
 158                  break;
 159              case 'move':
 160                  if (!isset($tofolder) || empty($tofolder)) {
 161                      error($lang['textnofolder'], false, $u2uheader, $u2ufooter, $full_url.'u2u.php', true, false, false);
 162                  }
 163  
 164                  if (!isset($u2u_select) || empty($u2u_select)) {
 165                      error($lang['textnonechosen'], false, $u2uheader, $u2ufooter, $full_url."u2u.php?folder=$folder_url", true, false, false);
 166                      return;
 167                  }
 168                  u2u_mod_move($tofolder, $u2u_select);
 169                  break;
 170              case 'markunread':
 171                  if (!isset($u2u_select) || empty($u2u_select)) {
 172                      error($lang['textnonechosen'], false, $u2uheader, $u2ufooter, $full_url."u2u.php?folder=$folder_url", true, false, false);
 173                  }
 174                  u2u_mod_markUnread($folder, $u2u_select);
 175                  break;
 176              default:
 177                  error($lang['testnothingchos'], false, $u2uheader, $u2ufooter, $full_url."u2u.php?folder=$folder_url", true, false, false);
 178                  break;
 179          }
 180          break;
 181      case 'send':
 182          $msgto = postedVar('msgto', 'javascript', TRUE, FALSE, TRUE);
 183          $subject = postedVar('subject', 'javascript', TRUE, FALSE, TRUE);
 184          $message = postedVar('message', '', TRUE, FALSE);
 185          $leftpane = u2u_send($u2uid, $msgto, $subject, $message, $u2upreview);
 186          break;
 187      case 'view':
 188          $leftpane = u2u_view($u2uid, $folders);
 189          break;
 190      case 'printable':
 191          u2u_print($u2uid, false);
 192          break;
 193      case 'folders':
 194          if (onSubmit('folderssubmit')) {
 195              $u2ufolders = postedVar('u2ufolders', 'javascript', TRUE, FALSE, TRUE);
 196              u2u_folderSubmit($u2ufolders, $folders);
 197          } else {
 198              eval('$leftpane = "'.template('u2u_folders').'";');
 199          }
 200          break;
 201      case 'ignore':
 202          $leftpane = u2u_ignore();
 203          break;
 204      case 'emptytrash':
 205          $db->query("DELETE FROM ".X_PREFIX."u2u WHERE folder='Trash' AND owner='$xmbuser'");
 206          u2u_msg($lang['texttrashemptied'], 'u2u.php');
 207          break;
 208      default:
 209          $leftpane = u2u_display($folder, $folders);
 210          break;
 211  }
 212  
 213  if (!X_STAFF) {
 214      $percentage = (0 == $SETTINGS['u2uquota']) ? 0 : (float)(($u2ucount / $SETTINGS['u2uquota']) * 100);
 215      if ($percentage > 100) {
 216          $barwidth = 100;
 217          eval($lang['evaluqinfo_over']);
 218      } else {
 219          $percent = number_format($percentage, 2);
 220          $barwidth = number_format($percentage, 0);
 221          eval($lang['evaluqinfo']);
 222      }
 223  } else {
 224      $barwidth = $percentage = 0;
 225      eval($lang['evalu2ustaffquota']);
 226  }
 227  eval('$u2uquotabar = "'.template('u2u_quotabar').'";');
 228  $tu2u = ($self['useoldu2u'] == 'yes') ? 'u2u_old' : 'u2u';
 229  eval('echo "'.template($tu2u).'";');
 230  ?>

title

Description

title

Description

title

Description

title

title

Body