mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-30 07:07:14 +00:00
fix chat system by SalmonPlus
This commit is contained in:
+9
-7
@@ -183,7 +183,7 @@ if (!isset($SAJAX_INCLUDED)) {
|
|||||||
|
|
||||||
uri = "<?php echo $sajax_remote_uri; ?>";
|
uri = "<?php echo $sajax_remote_uri; ?>";
|
||||||
if (sajax_request_type == "GET") {
|
if (sajax_request_type == "GET") {
|
||||||
|
// alert(args);
|
||||||
if (uri.indexOf("?") == -1)
|
if (uri.indexOf("?") == -1)
|
||||||
uri += "?rs=" + escape(func_name);
|
uri += "?rs=" + escape(func_name);
|
||||||
else
|
else
|
||||||
@@ -191,9 +191,9 @@ if (!isset($SAJAX_INCLUDED)) {
|
|||||||
uri += "&rst=" + escape(sajax_target_id);
|
uri += "&rst=" + escape(sajax_target_id);
|
||||||
uri += "&rsrnd=" + new Date().getTime();
|
uri += "&rsrnd=" + new Date().getTime();
|
||||||
|
|
||||||
for (i = 0; i < args.length-1; i++)
|
for (i = 0; i < args.length-1; i++) {
|
||||||
uri += "&rsargs[]=" + escape(args[i]);
|
uri += "&rsargs[]=" + args[i];
|
||||||
|
}
|
||||||
post_data = null;
|
post_data = null;
|
||||||
}
|
}
|
||||||
else if (sajax_request_type == "POST") {
|
else if (sajax_request_type == "POST") {
|
||||||
@@ -352,13 +352,15 @@ if (!isset($SAJAX_INCLUDED)) {
|
|||||||
function add_data($data) {
|
function add_data($data) {
|
||||||
global $session,$database;
|
global $session,$database;
|
||||||
|
|
||||||
$data = explode("|",$data);
|
//$data = explode("|",$data);
|
||||||
|
if (is_array($data)){$msg = htmlspecialchars($data[1]);}else{$msg = htmlspecialchars($data);};
|
||||||
|
// $msg=htmlspecialchars($msg);
|
||||||
$name = $session->username;
|
$name = $session->username;
|
||||||
$msg = htmlspecialchars($data[1]);
|
|
||||||
$id_user = $session->uid;
|
$id_user = $session->uid;
|
||||||
$alliance = $session->alliance;
|
$alliance = $session->alliance;
|
||||||
$now = time();
|
$now = time();
|
||||||
$q = "INSERT into ".TB_PREFIX."chat (id_user,name,alli,date,msg) values ('$id_user','$name','$alliance','$now','$msg')";
|
echo $q = "INSERT into ".TB_PREFIX."chat (id_user,name,alli,date,msg) values ('$id_user','$name','$alliance','$now','$msg')";
|
||||||
mysql_query($q, $database->connection);
|
mysql_query($q, $database->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,10 @@ if(isset($_POST)){
|
|||||||
$_POST = array_map('htmlspecialchars', $_POST);
|
$_POST = array_map('htmlspecialchars', $_POST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$rsargs=$_GET['rsargs'];
|
||||||
$_GET = array_map('mysql_real_escape_string', $_GET);
|
$_GET = array_map('mysql_real_escape_string', $_GET);
|
||||||
$_GET = array_map('htmlspecialchars', $_GET);
|
$_GET = array_map('htmlspecialchars', $_GET);
|
||||||
|
$_GET['rsargs']=$rsargs;
|
||||||
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
|
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
|
||||||
$_COOKIE = array_map('htmlspecialchars', $_COOKIE);
|
$_COOKIE = array_map('htmlspecialchars', $_COOKIE);
|
||||||
|
|
||||||
$rsargs=$_GET['rsargs'];
|
|
||||||
$_GET = array_map('mysql_real_escape_string', $_GET);
|
|
||||||
$_GET = array_map('htmlspecialchars', $_GET);
|
|
||||||
$_GET['rsargs']=$rsargs;
|
|
||||||
?>
|
?>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
////////////// made by TTMTT //////////////
|
////////////// made by TTMTT //////////////
|
||||||
ob_start();
|
|
||||||
if(isset($aid)) {
|
if(isset($aid)) {
|
||||||
$aid = $aid;
|
$aid = $aid;
|
||||||
}
|
}
|
||||||
@@ -20,14 +20,17 @@ function show_data_cb(text) { document.getElementById("masnun").innerHTML = text
|
|||||||
function start_it() { x_get_data(show_data_cb); setTimeout("start_it()",1000); }
|
function start_it() { x_get_data(show_data_cb); setTimeout("start_it()",1000); }
|
||||||
function add_cb() {}
|
function add_cb() {}
|
||||||
function send_data() {
|
function send_data() {
|
||||||
|
//alert( document.form1.msg.value);
|
||||||
msg = document.form1.msg.value;
|
msg = document.form1.msg.value;
|
||||||
x_add_data(name +"|"+msg,add_cb); }
|
//alert(msg);
|
||||||
|
//x_add_data(name +"|"+msg,add_cb);
|
||||||
|
x_add_data(msg,add_cb);
|
||||||
|
document.form1.msg.value="";
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
|
||||||
if($session->access!=BANNED){
|
|
||||||
?>
|
|
||||||
<body onload="start_it()">
|
<body onload="start_it()">
|
||||||
<form name="form1" onSubmit="send_data()">
|
<form name="form1" onSubmit="send_data()">
|
||||||
<div id="TitleName" class="chatHeader">Ally-Chat</div>
|
<div id="TitleName" class="chatHeader">Ally-Chat</div>
|
||||||
@@ -52,8 +55,3 @@ if($session->access!=BANNED){
|
|||||||
</body>
|
</body>
|
||||||
<div id="rooms">
|
<div id="rooms">
|
||||||
</div>
|
</div>
|
||||||
<?php
|
|
||||||
}else{
|
|
||||||
header("Location: banned.php");
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user