Вход Регистрация
Файл: personal_mail.php
Строк: 68
<?php

include_once("settings.php");
include_once(
"game_header.php");
include_once(
"personal_msg.php");


if(!isset(
$_REQUEST["mode"])){
    
$mode="";
}else{
    
$mode $_REQUEST["mode"];
}


$personal_msg = new CPlayerPersonalMsg($db,$vnum);

if(
$mode=='send'){
        
$new_mode="";
        
$info_msg="";
        
//check send method
        
if($REQUEST_METHOD!="POST"
        {
            
header("Location: personal_mail.php");
            exit();
        }
        
        
//get values
        
$mailto=getHttpVar('mailto');
        
$subject=getHttpVar('subject');
        
$msg=getHttpVar('msg');
        
        
$mailto=substr($mailto,0,15);
        
$subject=substr($subject,0,50);
        
$msg=substr($msg,0,500);
        
        
//check values
        
$to_player_id $player->checkPlayerName($mailto);
        
        if(
$to_player_id==false){
            
$info_msg="фБЛПЗП ЙЗТПЛБ ОЕ УХЭЕУФЧХЕФ";
        }else{
            if(
strlen($subject)==|| strlen($msg)==){
                
$info_msg="чЩ ДПМЦОЩ ЧЩЧЕУФЙ ФЕНХ Й ФЕЛУФ УППВЭЕОЙС";
            }
        }
        
        if(
$info_msg==""){
            
//send personal mail
            
$personal_msg->sendMail($to_player_id,$subject,$msg);
        }else{
            
$new_mode="new";
        }
        
        
session_register("info_msg");
        
header("Location: personal_mail.php?mode=$new_mode");
        exit;
}

if(isset(
$info_msg))
{
    
$smarty->assign('INFO_MSG',$info_msg);
    
session_unregister("info_msg");
}

if(
$mode=="new"){
    
    if(isset(
$_REQUEST['vnum_msg'])){
        
$msg=$personal_msg->getMailFrom($_REQUEST['vnum_msg']);
        
$smarty->assign("MAILTO",$msg["name"]);
        
$smarty->assign("SUBJECT","Re: ".$msg["caption"]);
    }
    
    
$mail_txt=$smarty->fetch($templ_path.'/personal_mail_new.tpl');
    
$smarty->assign('MAIN',$mail_txt);
    echo(
$smarty->fetch($templ_path.'/game.tpl'));
    exit();
}

if(
$mode=="view"){
    
    
$msg $personal_msg->getMailTo($vnum_msg);
    
$msg['pdate']=getDatesYearTime($msg['pdate']);
    
$smarty->assign_by_ref("msg",$msg);
    
    
$mail_txt=$smarty->fetch($templ_path.'/personal_mail_view.tpl');
    
$smarty->assign('MAIN',$mail_txt);
    echo(
$smarty->fetch($templ_path.'/game.tpl'));
    exit();
}

if(
$mode=="read"){
    
    
$msg $personal_msg->getMailFrom($vnum_msg);
    
$msg['pdate']=getDatesYearTime($msg['pdate']);
    
$smarty->assign_by_ref("msg",$msg);
    
    
$mail_txt=$smarty->fetch($templ_path.'/personal_mail_read.tpl');
    
$smarty->assign('MAIN',$mail_txt);
    echo(
$smarty->fetch($templ_path.'/game.tpl'));
    exit();
}


$list_from $personal_msg->getListFrom();

foreach (
$list_from as $v){
    
$v['pdate']=getDatesYearTime($v['pdate']);
    
$smarty->append("list_from",$v);
}


$list_to $personal_msg->getListTo();

foreach (
$list_to as $v){
    
$v['pdate']=getDatesYearTime($v['pdate']);
    
$smarty->append("list_to",$v);
}



$mail_txt=$smarty->fetch($templ_path.'/personal_mail.tpl');

$smarty->assign('MAIN',$mail_txt);

echo(
$smarty->fetch($templ_path.'/game.tpl'));

?>
Онлайн: 0
Реклама