Вход Регистрация
Файл: public_html/element_mail_create.php
Строк: 128
<?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;
    }

    
$ban mysql_result(mysql_query("SELECT COUNT(`lost_id`) FROM `element_ban_list` WHERE `lost_user` = '".$user['lost_id']."' AND `lost_time_ban` > '".time()."'"), 0);
    if(
$ban >= 1){
        
$title 'Доступ закрыт';
        
$error1 '<span class="small">Вы не можете отправлять сообщения, т.к провинились и получили молчанку</span>';
        require_once 
'element_error_page.php';
        exit;

    }
    if (
$id == $user['lost_id']) {
        
$title 'Доступ закрыт';
        
$error1 '<span class="small">Вы не можете отправлять сообщения самому себе</span>';
        require_once 
'element_error_page.php';
        exit;
    }
    if (
$user['lost_level'] <3) {
        
$title 'Доступ закрыт';
        
$error1 '<span class="small">Почту можно отправлять только с 3-его ур.</span>';
        require_once 
'element_error_page.php';
        exit;
    }
    
$profile_user cache_user($id);

    
$list mysql_query("SELECT `push` FROM `users_contact` WHERE `friend`='{$user['lost_id']}' AND `user`='{$profile_user['lost_id']}' LIMIT 1");
    if (
mysql_num_rows($list))
    {
        
$list mysql_result($list0);
    }
    if (
$list == 'ignore')
    {
        
$title 'Вы в игноре';
        
$error1 '<span class="small">Выбранный Вами персонаж добавил Вас в игнор-лист, если вы считаете это ошибкой, обратитесь пожалуйста в <a class="small yellow" href="/support">техническую поддержку</a></span>';
        require_once 
'element_error_page.php';
        exit;
    }

    if (!
$profile_user) {
        
$title 'Персонаж не найден';
        
$error1 '<span class="small">Выбранный Вами персонаж не существует, либо был удален, если вы считаете это ошибкой, обратитесь пожалуйста в <a class="small yellow" href="/support">техническую поддержку</a></span>';
        require_once 
'element_error_page.php';
        exit;
    }

    
$title 'Письмо для "'.$profile_user['lost_login'].'"';
    require_once 
'./element_include/element_head.php';
    require_once 
'./element_include/element_header_user_true.php';

        if (
$go == 'add') {
            
$text = (isset($_POST['text']) AND !empty($_POST['text'])) ? mysql_real_escape_string(htmlspecialchars(addslashes(trim($_POST['text'])))) : false;

            if (!
$text$error 'Поле 'сообщение' обязательно для ввода';
            if (
$user['lost_resourse_cristalls'] < 1$error 'Недостаточно кристаллов';

            if (!isset(
$error)) {
                require_once 
'./element_function/element_function_mail.php';
                
$sub_text mb_substr($text,0,20,"UTF-8");
                
$sub_text = (mb_strlen($sub_text,"UTF-8") >= 20) ? $sub_text.'...' $sub_text;
                
$profile_other explode(' '$profile_user['lost_other']);
                if (
$profile_other[2] < 0$profile_other[2] = 0;
                
$profile_other[2] = $profile_other[2] + 1;
                
$profile_user['lost_other'] = implode(' '$profile_other);
                
writecache('element_users_id_'.$id$profile_user);
                
user_list_update($id);
                
update_money_exp($user0, -100);

                
mysql_query("INSERT INTO `element_mail` SET `lost_out` = '$user[lost_id]',
                                                            `lost_in` = '
$id',
                                                            `lost_sub_text` = '
$sub_text',
                                                            `lost_text` = '
$text',
                                                            `lost_user_out` = '
$user[lost_id]',
                                                            `lost_user_in` = '
$id',
                                                            `lost_time` = '"
.time()."',
                                                            `lost_new` = '1'"
);
                
$count_out Cache_Count_Message($user['lost_id']);
                
$count_in Cache_Count_Message($id);

                    if (!empty(
$count_out['all'])) $count_out['all']++;
                    if (!empty(
$count_out['out'])) $count_out['out']++;
                    
writecache('element_count_message'.$user['lost_id'], $count_out);

                    if (!empty(
$count_in['all'])) $count_in['all']++;
                    if (!empty(
$count_in['in'])) $count_in['in']++;
                    if (!empty(
$count_in['new'])) $count_in['new']++;
                    
writecache('element_count_message'.$id$count_in);

                
header('Location: /mail');
                exit;
            } else echo 
'<div class="error cntr p5 mb5"><span class="red">'.$error.'</span></div>';
        }

    echo 
'<div class="nfl cntr p5 mb5 mt5 mlra">';
    echo 
'
    <form method="post" action="/mail/create?id='
.$id.'&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 
'<br/><span class="yellow1">Стоимость отправки почты <img src="/images/icons/cristall.png">1</span>';
    echo 
'</div>';
        echo 
'<div class="nfl p5 mb5 mt5 mlra">';
    
        echo 
'<div class="cntr small"><a class="yellow1" href="/transfer_item.php?user='.$id.'">Передать вещи</a></div></div>';

    
    
    require_once 
'./element_include/element_foot_user_true.php';
?>
Онлайн: 2
Реклама