[ Index ]
 

Code source de e107 0.7.8

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

title

Body

[fermer]

/e107_plugins/chatbox_menu/ -> admin_chatbox.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/chatbox_menu/admin_chatbox.php,v $
  14  |     $Revision: 1.21 $
  15  |     $Date: 2007/01/28 13:51:57 $
  16  |     $Author: e107steved $
  17  +----------------------------------------------------------------------------+
  18  */
  19  require_once ("../../class2.php");
  20  
  21  if(!getperms("P")) { header("location:".e_BASE."index.php"); exit; }
  22  
  23  @include_once e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE."_config.php";
  24  @include_once e_PLUGIN."chatbox_menu/languages/English/English_config.php";
  25  
  26  require_once(e_ADMIN."auth.php");
  27  require_once(e_HANDLER."userclass_class.php");
  28  
  29  if (isset($_POST['updatesettings'])) {
  30  
  31      $pref['chatbox_posts'] = $_POST['chatbox_posts'];
  32      $pref['cb_layer'] = $_POST['cb_layer'];
  33      $pref['cb_layer_height'] = ($_POST['cb_layer_height'] ? $_POST['cb_layer_height'] : 200);
  34      $pref['cb_emote'] = $_POST['cb_emote'];
  35      $pref['cb_mod'] = $_POST['cb_mod'];
  36      save_prefs();
  37      $e107cache->clear("nq_chatbox");
  38      $message = CHBLAN_1;
  39  }
  40  
  41  if (isset($_POST['prune'])) {
  42      $chatbox_prune = $_POST['chatbox_prune'];
  43      $prunetime = time() - $chatbox_prune;
  44  
  45      $sql->db_Delete("chatbox", "cb_datestamp < '$prunetime' ");
  46      $e107cache->clear("nq_chatbox");
  47      $message = CHBLAN_28;
  48  }
  49  
  50  if (isset($_POST['recalculate'])) {
  51      $sql->db_Update("user", "user_chats = 0");
  52      $qry = "SELECT u.user_id AS uid, count(c.cb_nick) AS count FROM #chatbox AS c
  53          LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id
  54          WHERE u.user_id > 0
  55          GROUP BY uid";
  56  
  57          if ($sql -> db_Select_gen($qry)) {
  58              $ret = array();
  59              while($row = $sql -> db_Fetch())
  60              {
  61                  $list[$row['uid']] = $row['count'];
  62              }
  63          }
  64  
  65          foreach($list as $uid => $cnt)
  66          {
  67              $sql->db_Update("user", "user_chats = '{$cnt}' WHERE user_id = '{$uid}'");
  68          }
  69      $message = CHBLAN_33;
  70  }
  71  
  72  if (isset($message)) {
  73      $ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
  74  }
  75  
  76  $chatbox_posts = $pref['chatbox_posts'];
  77  
  78  $text = "<div style='text-align:center'>
  79      <form method='post' action='".e_SELF."' id='cbform'>
  80      <table style='".ADMIN_WIDTH."' class='fborder'>
  81      <tr>
  82      <td class='forumheader3' style='width:40%'>".CHBLAN_11.":  <div class='smalltext'>".CHBLAN_12."</div></td>
  83      <td class='forumheader3' style='width:60%'>
  84      <select name='chatbox_posts' class='tbox'>";
  85  if ($chatbox_posts == 5) {
  86      $text .= "<option selected='selected'>5</option>\n";
  87  } else {
  88      $text .= "<option>5</option>\n";
  89  }
  90  if ($chatbox_posts == 10) {
  91      $text .= "<option selected='selected'>10</option>\n";
  92  } else {
  93      $text .= "<option>10</option>\n";
  94  }
  95  if ($chatbox_posts == 15) {
  96      $text .= "<option selected='selected'>15</option>\n";
  97  } else {
  98      $text .= "<option>15</option>\n";
  99  }
 100  if ($chatbox_posts == 20) {
 101      $text .= "<option selected='selected'>20</option>\n";
 102  } else {
 103      $text .= "<option>20</option>\n";
 104  }
 105  if ($chatbox_posts == 25) {
 106      $text .= "<option selected='selected'>25</option>\n";
 107  } else {
 108      $text .= "<option>25</option>\n";
 109  }
 110  
 111  if(!isset($pref['cb_mod']))
 112  {
 113      $pref['cb_mod'] = e_UC_ADMIN;
 114  }
 115  
 116  $text .= "</select>
 117      </td>
 118      </tr>
 119  
 120      <tr><td class='forumheader3' style='width:40%'>".CHBLAN_32.": </td>
 121      <td class='forumheader3' style='width:60%'>". r_userclass("cb_mod", $pref['cb_mod'], 'off', "admin, classes")."
 122      </td>
 123      </tr>
 124  
 125      <tr><td class='forumheader3' style='width:40%'>".CHBLAN_36."</td>
 126      <td class='forumheader3' style='width:60%'>".
 127      ($pref['cb_layer'] == 0 ? "<input type='radio' name='cb_layer' value='0' checked='checked' />" : "<input type='radio' name='cb_layer' value='0' />")."&nbsp;&nbsp;". CHBLAN_37."<br />".
 128      ($pref['cb_layer'] == 1 ? "<input type='radio' name='cb_layer' value='1' checked='checked' />" : "<input type='radio' name='cb_layer' value='1' />")."&nbsp;".CHBLAN_29."&nbsp;--&nbsp;". CHBLAN_30.": <input class='tbox' type='text' name='cb_layer_height' size='8' value='".$pref['cb_layer_height']."' maxlength='3' /><br />".
 129      ($pref['cb_layer'] == 2 ? "<input type='radio' name='cb_layer' value='2' checked='checked' />" : "<input type='radio' name='cb_layer' value='2' />")."&nbsp;&nbsp;". CHBLAN_38."
 130      </td>
 131      </tr>
 132      ";
 133  
 134      if($pref['smiley_activate'])
 135      {
 136          $text .= "<tr><td class='forumheader3' style='width:40%'>".CHBLAN_31."?: </td>
 137          <td class='forumheader3' style='width:60%'>". ($pref['cb_emote'] ? "<input type='checkbox' name='cb_emote' value='1' checked='checked' />" : "<input type='checkbox' name='cb_emote' value='1' />")."
 138          </td>
 139          </tr>
 140          ";
 141      }
 142  
 143      $text .= "<tr>
 144      <td class='forumheader3' style='width:40%'>".CHBLAN_21.": <div class='smalltext'>".CHBLAN_22."</div></td>
 145      <td class='forumheader3' style='width:60%'>
 146      ".CHBLAN_23." <select name='chatbox_prune' class='tbox'>
 147      <option></option>
 148      <option value='86400'>".CHBLAN_24."</option>
 149      <option value='604800'>".CHBLAN_25."</option>
 150      <option value='2592000'>".CHBLAN_26."</option>
 151      <option value='1'>".CHBLAN_27."</option>
 152      </select>
 153      <input class='button' type='submit' name='prune' value='".CHBLAN_21."' />
 154      </td>
 155      </tr>";
 156  
 157  
 158      $text .= "<tr>
 159      <td class='forumheader3' style='width:40%'>".CHBLAN_34.":</td>
 160      <td class='forumheader3' style='width:60%'>
 161      <input class='button' type='submit' name='recalculate' value='".CHBLAN_35."' />
 162      </td>
 163      </tr>";
 164  
 165      $text .= "<tr>
 166      <td  class='forumheader' colspan='3' style='text-align:center'>
 167      <input class='button' type='submit' name='updatesettings' value='".CHBLAN_19."' />
 168      </td>
 169      </tr>
 170      </table>
 171      </form>
 172      </div>";
 173  
 174  $ns->tablerender(CHBLAN_20, $text);
 175  
 176  require_once(e_ADMIN."footer.php");
 177  ?>


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