Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors', 1);
  3. ini_set('display_startup_errors', 1);
  4. error_reporting(E_ALL);
  5.  
  6. //require_once __DIR__ . "/TeamSpeak3/TeamSpeak3.php";
  7.  
  8. try
  9.  
  10. {
  11. $link = mysqli_connect("localhost","flowhost_mar","3181cq61.");
  12.  
  13. mysqli_select_db($link,"flowhost_mar") or die ("Ninguna DB seleccionada");
  14.  
  15. $qdatos = "SELECT * FROM tsw_config";
  16. $rdatos = mysqli_query($link,$qdatos) or die(mysql_error());
  17.  
  18. while($row = mysqli_fetch_array($rdatos)) {
  19. $queryda[] = $row;
  20. }
  21.  
  22. $connect = "serverquery://".$queryda['27']['value'].":".$queryda['28']['value']."@".$queryda['24']['value'].":".$queryda['25']['value']."";
  23.  
  24. $ts3 = TeamSpeak3::factory($connect);
  25.  
  26. $ts3 = $ts3->serverGetByPort($queryda['26']['value']);
  27.  
  28. $ts3->execute("clientupdate", array("client_nickname" => $queryda['14']['value']));
  29.  
  30.  
  31. $unixTime = time();
  32.  
  33. $realTime = date('[d-m-Y] [H:i]',$unixTime);
  34.  
  35. }
  36.  
  37.  
  38. catch(Exception $e) {
  39.  
  40. echo "Failed Connect To Server";
  41. die();
  42.  
  43. }
  44.  
  45.  
  46. if (isset($_POST["crearcanal"])){
  47.  
  48.  
  49.  
  50. $nombre = $_POST['nombrecanal'];
  51.  
  52. $password = $_POST['contraseña'];
  53.  
  54. $orden = $_POST['seccion'];
  55.  
  56. $unixTime = time();
  57.  
  58. $realTime = date('[Y-m-d]-[H:i]',$unixTime);
  59.  
  60. $channel_admin_group = 13;
  61.  
  62.  
  63.  
  64. $clib = $usuario['clid'];
  65.  
  66.  
  67. try{
  68. $cid1 = $ts3->channelCreate(array(
  69.  
  70. "channel_name" => '['.$nombrecanaln.'] '.$nombre.'',
  71.  
  72. "channel_password" => "$password",
  73.  
  74. "channel_flag_permanent" => "1",
  75.  
  76. "channel_description" => '[center][b][u]'.$nombre.'[/u][/b][/center][hr][b][list][*]Fecha: '.$realTime.'[*]Dueño: [URL=client://' . $clib . '/' . $clientuid . ']' . $usuario . '[/URL][/list][/b]',
  77.  
  78. "channel_order" => $resultadoapertura));
  79.  
  80.  
  81. $spacerbot = $ts3->channelCreate(array(
  82.  
  83. "channel_name" => '[spacer*'.$random.']',
  84.  
  85. "channel_password" => "$random",
  86.  
  87. "channel_flag_permanent" => "1",
  88.  
  89. "channel_order" => $cid1));
  90.  
  91.  
  92. }
  93.  
  94. catch(Exception $e) {
  95.  
  96.  
  97.  
  98. echo "[DEBUG] Ha ocurrido un error inesperado <br>";
  99.  
  100. echo "[DEBUG] Mensaje de error DEBUG: ".$e->getMessage()."<br>";
  101.  
  102. echo "[DEBUG] El codigo de error fue ".$e->getCode()."<br>";
  103.  
  104. }
  105.  
  106.  
  107.  
  108. $ts3->clientGetByUid($clientuid)->setChannelGroup($cid1, $channel_admin_group);
  109.  
  110. $ts3->clientMove($clib, $cid1);
  111.  
  112.  
  113.  
  114. $mensajito = $ts3->clientGetByUid($clientuid);
  115.  
  116. $mensajito->message("[B]Hola, [COLOR=#ff0000]".$usuario."[/COLOR]. Gracias por Utilizar nuestro sistema fuiste movido a tu canal.");
  117.  
  118.  
  119. echo "<script language='javascript'>window.location='createchannel.php?created'</script>;";
  120.  
  121. }
  122. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement