<?php
#-----------------------------------------------------#
# ****** Сообщества ****** #
# Site : http://cobwap.net #
# E-mail : [email protected] #
# Для связи : 8(909)651-0-222 #
# ICQ : 384181109 #
# Автор скрипта : LAS #
#-----------------------------------------------------#
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";
if ($provlog==$_SESSION['log'] && $provpar==md5($_SESSION['par']) && $_SESSION['log']!="" && md5($_SESSION['par'])!=""){
$soo=check($soo);
$them=check($them);
$soo = $_GET['soo'];
$them = $_GET['them'];
$mess = check($_POST['mess']);
$name = check($_POST['name']);
if(strlen(trim($name))<6 || strlen(trim($mess))<20 ){header ("Location: index.php?isset=posts&".SID); exit;}
//--------------------- Новый антифлуд -----------------------------//
if($config_floodstime > 0){
if(flooder($ip, $php_self) == TRUE ){header ("Location: index.php?isset=antiflood&".SID); exit;}
$flood_file = fopen(BASEDIR."local/flood.dat", "a+");
flock ($flood_file,LOCK_EX);
fputs ($flood_file,"$sitetime|$ip|$php_self|\r\n");
fflush($flood_file);
flock ($flood_file,LOCK_UN);
fclose($flood_file);}
//--------------------- Карантин -----------------------------//
if($config_karantin > 0){
if($udata[6]+$config_karantin>$sitetime){header ("Location: index.php?isset=karantin&".SID); exit;}}
$name=check($name);
$mess=check($mess);
$mess=substr($mess,0,700);
$mess = antimat($mess);
$mess = smiles($mess);
$mess=no_br($mess,"<br>");
$idd=rand(10000000,99999999);
$file="$log:||:$name:||:$mess:||:$soo:||:$sitetime:||:1:||::||::||::||::||::||::||::||:";
$fm=fopen(BASEDIR."local/comm/$idd.soo","a");
flock($fm,LOCK_EX);
fputs($fm,"$file");
fflush($fm);
flock($fm,LOCK_UN);
fclose($fm);
chmod (BASEDIR."local/comm/$idd.soo", 0666);
$textreg1=''.$log.'|'.$sitetime.'|||';
$fp1=fopen(BASEDIR."local/comm/$idd.use","w");
flock($fp1,LOCK_EX);
fputs($fp1,"$textreg1\r\n");
fflush($fp1);
flock($fp1,LOCK_UN);
fclose($fp1);
$textreg1=''.$idd.'|'.$sitetime.'';
$fp1=fopen(BASEDIR."local/commuse/$log.use","a+");
flock($fp1,LOCK_EX);
fputs($fp1,"$textreg1\r\n");
fflush($fp1);
flock($fp1,LOCK_UN);
fclose($fp1);
$textreg=''.$idd.'|'.$name.'|'.$mess.'|'.$soo.'|'.$sitetime.'';
$fp=fopen(BASEDIR."local/comms/$soo/file.dat","a+");
flock($fp,LOCK_EX);
fputs($fp,"$textreg\r\n");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
$textreg0=''.$idd.'|'.$name.'|'.$mess.'|'.$soo.'|'.$sitetime.'';
$fp0=fopen("local/new.dat","w");
flock($fp0,LOCK_EX);
fputs($fp0,"$textreg0\r\n");
fflush($fp0);
flock($fp0,LOCK_UN);
fclose($fp0);
if(!is_dir(BASEDIR."local/commforum/$idd")){
if(mkdir(BASEDIR."local/commforum/$idd", 0777)){
chmod(BASEDIR."local/commforum/$idd/", 0777);
}}
if(!is_dir(BASEDIR."local/commgallery/$idd")){
if(mkdir(BASEDIR."local/commgallery/$idd", 0777)){
chmod(BASEDIR."local/commgallery/$idd/", 0777);
}}
//------------------------------ Запись в профиль ----------------------------//
$ufile = file_get_contents(BASEDIR."local/profil/$log.prof");
$udata = explode(":||:",$ufile);
$udata[14]=$ip;
for ($u=0; $u<$config_userprofkey; $u++){
$utext.=$udata[$u].':||:';}
if($udata[0]!="" && $udata[1]!="" && $udata[4]!="" && $utext!=""){
$fp=fopen(BASEDIR."local/profil/$log.prof","a+");
flock($fp,LOCK_EX);
ftruncate($fp,0);
fputs($fp,$utext);
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
unset($utext);
}
header ("Location: index.php?soo=$soo&them=$them&".SID); exit;
}else{echo '<br>Вы не выполнили <a href="../pages/vhod.php?'.SID.'">вход</a></b> или в начале вам нужно <b> <a href="../pages/registration.php?'.SID.'">зарегистрироваться</a></b><br> ';}
include_once"../themes/$config_themes/foot.php";
?>