home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / dotproject / modules / forums / do_forum_aed.php < prev    next >
Encoding:
PHP Script  |  2003-04-04  |  773 b   |  30 lines

  1. <?php /* FORUMS $Id: do_forum_aed.php,v 1.2 2003/04/04 05:02:40 eddieajau Exp $ */
  2. $del = isset($_POST['del']) ? $_POST['del'] : 0;
  3.  
  4. $obj = new CForum();
  5.  
  6. if (($msg = $obj->bind( $_POST ))) {
  7.     $AppUI->setMsg( $msg, UI_MSG_ERROR );
  8.     $AppUI->redirect();
  9. }
  10.  
  11. // prepare (and translate) the module name ready for the suffix
  12. $AppUI->setMsg( 'Forum' );
  13. if ($del) {
  14.     if (($msg = $obj->delete())) {
  15.         $AppUI->setMsg( $msg, UI_MSG_ERROR );
  16.         $AppUI->redirect();
  17.     } else {
  18.         $AppUI->setMsg( "deleted", UI_MSG_ALERT, true );
  19.         $AppUI->redirect( "m=forums" );
  20.     }
  21. } else {
  22.     if (($msg = $obj->store())) {
  23.         $AppUI->setMsg( $msg, UI_MSG_ERROR );
  24.     } else {
  25.         $isNotNew = @$_POST['forum_id'];
  26.         $AppUI->setMsg( $isNotNew ? 'updated' : 'added', UI_MSG_OK, true );
  27.     }
  28.     $AppUI->redirect();
  29. }
  30. ?>