View file dl/add.php

File size: 1.25Kb
<?php

include_once 'sys/cons.php';
include_once 'sys/funct.php';
include_once "sys/lang/$language.php";


$date=date("d.m.y");
$time=date("H:i"); 
$str=strlen(trim($msg));
$str2=strlen(trim($nick));

if($comm_del_on==1){
$file=file(BASE."dati/$vards.comm");
$i = count($file);
if ($i>=$comm_automatic_del) {
clear_dat(BASE."dati/$vards.comm");
}}


if($msg=="" || $str<6 ){
header ("Location: about.php?act=comm&fails=$fails&vards=$vards&mape=$mape&msg=strlen&"); exit;}
if($nick !== "" || !$str2 < 2 ){

$brow=parbaude($brow);
$msg=wordwrap($msg,150,' ',1);
$msg=substr($msg,0,1200);
$msg=parbaude($msg);
$name=parbaude($nick);

	
////////////////////////////////////////
if($trans=="y"){$msg=$transs($msg);}
////////////////////////////////////////
$text=$msg.'|'.$nick.'|'.$date.'|'.$time.'|'.$brow.'|'.$ip.'|';
$text=preg_replace ("|[\r\n]+|si","",$text);

$fp=fopen(BASE."dati/$vards.comm","a+");
flock ($fp,LOCK_EX);
fputs($fp,"$text\r\n");
flock ($fp,LOCK_UN);
fclose($fp);
chmod (BASE."dati/$vards.comm", 0666);

header ("Location: about.php?act=comm&fails=$fails&vards=$vards&mape=$mape&msg=commadd");

}else{header ("Location: about.php?act=comm&fails=$fails&vards=$vards&mape=$mape&msg=strlenick&"); exit;
}

?>