Размер файла: 2.83Kb
<?
include "ini.php";
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";
$text = file("../local/profil/$log.prof");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$provlog=trim($udata[0]);
$provpar=trim($udata[1]);
$privat=trim($udata[10]);}
//////////////////////////////////////////////////////////////////////////////////////
if (md5($_SESSION['par'])!==$provpar || $_SESSION['log']!==$provlog || $_SESSION['log']=="" || md5($_SESSION['par'])=="")
{header ("Location: index.php?".SID."");exit;}
//////////////////////////////////////////////////////////////////////////////////////
if (!isset($_GET['kont']) || $_GET['kont']==''){header ("Location: index.php?".SID."");exit;}
if (!file_exists("../local/datalove/prof/$log.prof")){header ("Location: reg.php?".SID."");exit;}
if (!file_exists("../local/datalove/prof/$kont.prof")){header ("Location: reg.php?".SID."");exit;}
$kontprof=file("../local/datalove/prof/$kont.prof");
$kontprof=explode(":||:", $kontprof[0]);
if ($kontprof[5]=='1')
{$filetop=file("../local/datalove/top_m.dat");}
else
{$filetop=file("../local/datalove/top_zh.dat");}
$filetop_k=count($filetop);
for ($i=0;$i<$filetop_k;$i++)
{
$top=explode(":||:",$filetop[$i]);
if ($top[1]==$log && $top[0]==$kont){$golos='1';}
}
if ($golos!='1')
{
if ($kontprof[5]=='1')
{$fptop=fopen("../local/datalove/top_m.dat","a");}
else
{$fptop=fopen("../local/datalove/top_zh.dat","a");}
flock($fptop,LOCK_EX);
fputs($fptop,"$kont:||:$log:||:\r\n");
fflush($fptop);
flock($fptop,LOCK_UN);
fclose($fptop);
chmod ("../local/datalove/kont/$log.kont", 0666);
if ($kontprof[5]=='1')
{chmod ("../local/datalove/top_m.dat", 0666);}
else
{chmod ("../local/datalove/top_zh.dat", 0666);}
echo "Ваш голос за $kont принят<br />\r\n";
}
else
{
echo "Вы уже голосовали за $kont<br />\r\n";
}
echo "<br />\r\n";
echo "« <a href=\"privat.php?kont=$kont&".SID."\">Вернуться в приват</a><img src=\"lov.gif\" alt=\"\" /><br />\r\n";
echo "« <a href=\"kab.php?".SID."\">Личный кабинет</a><img src=\"kab.gif\" alt=\"\" /><br />\r\n";
echo "« <a href=\"index.php?".SID."\" >Главная</a><img src=\"glav.gif\" alt=\"\" /><br />\r\n";
echo "<hr />\r\n";
echo "« <a href=\"../index.php?".SID."\">На главную</a><br />\r\n";
include_once"../themes/$config_themes/foot.php";
?>