Файл: comment/write.php
Строк: 70
<?
$mail_mess = $mess_;
$mail_name = $namee_;
$namerr = cutty($namee_);
$mailrr = cutty($mail_);
$url_ = trim($url_);
$url_ = stripslashes($url_);
$url_ = str_replace ("<", "<", $url_);
$url_ = str_replace (">", ">", $url_);
$url_ = ereg_replace ('\"', """, $url_);
$url_ = ereg_replace ("\'", """, $url_);
$url_ = ereg_replace (""", """, $url_);
$url_ = ereg_replace ("'", "'", $url_);
$url_ = ereg_replace ("'", "`", $url_);
$url_ = str_replace ("r", "", $url_);
$url_ = str_replace ("n", "<br>", $url_);
$url_ = str_replace ("%", "%", $url_);
$url_ = str_replace ("!", "!", $url_);
$url_ = str_replace ("^ +", "", $url_);
$url_ = str_replace (" +$", "", $url_);
$urlrr = $url_;
$cityrr = cutty($city_);
$messrr = cutty($mess_);
$daterr = time();
$mail_date = mydate($daterr);
if (($f_antispam==$antispam)&&($antispam<>"")||($spamcontrol<>"yes"))
{
$data_gb='foto/data/'.$albom[$ftalb].'/comment.dat';
if(is_file($data_gb) && is_readable($data_gb))
{
$readdata=fopen($data_gb,"r") or die("<p class=error>$leng_comment_ad[0] $data</p>");
$file_array_comment=file("$data_gb");
fclose($readdata);
}
$dfdfafwafhh=1;
for($i=0;$i<=count($file_array_comment);$i++)
{
list($name_foto1,$name1,$city1,$date1,$mail1,$url1,$mess1,$answer1)=explode("::", $file_array_comment[$i]);
if ($name_foto1==$ftnmdoc) { $namehh = split ("|", $name1); $id=$i; $dfdfafwafhh=2; break;}
}
if ($dfdfafwafhh==2)
{
$name13=$name1.'|'.$namerr;
$city13=$city1.'|'.$cityrr;
$date13=$date1.'|'.$daterr;
$mail13=$mail1.'|'.$mailrr;
$url13=$url1.'|'.$urlrr;
$mess13=$mess1.'|'.$messrr;
$answer13=$answer1.'|';
$file_array_comment[$id]="$ftnmdoc::$name13::$city13::$date13::$mail13::$url13::$mess13::$answer13::rn";
if(is_file($data_gb) && is_writable($data_gb)):
$write=fopen($data_gb,"w") or die("<p class=error>$leng_comment_ad[0] $data_gb</p>");
flock($write,2);
foreach($file_array_comment as $key=>$value)
fputs($write,$value);
flock($write,3);
fclose($write);
endif;
}
elseif ($dfdfafwafhh==1)
{
$fffaaa = fopen ($data_gb,"a");
flock ($fffaaa,2);
fputs ($fffaaa,"$ftnmdoc::$namerr::$cityrr::$daterr::$mailrr::$urlrr::$messrr::::rn");
flock ($fffaaa,3);
fclose ($fffaaa);
}
$very_bad = 0;
$ref_url=$PHP_SELF.'?ftalb='.$ftalb.'&photo='.$photo;
}
else
{
$very_bad = 1;
$ref_url=$PHP_SELF.'?ftalb='.$ftalb.'&photo='.$photo.'&messref=1';
}
$mess_ = "";
if (!($time_of_zaderjka==="-1") && $time_of_zaderjka>="0")
{ ?>
<META http-equiv="refresh" content="<?=$time_of_zaderjka;?>; url=<?=$ref_url?>">
<?php
} ?>
</head>
<body bgcolor=<?=$BACKGROUND?> topmargin=15 leftmargin=0 marginwidth=0 marginheight=0>
<table width=<?=$TABWIDTH?> border=0 align="center" cellpadding=2 cellspacing=1 bgcolor=<?=$BORDER;?>>
<tr bgcolor="<?=$LIGHT;?>" class=p>
<td>
<?
if ($very_bad==0) echo "<p class=p><strong>$leng_comment_wr[0]</strong></p>";
else
{
echo "<p class=p><strong>$leng_comment_wr[1]</strong></p><br/>";
}
?>
<p class=p><?=$leng_comment_wr[2];?> <a href="<?=$ref_url?>"><strong><?=$leng_comment_wr[3];?></strong></a><?=$leng_comment_wr[4];?></p></td>
</tr>
</table>
</body>
</html>