<?php
  $uid = intval($_REQUEST["uid"]);
  $this_user = forum_user($uid);
  
  
  if (!$this_user) {

    /************
     * initiate template and assign variables
     ************/         
    $QuickSkin = new QuickSkin("status_messages.html");
    $QuickSkin->assign("INFO",lang("usernotfound"));
    $content .= $QuickSkin->result();
    unset($QuickSkin);


  } elseif (!$this_user->usermail) {

    /************
     * initiate template and assign variables
     ************/         
    $QuickSkin = new QuickSkin("status_messages.html");
    $QuickSkin->assign("INFO",lang("notification_dis_long"));
    $content .= $QuickSkin->result();
    unset($QuickSkin);
      
  } else {
    
    //Template Vars
    $USER_ID = $uid;
    $USER_NAME = $this_user->user;
    $USER_CLASS = nick_class($this_user->is_admin, $this_user->is_mod);
    
    $FORM_HEADLINE = sprintf(lang("send_mail_to"), $this_user->user);
    $DESCR_RCPT = lang("rcpt");
    $DESCR_SUBJECT = lang("subject");
    $DESCR_MESSAGE = lang("your_message");
    $DESCR_MESSAGEINFOS = lang("messageinfo");
    $DESCR_SUBMIT = lang("send_message");
    
    $FORM_VAL_SUBJECT = $subject;
    $FORM_VAL_MESSAGE = $message;
     

    /************
     * initiate template and assign variables
     ************/ 
    $sendmailVARS = array('FORM_HEADLINE' => $FORM_HEADLINE,
                          'DESCR_RCPT' => $DESCR_RCPT,
                          'DESCR_SUBJECT' => $DESCR_SUBJECT,
                          'DESCR_MESSAGE' => $DESCR_MESSAGE,
                          'DESCR_MESSAGEINFOS' => $DESCR_MESSAGEINFOS,
                          'DESCR_SUBMIT' => $DESCR_SUBMIT,
                          'USER_ID' => $USER_ID,
                          'USER_NAME' => $USER_NAME,
                          'USER_CLASS' => $USER_CLASS,
                          'FORM_VAL_SUBJECT' => $FORM_VAL_SUBJECT,
                          'FORM_VAL_MESSAGE' => $FORM_VAL_MESSAGE,

                          'CONF' => $GLOBAL_TEMPLATE_VARS,
                          'FLAGS' => $TEMPLATE_FLAGS
    );
    $QuickSkin = new QuickSkin("sendmail.html");
    $QuickSkin->assign($sendmailVARS);
    $content .= $QuickSkin->result();
    unset($QuickSkin);
  
  }
  
?>