Beehive PHP Cross Reference Discussion Forums

Source: /lmessages.php - 97 lines - 2902 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  'lboot.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 . 'header.inc.php';
  31  require_once  BH_INCLUDE_PATH . 'html.inc.php';
  32  require_once  BH_INCLUDE_PATH . 'light.inc.php';
  33  require_once  BH_INCLUDE_PATH . 'messages.inc.php';
  34  require_once  BH_INCLUDE_PATH . 'poll.inc.php';
  35  // End Required includes
  36  
  37  // Message pane caching
  38  cache_check_messages();
  39  
  40  if (isset($_GET['msg']) && validate_msg($_GET['msg'])) {
  41  
  42      $msg = $_GET['msg'];
  43  
  44  } else if (isset($_POST['msg']) && validate_msg($_POST['msg'])) {
  45  
  46      $msg = $_POST['msg'];
  47  
  48  } else if (($msg = messages_get_most_recent($_SESSION['UID'])) === false) {
  49  
  50      light_html_draw_top(sprintf("title=%s", gettext("Error")), "robots=noindex,nofollow");
  51      light_html_display_error_msg(gettext("No Messages"));
  52      light_html_draw_bottom();
  53      exit;
  54  }
  55  
  56  list($tid, $pid) = explode('.', $msg);
  57  
  58  if (isset($_POST['poll_submit'])) {
  59  
  60      if (isset($_POST['poll_vote']) && is_array($_POST['poll_vote'])) {
  61  
  62          $poll_votes = $_POST['poll_vote'];
  63  
  64          if (poll_check_tabular_votes($tid, $poll_votes)) {
  65  
  66              poll_vote($tid, $poll_votes);
  67  
  68              header_redirect("lmessages.php?webtag=$webtag&msg=$msg");
  69  
  70          } else {
  71  
  72              light_html_draw_top(sprintf("title=%s", gettext("Error")));
  73              light_html_display_error_msg(gettext("You must vote in every group."));
  74              light_html_draw_bottom();
  75              exit;
  76          }
  77  
  78      } else {
  79  
  80          light_html_draw_top(sprintf("title=%s", gettext("Error")));
  81          light_html_display_error_msg(gettext("You must select an option to vote for!"));
  82          light_html_draw_bottom();
  83          exit;
  84      }
  85  
  86  } else if (isset($_POST['poll_change_vote'])) {
  87  
  88      poll_delete_vote($tid);
  89  
  90      header_redirect("lmessages.php?webtag=$webtag&msg=$msg");
  91  }
  92  
  93  light_html_draw_top("js/messages.js");
  94  
  95  light_draw_messages($tid, $pid);
  96  
  97  light_html_draw_bottom();

title

Description

title

Description

title

Description

title

title

Body