Hab kleines problem beim botpanel
Kann mir einer das fixxen? wäre dankbar
wenn ich bot kaufe zeigt sich das style nicht im client, obwohl ich es augewählt habe bitte hilft mir
PHP
<?php
require_once('./data_classes/server-data.php_data_classes-core.php.php');
require_once('./data_classes/server-data.php_data_classes-session.php.php');
$pagename = "Botpanel";
$pageid = "25";
require_once('./templates/community_subheader.php');
require_once('./templates/community_header.php');
$us = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$my_id."'"));
$rooms = mysql_query("SELECT * FROM `rooms` WHERE `owner` = '".$us['username']."'");
if(isset($_GET['do']) && $_GET['do'] == "create") {
$name = htmlspecialchars(mysql_real_escape_string($_POST['name']));
$mission = htmlspecialchars(mysql_real_escape_string($_POST['mission']));
$movetype = $_POST['movetype'];
$locations = array();
$locations['X'] = $_POST['locationX'];
$locations['Y'] = $_POST['locationY'];
$locations['Z'] = $_POST['locationZ'];
$look = htmlspecialchars(mysql_real_escape_string($_POST['look']));
$room = $_POST['room'];
foreach($_POST['konst_text'] AS $id => $text) {
$trim_text = trim($text);
if(!empty($trim_text)) {
$konst_text[$id]['text'] = htmlspecialchars(mysql_real_escape_string($text));
$konst_text[$id]['type'] = $_POST['konst_type'][$id];
}
}
foreach($_POST['sprach_text'] AS $id => $text) {
$trim_text = trim($text);
$trim_words = trim($_POST['words'][$id]);
if(!empty($trim_text) AND !empty($trim_words)) {
$sprach_text[$id]['text'] = htmlspecialchars(mysql_real_escape_string($text));
$sprach_text[$id]['words'] = htmlspecialchars(mysql_real_escape_string($_POST['words'][$id]));
$sprach_text[$id]['type'] = $_POST['sprach_type'][$id];
}
}
$wordshort = false;
foreach($sprach_text AS $index => $datas) {
$woerter = explode(";", $datas['words']);
if(count($woerter) > 0) {
foreach($woerter AS $index => $value) {
$trimval = trim($value);
if(strlen($trimval) < 4) {
$wordshort = true;
}
}
}
}
$trim_look = trim($look);
if($us['credits'] >= 50) {
if($wordshort == false) {
if(strlen($look) > 0) {
if(strlen(trim($name)) > 1) {
if(is_numeric($locations['X']) && is_numeric($locations['Y']) && is_numeric($locations['Z'])) {
if(!empty($trim_look)) {
if(count($konst_text) > 0) {
$credits = mysql_query("UPDATE `users` SET `credits` = `credits` - 50 WHERE `id` = '".$my_id."'");
$styledats = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `username` = '".$look."' LIMIT 1"));
$bot_create = mysql_query("INSERT INTO `bots` (`room_id`, `ai_type`, `name`, `motto`, `look`, `x`, `y`, `z`, `rotation`, `walk_mode`, `min_x`, `min_y`, `max_x`, `max_y`, `effect`) VALUES ('".$room."', 'generic', '".$name."', '".$mission."', '".$styledats['look']."', '".$locations['X']."', '".$locations['Y']."', '".$locations['Y']."', '0', '".$movetype."', '0', '0', '0', '0', '0')");
$bot = mysql_fetch_assoc(mysql_query("SELECT * FROM `bots` WHERE `name` = '".$name."' ORDER BY `id` DESC LIMIT 1"));
$bot_id = $bot['id'];
$user_bots = mysql_query("INSERT INTO `user_bots` (`userid`, `bot_id`, `responses`, `speech`) VALUES ('".$my_id."', '".$bot_id."', '5', '5')");
foreach($konst_text AS $num => $datas) {
$bot_konst_speech = mysql_query("INSERT INTO `bots_speech` (`bot_id`, `text`, `shout`) VALUES ('".$bot_id."', '".$datas['text']."', '".$datas['type']."')");
}
foreach($sprach_text AS $num => $datas) {
$words = explode(";", $datas['words']);
foreach($words AS $index => $value) {
$trim_value = trim($value);
if(!empty($trim_value)) {
if($index == 0) {
$word = $value;
} else {
$word .= ";".$value;
}
}
}
$bot_sprach_text = mysql_query("INSERT INTO `bots_responses` (`bot_id`, `response_text`, `keywords`, `mode`, `serve_id`) VALUES ('".$bot_id."', '".$datas['text']."', '".$word."', '".$datas['type']."', '0')");
}
if($bot_create && $bot_konst_speech && $tickets && $user_bots) {
unset($_POST);
$msg = "<div class='rounded rounded-green'><center>Erfolgreich erstellt<img src=\"./images/check.gif\"></center></div><br>";
echo "<script>alert('Achtung! Führe jetzt :unload und :update_bots in dem Raum aus, den du ausgewählt hast und der Bot sein soll!');</script>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Du musst mindestens einen konstanten Text angeben! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Bitte gib einen richtigen Usernamen ein, von dem der Style kopiert werden soll! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Du musst einen Standort (X, Y, Z) auswählen, wo der Bot stehen / starten soll! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Der Name des Bots ist unzulässig! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Du musst einen Namen für den Style deines Bots auswählen! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Ein Wort muss mindestens 4 Zeichen haben! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Du hast nicht genügend Tickets! <img src=\"./images/del.gif\"></center></div><br>";
}
}
if(isset($_GET['do']) && $_GET['do'] == "edit") {
$bot_id = intval($_GET['key']);
$name = htmlspecialchars(mysql_real_escape_string($_POST['name']));
$mission = htmlspecialchars(mysql_real_escape_string($_POST['mission']));
$movetype = htmlspecialchars(mysql_real_escape_string($_POST['movetype']));
$locations = array();
$locations['X'] = htmlspecialchars(mysql_real_escape_string($_POST['locationX']));
$locations['Y'] = htmlspecialchars(mysql_real_escape_string($_POST['locationY']));
$locations['Z'] = htmlspecialchars(mysql_real_escape_string($_POST['locationZ']));
$look = htmlspecialchars(mysql_real_escape_string($_POST['look']));
$room = htmlspecialchars(mysql_real_escape_string($_POST['room']));
foreach ($_POST['konst_text'] AS $id => $text) {
$trim_text = trim($text);
if(!empty($trim_text)) {
$konst_text[$id]['text'] = htmlspecialchars(mysql_real_escape_string($text));
$konst_text[$id]['type'] = htmlspecialchars(mysql_real_escape_string($_POST['konst_type'][$id]));
}
}
foreach($_POST['sprach_text'] AS $id => $text) {
$trim_text = trim($text);
$trim_words = trim($_POST['words'][$id]);
if(!empty($trim_text) AND !empty($trim_words)) {
$sprach_text[$id]['text'] = htmlspecialchars(mysql_real_escape_string($text));
$sprach_text[$id]['words'] = htmlspecialchars(mysql_real_escape_string($_POST['words'][$id]));
$sprach_text[$id]['type'] = htmlspecialchars(mysql_real_escape_string($_POST['sprach_type'][$id]));
}
}
$wordshort = false;
foreach($sprach_text AS $index => $datas) {
$woerter = explode(";", $datas['words']);
if(count($woerter) > 0) {
foreach($woerter AS $index => $value) {
$trimval = trim($value);
if(strlen($trimval) < 4) {
$wordshort = true;
}
}
}
}
$trim_look = trim($look);
if(is_numeric($bot_id)) {
if($us['tickets'] >= 50) {
if($wordshort == false) {
if(strlen($look) > 0) {
if(strlen(trim($name)) > 1) {
if(is_numeric($locations['X']) && is_numeric($locations['Y']) && is_numeric($locations['Z'])) {
if(!empty($trim_look)) {
if(count($konst_text) > 0) {
$del2 = mysql_query("DELETE FROM `bots_speech` WHERE `bot_id` = '".$bot_id."'");
$del3 = mysql_query("DELETE FROM `bots_responses` WHERE `bot_id` = '".$bot_id."'");
$styledats = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `username` = '".$look."' LIMIT 1"));
$bot_update = mysql_query("UPDATE `bots` SET `room_id` = '".$room."', `name` = '".$name."', `motto` = '".$mission."', `look` = '".$styledats['look']."', `x` = '".$locations['X']."', `y` = '".$locations['Y']."', `z` = '".$locations['Z']."', `walk_mode` = '".$movetype."' WHERE `id` = '".$bot_id."'");
foreach($konst_text AS $num => $datas) {
$bot_konst_speech = mysql_query("INSERT INTO `bots_speech` (`bot_id`, `text`, `shout`) VALUES ('".$bot_id."', '".$datas['text']."', '".$datas['type']."')");
}
foreach($sprach_text AS $num => $datas) {
$words = explode(";", $datas['words']);
foreach($words AS $index => $value) {
$trim_value = trim($value);
if(!empty($trim_value)) {
if($index == 0) {
$word = $value;
} else {
$word .= ";".$value;
}
}
}
$bot_sprach_text = mysql_query("INSERT INTO `bots_responses` (`bot_id`, `response_text`, `keywords`, `mode`, `serve_id`) VALUES ('".$bot_id."', '".$datas['text']."', '".$word."', '".$datas['type']."', '0')");
}
if($bot_update && $bot_konst_speech && $bot_sprach_text) {
unset($_POST);
$msg = "<div class='rounded rounded-green'><center>Erfolgreich bearbeitet!<img src=\"./images/check.gif\"></center></div><br>";
echo "<script>alert('Achtung! Führe jetzt :update_bots und :unload in dem Raum aus, den du ausgewählt hast und der Bot sein soll!');</script>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Du musst mindestens einen konstanten Text angeben! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Bitte gib einen richtigen Usernamen ein, von dem der Style kopiert werden soll! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Du musst einen Standort (X, Y, Z) auswählen, wo der Bot stehen / starten soll! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Der Name des Bots ist unzulässig! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Du musst einen Namen für den Style deines Bots auswählen! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Ein Wort muss mindestens 4 Zeichen haben! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Du hast nicht genügend Tickets! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Falscher Key! <img src=\"./images/del.gif\"></center></div><br>";
}
}
if(isset($_GET['do']) && $_GET['do'] == "add_konst" && isset($_GET['key'])) {
$bot_id = intval($_GET['key']);
$text = htmlspecialchars(mysql_real_escape_string($_POST['text']));
$trim_text = trim($text);
$type = htmlspecialchars(mysql_real_escape_string($_POST['type']));
$num = mysql_num_rows(mysql_query("SELECT * FROM `user_bots` WHERE `bot_id` = '".$bot_id."' LIMIT 1"));
$botdata = mysql_fetch_assoc(mysql_query("SELECT * FROM `user_bots` WHERE `bot_id` = '".$bot_id."'"));
$userdaa = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$botdata['userid']."'"));
if(is_numeric($bot_id)) {
if($userdaa['tickets'] >= 0) {
if($num > 0) {
if(!empty($trim_text)) {
if($my_id == $userdaa['id']) {
$bot_konst_speech = mysql_query("INSERT INTO `bots_speech` (`bot_id`, `text`, `shout`) VALUES ('".$bot_id."', '".$text."', '".$type."')");
$user_bot_add_speech = mysql_query("UPDATE `user_bots` SET `speech` = `speech` + 1 WHERE `bot_id` = '".$bot_id."' AND `userid` = '".$userdaa['id']."'");
$user_tickets = mysql_query("UPDATE `users` SET `tickets` = `tickets` - 10 WHERE `id` = '".$userdaa['id']."'");
if($bot_konst_speech && $user_bot_add_speech && $user_tickets) {
unset($_POST);
$msg = "<div class='rounded rounded-green'><center>Erfolgreich hinzugefügt! <img src=\"./images/check.gif\"></center></div><br>";
echo "<script>alert('Achtung! Frage nun einen Staff / Moderator ob er in deinem Raum den Bot aktiviert!');</script>";
} else {
$msg = mysql_error();
}
} else {
$msg = "<div class='rounded rounded-red'><center>Kein Bot gefunden. <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Du musst etwas bei Text eintragen! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Diesen Bot gibt es nicht! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Du hast nicht genügend Tickets! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Key fehlerhaft! <img src=\"./images/del.gif\"></center></div><br>";
}
}
if(isset($_GET['do']) && $_GET['do'] == "add_sprach" && isset($_GET['key'])) {
$bot_id = intval($_GET['key']);
$text = htmlspecialchars(mysql_real_escape_string($_POST['text']));
$trim_text = trim($text);
$type = $_POST['type'];
$wor = htmlspecialchars(mysql_real_escape_string($_POST['words']));
$c = 0;
$words = explode(";", $wor);
foreach($words AS $index => $value) {
$trim_value = trim($value);
if(!empty($trim_value)) {
$c++;
if($index == 0) {
$word = $value;
} else {
$word .= ";".$value;
}
}
}
$num = mysql_num_rows(mysql_query("SELECT * FROM `user_bots` WHERE `bot_id` = '".$bot_id."' LIMIT 1"));
$botdata = mysql_fetch_assoc(mysql_query("SELECT * FROM `user_bots` WHERE `bot_id` = '".$bot_id."'"));
$userdaa = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$botdata['userid']."'"));
if($c > 0) {
if(is_numeric($bot_id)) {
if($num > 0) {
if($userdaa['tickets'] >= 0) {
if(!empty($trim_text)) {
if($my_id == $userdaa['id']) {
$bot_sprach_text = mysql_query("INSERT INTO `bots_responses` (`bot_id`, `response_text`, `keywords`, `mode`, `serve_id`) VALUES ('".$bot_id."', '".$text."', '".$word."', '".$type."', '0')");
$bot_user_add_sprach = mysql_query("UPDATE `user_bots` SET `responses` = `responses` + 1 WHERE `bot_id` = '".$bot_id."' AND `userid` = '".$my_id."'");
$user_tickets = mysql_query("UPDATE `users` SET `tickets` = `tickets` - 15 WHERE `id` = '".$my_id."'");
if($user_tickets && $bot_sprach_text && $bot_user_add_sprach) {
unset($_POST);
$msg = "<div class='rounded rounded-green'><center>Erfolgreich hinzugefügt! <img src=\"./images/check.gif\"></center></div><br>";
echo "<script>alert('Achtung! Führe jetzt :update_bots und :unload in dem Raum aus, in dem der Bot steht, damit er diesen Satz sagt!');</script>";
} else {
$msg = mysql_error();
}
} else {
$msg = "<div class='rounded rounded-red'><center>Bot nicht gefunden! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Gib einen gültigen Text ein! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Nicht genug Tickets! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Bot nicht gefunden! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Key fehlerhaft! <img src=\"./images/del.gif\"></center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Gib mindestens ein richtiges Wort ein! <img src=\"./images/del.gif\"></center></div><br>";
}
}
if(isset($_GET['do']) && $_GET['do'] == "delete") {
$id = intval($_GET['id']);
$botdata = mysql_fetch_assoc(mysql_query("SELECT * FROM `user_bots` WHERE `bot_id` = '".$id."'"));
$num = mysql_num_rows(mysql_query("SELECT * FROM `bots` WHERE `id` = '".$id."'"));
if(is_numeric($id)) {
if($botdata['userid'] == $my_id) {
if($num > 0) {
$del1 = mysql_query("DELETE FROM `bots` WHERE `id` = '".$id."'");
$del2 = mysql_query("DELETE FROM `bots_speech` WHERE `bot_id` = '".$id."'");
$del3 = mysql_query("DELETE FROM `bots_responses` WHERE `bot_id` = '".$id."'");
$del4 = mysql_query("DELETE FROM `user_bots` WHERE `bot_id` = '".$id."'");
if($del1 && $del2 && $del3 && $del4) {
$msg = "<div class='rounded rounded-green'><center>Erfolgreich gelöscht!</center></div><br>";
} else {
$msg = "Fehler: ". mysql_error();
}
} else {
$msg = "<div class='rounded rounded-red'><center>Bot nicht vorhanden!</font>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Keine Berechtigung!</font>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>NANANANA! Nicht manipulieren!</font>";
}
}
?>
<style lang="text/css">
#tabletuch td {
background-color: #DDDDDD;
border: 1px solid black;
}
#tabletuch2 td {
border: 1px solid black;
}
#tablehead th {
background-color: #AAAAAA;
border: 1px solid black;
}
#tablebott td {
background-color: #AAAAAA;
border: 1px solid black;
}
#tablebott2 td {
background-color: #CCCCCC;
}
</style>
<div id="container">
<div id="content">
<div id="column1" class="column">
<div class="habblet-container ">
<div class="cbb clearfix green">
<h2 class="title"><?php echo $sitename; ?> - Botpanel</h2>
<div class="habblet box-content">
<?php
if(!isset($_GET['mode']) OR $_GET['mode'] == "add") {
?>
<h1 align="center">Bot-Panel</h1>
<?php echo $msg; ?><br />
Kosten: <strong>50</strong> Tickets<br /><br />
<table style="border-collapse: collapse;" cellpadding="5" width="100%">
<form action="botpanel.php?do=create" method="post">
<tr id="tablehead">
<th colspan="2"><font color="white">Neuen Bot erstellen</font></th>
</tr>
<tr id="tablehead">
<th colspan="2"><font color="white">Allgemeins</font></th>
</tr>
<tr id="tabletuch2">
<td>Name des Bots:</td>
<td><input value="<?php echo $_POST['name']; ?>" type="text" name="name" maxlength="32" /></td>
</tr>
<tr id="tabletuch2">
<td>Mission:</td>
<td><input value="<?php echo $_POST['mission']; ?>" type="text" name="mission" maxlength="64" /></td>
</tr>
<tr id="tabletuch2">
<td valign="top">Bewegungsart: <a onClick="alert('Freies Bewegen: Der Bot läuft frei im Raum herum. Stand: Der Bot bleibt nur an einer Stelle stehen.');">(?)</a></td>
<td><input type="radio" value="freeroam" name="movetype" <?php if($_POST['movetype'] == "freeroam") { ?> checked <?php } ?>> Freies Bewegen<br />
<input type="radio" value="stand" name="movetype" <?php if($_POST['movetype'] == "stand") { ?> checked <?php } ?>> Stand</td>
</tr>
<tr id="tabletuch2">
<td valign="top">Start- oder Standort <a onClick="alert('Der Ort an dem der Bot stehen soll bzw. anfangen soll zu laufen. Tipp: Gehe in ein Raum, stehe dort hin wo der Bot stehen soll und gebe :coords ein. Die darauf folgende Ausgabe gibts Du hier ein!');">(?)</a></td>
<td><input type="text" value="<?php echo $_POST['locationX']; ?>" name="locationX" size="1" /> X<br />
<input type="text" value="<?php echo $_POST['locationY']; ?>" name="locationY" size="1" /> Y<br />
<input type="text" value="<?php echo $_POST['locationZ']; ?>" name="locationZ" size="1" /> Z</td>
</tr>
<tr id="tabletuch2">
<td>Aussehen: <a onClick="alert('Gebe hier einen <?php echo $sitename; ?> Namen ein, von dem der Style auf den Bot kopiert werden soll.');">(?)</a></td>
<td><input type="text" value="<?php echo $_POST['look']; ?>" name="look" /></td>
</tr>
<tr id="tabletuch2">
<td>Raum:</td>
<td><select name="room">
<?php
while($row = mysql_fetch_assoc($rooms)) {
?>
<option value="<?php echo $row['id']; ?>" <?php if($_POST['room'] == $row['id']) { ?> selected <?php } ?>><?php echo $row['caption']; ?></option>
<?php
}
?>
</select></td>
<tr id="tablehead">
<th colspan="2"><font color="white">Konstante Sprachsätze</font> <a onClick="alert('Hier kannst du 5 Sätze rein schreiben, die der Bot in einem bestimmten Zeitraum immer wieder sagt. Du musst nicht alle 5 Sätze verwenden. Wenn du den Text frei lässt, wird dieser nicht vom Bot gesprochen');">(?)</a></th>
</tr>
<?php
for($i = 1; $i <= 5; $i++) {
?>
<tr id="tabletuch2">
<td>Text #<?php echo $i; ?>:</td>
<td><input type="text" value="<?php echo $row['konst_text'][$i]; ?>" name="konst_text[]" size="25" /><select name="konst_type[]"><option value="0" <?php if($_POST['konst_type'][$i] == 0) { ?> selected <?php } ?>>Sagen</option><option value="1" <?php if($_POST['konst_type'][$i] == 1) { ?> selected <?php } ?>>Schreien</option></select></td>
</tr>
<?php
}
?>
<tr id="tablehead">
<th colspan="2"><font color="white">Sprachgesteuerte Sätze</font> <a onClick="alert('Hier kannst du wieder 5 Sätze eintragen, die von einem User mit bestimmten Wörtern auslöst. Du kannst mehrere Wörter auswählen in dem du sie mit ; trennst. z.B. hallo;krass;geil ...');">(?)</a></th>
</tr>
<?php
for($i = 1; $i <= 5; $i++) {
?>
<tr id="tabletuch2">
<td>Wörter #<?php echo $i; ?>:</td>
<td><input type="text" name="words[]" value="<?php echo $_POST['words'][$i]; ?>"></td>
</tr>
<tr id="tabletuch2">
<td>Text #<?php echo $i; ?>:</td>
<td><input type="text" name="sprach_text[]" size="25" value="<?php echo $_POST['sprach_text'][$i]; ?>" /><select name="sprach_type[]"><option value="say" <?php if($_POST['sprach_type'][$i] == "say") { ?> selected <?php } ?>>Sagen</option><option value="whisper" <?php if($_POST['sprach_type'][$i] == "whisper") { ?> selected <?php } ?>>Flüstern</option><option value="shout" <?php if($_POST['sprach_type'][$i] == "shout") { ?> selected <?php } ?>>Schreien</option></select></td>
</tr>
<?php
}
?>
<tr id="tablebott">
<td colspan="2"><input type="submit" value="Erstellen" style="width: 100%; font-size: 14pt;" /></td>
</tr>
</table>
<?php
} elseif(isset($_GET['mode']) && $_GET['mode'] == "edit" && isset($_GET['key'])) {
$key = intval($_GET['key']);
$num = mysql_num_rows(mysql_query("SELECT * FROM `bots` WHERE `id` = '".$key."' LIMIT 1"));
$bot = mysql_fetch_assoc(mysql_query("SELECT * FROM `bots` WHERE `id` = '".$key."' LIMIT 1"));
$bot_speech = mysql_query("SELECT * FROM `bots_speech` WHERE `bot_id` = '".$key."'");
$bot_response = mysql_query("SELECT * FROM `bots_responses` WHERE `bot_id` = '".$key."'");
$user_bot = mysql_fetch_assoc(mysql_query("SELECT * FROM `user_bots` WHERE `bot_id` = '".$key."'"));
$use = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `look` = '".$bot['look']."' LIMIT 1"));
if(is_numeric($key)) {
if($num > 0) {
if($us['id'] == $user_bot['userid']) {
?>
<h1 align="center">Bot-Panel (bearbeiten)</h1>
<?php echo $msg; ?><br />
<table style="border-collapse: collapse;" cellpadding="5" width="100%">
<form action="botpanel.php?do=edit&key=<?php echo $key; ?>" method="post">
<tr id="tablehead">
<th colspan="2"><font color="white">Deinen Bot bearbeiten</font></th>
</tr>
<tr id="tablehead">
<th colspan="2"><font color="white">Allgemeins</font></th>
</tr>
<tr id="tabletuch2">
<td>Name des Bots:</td>
<td><input value="<?php echo $bot['name']; ?>" type="text" name="name" maxlength="32" /></td>
</tr>
<tr id="tabletuch2">
<td>Mission:</td>
<td><input value="<?php echo $bot['motto']; ?>" type="text" name="mission" maxlength="64" /></td>
</tr>
<tr id="tabletuch2">
<td valign="top">Bewegungsart: <a onClick="alert('Freies Bewegen: Der Bot läuft frei im Raum herum. Stand: Der Bot bleibt nur an einer Stelle stehen.');">(?)</a></td>
<td><input type="radio" value="freeroam" name="movetype" <?php if($bot['walk_mode'] == "freeroam") { ?> checked <?php } ?>> Freies Bewegen<br />
<input type="radio" value="stand" name="movetype" <?php if($bot['walk_mode'] == "stand") { ?> checked <?php } ?>> Stand</td>
</tr>
<tr id="tabletuch2">
<td valign="top">Start- oder Standort <a onClick="alert('Der Ort an dem der Bot stehen soll bzw. anfangen soll zu laufen. Tipp: Gehe in ein Raum, stehe dort hin wo der Bot stehen soll und gebe :coords ein. Die darauf folgende Ausgabe gibts Du hier ein!');">(?)</a></td>
<td><input type="text" value="<?php echo $bot['x']; ?>" name="locationX" size="1" /> X<br />
<input type="text" value="<?php echo $bot['y']; ?>" name="locationY" size="1" /> Y<br />
<input type="text" value="<?php echo $bot['z']; ?>" name="locationZ" size="1" /> Z</td>
</tr>
<tr id="tabletuch2">
<td>Aussehen: <a onClick="alert('Gebe hier einen <?php echo $sitename; ?> Namen ein, von dem der Style auf den Bot kopiert werden soll.');">(?)</a></td>
<td><input type="text" value="<?php echo $use['username']; ?>" name="look" /></td>
</tr>
<tr id="tabletuch2">
<td>Raum:</td>
<td><select name="room">
<?php
while($row = mysql_fetch_assoc($rooms)) {
?>
<option value="<?php echo $row['id']; ?>" <?php if($bot['room_id'] == $row['id']) { ?> selected <?php } ?>><?php echo $row['caption']; ?></option>
<?php
}
?>
</select></td>
<tr id="tablehead">
<th colspan="2"><font color="white">Konstante Sprachsätze</font> <a onClick="alert('Hier kannst du deine Sätze bearbeiten, die der Bot in einem bestimmten Zeitraum immer wieder sagt. Du musst nicht alle 5 Sätze verwenden. Wenn du den Text frei lässt, wird dieser nicht vom Bot gesprochen, doch du behälst deine Anzahl an texten!');">(?)</a></th>
</tr>
<?php
$i = 0;
while($row = mysql_fetch_assoc($bot_speech)) {
$i++;
?>
<tr id="tabletuch2">
<td>Text #<?php echo $i; ?>:</td>
<td><input type="text" value="<?php echo $row['text']; ?>" name="konst_text[]" size="25" /><select name="konst_type[]"><option value="0" <?php if($row['shout'] == 0) { ?> selected <?php } ?>>Sagen</option><option value="1" <?php if($row['shout'] == 1) { ?> selected <?php } ?>>Schreien</option></select></td>
</tr>
<?php
}
?>
<?php
for($r = $i; $r < $user_bot['speech']; $r++) {
?>
<tr id="tabletuch2">
<td>Text #<?php echo $r+1; ?>:</td>
<td><input type="text" name="konst_text[]" size="25" /><select name="konst_type[]"><option value="0">Sagen</option><option value="1">Schreien</option></select></td>
</tr>
<?php
}
?>
<tr id="tablehead">
<th colspan="2"><font color="white">Sprachgesteuerte Sätze</font> <a onClick="alert('Hier kannst du wieder deine Sätze bearbeiten, die von einem User mit bestimmten Wörtern auslöst. Du kannst mehrere Wörter auswählen in dem du sie mit ; trennst. z.B. hallo;krass;geil ...');">(?)</a></th>
</tr>
<?php
$i = 0;
$num = mysql_num_rows($bot_response);
while($row = mysql_fetch_assoc($bot_response)) {
$i++;
?>
<tr id="tabletuch2">
<td>Wörter #<?php echo $i; ?>:</td>
<td><input type="text" name="words[]" value="<?php echo $row['keywords']; ?>"></td>
</tr>
<tr id="tabletuch2">
<td>Text #<?php echo $i; ?>:</td>
<td><input type="text" name="sprach_text[]" size="25" value="<?php echo $row['response_text']; ?>" /><select name="sprach_type[]"><option value="say" <?php if($row['mode'] == "say") { ?> selected <?php } ?>>Sagen</option><option value="whisper" <?php if($row['mode'] == "whisper") { ?> selected <?php } ?>>Flüstern</option><option value="shout" <?php if($row['mode'] == "shout") { ?> selected <?php } ?>>Schreien</option></select></td>
</tr>
<?php
}
?>
<?php
for($r = $i; $r < $user_bot['responses']; $r++) {
?>
<tr id="tabletuch2">
<td>Wörter #<?php echo $r+1; ?>:</td>
<td><input type="text" name="words[]"></td>
</tr>
<tr id="tabletuch2">
<td>Text #<?php echo $r+1; ?>:</td>
<td><input type="text" name="sprach_text[]" size="25" /><select name="sprach_type[]"><option value="say" selected>Sagen</option><option value="whisper">Flüstern</option><option value="shout">>Schreien</option></select></td>
</tr>
<?php
}
?>
<tr id="tablebott">
<td colspan="2"><input type="submit" value="Bearbeiten" style="width: 100%; font-size: 14pt;" /></td>
</tr>
</table>
<?php
} else {
$msg = "<div class='rounded rounded-red'><center>Bot gibt es nicht!</center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Bot gibt es nicht!</font>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Falscher Key!</font>";
}
} elseif(isset($_GET['mode']) && $_GET['mode'] == "addtexts" && isset($_GET['key'])) {
$key = intval($_GET['key']);
$num = mysql_num_rows(mysql_query("SELECT * FROM `bots` WHERE `id` = '".$key."' LIMIT 1"));
$fetch = mysql_fetch_assoc(mysql_query("SELECT * FROM `user_bots` WHERE `bot_id` = '".$key."' LIMIT 1"));
if(is_numeric($key)) {
if($num > 0) {
if($fetch['userid'] == $us['id']) {
?>
<h1 align="center">Texte hinzufügen</h1>
<i>Hier kannst du weitere Texte für dein Bot hinzufügen. Diese bleiben für immer bestehen, auch wenn du sie nicht nutzt!</i><br />
<?php echo $msg; ?><br />
<table width="100%" style="border-collapse: collapse;" cellpadding="5">
<form action="./botpanel.php?do=add_konst&key=<?php echo $key; ?>" method="post">
<tr id="tablehead">
<th colspan="2"><font color='white'>Konstanter Text hinzufügen (Kosten: 10 Tickets)</font></th>
</tr>
<tr id="tabletuch2">
<td>Text:</td>
<td><input type="text" name="text" size="23" /><select name="type"><option value="0" selected>Sagen</option><option value="1">Schreien</option></select></td>
</tr>
<tr id="tablebott">
<td colspan="2"><input type="submit" value="Hinzufügen" style="width: 100%; font-size: 10pt;" /></td>
</tr>
</form>
</table><br /><br />
<table width="100%" style="border-collapse: collapse;" cellpadding="5">
<form action="./botpanel.php?do=add_sprach&key=<?php echo $key; ?>" method="post">
<tr id="tablehead">
<th colspan="2"><font color='white'>Sprachgesteuerter Text hinzufügen (Kosten: 15 Tickets)</font></th>
</tr>
<tr id="tabletuch2">
<td>Wörter:</td>
<td><input type="text" name="words" /></td>
</tr>
<tr id="tabletuch2">
<td>Text:</td>
<td><input type="text" name="text" size="23" /><select name="type"><option value="say" selected>Sagen</option><option value="whisper">Flüstern</option><option value="shout">Schreien</option></select></td>
</tr>
<tr id="tablebott">
<td colspan="2"><input type="submit" value="Hinzufügen" style="width: 100%; font-size: 10pt;" /></td>
</tr>
</form>
</table><br />
<?php
} else {
$msg = "<div class='rounded rounded-red'><center>Bot gibt es nicht!</center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Bot gibt es nicht!</center></div><br>";
}
} else {
$msg = "<div class='rounded rounded-red'><center>Falscher Key!</center></div><br>";
}
}
?>
</div></div></div></div>
<div id="column2" class="column">
<div class="habblet-container">
<div class="cbb clearfix green">
<h2 class="title">Deine Bots</h2>
<div class="habblet box-content">
<table border="0" style="border-collapse:collapse;" width="100%">
<?php
$count = 0;
$get_vip = mysql_query("SELECT * FROM `user_bots` WHERE `userid` = '".$my_id."' ORDER BY id DESC"); while($row = mysql_fetch_assoc($get_vip)){ ?>
<?php
$usdat = mysql_fetch_assoc(mysql_query("SELECT * FROM `bots` WHERE `id` = '".$row['bot_id']."' LIMIT 1"));
$count++;
if($count % 2 == 0) {
echo "<tr>";
} else {
echo "<tr id='tablebott2'>";
}
?>
<td>
<img align="left" style="margin-top: -15px; left: -50px;" src="<?php echo $avatar; echo $usdat['look']; ?>&size=b&direction=4&head_direction=3&gesture=sml&effect=2" width="64" height="110" />
</td>
<td valign="top">
<b>Name:</b> <?php echo $usdat['name']; ?><br>
<b>Mission:</b> <?php echo $usdat['motto']; ?><br />
<a href="./botpanel.php?mode=addtexts&key=<?php echo $usdat['id']; ?>">Texte hinzufügen</a><br />
<a href="./botpanel.php?mode=edit&key=<?php echo $usdat['id']; ?>">Bearbeiten</a><br />
<a href="./botpanel.php?do=delete&id=<?php echo $usdat['id']; ?>">Löschen</a>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div></div></div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
<?php require_once('./templates/community_footer.php'); ?>
Alles anzeigen