Файл: public_html/element_mail_read.php
Строк: 144
<?php
require_once './element_options/element_options.php';
if (!$user) { header('Location: /'); exit; }
if (readcache('element_user_mesto'.$user['lost_id']) != 'Почта') writecache('element_user_mesto'.$user['lost_id'], 'Почта');
if (!$id) {
$title = 'Письмо не найдено';
$error1 = '<span class="small">Выбранное Вами письмо не найдено, либо было удалено. Если Вы считаете это ошибкой, обратитесь пожалуйста в <a class="small yellow" href="/support">техническую поддержку</a></span>';
require_once 'element_error_page.php';
exit;
}
$query = mysql_fetch_array(mysql_query("SELECT * FROM `element_mail` WHERE `lost_id` = '$id' LIMIT 1"));
$user_in = cache_user($query['lost_user_in']);
$user_out = cache_user($query['lost_user_out']);
$list_user = $query['lost_user_in'] != $user['lost_id'] ? $query['lost_user_in'] : $query['lost_user_out'];
$list = mysql_query("SELECT `push` FROM `users_contact` WHERE `user`='{$user['lost_id']}' AND `friend`='{$list_user}' LIMIT 1");
if (mysql_num_rows($list))
{
$list = mysql_result($list, 0);
}
if ($_GET['go'] == 'contact' && $list != 'contact')
{
if ($list == 'ignore')
{
mysql_query("UPDATE `users_contact` SET `push`='contact' WHERE `user`='{$user['lost_id']}' AND `friend`='{$list_user}' LIMIT 1");
}
else
{
mysql_query("INSERT INTO `users_contact` (`user`, `friend`, `push`) VALUES ('{$user['lost_id']}', '{$list_user}', 'contact')");
}
header("Location: ?id=".$id);
exit;
}
else if ($_GET['go'] == 'ignore' && $list != 'ignore')
{
if ($list == 'contact')
{
mysql_query("UPDATE `users_contact` SET `push`='ignore' WHERE `user`='{$user['lost_id']}' AND `friend`='{$list_user}' LIMIT 1");
}
else
{
mysql_query("INSERT INTO `users_contact` (`user`, `friend`, `push`) VALUES ('{$user['lost_id']}', '{$list_user}', 'ignore')");
}
header("Location: ?id=".$id);
exit;
}
if (!$query) {
$title = 'Письмо не найдено';
$error1 = '<span class="small">Выбранное Вами письмо не найдено, либо было удалено. Если Вы считаете это ошибкой, обратитесь пожалуйста в <a class="small yellow" href="/support">техническую поддержку</a></span>';
require_once 'element_error_page.php';
exit;
}
if ($query['lost_out'] != $user['lost_id'] AND $query['lost_in'] != $user['lost_id']) {
$title = 'Доступ закрыт';
$error1 = '<span class="small">Вы не можете просматривать эту страницу, потому что администрация ограничила доступ к ней</span>';
require_once 'element_error_page.php';
exit;
}
if ($query['lost_user_in'] == $user['lost_id'] AND $query['lost_new'] > 0 AND $query['lost_money_gold'] == 0) {
require_once './element_function/element_function_mail.php';
$lost_other[2] = $lost_other[2] - 1;
if ($lost_other[2] < 0) $lost_other[2] = 0;
$user['lost_other'] = implode(' ', $lost_other);
writecache('element_users_id_'.$user['lost_id'], $user);
user_list_update($user['lost_id']);
mysql_query("UPDATE `element_mail` SET `lost_new` = '0' WHERE `lost_id` = '$id' LIMIT 1");
$count = Cache_Count_Message($user['lost_id']);
if (!empty($count['new'])) { $count['new'] = $count['new'] - 1;
writecache('element_count_message'.$user['lost_id'], $count); }
}
$title = 'Письмо для "'.$user_in['lost_login'].'"';
require_once './element_include/element_head.php';
require_once './element_include/element_header_user_true.php';
echo '<div class="nfl p5 mb5 mt5 mlra">';
echo '<div class="cntr small"><a class="yellow1" href="/mail">Вернуться в почту!</a></div><br/>';
if (empty($query['lost_system']))
echo '<a class="yellow1 sndr bl" href="/user?id='.$user_out['lost_id'].'">
<span class="small fr pt2 lngreen">'.rdate("d M H:i", $query['lost_time']).'</span>
'.ikonka_user($user_out['lost_race'], ((!empty($online[$user_out['lost_id']])) ? 'online' : 'offline')).' <span class="small">'.$user_out['lost_login'].', '.$user_out['lost_level'].' уровень</span>
</a>';
else
echo '<span class="yellow1 sndr bl">
<span class="small fr pt2 lngreen">'.rdate("d M H:i", $query['lost_time']).'</span>
<span class="small">'.$query['lost_system'].'</span>
</span>';
//Antispam
$query['lost_text'] = str_replace("ti-war","OOOPS",$query['lost_text']);
$query['lost_text'] = str_replace("ru","OOOPS",$query['lost_text']);
$query['lost_text'] = str_replace("com","OOOPS",$query['lost_text']);
$query['lost_text'] = str_replace("mobi","OOOPS",$query['lost_text']);
//Antispam
echo '<span class="small">'.nl2br(Color_Privilege($user_out['lost_privilege'], $query['lost_text'])).'</span>';
echo (empty($query['lost_system']) or $list != 'ignore') ? '<br/>
<form class="cntr" method="post" action="/mail/create?id='.(($query['lost_user_in'] == $user['lost_id']) ? $query['lost_user_out'] : $query['lost_user_in']).'&go=add">
<span class="small white">Сообщение</span><br/>
<textarea class="w90 mb5 fdark" rows="5" name="text"></textarea><br/>
<span class="btn w40"><span class="el">
<span class="er"><input class="ttl" type="submit" name="submit" value="Ответить"/>
</span></span>
</span>
</form>' : '';
echo '</div>';
echo '<div class="nfl p5 mb5 mt5 mlra">';
if ($user_out['lost_id'] != $user['lost_id'])
{
echo '<div class="cntr small"><a class="yellow1" href="/transfer_item.php?user='.$user_out['lost_id'].'">Передать вещи</a></div>';
}
if ($list != 'contact')
{
echo '<div class="cntr small"><a class="yellow1" href="?go=contact&id='.$_GET['id'].'">В контакт лист</a></div>';
}
if ($list != 'ignore')
{
echo '<div class="cntr small"><a class="yellow1" href="?go=ignore&id='.$_GET['id'].'">В игнор лист</a></div>';
}
echo '</div>';
require_once './element_include/element_foot_user_true.php';
?>