*/
/* Original script by Nicola Delbono */
/* Added time, users management, private messages, */
/* ip banning, bad words filter, kicking */
/* and more improvements by */
/* juancarlos@develooping.com */
/* version 1.6.4 */
?>
", " ", $person);
$person = trim ($person);
$person = stripslashes ($person);
?>
&output=
= $total_lenght){
$u = $a - $review_lenght;
$msg_old="";
for($i = $u; $i <= $a ;$i++){
$msg_old = $msg_old.strval($lines[$i]);
}
$fchat = fopen($chat_file_ok, "w");
$fwchat = fwrite($fchat, $msg_old);
fclose($fchat);
}
/* write message to $chat_file_ok */
/* ------------------------------ */
$msg = str_replace ("\n"," ", $message);
$msg = stripslashes ($msg);
$msg = htmlspecialchars ($msg);
//accepted tags
$msg = str_replace("<b>","",$msg);
$msg = str_replace("<B>","",$msg);
$msg = str_replace("</b>","",$msg);
$msg = str_replace("</B>","",$msg);
$msg = str_replace("<i>","",$msg);
$msg = str_replace("<I>","",$msg);
$msg = str_replace("</i>","",$msg);
$msg = str_replace("</I>","",$msg);
//close unclosed tags //
$countb=substr_count($msg, "");
$count_b=substr_count($msg, "");
$counti=substr_count($msg, "");
$count_i=substr_count($msg, "");
function strlastpos($haystack, $needle) {
if (strstr($haystack, $needle)){
return strlen($haystack) - strlen($needle) - strpos(strrev($haystack), strrev($needle));
}else{
return -1;
}
}
$lastb = strlastpos($msg,"");
$lasti = strlastpos($msg,"");
if ($lastb>$lasti){
for($addb = $count_b; $addb < $countb ;$addb++){
if($msg!=""){
$msg .="";
}
}
for($addb = $count_i; $addb < $counti ;$addb++){
if($msg!=""){
$msg .="";
}
}
}
if ($lasti>$lastb){
for($addb = $count_i; $addb < $counti ;$addb++){
if($msg!=""){
$msg .="";
}
}
for($addb = $count_b; $addb < $countb ;$addb++){
if($msg!=""){
$msg .="";
}
}
}
//insert links
function InsertLinks ( $Text )
{
// First match things beginning with http:// (or other protocols)
$NotAnchor = '(?$0", $Text );
// Now match things beginning with www.
$NotAnchor = '(?$0", $Result );
}
$msg = InsertLinks( $msg );
//replace emoticons
$msg=str_replace (":)","b", $msg);
$msg=str_replace (":|","c", $msg);
$msg=str_replace (";)","d", $msg);
$msg=str_replace (":D","e", $msg);
$msg=str_replace (":O","f", $msg);
$msg=str_replace (":o","f", $msg);
$msg=str_replace (":P","g", $msg);
$msg=str_replace (":(","h", $msg);
$msg=str_replace (":S","i", $msg);
$msg=str_replace ("8)","j", $msg);
//end replace emoticons
/* filter bad words */
/* ----------------- */
$number_of_bad_words = count($words_to_filter);
for($i = 0; $i <= $number_of_bad_words ;$i++){
if (strval($words_to_filter[$i])!=""){
$msg = eregi_replace(strval($words_to_filter[$i]),$replace_by,$msg);
}
}
if (ereg ("$private_message_expression", $msg, $regs) and ereg ("\(de $password a", $msg)){ // is a private message
$receiver = strval($regs[1])."\n";
$lines = file($users_file);
$a = count($lines);
$follow = 1;
for($i = 0; $i <= $a ;$i++){
if (strval($lines[$i]) == $receiver){
$add = rtrim(strval($lines[$i+1]));//read the password of receiver
$follow = 0;
}else{
if ($follow==1){
$add = " eztezamarchaoynoezta";// receiver is not in the room
}}
}
$msg .= $add;
}
if ($msg != ""){
$text_to_write = date ("(H:i:s)",time()+$correct_time)." ".$person." : ".$msg."\n";//compound single message
$fchat1 = fopen($chat_file_ok, "a");
$fwchat1 = fwrite($fchat1, "$text_to_write");// message is appended to the msg.txt file
fclose($fchat1);
}
/* reads the last $chat_lenght lines of $chat_file_ok */
/* -------------------------------------------------- */
$lines = file($chat_file_ok);
$a = count($lines);
$u = $a - $chat_lenght;
/* check the text order */
/* -------------------- */
if ($text_order == "up"){
for($i = $a; $i >= $u ;$i--){
$is_private = 0;
$show_message = 1;
$line_value= strval($lines[$i]);
$string_to_add="";
/* output to the chat private and general messages */
/* ----------------------------------------------- */
if (ereg($private_message_expression, $line_value, $name) and ereg("\(de (.*) a (.*)$", $line_value, $pass)){// is a private message
$senderpassword=strval($pass[1]);
$receiverpassword=strval($pass[2]);
$receivername=strval($name[1]);
$is_private = 1;
$show_message = 0;
}
if ($is_private == 1){
if (($receivername==$person) and ereg("(.)?$password(\n)?", $receiverpassword)){//is the receiver
$line_value = ereg_replace( "\(de (.*) a (.*)$", "\n", $line_value);
echo substr(urlencode($line_value),$substart);//show message
} elseif(ereg("\(..:..:..\) $person :", $line_value) and ereg("(.)?$password", $senderpassword)){//is the sender
if (ereg("(.)?eztezamarchaoynoezta(\n)?", $receiverpassword)) {$string_to_add = $not_here_string;}
$line_value = ereg_replace( "\(de (.*) a (.*)$", "$string_to_add\n", $line_value);
echo substr(urlencode($line_value),$substart);//show message
}else{
$u--;
$show_message = 0;
}
}
if ($show_message == 1) {// is a general message
if ((ereg($bye_user,$line_value)) or (ereg($enter_string,$line_value))){
echo urlencode ($line_value);//show time only if user enters or exits
}
else{
echo substr(urlencode($line_value),$substart);//show message
}
}
}
}
else{
for($i = $u; $i <= $a ;$i++){
$is_private = 0;
$show_message = 1;
$line_value= strval($lines[$i]);
$string_to_add="";
/* output to the chat private and general messages */
/* ----------------------------------------------- */
if (ereg($private_message_expression, $line_value, $name) and ereg("\(de (.*) a (.*)$", $line_value, $pass)){// is a private message
$senderpassword=strval($pass[1]);
$receiverpassword=strval($pass[2]);
$receivername=strval($name[1]);
$is_private = 1;
$show_message = 0;
}
if ($is_private == 1){
if (($receivername==$person) and ereg("(.)?$password(\n)?", $receiverpassword)){//is the receiver
$line_value = ereg_replace( "\(de (.*) a (.*)$", "\n", $line_value);
echo substr(urlencode($line_value),$substart);//show message
} elseif(ereg("\(..:..:..\) $person :", $line_value) and ereg("(.)?$password", $senderpassword)){//is the sender
if (ereg("(.)?eztezamarchaoynoezta(\n)?", $receiverpassword)) {$string_to_add = $not_here_string;}
$line_value = ereg_replace( "\(de (.*) a (.*)$", "$string_to_add\n", $line_value);
echo substr(urlencode($line_value),$substart);//show message
}else{
$u--;
$show_message = 0;
}
}
if ($show_message == 1) {// is a general message
if ((ereg($bye_user,$line_value)) or (ereg($enter_string,$line_value))){
echo urlencode ($line_value);//show time only if user enters or exits
}
else{
echo substr(urlencode($line_value),$substart);//show message
}
}
}
}
}
echo "&order=";
echo $text_order;
?>
Partneroldalak:
Domain regisztráció tár és szerverszolgáltatások: domain domainnév tárhely e-mail, imap, pop3
www.webtar.hu
www.micropay.hu
www.ingyenweb.hu
www.videok.hu
www.antikvárium.hu
www.ftpdir.hu
www.fotók.hu
www.randi.hu
www.licit.hu
www.napivicc.hu
www.gyertyalang.hu
www.helyesírás.hu
Domain regisztráció