<?php

//-----Создаем титл страницы-----//
require_once ('../system/function.php');
require_once ('../system/header.php');
$id = abs(intval($_GET['id']));
$photo = mysql_fetch_assoc(mysql_query("SELECT * FROM `stena` WHERE `id` = '".$id."'"));
$reit_a = mysql_fetch_array(mysql_query('select * from `status_r` where `news` = '.$id.' and `kto` = "'.$user['id'].'"'));
$ank = mysql_fetch_array(mysql_query('select * from `users` where `id` = "'.$photo['avtor'].'"'));
if($user['id'] != $photo['avtor'] && $reit_a == 0) {
mysql_query("INSERT INTO `status_r` SET `news` = '".$id."', `kto` = '".$user['id']."', `r` = '1' ");

mysql_query("INSERT INTO `lenta` SET `readlen` = '0', `time` = '".time()."', `komy` = '".$photo['avtor']."', `kto` = '".$user['id']."', `text` = 'оценил вашу новост на [url=".$HOME."/stena/".$ank['login']."?selection=top]стене[/url]'");
header('Location: '.$HOME.'/user/komm.php?id='.$id.'');
}
//-----Подключаем низ-----//

?>