definicijama za smajlije tj kratki naziv i to cijeli sadrzaj fajla
room.php
Code:
// REMOVING ADVERTS
if ($adv == 1 && $level < 4) {
$msg = eregi_replace("((([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z;]{2,3}))|(([0-9]{1,3}\.){3}([0-9]{1,3})))((/|\?)[a-z0-9~#%&'_\+=:;\?\.-]*)*)", "censored", $msg);
}
// SMILES
include "smiles.php";
$msg = preg_replace($smiles_array, $smile, $msg, 2);
if ($level == 4) {
$msg = preg_replace("|\*\((.*)\)\*|isU", "<b>\\1</b>", $msg);
}
$msg = mysql_escape_string($msg);
$sql = mysql_query("SELECT `msg` FROM `chat" . $rid . "` WHERE `aid` = '" . $id . "' ORDER BY `id` DESC LIMIT 1;");
$last_msg = mysql_escape_string(mysql_result($sql, 0));
// INSERTING MESSAGE
if ($last_msg != $msg && !empty($msg)) {
$to = (int)$_POST['to'];
$sql = mysql_query("INSERT INTO `chat" . $rid . "` VALUES(0, '" . $id . "', '" . $nickname . "', '<beginning>" . $msg . "', '" . $to . "', '" . date("H:i") . "'," . time() . ");");
//CLearing rooms
if (mysql_insert_id() > 4000000000) {
mysql_query("TRUNCATE TABLE `chat" . $rid . "`;");
$message = "Db flooded with messages.";
$sql = mysql_query("SELECT `id` FROM `chat_rooms`;");
while ($room_id = mysql_fetch_array($sql)) {
mysql_query("INSERT INTO `chat" . $rid . "` VALUES(0, '5', '" . $bots[3] . "', '" . $message . "', '0', '" . date("H:i:s") . "'," . time() . ");");
}
}
//END of CLearing rooms
// if (!$sql) {
// $sql = mysql_query("INSERT INTO `chat" . $rid . "` VALUES(0, '" . $id . "', '" . $nickname . "', '<beginning>" . $msg . "', '" . $to . "', '" . date("H:i") . "', " . time() . ");");
// }
mysql_query("UPDATE `chat_users` SET `posts` = `posts` + 1 WHERE `id` = '" . $id . "';");
// if ($rid == 1) include "bots/answer.php";
// if ($rid == 3) include "bots/second_answer.php";
}
// END of INSERTING MESSAGE
// REMOVING ADVERTS
if ($adv == 1 && $level < 4) {
$msg = eregi_replace("((([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z;]{2,3}))|(([0-9]{1,3}\.){3}([0-9]{1,3})))((/|\?)[a-z0-9~#%&'_\+=:;\?\.-]*)*)", "censored", $msg);
}
// SMILES
include "smiles.php";
$msg = preg_replace($smiles_array, $smile, $msg, 2);
if ($level == 4) {
$msg = preg_replace("|\*\((.*)\)\*|isU", "<b>\\1</b>", $msg);
}
$msg = mysql_escape_string($msg);
$sql = mysql_query("SELECT `msg` FROM `chat" . $rid . "` WHERE `aid` = '" . $id . "' ORDER BY `id` DESC LIMIT 1;");
$last_msg = mysql_escape_string(mysql_result($sql, 0));
// INSERTING MESSAGE
if ($last_msg != $msg && !empty($msg)) {
$to = (int)$_POST['to'];
$sql = mysql_query("INSERT INTO `chat" . $rid . "` VALUES(0, '" . $id . "', '" . $nickname . "', '<beginning>" . $msg . "', '" . $to . "', '" . date("H:i") . "'," . time() . ");");
//CLearing rooms
if (mysql_insert_id() > 4000000000) {
mysql_query("TRUNCATE TABLE `chat" . $rid . "`;");
$message = "Db flooded with messages.";
$sql = mysql_query("SELECT `id` FROM `chat_rooms`;");
while ($room_id = mysql_fetch_array($sql)) {
mysql_query("INSERT INTO `chat" . $rid . "` VALUES(0, '5', '" . $bots[3] . "', '" . $message . "', '0', '" . date("H:i:s") . "'," . time() . ");");
}
}
//END of CLearing rooms
// if (!$sql) {
// $sql = mysql_query("INSERT INTO `chat" . $rid . "` VALUES(0, '" . $id . "', '" . $nickname . "', '<beginning>" . $msg . "', '" . $to . "', '" . date("H:i") . "', " . time() . ");");
// }
mysql_query("UPDATE `chat_users` SET `posts` = `posts` + 1 WHERE `id` = '" . $id . "';");
// if ($rid == 1) include "bots/answer.php";
// if ($rid == 3) include "bots/second_answer.php";
}
// END of INSERTING MESSAGE
mada mi se cini da i ovaj dio " // REMOVING ADVERTS" isto nije u redu
smilies.php
Code:
<?
$smiles_array = array(
"'\.smile\.'",
);
//------------------------
$smile = array(
"<img src=\"smiles/001.gif\" alt=\"smile\"/>",
);
?>
<?
$smiles_array = array(
"'\.smile\.'",
);
//------------------------
$smile = array(
"<img src=\"smiles/001.gif\" alt=\"smile\"/>",
);
?>
e sad kada maknem onja dio oko samjlija "include "smiles.php"; $msg = preg_replace($smiles_array, $smile, $msg, 2);" sve radi dobro , a greska je sledece sadrzine:
", "\"oops\"/", "\"xexe\"/" ............. ); ?>
Hvala na svakoj pomoci ... unapred
vidovic-slobodan.blogspot.com