[ Index ]
 

Code source de Phorum 5.1.25

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/include/admin/ -> deleteforum.php (source)

   1  <?php
   2  
   3  ////////////////////////////////////////////////////////////////////////////////
   4  //                                                                            //
   5  //   Copyright (C) 2006  Phorum Development Team                              //
   6  //   http://www.phorum.org                                                    //
   7  //                                                                            //
   8  //   This program is free software. You can redistribute it and/or modify     //
   9  //   it under the terms of either the current Phorum License (viewable at     //
  10  //   phorum.org) or the Phorum License that was distributed with this file    //
  11  //                                                                            //
  12  //   This program is distributed in the hope that it will be useful,          //
  13  //   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
  14  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
  15  //                                                                            //
  16  //   You should have received a copy of the Phorum License                    //
  17  //   along with this program.                                                 //
  18  ////////////////////////////////////////////////////////////////////////////////
  19  
  20      if(!defined("PHORUM_ADMIN")) return;
  21  
  22      if($_GET["confirm"]=="Yes"){
  23  
  24          if($_GET["folder_flag"]){
  25  
  26              $cur_folder_id=(int)$_GET['forum_id'];
  27              // handling vroots
  28              $oldfolder_tmp=phorum_db_get_forums($cur_folder_id);
  29              $oldfolder=array_shift($oldfolder_tmp);
  30  
  31              if($oldfolder['parent_id'] > 0) { // is it a real folder?
  32                  $parent_folder=phorum_db_get_forums($oldfolder['parent_id']);
  33                  if($parent_folder[$oldfolder['parent_id']]['vroot'] > 0) { // is a vroot set?
  34                      // then set the vroot to the vroot of the parent-folder
  35                      phorum_admin_set_vroot($cur_folder_id,$parent_folder[$oldfolder['parent_id']]['vroot'],$cur_folder_id);
  36                  }
  37              } else { // just default root ...
  38                  phorum_admin_set_vroot($cur_folder_id,0,$cur_folder_id);
  39              }
  40              // done with vroots
  41  
  42              phorum_db_drop_folder($cur_folder_id);
  43              $msg="The folder was deleted.  All forums and folders in this folder have been moved to this folder's parent.";
  44          } else {
  45              phorum_db_drop_forum($_GET["forum_id"]);
  46              $msg="The forum was deleted.  All messages in that forum were deleted.";
  47          }
  48  
  49      } elseif($_GET["confirm"]=="No"){
  50  
  51          $msg="No action was taken.";
  52  
  53      } else {
  54  
  55          $forums=phorum_db_get_forums((int)$_GET["forum_id"]);
  56          $forum=array_shift($forums);
  57  
  58          if($forum["folder_flag"]){
  59              $msg="Are you sure you want to delete $forum[name]?  All forums and folders in this folder will be moved to this folder's parent.";
  60          } else {
  61              $msg="Are you sure you want to delete $forum[name]?  All messages in this forum will be deleted";
  62          }
  63          $msg.="<form action=\"{$PHORUM["admin_http_path"]}\" method=\"get\"><input type=\"hidden\" name=\"module\" value=\"$module\" /><input type=\"hidden\" name=\"forum_id\" value=\"{$forum['forum_id']}\" /><input type=\"hidden\" name=\"folder_flag\" value=\"$forum[folder_flag]\" /><input type=\"submit\" name=\"confirm\" value=\"Yes\" />&nbsp;<input type=\"submit\" name=\"confirm\" value=\"No\" /></form>";
  64  
  65      }
  66  
  67  ?>
  68  <div class="PhorumInfoMessage"><?php echo $msg; ?></div>


Généré le : Thu Nov 29 12:22:27 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics