$TAB = chr(9);
$CR = chr(13) . chr(10);
$BR = chr(27);
if ( isset($email) )
SetCookie("cook_email","$email", time() + 20000000);
if ( isset($nick) )
SetCookie("cook_nick","$nick", time() + 20000000);
// $to - reply_file, файл с результатами отзывов
if ( isset($to) && file_exists($to) ) {
$contents = explode( $BR , implode(file($to), ""));
$levels = explode( $TAB, $contents[2] );
if ( isset($level) && !isset(${ "cook_$to" }) && !isset($look) ) {
SetCookie("cook_$to",":-)", time() + 30000000);
$levels[$level]++;
$levels[0]++;
$contents[2] = implode( $levels, $TAB );
$rewrite = TRUE;
}
if (isset($comment) && ($comment != "") && !isset($look)) {
if (!isset( $nick)) $nick = "Аноним";
if (!isset( $email))
$signature = "$nick";
else
$signature = "$nick";
$contents[3] = "$comment
$signature " . date("d.m.y") . "
" . $contents[3]; $rewrite = TRUE; } if (isset($rewrite)) { $fp = fopen( $to,"w"); fwrite($fp, implode( $contents, $BR ) ); fclose($fp); } include("autopilot.h"); // Строим html-файл с результатами $question = $contents[0]; $answers = explode( $TAB, $contents[1] ); $content = implode( file("$htmlates_dir/header.reply.htm"), "" ) . "
| ";
if ( !($levels[0]) )
$stat = "Нет данных ";
else
for ($i=0; $i < count ( $answers ); $i++ ) {
$procent = ceil($levels[$i + 1] / $levels[0] * 100);
$stat .= $answers[$i] . ":
" . $stat . "Проголосовавших читателей: $levels[0] |
![]()
| " . $contents[3] . " " . "Назад к статье \"$contents[4]\"" . " |