[ PHPXref.com ] [ Generated: Sun Jul 20 19:52:25 2008 ] [ PHPOpenChat 3.0.2 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> new_guestbook_entry.php (source)

   1  <?php //-*-php-*-
   2  /*   ********************************************************************   **
   3  **   Copyright notice                                                       **
   4  **                                                                          **
   5  **   (c) 1995-2004 PHPOpenChat Development Team                             **
   6  **   http://phpopenchat.sourceforge.net/                                    **
   7  **                                                                          **
   8  **   All rights reserved                                                    **
   9  **                                                                          **
  10  **   This script is part of the PHPOpenChat project. The PHPOpenChat        **
  11  **   project is free software; you can redistribute it and/or modify        **
  12  **   it under the terms of the GNU General Public License as published by   **
  13  **   the Free Software Foundation; either version 2 of the License, or      **
  14  **   (at your option) any later version.                                    **
  15  **                                                                          **
  16  **   The GNU General Public License can be found at                         **
  17  **   http://www.gnu.org/copyleft/gpl.html.                                  **
  18  **   A copy is found in the textfile GPL and important notices to the       **
  19  **   license from the team is found in the textfile LICENSE distributed     **
  20  **   with these scripts.                                                    **
  21  **                                                                          **
  22  **   This script is distributed in the hope that it will be useful,         **
  23  **   but WITHOUT ANY WARRANTY; without even the implied warranty of         **
  24  **   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          **
  25  **   GNU General Public License for more details.                           **
  26  **                                                                          **
  27  **   This copyright notice MUST APPEAR in all copies of the script!         **
  28  **   ********************************************************************   */
  29  
  30  /*
  31    $Author: letreo $
  32    $Date: 2004/02/24 17:05:18 $
  33    $Source: /cvsroot/phpopenchat/chat3/new_guestbook_entry.php,v $
  34    $Revision: 1.1.2.4 $
  35  */
  36  
  37  //Get default values
  38  require_once ('config.inc.php');
  39  
  40  require_once (POC_INCLUDE_PATH.'/adodb/adodb.inc.php');
  41  require_once (POC_INCLUDE_PATH.'/class.Chat.inc');
  42  require_once (POC_INCLUDE_PATH.'/class.Chatter.inc');
  43  require_once(POC_INCLUDE_PATH.'/class.Guestbook.inc');
  44  require_once (POC_INCLUDE_PATH.'/class.Guestbook_Post.inc');
  45  require_once (POC_INCLUDE_PATH.'/class.Translator.inc');
  46  require_once (POC_INCLUDE_PATH.'/class.Template.inc');
  47  
  48  session_start();
  49  //check if chatter is authorized to get this page
  50  if( !isset($_SESSION['chatter']) )
  51    die('Permission denied');
  52  
  53  $TEMPLATE_OUT['success'] = false;
  54  if( isset($_POST['add']) && isset($_SESSION['chatter']) )
  55  {
  56    $recipient = POC_Chat::mkinstance_chatter( $_POST['nickname'] );
  57    $guestbook = &new POC_Guestbook( $recipient );
  58    $post = &new POC_Guestbook_Post( $_SESSION['chatter'] );
  59    $post->set_said( $_POST['content'] );
  60    $post->set_time();
  61    $TEMPLATE_OUT['success'] = $guestbook->put_post( $post );
  62  }
  63  
  64  header('Content-type: text/html; charset='.$_SESSION['translator']->out('CHARACTER_ENCODING'));
  65  $_SESSION['template']->get_template();
  66  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]