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

Размер файла: 2.97Kb
<?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 ($_SESSION['log']!="" && md5($_SESSION['par'])!="" && md5($_SESSION['par'])==$provpar && $_SESSION['log']==$provlog ) {
echo '<img src="../images/img/partners.gif" alt=""> <b>Новости</b><br><br>';
$them = check($_GET['them']);
$soo = check($_GET['soo']);
$themes = check($_POST['themes']);
$msg = check($_POST['msg']);

if($them!="" && !eregi("[^0-9-]",$them)){
$text = file(BASEDIR."local/comm/$them.soo"); 
if ($text!=""){
$uzdata = explode(":||:",$text[0]);

if(!empty($msg) && !empty($themes)){
$themes=check($themes);	
$msg=check($msg);	
$msg=no_br($msg,"<br>");
if($trans=="y"){
$themes=transliter($themes);
$msg=transliter($msg);}	
$msg = smiles($msg);
$file = file("../local/commnews/$them.dat");
$total = count($file);
$total = $total - 1;
$data1 = explode("|",$file[$total]);
$me=round($data1[5]+1);
$text=$themes.'|'.$msg.'||'.$sitetime.'|'.$log.'|'.$me.'|';
$text=no_br($text);
$fp=fopen("../local/commnews/$them.dat","a+");
flock ($fp,LOCK_EX);
fputs($fp,"$text\r\n");
flock ($fp,LOCK_UN);
fclose($fp);
chmod($fp, 0777);
chmod("../local/commnews/$them.dat", 0777);

}else{header ("Location: news.php?soo=$soo&them=$them&".SID); exit;}
header ("Location: news.php?soo=$soo&them=$them&".SID);




} else {echo '<img src="../images/img/error.gif" alt=""> Сообщество не существует!<br>';}
} else {echo '<img src="../images/img/error.gif" alt=""> Произошла ошибка. Сообщество не существует!<br>';}
}else{echo '<br>Вы не выполнили <a href="../pages/vhod.php?'.SID.'">вход</a></b> или в начале вам нужно <b> <a href="../pages/registration.php?'.SID.'">зарегистрироваться</a></b><br> ';}
echo'<br><br><img src="../images/img/back.gif" alt=""> <a href="view.php?soo='.$soo.'&them='.$them.'&'.SID.'">Назад</a>';
echo'<br><img src="../images/img/back.gif" alt=""> <a href="index.php?'.SID.'">Сообщества</a>';
echo'<br><img src="../images/img/homepage.gif" alt=""> <a href="../index.php?'.SID.'">На главную</a>';
include_once"../themes/$config_themes/foot.php";               
?>