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

    //Template Vars
    $USER_NOT_FOUND = lang("usernotfound");
    $hide_blocks[] = "USER_NOMESS";
    $hide_blocks[] = "CONTACT_FORM";

  } elseif (!$this_user->usermail) {
    
    //Template Vars
    $USER_NOMESS = lang("notification_dis_long");
    $hide_blocks[] = "USER_NOTFOUND";
    $hide_blocks[] = "CONTACT_FORM";
  
  } 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;
    
    $hide_blocks[] = "USER_NOTFOUND";
    $hide_blocks[] = "USER_NOMESS";

  }
  
  
        /************
         * initiate template and assign variables
         ************/ 
                  
        $tpl->load_file("sendmail", "$template_path/sendmail.html");
        if ($hide_blocks) $tpl->parse_hide('sendmail', $hide_blocks);
        $content .= $tpl->pget('sendmail', array('CONF_MAINSCRIPT', 'CONF_RELPATH', 'CONF_LANG', 'CONF_TEMPLATE_PATH', 'CONF_FORUMTITLE',
          'USER_NOT_FOUND', 'USER_NOMESS', 'FORM_HEADLINE', 'DESCR_RCPT', 'DESCR_SUBJECT', 'DESCR_MESSAGE', 'DESCR_MESSAGEINFOS', 'DESCR_SUBMIT',
          'USER_ID', 'USER_NAME', 'USER_CLASS', 'FORM_VAL_SUBJECT', 'FORM_VAL_MESSAGE'
          ));
  
  
?>