[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_plugins/forum/ -> forum_conf.php (source)

   1  <?php
   2  /*
   3  +---------------------------------------------------------------+
   4  | e107 website system
   5  |
   6  | ©Steve Dunstan 2001-2002
   7  | http://e107.org
   8  | jalist@e107.org
   9  |
  10  | Released under the terms and conditions of the
  11  | GNU General Public License (http://gnu.org).
  12  |
  13  | $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_conf.php,v $
  14  | $Revision: 1.10 $
  15  | $Date: 2006/12/26 13:33:25 $
  16  | $Author: mrpete $
  17  +---------------------------------------------------------------+
  18  */
  19  require_once ("../../class2.php");
  20  @include_once e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_conf.php';
  21  @include_once e_PLUGIN.'forum/languages/English/lan_forum_conf.php';
  22  
  23  $e_sub_cat = 'forum';
  24      
  25  $qs = explode(".", e_QUERY);
  26  $action = $qs[0];
  27  $thread_id = intval($qs[1]);
  28  
  29  $qry = "
  30  SELECT t.*, f.*, fp.forum_id AS forum_parent_id FROM #forum_t as t
  31  LEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id
  32  LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent
  33  WHERE t.thread_id = {$thread_id}
  34  ";
  35  
  36  if($sql->db_Select_gen($qry))
  37  {
  38      $info=$sql->db_Fetch();
  39      if(!check_class($info['forum_moderators']))
  40      {
  41          header("location:".e_BASE."index.php");
  42          exit;
  43      }
  44  }
  45  else
  46  {
  47      header("location:".e_BASE."index.php");
  48      exit;
  49  }
  50  
  51  require_once(HEADERF);
  52  
  53  if (isset($_POST['deletepollconfirm'])) {
  54      $sql->db_Delete("poll", "poll_id='".intval($thread_parent)."' ");
  55      $sql->db_Select("forum_t", "*", "thread_id='".$thread_id."' ");
  56      $row = $sql->db_Fetch();
  57       extract($row);
  58      $thread_name = str_replace("[poll] ", "", $thread_name);
  59      $sql->db_Update("forum_t", "thread_name='$thread_name' WHERE thread_id='$thread_id' ");
  60      $message = FORLAN_5;
  61      $url = e_PLUGIN."forum/forum_viewtopic.php?".$thread_id;
  62  }
  63      
  64  if (isset($_POST['move']))
  65  {
  66      require_once(e_PLUGIN."forum/forum_class.php");
  67      $forum = new e107forum;
  68      $new_forum = intval($_POST['forum_move']);
  69      $replies = $sql->db_Select("forum_t", "*", "thread_parent='$thread_id' ");
  70      $sql->db_Select("forum_t", "thread_name, thread_forum_id", "thread_id ='".$thread_id."' ");
  71      $row = $sql->db_Fetch();
  72      $old_forum = $row['thread_forum_id'];
  73      $new_thread_name = $row['thread_name'];
  74  
  75      if($_POST['rename_thread'] == 'add')
  76      {
  77          $new_thread_name = "[".FORLAN_27."] ".$new_thread_name;
  78      }
  79      elseif($_POST['rename_thread'] == 'rename' && trim($_POST['newtitle']) != "")
  80      {
  81          $new_thread_name = $tp->toDB($_POST['newtitle']);
  82      }
  83  
  84      $sql->db_Update("forum_t", "thread_forum_id='$new_forum', thread_name='{$new_thread_name}' WHERE thread_id='$thread_id' ");
  85      $sql->db_Update("forum_t", "thread_forum_id='$new_forum' WHERE thread_parent='$thread_id' ");
  86      $sql->db_Update("forum", "forum_threads=forum_threads-1, forum_replies=forum_replies-$replies WHERE forum_id='$old_forum' ");
  87      $sql->db_Update("forum", "forum_threads=forum_threads+1, forum_replies=forum_replies+$replies WHERE forum_id='$new_forum' ");
  88       
  89      // update lastposts
  90  
  91      $forum->update_lastpost('forum', $old_forum, FALSE);
  92      $forum->update_lastpost('forum', $new_forum, FALSE);
  93       
  94      $message = FORLAN_9;
  95      $url = e_PLUGIN."forum/forum_viewforum.php?".$new_forum;
  96  }
  97      
  98  if (isset($_POST['movecancel']))
  99  {
 100      $message = FORLAN_10;
 101      $url = e_PLUGIN."forum/forum_viewforum.php?".$info['forum_id'];
 102  }
 103      
 104  if ($message)
 105  {
 106      $text = "<div style='text-align:center'>".$message."
 107          <br />
 108          <a href='$url'>".FORLAN_11."</a>
 109          </div>";
 110      $ns->tablerender(FORLAN_12, $text);
 111      require_once(FOOTERF);
 112      exit;
 113  }
 114      
 115  if ($action == "delete_poll")
 116  {
 117      $text = "<div style='text-align:center'>
 118          ".FORLAN_13."
 119          <br /><br />
 120          <form method='post' action='".e_SELF."?".e_QUERY."'>
 121          <input class='button' type='submit' name='deletecancel' value='".FORLAN_14."' />
 122          <input class='button' type='submit' name='deletepollconfirm' value='".FORLAN_15."' />
 123          </form>
 124          </div>";
 125      $ns->tablerender(FORLAN_16, $text);
 126      require_once ("footer.php");
 127      exit;
 128  }
 129      
 130  if ($action == "move")
 131  {
 132      $text = "
 133          <form method='post' action='".e_SELF."?".e_QUERY."'>
 134          <div style='text-align:center'>
 135          <table style='".ADMIN_WIDTH."'>
 136          <tr>
 137          <td style='text-align:right'>".FORLAN_24.": </td>
 138          <td style='text-align:left'>
 139          <select name='forum_move' class='tbox'>";
 140      $qry = "
 141      SELECT f.forum_id, f.forum_name, fp.forum_name AS forum_parent, sp.forum_name AS sub_parent
 142      FROM #forum AS f
 143      LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
 144      LEFT JOIN #forum AS sp ON f.forum_sub = sp.forum_id
 145      WHERE f.forum_parent != 0
 146      AND f.forum_id != ".intval($info['forum_id'])."    
 147      AND f.forum_class IN (".USERCLASS_LIST.")
 148      AND fp.forum_class IN (".USERCLASS_LIST.")
 149      ORDER BY f.forum_parent ASC, f.forum_sub, f.forum_order ASC
 150      ";
 151      $sql->db_Select_gen($qry);
 152      $fList = $sql->db_getList();
 153  
 154      foreach($fList as $f)
 155      {
 156          if($f['forum_sub'] > 0)
 157          {
 158              $f['forum_name'] = "subforum -> ".$f['forum_name'];
 159          }
 160          $for_name = $f['forum_parent']." -> ";
 161          $for_name .= ($f['sub_parent'] ? $f['sub_parent']." -> " : "");
 162          $for_name .= $f['forum_name'];
 163  
 164          $text .= "<option value='{$f['forum_id']}'>".$for_name."</option>";
 165      }
 166      $text .= "</select>
 167          </td>
 168          </tr>
 169          <tr>
 170          <td colspan='2'><br />
 171          <b>".FORLAN_32."</b><br />
 172          <input type='radio' name='rename_thread' checked='checked' value='none' /> ".FORLAN_28."<br />
 173          <input type='radio' name='rename_thread' value='add' /> ".FORLAN_29." [".FORLAN_27."] ".FORLAN_30."<br />
 174          <input type='radio' name='rename_thread' value='rename' /> ".FORLAN_31." <input type='text' class='tbox' name='newtitle' size='60' maxlength='250' value='".$tp->toForm($info['thread_name'])."'/>
 175          </td>
 176          </tr>
 177          <tr style='vertical-align: top;'>
 178          <td colspan='2'  style='text-align:center'><br />
 179          <input class='button' type='submit' name='move' value='".FORLAN_25."' />
 180          <input class='button' type='submit' name='movecancel' value='".FORLAN_14."' />
 181          </td>
 182          </tr>
 183          </table>
 184          </div>
 185          </form><br />";
 186      $text = $ns->tablerender($tp->toHTML($info['thread_name']), $tp->toHTML($info['thread_thread']), '', TRUE).$ns->tablerender("", $text, '', true);
 187      $ns->tablerender(FORLAN_25, $text);
 188      
 189  }
 190  require_once(FOOTERF);
 191  ?>


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7