Просмотр файла Soo_by_las/comm/apanell.php

Размер файла: 3.15Kb
<?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'])!=""){
$them = check($_GET['them']);
$soo = check($_GET['soo']);
$name = check($_POST['name']);
$mess = check($_POST['mess']);
$priv = check($_POST['priv']);
$pol = check($_POST['pol']);
$file = check($_POST['file']);


$avat_size=$_FILES['file']['size'];
$avat_name=$_FILES['file']['name'];
$av_file = file($_FILES['file']['tmp_name']);
$av_string = substr($av_file[0], 0, 3);
$ext = strtolower(substr($avat_name, 1 + strrpos($avat_name, ".")));
$mn=substr_count("$avat_name",".");
if($av_file){
if($ext=="jpg"||$ext=="gif"){
if($avat_size>=0 && $avat_size<=7000){
copy($_FILES['file']['tmp_name'], "logo/$them.gif");
chmod("logo/$them"."gif", 0777);
}else{echo'Ошибка, недопустимый вес картинки! Разрешается загружать картинки весом до 7 килобайт <br>';exit;}
}else{echo'Ошибка, недопустимое расширение файла! Разрешается загружать картинки только в формате .jpg .gif <br>';exit;}}
$autor=check($autor);
$content ="$autor";
fputs($omf,"$content\r\n");
fclose($omf);
 
$name=substr($name,0,40);
$mess=substr($mess,0,500);
$priv=substr($priv,0,140);

//------------------------------ Запись в профиль ----------------------------//
$ufile = file_get_contents(BASEDIR."local/comm/$them.soo"); 
$udata = explode(":||:",$ufile);
$udata[1]=check(no_br($name));
$udata[2]=check(no_br($mess));
$udata[5]=check(no_br($pol)); 
$udata[6]=check(no_br($priv)); 
for ($u=0; $u<30; $u++){
$utext.=$udata[$u].':||:';}
$fp=fopen(BASEDIR."local/comm/$them.soo","a+");
flock($fp,LOCK_EX);   
ftruncate($fp,0);                                                                 
fputs($fp,$utext);
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);  
unset($utext);


header ("Location: view.php?soo=$soo&them=$them&isset=editprofil&".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";               
?>