$output=t("You cannot send more than %number messages per hour. Please try again later.",array('%number'=>variable_get('contact_hourly_threshold',3)));
$form['contact_information']=array('#value'=>filter_xss_admin(variable_get('contact_form_information',t('You can leave a message using the contact form below.'))));
$form['name']=array('#type'=>'textfield',
'#title'=>t('Your name'),
'#maxlength'=>255,
'#default_value'=>$user->uid?$user->name:'',
'#required'=>TRUE,
);
$form['mail']=array('#type'=>'textfield',
'#title'=>t('Your e-mail address'),
'#maxlength'=>255,
'#default_value'=>$user->uid?$user->mail:'',
'#required'=>TRUE,
);
$form['subject']=array('#type'=>'textfield',
'#title'=>t('Subject'),
'#maxlength'=>255,
'#required'=>TRUE,
);
if(count($categories)>1){
// If there is more than one category available and no default category has been selected,
// We do not allow anonymous users to send themselves a copy
// because it can be abused to spam people.
if($user->uid){
$form['copy']=array('#type'=>'checkbox',
'#title'=>t('Send yourself a copy.'),
);
}
$form['submit']=array('#type'=>'submit',
'#value'=>t('Send e-mail'),
);
}
else{
drupal_set_message(t('The contact form has not been configured. <a href="@add">Add one or more categories</a> to the form.',array('@add'=>url('admin/build/contact/add'))),'error');
watchdog('mail','%name-from sent an e-mail regarding %category.',array('%name-from'=>$values['name']." [$from]",'%category'=>$contact['category']));
drupal_set_message(t('Your message has been sent.'));
// Jump to home page rather than back to contact page to avoid
// contradictory messages if flood control has been activated.
$form_state['redirect']='';
}
/**
*Personalcontactpage.
*/
functioncontact_user_page($account){
global$user;
if(!valid_email_address($user->mail)){
$output=t('You need to provide a valid e-mail address to contact other users. Please update your <a href="@url">user information</a> and try again.',array('@url'=>url("user/$user->uid/edit")));
$output=t('You cannot contact more than %number users per hour. Please try again later.',array('%number'=>variable_get('contact_hourly_threshold',3)));